Autor Tópico: Avatars @ Index2  (Lida 3404 vezes)

0 Membros e 1 Visitante estão a ver este tópico.

Offline candidosa2

  • Suporte Tecnico
  • Fundador
  • *
  • Mensagens: 5072
  • Rank: 1658
  • Sexo: Masculino
  • Suporte
    • Hosting Moçambique
Avatars @ Index2
« em: 20 de Janeiro de 2008, 15:02 »

source/ModSettings.php
Pesquisr por
Código: [Seleccione]
array('check', 'who_enabled'),
e colocar por baixo
Código: [Seleccione]
'',
// Avatars at Index By Canddiosa2
array('check', 'enable_mini_avatars'),
array('int', 'miniAvatarHeight'),
array('int', 'miniAvatarWidth'),
array('check', 'enable_memberlist_avatars'),



sources/Memberlist.php

Pesquisar por
Código: [Seleccione]
'realName' => array(
'label' => $txt[35]
),

Colocar por baixo
Código: [Seleccione]
);
if (!empty($modSettings['enable_memberlist_avatars']))
$context['columns'] += array(
'avatar' => array(
            'label' => $txt['avatar']
        ),
        );       
        $context['columns'] += array(

Pesquisar por
Código: [Seleccione]
'realName' => array(
'down' => 'mem.realName ASC',
'up' => 'mem.realName DESC'
),

Colocar por Baixo
Código: [Seleccione]
'avatar' => array(
'down' => 'LENGTH(mem.avatar) > 0 DESC, ISNULL(mem.avatar) ASC, mem.avatar ASC',
'up' => 'LENGTH(mem.avatar) > 0 ASC, ISNULL(mem.avatar) DESC, mem.avatar DESC'
),


sources/MessageIndex.php
Pesquisar por
Código: [Seleccione]
else
{
if (!isset($context['icon_sources'][$row['firstIcon']]))
$context['icon_sources'][$row['firstIcon']] = 'images_url';
if (!isset($context['icon_sources'][$row['lastIcon']]))
$context['icon_sources'][$row['lastIcon']] = 'images_url';
}

Colocar por Baixo
Código: [Seleccione]
//Avatars at Index By Candidosa2
$mini_row = $row['firstID_MEMBER'];
$mini_avatar;

if (!empty($settings['show_user_images']) && empty($options['show_no_avatars'])) {
$res = db_query("
SELECT
mem.avatar, a.ID_ATTACH, a.attachmentType, a.filename
FROM {$db_prefix}members AS mem LEFT JOIN {$db_prefix}attachments AS a ON (a.ID_MEMBER = mem.ID_MEMBER)
WHERE mem.ID_MEMBER = $mini_row
LIMIT 1", __FILE__, __LINE__);
$mini_avatar =  mysql_fetch_assoc($res);
mysql_free_result($res);
}

Pesquisar por
Código: [Seleccione]
'id' => $row['firstID_MEMBER'],
'href' => !empty($row['firstID_MEMBER']) ? $scripturl . '?action=profile;u=' . $row['firstID_MEMBER'] : '',

 Colocar por Baixo
Código: [Seleccione]
'avatar' => $mini_avatar['avatar'] == '' ? ($mini_avatar['ID_ATTACH'] > 0 ? '<img src="' . (empty($mini_avatar['attachmentType']) ? $scripturl . '?action=dlattach;attach=' . $mini_avatar['ID_ATTACH'] . ';type=avatar' : $modSettings['custom_avatar_url'] . '/' . $mini_avatar['filename']) . '" alt="" height="'.$modSettings['miniAvatarHeight'] .'px" width="'.$modSettings['miniAvatarWidth'] .'px" align="absmiddle" border="0" />' : '') : (stristr($mini_avatar['avatar'], 'http://') ? '<img src="' . $mini_avatar['avatar'] . '" alt="" height="'.$modSettings['miniAvatarHeight'] .'px" width="'.$modSettings['miniAvatarWidth'] .'px" align="absmiddle" border="0" />' : '<img src="' . $modSettings['avatar_url'] . '/' . htmlspecialchars($mini_avatar['avatar']) . '" alt="" height="'.$modSettings['miniAvatarHeight'] .'px" width="'.$modSettings['miniAvatarWidth'] .'px" align="absmiddle" border="0" />'),  // Avatars at Index By Candidosa2

theme/MessageIndex.template.php  Alguns temas nao tem esta no attach

Pesquisar por
Código: [Seleccione]
<td class="windowbg2" valign="middle" width="14%">
', $topic['first_post']['member']['link'], '
</td>

Alterar colocar este código
Código: [Seleccione]
<td class="windowbg2" style="padding: 0px;" align="center"  valign="middle" width="17%">';
if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($modSettings['enable_mini_avatars']))
echo '<table width="100%" cellpadding="0" cellspacing="2px" border="0"><tr><td class="windowbg2" width="30%" align="center">
', $topic['first_post']['member']['avatar'],'</td><td class="windowbg2" width="70%">';
echo'
', $topic['first_post']['member']['link'], '</td>';

if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($modSettings['enable_mini_avatars']))
echo '</tr></table></td>';
echo'


theme/Memberlist.template.php
Pesquisar por
Código: [Seleccione]
function template_main()
{
global $context, $settings, $options, $scripturl, $txt;

Alterar colocar este
Código: [Seleccione]
function template_main()
{
global $modSettings, $context, $settings, $options, $scripturl, $txt;


Pesquisar por
Código: [Seleccione]
<td class="windowbg" align="left">', $member['link'], '</td>
Colocar por Baixo
Código: [Seleccione]
', empty($modSettings['enable_memberlist_avatars']) ? '' : ' <td class="windowbg" align="center">' . $member['avatar']['image'] . '</td>' ,'
Pesquisar por
Código: [Seleccione]
<td colspan="12">';
Alterar por
Código: [Seleccione]
<td colspan=" ', empty($modSettings['enable_memberlist_avatars']) ? '12' : '13','">';
Pesquisar por
Código: [Seleccione]
<td colspan="12" class="', empty($settings['use_tabs']) ? 'catbg' : 'titlebg', '">';
Alterar por
Código: [Seleccione]
<td colspan=" ', empty($modSettings['enable_memberlist_avatars']) ? '12' : '13','" class="', empty($settings['use_tabs']) ? 'catbg' : 'titlebg', '">';
Pesquisar por
Código: [Seleccione]
<td class="titlebg" colspan="12">', $txt[139], ': ', $context['page_index'], '</td>
Alterar por
Código: [Seleccione]
<td class="titlebg" colspan=" ', empty($modSettings['enable_memberlist_avatars']) ? '12' : '13','">', $txt[139], ': ', $context['page_index'], '</td>
Pesquisar por
Código: [Seleccione]
<td colspan="12" class="windowbg">', $txt[170], '</td>
Alterar e colocar este
Código: [Seleccione]
<td colspan=" ', empty($modSettings['enable_memberlist_avatars']) ? '12' : '13','" class="windowbg">', $txt[170], '</td>

language/Modifications.portuguese.php
Pesquisar
Código: [Seleccione]
?>
Colocar antes
Código: [Seleccione]
// Avatars at Index Mod Translate By Candidosa2
$txt['enable_mini_avatars'] = 'Permita indicar avatars mini na mensagem index';
$txt['enable_memberlist_avatars'] = 'Permita indicar avatars na lista do membro <div class="smalltext">na lista do membro pareça sem redução.</div>';
$txt['miniAvatarHeight'] = 'Avatar altura (pixel) <div class="smalltext">Para escalar pela Altura somente, ponha enter 0.</div>';
$txt['miniAvatarWidth'] = 'Avatar largura (pixel) <div class="smalltext">Para escalar pela largura somente,ponha enter 0.<br>Para avatars sem redução enter 0 a ambos os campos.</div>';
$txt['avatar'] = 'Avatar';
// Avatars Mod


estao aqui os ficheiros ja alterados pra que nao tem no tema dele
messageindex.template.php
Código: [Seleccione]
<?php
// Version: 1.1; MessageIndex

function template_main()
{
global $context$settings$options$scripturl$modSettings$txt;

echo '
<div style="margin-bottom: 2px;"><a name="top"></a>'
theme_linktree(), '</div>';

if (isset($context['boards']) && (!empty($options['show_children']) || $context['start'] == 0))
{
echo '
<div class="tborder" style="margin-bottom: 3ex; '
$context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' width: 100%;' '''">
<table border="0" width="100%" cellspacing="1" cellpadding="5" class="bordercolor">
<tr>
<td colspan="4" class="catbg">'
$txt['parent_boards'], '</td>
</tr>

'
,
empty($settings['boardname_posts_lastposts_nodisplay']) ? '<tr>
<td class="titlebg3" width="51" align="center" valign="middle">

</td>
<td class="titlebg3">
'
$txt[20].'
</td>
<td class="titlebg3" valign="middle" align="center" style="width: 12ex;">
'
$txt[21].'
</td>
<td class="titlebg3" valign="middle" align="center" width="22%">
'
$txt[22].'
</td>
</tr>' 
'' ;

foreach ($context['boards'] as $board)
{
echo '
<tr>
<td class="windowbg" width="51" align="center" valign="middle"><a href="'
$scripturl'?action=unread;board='$board['id'], '.0">';

// If the board is new, show a strong indicator.
if ($board['new'])
echo '<img src="'$settings['images_url'], '/'$settings['theme_main_color'], '/on.gif" alt="'$txt[333], '" title="'$txt[333], '" />';
// This board doesn't have new posts, but its children do.
elseif ($board['children_new'])
echo '<img src="'$settings['images_url'], '/'$settings['theme_main_color'], '/on2.gif" alt="'$txt[333], '" title="'$txt[333], '" />';
// No new posts at all! The agony!!
else
echo '<img src="'$settings['images_url'], '/'$settings['theme_main_color'], '/off.gif" alt="'$txt[334], '" title="'$txt[334], '" />';

echo '</a>
</td>
<td class="windowbg2" style="padding-top:12px; padding-bottom:12px;">
<b><a href="'
$board['href'], '" name="b'$board['id'], '">'$board['name'], '</a></b><br />
'
$board['description'];

// Show the "Moderators: ". Each has name, href, link, and id. (but we're gonna use link_moderators.)
if (!empty($board['moderators']))
echo '
<div style="padding-top: 1px;"><small><br/><i>'
count($board['moderators']) == $txt[298] : $txt[299], ': 'implode(', '$board['link_moderators']), '</i></small></div>';

// Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...)
if (!empty($board['children']))
{
// Sort the links into an array with new boards bold so it can be imploded.
$children = array();
/* Each child in each board's children has:
id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */
foreach ($board['children'] as $child)
{
$child['link'] = '<a href="' $child['href'] . '" title="' . ($child['new'] ? $txt[333] : $txt[334]) . ' (' $txt[330] . ': ' $child['topics'] . ', ' $txt[21] . ': ' $child['posts'] . ')">' $child['name'] . '</a>';
$children[] = $child['new'] ? '<img style="margin-right:5px;" src="' $settings['images_url'] . '/' $settings['theme_main_color'] . '/onk.gif" alt="' $txt[333] . '"/><b>' $child['link'] . '</b>' '<img style="margin-right:5px;" src="' $settings['images_url'] . '/' $settings['theme_main_color'] . '/offk.gif" alt="' $txt[334] . '"/>' $child['link'];
}

echo '
<table style="float:right; margin-top: 15px;" width="100%" cellspacing="0" cellpadding="3" border="0">
<tr>
<td class="middletext" valign="middle" align="center" width="30%">
<b>'
$txt['parent_boards'], ':</b>
'
;

$child_counter 0;

if(empty($settings['child_boards_rows']))
{
echo '
</td>
<td class="middletext" valign="top">'
;

for(; $child_counter ceil(count($children)/2); $child_counter++)
echo $children[$child_counter], '<br/>';
}

echo '
</td>
<td class="middletext" valign="top">'
;
for(; $child_counter count($children); $child_counter++)
echo $children[$child_counter], '<br/>';
echo '
</td>
</tr>
</table>'
;
}

// Show some basic information about the number of posts, etc.
echo '
</td>
<td class="windowbg" valign="middle" align="center" style="width: 12ex;"><small>
'
$board['posts'], ' '$txt[21], ' <br />
'
$board['topics'],' '$txt[330], '</small>
</td>
<td class="windowbg2" valign="middle" width="22%"><small>'
;

/* The board's and children's 'last_post's have:
time, timestamp (a number that represents the time.), id (of the post), topic (topic id.),
link, href, subject, start (where they should go for the first unread post.),
and member. (which has id, name, link, href, username in it.) */
if (!empty($board['last_post']['id']))
echo '
<b>'
$txt[22], '</b> '$txt[525], ' '$board['last_post']['member']['link'] , '<br />
'
$txt['smf88'], ' '$board['last_post']['link'], '<br />
'
$txt[30], ' '$board['last_post']['time'];

echo '</small>
</td>
</tr>'
;
}

echo '
</table>
</div>'
;
}


if (!empty($options['show_board_desc']) && $context['description'] != '')
{
echo '
<table width="100%" cellpadding="6" cellspacing="1" border="0" class="tborder" style="padding: 0; margin-bottom: 2ex;">
<tr>
<td class="titlebg2" width="100%" height="24" style="border-top: 0;">
<small>'
$context['description'], '</small>
</td>
</tr>
</table>'
;
}

// Create the button set...
$normal_buttons = array(
'new_topic' => array('test' => 'can_post_new''text' => 'smf258''image' => 'new_topic.gif''lang' => true'url' => $scripturl '?action=post;board=' $context['current_board'] . '.0'),
'markread' => array('text' => 'mark_read_short''image' => 'markread.gif''lang' => true'url' => $scripturl '?action=markasread;sa=board;board=' $context['current_board'] . '.0;sesc=' $context['session_id']),
'notify' => array('test' => 'can_mark_notify''text' => 125'image' => 'notify.gif''lang' => true'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"''url' => $scripturl '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' 'on') . ';board=' $context['current_board'] . '.' $context['start'] . ';sesc=' $context['session_id']),
'post_poll' => array('test' => 'can_post_poll''text' => 'smf20''image' => 'new_poll.gif''lang' => true'url' => $scripturl '?action=post;board=' $context['current_board'] . '.0;poll'),
);

// They can only mark read if they are logged in and it's enabled!
if (!$context['user']['is_logged'] || !$settings['show_mark_read'])
unset($normal_buttons['markread']);

if (!$context['no_topic_listing'])
{
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="middletext">'
$txt[139], ': '$context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '&nbsp;&nbsp;<a href="#bot"><b>' $txt['topbottom5'] . '</b></a>' '''</td>
<td align="right" style="padding-right: 1ex;">
<table cellpadding="0" cellspacing="0">
<tr>
'
template_button_strip($normal_buttons'bottom'), '
</tr>
</table>
</td>
</tr>
</table>'
;

// If Quick Moderation is enabled start the form.
if (!empty($options['display_quick_mod']) && !empty($context['topics']))
echo '
<form action="'
$scripturl'?action=quickmod;board='$context['current_board'], '.'$context['start'], '" method="post" accept-charset="'$context['character_set'], '" name="quickModForm" id="quickModForm" style="margin: 0;">';

echo '
<div class="tborder" '
$context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? 'style="width: 100%;"' '''>
<table border="0" width="100%" cellspacing="1" cellpadding="4" class="bordercolor">
<tr>'
;

// Are there actually any topics to show?
if (!empty($context['topics']))
{
echo '
<td width="9%" colspan="2" class="catbg3"></td>

<td class="catbg3"><a href="'
$scripturl'?board='$context['current_board'], '.'$context['start'], ';sort=subject'$context['sort_by'] == 'subject' && $context['sort_direction'] == 'up' ';desc' '''">'$txt[70], $context['sort_by'] == 'subject' ' <img src="' $settings['images_url'] . '/sort_' $context['sort_direction'] . '.gif" alt="" />' '''</a></td>

<td class="catbg3" width="11%"><a href="'
$scripturl'?board='$context['current_board'], '.'$context['start'], ';sort=starter'$context['sort_by'] == 'starter' && $context['sort_direction'] == 'up' ';desc' '''">'$txt[109], $context['sort_by'] == 'starter' ' <img src="' $settings['images_url'] . '/sort_' $context['sort_direction'] . '.gif" alt="" />' '''</a></td>

<td class="catbg3" width="4%" align="center"><a href="'
$scripturl'?board='$context['current_board'], '.'$context['start'], ';sort=replies'$context['sort_by'] == 'replies' && $context['sort_direction'] == 'up' ';desc' '''">'$txt[110], $context['sort_by'] == 'replies' ' <img src="' $settings['images_url'] . '/sort_' $context['sort_direction'] . '.gif" alt="" />' '''</a></td>

<td class="catbg3" width="4%" align="center"><a href="'
$scripturl'?board='$context['current_board'], '.'$context['start'], ';sort=views'$context['sort_by'] == 'views' && $context['sort_direction'] == 'up' ';desc' '''">'$txt[301], $context['sort_by'] == 'views' ' <img src="' $settings['images_url'] . '/sort_' $context['sort_direction'] . '.gif" alt="" />' '''</a></td>

<td class="catbg3" width="22%"><a href="'
$scripturl'?board='$context['current_board'], '.'$context['start'], ';sort=last_post'$context['sort_by'] == 'last_post' && $context['sort_direction'] == 'up' ';desc' '''">'$txt[111], $context['sort_by'] == 'last_post' ' <img src="' $settings['images_url'] . '/sort_' $context['sort_direction'] . '.gif" alt="" />' '''</a></td>';

// Show a "select all" box for quick moderation?
if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1)
echo '
<td class="catbg3" width="24" valign="middle" align="center">
<input type="checkbox" onclick="invertAll(this, this.form, \'topics[]\');" class="check" />
</td>'
;
// If it's on in "image" mode, don't show anything but the column.
elseif (!empty($options['display_quick_mod']))
echo '
<td class="catbg3" width="4%" valign="middle" align="center"></td>'
;
}
// No topics.... just say, "sorry bub".
else
echo '
<td class="catbg3" width="100%" colspan="7"><b>'
$txt[151], '</b></td>';

echo '
</tr>'
;

if (!empty($settings['display_who_viewing']))
{
echo '
<tr class="windowbg2">
<td colspan="' 
, !empty($options['display_quick_mod']) ? '8' '7' '"><small>';
if ($settings['display_who_viewing'] == 1)
echo count($context['view_members']), ' 'count($context['view_members']) == $txt['who_member'] : $txt[19];
else
echo empty($context['view_members_list']) ? '0 ' $txt[19] : implode(', '$context['view_members_list']) . ((empty($context['view_num_hidden']) or $context['can_moderate_forum']) ? '' ' (+ ' $context['view_num_hidden'] . ' ' $txt['hidden'] . ')');
echo $txt['who_and'], $context['view_num_guests'], ' '$context['view_num_guests'] == $txt['guest'] : $txt['guests'], $txt['who_viewing_board'], '
</small></td>
</tr>'
;
}

foreach ($context['topics'] as $topic)
{
// Do we want to seperate the sticky and lock status out?
if (!empty($settings['seperate_sticky_lock']) && strpos($topic['class'], 'sticky') !== false)
$topic['class'] = substr($topic['class'], 0strrpos($topic['class'], '_sticky'));
if (!empty($settings['seperate_sticky_lock']) && strpos($topic['class'], 'locked') !== false)
$topic['class'] = substr($topic['class'], 0strrpos($topic['class'], '_locked'));

echo '
<tr>
<td class="windowbg2" valign="middle" align="center" width="5%">
<img src="'
$settings['images_url'], '/topic/'$topic['class'], '.gif" alt="" />
</td>
<td class="windowbg2" valign="middle" align="center" width="4%">
<img src="'
$topic['first_post']['icon_url'], '" alt="" />
</td>
<td class="windowbg' 
, !empty($settings['seperate_sticky_lock']) && $topic['is_sticky'] ? '3' '' '" valign="middle" ', (!empty($topic['quick_mod']['remove']) ? 'id="topic_' $topic['first_post']['id'] . '" onmouseout="mouse_on_div = 0;" onmouseover="mouse_on_div = 1;" ondblclick="modify_topic(\'' $topic['id'] . '\', \'' $topic['first_post']['id'] . '\', \'' $context['session_id'] . '\');"' ''), '>';

if (!empty($settings['seperate_sticky_lock']))
echo '
$topic['is_locked'] ? '<img src="' $settings['images_url'] . '/icons/quick_lock.gif" align="right" alt="" id="lockicon' $topic['first_post']['id'] . '" style="margin: 0;" />' '' '
$topic['is_sticky'] ? '<img src="' $settings['images_url'] . '/icons/show_sticky.gif" align="right" alt="" id="stickyicon' $topic['first_post']['id'] . '" style="margin: 0;" />' '';

echo '
'
$topic['is_sticky'] ? '<b>' '' '<span id="msg_' $topic['first_post']['id'] . '">'$topic['first_post']['link'], '</span>'$topic['is_sticky'] ? '</b>' '';

// Is this topic new? (assuming they are logged in!)
if ($topic['new'] && $context['user']['is_logged'])
echo '
<span class="newicon"><a href="'
$topic['new_href'], '" id="newicon' $topic['first_post']['id'] . '">'$txt[302], '</a></span>';

echo '
<small id="pages' 
$topic['first_post']['id'] . '">'$topic['pages'], '</small>
</td>
<td class="windowbg2" style="padding: 0px;" align="center"  valign="middle" width="17%">'
;
if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($modSettings['enable_mini_avatars']))
echo '<table width="100%" cellpadding="0" cellspacing="2px" border="0"><tr><td class="windowbg2" width="30%" align="center">
'
$topic['first_post']['member']['avatar'],'</td><td class="windowbg2" width="70%">';
echo'
'
$topic['first_post']['member']['link'], '</td>';

if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($modSettings['enable_mini_avatars']))
echo '</tr></table></td>';
echo'
<td class="windowbg' 
$topic['is_sticky'] ? '3' '' '" valign="middle" width="4%" align="center">
'
$topic['replies'], '
</td>
<td class="windowbg' 
$topic['is_sticky'] ? '3' '' '" valign="middle" width="4%" align="center">
'
$topic['views'], '
</td>
<td class="windowbg2" valign="middle" width="22%">
<a href="'
$topic['last_post']['href'], '"><img src="'$settings['images_url'], '/icons/last_post.gif" alt="'$txt[111], '" title="'$txt[111], '" style="float: right;" /></a>
<span class="smalltext">
'
$topic['last_post']['time'], '<br />
'
$txt[525], ' '$topic['last_post']['member']['link'], '
</span>
</td>'
;

// Show the quick moderation options?
if (!empty($options['display_quick_mod']))
{
echo '
<td class="windowbg' 
$topic['is_sticky'] ? '3' '' '" valign="middle" align="center" width="4%">';
if ($options['display_quick_mod'] == 1)
echo '
<input type="checkbox" name="topics[]" value="'
$topic['id'], '" class="check" />';
else
{
// Check permissions on each and show only the ones they are allowed to use.
if ($topic['quick_mod']['remove'])
echo '<a href="'$scripturl'?action=quickmod;board='$context['current_board'], '.'$context['start'], ';actions['$topic['id'], ']=remove;sesc='$context['session_id'], '" onclick="return confirm(\''$txt['quickmod_confirm'], '\');"><img src="'$settings['images_url'], '/icons/quick_remove.gif" width="16" alt="'$txt[63], '" title="'$txt[63], '" /></a>';

if ($topic['quick_mod']['lock'])
echo '<a href="'$scripturl'?action=quickmod;board='$context['current_board'], '.'$context['start'], ';actions['$topic['id'], ']=lock;sesc='$context['session_id'], '" onclick="return confirm(\''$txt['quickmod_confirm'], '\');"><img src="'$settings['images_url'], '/icons/quick_lock.gif" width="16" alt="'$txt['smf279'], '" title="'$txt['smf279'], '" /></a>';

if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove'])
echo '<br />';

if ($topic['quick_mod']['sticky'])
echo '<a href="'$scripturl'?action=quickmod;board='$context['current_board'], '.'$context['start'], ';actions['$topic['id'], ']=sticky;sesc='$context['session_id'], '" onclick="return confirm(\''$txt['quickmod_confirm'], '\');"><img src="'$settings['images_url'], '/icons/quick_sticky.gif" width="16" alt="'$txt['smf277'], '" title="'$txt['smf277'], '" /></a>';

if ($topic['quick_mod']['move'])
echo '<a href="'$scripturl'?action=movetopic;board='$context['current_board'], '.'$context['start'], ';topic='$topic['id'], '.0"><img src="'$settings['images_url'], '/icons/quick_move.gif" width="16" alt="'$txt[132], '" title="'$txt[132], '" /></a>';
}
echo '</td>';
}
echo '
</tr>'
;
}

if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == && !empty($context['topics']))
{
echo '
<tr class="catbg">
<td colspan="8" align="right">
<select name="qaction"'
$context['can_move'] ? ' onchange="this.form.moveItTo.disabled = (this.options[this.selectedIndex].value != \'move\');"' '''>
<option value="">--------</option>
'
$context['can_remove'] ? '<option value="remove">' $txt['quick_mod_remove'] . '</option>' '''
'
$context['can_lock'] ? '<option value="lock">' $txt['quick_mod_lock'] . '</option>' '''
'
$context['can_sticky'] ? '<option value="sticky">' $txt['quick_mod_sticky'] . '</option>' '''
'
$context['can_move'] ? '<option value="move">' $txt['quick_mod_move'] . ': </option>' '''
'
$context['can_merge'] ? '<option value="merge">' $txt['quick_mod_merge'] . '</option>' '''
<option value="markread">'
$txt['quick_mod_markread'], '</option>
</select>'
;

if ($context['can_move'])
{
echo '
<select id="moveItTo" name="move_to" disabled="disabled">'
;

foreach ($context['jump_to'] as $category)
foreach ($category['boards'] as $board)
{
if (!$board['is_current'])
echo '
<option value="'
$board['id'], '"', !empty($board['selected']) ? ' selected="selected"' '''>'str_repeat('-'$board['child_level'] + 1), ' '$board['name'], '</option>';
}
echo '
</select>'
;
}
echo '
<input type="submit" value="'
$txt['quick_mod_go'], '" onclick="return document.forms.quickModForm.qaction.value != \'\' &amp;&amp; confirm(\''$txt['quickmod_confirm'], '\');" />
</td>
</tr>'
;
}

echo '
</table>
</div>
<a name="bot"></a>'
;

// Finish off the form - again.
if (!empty($options['display_quick_mod']) && !empty($context['topics']))
echo '
<input type="hidden" name="sc" value="' 
$context['session_id'] . '" />
</form>'
;

echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="middletext">'
$txt[139], ': '$context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '&nbsp;&nbsp;<a href="#top"><b>' $txt['topbottom4'] . '</b></a>' '''</td>
<td align="right" style="padding-right: 1ex;">
<table cellpadding="0" cellspacing="0">
<tr>
'
template_button_strip($normal_buttons'top'), '
</tr>
</table>
</td>
</tr>
</table>'
;
}


// Show breadcrumbs at the bottom too?
echo '
<div>'
theme_linktree(), '<br /></div>';

echo '
<div class="tborder">
<table cellpadding="8" cellspacing="0" width="100%" class="titlebg2">
<tr>'
;

if (!$context['no_topic_listing'])
echo '
<td style="padding-top: 2ex;" class="smalltext">'
, !empty($modSettings['enableParticipation']) ? '
<img src="' 
$settings['images_url'] . '/topic/my_normal_post.gif" alt="" align="middle" /> ' $txt['participation_caption'] . '<br />' '''
<img src="' 
$settings['images_url'] . '/topic/normal_post.gif" alt="" align="middle" /> ' $txt[457] . '<br />
<img src="' 
$settings['images_url'] . '/topic/hot_post.gif" alt="" align="middle" /> ' $txt[454] . '<br />
<img src="' 
$settings['images_url'] . '/topic/veryhot_post.gif" alt="" align="middle" /> ' $txt[455] . '
</td>
<td valign="top" style="padding-top: 2ex;" class="smalltext">
<img src="' 
$settings['images_url'] . '/icons/quick_lock.gif" alt="" align="middle" /> ' $txt[456] . '<br />' . ($modSettings['enableStickyTopics'] == '1' '
<img src="' 
$settings['images_url'] . '/icons/quick_sticky.gif" alt="" align="middle" /> ' $txt['smf96'] . '<br />' '') . ($modSettings['pollMode'] == '1' '
<img src="' 
$settings['images_url'] . '/topic/normal_poll.gif" alt="" align="middle" /> ' $txt['smf43'] : '') . '
</td>'
;

echo '
<td align="'
, !$context['right_to_left'] ? 'right' 'left''" valign="middle">
<form action="'
$scripturl'" method="get" accept-charset="'$context['character_set'], '" name="jumptoForm">
<span class="smalltext"><label for="jumpto">' 
$txt[160] . '</label>:</span>
<select name="jumpto" id="jumpto" onchange="if (this.selectedIndex > 0 &amp;&amp; this.options[this.selectedIndex].value) window.location.href = smf_scripturl + this.options[this.selectedIndex].value.substr(smf_scripturl.indexOf(\'?\') == -1 || this.options[this.selectedIndex].value.substr(0, 1) != \'?\' ? 0 : 1);">
<option value="">' 
$txt[251] . ':</option>';

// Show each category - they all have an id, name, and the boards in them.
foreach ($context['jump_to'] as $category)
{
// Show the category name with a link to the category. (index.php#id)
echo '
<option value="" disabled="disabled">-----------------------------</option>
<option value="#'
$category['id'], '">'$category['name'], '</option>
<option value="" disabled="disabled">-----------------------------</option>'
;

/* Now go through each board - they all have:
id, name, child_level (how many parents they have, basically...), and is_current. (is this the current board?) */
foreach ($category['boards'] as $board)
{
// Show some more =='s if this is a child, so as to make it look nice.
echo '
<option value="?board='
$board['id'], '.0"'$board['is_current'] ? ' selected="selected"' '''> 'str_repeat('=='$board['child_level']), '=> '$board['name'], '</option>';
}
}

echo '
</select>&nbsp;
<input type="button" value="'
$txt[161], '" onclick="if (this.form.jumpto.options[this.form.jumpto.selectedIndex].value) window.location.href = \''$scripturl'\' + this.form.jumpto.options[this.form.jumpto.selectedIndex].value;" />
</form>
</td>
</tr>
</table>
</div>'
;

// Javascript for inline editing.
echo '
<script language="JavaScript" type="text/javascript" src="' 
$settings['default_theme_url'] . '/xml_board.js"></script>
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[

// Hide certain bits during topic edit.
hide_prefixes.push("lockicon", "stickyicon", "pages", "newicon");

// Use it to detect when we\'ve stopped editing.
document.onclick = modify_topic_click;

var mouse_on_div;
function modify_topic_click()
{
if (in_edit_mode == 1 && mouse_on_div == 0)
modify_topic_save("'
$context['session_id'], '");
}

function modify_topic_keypress(oEvent)
{
if (typeof(oEvent.keyCode) != "undefined" && oEvent.keyCode == 13)
{
modify_topic_save("'
$context['session_id'], '");
if (typeof(oEvent.preventDefault) == "undefined")
oEvent.returnValue = false;
else
oEvent.preventDefault();
}
}

// For templating, shown when an inline edit is made.
function modify_topic_show_edit(subject)
{
// Just template the subject.
setInnerHTML(cur_subject_div, \'<input type="text" name="subject" value="\' + subject + \'" size="60" style="width: 99%;"  maxlength="80" onkeypress="modify_topic_keypress(event)" /><input type="hidden" name="topic" value="\' + cur_topic_id + \'" /><input type="hidden" name="msg" value="\' + cur_msg_id.substr(4) + \'" />\');
}

// And the reverse for hiding it.
function modify_topic_hide_edit(subject)
{
// Re-template the subject!
setInnerHTML(cur_subject_div, \'<a href="'
$scripturl'?topic=\' + cur_topic_id + \'.0">\' + subject + \'</a>\');
}

// ]]></script>'
;
}

function 
theme_show_buttons()
{
global $context$settings$options$txt$scripturl;

$buttonArray = array();

// Are they allowed to post new topics?
if ($context['can_post_new'])
$buttonArray[] = '<a href="' $scripturl '?action=post;board=' $context['current_board'] . '.0">' $txt['smf258'] . '</a>';

// If they are logged in, and the mark read buttons are enabled..
if ($context['user']['is_logged'] && $settings['show_mark_read'])
$buttonArray[] = '<a href="' $scripturl '?action=markasread;sa=board;board=' $context['current_board'] . '.0;sesc=' $context['session_id'] . '">' $txt['mark_read_short'] . '</a>';

// If the user has permission to show the notification button... ask them if they're sure, though.
if ($context['can_mark_notify'])
$buttonArray[] = '<a href="' $scripturl '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' 'on') . ';board=' $context['current_board'] . '.' $context['start'] . ';sesc=' $context['session_id'] . '" onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');">' $txt[125] . '</a>';

// How about new polls, can the user post those?
if ($context['can_post_poll'])
$buttonArray[] = '<a href="' $scripturl '?action=post;board=' $context['current_board'] . '.0;poll">' $txt['smf20'] . '</a>';

return implode(' &nbsp;|&nbsp; '$buttonArray);
}

?>

Qualquer dificuldade ponha aqui

Offline candidosa2

  • Suporte Tecnico
  • Fundador
  • *
  • Mensagens: 5072
  • Rank: 1658
  • Sexo: Masculino
  • Suporte
    • Hosting Moçambique
Re: Avatars @ Index2
« Responder #1 em: 20 de Janeiro de 2008, 15:03 »
memberlist.template.php

Código: [Seleccione]
<?php
// Version: 1.1; Memberlist

// Displays a sortable listing of all members registered on the forum.
function template_main()
{
global $modSettings$context$settings$options$scripturl$txt;

// Show the link tree.
echo '
<div style="padding: 3px;">'
theme_linktree(), '</div>';

// shall we use the tabs?
if (!empty($settings['use_tabs']))
{
// Display links to view all/search.
echo '
<table cellpadding="0" cellspacing="0" border="0" style="margin-left: 10px;">
<tr>
<td class="mirrortab_first">&nbsp;</td>'
;

foreach ($context['sort_links'] as $link)
{
if ($link['selected'])
echo '
<td class="mirrortab_active_first">&nbsp;</td>
<td valign="top" class="mirrortab_active_back">
<a href="' 
$scripturl '?action=mlist' . (!empty($link['action']) ? ';sa=' $link['action'] : '') . '">'$link['label'], '</a>
</td>
<td class="mirrortab_active_last">&nbsp;</td>'
;
else
echo '
<td valign="top" class="mirrortab_back">
<a href="' 
$scripturl '?action=mlist' . (!empty($link['action']) ? ';sa=' $link['action'] : '') . '">'$link['label'], '</a>
</td>'
;
}

echo '
<td class="mirrortab_last">&nbsp;</td>
</tr>
</table>'
;
}

echo '
<table border="0" cellspacing="1" cellpadding="4" align="center" width="100%" class="bordercolor">'
;

// Old style tabs?
if (empty($settings['use_tabs']))
{
echo '
<tr class="titlebg">
<td colspan=" '
, empty($modSettings['enable_memberlist_avatars']) ? '12' '13','">';
$links = array();
foreach ($context['sort_links'] as $link)
$links[] = ($link['selected'] ? '<img src="' $settings['images_url'] . '/selected.gif" alt="&gt;" /> ' '') . '<a href="' $scripturl '?action=mlist' . (!empty($link['action']) ? ';sa=' $link['action'] : '') . '">' $link['label'] . '</a>';

echo '
'
implode(' | '$links), '
</td>
</tr>'
;
}
echo '
<tr>
<td colspan=" '
, empty($modSettings['enable_memberlist_avatars']) ? '12' '13','" class="', empty($settings['use_tabs']) ? 'catbg' 'titlebg''">';

// Display page numbers and the a-z links for sorting by name if not a result of a search.
if (!isset($context['old_search']))
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>'
$txt[139], ': '$context['page_index'], '</td>
<td align="right">'
$context['letter_links'] . '</td>
</tr>
</table>'
;
// If this is a result of a search then just show the page numbers.
else
echo '
'
$txt[139], ': '$context['page_index'];

echo '
</td>
</tr>
<tr class="'
, empty($settings['use_tabs']) ? 'titlebg' 'catbg3''">';

// Display each of the column headers of the table.
foreach ($context['columns'] as $column)
{
// We're not able (through the template) to sort the search results right now...
if (isset($context['old_search']))
echo '
<td'
, isset($column['width']) ? ' width="' $column['width'] . '"' '', isset($column['colspan']) ? ' colspan="' $column['colspan'] . '"' '''>
'
$column['label'], '</td>';
// This is a selected solumn, so underline it or some such.
elseif ($column['selected'])
echo '
<td style="width: auto;"' 
. (isset($column['colspan']) ? ' colspan="' $column['colspan'] . '"' '') . ' nowrap="nowrap">
<a href="' 
$column['href'] . '">' $column['label'] . ' <img src="' $settings['images_url'] . '/sort_' $context['sort_direction'] . '.gif" alt="" /></a></td>';
// This is just some column... show the link and be done with it.
else
echo '
<td'
, isset($column['width']) ? ' width="' $column['width'] . '"' '', isset($column['colspan']) ? ' colspan="' $column['colspan'] . '"' '''>
'
$column['link'], '</td>';
}
echo '
</tr>'
;

// Assuming there are members loop through each one displaying their data.
if (!empty($context['members']))
{
foreach ($context['members'] as $member)
echo '
<tr style="text-align: center;"'
, empty($member['sort_letter']) ? '' ' id="letter' $member['sort_letter'] . '"''>
<td class="windowbg2">
'
$context['can_send_pm'] ? '<a href="' $member['online']['href'] . '" title="' $member['online']['text'] . '">' ''$settings['use_image_buttons'] ? '<img src="' $member['online']['image_href'] . '" alt="' $member['online']['text'] . '" align="middle" />' $member['online']['label'], $context['can_send_pm'] ? '</a>' '''
</td>
<td class="windowbg" align="left">'
$member['link'], '</td>
'
, empty($modSettings['enable_memberlist_avatars']) ? '' ' <td class="windowbg" align="center">' $member['avatar']['image'] . '</td>' ,'
<td class="windowbg2">'
$member['hide_email'] ? '' '<a href="mailto:' $member['email'] . '"><img src="' $settings['images_url'] . '/email_sm.gif" alt="' $txt[69] . '" title="' $txt[69] . ' ' $member['name'] . '" /></a>''</td>
<td class="windowbg">'
$member['website']['url'] != '' '<a href="' $member['website']['url'] . '" target="_blank"><img src="' $settings['images_url'] . '/www.gif" alt="' $member['website']['title'] . '" title="' $member['website']['title'] . '" /></a>' '''</td>
<td class="windowbg2">'
$member['icq']['link'], '</td>
<td class="windowbg2">'
$member['aim']['link'], '</td>
<td class="windowbg2">'
$member['yim']['link'], '</td>
<td class="windowbg2">'
$member['msn']['link'], '</td>
<td class="windowbg" align="left">'
, empty($member['group']) ? $member['post_group'] : $member['group'], '</td>
<td class="windowbg" align="left">'
$member['registered_date'], '</td>
<td class="windowbg2" width="15">'
$member['posts'], '</td>
<td class="windowbg" width="100" align="left">
'
$member['posts'] > '<img src="' $settings['images_url'] . '/bar.gif" width="' $member['post_percent'] . '" height="15" alt="" />' '''
</td>
</tr>'
;
}
// No members?
else
echo '
<tr>
<td colspan=" '
, empty($modSettings['enable_memberlist_avatars']) ? '12' '13','" class="windowbg">'$txt[170], '</td>
</tr>'
;

// Show the page numbers again. (makes 'em easier to find!)
echo '
<tr>
<td class="titlebg" colspan=" '
, empty($modSettings['enable_memberlist_avatars']) ? '12' '13','">'$txt[139], ': '$context['page_index'], '</td>
</tr>
</table>'
;

// If it is displaying the result of a search show a "search again" link to edit their criteria.
if (isset($context['old_search']))
echo '
<br />
<a href="'
$scripturl'?action=mlist;sa=search;search='$context['old_search_value'], '">'$txt['mlist_search2'], '</a>';
}

// A page allowing people to search the member list.
function template_search()
{
global $context$settings$options$scripturl$txt;

// Start the submission form for the search!
echo '
<form action="'
$scripturl'?action=mlist;sa=search" method="post" accept-charset="'$context['character_set'], '">';

// Display that link tree...
echo '
<div style="padding: 3px;">'
theme_linktree(), '</div>';

// Display links to view all/search.
if (!empty($settings['use_tabs']))
{
echo '
<table cellpadding="0" cellspacing="0" border="0" style="margin-left: 10px;">
<tr>
<td class="mirrortab_first">&nbsp;</td>'
;

foreach ($context['sort_links'] as $link)
{
if ($link['selected'])
echo '
<td class="mirrortab_active_first">&nbsp;</td>
<td valign="top" class="mirrortab_active_back">
<a href="' 
$scripturl '?action=mlist' . (!empty($link['action']) ? ';sa=' $link['action'] : '') . '">'$link['label'], '</a>
</td>
<td class="mirrortab_active_last">&nbsp;</td>'
;
else
echo '
<td valign="top" class="mirrortab_back">
<a href="' 
$scripturl '?action=mlist' . (!empty($link['action']) ? ';sa=' $link['action'] : '') . '">'$link['label'], '</a>
</td>'
;
}

echo '
<td class="mirrortab_last">&nbsp;</td>
</tr>
</table>
<div class="tborder">'
;
}
else
{
echo '
<div class="bordercolor" style="padding: 1px;">
<div class="titlebg" style="padding: 4px 4px 4px 10px;">'
;
$links = array();
foreach ($context['sort_links'] as $link)
$links[] = ($link['selected'] ? '<img src="' $settings['images_url'] . '/selected.gif" alt="&gt;" /> ' '') . '<a href="' $scripturl '?action=mlist' . (!empty($link['action']) ? ';sa=' $link['action'] : '') . '">' $link['label'] . '</a>';

echo '
'
implode(' | '$links), '
</div>
</div>
<div class="bordercolor" style="padding: 1px">'
;
}

// Display the input boxes for the form.
echo '

<div class="windowbg" align="center" style="padding-bottom: 1ex;">
<table width="440" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" align="left">
<br />
<b>'
$txt[582], ':</b> <input type="text" name="search" value="'$context['old_search'], '" size="35" /> <input type="submit" name="submit" value="' $txt[182] . '" style="margin-left: 20px;" /><br />
<br />
</td>
</tr>
<tr>
<td align="left">
<label for="fields-email"><input type="checkbox" name="fields[]" id="fields-email" value="email" checked="checked" class="check" /> '
$txt['mlist_search_email'], '</label><br />
<label for="fields-messenger"><input type="checkbox" name="fields[]" id="fields-messenger" value="messenger" class="check" /> '
$txt['mlist_search_messenger'], '</label><br />
<label for="fields-group"><input type="checkbox" name="fields[]" id="fields-group" value="group" class="check" /> '
$txt['mlist_search_group'], '</label>
</td>
<td align="left" valign="top">
<label for="fields-name"><input type="checkbox" name="fields[]" id="fields-name" value="name" checked="checked" class="check" /> '
$txt['mlist_search_name'], '</label><br />
<label for="fields-website"><input type="checkbox" name="fields[]" id="fields-website" value="website" class="check" /> '
$txt['mlist_search_website'], '</label>
</td>
</tr>
</table>
</div>
</div>
</form>'
;
}

?>