vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   call a random advertisement (https://vborg.vbsupport.ru/showthread.php?t=195252)

Winterworks 11-02-2008 01:45 PM

call a random advertisement
 
I have an advertisement part in my site. This is the code (added in FORUMHOME at the bottom)

Code:

<!-- Trasion Advertisements -->
<tbody>
<tr>
<td class="thead" colspan="2">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_stats')"><img id="Advertisement" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_stats].gif" alt="" border="0" /></a>
<phrase 1="$vboptions[bbtitle]">Trasion Advertisements</phrase>
</td>
</tr>
</tbody>
<tbody id="collapseobj_forumhome_stats" style="$vbcollapse[collapseobj_forumhome_stats]">
<tr>
<td class="alt2"><img src="$stylevar[imgdir_misc]/adv.gif" alt="<phrase 1="$vboptions[bbtitle]">$vbphrase[x_statistics]</phrase>" border="0" /></td>
<td class="alt1" width="100%">
 
<p align="center">
 
<img src="http://www.trasion.com/ads/advertisementvbnt.jpg" border="0" />

</center>
<br>
</td>
</tr>
</tbody>
<!-- Trasion Advertisements -->

Where it says "<img src="http://www.trasion.com/ads/advertisementvbnt.jpg" border="0" />"

I don't want just 1 image. I want it so everytime you refresh, the image will randomly be selected from a folder, or something. So it changes everytime you visit the site (but it can rarely repeat).

What is the code to do this? Please add it into my code above and repost :)

Brandon Sheley 11-02-2008 02:07 PM

Why not use a program like OpenX?
it makes it so much easier to manage your ads

Winterworks 11-02-2008 02:08 PM

link me?

Brandon Sheley 11-02-2008 02:12 PM

uh I think it's www.openx.org/
it's a free script and it's really nice IMO
I'm using it for all my sites

cono1717 11-02-2008 02:12 PM

Open X downloadable file (to upload to your server) http://www.openx.org/ad-server/download

Open X hosted (still in beta but just as good) http://www.openx.org/ad-server/get-openx-hosted

Enjoy

Winterworks 11-02-2008 02:15 PM

There was this thread on vb.com I believe about how to do this.. But I completely forget what it was called or where it was. It was just a simple code.

--------------- Added [DATE]1225644277[/DATE] at [TIME]1225644277[/TIME] ---------------

http://www.vbulletin.com/forum/showt...ghlight=random found it


All times are GMT. The time now is 07:46 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.01461 seconds
  • Memory Usage 1,718KB
  • 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
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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