Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)

Reply
 
Thread Tools Display Modes
  #11  
Old 01-07-2005, 02:07 PM
mawby mawby is offline
 
Join Date: Jun 2004
Location: Wiltshire, England
Posts: 145
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok, couldn't get the e-mail working but by trial and error I've traced the problem to the first SQL query. If I put it into plain SQL like...
Code:
UPDATE user AS user SET customtitle = 0 WHERE customtitle = 2 AND user.usergroupid IN (SELECT usergroupid FROM usergroup where (genericpermissions & 2048) = 0)
and run it through mySQL it returns the following error...
Quote:
#1064 - 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 'SELECT usergroupid FROM usergroup where (genericpermissions & 2
...and I'm using mySQL version 4.0.22-nt

Does that give any clues?
Reply With Quote
  #12  
Old 01-07-2005, 03:47 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm running MySQL 4.1.8nt myself, but the functions used in there are nothing new i think. I copied your sql statement back into my sql manageer and it worked like a charm. Strange.

Hmm MySQL documentation not clear on this, but it might be that the IN statement not work like expected in your version of mysql (http://dev.mysql.com/doc/mysql/en/Co...s.html#IDX1235)

Try changing the line:
PHP Code:
AND user.usergroupid IN (SELECT usergroupid FROM " . TABLE_PREFIX . "usergroup where (genericpermissions 2048) = 0)"); 
into:

PHP Code:
AND user.usergroupid ANY (SELECT usergroup.usergroupid FROM " . TABLE_PREFIX . "usergroup AS usergroup where (usergroup.genericpermissions 2048) = 0)"); 
See also:
http://dev.mysql.com/doc/mysql/en/AN...ubqueries.html
Reply With Quote
  #13  
Old 01-07-2005, 05:29 PM
mawby mawby is offline
 
Join Date: Jun 2004
Location: Wiltshire, England
Posts: 145
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Still doesn't work mate, says there's an error near "(SELECT usergroup.usergroupid ".

I can see what the SQL is trying to do, is there a way to move the logic out into the PHP maybe?
Reply With Quote
  #14  
Old 01-07-2005, 06:21 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Give me a litle time, will try to rewrite it tonight (CET)
Reply With Quote
  #15  
Old 01-07-2005, 07:50 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok a new attempt. Should work on all mySQL version now.

Replace the file and try again.
Attached Files
File Type: zip cleanusertitles.zip (953 Bytes, 12 views)
Reply With Quote
  #16  
Old 01-09-2005, 08:48 AM
mawby mawby is offline
 
Join Date: Jun 2004
Location: Wiltshire, England
Posts: 145
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Mate you're a star, that worked perfectly!

Cheers!

:banana:
Reply With Quote
  #17  
Old 01-09-2005, 09:43 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the feedback.

Since more people seem to be looking for this, i might change it to include also membergroups and release it as a mini mod.
Reply With Quote
  #18  
Old 06-04-2005, 02:37 PM
djroketboy djroketboy is offline
 
Join Date: Apr 2003
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarcoH64
Thanks for the feedback.

Since more people seem to be looking for this, i might change it to include also membergroups and release it as a mini mod.
I'm about to install this, seeing I am having this issue as well, is there a way to set which usergroups are affected? i only need 2 groups, 1 paid members, and 2 free members that need to be used, the rest can be left as default.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:59 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04414 seconds
  • Memory Usage 2,252KB
  • Queries Executed 14 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (2)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (1)postbit_attachment
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete