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

Reply
 
Thread Tools Display Modes
  #1  
Old 01-30-2003, 12:16 PM
nsglazer nsglazer is offline
 
Join Date: Jan 2002
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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>
Reply With Quote
  #2  
Old 01-30-2003, 04:06 PM
nsglazer nsglazer is offline
 
Join Date: Jan 2002
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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>
Reply With Quote
  #3  
Old 01-30-2003, 04:56 PM
nsglazer nsglazer is offline
 
Join Date: Jan 2002
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I fixed it.. NEver mind
Reply With Quote
  #4  
Old 01-30-2003, 04:56 PM
nsglazer nsglazer is offline
 
Join Date: Jan 2002
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Its fixed. Disregard
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 10:57 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.03813 seconds
  • Memory Usage 2,194KB
  • Queries Executed 13 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)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_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
  • 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