Announcement

Collapse
No announcement yet.

php code for # of peeps in X user group

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • php code for # of peeps in X user group

    http://130.94.172.202/clan.php

    i want to add that functionality to the above page. just a member count for that user group. what code would i add to the script to get this functionality?

  • #2
    $macnum = mysql_num_rows(mysql_query("select * from user WHERE usergroupid =XX "));

    ... I think

    Comment


    • #3
      and then the $macnum variable gets put into the appropriate template, right?

      well, whatever. i'll try this when i get home tonight.

      Comment


      • #4
        You could also do:

        $macnum = $DB_site->query("SELECT COUNT(*) AS count FROM user WHERE usergroupid='1'");

        then use $macnum[count] in the template.

        Comment


        • #5
          didn't work. i'm attaching the file in question. maybe i'll get lucky and some one will mod the file and upload it here for me.

          i changed the extension to .txt for attachment purposes.

          Comment


          • #6
            hold the phone. i'll try jame's sug.

            Comment


            • #7
              not working... due to my extremely limited php knowledge i'm sure. i'm all putting that statement in different parts of the script trying to get it working. the script kept coming up saying call to undefined function and stuff. i have no idea.

              Comment


              • #8
                shameless bump

                Comment


                • #9
                  OK, try this.. this worked for me with your templates.

                  Find (in your clan.php)
                  Code:
                  	eval("\$moderatorbits .= \"".gettemplate("showmods_bit")."\";");
                  }
                  Just under that put..
                  Code:
                  $macnum = mysql_num_rows(mysql_query("select * from user WHERE usergroupid =$clan_usergroup"));
                  then place $macnum where you want it in your clan template. lemme know if this works. http://www.talkloud.net/clan.php. note the 4 floating up there.

                  Comment


                  • #10
                    Heres the file. This works on my server.

                    Comment


                    • #11
                      it works. thx dude.

                      Comment


                      • #12
                        Sweet I was a bit worried there! Glad I could help.

                        Comment

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