Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 06-06-2002, 05:02 PM
inetd inetd is offline
 
Join Date: Nov 2001
Posts: 332
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Mods can moderate new users

Hi!
I need subj. Who can help me?
Please!
Reply With Quote
  #2  
Old 06-06-2002, 05:20 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

haven't tested:

copy this code from admin/user.php

into mod/user.php

PHP Code:
// ###################### Start moderate + coppa #######################
if ($action=="moderate") {

  
/*
  // delete coppa entries older than 30 days
  $datecut=time()-(30*60*60*24);
  $DB_site->query("DELETE FROM user WHERE joindate<$datecut AND usergroupid=4");
  */

  
$users=$DB_site->query("SELECT userid,username,email FROM user WHERE usergroupid=4 ORDER BY username");

  if (
$DB_site->num_rows($users)==0) {
    echo 
"<p>None awaiting validation</p>";
  } else {
    
doformheader("user","domoderate");

    echo 
"<tr class='tblhead'><td><p><b><span class='tblhead'>Validate?</span></b></p></td><td><p><b><span class='tblhead'>Name</span></b></p></td><td><p><b><span class='tblhead'>Email</span></b></p></td><td><p><b><span class='tblhead'>Options</span></b></p></td></tr>\n";
    while (
$user=$DB_site->fetch_array($users)) {

      echo 
"<tr class='".getrowbg()."'><td><p> Yes<input type=\"radio\" checked name=\"validate[$user[userid]]\" value=\"1\"> No <input type=\"radio\" name=\"validate[$user[userid]]\" value=\"0\"></p></td>";
      echo 
"<td><p>$user[username]</p></td><td><p><a href=\"mailto:$user[email]\">$user[email]</a></p></td><td><p><a href=\"user.php?s=$session[sessionhash]&action=edit&userid=$user[userid]\" target=_blank>View profile</a></p></td></tr>\n";

    }

    
maketableheader("Send this email to validated users:","",1,4);
    echo 
"<tr class='".getrowbg()."'><td>Subject:</td><td colspan='3'><input type=text name=subject size=50 value=\"Your account at $bbtitle has been activated\"></td></tr>\n";

    
$gettemp=$DB_site->query_first("SELECT template FROM template WHERE title='email_validated' AND (templatesetid=-1 OR templatesetid=1) ORDER BY templatesetid DESC"); //kludgy!!
    
$template=$gettemp[template];

    echo 
"<tr class='".getrowbg()."'><td>Body:</td><td colspan='3'><textarea rows=10 cols=50 name=email>".htmlspecialchars($template)."</textarea></td></tr>\n";

    
doformfooter("Process Users","Reset",4);
  }
}

// ###################### Start do moderate and coppa #######################
if ($HTTP_POST_VARS['action']=="domoderate") {

  while (list(
$key,$val)=each($validate)) {
    if (
$val==1) {

      
$user=$DB_site->query_first("SELECT username,email FROM user WHERE userid=$key");
      
$username=unhtmlspecialchars($user[username]);

      eval(
"\$message = \"".ereg_replace("\"","\\\"",$email)."\";");
      eval(
"\$subject = \"".ereg_replace("\"","\\\"",$subject)."\";");

      
mail ($user[email],$subject,$message,"From: $webmasteremail");

      
$DB_site->query("UPDATE user SET usergroupid=2 WHERE userid=$key");
    }
  }

  echo 
"<p>Accounts validated and users notified</p>";


then just add a link to the mod-cp user.php?action=moderate

no responsibility
Reply With Quote
  #3  
Old 03-24-2003, 03:37 PM
Zelda-King's Avatar
Zelda-King Zelda-King is offline
 
Join Date: Nov 2002
Location: London, England
Posts: 674
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've tested it. It works fine, but the screen briefly looks like the attached before it resolves to the 'proper' formatting.
Attached Images
File Type: gif validate.gif (36.2 KB, 0 views)
Reply With Quote
  #4  
Old 03-24-2003, 03:46 PM
Xenon's Avatar
Xenon Xenon is offline
 
Join Date: Oct 2001
Location: Bavaria
Posts: 12,878
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

well it's the code from the acp.

i don't know why they've coded it too look like that
Reply With Quote
  #5  
Old 03-24-2003, 05:03 PM
Zelda-King's Avatar
Zelda-King Zelda-King is offline
 
Join Date: Nov 2002
Location: London, England
Posts: 674
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's just it. It doesn't. I don't know why the screen goes funny like that. It looks quite normal afterwards. It just goes like this for about a second.
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 01:26 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.03921 seconds
  • Memory Usage 2,246KB
  • Queries Executed 12 (?)
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_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (1)postbit_attachment
  • (5)postbit_onlinestatus
  • (5)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_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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete