Moderator: Moderators



austin881 wrote:What do you mean by Tag System Mod?

austin881 wrote:I ask because I wrote a little snippet of code that creates a tag cloud based on the phpBB-SEO SEO TOOLKIT - META code which collects all the keywords from every post on the viewtopic pages.

// Send vars to template
$template->assign_vars(array(
// BEGAN - Random Topics by ModernDignity.com
$sql_rand_ary = array(
'SELECT' => 't.topic_title, t.forum_id, t.topic_id, t.topic_last_post_id, t.topic_type',
'FROM' => array(TOPICS_TABLE => 't'),
'ORDER_BY' => 'RAND()',
);
$result_rand = $db->sql_query_limit($db->sql_build_query('SELECT', $sql_rand_ary), 6);
while( $row_rand = $db->sql_fetchrow($result_rand) )
{
$topic_id_rand = $row_rand['topic_id'];
$forum_id_rand = $row_rand['forum_id'];
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
$phpbb_seo->set_url($row_rand['forum_name'], $forum_id_rand, $phpbb_seo->seo_static['forum']);
$phpbb_seo->prepare_iurl($row_rand, 'topic', $row_rand['topic_type'] == POST_GLOBAL ? $phpbb_seo->seo_static['global_announce'] : $phpbb_seo->seo_url['forum'][$forum_id_rand]);
// www.phpBB-SEO.com SEO TOOLKIT END
$view_topic_url_rand = $phpbb_seo->seo_opt['no_dupe']['on'] ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $forum_id_rand . '&t=' . $topic_id_rand . '&start=' . @intval($phpbb_seo->seo_opt['topic_last_page'][$topic_id_rand])) : append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $forum_id_rand . '&t=' . $topic_id_rand);
$template->assign_block_vars('random_topics',array(
'U_TOPIC_RAND' => $view_topic_url_rand,
'TOPIC_TITLE_RAND' => $row_rand['topic_title'],
));
}
$db->sql_freeresult($result_rand);
// ENDED - Random Topics by ModernDignity.com
<!-- INCLUDE overall_footer.html -->
<div class="forabg">
<div class="inner"><span class="corners-top"><span></span></span>
<table class="table1" cellspacing="1">
<thead>
<tr>
<th>RANDOM TOPICS</th>
</tr>
</thead>
<tbody>
<tr class="bg1">
<td valign="top"><!-- BEGIN random_topics --><a href="{random_topics.U_TOPIC_RAND}">{random_topics.TOPIC_TITLE_RAND}</a><!-- IF random_topics.S_ROW_COUNT lt 5 --><hr /><!-- ELSE --><!-- ENDIF --><!-- END random_topics --></td>
</tr>
</tbody>
</table>
<span class="corners-bottom"><span></span></span></div>
</div>





include($phpbb_root_path . 'includes/bbcode.' . $phpEx);include($phpbb_root_path . 'includes/wordcloud.class.' . $phpEx); $sql = "SELECT w.word_text, w.word_count
FROM " . SEARCH_WORDMATCH_TABLE . " m, " . SEARCH_WORDLIST_TABLE . " w
WHERE $post_id_sql
AND w.word_id = m.word_id
$common_sql
ORDER BY w.word_count DESC";
$result = $db->sql_query_limit($sql, min(25, (int) $seo_meta->mconfig['keywordlimit']));
while ( $meta_row = $db->sql_fetchrow($result) ) {
$m_kewrd .= ' ' . $meta_row['word_text'];
}
$db->sql_freeresult($result);
// BEGAN - ModernDignity.com Topic Tags mod
$cloud_result = $db->sql_query_limit($sql, 40);
$cloud = new wordCloud();
while ( $cloud_row = $db->sql_fetchrow($cloud_result) ) {
$cloud->addWord($cloud_row['word_text']); // Basic method of Adding Keywords to wordcloud
}
// $cloud->orderBy('size', 'desc'); // Order the cloud
$myCloud = $cloud->showCloud('array');
foreach ($myCloud as $cloudArray)
{
$template->assign_block_vars('topic_tag_cloud', array(
'TOPIC_TAG' => ' <a href="' . $phpbb_root_path . 'search.' . $phpEx . '?keywords=' . $cloudArray['word'] . '" class="word size' . $cloudArray['range'] . '">' . $cloudArray['word'] . '</a>',
));
}
$db->sql_freeresult($cloud_result);
// ENDED - ModernDignity.com Topic Tags mod
<div class="forabg">
<div class="inner"><span class="corners-top"><span></span></span>
<table class="table1" cellspacing="1">
<thead>
<tr>
<th>TOPIC TAGS</th>
</tr>
</thead>
<tbody>
<tr class="bg1">
<td valign="top"><div class="word"><!-- BEGIN topic_tag_cloud -->{topic_tag_cloud.TOPIC_TAG}<!-- END topic_tag_cloud --></div></td>
</tr>
</tbody>
</table>
<span class="corners-bottom"><span></span></span></div>
</div>



austin881 wrote:I wrote a little snippet of code that creates a tag cloud based on the phpBB-SEO SEO TOOLKIT - META code which collects all the keywords from every post on the viewtopic pages.





Błąd ogólny
SQL ERROR [ mysqli ]
Out of memory (Needed 8387196 bytes) [5]
SQL
SELECT t.topic_title, t.forum_id, t.topic_id, t.topic_last_post_id, t.topic_type FROM (phpbb_topics t, phpbb_posts p) ORDER BY RAND() LIMIT 6
BACKTRACE
FILE: includes/db/mysqli.php
LINE: 163
CALL: dbal->sql_error()
FILE: includes/db/mysqli.php
LINE: 205
CALL: dbal_mysqli->sql_query()
FILE: includes/db/dbal.php
LINE: 170
CALL: dbal_mysqli->_sql_query_limit()
FILE: viewtopic.php
LINE: 707
CALL: dbal->sql_query_limit()
Users browsing this forum: No registered users and 4 guests