Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 05-16-2006, 11:37 PM
Mistah Roth's Avatar
Mistah Roth Mistah Roth is offline
 
Join Date: Jul 2003
Location: Ottawa, Ontario
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Simple Request... Yet Seems Difficult

I've been struggling for months now in trying to basically excluse the pieces of code that do the following on a non-vb page:

a) Keeps the user logged in (so it can say Welcome Whoever)
b) Gets all of the user table information (so I can check if they are a certain usergroup id)

Thats all I want... and I cant find any way of doing this without including global, which runs tons of un-neccessary queries. Can anyone help me out here? I want to be efficient, I tried just doing global.php but now there are so many queries being run my host is starting to complain lol.
Reply With Quote
  #2  
Old 05-16-2006, 11:47 PM
Abe1's Avatar
Abe1 Abe1 is offline
 
Join Date: Feb 2004
Location: I LOVE New York!
Posts: 2,886
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Mistah Roth
I've been struggling for months now in trying to basically excluse the pieces of code that do the following on a non-vb page:

a) Keeps the user logged in (so it can say Welcome Whoever)
b) Gets all of the user table information (so I can check if they are a certain usergroup id)

Thats all I want... and I cant find any way of doing this without including global, which runs tons of un-neccessary queries. Can anyone help me out here? I want to be efficient, I tried just doing global.php but now there are so many queries being run my host is starting to complain lol.
Global.php is realy thr only normal way and the easiest. You can add some defines that will stop global from running some queies.
Reply With Quote
  #3  
Old 05-17-2006, 12:04 AM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Looking at the output of a typical "explain", global.php seems to run six queries, at least half of which I would say are necessary to do what you want (one is for templates, you may not need them, two more are style info and calendar permissions - again, you may not want them). However, it would be very hard to pick out the bits of code you need (from config.php, functions.php, class_core.php, init.php etc etc) - not really worth the effort.

Also, global.php is called on every vb page, so adding it to an external page should not cause a dramatic rise in queries, unless most members are not actually in your forums, but in the external pages. Any host that moans about the number of queries here is being a bit petty - possibly you should be looking for a better host, not trying to re-invent the wheel.
Reply With Quote
  #4  
Old 05-17-2006, 10:03 AM
Mistah Roth's Avatar
Mistah Roth Mistah Roth is offline
 
Join Date: Jul 2003
Location: Ottawa, Ontario
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well right now I get about 15 queries a second, which is pretty high. Also 90% of my visitors are for the non-vb pages, my forum makes up about 10% of my hits.

I also have a lot of non-vb pages, upwards of 1000, so if you're browsing my site you're running a lot of queries. Ill try stopping those three queries and see if it makes a big difference, thank you.
Reply With Quote
  #5  
Old 05-17-2006, 07:38 PM
stonyarc stonyarc is offline
 
Join Date: Aug 2005
Location: Leuven (Belgium)
Posts: 930
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Mistah Roth
Well right now I get about 15 queries a second, which is pretty high. Also 90% of my visitors are for the non-vb pages, my forum makes up about 10% of my hits.

I also have a lot of non-vb pages, upwards of 1000, so if you're browsing my site you're running a lot of queries. Ill try stopping those three queries and see if it makes a big difference, thank you.
What is the platform of your non vb pages is it homebrew php? or a CMS or plain HTML or .....
Reply With Quote
  #6  
Old 05-17-2006, 11:09 PM
Mistah Roth's Avatar
Mistah Roth Mistah Roth is offline
 
Join Date: Jul 2003
Location: Ottawa, Ontario
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

its a PHP structure of my own creation. I use PHP, CSS, and HTML to make up the main site, the database only comes in for the user session and for downloading things (checks to see if they're logged in).

Also the news script, which is a blog script basically, uses the database as well.
Reply With Quote
  #7  
Old 05-17-2006, 11:35 PM
Hellcat Hellcat is offline
 
Join Date: May 2003
Location: Germany
Posts: 560
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You could read the cookie yourself and then run your own quries to fetch the user data you need....
Reply With Quote
  #8  
Old 05-18-2006, 12:15 AM
Mistah Roth's Avatar
Mistah Roth Mistah Roth is offline
 
Join Date: Jul 2003
Location: Ottawa, Ontario
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Alright then, I know nothing about cookies lol, so my request is for a script that reads the cookies vbulletin makes >.> hahaa.

And writing a query to get the usergroup isnt difficult, I can manage that on my own, the cookie part is the only real tricky part.
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:04 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.04617 seconds
  • Memory Usage 2,230KB
  • Queries Executed 11 (?)
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
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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_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