vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Custom Queries with parameters (https://vborg.vbsupport.ru/showthread.php?t=96199)

Marco van Herwaarden 09-12-2005 10:00 PM

Custom Queries with parameters
 
Custom Queries - version 1.02
================================================== ========================

Hack: Custom Queries
Version: 1.02
vB Version: 3.5.0 RC3
Author: MarcoH64
Description:
This hack will let you store SQL-statements that you use more then once in the database for later use. You can see it as an
extension the the standard predefined queries, but now you can define your own, use parameters and parse TABLE_PREFIX.

Features:
- Store SQL-statements for later use
- Use any number of parameters in your SQL-statements
- Query execution is done by standard vB scripts, so normal vB security is active on them.
- Full Admin Help (needs to be installed seperate)
- Can handle TABLE_PREFIX
- Quick Query for executing 1 time queries (including TABLE_PREFIX parsing)
- Import/Export groups of safed Queries

Donations are always welcome to Paypal: marcoh64 @ gmail.com

Change log:
v1.02 (18-9-2005)
- Added 'groupname' for queries. (used when exporting queries)
- Export Queries to an XML-File
- Import Queries from XML-File
- Direct safe Quick Query

v1.01 (16-9-2005)
- Parse TABLE_PREFIX
- Added Quick Query
- Added TABLE_PREFIX to install code

v1.00 (13-9-2005)
- Update: Admin help was not in product xml-file, see readme.txt

================================================== =========================

Installation:
- Upload all files from the upload directory to your forumhome directory.
- Install the product XML-File
- If Admin Help is wanted, also upload the file mh_cq-adminhelp.xml in your Admin Help Manager (only accessible in debug mode, or
by going to www.myboard.com/admincp/help.php?do=files)

================================================== =========================

When using parameters in a query, you can use the parametername surrounded by brackets (ie. {parametername})
in the SQL-statement.

Example:
Parametername: username

Query:
SELECT * FROM user WHERE username LIKE '%{username}%'

Attached is also an example export file with a demo query.

Oblivion Knight 09-13-2005 05:24 PM

Very nice, although I don't think I have a use for this (yet).

Thanks for sharing Marco! :)

Boofo 09-13-2005 05:38 PM

booboo? LOL

Just what I was looking for. ;)

Marco van Herwaarden 09-13-2005 05:51 PM

Update: Admin Help was not in productfile, see readme.txt on how to fix (just upload the adminhelp.xml file into the Admin Help Manager)

nexialys 09-13-2005 06:00 PM

my dream would be to be able to just have the " . TABLE_PREFIX . " element parsed by this SQL manager... would be simplier for all copy/pastes!

Marco van Herwaarden 09-13-2005 08:23 PM

Quote:

Originally Posted by nexialys
my dream would be to be able to just have the " . TABLE_PREFIX . " element parsed by this SQL manager... would be simplier for all copy/pastes!

S$!t, that reminds me that i added the install code for the product last minute, and i didn't add a table prefix there.

[high]* Marco van Herwaarden makes a note to fix that tomorrow.[/high]

Hmm parsing table prefix could be done easily, will have a look. Although my hack is more for queries that are run more then once, not for 1 time queries. You can see it as extending the buildin predefined queries with your own, plus that you can use parameters on them.

Boofo 09-13-2005 08:25 PM

Quote:

Originally Posted by MarcoH64
S$!t, that reminds me that i added the install code for the product last minute, and i didn't add a table prefix there.

[high]* MarcoH64 makes a note to fix that tomorrow.[/high]

Hmm parsing table prefix could be done easily, will have a look. Although my hack is more for queries that are run more then once, not for 1 time queries. You can see it as extending the buildin predefined queries with your own, plus that you can use parameters on them.

But having table prefix in the query can test it make sure it will work on the forum before using it anywhere. ;)

Marco van Herwaarden 09-13-2005 08:35 PM

Lol, here i go again, what started as an idea for a small simple plugin that would let you add your own queries to the predefined list (which wasn't possible since there are no hooks in that file) seems to be growing into something bigger then i ever intended. And i already have so many ideas for my existing hacks that i still need to finish.

But with only 1 install, i don't think i need to put too much work in this. ;)

Boofo 09-13-2005 08:55 PM

Thanks alot, buddy! ;)

nexialys 09-13-2005 10:21 PM

Quote:

Originally Posted by MarcoH64
But with only 1 install, i don't think i need to put too much work in this. ;)

[high]* nexialys did not click install because he never do it...
[/high]
but you can count me in...

i can even add some more requests on ALL your hacks MarcoH64! (that 64 remembers me of a certain Commodore!)


All times are GMT. The time now is 11:03 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.01124 seconds
  • Memory Usage 1,738KB
  • 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
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete