Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
javascript syndicated content... Details »»
javascript syndicated content...
Version: , by AmericanWoman AmericanWoman is offline
Developer Last Online: Mar 2005 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 08-02-2003 Last Update: Never Installs: 0
 
No support by the author.

I've created a javascript-output content hack, and it was working FANTASTIC until I went nuts with assigning parameters...and now I'm totally baffled and irritated and tired from no sleep.

The code works fine if you serve the page directly:

www.acuraworld.com/forums/js.php

It USED to work fine when called from a < script > tag, like so:

PHP Code:
<script language="javascript" src="http://www.acuraworld.com/forums/js.php"></script
Now the script tag reference doesn't return anything, and I don't get an error.

Yes, I know there are a lot of extra document . write () statements, and I'm not sure where they're surfacing. Here's the page code that creates the javascript:

PHP Code:
// lots of stuff prior to this, but not relevant

if (!isset($GET_VARS['limit']) || $GET_VARS['limit'] =="" || $GET_VARS['limit'] > "20") {
    $limit = "5";
}
if (!isset($GET_VARS['offset']) || $GET_VARS['offset'] =="" || $GET_VARS['offset'] > "24") {
    $offset = "0";
}
if (!isset($GET_VARS['bg']) || $GET_VARS['bg'] =="")    {
    $bg = "FFFFFF";
    }
else    {
    $bg = $GET_VARS['bg'];
    }
if (!isset($GET_VARS['thbg']) || $GET_VARS['thbg'] =="")    {
    $thbg = "FFFFFF";
    }
else    {
    $thbg = $GET_VARS['thbg'];
    }
if (!isset($GET_VARS['border']) || $GET_VARS['border'] =="")    {
    $border = "0";
    }
else    {
    $border = $GET_VARS['border'];
    }
if (!isset($GET_VARS['fcolor']) || $GET_VARS['fcolor'] =="")    {
    $fcolor = "000000";
    }
else    {
    $fcolor = $GET_VARS['fcolor'];
    }
if (!isset($GET_VARS['fsize']) || $GET_VARS['fsize'] == "")    {
    $fsize = "10";
    }
else {
    $fsize = $GET_VARS['fsize'];
    }
if (!isset($GET_VARS['font']) || $GET_VARS['font'] == "")    {
    $font = "Verdana";
    }
else {
    $font = $GET_VARS['font'];
    }
if (!isset($GET_VARS['width']) || $GET_VARS['width'] == "")    {
    $width = "100%";
    }
else    {
    $width = $GET_VARS['width'];
    }
if (!isset($GET_VARS['titlebg']) || $GET_VARS['titlebg'] == "")    {
    $titlebg = "C0C0C0";
    }
else    {
    $titlebg = $GET_VARS['titlebg'];
    }
if (!isset($GET_VARS['tdbg']) || $GET_VARS['tdbg'] == "")    {
    $tdbg = "FFFFFF";
    }
else    {
    $tdbg = $GET_VARS['tdbg'];
    }
if (!isset($GET_VARS['thalign']) || $GET_VARS['thalign'] == "")    {
    $thalign = "left";
    }
else    {
    $thalign = $GET_VARS['thalign'];
    }
if (!isset($GET_VARS['link']) || $GET_VARS['link'] == "")    {
    $link = "left";
    }
else    {
    $link = $GET_VARS['link'];
    }
if (!isset($GET_VARS['vlink']) || $GET_VARS['vlink'] == "")    {
    $vlink = $link;
    }
else    {
    $vlink = $GET_VARS['vlink'];
    }
if (!isset($GET_VARS['titlecolor']) || $GET_VARS['titlecolor'] == "")    {
    $titlecolor = 000000;
    }
else    {
    $titlecolor = $GET_VARS['titlecolor'];
    }
if (!isset($GET_VARS['bcolor']) || $GET_VARS['bcolor'] == "")    {
    $bcolor = 000000;
    }
else    {
    $bcolor = $GET_VARS['bcolor'];
    }
?>

document.write('<table style="font-size:<?php echo "$fsize"?>px; font-family: <?php echo "$font"?>; color: <?php echo "#$fcolor"?>" border="<?php echo "$border"?>" cellpadding="2" cellspacing="0" bordercolor="<?php echo "#$bcolor"?>" bgcolor="<?php echo "#$bg"?>" width="<?php echo "$width"?>">');
document.write('    <tr >');
document.write('        <td  align="<?php echo "$thalign"?>" bgcolor="<?php echo "#$titlebg"?>" style="color: <?php echo "#$titlecolor"?>"><b>Beta - Acuraworld.com News Syndicate!</b></td>');
document.write('    </tr>');

// sql and whatnot here - not relevant

document.write('    <tr >');
document.write('        <td align="<?php echo "$thalign"?>"  bgcolor="<?php echo "#$thbg"?>">');
document.write('<?php echo "<b><a style=\"color: #$link\" href=\"$bburl/showthread.php?threadid=$threadid&amp;goto=newpost\">".htmlspecialchars($title)."</a></b>";?>');
document.write('        </td>');
document.write('    </tr>');
document.write('    <tr >');
document.write('        <td  bgcolor="<?php echo "#$tdbg"?>">');
<?php
  
if ($mode == "lite") {
 
?> 
      document.write('<?php echo "<b>$lastposter</b> - $replies $replyword - $lastreplydate";?>');
    document.write('        </td>');
    document.write('    </tr>');
<?php      
  
}
  else {
 
?> 
    document.write('<?php echo "<b>$lastposter</b> - $replies $replyword - $lastreplydate<br><i>$lastpostshort</i>";?>');
    document.write('        </td>');
    document.write('    </tr>');
<?php    
  
}
}
?>
document.write('</table>');
Other than realize it's quick and dirty and not particularly efficient, I really just need to figure out why in tarnation it all of a sudden stopped working when called as a script reference.

Any help would be appreciated!!!

Show Your Support

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

Comments
  #2  
Old 08-03-2003, 12:19 PM
AmericanWoman AmericanWoman is offline
 
Join Date: Jan 2002
Posts: 47
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Got it working. The mistakes were stupid, like missing quotes in variable assignments, and forgetting to rename a variable after a copy/paste operation.

That's what I get for coding all night.
Reply With Quote
Reply


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:00 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.03849 seconds
  • Memory Usage 2,236KB
  • Queries Executed 15 (?)
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
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (2)post_thanks_box
  • (2)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit_info
  • (1)postbit
  • (2)postbit_onlinestatus
  • (2)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