<?php require_once 'engine/init.php';
$casters = mysql_select_multi("SELECT `name`, `castViewers`, `castDescription` FROM `players` WHERE `online`='1' AND `cast`='1' ORDER BY `castViewers` DESC;");
$total_viewers = 0;
if ($casters !== false && !empty($casters))
foreach ($casters as $caster)
$total_viewers += (int)$caster['castViewers'];
include 'layout/overall/header.php'; ?>
<h1>Cast list</h1>
<?php if ($casters !== false && !empty($casters)): ?>
<p>There are currently <?php echo count($casters); ?> players casting with a total of <?php echo $total_viewers; ?>...
ALTER TABLE `players` ADD `cast` TINYINT NOT NULL DEFAULT '0',
ADD `castViewers` INT( 11 ) NOT NULL DEFAULT '0',
ADD `castDescription` VARCHAR( 255 ) NOT NULL
db.query("UPDATE `players` SET `castViewers` = 1 WHERE `id` = " .. getPlayerGUID(cid) .. ";")
I need a link to the source code, not the exe file.~exe file removed, potential virus~
You can make that when entering a cast, modify the table castViewers, and by the same way that when leaving that cast, modify the castViewers table again, for example:
Code:db.query("UPDATE `players` SET `castViewers` = 1 WHERE `id` = " .. getPlayerGUID(cid) .. ";")
or something similar...
<?php require_once 'engine/init.php';
$casters = mysql_select_multi("SELECT `name`, `castViewers`, `castDescription` FROM `players` WHERE `online`='1' AND `cast`='1' ORDER BY `castViewers` DESC;");
$total_viewers = 0;
if ($casters !== false && !empty($casters))
foreach ($casters as $caster)
$total_viewers += (int)$caster['castViewers'];
include 'layout/overall/header.php'; ?>
<h1>Cast list</h1>
<?php if ($casters !== false && !empty($casters)): ?>
<p>There are currently <?php echo count($casters); ?> players casting with a total of <?php echo $total_viewers; ?> viewers.</p>
<table>
<tbody>
<tr class="yellow">
<th>Name</th>
<th>Viewers</th>
<th>Description</th>
</tr>
<?php foreach ($casters as $caster): ?>
<tr>
<td><a href="/characterprofile.php?name=<?php echo $caster['name'] ?>"><?php echo $caster['name'] ?></a></td>
<td><?php echo $caster['castViewers']; ?></td>
<td><?php echo $caster['castDescription']; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php else: ?>
<p>There are currently nobody casting on this server.</p>
<?php endif;
include 'layout/overall/footer.php'; ?>