Autor Tópico: Google Tagged  (Lida 7330 vezes)

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

Offline candidosa2

  • Suporte Tecnico
  • Fundador
  • *
  • Mensagens: 5072
  • Rank: 1658
  • Sexo: Masculino
  • Suporte
    • Hosting Moçambique
Google Tagged
« em: 30 de Novembro de 2008, 08:48 »
Nome:Google Tagged
Arquivo:google-tagged.zip  Mod em En
Arquivo:google-taggedjmz.zip em Pt
Autor do Mod:n3rve
Type:Feature Enhancement
Autor da Tradução: Candidosa2
Tradução: Pt-Pt
Tradução: Pt-PT-UTF8
Versões: disponível 1.1.3 a 1.1.5
Download em En - http://custom.simplemachines.org/mods/index.php?mod=1245
download em Pt  - attach
Versões: disponível  1.1.7

Testado com tema default Funciona 100%



Offline AlaStar

  • Iniciar SmfPt
  • *
  • Mensagens: 43
  • Rank: 2
Re: Google Tagged
« Responder #1 em: 30 de Novembro de 2008, 21:41 »
não percebi o que é que isto faz, candidosa2 poderá explicar-me ?

Offline candidosa2

  • Suporte Tecnico
  • Fundador
  • *
  • Mensagens: 5072
  • Rank: 1658
  • Sexo: Masculino
  • Suporte
    • Hosting Moçambique
Re: Google Tagged
« Responder #2 em: 30 de Novembro de 2008, 21:50 »
Translate Pt
Citar
Cada vez que um visitante é levada para um tópico por um importante motor de busca (Google / Yahoo / MSN / Ask / AOL / AlltheWeb), esta modificação agarra os termos de pesquisa que foram utilizadas e as armazena


inglesa
Citar
Every time a visitor is brought to a topic by a major search engine (Google/Yahoo/MSN/Ask/AOL/AllTheWeb), this modification grabs the search terms that were used and stores them.


Podes ver aqui...


Offline AlaStar

  • Iniciar SmfPt
  • *
  • Mensagens: 43
  • Rank: 2
Re: Google Tagged
« Responder #3 em: 30 de Novembro de 2008, 22:00 »
Obrigado candidosa2, já percebi o que o mod faz  wink

Offline candidosa2

  • Suporte Tecnico
  • Fundador
  • *
  • Mensagens: 5072
  • Rank: 1658
  • Sexo: Masculino
  • Suporte
    • Hosting Moçambique
Re: Google Tagged
« Responder #4 em: 04 de Março de 2011, 11:26 »
Actualizado

Offline candidosa2

  • Suporte Tecnico
  • Fundador
  • *
  • Mensagens: 5072
  • Rank: 1658
  • Sexo: Masculino
  • Suporte
    • Hosting Moçambique
Re: Google Tagged
« Responder #5 em: 28 de Outubro de 2014, 12:19 »

./Sources/BoardIndex.php

Pesquisar por

Código: [Seleccione]
$context += getMembersOnlineStats($membersOnlineOptions);
Adicionar por baixo

Código: [Seleccione]
// prepare a tag cloud
// now this is complex because the same tag may have been saved multiple times
// deleted topics where tags still remain will be ignored.
global $smcFunc;
loadLanguage('GoogleTagged');
$query = $smcFunc['db_query']('', '
SELECT g.tag, g.id_tag, g.hits, g.status, g.id_topic, t.id_topic
FROM {db_prefix}googletagged as g, {db_prefix}topics as t
WHERE g.id_topic = t.id_topic
AND g.status != 0
GROUP BY g.tag
ORDER BY RAND()
LIMIT 50',
array()
);

// found some tags?
if($smcFunc['db_num_rows']($query) != 0)
{
// create an array for tags
$context['googletagged'] = array();
// cycle through
$highest = 1 ;
$lowest = 999999999999 ; // SO IT FORCES THE FIRST ROW TO BE THE LOWEST
while($row = $smcFunc['db_fetch_assoc']($query)) {
// STORE THE INFO FOR LATER ON
$context['googletagged'][] = $row;
$highest = ($row['hits'] > $highest) ? $row['hits'] : $highest ;
$lowest = ($row['hits'] < $lowest) ? $row['hits'] : $lowest ;
}
// tidy up
unset($row);
// work out the sizes for us
// first the max and min sizes that we can use in %
$maxsize = 200;
$minsize = 100;
// whats the difference - if 0, dividing my zero will cause an error
$diff = ($highest - $lowest == 0) ? 1 : ($highest - $lowest) ;
// evenly step the tags
$steps = ($maxsize - $minsize)/$diff;

// cycle through our tags
foreach ($context['googletagged'] as $key => $row) {
// ADD THE COLUMN FOR SIZE

$context['googletagged'][$key]['size'] = ceil($minsize + ($steps * ($row['hits'] - $lowest)));
$context['googletagged'][$key]['text'] = str_replace("+", " ", $context['googletagged'][$key]['tag']);
}
// tidy up
unset($key,$row,$steps,$highest,$lowest,$maxsize,$minsize);
$smcFunc['db_free_result']($query);
}

./Themes/default/BoardIndex.template.php

Pesquisar

Código: [Seleccione]
template_info_center();

Adicionar por baixo

Código: [Seleccione]
// start the table
echo '<br />
<div class="title_bar">
<h3 class="titlebg">
<span style="margin: 0 auto;">', $txt['googletagged_random50'], '</span>
</h3>
</div>
<div class="windowbg2">
<span class="topslice"><span></span></span>
<div class="content centertext">';

// start our tag cloud
if(isset($context['googletagged']))
{
$i = 1 ;
// write out our tags
foreach($context['googletagged'] as $key => $row)
{
echo '
<a href="', $scripturl , '?action=tagged;id=', $row['id_tag'] ,';tag=', $row['tag'] ,'" style="font-size: '.$row['size'].'%;" title="', $row['text'] ,'">', $row['text'] ,'</a>';
// increase counter until we may need to break
// if divisable by 10 - new line
echo (($i % 10) == 0) ? '<br />' : '';
$i++;
}
// tidy up
unset($i,$key,$row);
} else {
// no tags, so tell the user
echo $txt['googletagged_empty'];
}

// end the table
echo '
</div>
<span class="botslice"><span></span></span>
</div>';