vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Change User Group By post Count (https://vborg.vbsupport.ru/showthread.php?t=43170)

wolfe 09-04-2002 08:32 PM

Change User Group By post Count
 
is there a hack out of a bit of template editing or can someone make it please :D

what i mean is like you get 10 posts you move to another group automaticly :D

g-force2k2 09-04-2002 09:23 PM

you could just manually add it in to the newthread and newreply.php files... for instance...

PHP Code:

if($bbuserinfo[posts] > 10) {
  
$DB_site->query("UPDATE user SET usergroupid='{theusergroupidhere}' WHERE userid='$bbuserinfo[userid]'");


if you're looking for something more sophistic i can help you... but i personally would just suggest using the ranking system instead :p regards...

g-force2k2

wolfe 09-04-2002 09:43 PM

thanx d00d but where do i put it

wolfe 09-04-2002 09:59 PM

not working :(

wolfe 09-04-2002 10:00 PM

i put it here under

eval("standarderror(\"".gettemplate("error_toolong ")."\");");
}

Logician 09-04-2002 10:12 PM

Put it after

PHP Code:

 $DB_site->query("UPDATE user SET
          "
.iif ($foruminfo[countposts],"posts=posts+1,","")."
          
$dotitle"."lastpost='".time()."' WHERE userid='$bbuserinfo[userid]'"); 

And I suggest using this code instead:

PHP Code:

if($bbuserinfo[posts] == 10 AND $bbuserinfo[usergroupid]==2) {
  
$DB_site->query("UPDATE user SET usergroupid='{theusergroupidhere}' WHERE userid='$bbuserinfo[userid]'");


Otherwise all your users with more than 10 posts including Admins, Mods, S.Mods etc. will end up in your new usergroup hehe

You can use $bbuserinfo[posts] > 10 instead of $bbuserinfo[posts] == 10 (as g-force suggested) and it will help you to automatically convert users with more than 10 posts whenever they post, but if you use $bbuserinfo[posts] == 10, you'll save 1 query in every new reply and thread. Of course then you need to manually update members more than 10 posts and the hack will apply to new users (members with less than 10 posts) only.. Your call..

wolfe 09-04-2002 10:33 PM

still not working :(

Logician 09-04-2002 10:43 PM

If you applied my code, you have to test it out under these conditions:
1- Testing user must be a "normal" member (usergroup id=2)
2- It should be tested at the moment he has "10" posts in your board. (Not more, not less)
3- The user must reply a thread or create a new thread to change his usergroup

wolfe 09-04-2002 10:45 PM

i have not working

Logician 09-04-2002 10:53 PM

Right before the hack code, add this:
PHP Code:

echo "My Usergroup id is ".$bbuserinfo[usergroupid]."<br>";
echo 
"My Post Count is ".$bbuserinfo[posts]."<br>"

Then test it out and tell me what it will display to you after you posted..


All times are GMT. The time now is 12:28 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.01060 seconds
  • Memory Usage 1,739KB
  • 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
  • (4)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete