vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Add custom MySQL query in Admin CP drop-down (https://vborg.vbsupport.ru/showthread.php?t=126096)

djbaxter 09-07-2006 10:00 PM

Add custom MySQL query in Admin CP drop-down
 
I wanted a fast way to access the subscribed list for my forum newsletter, for which I had added a custom variable. The technique below could be used for any MySQL query that you may want to add to the predefined "Automatic Query" drop down list in the Admin CP.

Open /admincp/queries.php

Find

Code:

                '210' => $vbphrase['subscribe_choice_none'],
                '220' => $vbphrase['subscribe_choice_0'],
                '230' => $vbphrase['subscribe_choice_1'],
                '240' => $vbphrase['subscribe_choice_2'],
                '250' => $vbphrase['subscribe_choice_3'],

Add before

Code:

                '209' => 'List users subscribed to newsletter',
Find

Code:

                                case 210:
                                        $query = "UPDATE " . TABLE_PREFIX . "user SET autosubscribe = -1";
                                        break;

Add before

Code:

                                case 209:
                                        $query = "SELECT username from " . TABLE_PREFIX . "user WHERE subscribenews=1";
                                        break;

SAVE and UPLOAD.

You will need to edit the above for your own variable and table names, of course. Also do a FIND to ensure that the CASE is not already in use.

Been Told 11-24-2006 07:50 PM

Nice! :)
I use that to insert a query to empty the chatbox. Thanks :)

msibm 02-21-2007 03:18 PM

Nice!
Thanks!

ZomgStuff 02-21-2007 10:11 PM

Reserved! Thanks!

gator777 03-23-2007 07:17 PM

Installed! I wish the VB guys would make this a feature. Thanks for the info. :D

TMSBrad 07-28-2008 02:09 PM

Very nice. Used it for my Master Member List which includes custom profile fields. Thanks.


All times are GMT. The time now is 02:31 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.01146 seconds
  • Memory Usage 1,716KB
  • 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
  • (4)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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