Enthusiast: Member Count

I created this back when my fanlisting collective ran on Enthusiast; there are several others like it out there, so I'm sure this has been seen in so many different ways. Of course, Hannah's version » works just as well as mine.

Code

Place this in members.php or something similar, outside your Enthusiast admin panel. Make sure /path/to/your/main/directory/ is replaced with the absolute path to your main directory (where the config.php file is held, outside your Enthusiast admin panel).

<table class="owned" width="100%">
<thead><tr>
<th class="tc">Fanlisting</th>
<th class="tc">Member Count</th>
</tr></thead>
<?php
require("/path/to/your/main/directory/config.php");

$select = "SELECT * FROM `$db_owned` WHERE `status` = '2' ORDER BY `subject` ASC";
$true = mysql_query($select);
if($true == false) {
 exit("<p>ERROR: Oops! Looks like there is an issue!</p>\n");
}

else {
 while($getItem = mysql_fetch_array($true)) {
  $approved = mysql_num_rows(mysql_query("SELECT * FROM `" . $getItem['dbtable'] . "` WHERE `pending` = '0'"));
  $pending = mysql_num_rows(mysql_query("SELECT * FROM `" . $getItem['dbtable'] . "` WHERE `pending` = '1'"));
  echo "<tbody><tr>\n";
  echo "<td style=\"text-align: center;\">" . $getItem['subject'] . "</td>\n";
  echo "<td style=\"text-align: center;\">" . $approved . " (" . $pending . " Pending)</td>\n";
  echo "</tr></tbody>\n";
 }
}
?>
</table>

Comments

Currently no comments!

Add Comment

Details

* Comment:

Anti-SPAM


CAPTCHA Image

Submit

Log Comment?
("Log Comment" can only apply to those who have an account here at ; if you do, make sure you use the same Name and E-Mail your account uses.)

Twitter Feed »

  • New Blog Post: Listing Admin: Important Bugfix: http://ow.ly/2pWwa August 15th, 2010
  • New Blog Post: Call for Beta Testers (and a Tiny-Little-Note)!: http://ow.ly/25sVx June 30th, 2010
  • New Blog Post: Listing Admin 2.2: http://ow.ly/1XJSd June 12th, 2010