ucp_zebra.php

PHPBB.NET FORUMS ONLY. You can introduce your forum to our community here. Please put your URL (http://yourforum.phpbb.net/).

ucp_zebra.php

Postby Uracos on Mon Jul 29, 2013 6:46 pm

Заменить в строке 227 PHP-Code
Code: Select all
$sql = 'SELECT z.*, u.username, u.username_clean
FROM ' . ZEBRA_TABLE . ' z, ' . USERS_TABLE . ' u
WHERE z.user_id = ' . $user->data['user_id'] . "
AND $sql_and
AND u.user_id = z.zebra_id
ORDER BY u.username_clean ASC";
$result = $db->sql_query($sql);

$s_username_options = '';
while ($row = $db->sql_fetchrow($result))
{
$s_username_options .= '' . $row['username'] . '';
}
$db->sql_freeresult($result);

$template->assign_vars(array(
'L_TITLE'    => $user->lang['UCP_ZEBRA_' . $l_mode],

'U_FIND_USERNAME'   => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=ucp&field=add'),

'S_USERNAME_OPTIONS'   => $s_username_options,
'S_HIDDEN_FIELDS'    => $s_hidden_fields,
'S_UCP_ACTION'    => $this->u_action)
);

на
Code: Select all
$sql = 'SELECT z.*, u.username, u.username_clean, u.user_avatar, u.user_avatar_type
FROM ' . ZEBRA_TABLE . ' z, ' . USERS_TABLE . ' u
WHERE z.user_id = ' . $user->data['user_id'] . "
AND $sql_and
AND u.user_id = z.zebra_id
ORDER BY u.username_clean ASC";
$result = $db->sql_query($sql);

$s_username_options = '';
$s_username_script = "<script type=\"text/javascript\">\nvar avafriend = new Array()\n";
while ($row = $db->sql_fetchrow($result))
{
$s_username_options .= '' . $row['username'] . '';

if ($row['user_avatar_type'] == 1) $s_username_script .= "avafriend[" . $row['zebra_id'] . "] = \"/download/file.php?avatar=".$row['user_avatar']."\"\n";
else $s_username_script .= "avafriend[" . $row['zebra_id'] . "] = \"" . $row['user_avatar'] . "\"\n";
}
$db->sql_freeresult($result);
$s_username_script .= "function changeFriend(changeId)\n"
."{\n"
."   if (avafriend[changeId] != \"\"){\n"
."   document.getElementById(\"avatar_friends\").src=avafriend[changeId]\n"
."   }\n"
."   else {\n"
."   document.getElementById(\"avatar_friends\").src=\"/download/forum-avatar.jpg\"\n"
."   }\n"
."}\n"
."";

$template->assign_vars(array(
'L_TITLE'    => $user->lang['UCP_ZEBRA_' . $l_mode],

'U_FIND_USERNAME'   => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=ucp&field=add'),

'S_USERNAME_OPTIONS'   => $s_username_options,
'S_USERNAME_SCRIPT'    => $s_username_script,
'S_HIDDEN_FIELDS'    => $s_hidden_fields,
'S_UCP_ACTION'    => $this->u_action)
);

также заменить в styles/themes/template/ucp_zebra_friends.html
и также заменить в styles/themes/template/ucp_zebra_foes.html
Code: Select all
<select name="usernames[]" id="usernames" multiple="multiple" size="5">{S_USERNAME_OPTIONS}</select>

на
Code: Select all
{S_USERNAME_SCRIPT}
<select name="usernames[]" id="usernames" multiple="multiple" size="5" onChange="changeFriend(this.value);">{S_USERNAME_OPTIONS}</select>
<img src="/download/forum-avatar.jpg" class="avatar_friends" id="avatar_friends">


и добавить в styles/themes/theme/forms.css
Code: Select all
.avatar_friends {
border: 0;
width: 190px;
height: 190px;
vertical-align: middle;
margin: 0 15px;
}

select.usernames {
width: 260px;
height: 190px;
}
Uracos
 
Posts: 1
Joined: Mon Jul 29, 2013 6:33 pm

Return to Introduce your Forums

Who is online

Users browsing this forum: No registered users and 1 guest

cron