[RELEASE v2] 0-Posters, active posters, inactive posters display hack.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • DEMOLiTiON
    Member
    • Dec 2000
    • 52

    [RELEASE v2] 0-Posters, active posters, inactive posters display hack.

    Hello,
    This hack will display members that have 0 posts, or are inactive, or are active in the memberlist.
    (members that are longer than one month registered, and haven't been posted for a month will be displayed)

    Tested on php 4.0.4pl1 and vB 2.0.1
    I am still trying to make a hack to display the top 10 thread starters, if somebody can make this, please reply.

    01. memberlist.php

    Find,
    PHP Code:
      if ($what=="datejoined") {
        
    $orderby="joindate";
        
    $direction="DESC";
      } 
    Under it add,
    PHP Code:
    // memberlist hack v1.0 by demolition, aka addict
      
    if ($what=="0-posters") {
        
    $condition.=" AND posts<'1'";
        
    $orderby="";
        
    $direction="";
      }
      if (
    $what=="active") {
        
    $condition.=" AND posts>'0'";
        
    $orderby="posts";
        
    $direction="DESC";
      }
      if (
    $what=="inactive") {
        
    $lastmonth mktime (0,0,0,date("m")-1,date("d"),date("Y"));
        
    $lastmonth2 date("Y-m-d"$lastmonth);
        
    $condition.=" AND joindate<UNIX_TIMESTAMP('".addslashes(strtolower($lastmonth2))."') AND lastpost<UNIX_TIMESTAMP('".addslashes(strtolower($lastmonth2))."')";
        
    $orderby="posts";
        
    $direction="DESC";
      }
    // end memberlist hack v1.0 by demolition, aka addict 
    02. open index.php

    Find,
    PHP Code:
    $numbermembers=$numbersmembers['users']; 
    Under it add,
    PHP Code:
    // memberlist hack v1.0 by demolition, aka addict
    $snonposters=$DB_site->query_first('SELECT COUNT(*) AS users,MAX(userid) AS max FROM user WHERE posts=0');
    $nonposters=$snonposters['users'];
    $activemembers=$numbermembers-$nonposters;

    $lastmonth mktime (0,0,0,date("m")-1,date("d"),date("Y"));
    $lastmonth2 date("Y-m-d"$lastmonth);
    $sinactive=$DB_site->query_first("SELECT COUNT(*) AS users,MAX(userid) AS max FROM user WHERE joindate<UNIX_TIMESTAMP('".addslashes(strtolower($lastmonth2))."') AND lastpost<UNIX_TIMESTAMP('".addslashes(strtolower($lastmonth2))."')");
    $inactive=$sinactive['users'];
    // end memberlist hack v1.0 by demolition, aka addict 
    03. open your forumhome template, and place this code somewhere.
    Code:
    <A HREF="memberlist.php?s=$session[sessionhash]&what=0-posters">$nonposters 0-posters</A> | 
    <A HREF="memberlist.php?s=$session[sessionhash]&what=active">$activemembers active members</A> | 
    <A HREF="memberlist.php?s=$session[sessionhash]&what=inactive">$inactive non-active members</A>
    04. done
    Last edited by DEMOLiTiON; Sun 8 Jul '01, 3:31pm.
  • AS_Eagle_1
    New Member
    • May 2001
    • 10

    #2
    Nice Hack,
    If u wanna see it visit our Board
    (its on f2s till our webserver is rdy for php4)
    i've translate it in german but u can see it working.

    but there ist a small error in your code:

    <A HREF="memberlist.php?s=$session[sessionhash]&what=lamers">$nonposters 0-posters</A> |
    it must be:

    <A HREF="memberlist.php?s=$session[sessionhash]&what=0-posters">$nonposters 0-posters</A> |
    sorry for my bad english

    greets
    AS_Eagle_1
    (Sascha)

    Comment

    • DEMOLiTiON
      Member
      • Dec 2000
      • 52

      #3
      lol, forgot that sorry

      btw, how did you do that clan listing in your memberlist?
      Last edited by DEMOLiTiON; Sun 8 Jul '01, 3:12pm.

      Comment

      • AS_Eagle_1
        New Member
        • May 2001
        • 10

        #4
        this clan listing is verry simple.
        i've greated a user profile field and make it as a necesarry field.
        then i've added a new colume in the memberlist template and added in the memberlistbit
        <td bgcolor="#DFDFDF" align="center"><normalfont>$userinfo[field5]</normalfont></td>
        [field5] must be replace with the id of the userfield.

        if u wanna show the content of this field in the posts under the usrs name like location read this thread:

        Comment

        • DEMOLiTiON
          Member
          • Dec 2000
          • 52

          #5
          cool thnx

          Comment

          • Kengan
            Senior Member
            • Jul 2001
            • 103

            #6
            COOL HACK !!

            Comment

            • stefanh3
              New Member
              • Jun 2001
              • 15

              #7
              Maybe you'de like to combine it with my activity rate hack posted some time ago:

              Comment

              • Ajnabi
                Member
                • Mar 2001
                • 34

                #8
                this could be a nice hack to add to my board..

                thx

                Comment

                • ShadowTech
                  New Member
                  • Jul 2001
                  • 18

                  #9
                  One small bug I noticed ... the Active users also counts the Non-Active in the total number.

                  I dunno if it is just me.. so someone else who installed this .. add up the 3 numbers (0-posters, Active + Non active) and see if it's the same as your total registered members.

                  I tried changing the
                  PHP Code:
                  $activemembers=$numbermembers-$nonposters
                  to
                  PHP Code:
                  $activemembers=$numbermembers-$nonposters-$inactive

                  or

                  $activemembers=$numbermembers-($nonposters+$inactive); 
                  but it still didn't give me the right number for Active - inactive. All the original code is doing i removing the 0-posters from the total registered to get active.. so if a board has a lot of inactive members that have at least posted one.. you'll get some numbers that add up to a lot higher than total registered.

                  Again.. it's just a small bug.. but would be great to see a fix.

                  Comment

                  • Sinclair
                    New Member
                    • Jun 2001
                    • 12
                    • 2.3.7

                    #10
                    I´ve modified this hack, now it shows users with one post.

                    01. memberlist.php

                    find
                    PHP Code:

                      
                    if ($what=="0-posters") {
                        
                    $condition.=" AND posts<'1'";
                        
                    $orderby="";
                        
                    $direction="";
                      } 
                    under it add

                    PHP Code:
                      if ($what=="oneposters") {
                        
                    $condition.=" AND posts<'2' AND posts>'0'";
                        
                    $orderby="";
                        
                    $direction="";
                      } 
                    02. index.php

                    find

                    PHP Code:
                    $snonposters=$DB_site->query_first('SELECT COUNT(*) AS users,MAX(userid) AS max FROM user WHERE posts=0');
                    $nonposters=$snonposters['users'];
                    $activemembers=$numbermembers-$nonposters
                    under it add:

                    PHP Code:
                    $soneposters=$DB_site->query_first('SELECT COUNT(*) AS users,MAX(userid) FROM user WHERE posts=1');
                    $oneposters=$soneposters['users']; 
                    03. forumhome template

                    find:
                    <A HREF="memberlist.php?s=$session[sessionhash]&what=0-posters">$nonposters 0-posters</A> |
                    <A HREF="memberlist.php?s=$session[sessionhash]&what=active">$activemembers active members</A> |
                    <A HREF="memberlist.php?s=$session[sessionhash]&what=inactive">$inactive non-active members</A>
                    under it add:

                    <A HREF="memberlist.php?s=$session[sessionhash]&what=oneposters">$oneposters Users with one post</A>

                    Comment

                    • Chen
                      Senior Member
                      • Jun 2001
                      • 8388

                      #11
                      Originally posted by ShadowTech
                      One small bug I noticed ... the Active users also counts the Non-Active in the total number.

                      I dunno if it is just me.. so someone else who installed this .. add up the 3 numbers (0-posters, Active + Non active) and see if it's the same as your total registered members.

                      I tried changing the
                      PHP Code:
                      $activemembers=$numbermembers-$nonposters
                      to
                      PHP Code:
                      $activemembers=$numbermembers-$nonposters-$inactive

                      or

                      $activemembers=$numbermembers-($nonposters+$inactive); 
                      but it still didn't give me the right number for Active - inactive. All the original code is doing i removing the 0-posters from the total registered to get active.. so if a board has a lot of inactive members that have at least posted one.. you'll get some numbers that add up to a lot higher than total registered.

                      Again.. it's just a small bug.. but would be great to see a fix.
                      I'm having the same problem.
                      Chen Avinadav
                      Better to remain silent and be thought a fool than to speak out and remove all doubt.

                      גם אני מאוכזב מסיקור תחרות לתור מוטור של NRG הרשת ע"י מעריב

                      Comment

                      • Clueless
                        New Member
                        • Jul 2001
                        • 15

                        #12
                        How do you reset this hack for a new month ??

                        I mean i've just been setting the board up and installed this hack and it shows 9 of my members as 0-posters ??? which i need to reset it to so 0 0-posters ???????

                        Comment

                        • mister
                          Senior Member
                          • Jan 2001
                          • 223
                          • 5.0.X

                          #13
                          Originally posted by FireFly

                          I'm having the same problem.
                          Yea.
                          I'm having the problem with the active + inactive != total
                          What do you Listen-To? http://www.listen-to.com

                          i <3 vBulletin.

                          Comment

                          • mister
                            Senior Member
                            • Jan 2001
                            • 223
                            • 5.0.X

                            #14
                            i changed the calculation to this:

                            PHP Code:
                            $activemembers=$numbermembers-$inactive
                            and it seems to work, that is, inactive+active=total
                            What do you Listen-To? http://www.listen-to.com

                            i <3 vBulletin.

                            Comment

                            • DarkManX_19
                              Senior Member
                              • Mar 2001
                              • 107

                              #15
                              would it be possible to add the number of users that have been banned or restricted???

                              Comment

                              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                              Working...