0 Membros e 4 Visitantes estão a ver este tópico.
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
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.
$context += getMembersOnlineStats($membersOnlineOptions);
// 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); }
template_info_center();
// 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>';