vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Is This Possible?.... (https://vborg.vbsupport.ru/showthread.php?t=44520)

groovesalad 10-11-2002 08:43 PM

Is This Possible?....
 
I created a User Group named "DVD". Each one of the subscribers has a different Username but all of them have the same password. Is there a way that when they sign up with different usernames, but use a specific password, it'll register them under the DVD user group name?

Xenon 10-12-2002 09:04 AM

you know it's dangerous to give all the same password?
they can easily log in as someone else...

my tip: create a new customfield DVD-Password

then edit register.php and compare DVD-Passwordfield with the password you want for that group.
if they match, they'll be registred in this custom group

groovesalad 10-12-2002 01:43 PM

I have no idea how to do that.

Xenon 10-12-2002 06:52 PM

well create the new field in your AdminCP
Editable by user, but not viewable in profile

then open register.php find
PHP Code:

  $DB_site->query("INSERT INTO user (userid,username,password,email,".$newstylefield."parentemail,coppauser,homepage,icq,aim,yahoo,signature,adminemail,showemail,invisible,usertitle,joindate,cookieuser,daysprune,lastvisit,lastactivity,usergroupid,timezoneoffset,emailnotification,receivepm,emailonpm,options,birthday,maxposts,startofweek,ipaddress,pmpopup,referrerid,nosessionhash,avatarid) VALUES (NULL,'".addslashes(htmlspecialchars($username))."','".addslashes(md5($password))."','".addslashes(htmlspecialchars($email))."',".$newstyleval."'".addslashes(htmlspecialchars($parentemail))."','$coppauser','".addslashes(htmlspecialchars($homepage))."','".addslashes(htmlspecialchars($icq))."','".addslashes(htmlspecialchars($aim))."','".addslashes(htmlspecialchars($yahoo))."','".addslashes($signature)."','$adminemail','$showemail','$invisible','".addslashes($usertitle)."','".time()."','$cookieuser','".addslashes($prunedays)."','".time()."','".time()."','$newusergroupid','".addslashes($timezoneoffset)."','$emailnotification','$receivepm','$emailonpm','$options','".addslashes($birthday)."','".addslashes($umaxposts)."','".addslashes($startofweek)."','".addslashes($ipaddress)."','$pmpopup','".addslashes($testreferrerid['userid'])."','$nosessionhash','$avatarid')"); 

before this add:
PHP Code:

if($fieldX=="password"$newusergroupid=xy

replace the X with the new fieldid and the xy with the usergroupid of your DVD group

not tested but should work

groovesalad 10-12-2002 07:12 PM

I know how to find out the usergroupid, but how do I figure out the fieldID number?

groovesalad 10-12-2002 07:16 PM

nevermind, I think I got it...testing now

groovesalad 10-12-2002 07:27 PM

Doesn't work unfortunately. It just registers them under "Registered" instead of "DVD"

Xenon 10-12-2002 10:11 PM

hmm, had a second look at the code and it should work perfectly...

Is your typing correct, the password is cassensitiv.

you can add an
PHP Code:

echo $fieldX;
exit; 

after if($fieldX=="password") $newusergroupid=xy;

to see if the content of the var is correct

groovesalad 10-12-2002 10:28 PM

when I put in the echo code, when I try to register and give the correct password, the page refreshes to just a blank page. I took out that code and tried again and it still just registers the user as "Registered" and not under "DVD". Weird. Maybe I have my numbers wrong, but I have the Field ID set to the DVD group when I added that group, and I have the New User Group ID set to the Forum number. Is this correct?

groovesalad 10-12-2002 10:51 PM

I even switched the numbers around and it still doesn't work.

Xenon 10-13-2002 09:29 AM

the fieldid you'll get when you highlight the edit profilefield link and look into the status bar.

you must use the right numbers or it cannot work

groovesalad 10-13-2002 10:20 AM

Yeah, used the correct numbers. Have you tried it on your site? Maybe I have a conflicting hack interfering with it? .....don't know. Either way, thanks for your help :)

Xenon 10-13-2002 10:43 AM

yes i've tried it on my testboard now and it works perfectly.

you must have made a small mistake while hacking...

an normally there shouldn't be a conflicting hack, because it just uses a form value if the hack doesn't empty this val it should work...

groovesalad 10-13-2002 11:40 PM

Ok, let's see if I did this wrong. Here's the steps I did.

1. Went to ACP and went to ACP > User Groups > Add ( under Title, I gave it DVD ), then clicked Save

2. I placed my cursor over the EDIT link for the newly created DVD group. It showed a number of 13

3. Went to Forums & Moderators > Add. I created a private group (maybe this is the problem - it being private?) called DVD. Then clicked on Save Forum.

4. Ran my cursor over the newly created Forum and got a number of 35.

For the code, I put this:

if($field13=="test") $newusergroupid=35;

Then I went to my board as an unregistered user. I registered with a random username and put the password as "test" (w/o quotes). Then I replied to the user authentication email.

However, now when I go into my ACP and look at the newly created user, they are placed in the "Registered" category instead of the "DVD" category.

Was this correct? Thanks again for your help.

Xenon 10-14-2002 04:17 PM

ahh no i see what you've made wrong, you've missmatched some general vb terms.

step 1 and 2 are ok, usergroupid=13
step 3 and 4 are completly wrong for the instructions i meant:
section User Profile Fields > Add
add a new field lenght what you want, editable by user yes, hidden for other users in profile
after creating this field get the id and then chage the ifclause to:
if($fieldX=="test") $newusergroupid=13;
Replace the x with profilefield id

groovesalad 10-15-2002 12:11 PM

Works perfectly! Thank you :)

Do you know if there is a way to send the DVD subscribers a different User Confirmation Email once they subscribe? Something that is different than the normal "Registered" users?

If that's not possible, then maybe this:

I signed up on a board once, replied to the user confirmation email, and once I signed into the board, I got a pop up box saying I had a private message. The message was just greeting me to the board. I noticed that the PM Popup button is always set to NO when my subscribers sign up. Is there any way to get it to default to YES?

Xenon 10-15-2002 04:16 PM

you have to edit the registeroption templates to set defaults from YES to NO or the other way ;)

yes, as i say most of the time: Nearly everything is possible, but a secound email isnt as easy as this hack here, because you have to edit more than just one file ;)

groovesalad 10-15-2002 04:29 PM

Great. Well, i really appreciate your help. :)


All times are GMT. The time now is 11:05 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.01065 seconds
  • Memory Usage 1,763KB
  • 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_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (18)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete