PDA

View Full Version : [RELEASE] Affiliate of The Moment Hack


10-16-2000, 12:50 AM
I created this hack because my forum (http://www.gamedoggy.com) needed to link to other sites, in a sort of "link exchange". I figure this will work for other type of links, like affiliate networks and pay per action networks. Plus you could modify the code as to use images rather easily!

First off, a demo of this hack can be seen @ http://www.gamedoggy.com

Ok, here is how we get it to work!

First off, make a new template called affiliatelist! In it put something like thisAffiliateName|AffiliateURL
AffiliateNumberTwoName|AffiliateNumberTwoURL
GameDoggy.com|http://www.gamedoggy.com
vbulletin.com|http://www.vbulletin.com


Next go into global.php and find if ($useadvfooter==1) {
eval(gettemplate("footer",0));
} else {
eval("\$footer = \"".gettemplate("footer")."\";");
}


below that addsrand ((double) microtime() * 1000000);$affiliate_list = explode("\n",gettemplate("affiliatelist"));
$affiliate_number = rand(0,count($affiliate_list)-1);
$affiliate = explode("|", $affiliate_list[$affiliate_number]);
$affiliate_name = $affiliate['0'];
$affiliate_url = $affiliate['1'];


All you have to do now is put something in fivelinks that looks something like this<br>
Affiliate of The Moment: <a href="$affiliate_url">$affiliate_name</A>


I hope this hack can help someone! If you run a gaming forum and would like to affiliate with gamedoggy.com, please send me a email ( nick4753@nozone.net )

P.S. You can also have email accounts as links, just replace the http://www. with mailto:

10-16-2000, 02:13 PM
Nice clean hack. Thanks.

10-17-2000, 12:17 AM
It'd probably be best to use an additional MySQL table for this hack, since parsing a text field sort of works against the database orientation of vB. It'll work, and admittingly, I did take a similar shortcut with my Buddy List, but if I had to do it again, I would do it with a new table... :-)

10-17-2000, 01:12 AM
I would agree that a table would be "better," but if you have a look at how all the options are stored in the template table, parsing text fields is right in line with the current design! :-)

10-17-2000, 12:51 PM
The current design is much faster than having a table for each affiliate.. My idea was to make something very simple, without taking up resources..

10-17-2000, 06:15 PM
Not a table for each affiliate, but an affiliates table with seperate entries for each affiliate. This would be faster (in theory, not noticably though :) since you'd be pulling a varchar field instead of a text field, and you'd eliminate the PHP-parsing end of things.

eva2000
05-25-2001, 01:54 PM
wonder if this still works for vB 2.0 final ?