Tag System Mod & Random Topics

Support for the phpBB3 SEO mods released in the phpBB3 SEO Toolikt forum.

Moderator: Moderators

Tag System Mod & Random Topics

Postby maxwell » Fri Apr 02, 2010 11:28 am

Looking for two modifications, which will work with phpBB SEO, Tag System Mod and Random Topics :)
maxwell
PR0
PR0
 
Posts: 72
Joined: Sun Nov 15, 2009 3:13 pm
Location: NL

Advertisement

Re: Tag System Mod & Random Topics

Postby maxwell » Wed Apr 14, 2010 5:32 pm

bump
maxwell
PR0
PR0
 
Posts: 72
Joined: Sun Nov 15, 2009 3:13 pm
Location: NL

Re: Tag System Mod & Random Topics

Postby austin881 » Thu Apr 15, 2010 6:10 pm

What do you mean by Tag System Mod?

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. (See example in right-hand column: http://www.silveradosierra.com/how-to-a ... do-t3.html)

Random topics wouldn't be too difficult either. Seems rather pointless but if I were you I would just take something like Rich Mcgirr's top five mod and adapt it to be random.
My dev playground: Whoa.co
Appreciate my assistance? You can thank me by linking to my Chevrolet Astro forums.
User avatar
austin881
phpBB SEO Team
phpBB SEO Team
 
Posts: 249
Joined: Wed Oct 28, 2009 12:16 am
Location: Boise, Idaho USA

Re: Tag System Mod & Random Topics

Postby maxwell » Thu Apr 22, 2010 12:46 pm

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

The modification that allows you to create a theme for assigning tags. Tags randomly show up on the main forum page, and on these pages in the footer:
http://strzelnica-konin.com/
http://forum.alldeaf.pl/index.htm , http://rzeznia.eu/ - On this page is a cloud of tags, and random topics

These modifications are configured in the ACP, they are just to phpBB2
http://www.przemo.org/phpBB2/forum/view ... hp?t=65253
http://www.przemo.org/phpBB2/forum/view ... hp?t=81167 - random topic
maxwell
PR0
PR0
 
Posts: 72
Joined: Sun Nov 15, 2009 3:13 pm
Location: NL

Re: Tag System Mod & Random Topics

Postby wolkenkrieger » Sat Apr 24, 2010 3:24 pm

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.


Hello,

this is really cool :o

I'm looking for such functionallity for my forum ... is it possible, to get the code for that, please?

thanks
wolkenkrieger
PR0
PR0
 
Posts: 77
Joined: Sat Nov 03, 2007 4:49 pm

Re: Tag System Mod & Random Topics

Postby maxwell » Wed May 12, 2010 11:02 am

BUMP :)
maxwell
PR0
PR0
 
Posts: 72
Joined: Sun Nov 15, 2009 3:13 pm
Location: NL

Re: Tag System Mod & Random Topics

Postby austin881 » Wed May 12, 2010 1:35 pm

Random Topics hack

OPEN viewtopic.php

FIND
Code: Select all
// Send vars to template
$template->assign_vars(array(

ADD BEFORE
Code: Select all
// 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


OPEN styles/prosilver/template/viewtopic_body.html

FIND
Code: Select all
<!-- INCLUDE overall_footer.html -->

ADD BEFORE
Code: Select all
            <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>

My dev playground: Whoa.co
Appreciate my assistance? You can thank me by linking to my Chevrolet Astro forums.
User avatar
austin881
phpBB SEO Team
phpBB SEO Team
 
Posts: 249
Joined: Wed Oct 28, 2009 12:16 am
Location: Boise, Idaho USA

Re: Tag System Mod & Random Topics

Postby wolkenkrieger » Wed May 12, 2010 2:02 pm

And what's about the Tag Cloud? :mrgreen:
wolkenkrieger
PR0
PR0
 
Posts: 77
Joined: Sat Nov 03, 2007 4:49 pm

Re: Tag System Mod & Random Topics

Postby austin881 » Wed May 12, 2010 2:18 pm

Well its coming... I'm still trying to figure out all the changes I made to make the tag cloud work. It is rather hack-like.

First off, you'll need this...
Attachments
wordcloud.class.php.zip
Put this in root/includes/wordcloud.class.php
(2.38 KiB) Downloaded 172 times
My dev playground: Whoa.co
Appreciate my assistance? You can thank me by linking to my Chevrolet Astro forums.
User avatar
austin881
phpBB SEO Team
phpBB SEO Team
 
Posts: 249
Joined: Wed Oct 28, 2009 12:16 am
Location: Boise, Idaho USA

Re: Tag System Mod & Random Topics

Postby austin881 » Wed May 12, 2010 2:24 pm

OPEN viewtopic.php

FIND
Code: Select all
include($phpbb_root_path . 'includes/bbcode.' . $phpEx);

AFTER ADD
Code: Select all
include($phpbb_root_path . 'includes/wordcloud.class.' . $phpEx);

FIND
Code: Select all
         $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);

AFTER ADD
Code: Select all
         // 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


OPEN styles/prosilver/template/viewtopic_body.html

Put this code wherever you want the tag cloud to display:
Code: Select all
            <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>

My dev playground: Whoa.co
Appreciate my assistance? You can thank me by linking to my Chevrolet Astro forums.
User avatar
austin881
phpBB SEO Team
phpBB SEO Team
 
Posts: 249
Joined: Wed Oct 28, 2009 12:16 am
Location: Boise, Idaho USA

Re: Tag System Mod & Random Topics

Postby maxwell » Wed May 12, 2010 2:49 pm

"The modification allows you to add tags to topics on the forum, and display them in the form of 'clouds' anywhere in the forum" - About this feature I wanted :)
maxwell
PR0
PR0
 
Posts: 72
Joined: Sun Nov 15, 2009 3:13 pm
Location: NL

Re: Tag System Mod & Random Topics

Postby austin881 » Wed May 12, 2010 2:54 pm

You are quoting something that I've never said. This is what I said...

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.
My dev playground: Whoa.co
Appreciate my assistance? You can thank me by linking to my Chevrolet Astro forums.
User avatar
austin881
phpBB SEO Team
phpBB SEO Team
 
Posts: 249
Joined: Wed Oct 28, 2009 12:16 am
Location: Boise, Idaho USA

Re: Tag System Mod & Random Topics

Postby maxwell » Wed May 12, 2010 3:08 pm

What I quoted is a description of the modifications heh :D
I described the PM as modification of the screenshots would look like :)
maxwell
PR0
PR0
 
Posts: 72
Joined: Sun Nov 15, 2009 3:13 pm
Location: NL

Re: Tag System Mod & Random Topics

Postby austin881 » Wed May 12, 2010 5:09 pm

Bye
My dev playground: Whoa.co
Appreciate my assistance? You can thank me by linking to my Chevrolet Astro forums.
User avatar
austin881
phpBB SEO Team
phpBB SEO Team
 
Posts: 249
Joined: Wed Oct 28, 2009 12:16 am
Location: Boise, Idaho USA

Re: Tag System Mod & Random Topics

Postby maxwell » Thu Jun 03, 2010 2:24 pm

After installing the Random Topic of view, the topic I got an error:


Code: Select all
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()



Tag Cloud do not work well, there is a frame but is empty
maxwell
PR0
PR0
 
Posts: 72
Joined: Sun Nov 15, 2009 3:13 pm
Location: NL

Next

Return to phpBB SEO MODS

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 4 guests