The Arcive of vBulletin Modifications Site. |
|
Details »»
|
|||||||||||||||||||||||||
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 this Code:
AffiliateName|AffiliateURL AffiliateNumberTwoName|AffiliateNumberTwoURL GameDoggy.com|http://www.gamedoggy.com vbulletin.com|http://www.vbulletin.com Next go into global.php and find Code:
if ($useadvfooter==1) {
eval(gettemplate("footer",0));
} else {
eval("\$footer = \"".gettemplate("footer")."\";");
}
Code:
srand ((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'];
Code:
<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: Show Your Support
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
|||
|
|||
|
Nice clean hack. Thanks.
|
|
#3
|
|||
|
|||
|
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... :-)
|
|
#4
|
|||
|
|||
|
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! :-)
|
|
#5
|
|||
|
|||
|
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..
|
|
#6
|
|||
|
|||
|
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.
|
|
#7
|
||||
|
||||
|
wonder if this still works for vB 2.0 final ?
|
![]() |
|
|