Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > PHP > PHP Forum > ระบบ chat phpnuke ติดตั้งแล้วชื่อ user ที่ออนไลน์เป็นภาษาต่างดาว แก้อย่างไรครับ



 

ระบบ chat phpnuke ติดตั้งแล้วชื่อ user ที่ออนไลน์เป็นภาษาต่างดาว แก้อย่างไรครับ

 



Topic : 065343



โพสกระทู้ ( 11 )
บทความ ( 0 )



สถานะออฟไลน์




เป็นภาษาเหมือนที่อยู่ในภาพ

และลิงค์ข้างล่างนี้เป็นcode ระบบ chat ที่ติดตั้ง http://www.nukecoder.com/shop_download-file-13.html



Tag : PHP







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2011-08-25 01:53:24 By : ilovefacebook View : 1303 Reply : 9
 

 

No. 1



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

Code
<meta http-equiv=Content-Type content="text/html; charset=tis-620">


or

Code
<meta http-equiv=Content-Type content="text/html; charset=utf-8">



Go to : แก้ปัญหาภาษาไทย php กับ MySQL (TIS-620 กับ UTF-8)






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-08-25 06:23:23 By : webmaster
 


 

No. 2



โพสกระทู้ ( 11 )
บทความ ( 0 )



สถานะออฟไลน์


ผมเป็นมือใหม่ครับ ไม่ทราบว่าแก้ตรงไหนหรอครับ งงมากๆ อ่านบทความแล้วก็ยังงงครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-08-25 18:19:34 By : ilovefacebook
 

 

No. 3



โพสกระทู้ ( 2,311 )
บทความ ( 1 )



สถานะออฟไลน์


Code (PHP)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-08-25 18:34:51 By : arm8957
 


 

No. 4



โพสกระทู้ ( 11 )
บทความ ( 0 )



สถานะออฟไลน์


code นี้เพิ่ม ทุกไฟล์ในระบบ chat หรือ แค่บางไฟล์ถ้าบางไฟล์เป็นไฟล์ไหนครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-08-25 21:18:43 By : ilovefacebook
 


 

No. 5



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

ทุกไฟล์ครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-08-25 21:45:06 By : webmaster
 


 

No. 6



โพสกระทู้ ( 11 )
บทความ ( 0 )



สถานะออฟไลน์


ลองแล้วก็ไม่ได้ครับมันขึ้น Error accessing the server!
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-08-26 21:13:36 By : ilovefacebook
 


 

No. 7



โพสกระทู้ ( 11 )
บทความ ( 0 )



สถานะออฟไลน์


ทำอย่างไรดีครับ ปวดหัวมาก นี่เป็นตัวโปรแกรมครับ http://www.nukecoder.com/shop_download-file-13.html
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-08-26 22:02:34 By : ilovefacebook
 


 

No. 8



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

มันมีปัญหาแค่ Charset นี่แหละ ถ้าแก้ได้ก็ไม่ยากครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-08-27 08:26:55 By : webmaster
 


 

No. 9



โพสกระทู้ ( 11 )
บทความ ( 0 )



สถานะออฟไลน์


ต้องแก้ตรงไหนอย่างไรครับ

Code
<?php

// define table names
define('TABLE_CHAT', $prefix.'_live_chat');
define('TABLE_ONLINE', $prefix.'_live_online');

// define some options
define('MESSAGE_LIMIT', 50);// how many of the newest messages to get initially

// error handler for the backed chat
function error_handler($errNo, $errStr, $errFile, $errLine)
{
if(ob_get_length()) ob_clean();
$error_message = 'ERRNO: '.$errNo."\n".'TEXT: '.$errStr."\n".'LOCATION: '.$errFile.', line '.$errLine;
echo $error_message;
exit;
}


class Chat
{

private $db;

// you can add and remove text colors here
public $textColors = array
(
'Default' => '',
'Black' => '#000000',
'White' => '#FFFFFF',
'Yellow' => '#FFFF00',
'Red' => '#FF0000',
'Blue' => '#0000FF',
'Green' => '#008000',
'Gray' => '#808080',
'Purple' => '#800080',

'Fuchsia' => '#FF00FF',
'Silver' => '#C0C0C0',
'Olive' => '#808000',
'Maroon' => '#800000',
'Aqua' => '#00FFFF',
'Lime' => '#00FF00',
'Teal' => '#008080',
'Navy' => '#000080'
);

// you can add or remove text sizes here
public $textSizes = array
(
'Default' => '',
'X-Large' => '24px',
'Large' => '18px',
'Normal' => '12px',
'Small' => '9px',
'X-Small' => '7px'
);

// you can add or remove smilies here
public $smilies = array
(
'8)' => '<img src="modules/Forums/images/smiles/icon_cool.gif" title="Cool" alt="" />',
'80' => '<img src="modules/Forums/images/smiles/icon_eek.gif" title="Shocked" alt="" />',
':!:' => '<img src="modules/Forums/images/smiles/icon_exclaim.gif" title="Exclamation" alt="" />',
':(' => '<img src="modules/Forums/images/smiles/icon_sad.gif" title="Sad" alt="" />',
':)' => '<img src="modules/Forums/images/smiles/icon_smile.gif" title="Smile" alt="" />',
':?:' => '<img src="modules/Forums/images/smiles/icon_question.gif" title="Question" alt="" />',
':?' => '<img src="modules/Forums/images/smiles/icon_confused.gif" title="Confused" alt="" />',
':D' => '<img src="modules/Forums/images/smiles/icon_biggrin.gif" title="Very Happy" alt="" />',
':P' => '<img src="modules/Forums/images/smiles/icon_razz.gif" title="Razz" alt="" />',
':|' => '<img src="modules/Forums/images/smiles/icon_neutral.gif" title="Neutral" alt="" />',
':arrow:' => '<img src="modules/Forums/images/smiles/icon_arrow.gif" title="Arrow" alt="" />',
':cry:' => '<img src="modules/Forums/images/smiles/icon_cry.gif" title="Crying or Very Sad" alt="" />',
'' => '<img src="modules/Forums/images/smiles/icon_evil.gif" title="Evil or Very Mad" alt="" />',
'' => '<img src="modules/Forums/images/smiles/icon_idea.gif" title="Idea" alt="" />',
'' => '<img src="modules/Forums/images/smiles/icon_lol.gif" title="Laughing" alt="" />',
':mrgreen:' => '<img src="modules/Forums/images/smiles/icon_mrgreen.gif" title="Mr. Green" alt="" />',
':oops:' => '<img src="modules/Forums/images/smiles/icon_redface.gif" title="Embarassed" alt="" />',
':o' => '<img src="modules/Forums/images/smiles/icon_surprised.gif" title="Surprised" alt="" />',
'' => '<img src="modules/Forums/images/smiles/icon_rolleyes.gif" title="Rolling Eyes" alt="" />',
':twisted:' => '<img src="modules/Forums/images/smiles/icon_twisted.gif" title="Twisted Evil" alt="" />',
':wink:' => '<img src="modules/Forums/images/smiles/icon_wink.gif" title="Wink" alt="" />',
':x' => '<img src="modules/Forums/images/smiles/icon_mad.gif" title="Mad" alt="" />',
);


function __construct()
{
global $db;
$this->db = $db;

}

public function __destruct()
{

}

// this contains the layout of the chat block, edit carefully ;)
public function showChat($show_status = 0)
{
global $bgcolor2;
$module_name = 'Live_Chat';
$smilies = $this->smilies;
$smilie_line = '';
if (count($smilies) > 0)
{
foreach ($smilies as $code => $image)
{
$smilie_line .= '<a href="#" onclick="document.getElementById(\'messageBox\').value += \''.$code.' \'; return false;">'.$image.'</a>&nbsp; ';
}
}

$color_select = '';
if (count($this->textColors) > 0)
{
$color_select .= '<select name="textColor" id="textColor">'."\n";
foreach ($this->textColors as $name => $hex)
{
$color_select .= '<option value="'.$hex.'" '.(empty($hex) ? '' : 'style="color: '.$hex.'"').'>'.$name.'</option>'."\n";
}
$color_select .= '</select>';
}

$size_select = '';
if (count($this->textSizes) > 0)
{
$size_select .= '<select name="textSize" id="textSize">'."\n";
foreach ($this->textSizes as $name => $size)
{
$size_select .= '<option value="'.$size.'">'.$name.'</option>'."\n";
}
$size_select .= '</select>';
}

$chatBox = '
<script type="text/javascript" src="modules/'.$module_name.'/chat.js"></script>
<script type="text/javascript">bgcolor2 = "'.$bgcolor2.'";</script>
';
if ($show_status == 1)
{

$chatBox .= '
<script type="text/javascript">show_status = 1;</script>
<div id="status" style="background-color: '.$bgcolor2.'; width: 80px; height: 14px; padding-left: 2px; position: relative; font-weight: bold; z-index: 101;">Status</div>
';
}

$chatBox .= '
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" style="width: 100%;">
<div id="scroll" style="border: 1px solid '.$bgcolor2.';position: relative; height: 260px; overflow: auto; padding: 2px; text-align: justify;"></div>
</td>
<td valign="top" style="width: 140px;">
<div id="online" style="margin-left: 2px; border: 1px solid '.$bgcolor2.';position: relative; width: 138px; height: 260px; overflow: auto; padding: 2px; text-align: justify;"></div>
</td>
</tr>
<tr>
<td valign="top" colspan="2">
<div style="border: 1px solid'.$bgcolor2.'; margin-top: 2px; padding: 4px;" align="center">
<div style="margin-bottom: 4px;">
Font Size: '.$size_select.'&nbsp;&nbsp;
Font Color: '.$color_select.'&nbsp;&nbsp;

<span style="cursor: pointer; padding: 3px 8px 1px 8px; border: 1px solid black; text-align: center; font-weight: bold;" id="bold" onclick="toggleStyle(\'bold\', \'textBold\');">B</span>&nbsp;
<input type="hidden" name="textBold" id="textBold" value="" />
<span style="cursor: pointer; padding: 3px 8px 1px 8px; border: 1px solid black; text-align: center; font-style: italic;" id="italic" onclick="toggleStyle(\'italic\', \'textItalic\');">I</span>&nbsp;
<input type="hidden" name="textBold" id="textItalic" value="" />
<span style="cursor: pointer; padding: 3px 8px 1px 8px; border: 1px solid black; text-align: center; text-decoration: underline;" id="underline" onclick="toggleStyle(\'underline\', \'textUnderline\');">U</span>&nbsp;
<input type="hidden" name="textBold" id="textUnderline" value="" />

<span style="cursor: pointer; position: relative; top: 4px;" id="smilebutton" onclick="overlayElement(\'smile\', \'smilebutton\');"><img src="modules/'.$module_name.'/images/smilies.png" alt="Smilies" title="Smilies" /></span>
<div id="smile" style="display: none; position: absolute; width: 100px; background-color: '.$bgcolor2.'; border: 1px solid black; padding: 2px; margin-top: 4px;">'.$smilie_line.'</div>

</div>

<input type="text" id="messageBox" maxlength="2000" style="width: 80%" onkeydown="handleKey(event)"/>
<input type="button" id="sendMessage" value="Send" onclick="sendMessage();" />&nbsp;&nbsp;
'.(!empty($_GET['pop']) ? '' : '<span style="cursor: pointer; position: relative; top: 4px;" id="poplink" onclick="chatWindow(\'modules.php?name='.$module_name.'&amp;pop=1\',\'chatWin\',\'640\',\'360\');return false"><img src="modules/'.$module_name.'/images/window.png" alt="Popup Chat Window" title="Popup Chat Window" /></span>').'

<span style="cursor: pointer; position: relative; top: 4px;" onclick="stopChat();"><img src="modules/'.$module_name.'/images/stop.png" id="switch" alt="Stop Chat" title="Stop Chat" /></span>
</div>
<!-- <input type="button" value="Stop Updating" id="switch" onclick="stopChat();" /><br /> -->
</td>
<!-- <td valign="top" style="width: 140px;"></td> -->
</tr>
</table>
';

return $chatBox;
}
// end layout

private function getMessages($id = 0, $deny = false)
{
$id = intval($id);
if($id > 0)
{
$query = 'SELECT * FROM '.TABLE_CHAT.' WHERE id > ' . $id . ' ORDER BY id ASC';
}
else
{
$query = 'SELECT * FROM '.TABLE_CHAT.' WHERE id > (SELECT MAX( id ) - '.MESSAGE_LIMIT.' FROM '.TABLE_CHAT.') ORDER BY id ASC LIMIT '.MESSAGE_LIMIT;
}
$result = $this->db->sql_query($query);
$response = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';
$response .= '<response>';
$response .= '<online>';

$query2 = 'SELECT * FROM '.TABLE_ONLINE.' WHERE timestamp>\''.(time() - 60).'\' ORDER BY username ASC';
$result2 = $this->db->sql_query($query2);
if($this->db->sql_numrows($result2) > 0)
{

while ($row2 = $this->db->sql_fetchrow($result2))
{
$response .= '<user><![CDATA['.$row2['username'].']]></user>';
}

}
else
{
$response .= '<user><![CDATA[ &nbsp; ]]></user>';
}

$response .= '</online><q>'.$this->db->num_queries.'</q>';
$response .= '<denied>'.(!$deny ? 'false' : 'true' ).'</denied>';
if($this->db->sql_numrows($result) > 0)
{
while ($row = $this->db->sql_fetchrow($result))
{
$id = $row['id'];
$color = htmlspecialchars ($row['color']);
$size = htmlspecialchars ($row['size']);
$style = htmlspecialchars ($row['style']);
$userName = htmlspecialchars (stripslashes($row['username']));
$time = htmlspecialchars(date('m/d/Y h:i:s a', $row['timestamp']));
$message = htmlspecialchars (stripslashes($row['message']));
$message = $this->parseSmilies($message);
$response .= '<id>' . $id . '</id>' .
'<color><![CDATA[' . $color . ']]></color>' .
'<size><![CDATA[' . $size . ']]></size>' .
'<style><![CDATA[' . $style . ']]></style>' .
'<time>' . $time . '</time>' .
'<name><![CDATA[' . $userName . ']]></name>' .
'<message><![CDATA[' . $message . ']]></message>';
}
}
$response = $response . '</response>';
return $response;
}

public function showMessages($id, $deny = false)
{
if(ob_get_length()) ob_clean();
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-cache, must-revalidate');
header('Pragma: no-cache');
header('Content-Type: text/xml');
echo $this->getMessages($id, $deny);
}

public function postMessage($uname, $message, $color, $size, $bold = 0, $italic = 0, $underline = 0)
{
$uname = mysql_real_escape_string($uname);
$message = mysql_real_escape_string(strip_tags($message));
$color = mysql_real_escape_string($color);
$size = mysql_real_escape_string($size);
$style = intval($bold) ."|". intval($italic) ."|". intval($underline);

$query = 'INSERT INTO '.TABLE_CHAT.'(`timestamp`, `username`, `message`, `color`, `size`, `style`) VALUES (UNIX_TIMESTAMP(), \''.$uname.'\', \''.$message.'\', \''.$color.'\', \''.$size.'\', \''.$style.'\')';
$result = $this->db->sql_query($query);
}

public function checkOnline($username)
{

if (empty($username))
{
return false;
}
$username = mysql_real_escape_string($username);

if (rand(1,20) == 20)
{
// get rid of users that are gone
$query = 'DELETE FROM '.TABLE_ONLINE.' WHERE timestamp < '.(time() - 60).'';
$result = $this->db->sql_query($query);
}

// see if user is in the table
$query2 = 'SELECT username FROM '.TABLE_ONLINE.' WHERE username=\''.$username.'\' LIMIT 1';
$result2 = $this->db->sql_query($query2);
if($this->db->sql_numrows($result2) == 1)
{
$query3 = 'UPDATE '.TABLE_ONLINE.' SET timestamp=\''.time().'\' WHERE username=\''.$username.'\' LIMIT 1';
}
else
{
$query3 = 'INSERT INTO '.TABLE_ONLINE.' (username, timestamp) VALUES (\''.$username.'\', \''.time().'\')';
}
$result3 = $this->db->sql_query($query3);
}

public function takeOffline($username)
{
if (empty($username))
{
return false;
}
$username = mysql_real_escape_string($username);
$query = 'DELETE FROM '.TABLE_ONLINE.' WHERE username=\''.$username.'\' LIMIT 1';
$result = $this->db->sql_query($query);
}

private function parseSmilies($text)
{
$smilies = $this->smilies;
return str_replace(array_keys($smilies), array_values($smilies), $text);
}
}



// these functions are pulled from mainfile.php and put here.
// this is done because every time mainfile is called it runs over 20 queries.
// putting the functions here brings that number down to about 6, and reduces the server load quite a bit.

if (!function_exists('is_user'))
{
function is_user($user) {
if (!$user) { return 0; }

if (isset($userSave)) return $userSave;
if (!is_array($user)) {
$user = base64_decode($user);
$user = addslashes($user);
$user = explode(':', $user);
}
$uid = $user[0];
$pwd = $user[2];
$uid = intval($uid);
if (!empty($uid) AND !empty($pwd)) {
global $db, $user_prefix;
$sql = 'SELECT user_password FROM '.$user_prefix.'_users WHERE user_id=\''.$uid.'\'';
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
if ($row[0] == $pwd && !empty($row[0])) {
static $userSave;
return $userSave = 1;
}
}
static $userSave;
return $userSave = 0;
}
}

if (!function_exists('cookiedecode'))
{
function cookiedecode($user) {
global $cookie, $db, $user_prefix;
static $pass;
if(!is_array($user)) {
$user = base64_decode($user);
$user = addslashes($user);
$cookie = explode(':', $user);
} else {
$cookie = $user;
}
if (!isset($pass) AND isset($cookie[1])) {
$sql = 'SELECT user_password FROM '.$user_prefix.'_users WHERE username=\''.$cookie[1].'\'';
$result = $db->sql_query($sql);
list($pass) = $db->sql_fetchrow($result);
}
if (isset($cookie[2]) AND ($cookie[2] == $pass) AND (!empty($pass))) { return $cookie; }
}
}
?>

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-08-27 15:29:49 By : ilovefacebook
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : ระบบ chat phpnuke ติดตั้งแล้วชื่อ user ที่ออนไลน์เป็นภาษาต่างดาว แก้อย่างไรครับ
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 05
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่