sonnb - Live Thread

sonnb - Live Thread 1.2.0

No permission to download
Very cool addon! Thank you!
But is it possible to add not only checking the new messages in thread but the previous too? Cause i still can see messages that were removed by admin or moderators. Of course up to the moment refreshing this page... But that's not quite live thread. If you know what i mean :whistle:
Yes, I know that. At this time, to keep it clear as possible, I do not add that feature yet.
 
I'm using xenforo v 1.2.4 and I get this error:
Fatal error: Call to undefined function mb_convert_encoding() in /home/____/public_html/library/sonnb/LiveThread/Listener.php on line 185
 
I'm using xenforo v 1.2.4 and I get this error:
Fatal error: Call to undefined function mb_convert_encoding() in /home/____/public_html/library/sonnb/LiveThread/Listener.php on line 185
Please re-compile PHP with mb_string is enabled.
 
So I have a version 1.25, it seems alright when I install it but afterwards whenever I post a thread it just returns me with error pages, does anyone know why?
 
I've found a problem with this addon with the TinyMCE Quattro addon or any others addons that will use json string in the html code and when this json string has a single quote in it.

This error is coming from the post render templates modification of this addon. More precisely with the templates "thread_online & thread_view" modifications. It is caused by this code:
PHP:
$content = mb_convert_encoding($content, 'UTF-8', "HTML-ENTITIES");

I've tested two possible workarounds:

First one, replace the code with:
PHP:
$content = mb_convert_encoding(
   htmlentities(
     $content,
     ENT_COMPAT,
     'UTF-8'
   ),
   'UTF-8',
   "HTML-ENTITIES"
);

Second one, replace the code with:
PHP:
$content = htmlspecialchars_decode(utf8_decode(htmlentities($content, ENT_COMPAT, 'UTF-8')));

I haven't made further tests. I don't know if your addon will still work with these replacements. All I know is that your js requests doesn't have any errors with them.

To reproduce the bug with TinyQuattro, just add a smiley with inside its key a single quote, like the cry one :'(
 
I've found a problem with this addon with the TinyMCE Quattro addon or any others addons that will use json string in the html code and when this json string has a single quote in it.

This error is coming from the post render templates modification of this addon. More precisely with the templates "thread_online & thread_view" modifications. It is caused by this code:
PHP:
$content = mb_convert_encoding($content, 'UTF-8', "HTML-ENTITIES");

I've tested two possible workarounds:

First one, replace the code with:
PHP:
$content = mb_convert_encoding(
   htmlentities(
     $content,
     ENT_COMPAT,
     'UTF-8'
   ),
   'UTF-8',
   "HTML-ENTITIES"
);

Second one, replace the code with:
PHP:
$content = htmlspecialchars_decode(utf8_decode(htmlentities($content, ENT_COMPAT, 'UTF-8')));

I haven't made further tests. I don't know if your addon will still work with these replacements. All I know is that your js requests doesn't have any errors with them.

To reproduce the bug with TinyQuattro, just add a smiley with inside its key a single quote, like the cry one :'(

Thank you Cedric. I will take a look on it :).
 
This doesn't work for me anymore. It's been a couple months since I used it so I thought I'd try it again.

Well I've got all my other addons disabled except for Live Thread and I am using the basic xenforo default theme with no edits.

Live Thread still doesn't work for me.
 
This doesn't work for me anymore. It's been a couple months since I used it so I thought I'd try it again.

Well I've got all my other addons disabled except for Live Thread and I am using the basic xenforo default theme with no edits.

Live Thread still doesn't work for me.
Can you give me an enabled thread for testing?
 
Can you give me an enabled thread for testing?
Yeah I'll disable everything and put the default theme up in a minute.

Edit. Works for me now. Not sure why. Didn't really do anything except uninstall, reinstall, set a live forum then unset it.
 
Last edited:
It looks like when I post in a thread sometimes it automatically turns into a Live thread, sometimes it doesn't. Right now it doesn't. I will just have to select all threads as live for now until this is fixed or @******* makes his own version.
 
The following addons no longer work when a live topic thread is enabled as 'Live':

Current Thread Viewers/Browsers

Who Has Read A Thread
Because Live Thread uses different action rather Index so these add-ons simply do not support Live Thread.
Pagination is broken for me in Google Chrome but works fine in Firefox.
How is it?
It looks like when I post in a thread sometimes it automatically turns into a Live thread, sometimes it doesn't. Right now it doesn't. I will just have to select all threads as live for now until this is fixed or @******* makes his own version.
I will not turn automatically. It just cannot.
 
Does the facebook comment, comment individual threads or is it a site-wise comment box?
 
We've found a solution to automatically (without any admin or mod intervention) make any thread in a forum to a live thread if a certain, configurable threshold with new posts per time period has been met.

This is a perfect addition to this wonderful addon, if you do not like to set threads to "live" manually.

I would like to share it with you. I also sent it to sonnb a year ago.

Step 1)

Open the file "sonnb_LiveThread_CronEntry_CleanUp"

Add this function just above the last '}':

PHP:
    public static function runStartNew()
    {
        $time = XenForo_Application::$time;
        $startValue = XenForo_Application::get('options')->sonnb_LiveThread_Starts;
        $startLimit = XenForo_Application::get('options')->sonnb_LiveThread_StartLimit;
 
        if ($startValue && $startLimit)
        {
            $period = $time - $startValue*60;
            $db = XenForo_Application::getDb();
     
            $sql = "SELECT DISTINCT(thread_id), count(thread_id) as thread_count FROM `xf_post` WHERE post_date > $period GROUP BY thread_id";
     
            $stmt  = $db->query($sql);
            foreach ($stmt->fetchAll() as $row)
            {
                if ($row['thread_count'] >= $startLimit)
                {
                    $updateValue = array('sonnb_live_thread' => 1);
                    $updateCondition = "thread_id = ".$row['thread_id'];
                    $db->update('xf_thread', $updateValue, $updateCondition);
                }
            }
        }
    }

Step 2)

Add 2 new ACP options and a cron option.

This is the XML snipped, you cannot use it without the main addon XML file, but you can recreate the options manually from this info:

Code:
  <cron>
    <entry entry_id="sonnb_LiveThreadStarter" cron_class="sonnb_LiveThread_CronEntry_CleanUp" cron_method="runStartNew" active="1"><![CDATA[{"day_type":"dom","dom":["-1"],"hours":["-1"],"minutes":["5","10","15","20","25","30","35","40","45","50","55"]}]]></entry>
  </cron>

    <option option_id="sonnb_LiveThread_StartLimit" edit_format="spinbox" data_type="unsigned_integer" can_backup="1">
      <default_value>3</default_value>
      <edit_format_params>size=4
min=2</edit_format_params>
      <sub_options></sub_options>
      <relation group_id="sonnb_LiveThread" display_order="202"/>
    </option>
    <option option_id="sonnb_LiveThread_Starts" edit_format="spinbox" data_type="unsigned_integer" can_backup="1">
      <default_value>30</default_value>
      <edit_format_params>size=4
max=120</edit_format_params>
      <sub_options></sub_options>
      <relation group_id="sonnb_LiveThread" display_order="201"/>
    </option>

   <phrase title="cron_entry_sonnb_LiveThreadStarter" version_id="115" version_string="1.1.5"><![CDATA[sonnb - Live Thread - Autostarter]]></phrase>
   <phrase title="option_sonnb_LiveThread_StartLimit" version_id="115" version_string="1.1.5"><![CDATA[Start Live-Thread: Posts]]></phrase>

    <phrase title="option_sonnb_LiveThread_StartLimit_explain" version_id="115" version_string="1.1.5"><![CDATA[How many posts have to be published in given period to automatically make the thread a live thread?]]></phrase>

    <phrase title="option_sonnb_LiveThread_Starts" version_id="115" version_string="1.1.5"><![CDATA[Start Live-Thread: Period (minutes)]]></phrase>

    <phrase title="option_sonnb_LiveThread_Starts_explain" version_id="115" version_string="1.1.5"><![CDATA[What time frame in minutes to look at for newly opened posts to start a live thread? Max value=120]]></phrase>

Have fun with your now automatic live threads!
 
Bug with Post Comment 2.0! Can you fix ?? Post Comment is not Displayed with your Addon!
 
Top Bottom