Autor Tópico: Related Topics - Tópicos relacionado  (Lida 2649 vezes)

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

Offline candidosa2

  • Suporte Tecnico
  • Fundador
  • *
  • Mensagens: 5061
  • Rank: 1658
  • Sexo: Masculino
  • Suporte
    • Hosting Moçambique
Related Topics - Tópicos relacionado
« em: 13 de Maio de 2011, 23:35 »


$sourcedir/Admin.php
Localizar o ficheiro

Adicione antes:

Código: [Seleccione]
'relatedtopics' => array(
               'label' => $txt['admin_related_topic'],
               'file' => 'RelatedTopics.php',
               'function' => 'RelatedTopicsAdmin',
               'subsections' => array(
                  'main' => array($txt['admin_related_topics_information']),
                  'settings' => array($txt['admin_related_topics_settings']),
                  'methods' => array($txt['admin_related_topics_methods']),
               ),
            ),

Pesquisar

   // Mod Authors for a "ADD AFTER" on this line. Ensure you end your change with a comma. For example:      

Adicionar

Código: [Seleccione]
'related' => array($txt['admin_related_topic']),




$sourcedir/RemoveTopic.php

Pesquisar

// Recycle topics that aren't in the recycle board...

Adicione antes

Código: [Seleccione]
// Added by Related Topics
      require_once($sourcedir . '/Subs-Related.php');
      relatedRemoveTopics($topics);
      // Related Topics END
 


$sourcedir/Subs-Post.php

Pesquisar

Código: [Seleccione]
   $topicOptions['id'] = $smcFunc['db_insert_id']('{db_prefix}topics', 'id_topic');
 

Adicionar depois

Código: [Seleccione]
// Added by Related Topics
   global $sourcedir;
   require_once($sourcedir . '/Subs-Related.php');
   relatedUpdateTopics($topicOptions['id']);
   // Related Topics END

Pesquisar
Código: [Seleccione]
if ($smcFunc['db_num_rows']($request) == 1)
         updateStats('subject', $topicOptions['id'], $msgOptions['subject']);

Alterar por

Código: [Seleccione]
if ($smcFunc['db_num_rows']($request) == 1)
      {
         updateStats('subject', $topicOptions['id'], $msgOptions['subject']);
 
         // Added by Related Topics
         global $sourcedir;
         require_once($sourcedir . '/Subs-Related.php');
         relatedUpdateTopics($topicOptions['id']);
         // Related Topics END
      }


$sourcedir/Display.php

Pesquisar
Código: [Seleccione]
$topicinfo = $smcFunc['db_fetch_assoc']($request);
   $smcFunc['db_free_result']($request);

Adicionar depois
Código: [Seleccione]
// Added by Related Topics
   if (!empty($modSettings['relatedTopicsEnabled']))
   {
      require_once($sourcedir . '/Subs-Related.php');
      loadRelated($topic);
   }


$themedir/Display.template.php

Pesquisar
Código: [Seleccione]
if ($context['show_spellchecking'])
      echo '
         <form action="', $scripturl, '?action=spellcheck" method="post" accept-charset="', $context['character_set'], '" name="spell_form" id="spell_form" target="spellWindow"><input type="hidden" name="spellstring" value="" /></form>

Adicione antes

Código: [Seleccione]
// Added by Related Topics
   if (!empty($context['related_topics'])) // TODO: Have ability to display no related topics?
   {
      echo '
      <br /><span class="clear upperframe"><span></span></span>
      <div class="roundframe"><div class="innerframe">
         <div class="cat_bar">
            <h3 class="catbg">
               ', $context['subject'], ' ', $txt['related_topics'], '
            </h3>
         </div>
         <div class="tborder topic_table" id="messageindex">
            <table class="table_grid" cellspacing="0">
               <thead>
                  <tr>
                     <td></td>
                  </tr>
               </thead>
               <tbody>';
 
      foreach ($context['related_topics'] as $topic)
      {
         echo '
         <tr>
            <td class="alt1" align="left">
               ', $topic['first_post']['link'],'<br />
               <div style="font-size:13px; margin-top:5px;">
                  ', $topic['first_post']['preview'],'
                  ', $topic['first_post']['devam'],'
               </div><br />
               <div style="margin-top: 0px;"><span class="smalltext">
                  <img src="', $settings['default_theme_url'], '/images/view.gif" alt="" border="0" />
                  ', $txt['views'], ': ', $topic['views'], ' -
                  <img src="', $settings['default_theme_url'], '/images/comments.gif" alt="" border="0" />
                  ', $txt['replies'], ': ', $topic['replies'], ' -
                  <img src="', $settings['default_theme_url'], '/images/user.gif" alt="" border="0" />
                  ', $txt['started_by'], ':', $topic['first_post']['member']['link'], '
               </span></div>
            </td>
         </tr>';
      }
 
      echo '</tbody>
            </table>
         </div>
</div></div>
   <span class="lowerframe"><span></span></span>
<br />';
   }
   // related topics end
 


$boarddir/index.php

Pesquisar
Código: [Seleccione]
'register2' => array('Register.php', 'Register2'),
Adicionar antes
Código: [Seleccione]
'related' => array('Subs-Related.php', 'Related'),
Ficheiros do pacote tem que colocar nos devidos Lugares

    SMF-2.0/Sources/RelatedTopics.php
    SMF-2.0/Sources/Subs-Related.php
    SMF-2.0/Sources/Subs-RelatedFulltext.php
    SMF-2.0/Themes/default/images/comments.gif
    SMF-2.0/Themes/default/images/user.gif
    SMF-2.0/Themes/default/images/view.gif
    SMF-2.0/Themes/default/RelatedTopicsAdmin.template.php


Modifications.portuguese_pt


Código: [Seleccione]
// Added by Related Topics translate by candidosa2
$txt['admin_related_topic'] = 'T&oacute;picos relacionados';
$txt['admin_related_topics_information'] = 'Informa&ccedil;&atilde;o';
$txt['admin_related_topics_settings'] = 'Defini&ccedil;&otilde;es';
$txt['admin_related_topics_methods'] = 'M&eacute;todos';

$txt['related_topics_admin_title'] = 'T&oacute;picos relacionados';
$txt['related_topics_admin_desc'] = '';

$txt['related_latest_news'] = '&Uacute;ltimas Not&iacute;cias';
$txt['related_news_unable_to_connect'] = 'Incapaz de conectar a <a href="http://www.smfarcade.info">SMFArcade.info</a> para o &Uacute;ltimas not&iacute;cias..';
$txt['related_version_info'] = 'Informa&ccedil;&otilde;es sobre a vers&atilde;o';
$txt['related_installed_version'] = 'Instalado Vers&atilde;o';
$txt['related_latest_version'] = 'Vers&atilde;o mais recente';

$txt['related_topics_ignored_boards'] = 'Quadro Ignorado';

$txt['related_topics_methods_title'] = 'M&eacute;todos';
$txt['related_topics_methods'] = 'Escolha m&eacute;todos dos utilizados para determinar t&oacute;picos relacionados<div class="smalltext">Reconstruir do &iacute;ndice &eacute; exigido ap&oacute;s alterar estas defini&ccedil;&otilde;es</div>';

$txt['related_topics_index'] = 'Index';
$txt['related_topics_rebuild'] = 'Reconstruir &iacute;ndices';
$txt['related_topics_rebuild_desc'] = 'Utilize esta configura&ccedil;&atilde;o ou ap&oacute;s a mudan&ccedil;a para a constru&ccedil;&atilde;o inicial cache';

$txt['relatedFulltext'] = 'Fulltext';

$txt['related_topics_settings_title'] = 'T&oacute;picos relacionados';
$txt['relatedTopicsEnabled'] = 'Activar T&oacute;picos relacionados';
$txt['relatedTopicsCount'] = 'Quantos t&oacute;picos relacionados a mostrar';

$txt['no_methods_selected'] = 'Voc&ecirc; n&atilde;o selecionou quais os m&eacute;todos a utilizar para determinar os t&oacute;picos relacionados';

$txt['related_topics'] = 'T&oacute;picos relacionados';
// END Added by Related Topics