Seite 1 von 1
Problem mit der "Online-Anzeige"
Verfasst: Sa 02.Sep, 2006 00:42
von baytar
Habe bei mir im Board Flashchat von Tufat,
nun wollte ich auf der Onlineanzeige die Mitglieder im Chat anzeigen.
habe den folgenden Code im "index_body.tpl" eingefügt (28 bis 31)
nun ist aber alles verschoben und Googlevisit anzeige ist auch ganz verkümmert.
was hab ich da falsch gemacht ?
Die Seite sieht momentan folgendermaßen aus
und so ist das original Aussehen der Anzeige
Code: Alles auswählen
<!-- BEGIN disable_viewonline -->
<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
<tr>
<td class="cat" colspan="2"><a href="{U_VIEWONLINE}">{L_WHO_IS_ONLINE}</a></td>
</tr>
<tr>
<td class="row1" rowspan="5"><img src="templates/fiblack3dblue/images/whosonline.gif" alt="{L_WHO_IS_ONLINE}" width="25" height="25" class="imgfolder" title="{L_WHO_IS_ONLINE}" />
</td>
<td class="row1" width="100%"><span class="gensmall">{TOTAL_POSTS}<br />
{TOTAL_USERS}<br />
{NEWEST_USER}</span></td>
</tr>
<tr>
<td class="row1"><span class="gensmall">{TOTAL_USERS_ONLINE} {COLOR_GROUPS_LIST}<br />
{RECORD_USERS}<br />
{LOGGED_IN_USER_LIST}</span></td>
</tr>
<!-- Start add - Birthday MOD -->
<tr>
<td class="row1" align="left"><span class="gensmall">{L_WHOSBIRTHDAY_TODAY}<br />{L_WHOSBIRTHDAY_WEEK}</span></td>
</tr>
<!-- End add - Birthday MOD -->
<!-- Start add - Last visit MOD -->
<tr>
<td class="row1" align="left"><span class="gensmall">{L_USERS_TODAY} {L_USERS_LASTHOUR}<br />{USERS_TODAY_LIST}</br></span></td>
</tr>
<!-- End add - Last visit MOD -->
<tr>
<td class="row1" align="left"><iframe height="100" frameborder="0" src="chat/info_embedded.php" style="width: 10\
0%; margin: 0; padding: 0; border: 0; overflow: hidden;" scrolling="no" border="0" allowtransparency="true"></iframe></td>
</tr>
<tr>
<td height="20" class="row1"><span class="gensmall">{GOOGLE_VISIT_COUNTER}<br />{L_ONLINE_EXPLAIN}</span></td>
</tr>
</table>
Verfasst: Sa 02.Sep, 2006 01:39
von oxpus
Zum einen müsste
Code: Alles auswählen
<td height="20" class="row1"><span class="gensmall">{GOOGLE_VISIT_COUNTER}<br />{L_ONLINE_EXPLAIN}</span></td>
durch
Code: Alles auswählen
<td colspan="2" height="20" class="row1"><span class="gensmall">{GOOGLE_VISIT_COUNTER}<br />{L_ONLINE_EXPLAIN}</span></td>
oder besser
Code: Alles auswählen
<td></td><td height="20" class="row1"><span class="gensmall">{GOOGLE_VISIT_COUNTER}<br />{L_ONLINE_EXPLAIN}</span></td>
ersetzt werden und dann in der eingebundenen Datei chat/info_embedded.php die Schriftfarbe angepasst. Schwarz auf dunkelbraun ist immer schwer zu lesen

Verfasst: Sa 02.Sep, 2006 10:04
von baytar
danke Oxpus es ist wieder alles gerade und nicht verschoben
Die Chaträume und die darin befindlichen User (ANzahl) konnte ich jetzt in gelber schrift darstellen
aber die Überschrift und die Nicknamen sind immer noch schwarz
und ich finde kein farbcode, den ich ändern kann
hier mein "info_embedded.php"
Code: Alles auswählen
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
/**
If this file is not in the FlashChat root folder, then change this
path to the location of the inc/common.php file.
*/
require_once('inc/common.php');
ChatServer::purgeExpired();
/**
Retrieves the number of users who are chatting in any room.
Leave the $room parameter empty to return the number of users in all room.
*/
function numusers( $room = "" )
{
if($room) {
$stmt = new Statement("SELECT COUNT(*) AS numb FROM {$GLOBALS['fc_config']['db']['pref']}connections WHERE userid IS NOT NULL AND roomid=?");
$rs = $stmt->process($room);
} else {
$stmt = new Statement("SELECT COUNT(*) AS numb FROM {$GLOBALS['fc_config']['db']['pref']}connections,{$GLOBALS['fc_config']['db']['pref']}rooms
WHERE userid IS NOT NULL AND ispublic IS NOT NULL
AND {$GLOBALS['fc_config']['db']['pref']}connections.roomid = {$GLOBALS['fc_config']['db']['pref']}rooms.id");
$rs = $stmt->process();
}
$rec = $rs->next();
return $rec?$rec['numb']:0;
}
/**
Retrieves a list of the users (by login ID) who are in $room.
Leave the $room parameter empty to return a list of all users in all rooms.
*/
function usersinroom( $room = "" )
{
$list = array();
if($room) {
$stmt = new Statement("SELECT userid, state, color, lang, roomid FROM {$GLOBALS['fc_config']['db']['pref']}connections WHERE userid IS NOT NULL AND roomid=?");
$rs = $stmt->process($room);
} else {
$stmt = new Statement("SELECT userid, state, color, lang, roomid FROM {$GLOBALS['fc_config']['db']['pref']}connections WHERE userid IS NOT NULL");
$rs = $stmt->process();
}
while($rec = $rs->next())
{
$usr = ChatServer::getUser($rec['userid']);
if($usr == null && $GLOBALS['fc_config']['enableBots']) $usr = $GLOBALS['fc_config']['bot']->getUser($rec['userid']);
$list[] = array_merge($usr, $rec);
}
return $list;
}
/**
Retrieves a list of all available rooms, as an array.
*/
function roomlist()
{
$list = array();
// populate $list with the names of all available rooms
$stmt = new Statement("SELECT * FROM {$GLOBALS['fc_config']['db']['pref']}rooms WHERE ispublic IS NOT NULL order by ispermanent");
$rs = $stmt->process();
while($rec = $rs->next()) $list[] = $rec;
//result will be an array of arrays like ('id' => <room id>, 'updated' = <timestamp>, 'created' => <timestamp>, 'name' => <room name>, 'ispublic' => <public flag>, 'ispermanent' => <autoclose flag>)
return $list;
}
$rooms = roomlist();
$roomnumb = sizeof($rooms);
$usernumb = numusers();
?>
<html>
<title>Who's in the chat?</title>
<meta http-equiv=Content-Type content="text/html; charset=UTF-8">
<head>
<style type="text/css">
<!--
body { background-color: transparent; margin: 0; padding: 0; font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: normal; font-size: 10px;}
....normal {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 10px;
font-weight: normal;
margin: 0; padding: 0;
text-align: center;
}
#roomList { margin: 0; padding: 0; }
#roomList a { color: yellow; text-decoration: none; } #roomList a:hover { text-decoration: underline; }
....userList { margin-left: 7px; margin-right: 0; margin-bottom: 0; margin-top: 0; padding: 0; }
-->
</style>
<script type="text/javascript">
function toggleUserList(id) {
if (l = document.getElementById(id)) {
if (l.style.display == '' || l.style.display == 'block') l.style.display = 'none';
else l.style.display = 'block';
}
return false;
}
</script>
</head>
<body>
<p class=normal><?php echo $usernumb ?> user<?php if ($usernumb != 1) echo "s" ?> in <?php echo $roomnumb ?> room<?php if ($roomnumb != 1) echo "s"; ?>.</p>
<ul id="roomList">
<?php if($roomnumb) { ?>
<?php foreach($rooms as $room) { ?>
<li><strong><a href="#" onclick="javascript:toggleUserList('room_<?php echo $room['id']?>')"><?php echo $room['name']?> (<?php echo numusers($room['id']) ?>)</a></strong>
<?php
$users = usersinroom($room['id']);
if ($users) {
echo "<ul class=\"userList\" id=\"room_".$room['id']."\">";
foreach( $users as $user ) {
echo "<li>".$user['login'] . "</li>";
}
echo "</ul>";
}
?> </li>
<?php } ?>
<?php } ?>
</ul>
</body>
</html>
Verfasst: Sa 02.Sep, 2006 10:51
von oxpus
Hm...
Trag mal in der Datei vor
das hier ein:
Verfasst: Sa 02.Sep, 2006 11:05
von baytar
habs folgendermaßen eingefügt aber keine Änderung
Code: Alles auswählen
li {color: #FFFFFF; }#roomList { margin: 0; padding: 0; }
#roomList a { color: yellow; text-decoration: none; } #roomList a:hover { text-decoration: underline; }
....userList { margin-left: 7px; margin-right: 0; margin-bottom: 0; margin-top: 0; padding: 0; }
Verfasst: Sa 02.Sep, 2006 11:46
von oxpus
Öh, Du musst vor #roomList auch einen Zeilenumbruch einfügen!
Verfasst: Sa 02.Sep, 2006 11:52
von Christian_N
kann es sein das roomlist auskommentiert ist mit dem # weil yellow steht ja drin wenn der diese style abrufen würde müsste es auch gelb sein, vllt. mal des # entfernen?
Code: Alles auswählen
roomList { margin: 0; padding: 0; }
roomList a { color: yellow; text-decoration: none; }
roomList a:hover { text-decoration: underline; }
....userList { margin-left: 7px; margin-right: 0; margin-bottom: 0; margin-top: 0; padding: 0; }
nur so eine Idee von mir

Verfasst: Sa 02.Sep, 2006 15:09
von baytar
habs endlich geschafft
Code hab ich folgendermaßen geändert:
Code: Alles auswählen
<!--
body { background-color: transparent; margin: 0; padding: 0; font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; font-size: 10px; color: #FFFF00;}
....normal {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
font-weight: bold;
margin: 0; padding: 0;
text-align: left;
}
{color: #FFFFFF; }
#roomList { margin: 0; padding: 0; }
#roomList a { color: cyan; text-decoration: none; } #roomList a:hover { text-decoration: underline; }
....userList { margin-left: 7px; margin-right: 0; margin-bottom: 0; margin-top: 0; padding: 0; }
-->