vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Stars for vB2.2.1 (english/german) (https://vborg.vbsupport.ru/showthread.php?t=34626)

Crunch 06-11-2002 09:44 AM

NEWTHREAD:


Update user stuff:
PHP Code:

// update user stuff
      
$dotitle="";
      if (
$bbuserinfo[userid]!=0)
      {
if (
$foruminfo[countposts]) {
          
$usergstars=$DB_site->query_first("SELECT starlevel,starimg FROM usergroup WHERE usergroupid='$bbuserinfo[usergroupid]'");
          if (
$usergstars[starlevel]=="") {
            
$getstars=$DB_site->query_first("SELECT starlevel,starimg FROM stars WHERE minposts<=$bbuserinfo[posts]+1 ORDER BY minposts DESC LIMIT 1");
            
$userstarlvl=$getstars[starlevel];
            
$userstarimg=$getstars[starimg];
          } else {
            
$userstarlvl=$usergstars[starlevel];
            
$userstarimg=$usergstars[starimg];
          }
          
$dostars=",starlevel='$userstarlvl',starimg='$userstarimg'";
        }
        if (
$bbuserinfo[customtitle]==&& $foruminfo[countposts])
        {
          
$usergroup=$DB_site->query_first("SELECT usertitle FROM usergroup WHERE usergroupid='$bbuserinfo[usergroupid]'");
          if (
$usergroup[usertitle]=="") {
            
$gettitle=$DB_site->query_first("SELECT title FROM usertitle WHERE minposts<=$bbuserinfo[posts]".iif ($foruminfo['countposts'],"+1","")." ORDER BY minposts DESC LIMIT 1");
            
$usertitle=$gettitle[title];
          } else {
            
$usertitle=$usergroup[usertitle];
          }
          
$dotitle="usertitle='".addslashes($usertitle)."',";
        }

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




Email moderator stuff:
PHP Code:

// send email to moderators
      
if ($enableemail) {
        
$moderators=$DB_site->query_first("SELECT CONCAT(newthreademail,' ',newpostemail) AS newthreademail FROM forum WHERE forumid='$forumid'");

        
$modtable=$DB_site->query("SELECT DISTINCT user.email FROM moderator,user WHERE moderator.userid=user.userid AND forumid IN ($foruminfo[parentlist]) AND (newthreademail=1 OR newpostemail=1)");
        while(
$thismod=$DB_site->fetch_array($modtable)) {
          
$moderators['newthreademail'].=$thismod[email]";
        }

        if (
$moderators['newthreademail']!="") {
          
$mods=explode(" ",trim($moderators['newthreademail']));
          while (list(
$key,$val)=each($mods)) {

            if (
trim($val)!="") {
              
$toemail=$val;
              
$forumtitle $foruminfo['title'];
              
$threadinfo['title'] = $subject;

              eval(
"\$emailmsg = \"".gettemplate("email_moderator",1,0)."\";");
              eval(
"\$emailsubject = \"".gettemplate("emailsubject_moderator",1,0)."\";");
              
mail($toemail,$emailsubject,$emailmsg,"From: \"$bbtitle Mailer\" <$webmasteremail>");
            }
          }
        }
      }

      
// redirect
      
if ($postpoll) {
        
$goto="poll.php?s=$session[sessionhash]&threadid=$threadid&polloptions=".intval($polloptions);
      } elseif (
$visible) {
        
$goto="showthread.php?s=$session[sessionhash]&threadid=$threadid";
      } else {
        
$goto="forumdisplay.php?s=$session[sessionhash]&forumid=$forumid";
      }
      eval(
"standardredirect(\"".gettemplate("redirect_postthanks")."\",\"$goto\");");
    }
  }


NEWREPLY:

update user stuff:
PHP Code:

// update user stuff
      
$dotitle="";
      if (
$bbuserinfo[userid]!=0)
      {
if (
$foruminfo[countposts]) {
          
$usergstars=$DB_site->query_first("SELECT starlevel,starimg FROM usergroup WHERE usergroupid='$bbuserinfo[usergroupid]'");
          if (
$usergstars[starlevel]=="") {
            
$getstars=$DB_site->query_first("SELECT starlevel,starimg FROM stars WHERE minposts<=$bbuserinfo[posts]+1 ORDER BY minposts DESC LIMIT 1");
            
$userstarlvl=$getstars[starlevel];
            
$userstarimg=$getstars[starimg];
          } else {
            
$userstarlvl=$usergstars[starlevel];
            
$userstarimg=$usergstars[starimg];
          }
          
$dostars=",starlevel='$userstarlvl',starimg='$userstarimg'";
        }
        if (
$bbuserinfo[customtitle]==&& $foruminfo[countposts])
        {
          
$usergroup=$DB_site->query_first("SELECT usertitle FROM usergroup WHERE usergroupid='$bbuserinfo[usergroupid]'");
          if (
$usergroup[usertitle]=="") {
            
$gettitle=$DB_site->query_first("SELECT title FROM usertitle WHERE minposts<=$bbuserinfo[posts]".iif ($foruminfo['countposts'],"+1","")." ORDER BY minposts DESC LIMIT 1");
            
$usertitle=$gettitle[title];
          } else {
            
$usertitle=$usergroup[usertitle];
          }
          
$dotitle="usertitle='".addslashes($usertitle)."',";
        }

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

      } 

email moderator stuff:
PHP Code:

 // send email to moderators
      
if ($enableemail) {
        
$moderators=$DB_site->query_first("SELECT newpostemail FROM forum WHERE forumid='$threadinfo[forumid]'");

        
$mods=$DB_site->query("SELECT DISTINCT user.email FROM moderator LEFT JOIN user USING (userid) WHERE moderator.forumid IN ($foruminfo[parentlist]) AND moderator.newpostemail=1");
        while (
$mod=$DB_site->fetch_array($mods)) {
          
$moderators[newpostemail].=' '.$mod[email];
        }
        
$moderators[newpostemail]=trim($moderators[newpostemail]);

        if (
$moderators[newpostemail]!="") {
          
$bbuserinfo['username']=unhtmlspecialchars($bbuserinfo['username']); //for emails
          
$mods=explode(" ",$moderators[newpostemail]);
          while (list(
$key,$val)=each($mods)) {
            if (
trim($val)!="") {
              
$subject=$threadtitle;
              
$toemail=$val;

              eval(
"\$emailmsg = \"".gettemplate("email_moderator",1,0)."\";");
              eval(
"\$emailsubject = \"".gettemplate("emailsubject_moderator",1,0)."\";");

              
mail($toemail,$emailsubject,$emailmsg,"From: \"$bbtitle Mailer\" <$webmasteremail>");
            }
          }
          
$bbuserinfo['username']=htmlspecialchars($bbuserinfo['username']); //back to norm
        
}
      }

      
// redirect
      
if ($visible) {
        
$goto="showthread.php?s=$session[sessionhash]&postid=$postid#post$postid";
      } else {
        
$goto="forumdisplay.php?s=$session[sessionhash]&forumid=$threadinfo[forumid]";
      }
      eval(
"standardredirect(\"".gettemplate("redirect_postthanks")."\",\"$goto\");");
    }
  }



Wolf42 06-11-2002 09:55 AM

Look at the query above // send email to moderators (in both files), it must look like these:
PHP Code:

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

You forgot the $dostars in the query, I think you deleted that by building in the "Away-Hack"!

Crunch 06-11-2002 10:04 AM

ok i added that but those were in the update user stuff, and now no stars appear for normal members at all when i updated counters!

Crunch 06-11-2002 10:06 AM

NM it for some reason deleted all my star settings. gah oh well let me test it for a sec.

Crunch 06-11-2002 10:08 AM

YES! thanks ya wolf guy. i know i did something wrong cause it was working before i went on another hack spree. thanks again :D

Wolf42 06-11-2002 10:14 AM

Pleased that I could helped you! :cool:

Webmasta XT 06-30-2002 11:12 PM

is there a way users can have custom stars?? =P

Wolf42 07-01-2002 05:07 AM

Quote:

Originally posted by Webmasta XT
is there a way users can have custom stars?? =P
You can set custom stars to each usergroup but not to each user. ;)

But you give each user his own usergroup :D (just joking).

Webmasta XT 07-04-2002 02:08 PM

so there is no way? what I am talking about is.. we can specify what amount of stars a member can have, not all members, just the few that wanted to have low stars and stuff, and we wanted to give the admins the highest stars, is it possible?

Chris M 07-04-2002 02:14 PM

Does this work with 2.2.6?

Satan


All times are GMT. The time now is 10:38 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.01243 seconds
  • Memory Usage 1,826KB
  • 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
  • (5)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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