We’re back with Part 3 of our exclusive series on how to install Gazelle. In this article, we explain how to add a script to anonymize all outgoing links through anonym.to. Also up, we show how to incorporate a ticket system so that beta testers and members can report site bugs and provide feedback. Last - but not least - we explain how to add a global freeleech to the tracker with the ability to enable/disable it through the Gazelle Toolbox utility.
Hello readers. I’m MFSL - here with the third article on gazelle development. Sorry about the delay between [article 2](../../../09/26/article-2-minor-edits-and-small-add-ons/ “Gazelle Article 2: Minor Edits and Small Addons”) and this third installment, I was having some trouble with mySQL and made a bit of a noob mistake. ‘ is NOT the same as `. Thank you ilias for pointing that out to me. The current beta members have requested many features and i am here to deliver a few of them. Lets get started!
Anonym.to added to external links
This was one of the many features requests by are beta members and not only is it very helpful in keeping our site secret but it is also fairly easy to implement. Login with your SFTP client and navigate to / open /site/classes/class_text.php. Replace the urls function with:
function urls($Str) {
$Str =
preg_replace(”/(\A|[^=]‘\”a-zA-Z0-9])((http|ftp|https|ftps|irc):\/\/[^<>\s()]+)/i”,
“\1<a href=’http://www.anonym.to/?\2′
target=’_blank’>\2</a>”, $Str);
$Str = str_replace(”http://www.anonym.to/?http://” . NONSSL_SITE_URL,
“http://” . NONSSL_SITE_URL, $Str);
$Str = str_replace(”http://www.anonym.to/?https://” . SSL_SITE_URL,
“https://” . SSL_SITE_URL, $Str);
// VULNERABLE
// Local site links
$Replace[]=’/(<a
href=[‘”]?)?http(s)?:\/\/www.’.preg_quote(NONSSL_SITE_URL,’/’).’\/?([^<>\s]*)([‘”]>)?/i’;
$Replace[]=’/(<a href=[‘”]?)?http(s)?:\/\/’.preg_quote(NONSSL_SITE_URL,’/’).’\/?([^<>\s]*)([‘”]>)?/i’;
$Replace[]=’/(<a href=[‘”]?)?http(s)?:\/\/’.preg_quote(SSL_SITE_URL,’/’).’\/?([^<>\s]*)([‘”]>)?/i’;
$Str=preg_replace_callback($Replace, array(’TEXT’,’fix_url’),$Str);
return $Str;
}
And it works :).

Leto’s Updated Ticket System
This may be one of the best suggestions we received. Leto did a great job with this. The current ticket system was… lacking, but Leto turned it into something that does its job perfectly. Here is my own mirror of Leto’s guide, it is far to long to post in with this article (letoticketsys.txt - or here). There are some things you should do however. Make sure you backup your site before you do this! One mistake and your in for a world of hurt. Also, don’t try and use PuTTY for file editing here, it’s far to tedious on this scale. Here are some pictures of the Ticket System in action!
Global Freeleech Staff Tool
Yet another feature that Raketa showed me. Lets get this started, everybody likes freeleeches!
First ssh in and login to mysql. Then execute the following code
USE <yourdatabase>
DROP TABLE IF EXISTS mod_core;
CREATE TABLE IF NOT EXISTS mod_core (
mod_option varchar(60) NOT NULL,
mod_setting int(12) NOT NULL default ‘0′,
PRIMARY KEY (mod_option)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO mod_core (mod_option, mod_setting) VALUES
(’global_freeleech’, 0);
ALTER TABLE torrents ADD was_free SET( ‘0′, ‘1′ ) NOT NULL DEFAULT
‘0′
Now that we got sql out of the say the rest is just Copy + Pasting
Open classes/script_start.php
Find:
Add this underneath of it:
Open classes/permissions_form.php
Find:
Add this underneath of it:
Open sections/tools/index.php
Find:
case ‘polls’:
if (!check_perms(’admin_manage_polls’)) { error(’403′); }
if ($_REQUEST[‘id’]) {
$Val->SetFields(’question’,1,’string’,’You did not enter a valid
question for this poll.’);
Add this above:
case ‘freeleech’:
include(’managers/freeleech.php’);
break;
case ‘enable_freeleech’:
enable_freeleech($_POST[‘go_freeleech’]);
header(’Location: tools.php’);
break;
Open sections/tools/tools.php
Find:
Add this underneath:
Create a new php file (sections/tools/managers/freeleech.php)
Add this code to it:
<?
enforce_login();
if(!check_perms(’admin_enable_freeleech’)){ error(403); }
show_header(’Enable Freeleech’);
$DB->query(”SELECT mod_setting FROM mod_core WHERE mod_option =
‘global_freeleech’”);
list ($mod_setting) = $DB->next_record();
if ($mod_setting == ‘1′) {
$enabled = ‘CHECKED’;
} else {
$disabled = ‘CHECKED’;
}
?>
<div class=”thin”>
<h2>Enable Freeleech</h2>
<form action=”tools.php” method=”post”>
<div class=”box pad”>
<input type=”hidden” name=”action” value=”enable_freeleech” />
Enable Freeleech:
<input type=”radio” name=”go_freeleech” value=”1″
<?=$enabled?>>
<br />
Disable Freeleech:
<input type=”radio” name=”go_freeleech” value=”0″
<?=$disabled?>>
<br />
<div class=”center”>
<input type=”submit” value=”Do it” />
</div>
</div>
</form>
</div>
<?
show_footer();
?>
Open sections/upload/upload_handle.php
Find:
Add this underneath:
And that’s all she wrote. Below is a picture of the Tools page and the Freeleech Tool itself.


Oromis Says:
Very nice tutorials
REDiR Says:
http://www.redir.pcinove.com/
Nice one!
Cumpz
Velocityy Says:
Keep up the great work, MFSL. This is useful for many people who want to start a tracker running on Gazelle. Let’s wait for article four to come out.
SomeGuy Says:
Isn’t MFSL also known as apt-get?
Interesting that FSF lets people like him post …
MFSL Says:
I’ll try to get the next article done by friday. I was looking around the code and messed something up in my site though so i have to fix some bugs.
Velocityy Says:
Bugs aren’t nice; you’re fixing them, so that’s pretty good. I’d also like to get an invite code to your tracker, but I can’t seem to find one.
MFSL Says:
VELOCITYY
87.118.92.205/register.php
here are 3 invite codes
2b1p2topw2oec097cfoo1nnb1kc90qz9
9a0f8nk9igbxfnyou93ljoqcvchusbku
0ynldw9j8ogfscrk82k79r78iqb7g1gs
jazzle Says:
lol , me being lame, i tried those invite codes, didnt work lol
Velocityy Says:
Of course those invites are all taken up. The SV Tracker is one of the best looking ones I’ve seen. They already have a lot of useful features on-site, and the forums are very active an friendly. SaveVinyl will certainly become a big hit in music trackers.
Random Guy Says:
>>I was having some trouble with mySQL and made a bit of a noob mistake. ‘ is NOT the same as `. <<
Seems like a very suitable person to write a tutorial on a very complex tracker.
A more “apt” name for this “exclusive series on how to install Gazelle” would be… “an exclusive series on who shouldn’t touch your code”
Random Guy Says:
awe my tag got removed
Speedy Says:
Damn, I really wish there would be some more invite codes
John Gambleputty Says:
Would really be great if some smart guy made a virtual machine with installed customized gazelle so that we dont have to code ourselves but pop many many new trackers. That would rock!
Top Clone and Torrent Tracker Scripts Says:
This is great, I’ve been looking at trying out gazelle on a virtual machine for a while. Thanks for the tuts!
caleb Says:
Your request has been answered, head to http://projectgazelle.wordpress.com/ for an virtual machine with gazelle up and running
Daedy Says:
What does flags=’2′ do?