Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-10-2003, 06:50 PM
Sylvus Sylvus is offline
 
Join Date: Apr 2003
Location: Toronto
Posts: 156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Query assistance

I have Firefly's query hack installed, which is great for running querys and has helped me a lot. I just downloaded a hack but the author did not give the full query to enter and I'm a little stumped.

What's the full query to do the following?

Code:
use phpMyAdmin to add a row to the user table.
filed : alias
type : varchar
length : 250
and

"then use phpmyadmin to edit 'allowmultiregs' in the settings table to change the description to:"

Code:
Normally, vBulletin will stop users signing up for multiple names by checking for a cookie on the user's machine. If one exists, then the user may not sign up for additional names.<br>If you wish to allow your users to sign up for multiple names, then select yes for this option, and they will not be blocked from registering additional usernames.<br>You may track also track multiples.  By using this option, the site will try to track and identify other screen names used by each member.
and change the optioncode to

Code:
<select name=\"setting[$setting[allowmultiregs]]\">
<option value=\"0\" ".iif($setting[value]==0,"selected","").">NO - Don't allow multiples</option>
<option value=\"1\" ".iif($setting[value]==1,"selected","").">YES - allow multiples</option>
<option value=\"2\" ".iif($setting[value]==2,"selected","").">YES - but track multiples</option>
</select>
Thanks,

Syl...
Reply With Quote
  #2  
Old 08-10-2003, 08:39 PM
g-force2k2 g-force2k2 is offline
 
Join Date: Mar 2002
Location: Everywhere you wanna be..
Posts: 1,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i believe filed is the column name?

if so run this query:

Code:
ALTER TABLE user ADD alias varchar(250) NOT NULL
g-force2k2
Reply With Quote
  #3  
Old 08-11-2003, 07:36 PM
Sylvus Sylvus is offline
 
Join Date: Apr 2003
Location: Toronto
Posts: 156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks g-force2k2. That worked. Any suggestions about the last two parts?
Reply With Quote
  #4  
Old 08-12-2003, 08:17 AM
Dark_Wizard Dark_Wizard is offline
 
Join Date: Nov 2001
Location: North Carolina
Posts: 1,251
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

UPDATE setting SET description=your description,optioncode=your optioncode WHERE varname=allowmultiregs
Reply With Quote
  #5  
Old 08-12-2003, 05:42 PM
Sylvus Sylvus is offline
 
Join Date: Apr 2003
Location: Toronto
Posts: 156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the tip and I got the first part done correct (the description) but I'm having a heck of a time with the next query to add the select options.

If I use the code provided in the hack (which I must add is the worst documention I've come across in all the hacks I've installed), it works.

This is what the hack installer said to use:

Code:
<select name=\"setting[$setting[allowmultiregs]]\">
<option value=\"0\" ".iif($setting[value]==0,"selected","").">NO - Dont allow multiples</option>
<option value=\"1\" ".iif($setting[value]==1,"selected","").">YES - allow multiples</option>
<option value=\"2\" ".iif($setting[value]==2,"selected","").">YES - but track multiples</option>
But in the Control Panel, I receive this error:

Parse error: parse error, expecting `','' or `';'' in /mnt/web/guide/site/forum/admin/options.php(72) : eval()'d code on line 1

No modifications to options.php were ever done during the attempted install of this hack.

So I figured I'd give this a shot,

Code:
UPDATE setting SET optioncode '<select name=\"setting[$setting[allowmultiregs]]\"><option value=\"0\" \".iif($setting[value]==0,\"selected\",\"\").\">NO - Dont allow multiples</option><option value=\"1\" \".iif($setting[value]==1,\"selected\",\"\").\">YES - allow multiples</option><option value=\"2\" \".iif($setting[value]==2,\"selected\",\"\").">YES - but track multiples</option>'
But it gives me this error:

mysql error: You have an error in your SQL syntax near ''<select name=\"setting[$setting[allowmultiregs]]\"><option value=\"0\" \".iif($' at line 1

Any help would be appreciated.

Syl...
Reply With Quote
  #6  
Old 08-12-2003, 06:28 PM
Dark_Wizard Dark_Wizard is offline
 
Join Date: Nov 2001
Location: North Carolina
Posts: 1,251
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmmm, His code is correct...try this instead:

Code:
<select name=\\'setting[$setting[allowmultiregs]]\\'>
<option value=\\'0\\' '.iif($setting[value]==0,'selected','').'>NO - Dont allow multiples</option>
<option value=\\'1\\' '.iif($setting[value]==1,'selected','').'>YES - allow multiples</option>
<option value=\\'2\\' '.iif($setting[value]==2,'selected','').'>YES - but track multiples</option>
Reply With Quote
  #7  
Old 08-12-2003, 06:53 PM
Sylvus Sylvus is offline
 
Join Date: Apr 2003
Location: Toronto
Posts: 156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ah I'm such a n00b. I'm sorry I made you ponder your time with this. Your second suggestion did not work but your first one did. It was all me If you check out the code I pasted above that did not work, you'll see I forgot to add this to the query.

optioncode='select name

I had optioncode 'select name

No = sign.

In the end, for your own curiosity, the following just worked like a charm:

Code:
UPDATE setting SET optioncode='select name=\"setting[$setting[allowmultiregs]]\"> NO - Dont allow multiples YES - allow multiples YES - but track multiples ' WHERE varname='allowmultiregs'
Thanks for the help. Learned to always double and triple check

The only problem I have is this. The query ran smoothly but I'm still getting:

Parse error: parse error, expecting `','' or `';'' in /mnt/web/guide/skullport/forum/admin/options.php(72) : eval()'d code on line 1

Under the Allow multiple registrations per user in the CP, which is exactly where that query would update to add the last option.

Should there be a ; perhaps in the query somewhere?

Syl...
Reply With Quote
  #8  
Old 08-12-2003, 08:00 PM
Dark_Wizard Dark_Wizard is offline
 
Join Date: Nov 2001
Location: North Carolina
Posts: 1,251
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You forgot the <" in front of select...
Reply With Quote
  #9  
Old 08-12-2003, 08:09 PM
g-force2k2 g-force2k2 is offline
 
Join Date: Mar 2002
Location: Everywhere you wanna be..
Posts: 1,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Code:
UPDATE setting SET optioncode='<select name=\"setting[\$setting[allowmultiregs]]\">
<option value=\"0\" \".iif(\$setting[value]==0,\"selected\",\"\").\">NO - Dont allow multiples</option>
<option value=\"1\" \".iif(\$setting[value]==1,\"selected\",\"\").\">YES - allow multiples</option>
<option value=\"2\" \".iif(\$setting[value]==2,\"selected\",\"\").\">YES - but track multiples</option></select>' WHERE varname='allowmultiregs'
you have to escape the variables as well...

regards,
g-force2k2
Reply With Quote
  #10  
Old 08-12-2003, 08:22 PM
Dark_Wizard Dark_Wizard is offline
 
Join Date: Nov 2001
Location: North Carolina
Posts: 1,251
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Today at 05:09 PM g-force2k2 said this in Post #9
Code:
UPDATE setting SET optioncode='<select name=\"setting[\$setting[allowmultiregs]]\">
<option value=\"0\" \".iif(\$setting[value]==0,\"selected\",\"\").\">NO - Dont allow multiples</option>
<option value=\"1\" \".iif(\$setting[value]==1,\"selected\",\"\").\">YES - allow multiples</option>
<option value=\"2\" \".iif(\$setting[value]==2,\"selected\",\"\").\">YES - but track multiples</option></select>' WHERE varname='allowmultiregs'
you have to escape the variables as well...

regards,
g-force2k2

Actually it should be:
Code:
UPDATE setting SET optioncode='<select name=\\"setting[\$setting[allowmultiregs]]\\">
<option value=\\"0\\" \".iif(\$setting[value]==0,\"selected\",\"\").\">NO - Dont allow multiples</option>
<option value=\\"1\\" \".iif(\$setting[value]==1,\"selected\",\"\").\">YES - allow multiples</option>
<option value=\\"2\\" \".iif(\$setting[value]==2,\"selected\",\"\").\">YES - but track multiples</option></select>' WHERE varname='allowmultiregs'
Reply With Quote
Reply


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 05:18 AM.


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.05965 seconds
  • Memory Usage 2,273KB
  • Queries Executed 13 (?)
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
  • (11)bbcode_code
  • (1)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
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete