Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
Another Javascript VBA CMPS Banner Rotation Solution Details »»
Another Javascript VBA CMPS Banner Rotation Solution
Version: 1.00, by Quarterbore Quarterbore is offline
Developer Last Online: Aug 2020 Show Printable Version Email this Page

Version: 3.5.2 Rating:
Released: 03-28-2006 Last Update: Never Installs: 1
Additional Files Is in Beta Stage  
No support by the author.

I have been fighting with a number of the various Javascript based banner rotations on the board and I seemed to keep having problems. My solution was to stubbornly give up and turn to our friends at Google.com. A quick google search uncovered this little script so the author of this page deserves credit for making this work:

http://www.yugdesign.com/demo/Ad-Simple/index.html

With the script above, I simply set out to create a module for my website that would allow me to present a random book with an amazon affiliate link.

Step 1: Create the PHP File, save in /forums/modules/books.pdf

PHP Code:
<tr><td><table bgcolor="white" width=100%><tr><td><center>
<
SCRIPT language=JavaScript>
/*
 +---------------------------------------------------------+
 | Ad Simple                 Copyright [url]www.YugDesign.com[/url]   |
 +---------------------------------------------------------+
 | This program may be used and hosted free of charge by   |
 |anyone for personal purpose as long as this copyright    |
 |notice remains intact.                                   |
 +---------------------------------------------------------+
*/

var img_width "150";
var 
img_height "230";
var 
img_title "Click Here";


var 
ad=new Array()
//insert here your images src
ad[0]='http://www.mydomain.com/books/book1.jpg'
ad[1]='http://www.mydomain.com/books/book2.jpg';
ad[2]='http://www.mydomain.com/books/book3.jpg'
ad[3]='http://www.mydomain.com/books/book4.jpg';  
ad[4]='http://www.mydomain.com/books/book5.jpg'
ad[5]='http://www.mydomain.com/books/book6.jpg';

var 
links=new Array()
//insert here your links
links[0]='http://www.amazon.com/affiliate_link_1; 
links[1]='
http://www.amazon.com/affiliate_link_2; 
links[2]='http://www.amazon.com/affiliate_link_3; 
links[3]='
http://www.amazon.com/affiliate_link_4; 
links[4]='http://www.amazon.com/affiliate_link_5; 
links[5]='
http://www.amazon.com/affiliate_link_6; 

var xy=Math.floor(Math.random()*ad.length);
document.write('<a href="'+links[xy]+'" target="_blank"><img src="'+ad[xy]+'" width="'+img_width+'" height="'+img_height+'" alt="'+img_title+'"></a>');
</
SCRIPT>
</
center></td></tr></table></td></tr
Then, create a new CMPS Module:

>>Add Module >> PHP File

Module Title: Related Books
File to Include: books.php
Identifier: books
Clean File Output: yes
Use Module Shell Template: Yes

Other notes: I upload photos of the books that I feature to my server as it is more reliable for me and it allows me to resize images to about the size that this script requires. This code could be used in many other ways.

You can see this running on my website at:

http://www.timeshareforums.com

Edits:

29-Mar-2006: Changed Title from Java to Javascript

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 03-29-2006, 01:08 AM
COBRAws's Avatar
COBRAws COBRAws is offline
 
Join Date: Oct 2002
Location: Buenos Aires
Posts: 864
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

this is Javascript not java. Confusion is being made by the tittle given.

Congrats by the way.
Reply With Quote
  #3  
Old 08-29-2006, 11:19 PM
kofoid kofoid is offline
 
Join Date: Dec 2005
Location: Colorado
Posts: 291
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think I may just have to give this a shot! Thanks!
Reply With Quote
  #4  
Old 02-05-2009, 01:05 PM
Trimos Trimos is offline
 
Join Date: Feb 2009
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just out of curiosity, what were the problems with the various ad rotation softwares ? Reason I ask is I'm using AdPeeps and like it except it seems to be causing the curious issue of logging out members when they don't want to be logged out.
Reply With Quote
  #5  
Old 02-05-2009, 01:15 PM
lorddomain lorddomain is offline
 
Join Date: Feb 2006
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great! Thanks for this
Reply With Quote
  #6  
Old 12-05-2009, 04:01 PM
srilions srilions is offline
 
Join Date: Feb 2009
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<font color="DarkRed">can I use for this 3.8.4 ???????????????????????</font>
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:54 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07775 seconds
  • Memory Usage 2,257KB
  • Queries Executed 19 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (5)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete