vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   PHP code to get user info from my database (https://vborg.vbsupport.ru/showthread.php?t=219819)

MozyMac 07-30-2009 11:42 AM

PHP code to get user info from my database
 
I was wondering what's the vbulletin code for fetching the user avatar and his/her user name.

Dismounted 07-30-2009 12:23 PM

PHP Code:

$userinfo fetch_userinfo($userid2); 


MozyMac 07-30-2009 12:38 PM

thanks Dismounted, I wondering how to do this:

i want to make a kind of user avatar gallery, but i don't want it to show all my users but just the ones that want to be shown, any idea how to make this (even if just prototype)

Thanks for quick help :)

James Birkett 07-30-2009 01:39 PM

You'd have to create user CP permissions so they can select if to show or not. Then you'd have to grab each user's avatar and place them in the gallery.

MozyMac 07-30-2009 02:00 PM

what about if i let them join a user group and only show pictures for this user group but how can i just show the pictures from a certain user group

--------------- Added [DATE]1248979590[/DATE] at [TIME]1248979590[/TIME] ---------------

guys how should i enter the code?
should i put it in template or php file for the custom vb page

MozyMac 07-31-2009 04:13 PM

any help here please?

toonysnn 07-31-2009 05:51 PM

php page. templates won't accept php.

MozyMac 07-31-2009 06:06 PM

but where should i put it and then what should i put in the template here is the code of the page:
Code:

<?php

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'imamac'); // change this depending on your filename

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array(

);

// get special data templates from the datastore
$specialtemplates = array(
   
);

// pre-cache templates used by all actions
$globaltemplates = array(
    'imamac',
);

// pre-cache templates used by specific actions
$actiontemplates = array(

);

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################

$navbits = array();
$navbits[$parent] = 'Im a Mac';

$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('imamac') . '");');
$userinfo = fetch_userinfo($userid, 2);
$test123 = "test";
echo "$test123";

?>


Dismounted 08-01-2009 03:58 AM

Quote:

Originally Posted by MozyMac (Post 1858497)
i want to make a kind of user avatar gallery, but i don't want it to show all my users but just the ones that want to be shown, any idea how to make this (even if just prototype)

Now this is a little more complicated. You'll have to create a query to fetch the avatars (instead of using the function), and join the userfield table to check if it should be shown. This requires more in-depth PHP knowledge, and can't really be done in a short tutorial.

MozyMac 08-01-2009 04:14 AM

Quote:

Originally Posted by Dismounted (Post 1859418)
Now this is a little more complicated. You'll have to create a query to fetch the avatars (instead of using the function), and join the userfield table to check if it should be shown. This requires more in-depth PHP knowledge, and can't really be done in a short tutorial.

this could be list the memberlist, ok so I checked my database found usergroup table, know i have to make query to fetch data from certain usergroup using the id as key. is that the correct way?

thanks


All times are GMT. The time now is 04:47 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.01116 seconds
  • Memory Usage 1,733KB
  • 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_code_printable
  • (1)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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