vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Help with custom coding problem please :-) (https://vborg.vbsupport.ru/showthread.php?t=48319)

nsglazer 01-30-2003 12:16 PM

Help with custom coding problem please :-)
 
Hello,

Would someone please help me with some PHP coding? I am trying to add a little customization to the page, but apparently my code is messing up one of the variables that vbulletin is using, or something. When the changes below are made the search engine on my site doesnt work. It gives the following error message:

"The search term you specified (*) is under the minimum word length (4) and therefore will not be found. Please make this term longer."

Do you know what I can do to correct this? Need any other info?

Thanks so much!!!

Neil

------------

What I added to header:

$leftcolumn

------------

What I added to PHP Include:

ob_start();
include( "$DOCUMENT_ROOT/column_left_special2.inc" );
$leftcolumn = ob_get_contents();
ob_end_clean();

------------

What Makes up $DOCUMENT_ROOT/column_left_special2.inc

<?php
$query = "SELECT * FROM store_items WHERE display = '1' AND image != ''";
$result = mysql_query( $query );
$n = mysql_numrows( $result );

if( $n > 1 )
{
// seed the random index generator
srand( ( double )microtime()*1000000 );
// generate random numbers
$j = rand( 0, ($n-1) );
}
else
{
$i=0;
}

if( $n > 0 )
{
$price = mysql_result( $result, $j, "price" );
$image = mysql_result( $result, $j, "image" );
$storeItem_id = mysql_result( $result, $j, "storeItem_id" );
$code = mysql_result( $result, $j, "code" );
$display = mysql_result( $result, $j, "display" );
$storeSubcat_fk = mysql_result( $result, $randval[$j], "storeSubcat_fk" );
$storeCat_fk = mysql_result( $result, $randval[$j], "storeCat_fk" );
$productName = mysql_result( $result, $j, "productName" );
$unadvertised = mysql_result( $result, $j, "unadvertised" );

if( $unadvertised == 0 )
{
$price = "click for price";
}
else
{
$price = "$" . $price;
}
}

$size = GetImageSize( "http://www.pilotmall.com/store/graphics/00000001/" . $image );

// size[0] is the width, size[1] is the height
if( $size[0] > 100 )
{
$width = " WIDTH=\"100\"";
}

?>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100" BORDER="0">
<TR>
<TD ALIGN="center" CLASS="small">
<B>Shop PilotMall.com</B>:
<A HREF="http://www.pilotmall.com/store/agent.mv?AG=studentpilot&SC=PROD&S=1&P=<?php print $code ?>"><IMG SRC="http://www.pilotmall.com/store/graphics/00000001/<?php print $image ?>" <?php print $width ?> ALT="" BORDER="0"></A>
<A HREF="http://www.pilotmall.com/store/agent.mv?AG=studentpilot&SC=PROD&S=1&P=<?php print $code ?>" CLASS="small"><?php print $productName; ?></A>
</TD>
</TR>
</TABLE>

nsglazer 01-30-2003 04:06 PM

Hello,

Would someone please help me with some coding? I am trying to add a little customization to the page, but apparently my code is messing up one of the variables that vbulletin is using, or something. When the changes below are made the search engine on my site doesnt work. It gives the following error message:

"The search term you specified (*) is under the minimum word length (4) and therefore will not be found. Please make this term longer."

Do you know what I can do to correct this? Need any other info?

Thanks so much!!!

Neil

------------

What I added to header:

$leftcolumn

------------

What I added to PHP Include:

ob_start();
include( "$DOCUMENT_ROOT/column_left_special2.inc" );
$leftcolumn = ob_get_contents();
ob_end_clean();

------------

What Makes up $DOCUMENT_ROOT/column_left_special2.inc

<?php
$query = "SELECT * FROM store_items WHERE display = '1' AND image != ''";
$result = mysql_query( $query );
$n = mysql_numrows( $result );

if( $n > 1 )
{
// seed the random index generator
srand( ( double )microtime()*1000000 );
// generate random numbers
$j = rand( 0, ($n-1) );
}
else
{
$i=0;
}

if( $n > 0 )
{
$price = mysql_result( $result, $j, "price" );
$image = mysql_result( $result, $j, "image" );
$storeItem_id = mysql_result( $result, $j, "storeItem_id" );
$code = mysql_result( $result, $j, "code" );
$display = mysql_result( $result, $j, "display" );
$storeSubcat_fk = mysql_result( $result, $randval[$j], "storeSubcat_fk" );
$storeCat_fk = mysql_result( $result, $randval[$j], "storeCat_fk" );
$productName = mysql_result( $result, $j, "productName" );
$unadvertised = mysql_result( $result, $j, "unadvertised" );

if( $unadvertised == 0 )
{
$price = "click for price";
}
else
{
$price = "$" . $price;
}
}

$size = GetImageSize( "http://www.pilotmall.com/store/graphics/00000001/" . $image );

// size[0] is the width, size[1] is the height
if( $size[0] > 100 )
{
$width = " WIDTH=\"100\"";
}

?>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100" BORDER="0">
<TR>
<TD ALIGN="center" CLASS="small">
<B>Shop PilotMall.com</B>:
<A HREF="http://www.pilotmall.com/store/agent.mv?AG=studentpilot&SC=PROD&S=1&P=<?php print $code ?>"><IMG SRC="http://www.pilotmall.com/store/graphics/00000001/<?php print $image ?>" <?php print $width ?> ALT="" BORDER="0"></A>
<A HREF="http://www.pilotmall.com/store/agent.mv?AG=studentpilot&SC=PROD&S=1&P=<?php print $code ?>" CLASS="small"><?php print $productName; ?></A>
</TD>
</TR>
</TABLE>

nsglazer 01-30-2003 04:56 PM

I fixed it.. NEver mind

nsglazer 01-30-2003 04:56 PM

Its fixed. Disregard


All times are GMT. The time now is 02:36 PM.

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.01041 seconds
  • Memory Usage 1,723KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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