Schedule Content XenForo 1.x only

Schedule Content XenForo 1.x only [Paid] 2.0.9

No permission to buy ($20.00)
Hi,

Just purchased this on your site. Great so far, only problem I seem to be having is that once a thread gets made visible by your schedule it becomes permanently unread.

So even if I open the thread and view it, it remains an unread thread?

EDIT:

I'm also a bit confused as to why the query count at the bottom of the page shows 10 queries, and when I click on it, it shows 14. The extra four are two queries for this add-on, one of them the same thing twice? :S
Ok I think I worked out why the extra queries. The moderator bar and navigation templates are not being preloaded, so I made the following change to template.php:

Code:
case 'PAGE_CONTAINER':
$template->preloadTemplate('scheduled_post_navigation_tabs');
$template->preloadTemplate('scheduled_post_moderator_bar');
break;

I then noticed that the query for grabbing the scheduled post count is being run twice so I made the following changes:

I added to the top of template.php just above the template_hook function:

Code:
private static $countScheduleds = null;

Then made the following change to the three instances of code which grab the count:

Code:
        $conditions = array(
           'scheduled_date' => array(">", XenForo_Application::$time)
         );
      
         if(is_null(self::$countScheduleds)) {
           self::$countScheduleds = $scheduledModel->countScheduleds($conditions);
         }
      
         $params += array(
           'viewScheduled' => $scheduledModel->viewScheduledPage(),
           'totalScheduledPosts' => self::$countScheduleds
         );

I can send you the file to see the changes I made if it is easier, makes the add-on more query friendly :)

I have not been able to figure out why the threads are not being marked as read yet though.
Thank you for given suggestion ^^.
 
Thanks for the update, however this is making the query count worse when there are no scheduled posts.
You need to change the following two lines:

FIND:
Code:
protected static $_scheduledCount = 0;

REPLACE WITH:
Code:
protected static $_scheduledCount = null;

FIND:
Code:
if (is_empty(self::$_scheduledCount))

REPLACE WITH:
Code:
if (is_null(self::$_scheduledCount))

Otherwise there are 30-40 extra queries where the count is checked on EVERY template hook.
 
Sorry, feel like I'm picking holes in your add-on. Just want to say it is a great add-on, I could not write it, I'm just trying to debug my site before it goes live at the moment so I am notice things. Hope you don't mind.

Again in template.php:
Code:
$template->preloadTemplate('scheduled_post_thread_view');

SHOULD BE:
Code:
$template->preloadTemplate('ScheduledPost_thread_view_pagenav');

AND:
Code:
$template->preloadTemplate('scheduled_post_thread_create');

SHOULD BE:
Code:
$template->preloadTemplate('ScheduledPost_thread_create');
 
Last edited:
Thanks for the update, still not sure why you don't want to cache the query for grabbing the scheduled count though, your new code will still do the same query about 3 times per page load, as there is no check to see if the scheduled count query has already been run.

:confused:
In latest code I have coded. Disable AddOn 12 queries and enabled AddOn also 12 queries :) Do you check on your site?
 
In latest code I have coded. Disable AddOn 12 queries and enabled AddOn also 12 queries :) Do you check on your site?

Yes but you must click on the link in the footer to see full debug, as the footer query count is output before all queries are finished.

On forum index, I get 11 with add-on disabled and 13 enabled.

This query is run twice (countScheduleds), from XenForo Debug Output page :

Code:
SELECT COUNT(*)
FROM xf_scheduled_post AS scheduled
WHERE (scheduled.scheduled_date > 1390237297)
Run Time: 0.001739

SELECT COUNT(*)
FROM xf_scheduled_post AS scheduled
WHERE (scheduled.scheduled_date > 1390237297)
Run Time: 0.000266
 
I insalled the last version (1.3.1.3 i guess) but I think there is a problem really strange. Yesterday I was able to use the custom time but it was bugged and now I can't use it because it's not visible although I have all permissions. Also, it's weird but I can't set a date and hour when I create a thread, the fields for that are greyed and I can't intreract with them. It works when I have created the thread and when I want to modify it using the option at the top of the thread.
 
I insalled the last version (1.3.1.3 i guess) but I think there is a problem really strange. Yesterday I was able to use the custom time but it was bugged and now I can't use it because it's not visible although I have all permissions. Also, it's weird but I can't set a date and hour when I create a thread, the fields for that are greyed and I can't intreract with them. It works when I have created the thread and when I want to modify it using the option at the top of the thread.
:oops: I will look at. With 1.3.1.3 still beta testing. I didn't decide release in here (Only on my site). Thank you reported ;)
 
I wanted to contact you on your website but my computer is very slow at the moment and due to the fact that I guess your server isn't in the same place as me, I couldn't ^^'
 
I wanted to contact you on your website but my computer is very slow at the moment and due to the fact that I guess your server isn't in the same place as me, I couldn't ^^'
^^! No problem man!.. If you have problem with 1.3.1.3 so should be using previous version ;)
 
Hi @Nobita.Kun ,

Love the add-on. We just installed it and it looks like it has some conflicts with other add-ons or at least is giving us the following DB errors:

Code:
Server Error Log
Error Info
ErrorException: Undefined index: scheduled_state - library/Nobita/ScheduledPost/XenForo/Model/Thread.php:188
Generated By: Denis Dyack, Yesterday at 11:23 PM
Stack Trace

#0 /home/pgweb/public_html/forums/library/Nobita/ScheduledPost/XenForo/Model/Thread.php(188): XenForo_Application::handlePhpError(8, 'Undefined index...', '/home/pgweb/pub...', 188, Array)
#1 /home/pgweb/public_html/forums/library/CTA/FeaturedThreads/AlertHandler/Thread.php(19): Nobita_ScheduledPost_XenForo_Model_Thread->canViewThread(Array, Array)
#2 /home/pgweb/public_html/forums/library/XenForo/Model/Alert.php(234): CTA_FeaturedThreads_AlertHandler_Thread->getContentByIds(Array, Object(bdTagMe_XenForo_Model_Alert), 12, Array)
#3 /home/pgweb/public_html/forums/library/XenForo/Model/Alert.php(77): XenForo_Model_Alert->_getContentForAlerts(Array, 12, Array)
#4 /home/pgweb/public_html/forums/library/XenForo/ControllerPublic/Account.php(73): XenForo_Model_Alert->getAlertsForUser(12, 'fetchPopupItems')
#5 /home/pgweb/public_html/forums/library/XenForo/FrontController.php(347): XenForo_ControllerPublic_Account->actionAlertsPopup()
#6 /home/pgweb/public_html/forums/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#7 /home/pgweb/public_html/forums/index.php(13): XenForo_FrontController->run()
#8 {main}

Request State

array(3) {
  ["url"] => string(205) "http://precursorgames.com/forums/index.php?account/alerts-popup&&_xfRequestUri=%2Fforums%2Findex.php&_xfNoRedirect=1&_xfToken=12%2C1391746766%2C19d9e45d6f16a524e970989514f17a0fd4494d1e&_xfResponseType=json"
  ["_GET"] => array(5) {
    ["account/alerts-popup"] => string(0) ""
    ["_xfRequestUri"] => string(17) "/forums/index.php"
    ["_xfNoRedirect"] => string(1) "1"
    ["_xfToken"] => string(54) "12,1391746766,19d9e45d6f16a524e970989514f17a0fd4494d1e"
    ["_xfResponseType"] => string(4) "json"
  }
  ["_POST"] => array(0) {
  }
}

Any ideas? We have about 6 of these in our database happening about every couple hours or so.

Thanks!
 
Hi @Nobita.Kun ,

Love the add-on. We just installed it and it looks like it has some conflicts with other add-ons or at least is giving us the following DB errors:

Code:
Server Error Log
Error Info
ErrorException: Undefined index: scheduled_state - library/Nobita/ScheduledPost/XenForo/Model/Thread.php:188
Generated By: Denis Dyack, Yesterday at 11:23 PM
Stack Trace

#0 /home/pgweb/public_html/forums/library/Nobita/ScheduledPost/XenForo/Model/Thread.php(188): XenForo_Application::handlePhpError(8, 'Undefined index...', '/home/pgweb/pub...', 188, Array)
#1 /home/pgweb/public_html/forums/library/CTA/FeaturedThreads/AlertHandler/Thread.php(19): Nobita_ScheduledPost_XenForo_Model_Thread->canViewThread(Array, Array)
#2 /home/pgweb/public_html/forums/library/XenForo/Model/Alert.php(234): CTA_FeaturedThreads_AlertHandler_Thread->getContentByIds(Array, Object(bdTagMe_XenForo_Model_Alert), 12, Array)
#3 /home/pgweb/public_html/forums/library/XenForo/Model/Alert.php(77): XenForo_Model_Alert->_getContentForAlerts(Array, 12, Array)
#4 /home/pgweb/public_html/forums/library/XenForo/ControllerPublic/Account.php(73): XenForo_Model_Alert->getAlertsForUser(12, 'fetchPopupItems')
#5 /home/pgweb/public_html/forums/library/XenForo/FrontController.php(347): XenForo_ControllerPublic_Account->actionAlertsPopup()
#6 /home/pgweb/public_html/forums/library/XenForo/FrontController.php(134): XenForo_FrontController->dispatch(Object(XenForo_RouteMatch))
#7 /home/pgweb/public_html/forums/index.php(13): XenForo_FrontController->run()
#8 {main}

Request State

array(3) {
  ["url"] => string(205) "http://precursorgames.com/forums/index.php?account/alerts-popup&&_xfRequestUri=%2Fforums%2Findex.php&_xfNoRedirect=1&_xfToken=12%2C1391746766%2C19d9e45d6f16a524e970989514f17a0fd4494d1e&_xfResponseType=json"
  ["_GET"] => array(5) {
    ["account/alerts-popup"] => string(0) ""
    ["_xfRequestUri"] => string(17) "/forums/index.php"
    ["_xfNoRedirect"] => string(1) "1"
    ["_xfToken"] => string(54) "12,1391746766,19d9e45d6f16a524e970989514f17a0fd4494d1e"
    ["_xfResponseType"] => string(4) "json"
  }
  ["_POST"] => array(0) {
  }
}

Any ideas? We have about 6 of these in our database happening about every couple hours or so.

Thanks!
Its look like missing columns. Have you tried disabled CTA Feature Thread then again :)
 
Its look like missing columns. Have you tried disabled CTA Feature Thread then again :)

Well I can ping @Brogan too but I would rather not disable the Featured Threads add-on as it is really great. Hi @Brogan Looking at the error 2 posts above does this look like a featured thread problem?
 
Last edited:
I am unable to trigger any errors in several installations.
Unfortunately I don't own this add-on so have no idea how it works or what the code is doing.
 
Back
Top Bottom