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-19-2006, 08:16 PM
Mickie D Mickie D is offline
 
Join Date: Jun 2002
Posts: 430
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default need help with converting my php to vbulletin

this code below works fine out of the vbulletin system and converting it to work with vbulletin is proving very dificult for me can someone assist please

as you can see i did convert some of the code (i.e the get stuff)

PHP Code:

// ##### CLEAN GET COMMANDS AND PROCESS SEARCHSTR VARIABLE #####

$vbulletin->input->clean_gpc('r''item'TYPE_NOHTML); 
$searchstr $vbulletin->GPC['searchstr'];


// ##### CHECK SEARCHSTR IS NOT MORE THAN 8 DIGITS #####

if(strlen($searchstr) < 8)
{
$footoutput 'sorry you have entered more than 8 charactors for your players first name you wont find him like that';
}


$sql $db->query_read("SELECT SUBSTRING(footie_data,9,16) AS footie_data FROM football WHERE footie_data LIKE '$searchstr%'");


$results = @mysql_query($sql); 
$numResults = @mysql_num_rows($results); 

if(
$numResults >0

while (
$row mysql_fetch_object($results)) 


$footoutput=$row->footie_data
}

i think it may have something to do with this bit:

PHP Code:
$results = @mysql_query($sql); 
$numResults = @mysql_num_rows($results); 

i am using a template but its not displaying the results when i use the get command from the same template (maybe its not parsing it right ?) but all i get is the message from first instance of $footoutput and it wont search the database ??

im not sure if i can use the code above in vbulletin code ?

thanks for any help given

Regards
Mickie

anyone help ?
Reply With Quote
  #2  
Old 01-21-2006, 04:00 PM
Mickie D Mickie D is offline
 
Join Date: Jun 2002
Posts: 430
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

right i have been playing and can someone help i think im nearly there

edited code from above

PHP Code:

$results 
= @mysql_query($sql);    ### dunno what to do with this line
$numResults $db->num_rows($results);   

if(
$numResults >0)   
{   
while (
$row $db->fetch_array($results))  
{   

$footoutput=$row->footie_data;  ### dunno what to do with this line 
}  

the lines marked ### dunno what to.....

are where i am stuck but i think some advice is needed please

Kind Regards
Mickie
Reply With Quote
  #3  
Old 01-21-2006, 04:18 PM
Guest210212002
Guest
 
Posts: n/a
Default

I'm not sure the exact answer to your question, but my opinion is that the vb.com sales support guys should at least take a crack at answering this for you, so it might be worthwhile to post it over there.
Reply With Quote
  #4  
Old 01-21-2006, 05:18 PM
Mickie D Mickie D is offline
 
Join Date: Jun 2002
Posts: 430
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i did with no response so far from yesterday.

i know i will get the modifying is todo with vbulletin.org reply sooner or later

i can write (well find all the stuff from php.net) that i need to make stuff but the whole vbulletin thing is beyond me they take the php code and use it a little different i think in a good way as i seen they use the $db-> to make it easier to call mysql, maybe if it was well documented or someone knew where i can find all the mysql calls (abbreviations) i would be a little better off... saying all that im not a coder i just know a few things from running a site for a while

i would be really greatful if someone could help i need to integrate this into my forums for my paid members,
Reply With Quote
  #5  
Old 01-21-2006, 06:19 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try (not tested, not at my own PC now):

PHP Code:
// this line is also not needed, you already done in the full example above: $results = $db->query_read($sql);    ### dunno what to do with this line (or query_write)

while ($row $db->fetch_array($results))   
{    

$footoutput=$row['footie_data'];  ### dunno what to do with this line  

PS You will not get an answer about custom coding at vb.com
Reply With Quote
  #6  
Old 01-21-2006, 07:44 PM
Mickie D Mickie D is offline
 
Join Date: Jun 2002
Posts: 430
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarcoH64
Try (not tested, not at my own PC now):

PHP Code:
// this line is also not needed, you already done in the full example above: $results = $db->query_read($sql);    ### dunno what to do with this line (or query_write)

while ($row $db->fetch_array($results))   
{    

$footoutput=$row['footie_data'];  ### dunno what to do with this line  

PS You will not get an answer about custom coding at vb.com
thanks very much for the reply its getting closer with the code you have given me it actually pulls the first ID when i try and search it gives me the same result all the time.

basicly i insert "phillip" and it spits out "hendros-wiganund" if i then put in gavin it still spits out "hendros-wiganund" when it should have told me "banstop-wiganund"

so i am a step forward and happy i got a reply

thanks very much

any ideas guys
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 06:28 PM.


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.05278 seconds
  • Memory Usage 2,229KB
  • 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
  • (5)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (5)postbit_onlinestatus
  • (6)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