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

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

ส่งหัวข้อนี้พิมพ์ หน้า: 1 2 Next
icon message ผู้เขียน หัวข้อ: Member Color Link คนมีสีทุกที่ ทุกเวลา  (อ่าน 2956 ครั้ง)
0 สมาชิก และ 2 ผู้เยี่ยมชม กำลังดูหัวข้อนี้
*
*


!Personal

Germany   ชาย ผู้เริ่มต้นกระทู้นี้ ออฟไลน์544566157 DexMore DexMore DexMore
เว็บไซต์
icon message
general เมื่อ: 27 มิถุนายน 2553, 20:44:51
  • ชื่อ: Member Color Link
  • ผู้เขียน: ディン1031
  • นำเสนอโดย: DexMoreGroup
  • ประเภท: Feature Enhancement
  • รองรับ: SMF 1.1.xx, 2.0.xx
  • ปรับปรุงล่าสุด: 11 มีนาคม 2553
  • ต้นฉบับ: Member Color Link

รายละเีอียด
      mod นี้จะทำให้ชื่อของสมาชิกที่สามารถลิงค์ไปยังข้อมูลส่วนตัวได้เป็นสีตามการตั้งค่ากลุ่มสมาชิก เช่น หน้าหลัก, หน้าดัชนีหัวข้อ, หน้าอ่านข้อความ, ข้อมูส่วนตัว, ข้อความส่วนตัวฯ

ตัวอย่าง


สำหรับ SMF 1.1.xx

แก้ไขไฟล์:

file $sourcedir/ModSettings.php

ค้นหา -->>
โค๊ด: [Select]
'layout' => array(
'title' => $txt['mods_cat_layout'],
'href' => $scripturl . '?action=featuresettings;sa=layout;sesc=' . $context['session_id'],
),

แก้เป็น -->>
โค๊ด: [Select]
'layout' => array(
'title' => $txt['mods_cat_layout'],
'href' => $scripturl . '?action=featuresettings;sa=layout;sesc=' . $context['session_id'],
),
'MemberColorLinks' => array(
'title' => $txt['MemberColorLinkHeadline'],
'href' => $scripturl . '?action=featuresettings;sa=MemberColorLinks;sesc=' . $context['session_id'],
),

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

แก้เป็น -->>
โค๊ด: [Select]
'layout' => 'ModifyLayoutSettings',
'MemberColorLinks' => 'ModifyMemberColorLinksSettings',

ค้นหา -->>
โค๊ด: [Select]
$context['post_url'] = $scripturl . '?action=featuresettings2;save;sa=karma';
$context['settings_title'] = $txt['smf293'];

prepareDBSettingContext($config_vars);
}

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
function ModifyMemberColorLinksSettings()
{
global $txt, $scripturl, $context, $settings, $sc;

$config_vars = array(
// Standard Membercolor?
array('check', 'MemberColorLink'),
array('check', 'MemberColorLinkOldSpanStyle'),
'',
//Some Stat Settings
array('check', 'MemberColorLatestMember'),
array('check', 'MemberColorStats'),
array('check', 'MemberColorWhoIsOnline'),
'',
//Thread and Boardsettings
array('check', 'MemberColorThreadOwner'),
array('check', 'MemberColorThreadLastPost'),
array('check', 'MemberColorThreadChild'),
'',
//Birthday and Calendar
array('check', 'MemberColorModeratorLinks'),
array('check', 'MemberColorBoardindex'),
array('check', 'MemberColorBirthday'),
'',
//Some Recent Things
array('check', 'MemberColorRecentOwner'),
array('check', 'MemberColorRecentLastPost'),
'',
// PM Colors
array('check', 'MemberColorInbox'),
array('check', 'MemberColorOutbox'),
'',
//The Heavy Member Search Option
array('check' , 'MemberColorAllSearch'),
'',
//Birthday Color
array('text', 'MemberColorBanned'),
//Guest Color
array('text', 'MemberColorGuests'),
//Birthday User Color
array('text', 'MemberColorBirthdayColor'),
);

// Saving?
if (isset($_GET['save']))
{
saveDBSettings($config_vars);
redirectexit('action=featuresettings;sa=MemberColorLinks');
}

$context['post_url'] = $scripturl . '?action=featuresettings2;save;sa=MemberColorLinks';
$context['settings_title'] = $txt['MemberColorLinkHeadline'];

prepareDBSettingContext($config_vars);
}

file $sourcedir/Load.php

ค้นหา -->>
โค๊ด: [Select]
array loadMemberData(array members, bool is_name = false, string set = 'normal')

แก้เป็น -->>
โค๊ด: [Select]
array load_OnlineColors(array members, bool returnarray = true, bool singleuser = false)
- This function is for Modcreators who like to color the nicks if the MemberColorLink is installed
 with this function the user can check if the function exists and load the colors if needed.
 But please load so many ids as possible at one time, to reduce the database querys.
 To Check if the function exist use if(!empty($modSettings['MemberColorLinkInstalled'])) {}
- return a array with follow informations
array(id_member => array(online_color => '', colored_name => '', colored_link => '');
- The option single user will only return one user color as array, without id before.
- chache datas the global $color_profile (only the db data, not the array data above)
- return "false" on nothing loaded!

bool/string load_mod_color(bool return = false, update = null)
- Store the Moderator Color into the $context['modGroupColor']
- "return = true" will return this color as string
- This function use only one time the query to load this color
- update is for the fast update of the moderator color

bool compare_birthday(string brtihday)
- Compare Today with the Birthday, true if today his/her birthday

array loadMemberData(array members, bool is_name = false, string set = 'normal')

ค้นหา -->>
โค๊ด: [Select]
// UTF-8 in regular expressions is unsupported on PHP(win) versions < 4.2.3.

แก้เป็น -->>
โค๊ด: [Select]
//This setting should never chached, it show others that member color link is installed!
$modSettings['MemberColorLinkInstalled'] = function_exists('load_onlineColors') ? 1 : 0;
$modSettings['MemberColorLinkVersion'] = '3.0.8';

// UTF-8 in regular expressions is unsupported on PHP(win) versions < 4.2.3.

ค้นหา -->>
โค๊ด: [Select]
global $user_profile, $db_prefix, $modSettings, $board_info;

แก้เป็น -->>
โค๊ด: [Select]
global $user_profile, $db_prefix, $modSettings, $board_info;
global $color_profile; //This is for Preloaded Data, i will not load it twice you know ;)

ค้นหา -->>
โค๊ด: [Select]
$loaded_ids[] = $data['ID_MEMBER'];
$user_profile[$data['ID_MEMBER']] = $data;

แก้เป็น -->>
โค๊ด: [Select]
$loaded_ids[] = $data['ID_MEMBER'];
$user_profile[$data['ID_MEMBER']] = $data;
//Happy Birthday Color to this user :D
if(!empty($modSettings['MemberColorBirthdayColor']) && !empty($data['birthdate']) && compare_colorBirthdate($data['birthdate'])) {
$user_profile[$data['ID_MEMBER']]['post_group_color'] = $modSettings['MemberColorBirthdayColor'];
$user_profile[$data['ID_MEMBER']]['member_group_color'] = $modSettings['MemberColorBirthdayColor'];
}
//Color Banned user, replace there color... hope they are not moderators ;P?
if(!empty($modSettings['MemberColorBanned']) && isset($data['is_activated']) && $data['is_activated'] >= 10) {
$user_profile[$data['ID_MEMBER']]['post_group_color'] = $modSettings['MemberColorBanned'];
$user_profile[$data['ID_MEMBER']]['member_group_color'] = $modSettings['MemberColorBanned'];
}
//Memeber Color Link will used Chached Data, too wheee.
if($set == 'normal' || $set == 'profile') //This are the only sets with the info the mod need.
$color_profile[$data['ID_MEMBER']] = array(
'ID_MEMBER' => $data['ID_MEMBER'],
'realName' => $data['realName'],
'member_group_color' => $user_profile[$data['ID_MEMBER']]['member_group_color'],
'post_group_color' => $user_profile[$data['ID_MEMBER']]['post_group_color'],
);

ค้นหา -->>
โค๊ด: [Select]
$user_profile[$row['ID_MEMBER']] = $row;

แก้เป็น -->>
โค๊ด: [Select]
$user_profile[$row['ID_MEMBER']] = $row;
//Happy Birthday Color ;D Hope you love it :D
if(!empty($modSettings['MemberColorBirthdayColor']) && !empty($row['birthdate']) && compare_colorBirthdate($row['birthdate'])) {
$user_profile[$row['ID_MEMBER']]['post_group_color'] = $modSettings['MemberColorBirthdayColor'];
$user_profile[$row['ID_MEMBER']]['member_group_color'] = $modSettings['MemberColorBirthdayColor'];
}
//Color Banned user, replace there color... hope they are not moderators ;P?
if(!empty($modSettings['MemberColorBanned']) && isset($row['is_activated']) && $row['is_activated'] >= 10) {
$user_profile[$row['ID_MEMBER']]['post_group_color'] = $modSettings['MemberColorBanned'];
$user_profile[$row['ID_MEMBER']]['member_group_color'] = $modSettings['MemberColorBanned'];
}
//Memeber Color Link Data, i store them for later use
if($set == 'normal' || $set == 'profile') //This are the only sets with the infos i need.
$color_profile[$row['ID_MEMBER']] = array(
'ID_MEMBER' => $row['ID_MEMBER'],
'realName' => $row['realName'],
'member_group_color' => $user_profile[$row['ID_MEMBER']]['member_group_color'],
'post_group_color' => $user_profile[$row['ID_MEMBER']]['post_group_color'],
);

ค้นหา -->>
โค๊ด: [Select]
cache_put_data('moderator_group_info', $row, 480);

แก้เป็น -->>
โค๊ด: [Select]
cache_put_data('moderator_group_info', $row, 480);
if(isset($modSettings['MemberColorLinkModColor']) && $modSettings['MemberColorLinkModColor'] != $row['member_group_color'])
updateSettings(array('MemberColorLinkModColor' => $row['member_group_color']));

ค้นหา -->>
โค๊ด: [Select]
if (!empty($row['member_group_color']))
$user_profile[$id]['member_group_color'] = $row['member_group_color'];

แก้เป็น -->>
โค๊ด: [Select]
if (!empty($row['member_group_color'])) {
$user_profile[$id]['member_group_color'] = $row['member_group_color'];
//Replace this, too because i will not forget it ;D (Member Color Link)
$color_profile[$id]['member_group_color'] = $row['member_group_color'];
}

ค้นหา -->>
โค๊ด: [Select]
$profile = $user_profile[$user];

แก้เป็น -->>
โค๊ด: [Select]
$profile = $user_profile[$user];

//Prepare some colored Datas :D Member Color Link give some Infos back 8)
$coloredData = load_onlineColors($user, true, true);

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

แก้เป็น -->>
โค๊ด: [Select]
'username' => &$profile['memberName'],
'name' => &$profile['realName'],
'colored_name' => $coloredData['colored_name'],
'online_color' => $coloredData['online_color'],

ค้นหา -->>
โค๊ด: [Select]
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $profile['ID_MEMBER'] . '" title="' . $txt[92] . ' ' . $profile['realName'] . '">' . $profile['realName'] . '</a>',

แก้เป็น -->>
โค๊ด: [Select]
'link' => $coloredData['colored_link'],
'colorless_link' => '<a href="' . $scripturl . '?action=profile;u=' . $profile['ID_MEMBER'] . '" title="' . $txt[92] . ' ' . $profile['realName'] . '">' . $profile['realName'] . '</a>',

ค้นหา -->>
โค๊ด: [Select]
// Load a theme, by ID.

แก้เป็น -->>
โค๊ด: [Select]
//This is the universial load colors function, can be used by each person who need it :)
//I think it's intressting for mod Creators =D
//SMF 1.1.x Version

function load_onlineColors($users, $returnarray = true, $singleuser = false) {
global $color_profile, $db_prefix, $modSettings;
static $color_array;

//Make something for sure :)
if(!isset($color_profile))
$color_profile = array();
//This will hold the array data for later ;)
if(!isset($color_array))
$color_array = array();
//Set a standard empty array for guest errors ;) (Deleted users, which are not resetet)
if(!isset($color_profile[0]))
$color_profile[0] = array('member_group_color' => '', 'post_group_color' => '');

// Can't just look for no users :P.
if (empty($users))
return false;

// Make sure it's an array.
$users = !is_array($users) ? array($users) : array_unique($users);

//... SSI can insert empty users :x
foreach($users as $k => $u)
if(empty($u) || $u < 0 || !is_numeric($u))
unset($users[$k]);

//Now i will use this as a chache, too
$loaded_ids = array();
$all_loaded_ids = array_keys($color_profile);
//All the users that allready loaded
$loaded_ids = array_intersect($all_loaded_ids, $users);
//Now i need only the new users to load
$users = array_diff($users, $all_loaded_ids);

if(!empty($users)) {
// Load the data.
$request = db_query("
SELECT
mem.ID_MEMBER AS ID_MEMBER, mem.realName AS realName, mem.is_activated AS is_activated,
mem.birthdate AS birthdate,
mg.onlineColor AS member_group_color, IFNULL(mg.groupName, '') AS member_group,
pg.onlineColor AS post_group_color, IFNULL(pg.groupName, '') AS post_group
FROM {$db_prefix}members AS mem
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)
WHERE mem.ID_MEMBER ".(count($users) == 1 ? " = '" . current($users) . "'" : " IN ('" . implode("', '", $users) . "')"), __FILE__, __LINE__);

while ($row = mysql_fetch_assoc($request))
{
$loaded_ids[] = $row['ID_MEMBER'];
$color_profile[$row['ID_MEMBER']] = $row;
//Happy Birthday Color ;D Hope you love it :D
if(!empty($modSettings['MemberColorBirthdayColor']) && !empty($row['birthdate']) && compare_colorBirthdate($row['birthdate'])) {
$color_profile[$row['ID_MEMBER']]['post_group_color'] = $modSettings['MemberColorBirthdayColor'];
$color_profile[$row['ID_MEMBER']]['member_group_color'] = $modSettings['MemberColorBirthdayColor'];
}
//Banned User hope it is not a mod ;)
if(!empty($modSettings['MemberColorBanned']) && isset($row['is_activated']) && $row['is_activated'] >= 10) {
$color_profile[$row['ID_MEMBER']]['post_group_color'] = $modSettings['MemberColorBanned'];
$color_profile[$row['ID_MEMBER']]['member_group_color'] = $modSettings['MemberColorBanned'];
}
}
mysql_free_result($request);
}

//Build the Array ;D
$array = array();
if(!empty($loaded_ids) && $returnarray == true) {
global $txt, $scripturl, $board_info;
foreach($loaded_ids as $id) {
$mod = false;
//Rewrite Moderator Color!
if(isset($board_info['moderators'][$id]) && (empty($color_array[$id]) || !$color_array[$id]['moderator'])) {
if(isset($color_array[$id]))
unset($color_array[$id]);
if(empty($color_profile[$id]['member_group_color']))
$color_profile[$id]['member_group_color'] = load_mod_color(true);
$mod = true;
}
//Load a prepared Data?
if(!isset($color_array[$id])) {
$profile = $color_profile[$id];
$onlineColor = !empty($profile['member_group_color']) ? $profile['member_group_color'] : $profile['post_group_color'];
$color_array[$id] = array(
'id' => $id,
'online_color' => $onlineColor,
'colored_name' => (!empty($onlineColor) ? '<span style="color:'.$onlineColor.';">' : '' ) . $profile['realName'] . (!empty($onlineColor) ? '</span>' : ''),
//Make it compatible old and new style
'colored_link' => (empty($modSettings['MemberColorLinkOldSpanStyle']) ?
'<a href="' . $scripturl . '?action=profile;u=' . $profile['ID_MEMBER'] . '" title="' . $txt[92] . ' ' . $profile['realName'] . '"'.(!empty($onlineColor) ? ' style="color:'.$onlineColor.';"' : '').'>' . $profile['realName'] .'</a>' :
'<a href="' . $scripturl . '?action=profile;u=' . $profile['ID_MEMBER'] . '" title="' . $txt[92] . ' ' . $profile['realName'] . '">' . ( !empty($profile['member_group_color']) || !empty($profile['post_group_color']) ? '<span style="color:'. ( !empty($profile['member_group_color']) ? $profile['member_group_color'] : $profile['post_group_color'] ) .';">' : '' ) . $profile['realName'] . (!empty($profile['member_group_color']) || !empty($profile['post_group_color']) ? '</span>' : '' ).'</a>'),
'moderator' => $mod,
);
}
$array[$id] = $color_array[$id];
}
}

//This option return only a single user, i hope you know what you do ;)
if($singleuser === true)
$array = current($array);

//Return that what should returned XD
return (empty($loaded_ids) ? false : ($returnarray == true ? $array : $loaded_ids));
}

//Load in a fast way the Moderator color... i think i cashe it sometimes...
//$update it's only for me that the mod is fast ;)
function load_mod_color($return = false, $update = null) {
global $context, $db_prefix, $modSettings;

//Need a update?
if($update !== null && $return === false) {
updateSettings(array('MemberColorLinkModColor' => $update));
return true;
}

//This settings is loaded in the loadMemberData
if(isset($modSettings['MemberColorLinkModColor']) && !isset($context['modGroupColor']))
$context['modGroupColor'] = $modSettings['MemberColorLinkModColor'];

if(!isset($context['modGroupColor'])) {
$context['modGroupColor'] = '';
$modColor = db_query("
SELECT onlineColor AS online_color
FROM {$db_prefix}membergroups
WHERE ID_GROUP = 3
LIMIT 1", __FILE__, __LINE__);
list($context['modGroupColor']) = mysql_fetch_row($modColor);
mysql_free_result($modColor);
}

//Need a update?
if(!isset($modSettings['MemberColorLinkModColor']))
updateSettings(array('MemberColorLinkModColor' => $context['modGroupColor']));

$return = (bool) $return;
return $return ? $context['modGroupColor'] : true;
}
//Compare Birthday, return true on todays brithday
function compare_colorBirthdate($birthday = '')
{
if (empty($birthday))
return false;
$d = explode('-', trim($birthday));
if (count($d) != 3)
return false;
$d['0'] = (int) $d['0'];
$d['1'] = (int) $d['1'];
$d['2'] = (int) $d['2'];
if (empty($d['2']) || empty($d['1']) || $d['0'] <= 1)
return false;
return date('md') == date('md', mktime(0,0,0,$d['1'],$d['2'],0)) ? true : false;
}

// Load a theme, by ID.

file $sourcedir/MessageIndex.php

ค้นหา -->>
โค๊ด: [Select]
// Aren't children wonderful things?
$result = db_query("

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
//Set some standard Variables for the MemberColorLink
$MemberSetColor = false;
if (!empty($modSettings['MemberColorThreadOwner']) || !empty($modSettings['MemberColorThreadLastPost']) || !empty($modSettings['MemberColorChild']) || (!empty($modSettings['MemberColorWhoIsOnline']) && !empty($settings['display_who_viewing'])))
$context['MemberColor_ID_MEMBER'] = array();


ค้นหา -->>
โค๊ด: [Select]
$theboards[] = $row_board['ID_BOARD'];

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
//The Last Posts of the Children MemberColor.
if (!empty($modSettings['MemberColorThreadChild']) && !empty($row_board['ID_MEMBER'])) {
$context['MemberColor_ID_MEMBER'][$row_board['ID_MEMBER']] = $row_board['ID_MEMBER'];
$MemberSetColor = true;
}

ค้นหา -->>
โค๊ด: [Select]
if (empty($row['showOnline']))
$context['view_num_hidden']++;
}
$context['view_num_guests'] = mysql_num_rows($request) - count($context['view_members']);
mysql_free_result($request);

แก้เป็น -->>
โค๊ด: [Select]
if (!empty($modSettings['MemberColorWhoIsOnline'])) {
$context['MemberColor_ID_MEMBER'][$row['ID_MEMBER']] = $row['ID_MEMBER'];
$MemberSetColor = true;
}

if (empty($row['showOnline']))
$context['view_num_hidden']++;
}
$context['view_num_guests'] = mysql_num_rows($request) - count($context['view_members']);
mysql_free_result($request);

ค้นหา -->>
โค๊ด: [Select]
if (!$pre_query)
$topic_ids[] = $row['ID_TOPIC'];

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
//I need to collect some IDs for the MemberColor :).
if (!empty($modSettings['MemberColorThreadOwner']) && !empty($row['firstID_MEMBER'])) {
$context['MemberColor_ID_MEMBER'][$row['firstID_MEMBER']] = $row['firstID_MEMBER'];
$MemberSetColor = true;
}
//Oh i need the Last Post ID, too ;)
if (!empty($modSettings['MemberColorThreadLastPost']) && !empty($row['lastID_MEMBER'])) {
$context['MemberColor_ID_MEMBER'][$row['lastID_MEMBER']] = $row['lastID_MEMBER'];
$MemberSetColor = true;
}

ค้นหา -->>
โค๊ด: [Select]
determineTopicClass($context['topics'][$row['ID_TOPIC']]);
}
mysql_free_result($result);

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
//Now let's replace the orginal link to the Color Link ;)
if ($MemberSetColor && !empty($context['MemberColor_ID_MEMBER'])) {
$colorDatas = load_onlineColors($context['MemberColor_ID_MEMBER']);
//You are not know what you do ;P Colors allready loaded :D
if(!empty($modSettings['MemberColorModeratorLinks']) && !empty($theboards)) {
//Okay now... do a heavy serach for moderators... only jokeing... but you know... it look so ugly ;)
$onlineColor = load_mod_color(true);
foreach($theboards as $boardid_memcolor) {
//Reset it :D
$context['boards'][$boardid_memcolor]['link_moderators'] = array();
global $color_profile;
foreach($context['boards'][$boardid_memcolor]['moderators'] as $moderators) {
$cmemcolid = $moderators['id'];
//Replace "Profil of" with "Moderator" ;D
$link = str_replace($txt[92], $txt[62], $colorDatas[$cmemcolid]['colored_link']);
if(empty($colorDatas[$cmemcolid]['online_color']) && !empty($onlineColor))
$link = '<a href="' . $scripturl . '?action=profile;u=' . $color_profile[$cmemcolid]['ID_MEMBER'] . '" title="' . $txt[62] . ' ' . $color_profile[$cmemcolid]['realName'] . '"'.(!empty($modSettings['MemberColorLinkOldSpanStyle']) ? '><span style="color:'.$onlineColor.';">' : ' style="color:'.$onlineColor.';">') . $color_profile[$cmemcolid]['realName'] . (!empty($modSettings['MemberColorLinkOldSpanStyle']) ? '</span>' : '').'</a>';
//Standard Color ;)
$context['boards'][$boardid_memcolor]['moderators'][$cmemcolid]['link'] = $link;
//Creat the new list...
$context['boards'][$boardid_memcolor]['link_moderators'][] = $link;
}
}
}
//Need the Childs some Colors XD
if (!empty($modSettings['MemberColorThreadChild']) && !empty($theboards))
foreach($theboards as $boardid_memcolor) {
//My Childs need a Member Color ;)
$cmemcolid = $context['boards'][$boardid_memcolor]['last_post']['member']['id'];
if(!empty($colorDatas[$cmemcolid]['colored_link']))
$context['boards'][$boardid_memcolor]['last_post']['member']['link'] = $colorDatas[$cmemcolid]['colored_link'];
}
//The Owner or the Last Post of the thread
if (!empty($modSettings['MemberColorThreadOwner']) || !empty($modSettings['MemberColorThreadLastPost']))
foreach($topic_ids as $topicid_memcolor) {
if (empty($context['topics'][$topicid_memcolor]))
continue;
//First the Thread Owner Link
if (!empty($modSettings['MemberColorThreadOwner'])) {
$cmemcolid = $context['topics'][$topicid_memcolor]['first_post']['member']['id'];
if(!empty($colorDatas[$cmemcolid]['colored_link']))
$context['topics'][$topicid_memcolor]['first_post']['member']['link'] = $colorDatas[$cmemcolid]['colored_link'];
}
//Or the Last Post Link ;)
if (!empty($modSettings['MemberColorThreadLastPost'])) {
$cmemcolid = $context['topics'][$topicid_memcolor]['last_post']['member']['id'];
if(!empty($colorDatas[$cmemcolid]['colored_link']))
$context['topics'][$topicid_memcolor]['last_post']['member']['link'] = $colorDatas[$cmemcolid]['colored_link'];
}
}
if (!empty($settings['display_who_viewing']) && !empty($modSettings['MemberColorWhoIsOnline']) && !empty($context['view_members'])) {
//I need the new not numeric keys :)
$klist = array_keys($context['view_members']);
foreach($klist as $value) {
$id = $context['view_members'][$value]['id'];
//Let's replace Who is online colors...
$context['view_members'][$value]['link'] = $colorDatas[$id]['colored_link'];
//Somehow the 'view_members_list' must be the same as before *g*, i don't like the hidden users...
if (!$context['view_members'][$value]['hidden'] || allowedTo('moderate_forum'))
$context['view_members_list'][$value] = ($context['view_members'][$value]['hidden'] ? '<i>' : '').$colorDatas[$id]['colored_link'].($context['view_members'][$value]['hidden'] ? '</i>' : '');
}
}
}

ค้นหา -->>
โค๊ด: [Select]
if (!empty($board_info['moderators']))
{
foreach ($board_info['moderators'] as $mod)
$context['link_moderators'][] ='<a href="' . $scripturl . '?action=profile;u=' . $mod['id'] . '" title="' . $txt[62] . '">' . $mod['name'] . '</a>';

แก้เป็น -->>
โค๊ด: [Select]
if (!empty($board_info['moderators']))
{
//I hate it in this way... but what should i do ;)
if(!empty($modSettings['MemberColorModeratorLinks'])) {
foreach($board_info['moderators'] as $mod)
$c[$mod['id']] = $mod['id'];
$colorDatas = load_onlineColors($c);
foreach ($board_info['moderators'] as $mod)
$context['link_moderators'][] = str_replace($txt[92], $txt[62], $colorDatas[$mod['id']]['colored_link']);
}
else
foreach ($board_info['moderators'] as $mod)
$context['link_moderators'][] ='<a href="' . $scripturl . '?action=profile;u=' . $mod['id'] . '" title="' . $txt[62] . '">' . $mod['name'] . '</a>';

ค้นหา -->>
โค๊ด: [Select]
if (!empty($row_board['ID_MODERATOR']))
{

แก้เป็น -->>
โค๊ด: [Select]
if (!empty($row_board['ID_MODERATOR']))
{
//Color the Mods, too...
if(!empty($modSettings['MemberColorModeratorLinks'])) {
$MemberSetColor = true;
$context['MemberColor_ID_MEMBER'][$row_board['ID_MODERATOR']] = $row_board['ID_MODERATOR'];
}

ค้นหา -->>
โค๊ด: [Select]
'link' => $row_board['posterName'] != '' ? (!empty($row_board['ID_MEMBER']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row_board['ID_MEMBER'] . '">' . $row_board['realName'] . '</a>' : $row_board['realName']) : $txt[470],

แก้เป็น -->>
โค๊ด: [Select]
'link' => $row_board['posterName'] != '' ? (!empty($row_board['ID_MEMBER']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row_board['ID_MEMBER'] . '">' . $row_board['realName'] . '</a>' : (!empty($modSettings['MemberColorGuests']) ? '<span style="color:'.$modSettings['MemberColorGuests'].';">' : '').$row_board['realName'].(!empty($modSettings['MemberColorGuests']) ? '</span>' : '')) : $txt[470],

ค้นหา -->>
โค๊ด: [Select]
'link' => $row['posterName'] != '' ? (!empty($row['ID_MEMBER']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a>' : $row['realName']) : $txt[470],

แก้เป็น -->>
โค๊ด: [Select]
'link' => $row['posterName'] != '' ? (!empty($row['ID_MEMBER']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a>' : (!empty($modSettings['MemberColorGuests']) ? '<span style="color:'.$modSettings['MemberColorGuests'].';">' : '').$row['realName'].(!empty($modSettings['MemberColorGuests']) ? '</span>' : '')) : $txt[470],

ค้นหา -->>
โค๊ด: [Select]
'link' => !empty($row['firstID_MEMBER']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row['firstID_MEMBER'] . '" title="' . $txt[92] . ' ' . $row['firstDisplayName'] . '">' . $row['firstDisplayName'] . '</a>' : $row['firstDisplayName']

แก้เป็น -->>
โค๊ด: [Select]
'link' => !empty($row['firstID_MEMBER']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row['firstID_MEMBER'] . '" title="' . $txt[92] . ' ' . $row['firstDisplayName'] . '">' . $row['firstDisplayName'] . '</a>' : (!empty($modSettings['MemberColorGuests']) ? '<span style="color:'.$modSettings['MemberColorGuests'].';">' : '').$row['firstDisplayName'].(!empty($modSettings['MemberColorGuests']) ? '</span>' : '')

ค้นหา -->>
โค๊ด: [Select]
'link' => !empty($row['lastID_MEMBER']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row['lastID_MEMBER'] . '">' . $row['lastDisplayName'] . '</a>' : $row['lastDisplayName']

แก้เป็น -->>
โค๊ด: [Select]
'link' => !empty($row['lastID_MEMBER']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row['lastID_MEMBER'] . '">' . $row['lastDisplayName'] . '</a>' : (!empty($modSettings['MemberColorGuests']) ? '<span style="color:'.$modSettings['MemberColorGuests'].';">' : '').$row['lastDisplayName'].(!empty($modSettings['MemberColorGuests']) ? '</span>' : '')

file $sourcedir/BoardIndex.php

ค้นหา -->>
โค๊ด: [Select]
if (!empty($row_board['ID_MODERATOR']))
{

แก้เป็น -->>
โค๊ด: [Select]
if (!empty($row_board['ID_MODERATOR']))
{
//Color the Mods, too...
if(!empty($modSettings['MemberColorModeratorLinks'])) {
$context['MemberColor_ID_MEMBER'][$row_board['ID_MODERATOR']] = $row_board['ID_MODERATOR'];
$context['MemberColor_ModBoard'][$isChild ? $row_board['ID_PARENT'] : $row_board['ID_BOARD']] = array(
'bid' => ($isChild ? $row_board['ID_PARENT'] : $row_board['ID_BOARD']),
'cat' => $row_board['ID_CAT']
);
}

ค้นหา -->>
โค๊ด: [Select]
'link' => $row_board['posterName'] != '' ? (!empty($row_board['ID_MEMBER']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row_board['ID_MEMBER'] . '">' . $row_board['realName'] . '</a>' : $row_board['realName']) : $txt[470],

แก้เป็น -->>
โค๊ด: [Select]
'link' => $row_board['posterName'] != '' ? (!empty($row_board['ID_MEMBER']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row_board['ID_MEMBER'] . '">' . $row_board['realName'] . '</a>' : (!empty($modSettings['MemberColorGuests']) ? '<span style="color:'.$modSettings['MemberColorGuests'].';">' : '').$row_board['realName'].(!empty($modSettings['MemberColorGuests']) ? '</span>' : '')) : $txt[470],

ค้นหา -->>
โค๊ด: [Select]
'start' => 'msg' . $row_board['new_from'],
'topic' => $row_board['ID_TOPIC']
);

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
if (!empty($modSettings['MemberColorBoardindex']) && !empty($row_board['ID_MEMBER'])) {
$context['MemberColor_ID_MEMBER'][$row_board['ID_MEMBER']] = $row_board['ID_MEMBER'];
$MemberColor_board[$isChild ? $row_board['ID_PARENT'] : $row_board['ID_BOARD']] = array(
'bid' => ($isChild ? $row_board['ID_PARENT'] : $row_board['ID_BOARD']),
'cat' => $row_board['ID_CAT']);
}

ค้นหา -->>
โค๊ด: [Select]
// Determine a global most recent topic.
if (!empty($row_board['posterTime']) && forum_time(true, $row_board['posterTime']) > $most_recent_topic['timestamp'])
$most_recent_topic = array(
'timestamp' => forum_time(true, $row_board['posterTime']),
'ref' => &$this_category[$isChild ? $row_board['ID_PARENT'] : $row_board['ID_BOARD']]['last_post'],
);
}
mysql_free_result($result_boards);

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
//The latest member?
if (!empty($modSettings['latestMember']) && !empty($modSettings['MemberColorLatestMember']))
$context['MemberColor_ID_MEMBER'][$modSettings['latestMember']] = $modSettings['latestMember'];

// Know set the colors for the last post...
if (!empty($context['MemberColor_ID_MEMBER'])) {
$colorDatas = load_onlineColors($context['MemberColor_ID_MEMBER']);
$cmemcolid = null;

//So the BoardIndex need colored links
if (!empty($modSettings['MemberColorBoardindex']) && !empty($MemberColor_board))
foreach($MemberColor_board as $boardid_memcolor) {
$cmemcolid = $context['categories'][$boardid_memcolor['cat']]['boards'][$boardid_memcolor['bid']]['last_post']['member']['id'];
if(!empty($colorDatas[$cmemcolid]['colored_link']))
$context['categories'][$boardid_memcolor['cat']]['boards'][$boardid_memcolor['bid']]['last_post']['member']['link'] = $colorDatas[$cmemcolid]['colored_link'];
}

//You are not know what you do ;P Colors allready loaded :D
if(!empty($modSettings['MemberColorModeratorLinks']) && !empty($context['MemberColor_ModBoard'])) {
//This site will evertime use the correct Moderator Color, for this i need a extra query,
//because at the moment i don't know the correct color
$onlineColor = load_mod_color(true);
foreach($context['MemberColor_ModBoard'] as $boardid_memcolor) {
global $color_profile;
//Reset it :D
$context['categories'][$boardid_memcolor['cat']]['boards'][$boardid_memcolor['bid']]['link_moderators'] = array();
foreach($context['categories'][$boardid_memcolor['cat']]['boards'][$boardid_memcolor['bid']]['moderators'] as $moderators) {
$cmemcolid = $moderators['id'];
//Replace "Profil of" with "Moderator" ;D
$link = str_replace($txt[92], $txt[62], $colorDatas[$cmemcolid]['colored_link']);
if(empty($colorDatas[$cmemcolid]['online_color']) && !empty($onlineColor))
$link = '<a href="' . $scripturl . '?action=profile;u=' . $color_profile[$cmemcolid]['ID_MEMBER'] . '" title="' . $txt[62] . ' ' . $color_profile[$cmemcolid]['realName'] . '"'.(!empty($modSettings['MemberColorLinkOldSpanStyle']) ? '><span style="color:'.$onlineColor.';">' : ' style="color:'.$onlineColor.';">') . $color_profile[$cmemcolid]['realName'] . (!empty($modSettings['MemberColorLinkOldSpanStyle']) ? '</span>' : '').'</a>';
$context['categories'][$boardid_memcolor['cat']]['boards'][$boardid_memcolor['bid']]['moderators'][$cmemcolid]['link'] = $link;
//Create the new list...
$context['categories'][$boardid_memcolor['cat']]['boards'][$boardid_memcolor['bid']]['link_moderators'][] = $link;
}
}
}
}

ค้นหา -->>
โค๊ด: [Select]
lo.ID_MEMBER, lo.logTime, mem.realName, mem.memberName, mem.showOnline,

แก้เป็น -->>
โค๊ด: [Select]
lo.ID_MEMBER, lo.logTime, mem.realName, mem.memberName, mem.showOnline,
mem.birthdate as birthdate, mem.is_activated as is_activated,

ค้นหา -->>
โค๊ด: [Select]
$context['num_users_hidden']++;
continue;
}

แก้เป็น -->>
โค๊ด: [Select]
$context['num_users_hidden']++;
continue;
}
//Happy Birthday Color ;D Hope you love it :D
if(!empty($modSettings['MemberColorBirthdayColor']) && !empty($row['birthdate']) && compare_colorBirthdate($row['birthdate']))
$row['onlineColor'] = $modSettings['MemberColorBirthdayColor'];
//Color Banned user, replace there color...?
if(!empty($modSettings['MemberColorBanned']) && isset($row['is_activated']) && $row['is_activated'] >= 10)
$row['onlineColor'] = $modSettings['MemberColorBanned'];

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


!Personal

Germany   ชาย ผู้เริ่มต้นกระทู้นี้ ออฟไลน์544566157 DexMore DexMore DexMore
เว็บไซต์
icon message
general ความคิดเห็นที่ 1 เมื่อ: 27 มิถุนายน 2553, 21:26:16
file $sourcedir/Calendar.php

ค้นหา -->>
โค๊ด: [Select]
$bday = array();

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
//Set some standard Variables for the MemberColorLink
$MemberSetColor = false;
if (!empty($modSettings['MemberColorBirthday'])) {
$context['MemberColor_ID_MEMBER'] = array();
}

ค้นหา -->>
โค๊ด: [Select]
$bday[$age_year . substr($row['birthdate'], 4)][] = array(
'id' => $row['ID_MEMBER'],
'name' => $row['realName'],
'age' => $row['birthYear'] > 4 && $row['birthYear'] <= $age_year ? $age_year - $row['birthYear'] : null,
'is_last' => false
);
}
mysql_free_result($result);

แก้เป็น -->>
โค๊ด: [Select]
$bday[$age_year . substr($row['birthdate'], 4)][] = array(
'id' => $row['ID_MEMBER'],
'name' => $row['realName'],
'age' => $row['birthYear'] > 4 && $row['birthYear'] <= $age_year ? $age_year - $row['birthYear'] : null,
'is_last' => false
);

//I need to collect some IDs for the MemberColor :).
if (!empty($modSettings['MemberColorBirthday']) && !empty($row['ID_MEMBER'])) {
$context['MemberColor_ID_MEMBER'][$row['ID_MEMBER']] = $row['ID_MEMBER'];
$MemberSetColor = true;
}
}
mysql_free_result($result);

if ($MemberSetColor && !empty($context['MemberColor_ID_MEMBER'])) {
$colorDatas = load_onlineColors($context['MemberColor_ID_MEMBER']);
$cmemcolid = null;

//So i need only the colors... Sorry this must changed in the theme, too
if (!empty($modSettings['MemberColorBirthday']))
if (is_array($bday))
foreach ($bday as $memcalkv => $memcalva)
foreach ($memcalva as $memcalidkv => $memcalid) {
//Old Version Compatible...
$bday[$memcalkv][$memcalidkv]['color'] = $colorDatas[$memcalid['id']]['online_color'];
//New Style
$bday[$memcalkv][$memcalidkv]['colored_link'] = $colorDatas[$memcalid['id']]['colored_link'];
}
}

$sourcedir/Display.php

ค้นหา -->>
โค๊ด: [Select]
if (!empty($board_info['moderators']))
{
// Add a link for each moderator...
foreach ($board_info['moderators'] as $mod)
$context['link_moderators'][] = '<a href="' . $scripturl . '?action=profile;u=' . $mod['id'] . '" title="' . $txt[62] . '">' . $mod['name'] . '</a>';

แก้เป็น -->>
โค๊ด: [Select]
if (!empty($board_info['moderators']))
{
//I hate it in this way... but what should i do ;)
if(!empty($modSettings['MemberColorModeratorLinks'])) {
foreach($board_info['moderators'] as $mod)
$c[$mod['id']] = $mod['id'];
$colorDatas = load_onlineColors($c);
foreach ($board_info['moderators'] as $mod)
$context['link_moderators'][] = str_replace($txt[92], $txt[62], $colorDatas[$mod['id']]['colored_link']);
}
else
foreach ($board_info['moderators'] as $mod)
$context['link_moderators'][] ='<a href="' . $scripturl . '?action=profile;u=' . $mod['id'] . '" title="' . $txt[62] . '">' . $mod['name'] . '</a>';

ค้นหา -->>
โค๊ด: [Select]
$memberContext[$message['ID_MEMBER']]['group'] = $txt[28];
$memberContext[$message['ID_MEMBER']]['link'] = $message['posterName'];

แก้เป็น -->>
โค๊ด: [Select]
$memberContext[$message['ID_MEMBER']]['group'] = $txt[28];
$memberContext[$message['ID_MEMBER']]['link'] = (!empty($modSettings['MemberColorGuests']) ? '<span style="color:'.$modSettings['MemberColorGuests'].';">' : '').$message['posterName'].(!empty($modSettings['MemberColorGuests']) ? '</span>' : '');

ค้นหา -->>
โค๊ด: [Select]
if (empty($row['showOnline']))
$context['view_num_hidden']++;
}

// The number of guests is equal to the rows minus the ones we actually used ;).
$context['view_num_guests'] = mysql_num_rows($request) - count($context['view_members']);
mysql_free_result($request);

แก้เป็น -->>
โค๊ด: [Select]
if (!empty($modSettings['MemberColorWhoIsOnline'])) {
$context['MemberColor_ID_MEMBER'][$row['ID_MEMBER']] = $row['ID_MEMBER'];
}

if (empty($row['showOnline']))
$context['view_num_hidden']++;
}

// The number of guests is equal to the rows minus the ones we actually used ;).
$context['view_num_guests'] = mysql_num_rows($request) - count($context['view_members']);
mysql_free_result($request);

ค้นหา -->>
โค๊ด: [Select]
// Sort the list.
krsort($context['view_members']);
krsort($context['view_members_list']);
}

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
// Somehow i can do the colors for this in two steps... because the split between first part and the messages...
if (!empty($context['MemberColor_ID_MEMBER'])) {
$colorDatas = load_onlineColors($context['MemberColor_ID_MEMBER']);
//Color for the who is online ;)
if (!empty($settings['display_who_viewing']) && !empty($modSettings['MemberColorWhoIsOnline']) && !empty($context['view_members'])) {
//I need the new not numeric keys :)
$klist = array_keys($context['view_members']);
foreach($klist as $value) {
$id = $context['view_members'][$value]['id'];
//Let's replace Who is online colors...
$context['view_members'][$value]['link'] = $colorDatas[$id]['colored_link'];
//Somehow the 'view_members_list' must be the same as before *g*, i don't like the hidden users...
if (!$context['view_members'][$value]['hidden'] || allowedTo('moderate_forum'))
$context['view_members_list'][$value] = ($context['view_members'][$value]['hidden'] ? '<i>' : '').$colorDatas[$id]['colored_link'].($context['view_members'][$value]['hidden'] ? '</i>' : '');
}
}
}

$sourcedir/Recent.php

ค้นหา -->>
โค๊ด: [Select]
$posts = array();

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
if (!empty($modSettings['MemberColorRecentLastPost']))
$context['MemberColor_ID_MEMBER'] = array();

ค้นหา -->>
โค๊ด: [Select]
);
}
mysql_free_result($request);

return $posts;
}

แก้เป็น -->>
โค๊ด: [Select]
);
//The Last Posters id for the MemberColor.
if (!empty($modSettings['MemberColorRecentLastPost']) && !empty($row['ID_MEMBER']))
$context['MemberColor_ID_MEMBER'][$row['ID_MEMBER']] = $row['ID_MEMBER'];
}
mysql_free_result($request);

// Know set the colors for the Recent posts...
if (!empty($context['MemberColor_ID_MEMBER'])) {
$colorDatas = load_onlineColors($context['MemberColor_ID_MEMBER']);
if (!empty($modSettings['MemberColorRecentLastPost']) && is_array($posts))
foreach($posts as $postkey => $postid_memcolor)
if(!empty($colorDatas[$postid_memcolor['poster']['id']]['colored_link']))
$posts[$postkey]['poster']['link'] = $colorDatas[$postid_memcolor['poster']['id']]['colored_link'];
}

return $posts;
}

ค้นหา -->>
โค๊ด: [Select]
$counter = $_REQUEST['start'] + 1;
$context['posts'] = array();

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
if (!empty($modSettings['MemberColorRecentOwner']) || !empty($modSettings['MemberColorRecentLastPost']))
$context['MemberColor_ID_MEMBER'] = array();

ค้นหา -->>
โค๊ด: [Select]
if ($ID_MEMBER == $row['ID_FIRST_MEMBER'])
$board_ids['own'][$row['ID_BOARD']][] = $row['ID_MSG'];
$board_ids['any'][$row['ID_BOARD']][] = $row['ID_MSG'];
}
mysql_free_result($request);

แก้เป็น -->>
โค๊ด: [Select]
if ($ID_MEMBER == $row['ID_FIRST_MEMBER'])
$board_ids['own'][$row['ID_BOARD']][] = $row['ID_MSG'];
$board_ids['any'][$row['ID_BOARD']][] = $row['ID_MSG'];

//The Thread Owners id for the MemberColor.
if (!empty($modSettings['MemberColorRecentOwner']) && !empty($row['ID_FIRST_MEMBER']))
$context['MemberColor_ID_MEMBER'][$row['ID_FIRST_MEMBER']] = $row['ID_FIRST_MEMBER'];
//The Last Posters id for the MemberColor.
if (!empty($modSettings['MemberColorRecentLastPost']) && !empty($row['ID_MEMBER']))
$context['MemberColor_ID_MEMBER'][$row['ID_MEMBER']] = $row['ID_MEMBER'];
}
mysql_free_result($request);

// Know set the colors for the Recent posts...
if (!empty($context['MemberColor_ID_MEMBER']) && is_array($context['posts'])) {
$colorDatas = load_onlineColors($context['MemberColor_ID_MEMBER']);
foreach($context['posts'] as $postkey => $postid_memcolor) {
if (!empty($modSettings['MemberColorRecentLastPost']) && !empty($colorDatas[$postid_memcolor['poster']['id']]['colored_link']))
$context['posts'][$postkey]['poster']['link'] = $colorDatas[$postid_memcolor['poster']['id']]['colored_link'];
if (!empty($modSettings['MemberColorRecentOwner']) && !empty($colorDatas[$postid_memcolor['first_poster']['id']]['colored_link']))
$context['posts'][$postkey]['first_poster']['link'] = $colorDatas[$postid_memcolor['first_poster']['id']]['colored_link'];
}
}

ค้นหา -->>
โค๊ด: [Select]
$context['topics'] = array();
$topic_ids = array();

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
if (!empty($modSettings['MemberColorRecentOwner']) || !empty($modSettings['MemberColorRecentLastPost']))
$context['MemberColor_ID_MEMBER'] = array();

ค้นหา -->>
โค๊ด: [Select]
);

determineTopicClass($context['topics'][$row['ID_TOPIC']]);
}
mysql_free_result($request);

if ($is_topics && !empty($modSettings['enableParticipation']) && !empty($topic_ids))

แก้เป็น -->>
โค๊ด: [Select]
);

//The Thread Owners id for the MemberColor.
if (!empty($modSettings['MemberColorRecentOwner']) && !empty($row['ID_FIRST_MEMBER']))
$context['MemberColor_ID_MEMBER'][$row['ID_FIRST_MEMBER']] = $row['ID_FIRST_MEMBER'];
//The Last Posters id for the MemberColor.
if (!empty($modSettings['MemberColorRecentLastPost']) && !empty($row['ID_LAST_MEMBER']))
$context['MemberColor_ID_MEMBER'][$row['ID_LAST_MEMBER']] = $row['ID_LAST_MEMBER'];

determineTopicClass($context['topics'][$row['ID_TOPIC']]);
}
mysql_free_result($request);

// Know set the colors for the Recent posts...
if (!empty($context['MemberColor_ID_MEMBER']) && is_array($context['topics'])) {
$colorDatas = load_onlineColors($context['MemberColor_ID_MEMBER']);
foreach($context['topics'] as $postkey => $postid_memcolor) {
if (!empty($modSettings['MemberColorRecentLastPost']) && !empty($colorDatas[ $postid_memcolor['last_post']['member']['id']]['colored_link']))
$context['topics'][$postkey]['last_post']['member']['link'] = $colorDatas[$postid_memcolor['last_post']['member']['id']]['colored_link'];
if (!empty($modSettings['MemberColorRecentOwner']) && !empty($colorDatas[ $postid_memcolor['first_post']['member']['id']]['colored_link']))
$context['topics'][$postkey]['first_post']['member']['link'] = $colorDatas[ $postid_memcolor['first_post']['member']['id']]['colored_link'];
}
}

if ($is_topics && !empty($modSettings['enableParticipation']) && !empty($topic_ids))

ค้นหา -->>
โค๊ด: [Select]
'link' => empty($row['ID_MEMBER']) ? $row['posterName'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['posterName'] . '</a>'
),
'subject' => $row['subject'],

แก้เป็น -->>
โค๊ด: [Select]
'link' => empty($row['ID_MEMBER']) ? (!empty($modSettings['MemberColorGuests']) ? '<span style="color:'.$modSettings['MemberColorGuests'].';">' : '').$row['posterName'].(!empty($modSettings['MemberColorGuests']) ? '</span>' : '') : '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['posterName'] . '</a>'
),
'subject' => $row['subject'],

ค้นหา -->>
โค๊ด: [Select]
'link' => empty($row['ID_FIRST_MEMBER']) ? $row['firstPosterName'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_FIRST_MEMBER'] . '">' . $row['firstPosterName'] . '</a>'

แก้เป็น -->>
โค๊ด: [Select]
'link' => empty($row['ID_FIRST_MEMBER']) ? (!empty($modSettings['MemberColorGuests']) ? '<span style="color:'.$modSettings['MemberColorGuests'].';">' : '').$row['firstPosterName'].(!empty($modSettings['MemberColorGuests']) ? '</span>' : '') : '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_FIRST_MEMBER'] . '">' . $row['firstPosterName'] . '</a>'

ค้นหา -->>
โค๊ด: [Select]
'link' => empty($row['ID_MEMBER']) ? $row['posterName'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['posterName'] . '</a>'
),
'message' => $row['body'],

แก้เป็น -->>
โค๊ด: [Select]
'link' => empty($row['ID_MEMBER']) ? (!empty($modSettings['MemberColorGuests']) ? '<span style="color:'.$modSettings['MemberColorGuests'].';">' : '').$row['posterName'].(!empty($modSettings['MemberColorGuests']) ? '</span>' : '') : '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['posterName'] . '</a>'
),
'message' => $row['body'],

$sourcedir/PersonalMessage.php

ค้นหา -->>
โค๊ด: [Select]
$context['allow_hide_email'] = !empty($modSettings['allow_hideEmail']);
$context['from_or_to'] = $context['folder'] != 'outbox' ? 'from' : 'to';
$context['get_pmessage'] = 'prepareMessageContext';

$labelQuery = $context['folder'] != 'outbox' ? "
AND FIND_IN_SET('$context[current_label_id]', pmr.labels)" : '';

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
//Correct a Modsettings sometime there is a problem, and load variables if i need them ;).
$colormodcheck = $context['folder'] == 'outbox' ? 'MemberColorOutbox' : 'MemberColorInbox';
$MemberSetColor = false;
if (empty($modSettings[$colormodcheck]) && !empty($modSettings['MemberColorLink']))
$modSettings['MemberColorLink'] = 0;
if (!empty($modSettings[$colormodcheck])) {
$context['MemberColor_ID_MEMBER'] = array();
$context['MemberColor_IM_ID'] = array();
}

ค้นหา -->>
โค๊ด: [Select]
}
mysql_free_result($request);

// Load any users....
$posters = array_unique($posters);
if (!empty($posters))
loadMemberData($posters);

แก้เป็น -->>
โค๊ด: [Select]
if (!empty($row['ID_MEMBER_TO']) && !empty($modSettings[$colormodcheck])) {
$MemberSetColor = true;
$posters[] = $row['ID_MEMBER_TO'];
// Hmmm somehow i must know what i should replace... i hope i do it right...
$context['MemberColor_IM_ID'][$row['ID_PM']][empty($row['bcc']) ? 'to' : 'bcc'][] = $row['ID_MEMBER_TO'];
}
elseif (empty($row['ID_MEMBER_TO']) && (!empty($modSettings['MemberColorOutbox']) || !empty($modSettings['MemberColorInbox'])))
$context['MemberColor_IM_ID'][$row['ID_PM']][empty($row['bcc']) ? 'to' : 'bcc'][] = NULL;
}

// Load any users....
$posters = array_unique($posters);
if (!empty($posters))
loadMemberData($posters);

//So i must correct the link ;) i need only the membercontext for this (a little bit faster)
if ($MemberSetColor && !empty($context['MemberColor_IM_ID'])) {
//Now i can Load the Missing global :)
global $user_profile;

//So let's replace the links...
foreach($context['MemberColor_IM_ID'] as $pmid => $pmidarray) {
if (!empty($pmidarray['to']))
foreach($pmidarray['to'] as $pm_meber_key => $pm_member_id) {
if(!empty($recipients[$pmid]['to'][$pm_meber_key]) && (!empty($user_profile[$pm_member_id]['member_group_color']) || !empty($user_profile[$pm_member_id]['post_group_color']))) {
$profile = $user_profile[$pm_member_id];
$recipients[$pmid]['to'][$pm_meber_key] = '<a href="' . $scripturl . '?action=profile;u=' . $profile['ID_MEMBER'] . '" title="' . $txt[92] . ' ' . $profile['realName'] . '"><span style="color:'.(!empty($profile['member_group_color']) ? $profile['member_group_color'] : $profile['post_group_color']).';">' . $profile['realName'] . '</span></a>';
}
}
if (!empty($pmidarray['bcc']))
foreach($pmidarray['bcc']  as $pm_meber_key => $pm_member_id) {
if(!empty($recipients[$pmid]['bcc'][$pm_meber_key]) && (!empty($user_profile[$pm_member_id]['member_group_color']) || !empty($user_profile[$pm_member_id]['post_group_color']))) {
$profile = $user_profile[$pm_member_id];
$recipients[$pmid]['bcc'][$pm_meber_key] = '<a href="' . $scripturl . '?action=profile;u=' . $profile['ID_MEMBER'] . '" title="' . $txt[92] . ' ' . $profile['realName'] . '"><span style="color:'.(!empty($profile['member_group_color']) ? $profile['member_group_color'] : $profile['post_group_color']).';">' . $profile['realName'] . '</span></a>';
}
}
}
}

$sourcedir/Stats.php

ค้นหา -->>
โค๊ด: [Select]
$context['top_posters'][] = array(
'name' => $row_members['realName'],
'id' => $row_members['ID_MEMBER'],
'num_posts' => $row_members['posts'],
'href' => $scripturl . '?action=profile;u=' . $row_members['ID_MEMBER'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row_members['ID_MEMBER'] . '">' . $row_members['realName'] . '</a>'
);

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

if (!empty($modSettings['MemberColorStats']))
$context['MemberColor_ID_MEMBER'][$row_members['ID_MEMBER']] = $row_members['ID_MEMBER'];

ค้นหา -->>
โค๊ด: [Select]
$context['top_boards'][] = array(
'id' => $row_board['ID_BOARD'],
'name' => $row_board['name'],
'num_posts' => $row_board['numPosts'],
'href' => $scripturl . '?board=' . $row_board['ID_BOARD'] . '.0',
'link' => '<a href="' . $scripturl . '?board=' . $row_board['ID_BOARD'] . '.0">' . $row_board['name'] . '</a>'
);

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
if (!empty($modSettings['MemberColorStats']))
$context['MemberColor_ID_MEMBER'][$row_members['ID_MEMBER_STARTED']] = $row_members['ID_MEMBER_STARTED'];

ค้นหา -->>
โค๊ด: [Select]
$context['top_time_online'][] = array(
'id' => $row_members['ID_MEMBER'],
'name' => $row_members['realName'],
'time_online' => $timelogged,
'seconds_online' => $row_members['totalTimeLoggedIn'],
'href' => $scripturl . '?action=profile;u=' . $row_members['ID_MEMBER'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row_members['ID_MEMBER'] . '">' . $row_members['realName'] . '</a>'
);

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
if (!empty($modSettings['MemberColorStats']))
$context['MemberColor_ID_MEMBER'][$row_members['ID_MEMBER']] = $row_members['ID_MEMBER'];

ค้นหา -->>
โค๊ด: [Select]
foreach ($context['top_time_online'] as $i => $member)
$context['top_time_online'][$i]['time_percent'] = round(($member['seconds_online'] * 100) / $max_time_online);

เพิ่มไว้หลัง -->>
   
โค๊ด: [Select]
if (!empty($modSettings['latestMember']) && !empty($modSettings['MemberColorLatestMember']))
$context['MemberColor_ID_MEMBER'][$modSettings['latestMember']] = $modSettings['latestMember'];

//Yeah baby give me some colors =) .oO(sometimes who read this ;D).
if (!empty($context['MemberColor_ID_MEMBER'])) {
$colorDatas = load_onlineColors($context['MemberColor_ID_MEMBER']);
if (!empty($modSettings['MemberColorStats'])) {
// First the Top Posters =)
foreach($context['top_posters'] as $key => $value) {
if(!empty($colorDatas[$context['top_posters'][$key]['id']]['colored_link']))
$context['top_posters'][$key]['link'] = $colorDatas[$context['top_posters'][$key]['id']]['colored_link'];
}
// First the Top Starter =)
foreach($context['top_starters'] as $key => $value) {
if(!empty($colorDatas[$context['top_starters'][$key]['id']]['colored_link']))
$context['top_starters'][$key]['link'] = $colorDatas[$context['top_starters'][$key]['id']]['colored_link'];
}
// First the Top Onliner =)
foreach($context['top_time_online'] as $key => $value) {
if(!empty($colorDatas[$context['top_time_online'][$key]['id']]['colored_link']))
$context['top_time_online'][$key]['link'] = $colorDatas[$context['top_time_online'][$key]['id']]['colored_link'];
}
}
if (!empty($modSettings['latestMember']) && !empty($modSettings['MemberColorLatestMember']))
$context['latest_member']['link'] = $colorDatas[$modSettings['latestMember']]['colored_link'];
}

file $sourcedir/Subs.php

ค้นหา -->>
โค๊ด: [Select]
// This looks weird, but it's because BoardIndex.php references the variable.
$context['common_stats']['latest_member'] = array(
'id' => $modSettings['latestMember'],
'name' => $modSettings['latestRealName'],
'href' => $scripturl . '?action=profile;u=' . $modSettings['latestMember'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $modSettings['latestMember'] . '">' . $modSettings['latestRealName'] . '</a>',
);

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
//Latest user need some colors... How could you put this into this file... i hate you... i hope no one read this :P
if (!empty($modSettings['latestMember']) && !empty($modSettings['MemberColorLatestMember'])) {
$data = load_onlineColors($modSettings['latestMember'], true, true); //I'm sure this is single user
$context['common_stats']['latest_member']['link'] = $data['colored_link'];
}

file $sourcedir/Search.php

ค้นหา -->>
โค๊ด: [Select]
$memberContext[$message['ID_MEMBER']]['link'] = $message['posterName'];

แก้เป็น -->>
โค๊ด: [Select]
$memberContext[$message['ID_MEMBER']]['link'] = (!empty($modSettings['MemberColorGuests']) ? '<span style="color:'.$modSettings['MemberColorGuests'].';">' : '').$message['posterName'].(!empty($modSettings['MemberColorGuests']) ? '</span>' : '');

ค้นหา -->>
โค๊ด: [Select]
$output = array_merge($context['topics'][$message['ID_MSG']], array(

แก้เป็น -->>
โค๊ด: [Select]
//Generate the Started By Search Link... This is not fine, because i need to load each sepperate...
//Ah and add correct Guest links ;D
$first_post_link = !empty($message['first_member_id']) ? '<a href="' . $scripturl . '?action=profile;u=' . $message['first_member_id'] . '" title="' . $txt[92] . ' ' . $message['first_member_name'] . '">' . $message['first_member_name'] . '</a>' : (!empty($modSettings['MemberColorGuests']) ? '<span style="color:'.$modSettings['MemberColorGuests'].';">' : '').$message['first_member_name'].(!empty($modSettings['MemberColorGuests']) ? '</span>' : '');
$last_post_link = !empty($message['last_member_id']) ? '<a href="' . $scripturl . '?action=profile;u=' . $message['last_member_id'] . '" title="' . $txt[92] . ' ' . $message['last_member_name'] . '">' . $message['last_member_name'] . '</a>' : (!empty($modSettings['MemberColorGuests']) ? '<span style="color:'.$modSettings['MemberColorGuests'].';">' : '').$message['last_member_name'].(!empty($modSettings['MemberColorGuests']) ? '</span>' : '');
if(!empty($modSettings['MemberColorAllSearch'])) {
$load = array();
if(!empty($message['first_member_id']))
$load[] = $message['first_member_id'];
if(!empty($message['first_member_id']))
$load[] = $message['last_member_id'];
if(!empty($load)) {
$colorDatas = load_onlineColors($load);
if(!empty($colorDatas[$message['first_member_id']]['colored_link']))
$first_post_link = $colorDatas[$message['first_member_id']]['colored_link'];
if(!empty($colorDatas[$message['last_member_id']]['colored_link']))
$last_post_link = $colorDatas[$message['last_member_id']]['colored_link'];
}
}

$output = array_merge($context['topics'][$message['ID_MSG']], array(

ค้นหา -->>
โค๊ด: [Select]
'link' => !empty($message['first_member_id']) ? '<a href="' . $scripturl . '?action=profile;u=' . $message['first_member_id'] . '" title="' . $txt[92] . ' ' . $message['first_member_name'] . '">' . $message['first_member_name'] . '</a>' : $message['first_member_name']

แก้เป็น -->>
โค๊ด: [Select]
'link' => $first_post_link

ค้นหา -->>
โค๊ด: [Select]
'link' => !empty($message['last_member_id']) ? '<a href="' . $scripturl . '?action=profile;u=' . $message['last_member_id'] . '" title="' . $txt[92] . ' ' . $message['last_member_name'] . '">' . $message['last_member_name'] . '</a>' : $message['last_member_name']

แก้เป็น -->>
โค๊ด: [Select]
'link' => $last_post_link

file $themedir/Calendar.template.php

ค้นหา -->>
โค๊ด: [Select]
<a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['name'], isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] ? '' : ', ';

แก้เป็น -->>
โค๊ด: [Select]
<a href="', $scripturl, '?action=profile;u=', $member['id'], '"'. (!empty($member['color']) ? (empty($modSettings['MemberColorLinkOldSpanStyle']) ? ' style="color:'.$member['color'].'">' : '><span style="color:'.$member['color'].';">') : '>'), $member['name'], isset($member['age']) ? ' (' . $member['age'] . ')' : '', (!empty($member['color']) && !empty($modSettings['MemberColorLinkOldSpanStyle']) ? '</span>' : ''), '</a>', $member['is_last'] ? '' : ', ';

file $themedir/BoardIndex.template.php

ค้นหา -->>
โค๊ด: [Select]
<a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['is_today'] ? '<b>' : '', $member['name'], $member['is_today'] ? '</b>' : '', isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] ? '<br />' : ', ';

แก้เป็น -->>
โค๊ด: [Select]
', ($member['is_today'] ? '<b>' : ''), '<a href="', $scripturl, '?action=profile;u=', $member['id'], '"'. (!empty($member['color']) ? (empty($modSettings['MemberColorLinkOldSpanStyle']) ? ' style="color:'.$member['color'].'">' : '><span style="color:'.$member['color'].';">') : '>'), $member['name'], isset($member['age']) ? ' (' . $member['age'] . ')' : '', (!empty($member['color']) && !empty($modSettings['MemberColorLinkOldSpanStyle']) ? '</span>' : ''), '</a>', ($member['is_today'] ? '</b>' : ''), $member['is_last'] ? '' : ', ';

file $themedir/Profile.template.php

ค้นหา -->>
โค๊ด: [Select]
<td><b>', $txt[68], ': </b></td>
<td>', $context['member']['name'], '</td>

แก้เป็น -->>
โค๊ด: [Select]
<td><b>', $txt[68], ': </b></td>
<td>', $context['member']['colored_name'], '</td>

file $languagedir/Modifications.thai-utf8.php

เพิ่ม -->>
โค๊ด: [Select]
//Member Color Link
$txt['MemberColorLinkHeadline'] = 'Member Color Link';
$txt['MemberColorLink'] = 'The display of the threadindex';
$txt['MemberColorLinkOldSpanStyle'] = 'Use a span html tag for the color (Old Style of the Mod)';
$txt['MemberColorThreadOwner'] = 'The thread owner at the boardindex';
$txt['MemberColorThreadLastPost'] = 'The last post member at the messageindex';
$txt['MemberColorThreadChild'] = 'The last post member at the childboard';
$txt['MemberColorModeratorLinks'] = 'Color the Moderator Links';
$txt['MemberColorBoardindex'] = 'The last post member at the boardindex';
$txt['MemberColorBirthday'] = 'The Birthday Links of the Members (Calendar and Boardindex)';
$txt['MemberColorRecentOwner'] = 'Recent posts, threadowner';
$txt['MemberColorRecentLastPost'] = 'Recent posts, the last poster';
$txt['MemberColorInbox'] = 'Change colors in the Instant Messages Inbox';
$txt['MemberColorOutbox'] = 'Change colors in the Instant Messages Outbox';
$txt['MemberColorLatestMember'] = 'Color the Latest Member';
$txt['MemberColorStats'] = 'Change color in the Boardstats.';
$txt['MemberColorWhoIsOnline'] = 'Color the Who is Online (Messagesindex and Threadindex)';
$txt['MemberColorGuests'] = 'Color for Guest nicknames<br /><span class="smalltext">Boradindex, Messageindex and Theaddisplay</span>';
$txt['MemberColorBanned'] = 'Color for Banned nicknames';
$txt['MemberColorBirthdayColor'] = 'Color for Brithday nicknames';
$txt['MemberColorModCenter'] = 'Color links for the Moderation Center';
$txt['MemberColorIssuePList'] = 'Color links of the profile issued warning list';
$txt['MemberColorAllSearch'] = 'Extend Color in Search to all Field (Heavy load needed)';

สร้างไฟล์: install_1.x.x.php เพื่อสร้างฐานข้อมูล ไว้ใน $boarddir (ที่เดียวกับไฟล์ SSI.php) รัน http://www.your_url.xxx/$boarddir/install_1.x.x.php -->> Enter เสร็จแล้วลบทิ้ง
โค๊ด: [Select]
<?
/*****************************************************************
* install.php  Version 1.0.2                                     *
* Special Advanced Version for Easier Handling                   *
* Programmed / Copyright By DIN1031 (http://www.ayu-kult.de/)    *
* for SMF (http://www.simplemachines.org)                        *
*****************************************************************/
/*****************************************************************
* It's free to change and use everywhere who this file is        *
* useable and made his work. You can change the code as you like *
* it. The only thing that i wish is, add the first 7 Lines of    *
* this file                                                      *
* THANKS A LOT                                                   *
*****************************************************************/
/*****************************************************************
* Used for follow Software                                       *
* Programm:      MemberColorLink                                 *
* By:            DIN1031 (http://www.ayu-kult.de/)               *
* Copyright:     DIN1031 (http://www.ayu-kult.de/)               *
*****************************************************************/

global $db_prefix, $modSettings;

//This is a way to install the mod without the package parser!
$SSI_INSTALL = false;
if(!isset($db_prefix)) {
require('SSI.php');
$SSI_INSTALL = true;
}

//I can't install it if this on <<
$old_querycheck = isset($modSettings['disableQueryCheck']) ? $modSettings['disableQueryCheck'] : 0;
$modSettings['disableQueryCheck'] = 1;

//Upgrade a field so that it store more informations ;D
db_query("ALTER TABLE {$db_prefix}membergroups CHANGE onlineColor onlineColor VARCHAR( 255 ) NOT NULL", __FILE__, __LINE__);

//Okay Work done ;) (Replace the Varibale back...)
$modSettings['disableQueryCheck'] = $old_querycheck;

//Give a proper answer on ssi install ;)
if($SSI_INSTALL)
echo 'DB Changes should be made now...';
?>

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


!Personal

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

แก้ไขไฟล์:

file $sourcedir/Admin.php

ค้นหา -->>
โค๊ด: [Select]
'layout' => array($txt['mods_cat_layout']),

แก้เป็น -->>
โค๊ด: [Select]
'layout' => array($txt['mods_cat_layout']),
'MemberColorLinks' => array($txt['MemberColorLinkHeadline']),

file $sourcedir/ManageSettings.php

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

แก้เป็น -->>
โค๊ด: [Select]
'layout' => 'ModifyLayoutSettings',
'MemberColorLinks' => 'ModifyMemberColorLinksSettings',

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

แก้เป็น -->>
โค๊ด: [Select]
'layout' => array(
),
'MemberColorLinks' => array(
),

ค้นหา -->>
โค๊ด: [Select]
function ModifyKarmaSettings($return_config = false)
{
global $txt, $scripturl, $context, $settings, $sc;

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
function ModifyMemberColorLinksSettings($return_config = false)
{
global $txt, $scripturl, $context, $settings, $sc;

$config_vars = array(
// Standard Membercolor?
array('check', 'MemberColorLink'),
array('check', 'MemberColorLinkOldSpanStyle'),
'',
//Some Stat Settings
array('check', 'MemberColorLatestMember'),
array('check', 'MemberColorStats'),
array('check', 'MemberColorWhoIsOnline'),
'',
//Thread and Boardsettings
array('check', 'MemberColorThreadOwner'),
array('check', 'MemberColorThreadLastPost'),
array('check', 'MemberColorThreadChild'),
'',
//Birthday and Calendar
array('check', 'MemberColorModeratorLinks'),
array('check', 'MemberColorBoardindex'),
array('check', 'MemberColorBirthday'),
'',
//Some Recent Things
array('check', 'MemberColorRecentOwner'),
array('check', 'MemberColorRecentLastPost'),
'',
// PM Colors
array('check', 'MemberColorInbox'),
array('check', 'MemberColorOutbox'),
'',
//Moderation Things :)
array('check' , 'MemberColorModCenter'),
array('check' , 'MemberColorIssuePList'),
'',
//The Heavy Member Search Option
array('check' , 'MemberColorAllSearch'),
'',
//Guest Color
array('text', 'MemberColorGuests'),
//Banned User Color
array('text', 'MemberColorBanned'),
//Birthday User Color
array('text', 'MemberColorBirthdayColor'),
);

if ($return_config)
return $config_vars;

// Saving?
if (isset($_GET['save']))
{
saveDBSettings($config_vars);
redirectexit('action=admin;area=featuresettings;sa=MemberColorLinks');
}

$context['post_url'] = $scripturl . '?action=admin;area=featuresettings;save;sa=MemberColorLinks';
$context['settings_title'] = $txt['MemberColorLinkHeadline'];

prepareDBSettingContext($config_vars);
}

file $sourcedir/Load.php

ค้นหา -->>
โค๊ด: [Select]
array loadMemberData(array members, bool is_name = false, string set = 'normal')

แก้เป็น -->>
โค๊ด: [Select]
array load_OnlineColors(array members, bool returnarray = true, bool singleuser = false)
- This function is for Modcreators who like to color the nicks if the MemberColorLink is installed
  with this function the user can check if the function exists and load the colors if needed.
  But please load so many ids as possible at one time, to reduce the database querys.
  To Check if the function exist use if(!empty($modSettings['MemberColorLinkInstalled'])) {}
- return a array with follow informations
array(id_member => array(online_color => '', colored_name => '', colored_link => '');
- The option single user will only return one user color as array, without id before.
- chache datas the global $color_profile (only the db data, not the array data above)
- return "false" on nothing loaded!

bool/string load_mod_color(bool return = false, string update = null)
- Store the Moderator Color into the $context['modGroupColor']
- "return = true" will return this color as string
- This function use only one time the query to load this color
- update is for the fast update of the moderator color

bool compare_birthday(string brtihday)
- Compare Today with the Birthday, true if today his/her birthday

array loadMemberData(array members, bool is_name = false, string set = 'normal')

ค้นหา -->>
โค๊ด: [Select]
// UTF-8 in regular expressions is unsupported on PHP(win) versions < 4.2.3.

แก้เป็น -->>
โค๊ด: [Select]
//This setting should never chached, it show others that member color link is installed!
$modSettings['MemberColorLinkInstalled'] = function_exists('load_onlineColors') ? 1 : 0;
$modSettings['MemberColorLinkVersion'] = '3.0.8';

// UTF-8 in regular expressions is unsupported on PHP(win) versions < 4.2.3.

ค้นหา -->>
โค๊ด: [Select]
if (!empty($row['id_moderator']))
$board_info['moderators'][$row['id_moderator']] = array(
'id' => $row['id_moderator'],
'name' => $row['real_name'],
'href' => $scripturl . '?action=profile;u=' . $row['id_moderator'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['id_moderator'] . '" title="' . $txt['board_moderator'] . '">' . $row['real_name'] . '</a>'
);

แก้เป็น -->>
โค๊ด: [Select]
if (!empty($row['id_moderator'])) {
//Online Color if needed for a Moderator :D, to many ways possible <<
if(!empty($modSettings['MemberColorModeratorLinks']))
$onlineColor = load_mod_color(true);
if(!empty($onlineColor))
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['id_moderator'] . '" title="' . $txt['board_moderator'] . ' ' . $row['real_name'] . '"'.(!empty($modSettings['MemberColorLinkOldSpanStyle']) ? '><span style="color:'.$onlineColor.';">' : ' style="color:'.$onlineColor.';">') . $row['real_name'] . (!empty($modSettings['MemberColorLinkOldSpanStyle']) ? '</span>' : '').'</a>';
else
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['id_moderator'] . '" title="' . $txt['board_moderator'] . '">' . $row['real_name'] . '</a>';

$board_info['moderators'][$row['id_moderator']] = array(
'id' => $row['id_moderator'],
'name' => $row['real_name'],
'href' => $scripturl . '?action=profile;u=' . $row['id_moderator'],
'link' => $link
);
}

ค้นหา -->>
โค๊ด: [Select]
global $user_profile, $modSettings, $board_info, $smcFunc;

แก้เป็น -->>
โค๊ด: [Select]
global $user_profile, $modSettings, $board_info, $smcFunc;
global $color_profile; //This is for Preloaded Data, i will not load it twice you know ;)

ค้นหา -->>
โค๊ด: [Select]
$loaded_ids[] = $data['id_member'];
$user_profile[$data['id_member']] = $data;

แก้เป็น -->>
โค๊ด: [Select]
$loaded_ids[] = $data['id_member'];
$user_profile[$data['id_member']] = $data;
//Happy Birthday Color to this user :D
if(!empty($modSettings['MemberColorBirthdayColor']) && !empty($data['birthdate']) && compare_colorBirthdate($data['birthdate'])) {
$user_profile[$data['id_member']]['post_group_color'] = $modSettings['MemberColorBirthdayColor'];
$user_profile[$data['id_member']]['member_group_color'] = $modSettings['MemberColorBirthdayColor'];
}
//Color Banned user, replace there color... hope they are not moderators ;P?
if(!empty($modSettings['MemberColorBanned']) && isset($data['is_activated']) && $data['is_activated'] >= 10) {
$user_profile[$data['id_member']]['post_group_color'] = $modSettings['MemberColorBanned'];
$user_profile[$data['id_member']]['member_group_color'] = $modSettings['MemberColorBanned'];
}
//Memeber Color Link will used Chached Data, too wheee.
if($set == 'normal' || $set == 'profile') //This are the only sets with the info the mod need.
$color_profile[$data['id_member']] = array(
'id_member' => $data['id_member'],
'real_name' => $data['real_name'],
'member_group_color' => $user_profile[$data['id_member']]['member_group_color'],
'post_group_color' => $user_profile[$data['id_member']]['post_group_color'],
);

ค้นหา -->>
โค๊ด: [Select]
$user_profile[$row['id_member']] = $row;

แก้เป็น -->>
โค๊ด: [Select]
$user_profile[$row['id_member']] = $row;
//Happy Birthday Color to this user :D
if(!empty($modSettings['MemberColorBirthdayColor']) && !empty($data['birthdate']) && compare_colorBirthdate($data['birthdate'])) {
$user_profile[$row['id_member']]['post_group_color'] = $modSettings['MemberColorBirthdayColor'];
$user_profile[$row['id_member']]['member_group_color'] = $modSettings['MemberColorBirthdayColor'];
}
//Color Banned user, replace there color... hope they are not moderators ;P?
if(!empty($modSettings['MemberColorBanned']) && isset($row['is_activated']) && $row['is_activated'] >= 10) {
$user_profile[$row['id_member']]['post_group_color'] = $modSettings['MemberColorBanned'];
$user_profile[$row['id_member']]['member_group_color'] = $modSettings['MemberColorBanned'];
}
//Memeber Color Link will used Chached Data, too wheee.
if($set == 'normal' || $set == 'profile') //This are the only sets with the info the mod need.
$color_profile[$row['id_member']] = array(
'id_member' => $row['id_member'],
'real_name' => $row['real_name'],
'member_group_color' => $user_profile[$row['id_member']]['member_group_color'],
'post_group_color' => $user_profile[$row['id_member']]['post_group_color'],
);

ค้นหา -->>
โค๊ด: [Select]
cache_put_data('moderator_group_info', $row, 480);

แก้เป็น -->>
โค๊ด: [Select]
cache_put_data('moderator_group_info', $row, 480);
//Chaka i will use this information for later... lower the querys ;)
if(isset($modSettings['MemberColorLinkModColor']) && $modSettings['MemberColorLinkModColor'] != $row['member_group_color'])
updateSettings(array('MemberColorLinkModColor' => $row['member_group_color']));

ค้นหา -->>
โค๊ด: [Select]
$profile = $user_profile[$user];

แก้เป็น -->>
โค๊ด: [Select]
$profile = $user_profile[$user];

//Prepare some colored Datas :D Member Color Link give some Infos back 8)
$coloredData = load_onlineColors($user, true, true);

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

แก้เป็น -->>
โค๊ด: [Select]
'username' => $profile['member_name'],
'name' => $profile['real_name'],
'colored_name' => $coloredData['colored_name'],
'online_color' => $coloredData['online_color'],

ค้นหา -->>
โค๊ด: [Select]
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $profile['id_member'] . '" title="' . $txt['profile_of'] . ' ' . $profile['real_name'] . '">' . $profile['real_name'] . '</a>',

แก้เป็น -->>
โค๊ด: [Select]
'link' => $coloredData['colored_link'],
'colorless_link' => '<a href="' . $scripturl . '?action=profile;u=' . $profile['id_member'] . '" title="' . $txt['profile_of'] . ' ' . $profile['real_name'] . '">' . $profile['real_name'] . '</a>',

ค้นหา -->>
โค๊ด: [Select]
// Load a theme, by ID.

แก้เป็น -->>
โค๊ด: [Select]
//This is the universial load colors function, can be used by each person who need it :)
//I think it's intressting for mod Creators =D
//SMF 2.0.x Version

function load_onlineColors($users, $returnarray = true, $singleuser = false) {
global $color_profile, $modSettings, $smcFunc;
static $color_array;

//Make something for sure :)
if(!isset($color_profile))
$color_profile = array();
//This will hold the array data for later ;)
if(!isset($color_array))
$color_array = array();
//Set a standard empty array for guest errors ;) (Deleted users, which are not resetet)
if(!isset($color_profile[0]))
$color_profile[0] = array('member_group_color' => '', 'post_group_color' => '');

// Can't just look for no users :P.
if (empty($users))
return false;

// Make sure it's an array.
$users = !is_array($users) ? array($users) : array_unique($users);

//... SSI can insert empty users :x
foreach($users as $k => $u)
if(empty($u) || $u < 0 || !is_numeric($u))
unset($users[$k]);

//Now i will use this as a chache, too
$loaded_ids = array();
$all_loaded_ids = array_keys($color_profile);
//All the users that allready loaded
$loaded_ids = array_intersect($all_loaded_ids, $users);
//Now i need only the new users to load
$users = array_diff($users, $all_loaded_ids);

if(!empty($users)) {
// Load the data.
$request = $smcFunc['db_query']('', "
SELECT
mem.id_member AS id_member, mem.real_name AS real_name, mem.is_activated AS is_activated,
mem.birthdate AS birthdate,
mg.online_color AS member_group_color, IFnull(mg.group_name, '') AS member_group,
pg.online_color AS post_group_color, IFnull(pg.group_name, '') AS post_group
FROM {db_prefix}members AS mem
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)
WHERE mem.id_member ".(count($users) == 1 ? " = '" . current($users) . "'" : " IN ('" . implode("', '", $users) . "')"));

while ($row = $smcFunc['db_fetch_assoc']($request))
{
$loaded_ids[] = $row['id_member'];
$color_profile[$row['id_member']] = $row;
//Happy Birthday Color ;D Hope you love it :D
if(!empty($modSettings['MemberColorBirthdayColor']) && !empty($row['birthdate']) && compare_colorBirthdate($row['birthdate'])) {
$color_profile[$row['id_member']]['post_group_color'] = $modSettings['MemberColorBirthdayColor'];
$color_profile[$row['id_member']]['member_group_color'] = $modSettings['MemberColorBirthdayColor'];
}
//Banned User hope it is not a mod ;)
if(!empty($modSettings['MemberColorBanned']) && isset($row['is_activated']) && $row['is_activated'] >= 10) {
$color_profile[$row['id_member']]['post_group_color'] = $modSettings['MemberColorBanned'];
$color_profile[$row['id_member']]['member_group_color'] = $modSettings['MemberColorBanned'];
}
}
$smcFunc['db_free_result']($request);
}

//Build the Array ;D
$array = array();
if(!empty($loaded_ids) && $returnarray == true) {
global $txt, $scripturl, $board_info;
foreach($loaded_ids as $id) {
$mod = false;
//Rewrite Moderator Color!
if(isset($board_info['moderators'][$id]) && (empty($color_array[$id]) || !$color_array[$id]['moderator'])) {
if(isset($color_array[$id]))
unset($color_array[$id]);
if(empty($color_profile[$id]['member_group_color']))
$color_profile[$id]['member_group_color'] = load_mod_color(true);
$mod = true;
}
//Load a prepared Data?
if(!isset($color_array[$id])) {
$profile = $color_profile[$id];
$onlineColor = !empty($profile['member_group_color']) ? $profile['member_group_color'] : $profile['post_group_color'];
$color_array[$id] = array(
'id' => $id,
'online_color' => $onlineColor,
'colored_name' => (!empty($onlineColor) ? '<span style="color:'. $onlineColor .';">' : '' ) . $profile['real_name'] . (!empty($onlineColor) ? '</span>' : ''),
//Make it compatible old and new style
'colored_link' => (empty($modSettings['MemberColorLinkOldSpanStyle']) ?
'<a href="' . $scripturl . '?action=profile;u=' . $profile['id_member'] . '" title="' . $txt['profile_of'] . ' ' . $profile['real_name'] . '"'.(!empty($onlineColor) ? ' style="color:'.$onlineColor.';"' : '').'>' . $profile['real_name'] .'</a>' :
'<a href="' . $scripturl . '?action=profile;u=' . $profile['id_member'] . '" title="' . $txt['profile_of'] . ' ' . $profile['real_name'] . '">' . ( !empty($profile['member_group_color']) || !empty($profile['post_group_color']) ? '<span style="color:'. ( !empty($profile['member_group_color']) ? $profile['member_group_color'] : $profile['post_group_color'] ) .';">' : '' ) . $profile['real_name'] . (!empty($profile['member_group_color']) || !empty($profile['post_group_color']) ? '</span>' : '' ).'</a>'),
'moderator' => $mod,
);
}
$array[$id] = $color_array[$id];
}
}

//This option return only a single user, i hope you know what you do ;)
if($singleuser === true)
$array = current($array);

//Return that what should returned XD
return (empty($loaded_ids) ? false : ($returnarray == true ? $array : $loaded_ids));
}

//Load in a fast way the Moderator color... i think i cashe it sometimes...
//$update it's only for me that the mod is fast ;)
function load_mod_color($return = false, $update = null) {
global $context, $modSettings, $smcFunc;

//Need a update?
if($update !== null && $return === false) {
updateSettings(array('MemberColorLinkModColor' => $update));
return true;
}

//This settings is loaded in the loadMemberData
if(isset($modSettings['MemberColorLinkModColor']) && !isset($context['modGroupColor']))
$context['modGroupColor'] = $modSettings['MemberColorLinkModColor'];

if(!isset($context['modGroupColor'])) {
$context['modGroupColor'] = '';
$modColor = $smcFunc['db_query']('', "
SELECT online_color AS online_color
FROM {db_prefix}membergroups
WHERE ID_GROUP = 3
LIMIT 1");
list($context['modGroupColor']) = $smcFunc['db_fetch_row']($modColor);
$smcFunc['db_free_result']($modColor);
}

//Need a update?
if(!isset($modSettings['MemberColorLinkModColor']))
updateSettings(array('MemberColorLinkModColor' => $context['modGroupColor']));

$return = (bool) $return;
return $return ? $context['modGroupColor'] : true;
}

//Compare Birthday, return true on todays brithday
function compare_colorBirthdate($birthday = '')
{
if (empty($birthday))
return false;
$d = explode('-', trim($birthday));
if (count($d) != 3)
return false;
$d['0'] = (int) $d['0'];
$d['1'] = (int) $d['1'];
$d['2'] = (int) $d['2'];
if (empty($d['2']) || empty($d['1']) || $d['0'] <= 1)
return false;
return date('md') == date('md', mktime(0,0,0,$d['1'],$d['2'],0)) ? true : false;
}

// Load a theme, by ID.

file $sourcedir/Subs-BoardIndex.php

ค้นหา -->>
โค๊ด: [Select]
if (!empty($row_board['id_moderator']))
{

แก้เป็น -->>
โค๊ด: [Select]
if (!empty($row_board['id_moderator']))
{
//Color the Mods, too...
if(!empty($modSettings['MemberColorModeratorLinks'])) {
$context['MemberColor_ID_MEMBER'][$row_board['id_moderator']] = $row_board['id_moderator'];
if(!empty($row_board['id_cat']))
$context['MemberColor_ModBoard'][$isChild ? $row_board['id_parent'] : $row_board['id_board']] = array(
'bid' => ($isChild ? $row_board['id_parent'] : $row_board['id_board']),
'cat' => (!empty($row_board['id_cat']) ? $row_board['id_cat'] : 0));
}

ค้นหา -->>
โค๊ด: [Select]
'link' => $row_board['poster_name'] != '' ? (!empty($row_board['id_member']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row_board['id_member'] . '">' . $row_board['real_name'] . '</a>' : $row_board['real_name']) : $txt['not_applicable'],

แก้เป็น -->>
โค๊ด: [Select]
'link' => $row_board['poster_name'] != '' ? (!empty($row_board['id_member']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row_board['id_member'] . '">' . $row_board['real_name'] . '</a>' : (!empty($modSettings['MemberColorGuests']) ? '<span style="color:'.$modSettings['MemberColorGuests'].';">' : '').$row_board['real_name'].(!empty($modSettings['MemberColorGuests']) ? '</span>' : '')) : $txt['not_applicable'],

ค้นหา -->>
โค๊ด: [Select]
// Provide the href and link.

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
//Some things i need for the Membercolor Link :)
if (!empty($row_board['id_member']))
$context['MemberColor_ID_MEMBER'][$row_board['id_member']] = $row_board['id_member'];
if (!empty($modSettings['MemberColorBoardindex']) && !empty($row_board['id_member'])) {
$context['MemberColor_board'][$isChild ? $row_board['id_parent'] : $row_board['id_board']] = array(
'bid' => ($isChild ? $row_board['id_parent'] : $row_board['id_board']),
'cat' => (!empty($row_board['id_cat']) ? $row_board['id_cat'] : 0));
}

file $sourcedir/MessageIndex.php

ค้นหา -->>
โค๊ด: [Select]
$context['name'] = $board_info['name'];
$context['description'] = $board_info['description'];

เพิ่มไว้ก่อน -->>
โค๊ด: [Select]
//Set some standard Variables for the MemberColorLink
$context['MemberColor_ID_MEMBER'] = array();

ค้นหา -->>
โค๊ด: [Select]
if (!empty($board_info['moderators']))
{
foreach ($board_info['moderators'] as $mod)
$context['link_moderators'][] ='<a href="' . $scripturl . '?action=profile;u=' . $mod['id'] . '" title="' . $txt['board_moderator'] . '">' . $mod['name'] . '</a>';

แก้เป็น -->>
โค๊ด: [Select]
if (!empty($board_info['moderators']))
{
//I hate it in this way... but what should i do ;)
if(!empty($modSettings['MemberColorModeratorLinks'])) {
foreach($board_info['moderators'] as $mod)
$c[$mod['id']] = $mod['id'];
$colorDatas = load_onlineColors($c);
foreach ($board_info['moderators'] as $mod)
$context['link_moderators'][] = str_replace($txt['profile_of'], $txt['board_moderator'], $colorDatas[$mod['id']]['colored_link']);
}
else
foreach ($board_info['moderators'] as $mod)
$context['link_moderators'][] = '<a href="' . $scripturl . '?action=profile;u=' . $mod['id'] . '" title="' . $txt['board_moderator'] . '">' . $mod['name'] . '</a>';

$context['linktree'][count($context['linktree']) - 1]['extra_after'] = ' (' . (count($context['link_moderators']) == 1 ? $txt['moderator'] : $txt['moderators']) . ': ' . implode(', ', $context['link_moderators']) . ')';

ค้นหา -->>
โค๊ด: [Select]
if (!empty($row['online_color']))
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '" style="color: ' . $row['online_color'] . ';">' . $row['real_name'] . '</a>';

แก้เป็น -->>
โค๊ด: [Select]
if (!empty($row['online_color']) && !empty($modSettings['MemberColorWhoIsOnline']))
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '" style="color: ' . $row['online_color'] . ';">' . $row['real_name'] . '</a>';

ค้นหา -->>
โค๊ด: [Select]
if (!$pre_query)
$topic_ids[] = $row['id_topic'];

แก้เป็น -->>
โค๊ด: [Select]
if (!$pre_query)
$topic_ids[] = $row['id_topic'];

//I need to collect some IDs for the MemberColor :).
if (!empty($modSettings['MemberColorThreadOwner']) && !empty($row['first_id_member']))
$context['MemberColor_ID_MEMBER'][$row['first_id_member']] = $row['first_id_member'];
//Oh i need the Last Post ID, too ;)
if (!empty($modSettings['MemberColorThreadLastPost']) && !empty($row['last_id_member']))
$context['MemberColor_ID_MEMBER'][$row['last_id_member']] = $row['last_id_member'];

ค้นหา -->>
โค๊ด: [Select]
'link' => !empty($row['first_id_member']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row['first_id_member'] . '" title="' . $txt['profile_of'] . ' ' . $row['first_display_name'] . '">' . $row['first_display_name'] . '</a>' : $row['first_display_name']

แก้เป็น -->>
โค๊ด: [Select]
'link' => !empty($row['first_id_member']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row['first_id_member'] . '" title="' . $txt['profile_of'] . ' ' . $row['first_display_name'] . '">' . $row['first_display_name'] . '</a>' : (!empty($modSettings['MemberColorGuests']) ? '<span style="color:'.$modSettings['MemberColorGuests'].';">' : '').$row['first_display_name'].(!empty($modSettings['MemberColorGuests']) ? '</span>' : '')

ค้นหา -->>
โค๊ด: [Select]
'link' => !empty($row['last_id_member']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row['last_id_member'] . '">' . $row['last_display_name'] . '</a>' : $row['last_display_name']

แก้เป็น -->>
โค๊ด: [Select]
'link' => !empty($row['last_id_member']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row['last_id_member'] . '">' . $row['last_display_name'] . '</a>' : (!empty($modSettings['MemberColorGuests']) ? '<span style="color:'.$modSettings['MemberColorGuests'].';">' : '').$row['last_display_name'].(!empty($modSettings['MemberColorGuests']) ? '</span>' : '')

ค้นหา -->>
โค๊ด: [Select]
determineTopicClass($context['topics'][$row['id_topic']]);
}
$smcFunc['db_free_result']($result);

แก้เป็น -->>
โค๊ด: [Select]
determineTopicClass($context['topics'][$row['id_topic']]);
}
$smcFunc['db_free_result']($result);

//Now let's replace the orginal link to the Color Link ;)
if (!empty($context['MemberColor_ID_MEMBER'])) {
$colorDatas = load_onlineColors($context['MemberColor_ID_MEMBER']);
//You are not know what you do ;P Colors allready loaded :D
if(!empty($modSettings['MemberColorModeratorLinks']) && !empty($context['boards'])) {
//Okay now... do a heavy serach for moderators... only jokeing... but you know... it look so ugly ;)
$onlineColor = load_mod_color(true);
foreach($context['boards'] as $ID_BOARD => $boardid_memcolor) {
//Reset it :D
$context['boards'][$ID_BOARD]['link_moderators'] = array();
global $color_profile;
foreach($context['boards'][$ID_BOARD]['moderators'] as $moderators) {
$cmemcolid = $moderators['id'];
//Replace "Profil of" with "Moderator" ;D
$link = str_replace($txt['profile_of'], $txt['board_moderator'], $colorDatas[$cmemcolid]['colored_link']);
if(empty($colorDatas[$cmemcolid]['online_color']) && !empty($onlineColor))
$link = '<a href="' . $scripturl . '?action=profile;u=' . $color_profile[$cmemcolid]['id_member'] . '" title="' . $txt['board_moderator'] . ' ' . $color_profile[$cmemcolid]['real_name'] . '"'.(!empty($modSettings['MemberColorLinkOldSpanStyle']) ? '><span style="color:'.$onlineColor.';">' : ' style="color:'.$onlineColor.';">') . $color_profile[$cmemcolid]['real_name'] . (!empty($modSettings['MemberColorLinkOldSpanStyle']) ? '</span>' : '').'</a>';
//Standard Color ;)
$context['boards'][$ID_BOARD]['moderators'][$cmemcolid]['link'] = $link;
//Creat the new list...
$context['boards'][$ID_BOARD]['link_moderators'][] = $link;
}
}
}

//Need the Childs some Colors XD
if (!empty($modSettings['MemberColorThreadChild']) && !empty($context['boards'])) {
foreach($context['boards'] as $ID_BOARD => $boardid_memcolor) {
if(empty($context['boards'][$ID_BOARD]['last_post']['member']['id']))
continue;
//My Childs need a Member Color ;)
$cmemcolid = $context['boards'][$ID_BOARD]['last_post']['member']['id'];
if(!empty($colorDatas[$cmemcolid]['colored_link']))
$context['boards'][$ID_BOARD]['last_post']['member']['link'] = $colorDatas[$cmemcolid]['colored_link'];
}
}
//The Owner or the Last Post of the thread
if (!empty($modSettings['MemberColorThreadOwner']) || !empty($modSettings['MemberColorThreadLastPost'])) {
foreach($topic_ids as $topicid_memcolor) {
if (empty($context['topics'][$topicid_memcolor]))
continue;
//First the Thread Owner Link
if (!empty($modSettings['MemberColorThreadOwner'])) {
$cmemcolid = $context['topics'][$topicid_memcolor]['first_post']['member']['id'];
if(!empty($colorDatas[$cmemcolid]['colored_link']))
$context['topics'][$topicid_memcolor]['first_post']['member']['link'] = $colorDatas[$cmemcolid]['colored_link'];
}
//Or the Last Post Link ;)
if (!empty($modSettings['MemberColorThreadLastPost'])) {
$cmemcolid = $context['topics'][$topicid_memcolor]['last_post']['member']['id'];
if(!empty($colorDatas[$cmemcolid]['colored_link']))
$context['topics'][$topicid_memcolor]['last_post']['member']['link'] = $colorDatas[$cmemcolid]['colored_link'];
}
}
}
}

file $sourcedir/BoardIndex.php

ค้นหา -->>
โค๊ด: [Select]
$context['categories'] = getBoardIndex($boardIndexOptions);

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
//The latest member?
if (!empty($modSettings['latestMember']) && !empty($modSettings['MemberColorLatestMember']))
$context['MemberColor_ID_MEMBER'][$modSettings['latestMember']] = $modSettings['latestMember'];

// Know set the colors for the last post...
if (!empty($context['MemberColor_ID_MEMBER'])) {
$colorDatas = load_onlineColors($context['MemberColor_ID_MEMBER']);
$cmemcolid = null;

//So the BoardIndex need colored links
if (!empty($modSettings['MemberColorBoardindex']) && !empty($context['MemberColor_board'])) {
foreach($context['MemberColor_board'] as $boardid_memcolor) {
$cmemcolid = $context['categories'][$boardid_memcolor['cat']]['boards'][$boardid_memcolor['bid']]['last_post']['member']['id'];
if(!empty($colorDatas[$cmemcolid]['colored_link']))
$context['categories'][$boardid_memcolor['cat']]['boards'][$boardid_memcolor['bid']]['last_post']['member']['link'] = $colorDatas[$cmemcolid]['colored_link'];
}
}

//You are not know what you do ;P Colors allready loaded :D
if(!empty($modSettings['MemberColorModeratorLinks']) && !empty($context['MemberColor_ModBoard'])) {
//Okay now... do a heavy serach for moderators... only jokeing... but you know... it look so ugly ;)
$onlineColor = load_mod_color(true);
global $scripturl, $color_profile;
foreach($context['MemberColor_ModBoard'] as $boardid_memcolor) {
//Reset it :D
$context['categories'][$boardid_memcolor['cat']]['boards'][$boardid_memcolor['bid']]['link_moderators'] = array();
foreach($context['categories'][$boardid_memcolor['cat']]['boards'][$boardid_memcolor['bid']]['moderators'] as $moderators) {
$cmemcolid = $moderators['id'];
//Replace "Profil of" with "Moderator" ;D
$link = str_replace($txt['profile_of'], $txt['board_moderator'], $colorDatas[$cmemcolid]['colored_link']);
if(empty($colorDatas[$cmemcolid]['online_color']) && !empty($onlineColor))
$link = '<a href="' . $scripturl . '?action=profile;u=' . $color_profile[$cmemcolid]['id_member'] . '" title="' . $txt['board_moderator'] . ' ' . $color_profile[$cmemcolid]['real_name'] . '"'.(!empty($modSettings['MemberColorLinkOldSpanStyle']) ? '><span style="color:'.$onlineColor.';">' : ' style="color:'.$onlineColor.';">') . $color_profile[$cmemcolid]['real_name'] . (!empty($modSettings['MemberColorLinkOldSpanStyle']) ? '</span>' : '').'</a>';
$context['categories'][$boardid_memcolor['cat']]['boards'][$boardid_memcolor['bid']]['moderators'][$cmemcolid]['link'] = $link;
//Creat the new list...
$context['categories'][$boardid_memcolor['cat']]['boards'][$boardid_memcolor['bid']]['link_moderators'][] = $link;
}
}
}
}

file $sourcedir/Subs-Calendar.php

ค้นหา -->>
โค๊ด: [Select]
$bday = array();

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
$MemberSetColor = false;
$context['MemberColor_ID_MEMBER'] = array();

ค้นหา -->>
โค๊ด: [Select]
$bday[$age_year . substr($row['birthdate'], 4)][] = array(
'id' => $row['id_member'],
'name' => $row['real_name'],
'age' => $row['birth_year'] > 4 && $row['birth_year'] <= $age_year ? $age_year - $row['birth_year'] : null,
'is_last' => false
);
}
$smcFunc['db_free_result']($result);

แก้เป็น -->>
โค๊ด: [Select]
$bday[$age_year . substr($row['birthdate'], 4)][] = array(
'id' => $row['id_member'],
'name' => $row['real_name'],
'age' => $row['birth_year'] > 4 && $row['birth_year'] <= $age_year ? $age_year - $row['birth_year'] : null,
'is_last' => false
);

//I need to collect some IDs for the MemberColor :).
if (!empty($modSettings['MemberColorBirthday']) && !empty($row['id_member']))
$context['MemberColor_ID_MEMBER'][$row['id_member']] = $row['id_member'];
}
$smcFunc['db_free_result']($result);

//Color the Birthday Links :D
if (!empty($context['MemberColor_ID_MEMBER'])) {
$colorDatas = load_onlineColors($context['MemberColor_ID_MEMBER']);
$cmemcolid = null;

//So i need only the colors... hmmm why schould i not use only the $user_profiles for this... (The Calenderlink is diffrent)
if (!empty($modSettings['MemberColorBirthday'])) {
if (!empty($bday) && is_array($bday)) {
foreach ($bday as $memcalkv => $memcalva) {
foreach ($memcalva as $memcalidkv => $memcalid) {
if(!empty($colorDatas[$memcalid['id']]['colored_link'])) {
$bday[$memcalkv][$memcalidkv]['color'] = $colorDatas[$memcalid['id']]['online_color'];
$bday[$memcalkv][$memcalidkv]['colored_name'] = $colorDatas[$memcalid['id']]['colored_name'];
}
}
}
}
}
}

file $sourcedir/Display.php

ค้นหา -->>
โค๊ด: [Select]
if (!empty($board_info['moderators']))
{
// Add a link for each moderator...
foreach ($board_info['moderators'] as $mod)
$context['link_moderators'][] = '<a href="' . $scripturl . '?action=profile;u=' . $mod['id'] . '" title="' . $txt['board_moderator'] . '">' . $mod['name'] . '</a>';

แก้เป็น -->>
โค๊ด: [Select]
if (!empty($board_info['moderators']))
{
//I hate it in this way... but what should i do ;)
if(!empty($modSettings['MemberColorModeratorLinks'])) {
foreach($board_info['moderators'] as $mod)
$c[$mod['id']] = $mod['id'];
$colorDatas = load_onlineColors($c);
foreach ($board_info['moderators'] as $mod)
$context['link_moderators'][] = str_replace($txt['profile_of'], $txt['board_moderator'], $colorDatas[$mod['id']]['colored_link']);
}
else
foreach ($board_info['moderators'] as $mod)
$context['link_moderators'][] = '<a href="' . $scripturl . '?action=profile;u=' . $mod['id'] . '" title="' . $txt['board_moderator'] . '">' . $mod['name'] . '</a>';

ค้นหา -->>
โค๊ด: [Select]
if (!empty($row['online_color']))
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '" style="color: ' . $row['online_color'] . ';">' . $row['real_name'] . '</a>';

แก้เป็น -->>
โค๊ด: [Select]
if (!empty($row['online_color']) && !empty($modSettings['MemberColorWhoIsOnline']))
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '" style="color: ' . $row['online_color'] . ';">' . $row['real_name'] . '</a>';

ค้นหา -->>
โค๊ด: [Select]
$memberContext[$message['id_member']]['group'] = $txt['guest_title'];
$memberContext[$message['id_member']]['link'] = $message['poster_name'];

แก้เป็น -->>
โค๊ด: [Select]
$memberContext[$message['id_member']]['group'] = $txt['guest_title'];
$memberContext[$message['id_member']]['link'] = (!empty($modSettings['MemberColorGuests']) ? '<span style="color:'.$modSettings['MemberColorGuests'].';">' : '').$message['poster_name'].(!empty($modSettings['MemberColorGuests']) ? '</span>' : '');

file $sourcedir/Recent.php

ค้นหา -->>
โค๊ด: [Select]
'link' => empty($row['id_first_member']) ? $row['first_poster_name'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['id_first_member'] . '">' . $row['first_poster_name'] . '</a>'

แก้เป็น -->>
โค๊ด: [Select]
'link' => empty($row['first_id_member']) ? (!empty($modSettings['MemberColorGuests']) ? '<span style="color:'.$modSettings['MemberColorGuests'].';">' : '').$row['first_poster_name'].(!empty($modSettings['MemberColorGuests']) ? '</span>' : '') : '<a href="' . $scripturl . '?action=profile;u=' . $row['first_id_member'] . '" title="' . $txt['profile_of'] . ' ' . $row['first_poster_name'] . '">' . $row['first_poster_name'] . '</a>'

ค้นหา -->>
โค๊ด: [Select]
'link' => empty($row['id_member']) ? $row['poster_name'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['poster_name'] . '</a>'

แก้เป็น -->>
โค๊ด: [Select]
'link' => empty($row['id_member']) ? (!empty($modSettings['MemberColorGuests']) ? '<span style="color:'.$modSettings['MemberColorGuests'].';">' : '').$row['poster_name'].(!empty($modSettings['MemberColorGuests']) ? '</span>' : '') : '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '" title="' . $txt['profile_of'] . ' ' . $row['poster_name'] . '">' . $row['poster_name'] . '</a>'

ค้นหา -->>
โค๊ด: [Select]
$counter = $_REQUEST['start'] + 1;
$context['posts'] = array();

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
$context['MemberColor_ID_MEMBER'] = array();

ค้นหา -->>
โค๊ด: [Select]
if ($user_info['id'] == $row['id_first_member'])
$board_ids['own'][$row['id_board']][] = $row['id_msg'];
$board_ids['any'][$row['id_board']][] = $row['id_msg'];
}
$smcFunc['db_free_result']($request);

แก้เป็น -->>
โค๊ด: [Select]
if ($user_info['id'] == $row['id_first_member'])
$board_ids['own'][$row['id_board']][] = $row['id_msg'];
$board_ids['any'][$row['id_board']][] = $row['id_msg'];

//The Thread Owners id for the MemberColor.
if (!empty($modSettings['MemberColorRecentOwner']) && !empty($row['id_first_member']))
$context['MemberColor_ID_MEMBER'][$row['id_first_member']] = $row['id_first_member'];
//The Last Posters id for the MemberColor.
if (!empty($modSettings['MemberColorRecentLastPost']) && !empty($row['id_member']))
$context['MemberColor_ID_MEMBER'][$row['id_member']] = $row['id_member'];
}
$smcFunc['db_free_result']($request);

// Know set the colors for the Recent posts...
if (!empty($context['MemberColor_ID_MEMBER'])) {
$colorDatas = load_onlineColors($context['MemberColor_ID_MEMBER']);
$cmemcolid = null;

//So Let's Color The Recent Posts ;)
if (is_array($context['posts'])) {
foreach($context['posts'] as $postkey => $postid_memcolor) {
if (!empty($modSettings['MemberColorRecentLastPost'])) {
$cmemcolid = $postid_memcolor['poster']['id'];
if(!empty($colorDatas[$cmemcolid]['colored_link']))
$context['posts'][$postkey]['poster']['link'] = $colorDatas[$cmemcolid]['colored_link'];
}
if (!empty($modSettings['MemberColorRecentOwner'])) {
$cmemcolid = $postid_memcolor['first_poster']['id'];
if(!empty($colorDatas[$cmemcolid]['colored_link']))
$context['posts'][$postkey]['first_poster']['link'] = $colorDatas[$cmemcolid]['colored_link'];
}
}
}
}

ค้นหา -->>
โค๊ด: [Select]
$context['topics'] = array();
$topic_ids = array();

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
$context['MemberColor_ID_MEMBER'] = array();

ค้นหา -->>
โค๊ด: [Select]
'link' => !empty($row['id_first_member']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row['id_first_member'] . '" title="' . $txt['profile_of'] . ' ' . $row['first_poster_name'] . '">' . $row['first_poster_name'] . '</a>' : $row['first_poster_name']

แก้เป็น -->>
โค๊ด: [Select]
'link' => !empty($row['first_id_member']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row['first_id_member'] . '" title="' . $txt['profile_of'] . ' ' . $row['first_poster_name'] . '">' . $row['first_poster_name'] . '</a>' : (!empty($modSettings['MemberColorGuests']) ? '<span style="color:'.$modSettings['MemberColorGuests'].';">' : '').$row['first_poster_name'].(!empty($modSettings['MemberColorGuests']) ? '</span>' : '')

ค้นหา -->>
โค๊ด: [Select]
'link' => !empty($row['id_last_member']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row['id_last_member'] . '">' . $row['last_poster_name'] . '</a>' : $row['last_poster_name']

แก้เป็น -->>
โค๊ด: [Select]
'link' => !empty($row['id_last_member']) ? '<a href="' . $scripturl . '?action=profile;u=' . $row['id_last_member'] . '" title="' . $txt['profile_of'] . ' ' . $row['last_poster_name'] . '">' . $row['last_poster_name'] . '</a>' : (!empty($modSettings['MemberColorGuests']) ? '<span style="color:'.$modSettings['MemberColorGuests'].';">' : '').$row['last_poster_name'].(!empty($modSettings['MemberColorGuests']) ? '</span>' : '')

ค้นหา -->>
โค๊ด: [Select]
determineTopicClass($context['topics'][$row['id_topic']]);
}
$smcFunc['db_free_result']($request);

แก้เป็น -->>
โค๊ด: [Select]
//The Thread Owners id for the MemberColor.
if (!empty($modSettings['MemberColorRecentOwner']) && !empty($row['id_first_member']))
$context['MemberColor_ID_MEMBER'][$row['id_first_member']] = $row['id_first_member'];
//The Last Posters id for the MemberColor.
if (!empty($modSettings['MemberColorRecentLastPost']) && !empty($row['id_last_member']))
$context['MemberColor_ID_MEMBER'][$row['id_last_member']] = $row['id_last_member'];

determineTopicClass($context['topics'][$row['id_topic']]);
}
$smcFunc['db_free_result']($request);

// Know set the colors for the Recent posts...
if(!empty($context['MemberColor_ID_MEMBER'])) {
$colorDatas = load_onlineColors($context['MemberColor_ID_MEMBER']);
$cmemcolid = null;

//So Let's Color The Recent Posts ;)
if (is_array($context['topics']) && !empty($context['topics'])) {
foreach($context['topics'] as $postkey => $postid_memcolor) {
if (!empty($modSettings['MemberColorRecentLastPost'])) {
$cmemcolid = $postid_memcolor['last_post']['member']['id'];
if(!empty($colorDatas[$cmemcolid]['colored_link']))
$context['topics'][$postkey]['last_post']['member']['link'] = $colorDatas[$cmemcolid]['colored_link'];
}
if (!empty($modSettings['MemberColorRecentOwner'])) {
$cmemcolid = $postid_memcolor['first_post']['member']['id'];
if(!empty($colorDatas[$cmemcolid]['colored_link']))
$context['topics'][$postkey]['first_post']['member']['link'] = $colorDatas[$cmemcolid]['colored_link'];
}
}
}
}

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


!Personal

Germany   ชาย ผู้เริ่มต้นกระทู้นี้ ออฟไลน์544566157 DexMore DexMore DexMore
เว็บไซต์
icon message
general ความคิดเห็นที่ 3 เมื่อ: 27 มิถุนายน 2553, 21:29:58
file $sourcedir/Subs-Recent.php

ค้นหา -->>
โค๊ด: [Select]
$posts = array();

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
$context['MemberColor_ID_MEMBER'] = array();

ค้นหา -->>
โค๊ด: [Select]
'link' => empty($row['id_member']) ? $row['poster_name'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['poster_name'] . '</a>'

แก้เป็น -->>
โค๊ด: [Select]
'link' => empty($row['id_member']) ? (!empty($modSettings['MemberColorGuests']) ? '<span style="color:'.$modSettings['MemberColorGuests'].';">' : '').$row['poster_name'].(!empty($modSettings['MemberColorGuests']) ? '</span>' : '') : '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '" title="' . $txt['profile_of'] . ' ' . $row['poster_name'] . '">' . $row['poster_name'] . '</a>'

ค้นหา -->>
โค๊ด: [Select]
);
}
$smcFunc['db_free_result']($request);

return $posts;
}

แก้เป็น -->>
โค๊ด: [Select]
);

//The Last Posters id for the MemberColor.
if (!empty($modSettings['MemberColorRecentLastPost']) && !empty($row['id_member']))
$context['MemberColor_ID_MEMBER'][$row['id_member']] = $row['id_member'];
}
$smcFunc['db_free_result']($request);

// Know set the colors for the Recent posts...
if (!empty($context['MemberColor_ID_MEMBER'])) {
$colorDatas = load_onlineColors($context['MemberColor_ID_MEMBER']);
//So Let's Color The Recent Posts ;)
if (!empty($modSettings['MemberColorRecentLastPost']) && is_array($posts)) {
foreach($posts as $postkey => $postid_memcolor) {
if(!empty($colorDatas[$postid_memcolor['poster']['id']]['colored_link']))
$posts[$postkey]['poster']['link'] = $colorDatas[$postid_memcolor['poster']['id']]['colored_link'];
}
}
}

return $posts;
}

file $sourcedir/PersonalMessage.php

ค้นหา -->>
โค๊ด: [Select]
$labelQuery = $context['folder'] != 'sent' ? '
AND FIND_IN_SET(' . $context['current_label_id'] . ', pmr.labels) != 0' : '';

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
//Correct a Modsettings sometime there is a problem, and load variables if i need them ;).
$colormodcheck = 'MemberColorInbox';
if ($context['folder'] != 'sent') $colormodcheck = 'MemberColorOutbox';
$MemberSetColor = false;
if (empty($modSettings[$colormodcheck]) && !empty($modSettings['MemberColorLink']))
$modSettings['MemberColorLink'] = null;
if (!empty($modSettings[$colormodcheck])) {
$context['MemberColor_ID_MEMBER'] = array();
$MemberColor_IM_ID = array();
}

ค้นหา -->>
โค๊ด: [Select]
}
$smcFunc['db_free_result']($request);

// Make sure we don't load unnecessary data.
if ($context['display_mode'] == 1)
{
foreach ($posters as $k => $v)
if (!in_array($k, $display_pms))
unset($posters[$k]);
}

// Load any users....
$posters = array_unique($posters);
if (!empty($posters))
loadMemberData($posters);

แก้เป็น -->>
โค๊ด: [Select]
if (!empty($row['id_member_to']) && !empty($modSettings[$colormodcheck])) {
$MemberSetColor = true;
$posters[] = $row['id_member_to'];
// Hmmm somehow i must know what i should replace... i hope i do it right...
$MemberColor_IM_ID[$row['id_pm']][empty($row['bcc']) ? 'to' : 'bcc'][] = $row['id_member_to'];
}
elseif (empty($row['id_member_to']) && (!empty($modSettings['MemberColorOutbox']) || !empty($modSettings['MemberColorInbox'])))
$MemberColor_IM_ID[$row['id_pm']][empty($row['bcc']) ? 'to' : 'bcc'][] = null;
}
$smcFunc['db_free_result']($request);

// Make sure we don't load unnecessary data.
if ($context['display_mode'] == 1)
{
foreach ($posters as $k => $v)
if (!in_array($k, $display_pms))
unset($posters[$k]);
}

// Load any users....
$posters = array_unique($posters);
if (!empty($posters))
loadMemberData($posters);

//So i must correct the link ;) i need only the membercontext for this (a little bit faster)
if ($MemberSetColor && !empty($MemberColor_IM_ID)) {
$colorDatas = load_onlineColors($posters);
//So let's replace the links...
foreach($MemberColor_IM_ID as $pmid => $pmidarray) {
if (!empty($pmidarray['to']))
foreach($pmidarray['to'] as $pm_meber_key => $pm_member_id) {
if(!empty($recipients[$pmid]['to'][$pm_meber_key]) && !empty($colorDatas[$pm_member_id]['colored_link'])) {
$recipients[$pmid]['to'][$pm_meber_key] = $colorDatas[$pm_member_id]['colored_link'];
}
}
if (!empty($pmidarray['bcc']))
foreach($pmidarray['bcc']  as $pm_meber_key => $pm_member_id) {
if(!empty($recipients[$pmid]['bcc'][$pm_meber_key]) && !empty($colorDatas[$pm_member_id]['colored_link'])) {
$recipients[$pmid]['bcc'][$pm_meber_key] = $colorDatas[$pm_member_id]['colored_link'];
}
}
}
}

file $sourcedir/Stats.php

ค้นหา -->>
โค๊ด: [Select]
$context['top_posters'] = array();
$max_num_posts = 1;

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
$context['MemberColor_ID_MEMBER'] = array();

ค้นหา -->>
โค๊ด: [Select]
if ($max_num_posts < $row_members['posts'])
$max_num_posts = $row_members['posts'];

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
if (!empty($modSettings['MemberColorStats']) && !empty($row_members['id_member']))
$context['MemberColor_ID_MEMBER'][$row_members['id_member']] = $row_members['id_member'];

ค้นหา -->>
โค๊ด: [Select]
if ($max_num_topics < $members[$row_members['id_member']])
$max_num_topics = $members[$row_members['id_member']];

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
if (!empty($modSettings['MemberColorStats']))
$context['MemberColor_ID_MEMBER'][$row_members['id_member']] = $row_members['id_member'];

ค้นหา -->>
โค๊ด: [Select]
if ($max_time_online < $row_members['total_time_logged_in'])
$max_time_online = $row_members['total_time_logged_in'];

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
if (!empty($modSettings['MemberColorStats']))
$context['MemberColor_ID_MEMBER'][$row_members['id_member']] = $row_members['id_member'];

ค้นหา -->>
โค๊ด: [Select]
foreach ($context['top_time_online'] as $i => $member)
$context['top_time_online'][$i]['time_percent'] = round(($member['seconds_online'] * 100) / $max_time_online);

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

if (!empty($modSettings['latestMember']) && !empty($modSettings['MemberColorLatestMember']))
$context['MemberColor_ID_MEMBER'][$modSettings['latestMember']] = $modSettings['latestMember'];

//Yeah baby give me some colors =).
if (!empty($context['MemberColor_ID_MEMBER'])) {
$colorDatas = load_onlineColors($context['MemberColor_ID_MEMBER']);
$cmemcolid = null;
if (!empty($modSettings['MemberColorStats'])) {
// First the Top Posters =)
foreach($context['top_posters'] as $key => $value) {
$cmemcolid = $context['top_posters'][$key]['id'];
if(!empty($colorDatas[$cmemcolid]['colored_link']))
$context['top_posters'][$key]['link'] = $colorDatas[$cmemcolid]['colored_link'];
}
// First the Top Starter =)
foreach($context['top_starters'] as $key => $value) {
$cmemcolid = $context['top_starters'][$key]['id'];
if(!empty($colorDatas[$cmemcolid]['colored_link']))
$context['top_starters'][$key]['link'] = $colorDatas[$cmemcolid]['colored_link'];
}
// First the Top Onliner =)
foreach($context['top_time_online'] as $key => $value) {
$cmemcolid = $context['top_time_online'][$key]['id'];
if(!empty($colorDatas[$cmemcolid]['colored_link']))
$context['top_time_online'][$key]['link'] = $colorDatas[$cmemcolid]['colored_link'];
}
}
if (!empty($modSettings['latestMember']) && !empty($modSettings['MemberColorLatestMember'])) {
if(!empty($colorDatas[$modSettings['latestMember']]['colored_link']))
$context['latest_member']['link'] = $colorDatas[$modSettings['latestMember']]['colored_link'];
}
}

file $sourcedir/Subs.php

ค้นหา -->>
โค๊ด: [Select]
// This looks weird, but it's because BoardIndex.php references the variable.
$context['common_stats']['latest_member'] = array(
'id' => $modSettings['latestMember'],
'name' => $modSettings['latestRealName'],
'href' => $scripturl . '?action=profile;u=' . $modSettings['latestMember'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $modSettings['latestMember'] . '">' . $modSettings['latestRealName'] . '</a>',
);

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
//Latest user need some colors... How could you put this into this file... i hate you... i hope no one read this :P
if (!empty($modSettings['latestMember']) && !empty($modSettings['MemberColorLatestMember'])) {
$colorDatas = load_onlineColors($modSettings['latestMember']);
if(!empty($colorDatas[$modSettings['latestMember']]['colored_link']))
$context['common_stats']['latest_member']['link'] = $colorDatas[$modSettings['latestMember']]['colored_link'];
}

file $sourcedir/Profile-Actions.php

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

แก้เป็น -->>
โค๊ด: [Select]
if(!empty($row['id_member']))
$context['MemberColor_ID_MEMBER'][$row['id_member']] = $row['id_member'];
$previous_warnings[] = array(

ค้นหา -->>
โค๊ด: [Select]
return $previous_warnings;

แก้เป็น -->>
โค๊ด: [Select]
//Color the Issue List
global $modSettings;
if(!empty($modSettings['MemberColorIssuePList']) && !empty($context['MemberColor_ID_MEMBER']) && !empty($previous_warnings)) {
$colorDatas = load_onlineColors($context['MemberColor_ID_MEMBER']);
foreach($previous_warnings as $key => $warning) {
if(!empty($colorDatas[$warning['issuer']['id']]['colored_link'])) {
$previous_warnings[$key]['issuer']['link'] = $colorDatas[$warning['issuer']['id']]['colored_link'];
}
}
}

return $previous_warnings;

file $sourcedir/Groups.php

ค้นหา -->>
โค๊ด: [Select]
$context['group']['moderators'][] = array(

แก้เป็น -->>
โค๊ด: [Select]
$context['MemberColor_ID_MEMBER'][$row['id_member']] = $row['id_member'];
$context['group']['moderators'][] = array(

ค้นหา -->>
โค๊ด: [Select]
if ($row['is_activated'] % 10 != 1)
$last_online = '<em title="' . $txt['not_activated'] . '">' . $last_online . '</em>';

แก้เป็น -->>
โค๊ด: [Select]
if ($row['is_activated'] % 10 != 1)
$last_online = '<em title="' . $txt['not_activated'] . '">' . $last_online . '</em>';
if(!empty($row['id_member']))
$context['MemberColor_ID_MEMBER'][$row['id_member']] = $row['id_member'];

ค้นหา -->>
โค๊ด: [Select]
// Select the template.
$context['sub_template'] = 'group_members';
$context['page_title'] = $txt['membergroups_members_title'] . ': ' . $context['group']['name'];

แก้เป็น -->>
โค๊ด: [Select]
//Color the Groups List ;D
if(!empty($modSettings['MemberColorModCenter']) && !empty($context['MemberColor_ID_MEMBER'])) {
$colorDatas = load_onlineColors($context['MemberColor_ID_MEMBER']);
if(!empty($context['group']['moderators'])) {
foreach($context['group']['moderators'] as $key => $item) {
if(!empty($colorDatas[$item['id']]['colored_link'])) {
$context['group']['moderators'][$key]['name'] = $colorDatas[$item['id']]['colored_name'];
}
}
}
if(!empty($context['members'])) {
foreach($context['members'] as $key => $item) {
if(!empty($colorDatas[$item['id']]['colored_link'])) {
$context['members'][$key]['name'] = $colorDatas[$item['id']]['colored_link'];
}
}
}
}

// Select the template.
$context['sub_template'] = 'group_members';
$context['page_title'] = $txt['membergroups_members_title'] . ': ' . $context['group']['name'];

ค้นหา -->>
โค๊ด: [Select]
$groups[$row['id_group']]['moderators'][] = '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>';

แก้เป็น -->>
โค๊ด: [Select]
{
$context['MemberColor_ID_MEMBER'][$row['id_member']] = $row['id_member'];
$groups[$row['id_group']]['moderators'][] = '<a href="' . $scripturl . '?action=profile;u=' . $row['id_member'] . '">' . $row['real_name'] . '</a>';
}

ค้นหา -->>
โค๊ด: [Select]
return $groups;

แก้เป็น -->>
โค๊ด: [Select]
//Color the Group Moderators
global $modSettings;
if(!empty($modSettings['MemberColorModCenter']) && !empty($context['MemberColor_ID_MEMBER']) && !empty($groups)) {
$colorDatas = load_onlineColors($context['MemberColor_ID_MEMBER']);
foreach($groups as $gkey => $group) {
if(!empty($group['moderators'])) {
foreach($group['moderators'] as $id => $item) {
if(!empty($colorDatas[$id]['colored_link'])) {
$groups[$gkey]['moderators'][$id] = $colorDatas[$id]['colored_link'];
}
}
}
}
}

return $groups;

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

แก้เป็น -->>
โค๊ด: [Select]
if(!empty($row['id_member']))
$context['MemberColor_ID_MEMBER'][$row['id_member']] = $row['id_member'];
$group_requests[] = array(
'id' => $row['id_request'],
'id_member' => $row['id_member'],

ค้นหา -->>
โค๊ด: [Select]
return $group_requests;

แก้เป็น -->>
โค๊ด: [Select]
//Give me some Colors baby ;D
global $modSettings;
if(!empty($modSettings['MemberColorModCenter']) && !empty($context['MemberColor_ID_MEMBER']) && !empty($group_requests)) {
$colorDatas = load_onlineColors($context['MemberColor_ID_MEMBER']);
foreach($group_requests as $key => $item) {
if(!empty($colorDatas[$item['id_member']]['colored_link'])) {
$group_requests[$key]['member_link'] = $colorDatas[$item['id_member']]['colored_link'];
}
}
}

return $group_requests;

file $sourcedir/ModerationCenter.php

ค้นหา -->>
โค๊ด: [Select]
// Don't run this twice... and don't conflict with the admin bar.
if (isset($context['admin_area']))
return;

แก้เป็น -->>
โค๊ด: [Select]
// Don't run this twice... and don't conflict with the admin bar.
if (isset($context['admin_area']))
return;

//Standard Member Color Link Varibale
if(empty($context['MemberColor_ID_MEMBER']))
$context['MemberColor_ID_MEMBER'] = array();

ค้นหา -->>
โค๊ด: [Select]
while ($row = $smcFunc['db_fetch_assoc']($request))
$watched_users[] = $row;

แก้เป็น -->>
โค๊ด: [Select]
while ($row = $smcFunc['db_fetch_assoc']($request))
$watched_users[$row['id_member']] = $row;

ค้นหา -->>
โค๊ด: [Select]
$context['watched_users'] = array();

แก้เป็น -->>
โค๊ด: [Select]
$context['watched_users'] = array();
//Load Watch Colors :)
if(!empty($modSettings['MemberColorModCenter']) && !empty($watched_users))
$colorDatas = load_onlineColors(array_keys($watched_users));

ค้นหา -->>
โค๊ด: [Select]
'name' => $user['real_name'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $user['id_member'] . '">' . $user['real_name'] . '</a>',

แก้เป็น -->>
โค๊ด: [Select]
'name' => !empty($colorDatas[$user['id_member']]['colored_name']) ? $colorDatas[$user['id_member']]['colored_name'] : $user['real_name'],
'link' => !empty($colorDatas[$user['id_member']]['colored_link']) ? $colorDatas[$user['id_member']]['colored_link'] : '<a href="' . $scripturl . '?action=profile;u=' . $user['id_member'] . '">' . $user['real_name'] . '</a>',

ค้นหา -->>
โค๊ด: [Select]
$context['notes'] = array();

แก้เป็น -->>
โค๊ด: [Select]
$context['notes'] = array();
//Load Colors for the notes
global $modSettings;
if(!empty($modSettings['MemberColorModCenter']) && !empty($moderator_notes)) {
foreach($moderator_notes as $note)
if(!empty($note['id_member'])) {
$data[$note['id_member']] = $note['id_member'];
}
if(isset($data))
$colorDatas = load_onlineColors($data);
}

ค้นหา -->>
โค๊ด: [Select]
'link' => $note['id_member'] ? ('<a href="' . $scripturl . '?action=profile;u=' . $note['id_member'] . '" title="' . $txt['on'] . ' ' . strip_tags(timeformat($note['log_time'])) . '">' . $note['member_name'] . '</a>') : $note['member_name'],

แก้เป็น -->>
โค๊ด: [Select]
'link' => $note['id_member'] ? (!empty($colorDatas[$note['id_member']]['colored_link']) ? $colorDatas[$note['id_member']]['colored_link'] : ('<a href="' . $scripturl . '?action=profile;u=' . $note['id_member'] . '" title="' . $txt['on'] . ' ' . strip_tags(timeformat($note['log_time'])) . '">' . $note['member_name'] . '</a>')) : $note['member_name'],

ค้นหา -->>
โค๊ด: [Select]
cache_put_data('reported_posts_' . $cachekey, $reported_posts, 90);
}

$context['reported_posts'] = array();

แก้เป็น -->>
โค๊ด: [Select]
cache_put_data('reported_posts_' . $cachekey, $reported_posts, 90);
}

$context['reported_posts'] = array();
//Color some Datas?
global $modSettings;
if(!empty($modSettings['MemberColorModCenter']) && !empty($reported_posts)) {
foreach($reported_posts as $report)
if(!empty($report['id_author'])) {
$data[$report['id_author']] = $report['id_author'];
}
if(isset($data))
$colorDatas = load_onlineColors($data);
}

ค้นหา -->>
โค๊ด: [Select]
'link' => $row['id_author'] ? '<a href="' . $scripturl . '?action=profile;u=' . $row['id_author'] . '">' . $row['author_name'] . '</a>' : $row['author_name'],

แก้เป็น -->>
โค๊ด: [Select]
'link' => $row['id_author'] ? (!empty($colorDatas[$row['id_author']]['colored_link']) ? $colorDatas[$row['id_author']]['colored_link'] : '<a href="' . $scripturl . '?action=profile;u=' . $row['id_author'] . '">' . $row['author_name'] . '</a>') : $row['author_name'],

ค้นหา -->>
โค๊ด: [Select]
'time_submitted' => timeformat($row['time_applied']),
);

แก้เป็น -->>
โค๊ด: [Select]
'time_submitted' => timeformat($row['time_applied']),
);

//Color the links... can you not do it in a better way... okay i will do it :D
if(!empty($row['id_member']))
$context['MemberColor_ID_MEMBER'][$row['id_member']] = $row['id_member'];

ค้นหา -->>
โค๊ด: [Select]
$smcFunc['db_free_result']($request);

return 'group_requests_block';

แก้เป็น -->>
โค๊ด: [Select]
$smcFunc['db_free_result']($request);

//Give me some Colors baby ;D
global $modSettings;
if(!empty($modSettings['MemberColorModCenter']) && !empty($context['MemberColor_ID_MEMBER']) && !empty($context['group_requests'])) {
$colorDatas = load_onlineColors($context['MemberColor_ID_MEMBER']);
foreach($context['group_requests'] as $key => $item) {
$id = $context['group_requests'][$key]['member']['id'];
if(!empty($colorDatas[$id]['colored_link'])) {
$context['group_requests'][$key]['member']['name'] = $colorDatas[$id]['colored_name'];
$context['group_requests'][$key]['member']['link'] = $colorDatas[$id]['colored_link'];
}
}
}
return 'group_requests_block';

ค้นหา -->>
โค๊ด: [Select]
$report_ids[] = $row['id_report'];
$context['reports'][$row['id_report']] = array(

แก้เป็น -->>
โค๊ด: [Select]
//Color the links... can you not do it in a better way... okay i will do it :D
if(!empty($row['id_author']))
$context['MemberColor_ID_MEMBER'][$row['id_author']] = $row['id_author'];
$report_ids[] = $row['id_report'];
$context['reports'][$row['id_report']] = array(

ค้นหา -->>
โค๊ด: [Select]
$context['reports'][$row['id_report']]['comments'][] = array(

แก้เป็น -->>
โค๊ด: [Select]
//Color the links... can you not do it in a better way... okay i will do it :D
if(!empty($row['id_member']))
$context['MemberColor_ID_MEMBER'][$row['id_member']] = $row['id_member'];
$context['reports'][$row['id_report']]['comments'][] = array(

ค้นหา -->>
โค๊ด: [Select]
'href' => $row['id_member'] ? $scripturl . '?action=profile;u=' . $row['id_member'] : '',
),
);
}
$smcFunc['db_free_result']($request);
}

แก้เป็น -->>
โค๊ด: [Select]
'href' => $row['id_member'] ? $scripturl . '?action=profile;u=' . $row['id_member'] : '',
),
);
}
$smcFunc['db_free_result']($request);
}

//Now go through the comments and Reports :D and color them
if(!empty($modSettings['MemberColorModCenter']) && !empty($context['MemberColor_ID_MEMBER']) && !empty($context['reports'])) {
$colorDatas = load_onlineColors($context['MemberColor_ID_MEMBER']);
foreach($context['reports'] as $rkey => $report) {
if(!empty($report['author']['id']) && !empty($colorDatas[$report['author']['id']]['colored_link'])) {
$context['reports'][$rkey]['author']['link'] = $colorDatas[$report['author']['id']]['colored_link'];
}
if(!empty($report['comments'])) {
foreach($report['comments'] as $ckey => $comment) {
if(!empty($comment['member']['id']) && !empty($colorDatas[$comment['member']['id']]['colored_link'])) {
$context['reports'][$rkey]['comments'][$ckey]['member']['link'] = $colorDatas[$comment['member']['id']]['colored_link'];
$context['reports'][$rkey]['comments'][$ckey]['member']['name'] = $colorDatas[$comment['member']['id']]['colored_name'];
}
}
}
}
}

ค้นหา -->>
โค๊ด: [Select]
$context['report'] = array(
'id' => $row['id_report'],

แก้เป็น -->>
โค๊ด: [Select]
//Color the links... can you not do it in a better way... okay i will do it :D
if(!empty($row['id_author']))
$context['MemberColor_ID_MEMBER'][$row['id_author']] = $row['id_author'];
$context['report'] = array(
'id' => $row['id_report'],

ค้นหา -->>
โค๊ด: [Select]
$context['report']['comments'][] = array(
'id' => $row['id_comment'],

แก้เป็น -->>
โค๊ด: [Select]
if(!empty($row['id_member']))
$context['MemberColor_ID_MEMBER'][$row['id_member']] = $row['id_member'];
$context['report']['comments'][] = array(
'id' => $row['id_comment'],

ค้นหา -->>
โค๊ด: [Select]
$context['report']['mod_comments'][] = array(
'id' => $row['id_comment'],

แก้เป็น -->>
โค๊ด: [Select]
if(!empty($row['id_member']))
$context['MemberColor_ID_MEMBER'][$row['id_member']] = $row['id_member'];
$context['report']['mod_comments'][] = array(
'id' => $row['id_comment'],

ค้นหา -->>
โค๊ด: [Select]
// What have the other moderators done to this message?
require_once($sourcedir . '/Modlog.php');
require_once($sourcedir . '/Subs-List.php');
loadLanguage('Modlog');

แก้เป็น -->>
โค๊ด: [Select]
//Now go through the comments and Reports :D and color them
global $modSettings;
//I do something in the Dirty way but it will work
if(!empty($modSettings['MemberColorModCenter']) && !empty($context['report']))
$context['reports']['single'] = $context['report'];

if(!empty($modSettings['MemberColorModCenter']) && !empty($context['MemberColor_ID_MEMBER']) && !empty($context['reports'])) {
$colorDatas = load_onlineColors($context['MemberColor_ID_MEMBER']);
foreach($context['reports'] as $rkey => $report) {
if(!empty($report['author']['id']) && !empty($colorDatas[$report['author']['id']]['colored_link'])) {
$context['reports'][$rkey]['author']['link'] = $colorDatas[$report['author']['id']]['colored_link'];
}
if(!empty($report['comments'])) {
foreach($report['comments'] as $ckey => $comment) {
if(!empty($comment['member']['id']) && !empty($colorDatas[$comment['member']['id']]['colored_link'])) {
$context['reports'][$rkey]['comments'][$ckey]['member']['link'] = $colorDatas[$comment['member']['id']]['colored_link'];
$context['reports'][$rkey]['comments'][$ckey]['member']['name'] = $colorDatas[$comment['member']['id']]['colored_name'];
}
}
}
if(!empty($report['mod_comments'])) {
foreach($report['mod_comments'] as $ckey => $comment) {
if(!empty($comment['member']['id']) && !empty($colorDatas[$comment['member']['id']]['colored_link'])) {
$context['reports'][$rkey]['mod_comments'][$ckey]['member']['link'] = $colorDatas[$comment['member']['id']]['colored_link'];
$context['reports'][$rkey]['mod_comments'][$ckey]['member']['name'] = $colorDatas[$comment['member']['id']]['colored_name'];
}
}
}
}
}
//Fix the dirty thing i do ;D
if(!empty($modSettings['MemberColorModCenter']) && !empty($context['report'])) {
$context['report'] = $context['reports']['single'];
unset($context['reports']['single']);
}

// What have the other moderators done to this message?
require_once($sourcedir . '/Modlog.php');
require_once($sourcedir . '/Subs-List.php');
loadLanguage('Modlog');

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

แก้เป็น -->>
โค๊ด: [Select]
//Color for this links?
if(!empty($row['id_member']))
$ID_MSG[$row['id_msg']] = $row['id_member'];

$member_posts[$row['id_msg']] = array(
'id' => $row['id_msg'],

ค้นหา -->>
โค๊ด: [Select]
return $member_posts;

แก้เป็น -->>
โค๊ด: [Select]
//Color the Post Datas 8)
if(!empty($modSettings['MemberColorModCenter']) && !empty($context['MemberColor_ID_MEMBER']) && !empty($ID_MSG)) {
$colorDatas = load_onlineColors($ID_MSG);
foreach($ID_MSG as $id_msg => $id_member) {
if(!empty($id_member) && !empty($colorDatas[$id_member]['colored_link'])) {
$member_posts[$id_msg]['author_link'] = $colorDatas[$id_member]['colored_link'];
}
}
}

return $member_posts;

ค้นหา -->>
โค๊ด: [Select]
$warnings = array();
while ($row = $smcFunc['db_fetch_assoc']($request))
{

แก้เป็น -->>
โค๊ด: [Select]
$warnings = array();
while ($row = $smcFunc['db_fetch_assoc']($request))
{
if(!empty($row['id_member']))
$context['MemberColor_ID_MEMBER'][$row['id_member']] = $row['id_member'];
if(!empty($row['id_recipient']))
$context['MemberColor_ID_MEMBER'][$row['id_recipient']] = $row['id_recipient'];

ค้นหา -->>
โค๊ด: [Select]
return $warnings;

แก้เป็น -->>
โค๊ด: [Select]
//Warning Colors... second time... is one time not enouph?
if(!empty($modSettings['MemberColorModCenter']) && !empty($context['MemberColor_ID_MEMBER']) && !empty($warnings)) {
$colorDatas = load_onlineColors($context['MemberColor_ID_MEMBER']);
foreach($warnings as $wkey => $warning) {
if(!empty($warning['id_issuer']) && !empty($colorDatas[$warning['id_issuer']]['colored_link'])) {
$warnings[$wkey]['issuer_link'] = $colorDatas[$warning['id_issuer']]['colored_link'];
}
if(!empty($warning['id_recipient']) && !empty($colorDatas[$warning['id_recipient']]['colored_link'])) {
$warnings[$wkey]['recipient_link'] = $colorDatas[$warning['id_recipient']]['colored_link'];
}
}
}
return $warnings;

file $sourcedir/Search.php

ค้นหา -->>
โค๊ด: [Select]
$memberContext[$message['id_member']]['link'] = $message['poster_name'];

แก้เป็น -->>
โค๊ด: [Select]
$memberContext[$message['id_member']]['link'] = (!empty($modSettings['MemberColorGuests']) ? '<span style="color:'.$modSettings['MemberColorGuests'].';">' : '').$message['poster_name'].(!empty($modSettings['MemberColorGuests']) ? '</span>' : '');

ค้นหา -->>
โค๊ด: [Select]
$output = array_merge($context['topics'][$message['id_msg']], array(

แก้เป็น -->>
โค๊ด: [Select]
//Generate the Started By Search Link... This is not fine, because i need to load each sepperate...
//Ah and add correct Guest links ;D
$first_post_link = !empty($message['first_member_id']) ? '<a href="' . $scripturl . '?action=profile;u=' . $message['first_member_id'] . '" title="' . $txt['profile_of'] . ' ' . $message['first_member_name'] . '">' . $message['first_member_name'] . '</a>' : (!empty($modSettings['MemberColorGuests']) ? '<span style="color:'.$modSettings['MemberColorGuests'].';">' : '').$message['first_member_name'].(!empty($modSettings['MemberColorGuests']) ? '</span>' : '');
$last_post_link = !empty($message['last_member_id']) ? '<a href="' . $scripturl . '?action=profile;u=' . $message['last_member_id'] . '" title="' . $txt['profile_of'] . ' ' . $message['last_member_name'] . '">' . $message['last_member_name'] . '</a>' : (!empty($modSettings['MemberColorGuests']) ? '<span style="color:'.$modSettings['MemberColorGuests'].';">' : '').$message['last_member_name'].(!empty($modSettings['MemberColorGuests']) ? '</span>' : '');
if(!empty($modSettings['MemberColorAllSearch'])) {
$load = array();
if(!empty($message['first_member_id']))
$load[] = $message['first_member_id'];
if(!empty($message['first_member_id']))
$load[] = $message['last_member_id'];
if(!empty($load)) {
$colorDatas = load_onlineColors($load);
if(!empty($colorDatas[$message['first_member_id']]['colored_link']))
$first_post_link = $colorDatas[$message['first_member_id']]['colored_link'];
if(!empty($colorDatas[$message['last_member_id']]['colored_link']))
$last_post_link = $colorDatas[$message['last_member_id']]['colored_link'];
}
}

$output = array_merge($context['topics'][$message['id_msg']], array(

ค้นหา -->>
โค๊ด: [Select]
'link' => !empty($message['first_member_id']) ? '<a href="' . $scripturl . '?action=profile;u=' . $message['first_member_id'] . '" title="' . $txt['profile_of'] . ' ' . $message['first_member_name'] . '">' . $message['first_member_name'] . '</a>' : $message['first_member_name']

แก้เป็น -->>
โค๊ด: [Select]
'link' => $first_post_link

ค้นหา -->>
โค๊ด: [Select]
'link' => !empty($message['last_member_id']) ? '<a href="' . $scripturl . '?action=profile;u=' . $message['last_member_id'] . '" title="' . $txt['profile_of'] . ' ' . $message['last_member_name'] . '">' . $message['last_member_name'] . '</a>' : $message['last_member_name']

แก้เป็น -->>
โค๊ด: [Select]
'link' => $last_post_link

file $themedir/BoardIndex.template.php]

ค้นหา -->>
โค๊ด: [Select]
<a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['is_today'] ? '<strong>' : '', $member['name'], $member['is_today'] ? '</strong>' : '', isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] ? '<br />' : ', ';

แก้เป็น -->>
โค๊ด: [Select]
<a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['is_today'] ? '<strong>' : '', (!empty($member['colored_name']) ? $member['colored_name'] : $member['name']), $member['is_today'] ? '</strong>' : '', isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] ? '<br />' : ', ';

file $themedir/Calendar.template.php

ค้นหา -->>
โค๊ด: [Select]
<a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['name'], isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] ? '' : ', ';

แก้เป็น -->>
โค๊ด: [Select]
<a href="', $scripturl, '?action=profile;u=', $member['id'], '">', (!empty($member['colored_name']) ? $member['colored_name'] : $member['name']), isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] ? '' : ', ';

ค้นหา -->>
โค๊ด: [Select]
<a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['name'], isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] || ($count == 10 && $use_js_hide)? '' : ', ';

แก้เป็น -->>
โค๊ด: [Select]
<a href="', $scripturl, '?action=profile;u=', $member['id'], '">', (!empty($member['colored_name']) ? $member['colored_name'] : $member['name']), isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] || ($count == 10 && $use_js_hide) ? '' : ', ';

file $themedir/Profile.template.php

ค้นหา -->>
โค๊ด: [Select]
<div class="username"><h4>', $context['member']['name'], ' <span class="position">', (!empty($context['member']['group']) ? $context['member']['group'] : $context['member']['post_group']), '</span></h4></div>

แก้เป็น -->>
โค๊ด: [Select]
<div class="username"><h4>', $context['member']['colored_name'], ' <span class="position">', (!empty($context['member']['group']) ? $context['member']['group'] : $context['member']['post_group']), '</span></h4></div>

file $languagedir/Modifications.thai-utf8.php

เพิ่ม -->>
โค๊ด: [Select]
//Member Color Link
$txt['MemberColorLinkHeadline'] = 'Member Color Link';
$txt['MemberColorLink'] = 'The display of the threadindex';
$txt['MemberColorLinkOldSpanStyle'] = 'Use a span html tag for the color (Old Style of the Mod)';
$txt['MemberColorThreadOwner'] = 'The thread owner at the boardindex';
$txt['MemberColorThreadLastPost'] = 'The last post member at the messageindex';
$txt['MemberColorThreadChild'] = 'The last post member at the childboard';
$txt['MemberColorModeratorLinks'] = 'Color the Moderator Links';
$txt['MemberColorBoardindex'] = 'The last post member at the boardindex';
$txt['MemberColorBirthday'] = 'The Birthday Links of the Members (Calendar and Boardindex)';
$txt['MemberColorRecentOwner'] = 'Recent posts, threadowner';
$txt['MemberColorRecentLastPost'] = 'Recent posts, the last poster';
$txt['MemberColorInbox'] = 'Change colors in the Instant Messages Inbox';
$txt['MemberColorOutbox'] = 'Change colors in the Instant Messages Outbox';
$txt['MemberColorLatestMember'] = 'Color the Latest Member';
$txt['MemberColorStats'] = 'Change color in the Boardstats.';
$txt['MemberColorWhoIsOnline'] = 'Color the Who is Online (Messagesindex and Threadindex)';
$txt['MemberColorGuests'] = 'Color for Guest nicknames<br /><span class="smalltext">Boradindex, Messageindex and Theaddisplay</span>';
$txt['MemberColorBanned'] = 'Color for Banned nicknames';
$txt['MemberColorBirthdayColor'] = 'Color for Brithday nicknames';
$txt['MemberColorModCenter'] = 'Color links for the Moderation Center';
$txt['MemberColorIssuePList'] = 'Color links of the profile issued warning list';
$txt['MemberColorAllSearch'] = 'Extend Color in Search to all Field (Heavy load needed)';

สร้างไฟล์: install_2.x.x.php เพื่อสร้างฐานข้อมูล ไว้ใน $boarddir (ที่เดียวกับไฟล์ SSI.php) รัน http://www.your_url.xxx/$boarddir/install_2.x.x.php -->> Enter เสร็จแล้วลบทิ้ง
โค๊ด: [Select]
<?
/*****************************************************************
* install.php  Version 1.0.3                                     *
* Special Advanced Version for Easier Handling                   *
* Programmed / Copyright By DIN1031 (http://www.ayu-kult.de/)    *
* for SMF (http://www.simplemachines.org)                        *
*****************************************************************/
/*****************************************************************
* It's free to change and use everywhere who this file is        *
* useable and made his work. You can change the code as you like *
* it. The only thing that i wish is, add the first 7 Lines of    *
* this file                                                      *
* THANKS A LOT                                                   *
*****************************************************************/
/*****************************************************************
* Used for follow Software                                       *
* Programm:      MemberColorLink                                 *
* By:            DIN1031 (http://www.ayu-kult.de/)               *
* Copyright:     DIN1031 (http://www.ayu-kult.de/)               *
*****************************************************************/

global $db_prefix, $modSettings, $smcFunc;

//This is a way to install the mod without the package parser!
$SSI_INSTALL = false;
if(!isset($db_prefix)) {
require('SSI.php');
$SSI_INSTALL = true;
}

// I want to be sure that this is loaded
if(empty($smcFunc['db_change_column']))
db_extend('packages');

// Change this in a compatible way ;)
$changed_field = array(
'name' => 'online_color',
'type' => 'varchar',
'size' => '255',
'null' => false
);
$smcFunc['db_change_column'] ('{db_prefix}membergroups', 'online_color', $changed_field);

//Give a proper answer on ssi install ;)
if($SSI_INSTALL)
echo 'DB Changes should be made now...';
?>

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



Thailand   ชาย ออฟไลน์
icon message
general ความคิดเห็นที่ 4 เมื่อ: 18 กรกฎาคม 2553, 20:06:24
ผมรันไฟล์ install_1.x.x.php
แล้วขึ้นว่า DB Changes should be made now...

ผมเข้า=ผู้ดูแล=ส่วน ปรับแต่งค่าการใช้งาน=Member Color Link (คลิ๊กแล้วไม่มีอะไรเกิดขึ้นเลยครับ)

ลิงค์หัวข้อ: http://dexmore.com/topic/2188
Windows XP    Firefox 3.6.6   see ip บันทึกการเข้า
ดูรายการสิ่งของน้องหมี..เอาไว้กอดนอนแทนกิ๊ก  
โฮสต์ดีๆ บริการด้วยใจ
*
*


!Personal

Germany   ชาย ผู้เริ่มต้นกระทู้นี้ ออฟไลน์544566157 DexMore DexMore DexMore
เว็บไซต์
icon message
general ความคิดเห็นที่ 5 เมื่อ: 18 กรกฎาคม 2553, 20:18:43
DB Changes should be made now... มันก็แจ้งว่าเรียบร้อยแล้วนี่ครับ

ทำความเข้าใจมันหน่อยนะครับ ไม่ใช่อะไรก็โยนใส่การสร้างตาราง

mod ตัวนี้ manual ยาวมาก พลาดตรงใหนไปหรือเปล่า

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



Thailand   ชาย ออฟไลน์
icon message
general ความคิดเห็นที่ 6 เมื่อ: 18 กรกฎาคม 2553, 20:34:32
DB Changes should be made now... มันก็แจ้งว่าเรียบร้อยแล้วนี่ครับ

ทำความเข้าใจมันหน่อยนะครับ ไม่ใช่อะไรก็โยนใส่การสร้างตาราง

mod ตัวนี้ manual ยาวมาก พลาดตรงใหนไปหรือเปล่า
ผมแค่บอกเฉยๆ ครับ กลัวว่าคุณหนุ่ยจะไม่เข้าใจ

ขอโทษด้วยครับ

ลิงค์หัวข้อ: http://dexmore.com/topic/2188
Windows XP    Firefox 3.6.6   see ip บันทึกการเข้า
ดูรายการสิ่งของน้องหมี..เอาไว้กอดนอนแทนกิ๊ก  
โฮสต์ดีๆ บริการด้วยใจ
iamgodcha

icon message
general ความคิดเห็นที่ 7 เมื่อ: 5 กันยายน 2553, 19:08:27
ช่วยด้วยครับ : ผมลงMOD Member color link แบบ แมนวลไปน่ะครับ เสร็จแล้วผมก้อเข้าไปในเมนู ส่วนปรับแต่งค่าการใช้งาน>Member color link>ติ๊กทุกช่องแล้วครับ พอเรากดบันทึก มันจะเด้งไปเมนู ส่วนปรับแต่งค่าการใช้งาน พอไปที่ Member color link อีกที ปรากดว่าไม่มีอารายติ๊กเลย ติ๊กใหม่หลายรอบแล้วก้อยังเหมือนเดิมน่ะครับ  ไม่ทราบว่ามีตรงไหนผิดหรือเปล่าครับ

ขอบคุณล่วงหน้าครับผม 

ลิงค์หัวข้อ: http://dexmore.com/topic/2188
Windows XP    Firefox 3.6.8   see ip บันทึกการเข้า
โฮสต์ดีๆ บริการด้วยใจ
*
*


!Personal

Germany   ชาย ผู้เริ่มต้นกระทู้นี้ ออฟไลน์544566157 DexMore DexMore DexMore
เว็บไซต์
icon message
general ความคิดเห็นที่ 8 เมื่อ: 5 กันยายน 2553, 20:44:28
ลองไล่ดูใหม่นะครับ โค้ดที่โพสต์ผมก็ไล่ดูแล้วไม่มีอะไรตกหล่น..

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



Thailand   ชาย ออฟไลน์
icon message
general ความคิดเห็นที่ 9 เมื่อ: 9 มีนาคม 2554, 21:14:05
ของผมลองทำตามหมดแล้วครับ มันเข้า ตรง ส่วนปรับแต่งค่าการใช้งาน > member color link ไม่ได้ครับ พอคลิกก็มาหน้า ส่วนปรับแต่งค่าการใช้งาน เหมือนเดิม

แล้วก็มันขึ่นเำพี่ยงแค่หน้่่า ในกระทู้ กับ ข้อมูลส่วนตัว นอกนั้นไม่ขึ้นเลยครับ ของผม 1.1.13 ครับ

ลิงค์หัวข้อ: http://dexmore.com/topic/2188
Windows XP    Firefox 3.6.15   see ip บันทึกการเข้า
โฮสต์ดีๆ บริการด้วยใจ
*
*


!Personal

Germany   ชาย ผู้เริ่มต้นกระทู้นี้ ออฟไลน์544566157 DexMore DexMore DexMore
เว็บไซต์
icon message
general ความคิดเห็นที่ 10 เมื่อ: 9 มีนาคม 2554, 21:25:04
ไล่ใหม่ครับ โดยเฉพาะ file $sourcedir/ModSettings.php

มันก็ไม่ขึ้นหรอกครับเพราะยังไม่ได้เข้าไปตั้งค่า

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



Thailand   หญิง ออฟไลน์
icon message
general ความคิดเห็นที่ 11 เมื่อ: 25 เมษายน 2554, 09:27:08
http://custom.simplemachines.org/mods/index.php?mod=111 ของ 2.0.5 เอาตัวไหนมาใช้ดี

ของ 2 อาร์ซี 5

ลิงค์หัวข้อ: http://dexmore.com/topic/2188
Windows XP    Firefox 3.6.16   see ip บันทึกการเข้า
โฮสต์ดีๆ บริการด้วยใจ
*
*


!Personal

Germany   ชาย ผู้เริ่มต้นกระทู้นี้ ออฟไลน์544566157 DexMore DexMore DexMore
เว็บไซต์
icon message
general ความคิดเห็นที่ 12 เมื่อ: 25 เมษายน 2554, 09:32:17
ตัวล่าสุดซิครับ 308

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



Thailand   หญิง ออฟไลน์
icon message
general ความคิดเห็นที่ 13 เมื่อ: 25 เมษายน 2554, 09:53:56
แล้วก็แก้ตามโค๊ดที่ให้มาเหรอค่ะ

ลิงค์หัวข้อ: http://dexmore.com/topic/2188
Windows XP    Firefox 3.6.16   see ip บันทึกการเข้า
โฮสต์ดีๆ บริการด้วยใจ
*
*


!Personal

Germany   ชาย ผู้เริ่มต้นกระทู้นี้ ออฟไลน์544566157 DexMore DexMore DexMore
เว็บไซต์
icon message
general ความคิดเห็นที่ 14 เมื่อ: 25 เมษายน 2554, 09:58:12
โหลดมาแล้วก็ install Packages ซิครับ ถ้าติดตั้งไม่ได้ค่อยแก้ด้วยมือ

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

Creative Commons License

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

WordPress Google เข้าเยี่ยมชมหน้านี้ล่าสุดเมื่อ : 16 พฤษภาคม 2555, 20:07:44

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