Total Users Online: 0 üye, 376 guest | Tarih/Saat: 2026-08-24 05:14
 
Chat.index plugini ve küçük bir değişiklik
2011-03-22 19:14 GMT  oklu Alnt
hakan yildiz
Seditio
User is: Online status   Gender_M
Posts: 46
Ülke: Konya - 42
Meslek: Kargo
Age: 40

Uzunca bir d?nem arad???m chat.index pluginini neocrome sitesinde bulmu?tum, indirdim y?kledim ve kullanmaya ba?lad???mda g?r?nt? olarak hi? ho?uma gitmedi?i i?in kald?rd?m ve tekrar aramaya ba?lad?m

Daha sonra kaan beyin yazm?? oldu?u chat.index pluginini buldum ve onu denedim, g?r?nt? olarak ?ok ho?uma gitti fakat kendimce k?c?k bir sorun g?rd?m

Sorun ise ?u ;
Mesela herhangi birisi Selam yazm?? aradan 6 saat ge?mi? a.selam yazm??lar
<Ali42> S.a
<mustafa78> A.s abii

Buraya bir tarih eklemek istiyorum, mesela
Tarih-Saat /Ali42/ S.a
Tarih-Saat /mustafa78/ A.s abii

chat.index.php
Kod:
<?PHP

/* ====================
Land Down Under - Website engine
Copyright Neocrome
http://www.neocrome.net

[BEGIN_SED]
File=plugins/chat/chat.php
Version=122
Updated=2007
Type=Plugin
Author=Kaan
Description=
[END_SED]

[BEGIN_SED_EXTPLUGIN]
Code=chat
Part=index
File=chat.index
Hooks=index.tags
Tags=index.tpl:{CHAT_MAIN},{CHAT_OPTIONS},{CHAT_SENDBOX},{CHAT_PAGES},{CHAT_JS}
Minlevel=0
Order=10
[END_SED_EXTPLUGIN]

==================== */

if (!defined('SED_CODE')) { die('Wrong URL.'); }

require('plugins/chat/inc/chat.inc.php');


// =============== Presets



unset($chat);
$newline = sed_import('newline','P','TXT');
$c = sed_import('c','G','ALP');
$d = sed_import('d','G','INT');
$d =(empty($d)) ? 0 : $d;
$id = sed_import('id','G','INT');
$jp = sed_import('jp','G','ALP');
$chat['joinpart'] = ($jp) ? TRUE : FALSE;



// =============== Statistics

$sys['day'] = date('Y-m-d');

$hits_today = sed_chat_getstat($sys['day']);

if ($hits_today>0)
{ sed_chat_stathit($sys['day']); }
else
{ sed_chat_statcreate($sys['day']); }


// =============== Handling of the userlist

$chat_timedout = $sys['now_offset'] - $cfg['plugin']['chat']['timeout']*4850000;

$sqltmp = sed_sql_query("SELECT u.user_name, c.chat_online_userid FROM sed_chat_online AS c
LEFT JOIN $db_users AS u ON u.user_id=c.chat_online_userid
WHERE chat_online_lastseen<'".$chat_timedout."'");

while ($row = sed_sql_fetcharray($sqltmp))
{ sed_chat_addline(0, "Quits: ".sed_cc(stripslashes($row['user_name']))." (Timeout)"); }

$sqltmp = sed_sql_query("DELETE FROM sed_chat_online WHERE chat_online_lastseen<'".$chat_timedout."'");

if ($usr['maingrp']>0)
{
$sqltmp = sed_sql_query("SELECT chat_online_userid FROM sed_chat_online WHERE chat_online_userid = '".$usr['id']."'");

if ($row = sed_sql_fetcharray($sqltmp))
{
$sqltmp = sed_sql_query("UPDATE sed_chat_online SET chat_online_lastseen='".$sys['now_offset']."' WHERE chat_online_userid = '".$usr['id']."'");
}
else
        {
        $sqltmp = sed_sql_query("INSERT INTO sed_chat_online (chat_online_userid, chat_online_lastseen, chat_online_status) VALUES ('".$usr['id']."', '".$sys['now_offset']."', '0')");
sed_chat_addline(0, "Joins: ".sed_cc($usr['name']).", ".$sed_level[$usr['maingrp']]." [".$usr['level']."]");
        }
}


// =============== New line ?

if (strlen($newline)>0 && $usr['maingrp']>=$cfg['plugin']['chat']['minlevelwrite'] && $usr['maingrp']>0)
{
sed_shield_protect();
sed_chat_addline($usr['id'], $newline);

if (substr($newline,0,1)=='!')
{
$space_pos=strpos($newline, ' ');
if ($space_pos==0)
{
$c = strtolower(substr($newline, 1, 255));
$f = '';
}
else
{
$c = strtolower(substr($newline, 1, $space_pos-1));
$f = substr($newline, $space_pos, 155);
}
}
else
{
sed_redirect("index.php?e=chat&d=".$d);
exit;
}
}







// =============== Main

$chat['users'] = sed_chat_get_users();
$chat['mode'] = ($c=='edit' && $usr['maingrp']>=$cfg['plugin']['chat']['minleveladmin']) ? 'edit' : '';
$chat['channel'] = sed_chat_get_channel($d, $cfg['plugin']['chat']['numlines'], $chat['mode'], $chat['joinpart']);

$chat['sendbox'] = ($usr['maingrp']>=$cfg['plugin']['chat']['minlevelwrite']) ? "<form id=\"sb\" action=\"index.php?e=chat#sb\" method=\"post\"><input type=\"text\" class=\"text\" name=\"newline\" id=\"newline\" value=\"\" size=\"80\" maxlength=\"500\" /><input type=\"submit\" class=\"submit\" value=\"     G?nder     \"></form>" : 'Mesaj Yazmak i?in Giri? Yapmal?s?n?z..';


// =============== Options and topic

/*
$chat['options'] .= "<form id=\"settings\">Refresh delay (dev) : <select name=\"refreshdelay\" size=\"1\" onchange=\"redirect(this)\">";
$chat['options'] .= "<option value=\"index.php?e=chat\">20 seconds</option>";
$chat['options'] .= "<option value=\"index.php?e=chat\">30 seconds</option>";
$chat['options'] .= "<option value=\"index.php?e=chat\">45 seconds</option>";
$chat['options'] .= "<option value=\"index.php?e=chat\">1 minute</option>";
$chat['options'] .= "<option value=\"index.php?e=chat\">2 minutes</option>";
$chat['options'] .= "</select>";
$chat['options'] .= "</form>";
*/

$sql = sed_sql_query("SELECT COUNT(*) FROM sed_chat WHERE chat_userid>0");
$totallines = sed_sql_result($sql, 0, "COUNT(*)");

$nbpages = ceil($totallines / $cfg['plugin']['chat']['numlines']);
$curpage = $d / $cfg['plugin']['chat']['numlines'];

$chat['pagenav'] .= "Page ".(floor($d/$cfg['plugin']['chat']['numlines'])+1);
$chat['pagenav'] .= "/".ceil($totallines/$cfg['plugin']['chat']['numlines'])." &nbsp; ";
$chat['pagenav'] .= ($d==0) ? " (newest) " : '';

if (($d + $cfg['plugin']['chat']['numlines'])<$totallines)
{
$prevpage = $d + $cfg['plugin']['chat']['numlines'];
$chat['pagenav'] .= "<a href=\"index.php?e=chat&amp;d=".$prevpage."#sb\"> $sed_img_up</a> &nbsp; ";
}

if ($d>0)
{
$nextpage = $d - $cfg['plugin']['chat']['numlines'];
if ($nextpage<0) { $nextpage = 0; }
$chat['pagenav'] .= "<a href=\"index.php?e=chat&amp;d=".$nextpage."#sb\">$sed_img_down</a>";
}

for ($i = 0; $i < $nbpages; $i++)
{
$j = $i * $cfg['plugin']['chat']['numlines'];
if ($i==$curpage)
{ $chat['pages'] .= "> <a href=\"forums.php?m=posts&amp;q=$q&amp;d=".$j."\">".($i+1)."</a> < "; }

elseif (is_int(($i+1)/5) || $i<10 || $i+1==$nbpages)

{ $chat['pages'] .= "<a href=\"index.php?e=chat&amp;d=".$j."\">".($i+1)."</a> "; }
}


$jp_str = ($chat['joinpart']) ? "&jp=1" : '';
$chat['options'] .= ($usr['maingrp']>=$cfg['plugin']['chat']['minleveladmin']) ? "<a href=\"index.php?e=chat&amp;c=edit&amp;d=".$d."\">Edit</a> " : '';
$chat['pagenav'] .= ($totallines>$cfg['plugin']['chat']['numlines'] && $d>0) ? " &nbsp; <a href=\"index.php?e=chat&amp;d=0\">$sed_img_down$sed_img_down</a>" : '';
$chat['options'] .= " &nbsp; Oto yenileme ".$cfg['plugin']['chat']['refreshd']." saniye / Mesaj?n?z? Yaz?n?z.";

$chat['topic'] = sed_chat_parse($cfg['plugin']['chat']['topic']);

// =============== Outputing

$chat['main'] = "<table class=\"cells\" style=\"width:100%\">";

$chat['main'] .= "<tr><td style=\"width:100%\">".$chat['channel']."</td></tr></table>";

$t-> assign(array(
"CHAT_MAIN" => $chat['main'],
"CHAT_OPTIONS" => $chat['options'],
"CHAT_SENDBOX" => $chat['sendbox'],
"CHAT_PAGENAV" => $chat['pagenav'],
"CHAT_PAGES" => $chat['pages'],
"CHAT_JS" => sed_chat_jsclient($cfg['plugin']['chat']['refreshd'], $d, $chat['joinpart'])
));

?>


Te?ekk?r ederim ..
Konuyla İlgili Diğer Başlıklar
Can't find FULLTEXT index matching yardım
Seditio Chat 1.0 Cross Site Request Forgery
anket, eklenti ve birkaç küçük soru (:
Galeride değişiklik
xx kişi konuya cevap yazdı, forum içi istatistikler , chat plug.

Bu mesaj Kaan tarafından 2011-03-23 00:02 GMT, 5633 Gün önce düzenlendi.

 

Powered by Seditio © 2009-2012 All Rights Reserved