nickpage work

This commit is contained in:
genuineparts 2025-06-25 22:17:29 +02:00
parent 45ca500cc3
commit 0637c14b23
5 changed files with 76 additions and 82 deletions

View file

@ -24,18 +24,7 @@ class chat extends module{
} else {
$befinden="sind";
}
/*$nicks="";
if($session->userdata['rp_admin']==1){
$result=$db->query("SELECT * FROM `" . $config["prefix"] . "rp_chars` WHERE (`uid`='".$session->userdata['uid']."' OR `uid`='0') ORDER BY `uid` DESC") or die($db->error());
}else{
$result=$db->query("SELECT * FROM `" . $config["prefix"] . "rp_chars` WHERE `uid`='".$session->userdata['uid']."'") or die($db->error());
}
while($row=$db->fetch_array($result)){
$nicks.='<option value="'.$row['id'].'">'.$row['name'].'</option>';
}
if($db->num_rows($result)<=0){
$core->message('Sorry', 'You have to create a <a href="/create_char.html">Char</a> to participate.',FALSE,$config['path'].'/index.php');
}*/
$rooms=array(array('room'=>'Lounge','selected'=>'selected="selected"'),array('room'=>'Flirt','selected'=>''),array('room'=>'Quiz','selected'=>''));
$this->tpl->assign('options',$rooms);
if($session->userdata['allow_grimdark']==0){
@ -45,10 +34,8 @@ class chat extends module{
}
unset($data['usercount']);
unset($data['gdusercount']);
$meta.=$this->xmeta();
$this->tpl->assign('user', $data);
$this->tpl->assign('befinden',$befinden);
$this->tpl->assign('nicks',$nicks);
return $this->tpl->fetch('chat.tpl', 'chat_front');
}else{
$core->message('Sorry', 'Scheint so als h&auml;tte der Chat gerade Probleme. Wir k&uuml;mmern uns sofort darum!',FALSE,$config['path'].'/index.php');
@ -72,20 +59,6 @@ class chat extends module{
}
}
$subs=array('1'=>'Enter','2'=>'Shift+Enter');
/*$result=$db->query("SELECT `uid`,`pr_only` FROM `" . $config["prefix"] . "rp_chars` WHERE `id`='".$db->escape($_POST['nick'])."'") or die($db->error());
$row=$db->fetch_array($result);
if($row['pr_only']=='true' && $_POST['room']!='Ponyopolis'){
$_POST['room']='Chitchat';
}
if($row['uid']!=$session->userdata['uid'] && $session->userdata['rp_admin']!=1){
$core->message('HACK!','You tried something fishy! It has been logged.');
}*/
$opts=array(
"ssl"=>array(
"verify_peer"=>false,
"verify_peer_name"=>false,
),
);
$ch = curl_init();
// setze die URL und andere Optionen
@ -102,11 +75,6 @@ class chat extends module{
// schließe den cURL-Handle und gebe die Systemresourcen frei
curl_close($ch);
if ($fh) {
/*$buffer = '';
while (!feof($fh)) {
$buffer .= fgets($fh, 512);
}
fclose($fh);*/
$buffer = trim($fh);
}
@ -132,11 +100,6 @@ class chat extends module{
$whisper=$row['whisperwindow'];
}
$meta.= '<script> var yacsid="'.$cookie.'";var subm="'.$sub.'"; var col="'.$col.'"; var chid="'.$session->userdata['uid'].'"; var whwind='.$whisper.'; var ncounter='.$nc.'; var nickcheck = /(\b'.$nick.'\b)/gi;</script>';
if($bg=='true'){
$bgtext='BG Music: On';
}else{
$bgtext='BG Music: Off';
}
if($whisper=='true'){
$whtext='F&uuml;sterfenster: An';
}else{
@ -155,11 +118,11 @@ class chat extends module{
}else{
$simg='<span style="color:#'.$col.';">'.$nick.':</span>';
}
$content = "";
$tpl->assign('cookie', $cookie);
$tpl->assign('username', $nick);
$tpl->assign('id', $_POST['nick']);
$this->titleaddon = $nick.' - ';
$tpl->assign('bgmusic', $bgtext);
$tpl->assign('whtext', $whtext);
$tpl->assign('ooctext', $ooctext);
$tpl->assign('submit', $subs[$sub]);
@ -178,7 +141,8 @@ class chat extends module{
}
}
function output_online(){
$data=chat_online();
global $core, $config;
$data=chat_online();
unset($data["usercount"]);
unset($data["gdusercount"]);
if (!$data["chat_offline"]) {
@ -190,7 +154,7 @@ class chat extends module{
}
function output_editlog(){
global $session,$config,$db,$tpl,$core,$plugin,$meta;
global $session,$config,$db,$core,$meta;
$meta.= '<script type="text/javascript"> var chid="'.$_GET['id'].'"</script>';
$logs=$db->query("SELECT c.*, u.`username` FROM `" . $config["prefix"] . "conversations` c LEFT JOIN `" . $config["prefix"] . "users` u ON u.`uid`=c.`owner` WHERE c.`owner`='".$session->userdata['uid']."' AND c.`id`='".intval($_GET['id'])."'");
if($db->num_rows($logs)<=0){
@ -210,7 +174,6 @@ class chat extends module{
}
$this->tpl->assign('share',$share);
$this->tpl->assign('id',intval($_GET['id']));
$this->tpl->assign('logdata',$logdata);
return $this->tpl->fetch('editlog.tpl', 'editlog');
}
@ -224,7 +187,7 @@ class chat extends module{
while($delid=$db->fetch_array($did)){
$ids[]=$delid['id'];
}
$sql="DELETE FROM `" . $config["prefix"] . "conversations` WHERE `id` in('".join($ids,'\',\'')."')";
$sql="DELETE FROM `" . $config["prefix"] . "conversations` WHERE `id` in('".join('\',\'', $ids)."')";
$db->query($sql);
$db->query("DELETE FROM `" . $config["prefix"] . "private_logs` WHERE `cid`='".$rowl['id']."'");
}else{
@ -333,12 +296,12 @@ class chat extends module{
$core->message('Sorry', "You have to be logged in to participate.");
}else{
$date='';
$logs='';
$logs = array();
$cd='';
if(isset($_POST['nicks']) && $_POST['nicks']!=""){
$chars=explode(', ',$_POST['nicks']);
array_pop($chars);
$char = '\''.join ($chars,'\',\'').'\'';
$char = '\''.join ('\',\'', $chars).'\'';
$cd = ' AND `user` IN ('.$char.')';
}
@ -451,6 +414,7 @@ class chat extends module{
$tpl->assign('nrep',$nrep);
$tpl->assign('rep',$rep);
$meta.= $this->repmeta();
$content = "";
$core->make_page($content,TRUE,$config['fullpath'].'/modules/chat/templates/default/reports.tpl',$config['fullpath'].'/modules/chat/templates/default/chat_header.tpl',$config['fullpath'].'/modules/chat/templates/default/chat_footer.tpl');
}else{
//echo "SELECT r.*,u.username,u.fuid,c.name,r.fuid as `cpid`,s.username as `cname` FROM `ptc_reports` r LEFT JOIN `" . $config["prefix"] . "users` u ON u.`uid`=r.`rpid` LEFT JOIN `" . $config["prefix"] . "users` s ON s.`uid`=r.`uid` LEFT JOIN `" . $config["prefix"] . "rp_chars` c ON c.`id`=r.`chid` WHERE `seen`='0' AND r.`uid`='". intval($_GET['uid']) ."' ORDER BY `time` DESC";
@ -467,32 +431,15 @@ class chat extends module{
$tpl->assign('nrep',$nrep);
$tpl->assign('rep',$rep);
$meta.= $this->repmeta();
$content = "";
$core->make_page($content,TRUE,$config['fullpath'].'/modules/chat/templates/default/reports.tpl',$config['fullpath'].'/modules/chat/templates/default/chat_header.tpl',$config['fullpath'].'/modules/chat/templates/default/chat_footer.tpl');
}
}
}
}
function xmeta(){
$meta='<script type="text/javascript" src="'.$config["path"].'/js/jquery/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
if ("WebSocket" in window){
document.getElementById("sock").checked=true;
document.getElementById("sock").disabled=false;
}else{
document.getElementById("sock").checked=false;
document.getElementById("sock").disabled=true;
}
});
</script>';
return $meta;
}
function repmeta(){
global $yacsid,$config;
global $yacsid,$config, $meta;
$meta.="<script src=\"//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js?ver=1213232\"></script>
<link type=\"text/css\" href=\"/themes/funchat/base/jquery-ui-1.9.2.custom.css?ver=1238732\" rel=\"Stylesheet\" />
<script src=\"//ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js?ver=123324732\"></script>
@ -1108,7 +1055,8 @@ function inmeta2(){
}
function meta_editlog(){
$meta="<script type=\"text/javascript\" src=\"".$config["path"]."/js/jquery/jquery.min.js\"></script>
global $config;
$meta="<script type=\"text/javascript\" src=\"".$config["path"]."/js/jquery/jquery.min.js\"></script>
<script type=\"text/javascript\" src=\"".$config["path"]."/js/jquery/jquery-ui.min.js\"></script>
<link rel=\"stylesheet\" media=\"screen\" type=\"text/css\" href=\"".$config["path"]."/themes/austria/smoothness/jquery-ui-1.8.18.custom.css\" />
<script type='text/javascript'>
@ -1198,8 +1146,10 @@ function inmeta2(){
</script>";
return $meta;
}
function footer_logs(){
$footer.="<script type=\"text/javascript\" src=\"".$config["path"]."/js/jquery/jquery.min.js\"></script>
global $config, $footer;
$footer.="<script type=\"text/javascript\" src=\"".$config["path"]."/js/jquery/jquery.min.js\"></script>
<script type=\"text/javascript\" src=\"".$config["path"]."/js/jquery/jquery-ui.min.js\"></script>
<link rel=\"stylesheet\" media=\"screen\" type=\"text/css\" href=\"".$config["path"]."/themes/austria/smoothness/jquery-ui-1.8.18.custom.css\" />";
return $footer;