Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Beta Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: 1.00, by holev holev is offline
Developer Last Online: Jul 2006 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 01-10-2002 Last Update: Never Installs: 0
Is in Beta Stage  
No support by the author.

This hack checks every hour (-using a cronjob) the user db and checks every user to see if the user is regged for over a week (can be changed), if over a week - given a certain usergroupid, if not, also a certain usergroupid.

this helps me gives new users on the board limited access to forums.

Here is the code for the main and only file behind this hack:
PHP Code:
<?
#!/usr/local/bin/php -q

## MySQL Vars: ## 
$mysql_host = "localhost";
$mysql_user = "";
$mysql_pass = "";
$mysql_db = "";
## MySQL Vars End ##

mysql_connect($mysql_host,$mysql_user,$mysql_pass);
mysql_select_db($mysql_db);

// EDIT //
$nuser = 15; // User Group ID for newbie user
$tuser = 2; // User Group ID for normal users 
$timepass = 60*60*24*7; // Requires u to be regged for one week
// ---- //

$x=0;
$y=0;
$query = mysql_query("select * from user where usergroupid=$nuser") or die(mysql_error());
while($r = mysql_fetch_array($query)) {
    echo $r["username"] . " ";
    $updatedate = $r[joindate] + ($timepass);
    if(($updatedate >= time()) || ($r[posts] < 15)) {
        $disalow = mysql_query("update user set usergroupid=$nuser where userid=" . $r["userid"]) or die(mysql_error());
        if($disalow) {
            echo ".... <b><font color=red>Failed.</font></b>";
            $x++;
        }
    } else {
        $alow = mysql_query("update user set usergroupid=$tuser where userid=" . $r["userid"]) or die(mysql_error());
        if($alow) {
            echo ".... <b><font color=green>Passed.</font></b>";
            $y++;
        }
    }
    echo "<br>";
}
echo "Passed: $y | Failed: $x";
?>
This hack can work with no connection to vbb and will work nomatter where u put it on your server.

Now just create the cronjob and make it call the php and execute it as a CGI every couple of minds u decide of.

Requirements: Crontab
(you must have axx to crontab on your server)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 01-11-2002, 07:57 PM
kreftt's Avatar
kreftt kreftt is offline
 
Join Date: Dec 2001
Posts: 121
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks a lot for this

kreftt
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 03:10 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.05695 seconds
  • Memory Usage 2,203KB
  • Queries Executed 15 (?)
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)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (2)post_thanks_box
  • (2)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit_info
  • (1)postbit
  • (2)postbit_onlinestatus
  • (2)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete