Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 12-17-2005, 02:57 AM
bitbender's Avatar
bitbender bitbender is offline
 
Join Date: Jan 2002
Location: Sorta near Dallas, Texas
Posts: 166
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Need help with fader.js invocation

Hello,

I am trying to rework the newfader hack from vb 2.3.0 to work in vb 3.5.

I got the primary code working ok to extract the announcements, newest member, and the latest 10 threads. I can see it in the dump of the generated HTML.

The Ouchie I am experiencing is that the fader.js definition is being blanked out from the <SCRIPT command I am placing in the forumhome template.

For example, the original install required that the following code be added;
Code:
<SCRIPT LANGUAGE='JavaScript1.2' TYPE='text/javascript'>
prefix="";
arNews = [
$newsfadebits
]
</SCRIPT>
<script LANGUAGE='JavaScript1.2' type="text/javascript" src='fader.js'></script>
(Note the bold line addresses a java script called fader.js )

right after $headinclude line in the forumhome template. Ok, fine.. Done!

However, what I get as output code is;
Code:
<SCRIPT LANGUAGE='JavaScript1.2' TYPE='text/javascript'>
prefix="";
arNews = [
.........
...........
.......(the actual DB extracts and HTML wraps)
..........
]
</SCRIPT>
<script LANGUAGE='JavaScript1.2' type="text/javascript" src=""></script>
(notice the bold line above now has the java src= file name blanked out!)

Is there some thing I am missing ? Or is there some new way I need to quantify the java script as OK for vbulletin to actually run it? Or have I made a typical n00b error, and I am getting my script name blanked out on purpose?

I have also added the following to forums/index.php after the setting for $today to generate the lines that will show thru the fader;
Code:
// Hack newsfade
  $newsfadebits = "\"<b><i>Welcome to Bitbender Forums, Where Members RULE</b></i>\",\"\",\n";
  $newsfades=$vbulletin->db->query_read("SELECT title,pagetext FROM announcement
 WHERE enddate>=$today AND forumid=0 ORDER BY startdate DESC");
  while ($newsfade=$vbulletin->db->fetch_array($newsfades)) {
    $newsfadebits.="\"".addslashes($newsfade[pagetext])."\",\"$newsfade[title]\",\n";
  }
  $ammount = 10;
  $postnr = 0;
  global $excatforums;
  $exclude_array = explode(",",$excatforums);
  $newsfadebits.="\"<font size=2 color=green><b>Please welcome our latest member: $newusername</b></font>\",\"member.php?s=&action=getinfo&userid=$newuserid\",\n\"<font size=2 color=green><b>Next up in the fader: The latest $ammount Posts!
Click on the fader message to view</b></font>\",\"\",\n";
  $newsfades=$vbulletin->db->query_read("SELECT threadid, title, postusername, forumid FROM
 thread ORDER BY threadid DESC LIMIT $ammount");
  while ($newsfade=$vbulletin->db->fetch_array($newsfades)) {
   if (in_array($newsfade["forumid"],$exclude_array)) {
      continue;
   } else {
   $postnr++;
   $threadid = $newsfade["threadid"];
   $thetitle = $newsfade["title"];
   $amountchr = count_chars($thetitle);
   if ($amountchr >= 35) {+
     $thetitle = substr($thetitle,0,35);
     $thetitle .= '...';
   }
   $postusername = $newsfade["postusername"];
   $content = '"' . $thetitle . '" by ' . $postusername;
    $newsfadebits.="\"<font style=verdanna size=1 color=crimson><b>Latest post #$postnr is ".addslashes($content)."</b></font>\",\"showthread.php?s=&threadid=$threadid\",\n"; }
  }
  $newsfadebits = substr($newsfadebits,0,-2);
  // End Hack newsfade
Also added the table entry in the forumhome template that draws the fader box, and it shows up on the rendered page. The fader.js script bundles up the lines into a arrray called elFader, which is then included in the output block;
Code:
<!-- Fader Hack STart --> 
<table bgcolor="#FFFFFF" cellpadding="4" cellspacing="1" width="100%" border="0"> 
<TR bgcolor="#6C6081" id=cat align=center><TD colspan=6>
<normalfont color="#F5D300"><B>What's Hot on the Forum??</b></normalfont></td> 
</tr> 
<tr><td colspan=6 bgcolor="#f7f7f7" height=30 valign="top" align="center"> 
<div id="elFader" style="position:relative;visibility:hidden;width:500"><div align="center">Forumnews</div></div> 
</td></tr> 
<table bgcolor="#FFFFFF" cellpadding="4" cellspacing="1" width="100%" border="0"> 
<tr align="center"> 
<!-- fader Hack End -->
It is retrieving data from the Data base ok, as I save the rendered page as html, and then I can see the announcements, newest member, and last 10 threads in the source HTML when edited by DreamScreamer. On the rendered page, the fader box appears as normal, but nothing scrolls thru. I am thinking that it is because the script name(fader.js) is getting blanked out by something.


TIA for any advice, this really used to work nice on my 2.3.0 version. I cannot afford all the cheese that I need to have to deal with the whine of my users for it not being there any more

Bits
Reply With Quote
 


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 03:14 AM.


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.03086 seconds
  • Memory Usage 2,264KB
  • Queries Executed 12 (?)
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
  • (4)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)showthread_list
  • (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_threadedmode.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • 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_threaded
  • showthread_threaded_construct_link
  • 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