4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: Lunat on January 15, 2009, 09:40:44 PM
-
The mod's creator is alekinna (http://www.4homepages.de/forum/index.php?action=profile;u=21731), and my idea.
This mod adds possibility to write to users a personal rank from admin centre. It is displayed in comment_bit.html and member_profile.html
1. In includes/db_field_definitions.php add:
$additional_user_fields['admin_text'] = array($lang['admin_text'], "text", 0);
2. In lang/russian/main.php add:
$lang['admin_text'] = "Personal rank: ";
3. In member_profile.html use*:
{lang_admin_text}
{admin_text}
*You are can use {if admin_text} and {endif admin_text}
4. In comment_bit.html use:
{if admin_text}
{lang_admin_text}{admin_text}
{endif admin_text}
5. In details.php:
find line with:
$sql = "SELECT c.comment_id, c.image_id, c.user_id, c.user_name AS comment_user_name,
add in this line:
u.admin_text,
find FIRST:
$admin_links = "";
before add:
$admin_text = $comment_row[$i]['admin_text'];
find:
"comment_user_info" => $comment_user_info,
after add:
"admin_text" => $admin_text,
"lang_admin_text" => $lang['admin_text'],
6. In PhpMyAdmin create new parameter:
ALTER TABLE `4images_users` ADD `admin_text` TEXT NOT NULL;
-
Thank you for sharing.
A little database optimization could be done by using VARCHAR(255) field type instead of TEXT.
I doubt that anyone would use even 255 characters..
-
1-includes/db_field_definitions.php open
?>
before add
$additional_user_fields['admin_text'] = array($lang['admin_text'], "text", 0);
2-lang/yourlang/main.php open
?>
before add
$lang['admin_text'] = "Personal rank: ";
3-templates/yourtheme/member_profile.html open
find
<tr>
<td class="row2"><b>{lang_icq}</b></td>
<td class="row2">{if user_icq}<a href="http://www.icq.com/people/about_me.php?uin={user_icq}" target="_blank">{user_icq}</a> (<b>{user_icq_status}</b>){endif user_icq}</td>
</tr>
after add
<tr>
<td class="row1"><b>{lang_admin_text}</b></td>
<td class="row1">{admin_text}</td>
</tr>
4-templates/yourtheme/comment_bit.html open
find
{comment_user_info}
{if comment_user_ip}<br /><br /><b>IP:</b> {comment_user_ip}{endif comment_user_ip}
after add
<br />
<br />
{if admin_text}
{lang_admin_text}{admin_text}
{endif admin_text}
5-details.php open
find line with
$sql = "SELECT c.comment_id, c.image_id, c.user_id, c.user_name AS comment_user_name,
add in this line:
u.admin_text,
find
$admin_links = "";
before add
$admin_text = $comment_row[$i]['admin_text'];
find
"comment_user_info" => $comment_user_info,
after add
"admin_text" => $admin_text,
"lang_admin_text" => $lang['admin_text'],
6-In PhpMyAdmin sql execute
ALTER TABLE `4images_users` ADD `admin_text` TEXT NOT NULL;
ı am live in turkey and ı can use little english