Log in

View Full Version : Help with custom coding problem please :-)


nsglazer
01-30-2003, 12:16 PM
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