Suggestion Box
Idea related or similar topics

Maybe after each topic we could show 3-5 related topics...this would increase stickiness of forum and user engagement. A bit like Wordpress's related posts plugin.

Maybe after each topic we could show 3-5 related topics...this would increase stickiness of forum and user engagement. A bit like Wordpress's related posts plugin.

Given up on Codoforum :(

@adesh1414127033 on install

got this

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '<> 69 AND p.post_id = t.post_id AND EXISTS (SELECT 1 FROM codo_permissions AS p' at line 1' in /home/sites/#####.co.uk/public_html/sys/CODOF/Search/Search.php:191 Stack trace: #0 /home/sites/######.co.uk/public_html/sys/CODOF/Search/Search.php(191): PDO->prepare('SELECT p.post_...') #1 /home/sites/#####.co.uk/public_html/sites/default/plugins/codo_similar_topics/codo_similar_topics.php(55): CODOF\Search\Search->search() #2 [internal function]: plg_similar_topics->get_similar_topics(Array, Array) #3 /home/sites/####.co.uk/public_html/sys/CODOF/Hook.php(65): call_user_func_array(Array, Array) #4 /home/sites/#####.co.uk/public_html/sys/Controller/forum.php(431): CODOF\Hook::call('on_topic_view', Array) #5 /home/ in /home/sites/####.co.uk/public_html/sys/CODOF/Search/Search.php on line 191
@adesh1414127033 on install got this ```` Fatal error: Uncaught exception &#039;PDOException&#039; with message &#039;SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;&amp;lt;&amp;gt; 69 AND p.post_id = t.post_id AND EXISTS (SELECT 1 FROM codo_permissions AS p&#039; at line 1&#039; in /home/sites/#####.co.uk/public_html/sys/CODOF/Search/Search.php:191 Stack trace: #0 /home/sites/######.co.uk/public_html/sys/CODOF/Search/Search.php(191): PDO-&amp;gt;prepare(&#039;SELECT p.post_...&#039;) #1 /home/sites/#####.co.uk/public_html/sites/default/plugins/codo_similar_topics/codo_similar_topics.php(55): CODOF\Search\Search-&amp;gt;search() #2 [internal function]: plg_similar_topics-&amp;gt;get_similar_topics(Array, Array) #3 /home/sites/####.co.uk/public_html/sys/CODOF/Hook.php(65): call_user_func_array(Array, Array) #4 /home/sites/#####.co.uk/public_html/sys/Controller/forum.php(431): CODOF\Hook::call(&#039;on_topic_view&#039;, Array) #5 /home/ in /home/sites/####.co.uk/public_html/sys/CODOF/Search/Search.php on line 191 ````

Given up on Codoforum :(

edited Jan 3 '16 at 9:17 pm

Make this change

Open sites/default/plugins/codo_similar_topics/codo_similar_topics.php

On line 52,

replace

$search->tid = '<> ' . $info[0]['topic_id'];

with

$search->tid = '!= ' . $info[0]['topic_id'];
Make this change Open sites/default/plugins/codo_similar_topics/codo_similar_topics.php On line 52, replace ``` $search-&amp;gt;tid = &#039;&amp;lt;&amp;gt; &#039; . $info[0][&#039;topic_id&#039;]; ``` with ``` $search-&amp;gt;tid = &#039;!= &#039; . $info[0][&#039;topic_id&#039;]; ```
Necessity is the mother of all inventions!

Will we see this plugin in the next version of codoforum or will this be optional?

Will we see this plugin in the next version of codoforum or will this be optional?

This is optional, we didn't make any repository for plugins otherwise we would have added it there.

This is optional, we didn&#039;t make any repository for plugins otherwise we would have added it there.
Necessity is the mother of all inventions!

Ah ok @admin and I see oh my gosh: Codoforum 4.0!

Ah ok @admin and I see oh my gosh: Codoforum 4.0! https://camo.githubusercontent.com/8e353005cf1cb86aa9cec71a33dfa10b0d7b3d61/687474703a2f2f6936302e74696e797069632e636f6d2f333436397774692e6a7067

@admin is there a way to change the sensitivity of the "relatedness" as at moment the topics the plugin is showing don't look related enough...

@admin is there a way to change the sensitivity of the &quot;relatedness&quot; as at moment the topics the plugin is showing don&#039;t look related enough...

Given up on Codoforum :(

Hi @adesh1414127033 , @hard_as_snails , @RolluS

I download the plugin from https://github.com/evnix/codo_similar_topics. However, after installing the plugin as the guildeline, I can see anything in the side bar. I'm using codo 3.3.1.

I add some commnet into the codo_similar_topics.php for tracking. Should I edit any other things?

<?php

/*
 * @CODOLICENSE
 */

...

echo "Begin test codo similar topic.";
echo "<br />";

defined('IN_CODOF') or die();

class plg_similar_topics{

    function get_similar_topics($info){



            require 'common_words.php';
            $common_words = plg_get_common_words();


            $search = new \CODOF\Search\Search();
            $title=$info[0]['title'];

            //replace double spaces with single space
            $title = str_replace("  ", " ",$title);

            //get all the words in an array
            $words=explode(" ",$title);

            //remove the common words
            $tarray= array_diff($words, $common_words);

            //join the new array
            $title=implode(" OR ", $tarray);            

            $search->str=$title;
            $search->tid = '!= ' . $info[0]['topic_id'];
            $search->pid = '= t.post_id';

            $links=$this->generate_links($search->search());

            $asset = new \CODOF\Asset\Stream();
            $col = new \CODOF\Asset\Collection('head_col');
            $col->addCSS(PLUGIN_DIR . "similar_topics/view.less");
            $asset->addCollection($col);

            //args: plugin_name,view_file,data
            Block::renderView('codo_similar_topics','view.tpl',['topics'=>$links]);


    }


    function generate_links($topics){

        $links=[];
            foreach($topics as $topic){

                $links[]=['link'=>\CODOF\Forum\Forum::getPostURL($topic['topic_id'],$topic['title']),
                          'title'=>$topic['title']];

            }

            return $links;


    }


}

Hook::add('on_topic_view',[ new plg_similar_topics,'get_similar_topics']);


echo "End test codo similar topic.";

Can't see any similar posts, except my comments.

56d7b9d5a3615.png

56d7b9d4f1820.png

Hi @adesh1414127033 , @hard_as_snails , @RolluS I download the plugin from https://github.com/evnix/codo_similar_topics. However, after installing the plugin as the guildeline, I can see anything in the side bar. I&#039;m using codo 3.3.1. I add some commnet into the ```codo_similar_topics.php``` for tracking. Should I edit any other things? ```` &amp;lt;?php /* * @CODOLICENSE */ ... echo &quot;Begin test codo similar topic.&quot;; echo &quot;&amp;lt;br /&amp;gt;&quot;; defined(&#039;IN_CODOF&#039;) or die(); class plg_similar_topics{ function get_similar_topics($info){ require &#039;common_words.php&#039;; $common_words = plg_get_common_words(); $search = new \CODOF\Search\Search(); $title=$info[0][&#039;title&#039;]; //replace double spaces with single space $title = str_replace(&quot; &quot;, &quot; &quot;,$title); //get all the words in an array $words=explode(&quot; &quot;,$title); //remove the common words $tarray= array_diff($words, $common_words); //join the new array $title=implode(&quot; OR &quot;, $tarray); $search-&amp;gt;str=$title; $search-&amp;gt;tid = &#039;!= &#039; . $info[0][&#039;topic_id&#039;]; $search-&amp;gt;pid = &#039;= t.post_id&#039;; $links=$this-&amp;gt;generate_links($search-&amp;gt;search()); $asset = new \CODOF\Asset\Stream(); $col = new \CODOF\Asset\Collection(&#039;head_col&#039;); $col-&amp;gt;addCSS(PLUGIN_DIR . &quot;similar_topics/view.less&quot;); $asset-&amp;gt;addCollection($col); //args: plugin_name,view_file,data Block::renderView(&#039;codo_similar_topics&#039;,&#039;view.tpl&#039;,[&#039;topics&#039;=&amp;gt;$links]); } function generate_links($topics){ $links=[]; foreach($topics as $topic){ $links[]=[&#039;link&#039;=&amp;gt;\CODOF\Forum\Forum::getPostURL($topic[&#039;topic_id&#039;],$topic[&#039;title&#039;]), &#039;title&#039;=&amp;gt;$topic[&#039;title&#039;]]; } return $links; } } Hook::add(&#039;on_topic_view&#039;,[ new plg_similar_topics,&#039;get_similar_topics&#039;]); echo &quot;End test codo similar topic.&quot;; ```` Can&#039;t see any similar posts, except my comments. ![56d7b9d5a3615.png](serve/attachment&amp;amp;path=56d7b9d5a3615.png) ![56d7b9d4f1820.png](serve/attachment&amp;amp;path=56d7b9d4f1820.png)
NguoiAnPhu.com Powered by Codoforum 4.3 (https://github.com/nguoianphu/codoforums-vietnam).

I'm using codo 3.3.1.

The current version is 3.5, it's time for an update.

&amp;gt; I&#039;m using codo 3.3.1. The current version is 3.5, it&#039;s time for an update.

I'm using codo 3.3.1.

The current version is 3.5, it's time for an update.

@James7 Probably better for him to wait until the bugs in 3.5 have been sorted first. There have been a couple that would cause issues atm. I have stayed with 3.4 myself atm until the bugs are fixed or 3.5.1 with the bugs fixed is released (preferably).

&amp;gt;&amp;gt; I&#039;m using codo 3.3.1. &amp;gt;The current version is 3.5, it&#039;s time for an update. @James7 Probably better for him to wait until the bugs in 3.5 have been sorted first. There have been a couple that would cause issues atm. I have stayed with 3.4 myself atm until the bugs are fixed or 3.5.1 with the bugs fixed is released (preferably).

Thank you @James7 and @RonAus ! smile

It works on the 3.4 B19 beta verion. I'm waiting for 3.5.x official release.

Thank you @James7 and @RonAus ! (blush) It works on the 3.4 B19 beta verion. I&#039;m waiting for 3.5.x official release.
NguoiAnPhu.com Powered by Codoforum 4.3 (https://github.com/nguoianphu/codoforums-vietnam).
291
14
6
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft