• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

Bans and help tickets statistics in staff page.

Newbie Spellweaver
Joined
Dec 9, 2010
Messages
41
Reaction score
7
Recently, I've been working on modifying staff pages for my hotel , as you can see .
I've tried to integrate Statistics for ban counts and CFH answered for each staffs, but seems like hard since its using PDO, and I'm not familiar with it. I also tried different workaround but it pops out error. Fyi, I'm using BoostCMS and IIS. Much appreciate if someone could post the code for me [emoji4]
 
Newbie Spellweaver
Joined
Dec 9, 2010
Messages
41
Reaction score
7
Sorry for the thread bump. Anyway, here's the code for staff page templates.

Code:
 <?php
while (Cache::Load('Staff3', 30))
{

$Ranks = CMS::$MySql->Query("SELECT id, name FROM ranks WHERE id < 8 ORDER BY id DESC LIMIT 2");

CMS::$MySql->Prepare("SELECT username, mail, look, motto, last_online, online, roles FROM users WHERE rank = ? ORDER BY id ASC");

while ($Rank = $Ranks->fetch_assoc())
{
CMS::$MySql->Execute($Rank['id']);

?>


<div class="habblet-container">
<div class="cbb clearfix green ">
<h2 class="title"><u><?php echo $Rank['name'];?>s</u></h2>
<div style="padding:5px">

<?php

while ($User = CMS::$MySql->Fetch('username', 'mail', 'look', 'motto', 'last_online', 'online', 'roles'))
{
 ?>

<p>
<img style="position:absolute;" src="http://habbo.nl/habbo-imaging/avatarimage?figure=<?php echo $User['look']; ?>&action=wav&direction=2&head_direction=3&size=m"> <!--Thanks for pointing this out Stevehabbz -->
<p style="margin-left:80px; margin-top:20px">
<b><a href="/home/<?php echo $User['username']; ?>"><?php echo $User['username']; ?></a></b><br>
<small>Motto: <strong><?php echo $User['motto']; ?></strong></small><br>
<small>Status: <?php if ($User['online']){ ?>
<font color="darkgreen">
<b>Online</b>
</font>
<?php } else { ?>
<font color="darkred">
<b>Offline</b>
</font>
<?php } ?>
</small><br>
<small>Last Online: <?php echo date('d M, Y', $User['last_online']); ?></small><br>
<small>Roles:<strong><?php echo $User['roles'];?></strong></small><br>
</p>
<br><br><br>
<?php
}
?>

</div>
</div>
</div>

<?php
}
}
?>
 
Upvote 0
Newbie Spellweaver
Joined
Oct 21, 2012
Messages
40
Reaction score
14
PHP:
$preset = mysql_query("SELECT null FROM moderation_tickets WHERE moderator_id = '" . $member['id'] . "'");
			            $num = mysql_num_rows($preset);
			            echo "Tickets: <b>" . $num . "</b><br />";
						
						$Bans = mysql_query("SELECT * FROM `bans` WHERE `added_by` = '" . $member['username'] . "'");
                        $BanCount = mysql_num_rows($Bans);
						{
                          echo "Bans: <b>$BanCount <br />";
						}
 
Upvote 0
Newbie Spellweaver
Joined
Dec 9, 2010
Messages
41
Reaction score
7
PHP:
$preset = mysql_query("SELECT null FROM moderation_tickets WHERE moderator_id = '" . $member['id'] . "'");
            $num = mysql_num_rows($preset);
            echo "Tickets: <b>" . $num . "</b><br />";

$Bans = mysql_query("SELECT * FROM `bans` WHERE `added_by` = '" . $member['username'] . "'");
                        $BanCount = mysql_num_rows($Bans);
{
                          echo "Bans: <b>$BanCount <br />";
}
I've tried the code before, but it doesnt work for me since my current cms is using PDO variables.
 
Upvote 0
Junior Spellweaver
Joined
Nov 11, 2012
Messages
144
Reaction score
11
try this:p

Not tested
add it under the while
Code:
CMS::$MySql->Prepare('SELECT COUNT(*) FROM moderation_tickets WHERE moderator_id = ?');
CMS::$MySql->Execute($Rank->id);
$test = CMS::MySql->FetchOne('COUNT(*)');
echo $test['COUNT(*)'];
 
Upvote 0
Newbie Spellweaver
Joined
Dec 9, 2010
Messages
41
Reaction score
7
try this[emoji14]

Not tested
add it under the while
Code:
CMS::$MySql->Prepare('SELECT COUNT(*) FROM moderation_tickets WHERE moderator_id = ?');
CMS::$MySql->Execute($Rank->id);
$test = CMS::MySql->FetchOne('COUNT(*)');
echo $test['COUNT(*)'];
Thanks for trying [emoji4] unfortunately, it still won't work as it should be. Nvm, I'm closing down my retro as I'll make my cloud server as temporary test platform for Azure EMU, for a week. Mods may close this thread.
 
Upvote 0
Back
Top