Back to vBulletin 3.6 Add-ons

Add custom MySQL query in Admin CP drop-down
Mod Version: 1.00, by djbaxter

This modification is in the archives.
vB Version: 3.6.0 Rating: (0 vote - 0 average) Installs: 12
Released: 08 Sep 2006 Last Update: Never Downloads: 3
Not Supported  

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.

Download

No files for download.


vblts.ru supports vBulletin®, 2022-2025