SitePoint Sponsor

User Tag List

Results 1 to 15 of 15
  1. #1
    SitePoint Zealot
    Join Date
    Feb 2000
    Location
    xyz
    Posts
    158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    JavaScript not working with vBulletin?

    I want to have text ads on my forum similar to the ones on sitepointforums. I'm using the same script: http://javascriptkit.com/script/scri...mcontent.shtml I've placed the code into the header template, but nothing shows up. It does in fact appear in the source code when I check it, but no output gets printed. What am I doing wrong?

  2. #2
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,121
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    For one, it isn't the same script. SitePoint uses a customized version of PhpAds to accomplish their advertising, you may want to look at it
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  3. #3
    SitePoint Zealot
    Join Date
    Feb 2000
    Location
    xyz
    Posts
    158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, I'm going to install something like that at some point, but what I'm referring to is the simple JavaScript thingie that SitePoint has on the forum index page.

  4. #4
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I think Maximar means the simple text ads in the footer which use a very similar if not identical javascript for their rotation.

    To answer your question, not sure why it isn't showing up. Maybe if you pasted your header template, we could help more.
    Wayne Luke
    ------------


  5. #5
    SitePoint Zealot
    Join Date
    Feb 2000
    Location
    xyz
    Posts
    158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, that's the one. Just a couple of affiliate links, we don't need anything fancy right now. Thanks for helping out.

    Here is a copy of my header template:

    Code:
    <!-- logo and buttons -->
    <center>
    <table border="0" width="{tablewidth}" cellpadding="0" cellspacing="0">
    <tr>
      <td valign="top" align="left" background="{imagesfolder}/menu_background.gif"><a href="http://www.adventuregamers.com/"><img src="{titleimage}" border="0" alt="$bbtitle"></a></td>
      <td valign="bottom" align="right" nowrap background="{imagesfolder}/menu_background.gif">
       <!-- toplinks -->
       <a href="usercp.php?s=$session[sessionhash]"><img src="{imagesfolder}/top_profile.gif" alt="Here you can view your subscribed threads, work with private messages and edit your profile and preferences" border="0"></a>
       <a href="register.php?s=$session[sessionhash]&action=signup"><img src="{imagesfolder}/top_register.gif" alt="Registration is free!" border="0"></a>
       <a href="calendar.php?s=$session[sessionhash]"><img src="{imagesfolder}/top_calendar.gif" alt="Calendar" border="0"></a>
       <a href="memberlist.php?s=$session[sessionhash]"><img src="{imagesfolder}/top_members.gif" alt="Find other members" border="0"></a>
       <a href="misc.php?s=$session[sessionhash]&action=faq"><img src="{imagesfolder}/top_faq.gif" alt="Frequently Asked Questions" border="0"></a>
       <a href="search.php?s=$session[sessionhash]"><img src="{imagesfolder}/top_search.gif" alt="Search" border="0"></a>
       <a href="index.php?s=$session[sessionhash]"><img src="{imagesfolder}/top_home.gif" alt="Home" border="0"></a>
       <!-- <a href="member.php?s=$session[sessionhash]&action=logout"><img src="{imagesfolder}/top_logout.gif" alt="Logout" border="0"></a>  -->
       &nbsp;
       <!-- /toplinks -->
      </td>
    </tr>
    </table>
    <!-- /logo and buttons -->
    
    <!-- content table -->
    <table bgcolor="{pagebgcolor}" width="{tablewidth}" cellpadding="10" cellspacing="0" border="0">
    <tr>
      <td>
    <script language="Javascript1.1" type="text/javascript">
    <!--
    var topads=new Array()
    topads[0]='<a href="http://www.chipsbits.com/cgi-bin/order.cbi_home?source=83426&add=WATC.IR">Pre-order your copy of The Watchmaker today.</a>';
    topads[1]='<a href="http://www.cdmag.com/cgi-bin/order.cbi_home?source=83426&page=catalogs/home.html&newpage=infopages/SYBE.IR.html">Can't wait to play Syberia? Be the first and pre-order it online.</a>';
    topads[2]='<a href="http://www.chipsbits.com/cgi-bin/order.cbi_home?source=83426&newpage=infopages/SOLDF2.IR.html">Soldier of Fortune 2: selling now at Chips&Bits</a>';
    //topads[3]='nothing';
    //topads[4]='here';
    //topads[5]='yet';
    //topads[6]='blah';
    var whichad=Math.floor(Math.random()*(topads.length));
    document.write("<div align=\"center\" style=\"font-size:14px;font-weight:bold;color:navy\">"+topads[whichad]+"</div>");
    //-->
    </script>

  6. #6
    SitePoint Wizard silver trophy Jeremy W.'s Avatar
    Join Date
    Jun 2001
    Location
    Toronto, Canada
    Posts
    9,121
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Um... Not that this helps your problem, but why are you linking to SitePoint for your images?
    SVP Marketing, SoCast SRM
    Personal blog: Strategerize
    Twitter: @jeremywright

  7. #7
    SitePoint Zealot
    Join Date
    Feb 2000
    Location
    xyz
    Posts
    158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    *scratches head*

    What the heck is that?? I assure you, it doesn't say Sitepoint anywhere in my header template.

    Hmmm, I think the forum processed the { imagesfolder } tag.

    I love Sitepoint but not so much that I'd steal your bandwidth

  8. #8
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    It does process the replacements....

    Anyway, you have an error on line 91 where it says it needs a semi-colon.

    Actually, I think it is line 89. So put a semi-colon after this line:

    Code:
    var topads=new Array()
    Wayne Luke
    ------------


  9. #9
    SitePoint Zealot
    Join Date
    Feb 2000
    Location
    xyz
    Posts
    158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That doesn't do the trick, as you can see here: http://www.adventuregamers.com/forums/


    hmmmm

  10. #10
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I see where your problem is...

    Replace
    Code:
    topads[1]='<a href="http://www.cdmag.com/cgi-bin/order.cbi_home?source=83426&page=catalogs/home.html&newpage=infopages/SYBE.IR.html">Can't wait to play Syberia? Be the first and pre-order it online.</a>';
    with
    Code:
    topads[1]='<a href="http://www.cdmag.com/cgi-bin/order.cbi_home?source=83426&page=catalogs/home.html&newpage=infopages/SYBE.IR.html">Can\'t wait to play Syberia? Be the first and pre-order it online.</a>';
    Wayne Luke
    ------------


  11. #11
    SitePoint Zealot
    Join Date
    Feb 2000
    Location
    xyz
    Posts
    158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I... don't see a difference?

  12. #12
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    hmmm.. it removed a slash..

    The word Can't should be Can\'t
    Wayne Luke
    ------------


  13. #13
    SitePoint Zealot
    Join Date
    Feb 2000
    Location
    xyz
    Posts
    158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Doh!

    I am not a programmer so this always happens to me

    Thanks!!

  14. #14
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    When putting something in quotes it must end with the same type of quote, because you have 3 quotes it wil try to eascape the sentence and continue executing the javascript. So it gets an error when it reads the next section as it expects ); instead of the rest of your sentence. The backslash escapes the character so it can continue.

    hope that clears it up a bit for you.

  15. #15
    SitePoint Zealot
    Join Date
    Feb 2000
    Location
    xyz
    Posts
    158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It does. Thanks everyone!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •