Autor Tópico: Active Members In Topic (2.0.x)  (Lida 5271 vezes)

0 Membros e 2 Visitantes estão a ver este tópico.

Offline candidosa2

  • Suporte Tecnico
  • Fundador
  • *
  • Mensagens: 5072
  • Rank: 1658
  • Sexo: Masculino
  • Suporte
    • Hosting Moçambique
Active Members In Topic (2.0.x)
« em: 07 de Janeiro de 2011, 04:24 »
Original Tópico: http://custom.simplemachines.org/mods/index.php?mod=355
Modo Nome: Active Members In Topic
Created By:    snork13
Versão: 1.8
Versão compatível: 2.0 RCx
Manual: Sim / / Por Candidosa2

./Sources/Display.php

Código: [Seleccione]
$_SESSION['last_read_topic'] = $topic;
   }

Código: [Seleccione]
   
   //get members who posted in topic and how many times
   $member_count=0;
   $request = $smcFunc['db_query']('',"
            SELECT COUNT(*) AS 'POSTCOUNT', {db_prefix}members.id_member, {db_prefix}members.". ($modSettings['activeMemberName'] ? 'real_name' : 'member_name') .", {db_prefix}membergroups.online_color
            FROM ({db_prefix}messages INNER JOIN {db_prefix}members ON {db_prefix}messages.id_member = {db_prefix}members.id_member) LEFT JOIN {db_prefix}membergroups ON {db_prefix}members.id_group = {db_prefix}membergroups.id_group
            WHERE ((({db_prefix}messages.id_topic)=$topic))
            GROUP BY {db_prefix}members.id_member ORDER BY POSTCOUNT  ". ($modSettings['activeMemberSort'] ? 'DESC' : 'ASC') ." ");
     
   $memlink="";
   while($memberp = $smcFunc['db_fetch_row']($request))
   {
      $member_count;
      $memberColor[$member_count] = $memberp[3];
      $memberPosted_id[$member_count] = $memberp[0];
      $member_id[$member_count] = $memberp[1];
      $memberPosted_name[$member_count] = $memberp[2];
      $context['member_name_posted'][$member_count] = $memberPosted_name[$member_count];
      $context['member_COUNT_posted'][$member_count] = $memberPosted_id[$member_count];
      if (!empty($modSettings['activeMemberCountenable']))
      {
      $memlinkac='<a href="' . $scripturl . '?action=profile;u=' . $member_id[$member_count] . '" style="color: ' . $memberColor[$member_count] . ';">' . $memberPosted_name[$member_count] .'('. $memberPosted_id[$member_count] . ')</a>';
      }
      else{
      $memlinkac='<a href="' . $scripturl . '?action=profile;u=' . $member_id[$member_count] . '" style="color: ' . $memberColor[$member_count] . ';">' . $memberPosted_name[$member_count] .'</a>';
      }
      $memlink=$memlink." ".$memlinkac;
     
     
   }
   $context['members_posted']=$memlink;


./Sources/ManagePermissions.php

Código: [Seleccione]
'view_mlist' => array(false, 'general', 'view_basic_info'),
Código: [Seleccione]
'activeMember_view' => array(false, 'general', 'view_basic_info'),

./Sources/ManageSettings.php

Código: [Seleccione]
         // Who's online.
         array('check', 'who_enabled'),

Código: [Seleccione]
         // Active Members In Topic.
         '',
         array('check', 'activeMemberEnable'),
         array('check', 'activeMemberCountenable'),
         array('text', 'activeMemberColor'),
         array('text', 'activeMemberTextColor'),
         array('select','activeMemberSort', array(&$txt['active_desc'], &$txt['active_asc'])),
         array('select','activeMemberName', array(&$txt['active_mname'], &$txt['active_rname'])),


./Themes/default/Display.template.php

Código: [Seleccione]
// Show the topic information - icon, subject, etc.
   echo '
<div id="forumposts" class="tborder">
   <h3 class="catbg3">
      <img src="', $settings['images_url'], '/topic/', $context['class'], '.gif" align="bottom" alt="" />
      <span>', $txt['author'], '</span>
      <span id="top_subject">', $txt['topic'], ': ', $context['subject'], ' &nbsp;(', $txt['read'], ' ', $context['num_views'], ' ', $txt['times'], ')</span>
   </h3>';

Código: [Seleccione]
// Show the topic information - icon, subject, etc.
   echo '
<div id="forumposts" class="tborder">
   <h3 class="catbg3">
      <img src="', $settings['images_url'], '/topic/', $context['class'], '.gif" align="bottom" alt="" />';
      if (!empty($modSettings['activeMemberEnable']) && AllowedTo('activeMember_view'))
      {
   // Do you wish to hide the active member section, the user can!   
      echo '<a href="#" onclick="shrinkHeaderAM(!current_header_am); return false;"><img id="upshrink_am" src="', $settings['images_url'], '/', empty($options['collapse_header_am']) ? 'collapse.gif' : 'expand.gif', '" alt="*" title="', $txt['am_description'], '" style="margin-right: 2ex;" /></a>';
      }
      echo'<span>', $txt['author'], '</span>';
   // Show the topic information - icon, subject, etc.   
      echo '<span id="top_subject">', $txt['topic'], ': ', $context['subject'], ' &nbsp;(', $txt['read'], ' ', $context['num_views'], ' ', $txt['times'], ')</span></h3>';
   // Is the active member enabled?   
      if (!empty($modSettings['activeMemberEnable']) && AllowedTo('activeMember_view'))
      {
      echo'<div id="upshrinkHeaderAM"', empty($options['collapse_header_am']) ? '' : ' style="display: none;"', '><div id="activemembers" style="background-color:'.$modSettings['activeMemberColor'].'; color:'.$modSettings['activeMemberTextColor'].'">',$txt['activeMembers_title'],'<br />', $context['members_posted'], '</div></div>';
      }

./Themes/default/index.template.php

Código: [Seleccione]
</head>
Código: [Seleccione]
<script language="JavaScript" type="text/javascript">
         var current_header_am = ', empty($options['collapse_header_am']) ? 'false' : 'true', ';

         function shrinkHeaderAM(mode)
         {';

   if ($context['user']['is_guest'])
      echo '
            document-.-cookie = "upshrinkAM=" + (mode ? 1 : 0);';
   else
      echo '
            smf_setThemeOption("collapse_header_am", mode ? 1 : 0, null, "', $context['session_id'], '");';

   echo '
            document.getElementById("upshrink_am").src = smf_images_url + (mode ? "/expand.gif" : "/collapse.gif");

            document.getElementById("upshrinkHeaderAM").style.display = mode ? "none" : "";

            current_header_am = mode;
         }
      </script>

./Themes/default/css/forum.css

Código: [Seleccione]
#forumposts h3.catbg3
{
   font-weight: normal;
   padding: 0.4em;
}

Código: [Seleccione]
#activemembers
 {
   padding: 5px;
   font-size: 10px;
}

./Themes/default/languages/Help.portuguese_pt.php

Código: [Seleccione]
?>
Código: [Seleccione]
$helptxt['activeMemberEnable'] = 'Esta opção permite-lhe ligar ou desligar a capacidade dos utilizadores  verem quem está activo em um tópico.';
$helptxt['activeMemberCountenable'] = 'Esta opção permite-lhe ligar ou desligar a habilidade de contar postes';


./Themes/default/languages/index.portuguese_pt.php

Código: [Seleccione]
?>
Código: [Seleccione]
$txt['cannot_activeMember_view'] = 'Desculpa, você não tem permissão para ver os membros activo em tópicos.';
$txt['permissionname_activeMember_view'] = 'Membros modo activo em tópicos';
$txt['permissionhelp_activeMember_view'] = 'Permitir aos membros para ver os membros ativos em um tópico. Se não for definido, eles não vão ver os membros da activos.';


./Themes/default/languages/ManageSettings.portuguese_pt.php


Código: [Seleccione]
$txt['karmaLabel'] = 'Karma label';
$txt['karmaApplaudLabel'] = 'Karma applaud label';
$txt['karmaSmiteLabel'] = 'Karma smite label';

Código: [Seleccione]
$txt['activeMemberEnable'] = 'Activar os membros no tópico';
$txt['activeMemberCountenable'] = 'Activar a contagem de membros activos no poste do tópico';
$txt['activeMemberColor'] = 'Cor de fundo da linha membro activo';
$txt['activeMemberTextColor'] = 'Cor do texto membro activo';
$txt['activeMemberSort'] = 'Ordenar por postes mais alta ou mais baixa mensagens no tópico';
$txt['activeMemberName'] = 'Classificar por nome de membro ou o nome real';
$txt['active_desc'] = 'Ordenar descendente';
$txt['active_asc'] = 'Ordenar em Crescente';
$txt['active_mname'] = 'Nome de Membro';
$txt['active_rname'] = 'Nome real';


Nota (Quando vai fazer a configuração manualmente, baixe o pacote e dentro dele cora o ficheiro no forum depois apagar "add_settings_2_0_x.php

Offline candidosa2

  • Suporte Tecnico
  • Fundador
  • *
  • Mensagens: 5072
  • Rank: 1658
  • Sexo: Masculino
  • Suporte
    • Hosting Moçambique
Re: Active Members In Topic (2.0.x)
« Responder #1 em: 08 de Maio de 2011, 11:36 »
No 2.0RC5

./Sources/ManageSettings.php

encontrar esse código ...
Código: [Seleccione]
        // Who's online?
array('check', 'who_enabled'),
array('int', 'lastActive'),

Por favor, adicione este código ...

Código: [Seleccione]
         // Active Members In Topic.
         '',
         array('check', 'activeMemberEnable'),
         array('check', 'activeMemberCountenable'),
         array('text', 'activeMemberColor'),
         array('text', 'activeMemberTextColor'),
         array('select','activeMemberSort', array(&$txt['active_desc'], &$txt['active_asc'])),
         array('select','activeMemberName', array(&$txt['active_mname'], &$txt['active_rname'])),


./Themes/default/Display.template.php

encontrar esse código ...
Código: [Seleccione]
// Show the topic information - icon, subject, etc.
   echo '
<div id="forumposts" class="tborder">
   <h3 class="catbg3">
      <img src="', $settings['images_url'], '/topic/', $context['class'], '.gif" align="bottom" alt="" />
      <span>', $txt['author'], '</span>
      <span id="top_subject">', $txt['topic'], ': ', $context['subject'], ' &nbsp;(', $txt['read'], ' ', $context['num_views'], ' ', $txt['times'], ')</span>
   </h3>';

substituí-lo ... Por este código

Código: [Seleccione]
// Show the topic information - icon, subject, etc.
   echo '
<div id="forumposts" class="tborder">
   <h3 class="catbg3">
      <img src="', $settings['images_url'], '/topic/', $context['class'], '.gif" align="bottom" alt="" />';
      if (!empty($modSettings['activeMemberEnable']) && AllowedTo('activeMember_view'))
      {
   // Do you wish to hide the active member section, the user can!   
      echo '<a href="#" onclick="shrinkHeaderAM(!current_header_am); return false;"><img id="upshrink_am" src="', $settings['images_url'], '/', empty($options['collapse_header_am']) ? 'collapse.gif' : 'expand.gif', '" alt="*" title="', $txt['am_description'], '" style="margin-right: 2ex;" /></a>';
      }
      echo'<span>', $txt['author'], '</span>';
   // Show the topic information - icon, subject, etc.   
      echo '<span id="top_subject">', $txt['topic'], ': ', $context['subject'], ' &nbsp;(', $txt['read'], ' ', $context['num_views'], ' ', $txt['times'], ')</span></h3>';
   // Is the active member enabled?   
      if (!empty($modSettings['activeMemberEnable']) && AllowedTo('activeMember_view'))
      {
      echo'<div id="upshrinkHeaderAM"', empty($options['collapse_header_am']) ? '' : ' style="display: none;"', '><div id="activemembers" style="background-color:'.$modSettings['activeMemberColor'].'; color:'.$modSettings['activeMemberTextColor'].'">',$txt['activeMembers_title'],'<br />', $context['members_posted'], '</div></div>';
      }


./Themes/default/css/forum.css

Colocar no

./Themes/default/css/index.css

Adicionar

Código: [Seleccione]
#activemembers
 {
   padding: 5px;
   font-size: 10px;
}


./Themes/default/languages/ManageSettings.portuguese_pt.php

encontrar esse código ...
Código: [Seleccione]
$txt['karmaLabel'] = 'T&iacute;tulo do Karma';
$txt['karmaApplaudLabel'] = 'Aumentar Karma';
$txt['karmaSmiteLabel'] = 'Diminuir Karma';


Por favor, adicione este código ...depois

Código: [Seleccione]
$txt['activeMemberEnable'] = 'Activar os membros no tópico';
$txt['activeMemberCountenable'] = 'Activar a contagem de membros activos no poste do tópico';
$txt['activeMemberColor'] = 'Cor de fundo da linha membro activo';
$txt['activeMemberTextColor'] = 'Cor do texto membro activo';
$txt['activeMemberSort'] = 'Ordenar por postes mais alta ou mais baixa mensagens no tópico';
$txt['activeMemberName'] = 'Classificar por nome de membro ou o nome real';
$txt['active_desc'] = 'Ordenar descendente';
$txt['active_asc'] = 'Ordenar em Crescente';
$txt['active_mname'] = 'Nome de Membro';
$txt['active_rname'] = 'Nome real';


[info]Para activar tem que ir ....    Admin » Centro de Administração » Funcionalidades e Opções »Geral[/info]





[okay]Testado a funcionar 100%[/okay]