vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   [How-To] vBulletin API Basics: Variables, Functions, Objects (https://vborg.vbsupport.ru/showthread.php?t=98047)

eXtremeTim 11-02-2005 09:40 PM

Quote:

Originally Posted by Dark Visor
Of course ;)

I dont need the reference but I will definally pass it on to people im working on training. Since I do php training and vbulletin training for new coders.

akanevsky 11-02-2005 11:30 PM

Quote:

Originally Posted by eXtremeTim
I dont need the reference but I will definally pass it on to people im working on training. Since I do php training and vbulletin training for new coders.

No problem, except don't reprint it anywhere...
Pass it on as a link to this thread.

eXtremeTim 11-03-2005 08:27 PM

Quote:

Originally Posted by Dark Visor
No problem, except don't reprint it anywhere...
Pass it on as a link to this thread.

You dont have to worry about me reprinting it. :)

If I was gonna have a vbulletin 3.5 change tutorial on my site I would definatly make my own.

akanevsky 11-03-2005 08:37 PM

Quote:

If I was gonna have a vbulletin 3.5 change tutorial on my site I would definatly make my own.
By plagiarising this tutorial? No... I'd prefer that, if you want, reprint it on your site via copy-and-paste method, but leave me my credits and a link to this thread :P Thanks

Lea Verou 11-13-2005 01:30 AM

Quote:

Originally Posted by Psionic Vision
By plagiarising this tutorial? No... I'd prefer that, if you want, reprint it on your site via copy-and-paste method, but leave me my credits and a link to this thread :P Thanks

Ermm sorry but if I were extremeTim I would get offended with that comment of yours...

Anyway thanks for the great tutorial :)

akanevsky 11-13-2005 01:47 AM

Quote:

Ermm sorry but if I were extremeTim I would get offended with that comment of yours...
Yes, hmm, I misread this "If I was gonna have a vbulletin 3.5 change tutorial on my site I would definatly make my own."... but unfortunately, too late.

Quote:

Anyway thanks for the great tutorial
NP :)

Lea Verou 11-13-2005 01:55 AM

I need to make a query (from the table user) that returns an array and the key of the array would be the userid and the value would be the value of another field in the database (eg referrerid).
For example if the array is $array and the users with userid 100, 200, 300 have a referrerid of 1,1 and 50 respectively that array should have the values $array[100]=1 $array[200]=1 $array[300]=50

Is that hard? How can I do it without adding many queries?
Thanks a lot in advance :)

edit: [offtopic] OMG I just saw you are 16!!! Wow! I'd never had expected that! I thought you were about 25+! OMG, most 16 year olds in Greece do not know how an opening tag of php is and generally they only care about playing games... Of course there are exeptions, like my bf which is in that age but still there is a huge difference... OMG, I still can't believe it! [/offtopic]

Nevermind, I figured out another way to get the results I wanted :)

akanevsky 11-13-2005 02:25 AM

That could be done with just one query. :)

PHP Code:

$getusers $db->query_read("SELECT userid, referrerid  FROM " TABLE_PREFIX "user WHERE userid IN (100, 200, 300)");

 while (
$userinfo $db->fetch_array($getusers))
 {
     
$referrer_array["$userinfo[userid]"] = $userinfo['referrerid'];
 }

 print(
"<pre>");
 
print_r($referrer_array);
 print(
"</pre>"); 

This code is not tested but should be working properly.

Quote:

[offtopic] OMG I just saw you are 16!!! Wow! I'd never had expected that! I thought you were about 25+! OMG, most 16 year olds in Greece do not know how an opening tag of php is and generally they only care about playing games... Of course there are exeptions, like my bf which is in that age but still there is a huge difference... OMG, I still can't believe it! [/offtopic]
That's right, I am 16 :)

EDIT:

Quote:

Nevermind, I figured out another way to get the results I wanted
:( (lol)... How did you do it?

Lea Verou 11-13-2005 02:30 AM

Something similar but WAY more messy than yours :o

However the 100,200,300 where just examples, in an actual forum it should go through all the userids :)
Well, that's not very hard to change, I'll just put instead of your WHERE a WHERE referrerid>0 (cause I want it to only return the users with a referrer) :)

Thanks so much!! That's much more organized than my code. I'm still trying to figure out how those SQL things work, it's quite hard :nervous:

edit: And it works too! Woo hoo!! :D Thanks, thanks, thanks!!! :D :D :D

akanevsky 11-13-2005 02:35 AM

np, and what are you trying to make, if it's not a secret? :)


All times are GMT. The time now is 12:04 AM.

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.03331 seconds
  • Memory Usage 1,747KB
  • 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
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete