PDA

View Full Version : Administrative and Maintenance Tools - MyQueries - Save custom SQL for future use


jesus likes pie
04-10-2009, 10:00 PM
My Queries by Rafael Lopez
04/10/2009 (m/d/y)

This mod allows you to store custom queries for later use. Simply define the query once, save it, and it'll appear under "Automatic Queries" in the
Admin CP - allowing you to run it again in a matter of seconds.

::: CHANGE LOG :::
v1.0 - original release
v2.0 - 4/12/09
-----New feature: Variables
-----A few bug fixes
v2.1 - 4/20/09
-----Saved queries can now be edited.


::: Installation :::

Extract product-my_queries.xml
Upload product-my_queries.xml by going to ADMIN CP --> PLUGINS AND PRODUCTS --> MANAGE PRODUCTS --> ADD/IMPORT PRODUCT
If you are upgrading then you should set "over-write" to yes.

And you're done!


https://vborg.vbsupport.ru/external/2009/04/28.png (http://creativecommons.org/licenses/by-sa/3.0/us/)

As always with my releases, you are free to modify, distribute, derive work from, and translate this mod.

If you liked this mod you might also like my others:

Select Postbit [https://vborg.vbsupport.ru/showthread.php?t=203324]
Shared Admin Notes [https://vborg.vbsupport.ru/showthread.php?t=203326]
Internal Forums Closed Message/Reason [https://vborg.vbsupport.ru/showthread.php?t=207855]
Auto-Moderate Evading Banned Members [https://vborg.vbsupport.ru/showthread.php?t=207966]
Multi-Quote / Edit Integration [https://vborg.vbsupport.ru/showthread.php?t=210620]

Jasem
04-11-2009, 02:57 AM
Nice work, thank you!

Installed

veenuisthebest
04-11-2009, 04:27 AM
Nice work, thank you!

Installed
man you have the same two lines posted in almost all threads LOL. Do you really install everything?

Hornstar
04-11-2009, 11:03 AM
can only admins that have can run query permission run these? It looks like a useful mod, thanks for sharing.

ahmed-samara
04-11-2009, 11:08 AM
wooow it's nice work ...i will try now :)

Ops !

MySQL Error : You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT CHARSET=latin1 AUTO_INCREMENT=1350' at line 6
Error Number : 1064

ArnyVee
04-11-2009, 11:15 AM
For those of us that are not so familiar with some of the backend functions like queries, could you explain what this would do or help us in doing? :)

Sweeks
04-11-2009, 11:18 AM
I think this would be great if there was some preset sample queries added to the text file for us to use :) Like one for deleting visitor messages of X user etc :)
________
Fix ps3 (http://fixps3.info/)

jesus likes pie
04-11-2009, 11:31 AM
can only admins that have can run query permission run these? It looks like a useful mod, thanks for sharing.

It is integrated directly into the query page, so it will be hidden from admins who do not have that permission.

wooow it's nice work ...i will try now :)

:)

For those of us that are not so familiar with some of the backend functions like queries, could you explain what this would do or help us in doing? :)

Queries allow you to make mass-changes by running code. It's relatively advanced and has the potential to completely ruin your forum if you make a slip. With that said, most syntax errors end up with an error message which simply doesnt execute the query.

The query page already has examples. Like you could run a query to make everyone on your forum use the WYSIWYG editor. Or, like the person below you stated, you could run a query to delete ALL visitor messages of a specific user.

Things like that.

I think this would be great if there was some preset sample queries added to the text file for us to use :) Like one for deleting visitor messages of X user etc :)

This is functionality that will be added shortly. At the moment the example you gave wouldn't work well because that query would require a WHERE clause of something like

WHERE userid = 123

I'll be adding something to add "variables" to saved queries and so when you save a query you define the above as

WHERE userid = {userid}

and then you add "userid" as a variable, and then when you run the query vBulletin will ask you to fill in the variable "userid" to which you would enter "123".

Long answer short: right now this, could, for example reset everyone's invitations to whatever number you wanted. (Obviously this would require the invitation mod).

The key is that as it works at the moment, it can run any query which affects ALL users.

Sweeks
04-11-2009, 11:32 AM
I cant wait for this added functionality, things like deleting all users private messages etc would be awesome too. Great work :)
________
LOW COST VAPORIZER (http://www.vaporshop.com)

ahmed-samara
04-11-2009, 02:04 PM
what about my problem :)
MySQL Error : You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT CHARSET=latin1 AUTO_INCREMENT=1350' at line 6
Error Number : 1064

jesus likes pie
04-11-2009, 02:25 PM
When do you get that?

edit: that's when installing it isn't it?

edit2: try using the xml in this post

ahmed-samara
04-11-2009, 03:38 PM
When do you get that?

edit: that's when installing it isn't it?

edit2: try using the xml in this post

please shack the attack file it's give me gif banner

i working in 3.8.2

jesus likes pie
04-11-2009, 04:15 PM
I'm sorry but I don't understand what you said :(

On the original attachment, the install code includes charset information which I don't think should be there. The attachment in #11 does not have it, so I wanted to know if that one would work for you.

I am working on 3.8.2 as well.

Sunka
04-11-2009, 08:08 PM
Very nice...
Taged for a moment.
Will be OK if you put some querries which are not default one (put some new querries).

jesus likes pie
04-12-2009, 09:53 PM
Updated with variables feature.

Sweeks
04-12-2009, 10:09 PM
Nice installing now :)
________
MAINE MARIJUANA DISPENSARY (http://maine.dispensaries.org/)

Stoebi
04-13-2009, 02:37 AM
Very very nice, it works excellent, thank you :)

My wish is to have a way to edit the saved query for automatic use, without going to pma or delete the query first.


Regards,

Stoebi

SnapOff Racing
04-13-2009, 06:07 AM
Been waiting for something like this! THANKS! :)

jesus likes pie
04-13-2009, 06:45 PM
Very very nice, it works excellent, thank you :)

My wish is to have a way to edit the saved query for automatic use, without going to pma or delete the query first.


Regards,

Stoebi


Do you mean a way to edit the queries you add?

Elenna
04-15-2009, 02:26 AM
I believe that is what he was saying. I think that would be useful, too, in case you wanted to change a stored one.

Or perhaps an option to run the current one as-in, or run with changes, which would copy the query to the box below, and allow for modifications that don't get saved.

Vitaly
04-15-2009, 07:22 PM
Very nice. Thanks a lot.

jesus likes pie
04-20-2009, 04:09 AM
Updated to version 2.1:

allows editing of saved queries.

see this attachment (https://vborg.vbsupport.ru/attachment.php?attachmentid=98039&d=1240203964) for preview

Stoebi
04-20-2009, 05:58 AM
Hi :)

Thank you very much :) :)

Have a MySQL Error, if i hit Save after editing my content.

This is my Content:
Title: Update Phrases (vbulletin)

UPDATE phrase
SET version = '{version}'
WHERE languageid = 3
AND product = 'vbulletin'
Variables: version

This is the error:

Datenbankfehler in vBulletin 3.8.2:

Invalid SQL:
UPDATE customqueries SET `name` = 'Phrasen aktualisieren (vbulletin)', `query` = 'UPDATE phrase
SET version = '{version}'
WHERE languageid = 3
AND product = 'vbulletin'', `variables` = 'version' WHERE qid = 1356;

MySQL-Fehler : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '{version}'
WHERE languageid = 3
AND product = 'vbulletin'', `variables` = 've' at line 1
Fehler-Nr. : 1064
Fehler-Zeit : Monday, 20.04.2009 @ 08:58:15
Datum : Monday, 20.04.2009 @ 08:58:15
Skript : http://localhost/vb/yvb382/admincp/queries.php?do=addquery
Referrer : http://localhost/vb/yvb382/admincp/queries.php?do=addquery
IP-Adresse : 127.0.0.1
Benutzername : Stoebi
Klassenname : vB_Database
MySQL-Version : 5.0.67-communityRegards, Stoebi

jesus likes pie
04-20-2009, 01:20 PM
Ah that's my bad.

Re-download the 2.1 file. Should be fixed now.

Stoebi
04-20-2009, 02:12 PM
Thank you so much. Works perfectly now. :)

An idea I have. What do you think about an import/export option?


Kind Regards,

Stoebi

Sunka
08-10-2009, 04:22 AM
Changed from taged to installed! :up:

Still it would be OK if someone will write here some querries that are not by default in ACP

Sweeks
08-10-2009, 10:32 AM
Thanks for the update :)

dilbert
08-10-2009, 10:43 AM
Very nice, thank you.

DubaiZone
08-10-2009, 10:54 AM
Nice Jod .. Thanx

*Installed soon*

jesus likes pie
07-05-2010, 02:15 AM
Can anyone tell me if this works on vB4?

I've been very outside the loop and I don't know if vB3 mods need to be rewritten to work in vB4. (I also don't have a vB4 forum installed, yet)