22 พฤษภาคม 2555, 17:06:06
ยินดีต้อนรับผู้เยี่ยมชม
  • noavata
  • ยินดีต้อนรับคุณ, ผู้เยี่ยมชม กรุณา เข้าสู่ระบบ หรือ ลงทะเบียน
    เข้าสู่ระบบด้วยชื่อผู้ใช้ รหัสผ่าน และระยะเวลาในเซสชั่น
Page Rank

ทำเว็บไซต์ | แต่งบอร์ด | ออกแบบ | SMF | Joomla | Drupal | WordPress | JQuery | CMS | ECommerce | Tel. +668-08577477

ส่งหัวข้อนี้พิมพ์ หน้า: 1 
icon message ผู้เขียน หัวข้อ: ColorizePost สีข้อความของสมาชิกตามกลุ่มอัตโนมัติ  (อ่าน 1671 ครั้ง)
0 สมาชิก และ 1 ผู้เยี่ยมชม กำลังดูหัวข้อนี้
*
*


!Personal

Germany   ชาย ผู้เริ่มต้นกระทู้นี้ ออฟไลน์544566157 DexMore DexMore DexMore
เว็บไซต์
  • ชื่อ: ColorizePost
  • ผู้เขียน: Bulakbol
  • นำเสนอโดย: DexMoreGroup
  • ประเภท: Posting
  • รองรับ: SMF 1.1.xx, 2.0.xx
  • ปรับปรุงล่าสุด: 25 กุมภาพันธ์ 2552
  • ต้นฉบับ: ColorizePost

รายละเอียด
      ให้สมาชิกมีสีตัวอักษรตามสีของกลุ่มตัวเองในการโพสต์ข้อความโดยอัตโนมัติ สามารถตั้งค่าในการ "แก้ไขกลุ่มของสมาชิก" ให้สมาชิกกลุ่มใหนใช้สีในการโพสต์ได้ และสมาชิกสามารถกำหนดสีในการโพสต์ของตัวเองได้ในขอมูลส่วนตัว "ปรับแต่งธีมและการวางรูปแบบ"

ตัวอย่าง


สำหรับ SMF 1.1.xx

แก้ไขไฟล์:

fie $sourcedir/Load.php

ค้นหา -->>
โค๊ด: [Select]
mem.karmaGood, mem.ID_POST_GROUP,

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
mem.post_color, mem.ID_THEME,

ค้นหา -->>
โค๊ด: [Select]
mem.birthdate, mem.ICQ, mem.AIM, mem.YIM, mem.MSN, mem.posts, mem.lastLogin, mem.karmaGood,

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
mem.post_color,

ค้นหา -->>
โค๊ด: [Select]
'name' => &$profile['realName'],

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
'post_color' => &$profile['post_color'],
'theme' => &$profile['ID_THEME'],

ค้นหา -->>
โค๊ด: [Select]
'local_time' => timeformat(time() + ($profile['timeOffset'] - $user_info['time_offset']) * 3600, false),
);

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
$memberContext[$user]['theme'] = $memberContext[$user]['theme'] == '0' ? $modSettings['theme_guests'] : $memberContext[$user]['theme'];

ค้นหา -->>
โค๊ด: [Select]
'language' => &$user_info['language'],

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
'language' => &$user_info['language'],
'theme_id' => &$user_info['theme'],

ค้นหา -->>
โค๊ด: [Select]
if ($context['user']['is_guest'])

แก้เป็น -->>
โค๊ด: [Select]
$context['user']['theme_id'] = $context['user']['theme_id'] == '0' ? $modSettings['theme_guests'] : $context['user']['theme_id'];
if ($context['user']['is_guest'])

file $sourcedir/Profile.php

ค้นหา -->>
โค๊ด: [Select]
'username' => $user_profile[$memID]['memberName'],

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
'post_color' => $user_profile[$memID]['post_color'],
'theme_id' => $user_profile[$memID]['ID_THEME'],
'group_color' => isset($user_profile[$memID]['group_color']) ? $user_profile[$memID]['group_color'] : '',
'post_group_color' => $user_profile[$memID]['post_group_color'],

ค้นหา -->>
โค๊ด: [Select]
// Call the appropriate subaction function.

แก้เป็น -->>
โค๊ด: [Select]
$context['member']['theme_id'] = $context['member']['theme_id'] == '0' ? $modSettings['theme_guests'] : $context['member']['theme_id'];

// Call the appropriate subaction function.

ค้นหา -->>
โค๊ด: [Select]
'signature', 'personalText', 'avatar',

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
'post_color',

ค้นหา -->>
โค๊ด: [Select]
$profile_strings[] = 'usertitle';

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
//post color
if (isset($_POST['post_color']))
$_POST['post_color'] = preg_replace('~[&]([^;]{8}|[^;]{0,8}$)~', '&$1', $_POST['post_color']);

file $sourcedir/Recent.php

ค้นหา -->>
โค๊ด: [Select]
b.name AS bname, c.name AS cname,

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
mem.post_color, mem.ID_THEME, mg.onlineColor AS group_color, pg.onlineColor AS post_group_color,
 

ค้นหา -->>
โค๊ด: [Select]
LEFT JOIN {$db_prefix}members AS mem2 ON (mem2.ID_MEMBER = m2.ID_MEMBER)

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
LEFT JOIN {$db_prefix}membergroups AS pg ON (pg.ID_GROUP = mem.ID_POST_GROUP)
LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = mem.ID_GROUP)

ค้นหา -->>
โค๊ด: [Select]
),
'poster' => array(
'id' => $row['ID_MEMBER'],

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
'post_color' => $row['post_color'],
'theme' => $row['ID_THEME'],
'group_color' => $row['group_color'],
'post_group_color' => $row['post_group_color'],

ค้นหา -->>
โค๊ด: [Select]
if ($ID_MEMBER == $row['ID_FIRST_MEMBER'])

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
$context['posts'][$row['ID_MSG']]['poster']['theme'] = $context['posts'][$row['ID_MSG']]['poster']['theme'] == '0' ? $modSettings['theme_guests'] : $context['posts'][$row['ID_MSG']]['poster']['theme'];

if ($ID_MEMBER == $row['ID_FIRST_MEMBER'])

file $sourcedir/ManagePermissions.php

ค้นหา -->>
โค๊ด: [Select]
'profile_remote_avatar' => false,

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
'use_post_color' => false,

ค้นหา -->>
โค๊ด: [Select]
'send_mail',

โค๊ด: [Select]
'use_post_color',

file $themedir/Recent.template.php

ค้นหา -->>
โค๊ด: [Select]
<td class="windowbg2" colspan="3" valign="top" height="80">
<div class="post">' . $post['message'] . '</div>

แก้เป็น -->>
โค๊ด: [Select]
<td class="windowbg2" colspan="3" valign="top" height="80">';
if (isset($post['poster']['theme']) && $post['poster']['theme'] == $context['user']['theme_id'])
$color = !empty($post['poster']['post_color']) ? $post['poster']['post_color'] : (!empty($post['poster']['group_color']) ? $post['poster']['group_color'] :
(!empty($post['poster']['post_group_color']) ? $post['poster']['post_group_color'] : ''));
else
$color = '';
echo '<div class="post" style="color: '. $color . ';">', $post['message'], '</div>

file $themedir/Profile.template.php

ค้นหา -->>
โค๊ด: [Select]
<td width="100%" height="80" colspan="3" valign="top" class="windowbg2">
<div class="post">', $post['body'], '</div>

แก้เป็น -->>
โค๊ด: [Select]
<td width="100%" height="80" colspan="3" valign="top" class="windowbg2">';
if ($context['member']['theme_id'] == $context['user']['theme_id'])
$color = !empty($context['member']['post_color']) ? $context['member']['post_color'] : (!empty($context['member']['group_color']) ? $context['member']['group_color'] : (!empty($context['member']['post_group_color']) ? $context['member']['post_group_color'] : ''));
else
$color = '';
echo '<div class="post" style="color: '. $color. ';">',$post['body'], '</div>

ค้นหา -->>
โค๊ด: [Select]
<option value="2"', !empty($context['member']['options']['display_quick_mod']) && $context['member']['options']['display_quick_mod'] != 1 ? ' selected="selected"' : '', '>', $txt['display_quick_mod_image'], '</option>
</select>
</td>
</tr>

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
';
if (allowedTo('use_post_color'))
echo '
<tr>
<td>
'. (!empty($context['member']['post_color']) ? '<span style="color: '. $context['member']['post_color'] . ';">' : '') . $txt['personal_color'] . (!empty($context['member']['post_color']) ? '</span>' : ''). '
<input type="text" name="post_color"', $context['member']['post_color'] == '' ? '' : ' value="' . $context['member']['post_color'] . '"', ' tabindex="', $context['tabindex']++, '" size="10" maxlength="15" />
</td>
</tr>';
echo '

file $themedir/Display.template.php

ค้นหา -->>
โค๊ด: [Select]
', $message['body'], '

แก้เป็น -->>
โค๊ด: [Select]
';
if (isset($message['member']['theme']) && $message['member']['theme'] == $context['user']['theme_id'])
$color = !empty($message['member']['post_color']) ? $message['member']['post_color'] : (!empty($message['member']['group_color']) ? $message['member']['group_color'] : (!empty($message['member']['post_group_color']) ? $message['member']['post_group_color'] : ''));
else
$color = '';
echo '<span style="color: '. $color. ';">', $message['body'], '</span>

file $languagedir/ManagePermissions.thai-utf8.php

เพิ่ม -->>
ขออภัย! ท่านไม่สามารถเข้าถึงข้อมูลส่วนนี้ได้ กรุณาอ่าน เงื่อนไขการใช้งาน DexMore.Com

file $languagedir/Profile.thai-utf8.php

เพิ่ม -->>
ขออภัย! ท่านไม่สามารถเข้าถึงข้อมูลส่วนนี้ได้ กรุณาอ่าน เงื่อนไขการใช้งาน DexMore.Com

สร้างไฟล์: ColorizePostDB114.php เพื่อสร้างฐานข้อมูล ไว้ใน $boarddir (ที่เดียวกับไฟล์ SSI.php) รัน http://www.your_url.xxx/$boarddir/ColorizePostDB114.php -->> Enter เสร็จแล้วลบทิ้ง
โค๊ด: [Select]
<?php

if (!defined('SMF'))
die('Hacking attemp...');

if (
$context['uninstalling'])
{
 
$result db_query ("
SHOW COLUMNS FROM {$db_prefix}members 
LIKE 'post_color'"
__FILE____LINE__);
if (mysql_num_rows($result) > )
{
mysql_free_result($result);
$result db_query ("
ALTER TABLE {$db_prefix}members
DROP post_color"
__FILE____LINE__);
if ( $result == false )
echo '<b>Error:</b> Please delete topic_color field manually from topics.';
}
}
else
{
$request db_query("
SHOW COLUMNS FROM {$db_prefix}members
LIKE 'post_color'"
__FILE____LINE__);
$no_upgrade mysql_num_rows($request) > 0;
if (!
$no_upgradedb_query("
ALTER TABLE {$db_prefix}members
ADD post_color tinytext NOT NULL
"
__FILE__,__LINE__);
mysql_free_result($request);
}
?>

การตั้งค่า: ผู้ดูแล -->> แก้ไขการอนุญาต -->> กลุ่มสมาชิก [ขั้นสูง] -->> อนุญาตให้สมาชิกกลุ่มนี้ใช้สีข้อความ?

ลิงค์หัวข้อ: http://dexmore.com/topic/2676
Thx by starry
Windows XP    Firefox 3.6.8   see ip บันทึกการเข้า
ดูรายการสิ่งของสำหรับบอกรักใครสักคน ก็ส่งไปให้เขาเลย!  สำหรับติดหมุดกระทู้ของคุณ!  เพิ่มเวลาที่อยู่ในระบบอีก 12 ชั่วโมง  น้องหมี..เอาไว้กอดนอนแทนกิ๊ก  สำหรับบอกรักใครสักคน ก็ส่งไปให้เขาเลย!  
*
*


!Personal

Germany   ชาย ผู้เริ่มต้นกระทู้นี้ ออฟไลน์544566157 DexMore DexMore DexMore
เว็บไซต์
icon message
general ความคิดเห็นที่ 1 เมื่อ: 4 สิงหาคม 2553, 21:12:23
สำหรับ SMF 2.0.xx

แก้ไขไฟล์:

file $sourcedir/Load.php

ค้นหา -->>
โค๊ด: [Select]
mem.time_offset, mem.show_online,

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
mem.post_color, mem.id_theme,

ค้นหา -->>
โค๊ด: [Select]
mem.last_login, mem.karma_good,

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
mem.post_color,

ค้นหา -->>
โค๊ด: [Select]
'name' => $profile['real_name'],

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
'post_color' => &$profile['post_color'],
'theme' => &$profile['id_theme'],

ค้นหา -->>
โค๊ด: [Select]
file 'local_time' => timeformat(time() + ($profile['time_offset'] - $user_info['time_offset']) * 3600, false),
);

เพิ่มไว้หลัง -->>
โค๊ด: [Select]

if ($memberContext[$user]['theme'] == 0)
$memberContext[$user]['theme'] = $modSettings['theme_guests'];

ค้นหา -->>
โค๊ด: [Select]
'is_mod' => &$user_info['is_mod'],

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
'theme_id' => empty($user_settings['id_theme']) ? $modSettings['theme_guests'] : $user_settings['id_theme'],

file $sourcedir/Profile-Modify.php

ค้นหา -->>
โค๊ด: [Select]
'avatar_choice' => array(

แก้เป็น -->>
โค๊ด: [Select]
'post_color' => array(
'type' => 'text',
'label' => $txt['personal_color'],
'size' => 15,
'permission' => 'use_post_color',
'input_validate' => create_function('&$value', '
if (empty($value))
$value = \'\';
else
$value = $value;
return true;
'),
),
'avatar_choice' => array(

ค้นหา -->>
โค๊ด: [Select]
'time_format', 'time_offset', 'hr',
'theme_settings',

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
'hr', 'post_color',

file $sourcedir/Recent.php

ค้นหา -->>
โค๊ด: [Select]
m2.id_member AS id_first_member,

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
mem.post_color, mem.id_theme, mg.online_color AS group_color, pg.online_color AS post_group_color,

ค้นหา -->>
โค๊ด: [Select]
LEFT JOIN {db_prefix}members AS mem2 ON (mem2.id_member = m2.id_member)

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
LEFT JOIN {db_prefix}membergroups AS pg ON (pg.id_group = mem.id_post_group)
LEFT JOIN {db_prefix}membergroups AS mg ON (mg.id_group = mem.id_group)

ค้นหา -->>
โค๊ด: [Select]
),
'poster' => array(
'id' => $row['id_member'],

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
'post_color' => $row['post_color'],
'theme' => $row['id_theme'],
'group_color' => $row['group_color'],
'post_group_color' => $row['post_group_color'],

ค้นหา -->>
โค๊ด: [Select]
if ($user_info['id'] == $row['id_first_member'])

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
$context['posts'][$row['id_msg']]['poster']['theme'] = $context['posts'][$row['id_msg']]['poster']['theme'] == 0 ? $modSettings['theme_guests'] : $context['posts'][$row['id_msg']]['poster']['theme'];

file $sourcedir/ManagePermissions.php

ค้นหา -->>
โค๊ด: [Select]
'profile_remote_avatar' => array(false, 'profile', 'use_avatar'),

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
'use_post_color' => array(false, 'profile', 'use_post_color'),

ค้นหา -->>
โค๊ด: [Select]
'send_mail',

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
'use_post_color',

file $themedir/Recent.template.php

ค้นหา -->>
โค๊ด: [Select]
<td class="windowbg2" colspan="3" valign="top" height="80">
<div class="post">' . $post['message'] . '</div>

แก้เป็น -->>
โค๊ด: [Select]
<td class="windowbg2" colspan="3" valign="top" height="80">';
if ($post['poster']['theme'] == $context['user']['theme_id'])
$color = !empty($post['poster']['post_color']) ? $post['poster']['post_color'] : (!empty($post['poster']['group_color']) ? $post['poster']['group_color'] :
(!empty($post['poster']['post_group_color']) ? $post['poster']['post_group_color'] : ''));
else
$color = '';
echo '<div class="post" style="color: '. $color . ';">', $post['message'], '</div>

file $themedir/Display.template.php

ค้นหา -->>
โค๊ด: [Select]
echo '
', $message['body'], '

แก้เป็น -->>
โค๊ด: [Select]
if (isset($message['member']['theme']) && $message['member']['theme'] == $context['user']['theme_id'])
$color = !empty($message['member']['post_color']) ? $message['member']['post_color'] : (!empty($message['member']['group_color']) ? $message['member']['group_color'] : (!empty($message['member']['post_group_color']) ? $message['member']['post_group_color'] : ''));
else
$color = '';
echo '<span style="color: '. $color. ';">', $message['body'], '</span>

file $themedir/Profile.template.php

ค้นหา -->>
โค๊ด: [Select]
', $post['body'], '</div>

แก้เป็น -->>
โค๊ด: [Select]
';
if (isset($message['member']['theme']) && $context['member']['theme'] == $context['user']['theme_id'])
$color = !empty($context['member']['post_color']) ? $context['member']['post_color'] : (!empty($context['member']['group_color']) ? $context['member']['group_color'] : (!empty($context['member']['post_group_color']) ? $context['member']['post_group_color'] : ''));
else
$color = '';
echo '<span style="color: '. $color. ';">',$post['body'], '</span></div>

file $themedir/PersonalMessage.template.php

ค้นหา -->>
โค๊ด: [Select]
', $message['body'], '</div>

แก้เป็น -->>
โค๊ด: [Select]
';
if (isset($message['member']['theme']) && $message['member']['theme'] == $context['user']['theme_id'])
$color = !empty($message['member']['post_color']) ? $message['member']['post_color'] : (!empty($message['member']['group_color']) ? $message['member']['group_color'] : (!empty($message['member']['post_group_color']) ? $message['member']['post_group_color'] : ''));
else
$color = '';
echo '<span style="color: '. $color. ';">',$message['body'], '</span></div>

เพิ่ม -->>
ขออภัย! ท่านไม่สามารถเข้าถึงข้อมูลส่วนนี้ได้ กรุณาอ่าน เงื่อนไขการใช้งาน DexMore.Com

file $languagedir/Profile.thai-utf8.php

เพิ่ม -->>
ขออภัย! ท่านไม่สามารถเข้าถึงข้อมูลส่วนนี้ได้ กรุณาอ่าน เงื่อนไขการใช้งาน DexMore.Com

สร้างไฟล์: ColorizePostDB2B3.php เพื่อสร้างฐานข้อมูล ไว้ใน $boarddir (ที่เดียวกับไฟล์ SSI.php) รัน http://www.your_url.xxx/$boarddir/ColorizePostDB2B3.php -->> Enter เสร็จแล้วลบทิ้ง
โค๊ด: [Select]
<?php

if (!defined('SMF'))
die('Hacking attemp...');

global 
$smcFunc$db_prefix;

$request $smcFunc['db_query'](''"
SHOW COLUMNS FROM {$db_prefix}members
LIKE 'post_color'"
,
array()
);
$no_upgrade $smcFunc['db_num_rows']($request) > 0;
if (!
$no_upgrade
$smcFunc['db_query'](''"
ALTER TABLE {$db_prefix}members
ADD post_color text NOT NULL
AFTER warning"
,
array()
);
$smcFunc['db_free_result']($request);

?>

ลิงค์หัวข้อ: http://dexmore.com/topic/2676
Windows XP    Firefox 3.6.8   see ip บันทึกการเข้า
ดูรายการสิ่งของสำหรับบอกรักใครสักคน ก็ส่งไปให้เขาเลย!  สำหรับติดหมุดกระทู้ของคุณ!  เพิ่มเวลาที่อยู่ในระบบอีก 12 ชั่วโมง  น้องหมี..เอาไว้กอดนอนแทนกิ๊ก  สำหรับบอกรักใครสักคน ก็ส่งไปให้เขาเลย!  
ส่งหัวข้อนี้พิมพ์ หน้า: 1 
กระโดดไป:  

Creative Commons License

SMF Thai Translation Powered by SMF © 2006–2012, Simple Machines LLC

WordPress Google เข้าเยี่ยมชมหน้านี้ล่าสุดเมื่อ : 17 พฤษภาคม 2555, 10:39:32

jQuery Plugin Copyright © 2551-2555 Themes Design & Hosting by DexMoreGroup

Sitemap | Thai Simple Machines Forum support SMF Thai

Web Begining | SMF Modifications | SMF Thai Translation Web Begining

Drupal | WordPress | CMS Joomla | jQuery Plugin | Web Graphics CMS Joomla