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

Wolf42 07-04-2002 02:24 PM

@hellsatan
Yes, working on vB 2.2.6.

@Webmasta XT
You want to decide how many stars each usergroup can reach at max depending on the amout of posting? (i.e. Members max 5 stars, Mods 7 stars and Admins 8, but depending on the amount of postings)

Chris M 07-04-2002 02:29 PM

Sweet...

I'll install it then!

*installs*

Satan

Thewnagchung 07-24-2002 07:00 PM

Hi. I just cant get this hack to work, i do fine until i reach functions.php, then i get a weird error message about T_encassed or something.

here is my functions.php file, could someone edit it to the way it should be ? thanks

and im on 2.2.6 btw


Please do not post full files of vBulletin. Thank you.

Wolf42 07-25-2002 09:26 AM

This is what the instructions says:

****In admin/functions.php****

**Find
PHP Code:

if ($post['receivepm'] and $enablepms==1) {
            eval(
"\$post[pmlink] = \"".gettemplate("postbit_sendpm")."\";");
        } else {
            
$post[pmlink] = "";
        } 

In your functions.php is this line 208 to 212.

**After this insert
PHP Code:

$sli 0;
    while (
$sli $post[starlevel]) {
      
$post[stars] .= "<img src=\"{imagesfolder}/stars/$post[starimg].gif\" border=\"0\">";
      ++
$sli;
    } 

Thats all you have edit in functions.php.

Molok 08-21-2002 10:05 PM

Hello!
I become problems when i modify a User Group!
When i click on the save button this error msg will be show:

Code:

Invalid SQL: UPDATE usergroup SET title='Administrators',usertitle='Administrator',starlevel='',starimg='',cancontrolpanel=1,canmodifyprofile=1,canviewmembers=1,canview=1,showgroup=1,cansearch=1,canemail=1,canpostnew=1,canmove=1,canopenclose=1,candeletethread=1,canreplyown=1,canreplyothers=1,canviewothers=1,caneditpost=1,candeletepost=1,canusepm=,canpostpoll=,canvote=1,canpostattachment=1,ismoderator=1,canpublicedit=1,canpublicevent=1,canthreadrate=1,cantrackpm=1,candenypmreceipts=1,maxbuddypm=1,maxforwardpm=1,canwhosonline=1,canwhosonlineip=1,cangetattachment=1 WHERE usergroupid=6
mysql error: You have an error in your SQL syntax near 'canpostpoll=,canvote=1,canpostattachment=1,ismoderator=1,canpublicedit=1,canpubl' at line 1

mysql error number: 1064

Date: Thursday 22nd of August 2002 01:04:10 AM
Script: http://domain.de/admin/usergroup.php
Referer: http://domain.de/admin/usergroup.php...&usergroupid=6

I have vB 2.2.6
Can you help me?!

Wolf42 09-02-2002 11:55 AM

Sorry for my late reply, but I was on holidays.

I've checked the SQL-command and it is correct!! It must be an other problem (maybe PHP). Which version of PHP are you running?

Molok 09-02-2002 02:13 PM

its php 4.0.4

Wolf42 09-18-2002 07:53 AM

Please check you admin/usergroup.php again.
PHP Code:

$DB_site->query("UPDATE usergroup SET title='".addslashes($title)."',usertitle='".addslashes($usertitle)."',starlevel='$starlevel',starimg='$starimg',cancontrolpanel=$cancontrolpanel,canmodifyprofile=$canmodifyprofile,canviewmembers=$canviewmembers,canview=$canview,showgroup=".intval($showgroup).",cansearch=$cansearch,canemail=$canemail,canpostnew=$canpostnew,canmove=$canmove,canopenclose=$canopenclose,candeletethread=$candeletethread,canreplyown=$canreplyown,canreplyothers=$canreplyothers,canviewothers=$canviewothers,caneditpost=$caneditpost,candeletepost=$candeletepost,canusepm=$canusepm,canpostpoll=$canpostpoll,canvote=$canvote,canpostattachment=$canpostattachment,ismoderator=$ismoderator,canpublicedit=$canpublicedit,canpublicevent=$canpublicevent,canthreadrate=$canthreadrate,cantrackpm=$cantrackpm,candenypmreceipts=$candenypmreceipts,maxbuddypm=$maxbuddypm,maxforwardpm=$maxforwardpm,canwhosonline=$canwhosonline,canwhosonlineip=$canwhosonlineip,cangetattachment=$cangetattachment WHERE usergroupid=$usergroupid"); 

Thats the query where the usergroup is updated.

I don't understand why the bits canusepm and canpostpoll are set to null in you query.

Barto 10-21-2002 06:26 PM

Any one can help me to use this in v. 2.2.6?
give me an icq number pls :(

Wolf42 10-22-2002 07:30 AM

What's your problem? Support is only given here. ;)

subu1 10-28-2002 08:55 PM

ups my eng. ist not so good *g* Läuft der Hack auch auf 2.2.7?
oder bin ich nur zu doof das zu installieren.habs drin nur ich seh keine Sternchen in acp kann ich alles einstellen, sehe aber auch da keine Sterne.
achso ich habe unter anderem das gleiche Prob wie mein Vorgänger, ich habs einfach nicht drin
**Finde

maketableheader("Update Users Info</b> - </b>updates user titles<b>","",0);

das wäre ja sowieso nur optional?

whats going on, please

greetz subu1

Wolf42 10-29-2002 05:15 AM

@subu1
Grundsätzlich läuft der Hack auf 2.2.7, zumindestens bei mir. Hast Du nach der Installation auch die Benutzertitel upgedated?

subu1 11-08-2002 09:17 PM

ups, sorry habe keine Benachrichtigung bekommen, deshalb schaue ich erst jetzt nach. Muß Ihn neu einbauen denn wir haben neu 2.2.8 installiert. Danke Dir ich melde mich wieder;-)

gruß subu1

subu1 11-09-2002 06:00 PM

so hab jetzt den Fehler gefunden und zwar habe ich das hier nicht.

I dont have this, please help me

****In admin/misc.php****

**Finde

maketableheader("Update Users Info</b> - </b>updates user titles<b>","",0);

**und ersetze es mit

maketableheader("Update Benutzer-Info</b> - </b>aktualisieren der Benutzertitel und Sterne<b>","",0);

greetz subu1

subu1 11-30-2002 07:19 AM

"Bingo" :-))) He is on, jappp

thxxx wolf:-)))

Zalbard 01-03-2003 02:01 PM

Is this working in version 2.2.9? I would love to install this in mine, but I want to make sure it works. I bet it does though, should I try and be a guini pig?

Dean C 01-03-2003 03:03 PM

Yes works fine in vb 2.2.9

It's all about how you follow the instructions

If you run into any problems give me a shout and i'll help

- miSt

Zalbard 01-03-2003 03:37 PM

Great, thanks! I will install this hack right away!

Zalbard 01-03-2003 04:41 PM

Ahhh! When I get to Admin/misc.php, I can't find maketableheader("Update Users Info</b> - </b>updates user titles<b>","",0); and I tried over and over again! Wher is this line? Please help!

cono 01-05-2003 08:55 PM

can someone release the hack with correct edits for v2.2.9?

Wolf42 01-06-2003 08:28 AM

Quote:

Originally posted by Zalbard
Ahhh! When I get to Admin/misc.php, I can't find maketableheader("Update Users Info</b> - </b>updates user titles<b>","",0); and I tried over and over again! Wher is this line? Please help!
In vB 2.2.9 its line 380
PHP Code:

  maketableheader("Update User's Titles","",0); 

Seams I have to modify it again. :(

Dean C 01-06-2003 11:14 AM

A lot of people are getting problems as the releases go up..

Perhaps it's best you make this version for 2.2.9 :)?

- miSt

Angelus 01-08-2003 01:03 PM

wie kommen die stars ins getinfo ?
habe versucht folgenden code in die member.php zu kopieren:

PHP Code:

 // Stars Hack Ende
  
$sli 0;
  while (
$sli $post[starlevel]) {
    
$post[stars] .= "<img src=\"images/stars/$post[starimg].gif\" border=\"0\">";
    ++
$sli;
  }
// Stars Hack Ende 

es wir mir im userprofil nicht angezeigt :(

Wolf42 01-08-2003 01:34 PM

Hallo Angelus!

Du hast einen kleinen Denkfehler, ist aber kein Problem. Statt $post solltest Du $userinfo verwenden. Das sieht dann ungef?hr so aus:
PHP Code:

  $sli 0;
  while (
$sli $userinfo[starlevel]) {
    
$userinfo[stars] .= "<img src=\"{imagesfolder}/stars/$userinfo[starimg].gif\" border=\"0\">";
    ++
$sli;
  } 

Und im getinfo-Template f?gst Du dann irgendwo (wo Du die Sterne gerne haben m?chtest] $userinfo[stars] ein. Thats it. ;)

Angelus 01-08-2003 04:48 PM

danke für den tipp nun klappt es superstar

iceman11111 03-28-2003 03:12 AM

Please Help

after I installed this hack, whenever someone registers it doesn't send them the verification email!

Also, any email that I send via the admin options doesn't get to the user!

Wolf42 03-28-2003 05:43 AM

Did the mail-function work before installing the hack? And which version of vB are you using? Couse the hack dosn't change anything in the mail-function of vB. :confused:

iceman11111 03-28-2003 12:56 PM

Hi

Yes, everything was working before.

Ver 2.2.9

Also, I had to add a '3' to the end of every php

because I am using php3

iceman11111 03-28-2003 01:14 PM

Ok, I have semi figured it out!

I figured out that it is the stars.php file

iceman11111 03-28-2003 01:21 PM

FIXED

I had to add "error_reporting(7);"

just after the first line "<?php"


All times are GMT. The time now is 11:32 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.01511 seconds
  • Memory Usage 1,931KB
  • 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
  • (1)bbcode_code_printable
  • (11)bbcode_php_printable
  • (2)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
  • (40)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