Prefix Forum Listing

Prefix Forum Listing 1.2.5

No permission to download
@yavuz

Yes, you can place thread prefixes on the top of the forum pages. But I am looking to place corresponding thread prefixes beside the forum names on the main/home page. Please look closely at my image. Did I miss something? Is it possible with this addon? o_O
 
I would imagine that it would but have no idea what template change is required that would make that happen.
 
Is there a way to apply this to the parent category/forum and have it be active to all sub forums? I have alot of forums and new forums are created daily as new roleplays are created and this step tends to be forgotten a lot.

Or just a Site wide feature making it active for all forums ever.

Other then that great addon!
 
We have started having the errors below when entering the admin section of this addon after upgrading the php on the server to 5.4

Code:
ErrorException: Array to string conversion - library/XenForo/Model/Node.php:1255
 
Stack Trace
 
#0 [internal function]: XenForo_Application::handlePhpError(8, 'Array to string...', '/home/xxx/...', 1255, Array)
#1 /home/xxx/public_html/library/XenForo/Model/Node.php(1255): strval(Array)
#2 /home/xxx/public_html/library/PrefixForumListing/Option/ForumMultipleChooser.php(31): XenForo_Model_Node->getNodeOptionsArray(Array, Array, '(belirtilmemi??...')
#3 /home/xxx/public_html/library/PrefixForumListing/Option/ForumMultipleChooser.php(65): PrefixForumListing_Option_ForumMultipleChooser::getNodeOptions(Array, '(belirtilmemi??...')
#4 /home/xxx/public_html/library/PrefixForumListing/Option/ForumMultipleChooser.php(8): PrefixForumListing_Option_ForumMultipleChooser::_render('option_list_opt...', Object(XenForo_ViewAdmin_Option_ListOptions), 'options', Array, false)
#5 [internal function]: PrefixForumListing_Option_ForumMultipleChooser::renderSelectM(Object(XenForo_ViewAdmin_Option_ListOptions), 'options', Array, false)
#6 /home/xxx/public_html/library/XenForo/ViewAdmin/Helper/Option.php(327): call_user_func(Array, Object(XenForo_ViewAdmin_Option_ListOptions), 'options', Array, false)
#7 /home/xxx/public_html/library/XenForo/ViewAdmin/Helper/Option.php(71): XenForo_ViewAdmin_Helper_Option::_renderCallbackOptionHtml(Object(XenForo_ViewAdmin_Option_ListOptions), 'options', Array, false)
#8 /home/xxx/public_html/library/XenForo/ViewAdmin/Helper/Option.php(33): XenForo_ViewAdmin_Helper_Option::renderPreparedOptionHtml(Object(XenForo_ViewAdmin_Option_ListOptions), Array, false, 'options')
#9 /home/xxx/public_html/library/XenForo/ViewAdmin/Option/ListOptions.php(30): XenForo_ViewAdmin_Helper_Option::renderPreparedOptionsHtml(Object(XenForo_ViewAdmin_Option_ListOptions), Array, false)
#10 /home/xxx/public_html/library/XenForo/ViewRenderer/Abstract.php(215): XenForo_ViewAdmin_Option_ListOptions->renderHtml()
#11 /home/xxx/public_html/library/XenForo/ViewRenderer/HtmlAdmin.php(63): XenForo_ViewRenderer_Abstract->renderViewObject('XenForo_ViewAdm...', 'Html', Array, 'option_list')
#12 /home/xxx/public_html/library/XenForo/FrontController.php(533): XenForo_ViewRenderer_HtmlAdmin->renderView('XenForo_ViewAdm...', Array, 'option_list', NULL)
#13 /home/xxx/public_html/library/XenForo/FrontController.php(156): XenForo_FrontController->renderView(Object(XenForo_ControllerResponse_View), Object(XenForo_ViewRenderer_HtmlAdmin), Array)
#14 /home/xxx/public_html/admin.php(13): XenForo_FrontController->run()
#15 {main}
 
Request State
array(3) {
["url"] => string(61) "http://xxx.com/admin.php?options/list/prefixForumListing"
["_GET"] => array(1) {
["options/list/prefixForumListing"] => string(0) ""
}
["_POST"] => array(0) {
}
}
 
We have started having the errors below when entering the admin section of this addon after upgrading the php on the server to 5.4

Code:
ErrorException: Array to string conversion - library/XenForo/Model/Node.php:1255
 
Stack Trace
 
#0 [internal function]: XenForo_Application::handlePhpError(8, 'Array to string...', '/home/xxx/...', 1255, Array)
#1 /home/xxx/public_html/library/XenForo/Model/Node.php(1255): strval(Array)
#2 /home/xxx/public_html/library/PrefixForumListing/Option/ForumMultipleChooser.php(31): XenForo_Model_Node->getNodeOptionsArray(Array, Array, '(belirtilmemi??...')
#3 /home/xxx/public_html/library/PrefixForumListing/Option/ForumMultipleChooser.php(65): PrefixForumListing_Option_ForumMultipleChooser::getNodeOptions(Array, '(belirtilmemi??...')
#4 /home/xxx/public_html/library/PrefixForumListing/Option/ForumMultipleChooser.php(8): PrefixForumListing_Option_ForumMultipleChooser::_render('option_list_opt...', Object(XenForo_ViewAdmin_Option_ListOptions), 'options', Array, false)
#5 [internal function]: PrefixForumListing_Option_ForumMultipleChooser::renderSelectM(Object(XenForo_ViewAdmin_Option_ListOptions), 'options', Array, false)
#6 /home/xxx/public_html/library/XenForo/ViewAdmin/Helper/Option.php(327): call_user_func(Array, Object(XenForo_ViewAdmin_Option_ListOptions), 'options', Array, false)
#7 /home/xxx/public_html/library/XenForo/ViewAdmin/Helper/Option.php(71): XenForo_ViewAdmin_Helper_Option::_renderCallbackOptionHtml(Object(XenForo_ViewAdmin_Option_ListOptions), 'options', Array, false)
#8 /home/xxx/public_html/library/XenForo/ViewAdmin/Helper/Option.php(33): XenForo_ViewAdmin_Helper_Option::renderPreparedOptionHtml(Object(XenForo_ViewAdmin_Option_ListOptions), Array, false, 'options')
#9 /home/xxx/public_html/library/XenForo/ViewAdmin/Option/ListOptions.php(30): XenForo_ViewAdmin_Helper_Option::renderPreparedOptionsHtml(Object(XenForo_ViewAdmin_Option_ListOptions), Array, false)
#10 /home/xxx/public_html/library/XenForo/ViewRenderer/Abstract.php(215): XenForo_ViewAdmin_Option_ListOptions->renderHtml()
#11 /home/xxx/public_html/library/XenForo/ViewRenderer/HtmlAdmin.php(63): XenForo_ViewRenderer_Abstract->renderViewObject('XenForo_ViewAdm...', 'Html', Array, 'option_list')
#12 /home/xxx/public_html/library/XenForo/FrontController.php(533): XenForo_ViewRenderer_HtmlAdmin->renderView('XenForo_ViewAdm...', Array, 'option_list', NULL)
#13 /home/xxx/public_html/library/XenForo/FrontController.php(156): XenForo_FrontController->renderView(Object(XenForo_ControllerResponse_View), Object(XenForo_ViewRenderer_HtmlAdmin), Array)
#14 /home/xxx/public_html/admin.php(13): XenForo_FrontController->run()
#15 {main}
 
Request State
array(3) {
["url"] => string(61) "http://xxx.com/admin.php?options/list/prefixForumListing"
["_GET"] => array(1) {
["options/list/prefixForumListing"] => string(0) ""
}
["_POST"] => array(0) {
}
}
open PrefixForumListing_Option_ForumMultipleChooser


search for
PHP:
protected static function _render($templateName, XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit)
{
$preparedOption['formatParams'] = self::getNodeOptions(
$preparedOption['option_value'],
sprintf('(%s)', new XenForo_Phrase('unspecified'))
);
 
return XenForo_ViewAdmin_Helper_Option::renderOptionTemplateInternal(
$templateName, $view, $fieldPrefix, $preparedOption, $canEdit, array('multiple')
);
}
replace with

PHP:
protected static function _render($templateName, XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit)
{
$preparedOption['formatParams'] = self::getNodeOptions(
$preparedOption['option_value']
);
 
return XenForo_ViewAdmin_Helper_Option::renderOptionTemplateInternal(
$templateName, $view, $fieldPrefix, $preparedOption, $canEdit, array('multiple')
);
}


try this pls:)
 
that's one of the GOOD CHANGES in php 5.4

previous versions of php ignored this "bug" and developers were "never" able to find it:D
 
open PrefixForumListing_Option_ForumMultipleChooser


search for
PHP:
protected static function _render($templateName, XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit)
{
$preparedOption['formatParams'] = self::getNodeOptions(
$preparedOption['option_value'],
sprintf('(%s)', new XenForo_Phrase('unspecified'))
);
 
return XenForo_ViewAdmin_Helper_Option::renderOptionTemplateInternal(
$templateName, $view, $fieldPrefix, $preparedOption, $canEdit, array('multiple')
);
}
replace with

PHP:
protected static function _render($templateName, XenForo_View $view, $fieldPrefix, array $preparedOption, $canEdit)
{
$preparedOption['formatParams'] = self::getNodeOptions(
$preparedOption['option_value']
);
 
return XenForo_ViewAdmin_Helper_Option::renderOptionTemplateInternal(
$templateName, $view, $fieldPrefix, $preparedOption, $canEdit, array('multiple')
);
}


try this pls:)


I did this and now I get a blank page instead of an error, any ideas?
 
FYI-- I made a quick fix for this when it wasn't hiding 0-count prefixes properly (when I had the setting configured to hide prefixes with no total). The problem is that it would hide the minimum total prefixes on first view, but when the cache was updated it would show them as (0) and ignore the "pfl_donotshow_totalthreads" option.

(I.e. the problem discussed here.)

So I just moved the test into the cached section:

library\PrefixForumListing\Extend\ControllerPublic\Forum.php
Code:
                    else
                    {
                            $prefix['totalThreads'] = $totalThreadsCache[$prefix['prefix_id']];                                           
                    }

becomes
Code:
                    else
                    {
                        if ($options->pfl_showTotalThreads == 0 || ($options->pfl_showTotalThreads > 0 && $totalThreadsCache[$prefix['prefix_id']]  >= $options->pfl_donotshow_totalthreads))
                        {
                            $prefix['totalThreads'] = $totalThreadsCache[$prefix['prefix_id']];                                           
                        }
                        else
                        {                   
                            unset($prefixes[$key]);
                        }                   
                    }

Hopefully this helps.
 
FYI-- I made a quick fix for this when it wasn't hiding 0-count prefixes properly (when I had the setting configured to hide prefixes with no total). The problem is that it would hide the minimum total prefixes on first view, but when the cache was updated it would show them as (0) and ignore the "pfl_donotshow_totalthreads" option.

So I just moved the test into the cached section:

library\PrefixForumListing\Extend\ControllerPublic\Forum.php
Code:
                    else
                    {
                            $prefix['totalThreads'] = $totalThreadsCache[$prefix['prefix_id']];                                           
                    }

becomes
Code:
                    else
                    {
                        if ($options->pfl_showTotalThreads == 0 || ($options->pfl_showTotalThreads > 0 && $totalThreadsCache[$prefix['prefix_id']]  >= $options->pfl_donotshow_totalthreads))
                        {
                            $prefix['totalThreads'] = $totalThreadsCache[$prefix['prefix_id']];                                           
                        }
                        else
                        {                   
                            unset($prefixes[$key]);
                        }                   
                    }

Hopefully this helps.

Is this a fix for the fact that the addon throws an error?
 
Top Bottom