Naja viel gibts nichtmehr zu sagen
Hier das Script (chat.php) :
PHP Code:
<script type="text/javascript">
$(document).ready(function(){
$('#s_loading').hide();
});
function s_refresh(){
setTimeout(function(){$("#reload").slideUp(300);},200);
setTimeout(function(){$('#s_loading').show();},200);
setTimeout(function(){$('#s_loading').hide();},1250);
setTimeout(function(){$("#reload").slideDown(300);},1200);
}
</script>
<h2>Ingame Rufchat</h2>
<?php if(isset($_SESSION['user_id'])) { ?>
<img src="img/loading_bar.gif" width="192" height="12" id="s_loading"/>
<div id="reload">
<table>
<tr>
<th class="topLine" width="130px;">Datum</th>
<th class="topLine">Nachricht</th>
</tr>
<?php
$rufChat = mysql_query("SELECT time, shout FROM log.shout_log ORDER BY time DESC LIMIT 15");
while($row = mysql_fetch_assoc($rufChat)) {
echo'<tr>';
echo '<td class="thell">'.$row['time'].'</td>';
echo '<td class="thell"><b>'.$row['shout'].'</b></td>';
echo'</tr>';
}
?>
</table>
</div>
<!-- Reload -->
<a href="index.php?s=chat" style="float:right;" onClick="s_refresh();">Aktualisieren</a>
<?php } else { echo '<p>Sie müssen für diesen Bereich angemeldet sein!</p>'; } ?>
Meine shout_log ( Ich denke mal die hat jeder, aber hier ist nochmal meine. ) :
Code:
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `shout_log`
-- ----------------------------
DROP TABLE IF EXISTS `shout_log`;
CREATE TABLE `shout_log` (
`time` datetime DEFAULT '0000-00-00 00:00:00',
`channel` tinyint(4) DEFAULT NULL,
`empire` tinyint(4) DEFAULT NULL,
`shout` varchar(64) DEFAULT NULL,
KEY `time_idx` (`time`)
) ENGINE=MyISAM DEFAULT CHARSET=big5;
-- ----------------------------
-- Records of shout_log
-- ----------------------------
INSERT INTO `shout_log` VALUES ('2013-02-23 16:28:01', '1', '3', '[Dev]Seven : Moin');
INSERT INTO `shout_log` VALUES ('2013-02-21 12:04:23', '2', '3', '[Dev]Seven : Test');
INSERT INTO `shout_log` VALUES ('2013-02-01 12:22:26', '1', '3', '[Dev]Seven : Seven :)');
Mfg
Seven
UPDATE :
Ja, kann man!Quote:
Sieht gut aus könntest du vielleicht noch hinzufügen welchem Reich der Spieler angehört der die Nachricht gesendet hat?
Hier das Script mit der Reichsanzeige (chat.php) :
PHP Code:
<script type="text/javascript">
$(document).ready(function(){
$('#s_loading').hide();
});
function s_refresh(){
setTimeout(function(){$("#reload").slideUp(300);},200);
setTimeout(function(){$('#s_loading').show();},200);
setTimeout(function(){$('#s_loading').hide();},1250);
setTimeout(function(){$("#reload").slideDown(300);},1200);
}
</script>
<h2>Ingame Rufchat</h2>
<?php if(isset($_SESSION['user_id'])) { ?>
<img src="img/loading_bar.gif" width="192" height="12" id="s_loading"/>
<div id="reload">
<table>
<tr>
<th class="topLine" width="130px;">Datum</th>
<th class="topLine">Nachricht</th>
<th class="topLine" width="40px;">Reich</th>
</tr>
<?php
$rufChat = mysql_query("SELECT time, shout, empire FROM log.shout_log ORDER BY time DESC LIMIT 15");
while($row = mysql_fetch_assoc($rufChat)) {
echo'<tr>';
echo '<td class="thell">'.$row['time'].'</td>';
echo '<td class="thell"><b>'.$row['shout'].'</b></td>';
if ($row['empire'] == 1){
echo '<td class="thell"><font color="#941818">Shinso</font></td>';
}
elseif ($row['empire'] == 2){
echo '<td class="thell"><font color="#947818">Chunjo</font></td>';
}
elseif ($row['empire'] == 3){
echo '<td class="thell"><font color="#186394">Jinno</font></td>';
}
echo'</tr>';
}
?>
</table>
</div>
<!-- Reload -->
<a href="index.php?s=chat" style="float:right;" onClick="s_refresh();">Aktualisieren</a>
<?php } else { echo '<p>Sie müssen für diesen Bereich angemeldet sein!</p>'; } ?>
Wenn ihr ne schöne Lade Animation haben wollt :
Einfach in das /img Verzeichnis ziehn.






