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-08-2002 01:33 PM

right i also what it ot change usertitile when it gets 10 posts i have tried adding this

Code:

if($bbuserinfo[posts] == 10 AND $bbuserinfo[usergroupid]== 2 AND $bbuserinfo[usertitle] == Trial Member<br><img src="http://www.s2k2.com/forums/images/0stars.gif">) {
  $DB_site->query("UPDATE user SET usergroupid='10' WHERE userid='$bbuserinfo[userid]'");
  $DB_site->query("UPDATE user SET usertitle='1' WHERE usertitle='$bbuserinfo[usertitle]'");
}

what else do i add :D

wolfe 09-08-2002 01:40 PM

would this work :D

wolfe 09-09-2002 01:04 PM

i am having problems with this code

i added it and it works it moved people to another group on so many posts but there user title is not updating so i tried the second bit of code bu noe look please hey me :(

Code:

echo "Your User Group Is ".$bbuserinfo[usergroupid]."<br>";
echo "My Post Count is ".$bbuserinfo[posts]."<br>";

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

this one is after they have moved groups

Code:

if($bbuserinfo[posts] == 10 AND $bbuserinfo[usergroupid]== 10) {
  $DB_site->query("UPDATE user SET usertitle='New Member<br><img src="http://www.s2k2.com/forums/images/1stars.gif">' WHERE usertitle='$bbuserinfo[usertitle]'");
}

but i get an error when i add it why

clubdub 10-02-2002 02:08 AM

i know this is old, but what Logician posted didn't work for me.

This one did.
PHP Code:

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


Logician 10-02-2002 07:26 AM

Quote:

Originally posted by clubdub
i know this is old, but what Logician posted didn't work for me.

This one did.
PHP Code:

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


Well, I dont suggest using this code..

Your code is not only changing the usergroup of the poster, but updating the usergroup for ALL USERS in your database. (ones who are from usergroup 2 and post >=10). This might not be a problem to you but I want to remind you the unnecessary MYSQL server load you are creating for every post your members sent..This can especially be a problem if your post number or user number gets bigger..

The reason my code didnt work for you is probably because you didnt test it when you have exactly 10 posts. As I said in my message it will work ONLY when you are on the exact post number, not less, not much..

If you change $bbuserinfo[posts] == 10 to $bbuserinfo[posts] >= 10 in my code as I mentioned, your problem should be cured..

Learner29 10-18-2002 05:55 PM

thank you logician ......

Learner29 10-18-2002 06:02 PM

I highly appreciate your help

xs1 06-23-2003 03:33 AM

its so confusing!!!! can anyone tell me wat exactly to be added and where ?

insanctus 06-23-2003 03:55 AM

Is there any way to add an age check into this.

Say if they hit 50 posts and are 18 or over then it changes them?

The reason I ask is I have a section I want only 18 and older in and only after so many posts.

This will make my life alot easier.

allan grossman 08-29-2003 12:12 PM

I'm gonna need something like this this weekend but would prefer to run it as a job in cron.daily

What I need to do is scan the database for users who are in usergroup 2 that have more than 249 posts and change their usergroup to usergroup xx.

Could someone hook me up, please?


All times are GMT. The time now is 06:08 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.01209 seconds
  • Memory Usage 1,741KB
  • 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_code_printable
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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