vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   How get Userinfo(userid) in plug-in ? (https://vborg.vbsupport.ru/showthread.php?t=129746)

suryoyena 10-23-2006 03:21 AM

How get Userinfo(userid) in plug-in ?
 
Hi,

im coding a plugin and i dont know how to get the userid to include this into a sql querry. here is my code:

PHP Code:

$buddy_search $vbulletin->db->query(
    
"SELECT user.username,user.userid,usertextfield.buddylist
    FROM user,usertextfield
    WHERE user.userid = usertextfield.userid
    AND FIND_IN_SET('6', REPLACE(usertextfield.buddylist, ' ', ',')) > 0
    ORDER BY user.username"
);

while (
$buddy_result $vbulletin->db->fetch_array($buddy_search)){
    
$buddy_split explode(" "$buddy_result[buddylist]);
    
$buddy_arr_size sizeof($buddy_result[buddylist]);
    for(
$i=0$i<=$buddy_arr_size+1$i++){
    
        
$find_user_name $vbulletin->db->query(
            
"SELECT * FROM user
            WHERE userid = "
.$buddy_split[$i]."
            ORDER BY username"
        
);

        while (
$find_user_name_result $vbulletin->db->fetch_array($find_user_name)){
            
$myshoutbuddies .= "<option value='".$buddy_split[$i]."'>".$find_user_name_result[username]."</option>";
        }
        
    }



in line 5 you see: "AND FIND_IN_SET('6', ... "

when i put a userid (in this case the 6) it works, i get a dropdown menu with my buddies, but i need it dynamic.

i put instead of the 6 : ".$userinfo['userid']." but it doesnt work.

could anybody help?

(sorry for my bad english, im too tired and too german)

greets,

chris

MaryTheG(r)eek 10-23-2006 03:35 AM

Sorry, it was wrong...

Kirk Y 10-24-2006 12:49 AM

Try using $vbulletin->userinfo['userid'] instead of $userinfo[userid].


All times are GMT. The time now is 05:30 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.01027 seconds
  • Memory Usage 1,720KB
  • 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)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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