vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   javascript syndicated content... (https://vborg.vbsupport.ru/showthread.php?t=55836)

AmericanWoman 08-02-2003 07:08 PM

javascript syndicated content...
 
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!!!

AmericanWoman 08-03-2003 12:19 PM

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. :(


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