vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   PM upon usergroup change And PM with forum password when changed... (https://vborg.vbsupport.ru/showthread.php?t=46874)

Chris M 12-21-2002 06:32 AM

PM upon usergroup change And PM with forum password when changed...
 
Right...

I've made a script that the user takes before he can access any forums...

It sorts them into a different usergroup depending on their answer;)

I am using Afterburner's password hack, as well as forum permissions for custom forums...

What I need is that when they are updated into that usergroup, they are sent the password to the custom forum that they can see...

Also - As an addon to this, I need the new password to be sent to the user's in that usergroup that can see that forum every time their Leader changes the password (the password changes every month)

Can someone help me do this, or give me the code to do it?:)

Satan

Xenon 12-21-2002 07:27 AM

well, the first one is easy, you just have to insert a new row into the privatemessage table, you should be able to do so..

the scond one should be as easy to you need a while construct:

PHP Code:

$users=$DB_site->query("SELECT userid FROM user WHERE usergroupid=XXX");
while(
$user=$DB_site->fetch_array($users)) {
  
$DB_site->query("INSERT INTO privatemessage.......");



Chris M 12-21-2002 08:24 AM

A new row?

Oh...You mean field?

There are 4 different passwords though...Can it be done?:)

Satan

Xenon 12-21-2002 08:38 AM

no i mean row :)

just use an insert into query :)

Chris M 12-21-2002 01:42 PM

How would that work?

The password is stored in the forum table, and there are 4 forums for 4 different usergroups which will have 4 different passwords:confused:

Satan

Xenon 12-21-2002 01:57 PM

PHP Code:

$pw=$DB_site->query("SELECT password FROM forum WHERE forumid=YY");
$users=$DB_site->query("SELECT userid FROM user WHERE usergroupid=XXX");
while(
$user=$DB_site->fetch_array($users)) {
  
$DB_site->query("INSERT INTO privatemessage (privatemessageid,userid,touserid,fromuserid,folderid,title,message,dateline) VALUES (NULL,$user[userid],$user[userid],1,0,'New password','".addslashes($pw[password])."',".time().")");



Chris M 12-21-2002 02:17 PM

Ah:)

Thanks Xenon:D

Satan

Xenon 12-21-2002 04:44 PM

:)
welcome


All times are GMT. The time now is 04:59 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.01004 seconds
  • Memory Usage 1,733KB
  • 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
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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