vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   selecting usergroups based off custom ugp (https://vborg.vbsupport.ru/showthread.php?t=170531)

Nullifi3d 02-15-2008 05:25 AM

selecting usergroups based off custom ugp
 
PHP Code:

$usergroups $db->query_first("SELECT usergroupid FROM " TABLE_PREFIX "usergroup WHERE fmwpermissions > '0'");
$website $db->query_first("SELECT homepage AS url, homepagetitle AS title FROM " TABLE_PREFIX "user WHERE usergroupid IN (" $usergroups ") AND homepage != '' AND last" $vbulletin->options['fmw_last_activity_type'] . " > UNIX_TIMESTAMP(NOW())-" $vbulletin->options['fmw_last_activity_time'] . " ORDER BY RAND() LIMIT 1"); 

The first query does not give me the needed results. I am looking for a way of the second query contains a list of usergroups that have a certain custom ugp set to yes.

Sorry forgot to add that this is a plugin within forumhome_loggedinuser

Opserty 02-15-2008 08:17 AM

Just a word of warning...you running a query every time a logged in member is displayed on the homepage. If you have 54 members logged in then thats 54 queries in a single page, if two people load the homepage thats 108 queries, you can see it grows very rapidly!

Nullifi3d 02-16-2008 01:59 AM

I guess I didn't look very far into the plugin being used. Thanks for pointing this out. I moved the query to 'forumhome_complete'. But the issue with finding the usergroups that have permission still exists.


All times are GMT. The time now is 10:38 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.00924 seconds
  • Memory Usage 1,714KB
  • 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