vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   [RELEASE] Affiliate of The Moment Hack (https://vborg.vbsupport.ru/showthread.php?t=3930)

10-15-2000 11:50 PM

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")."\";");
}

below that add
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'];

All you have to do now is put something in fivelinks that looks something like this
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:

10-16-2000 01:13 PM

Nice clean hack. Thanks.

10-16-2000 11:17 PM

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 12: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 11:51 AM

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 05: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 12:54 PM

wonder if this still works for vB 2.0 final ?


All times are GMT. The time now is 03:02 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02022 seconds
  • Memory Usage 1,722KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete