ToggleME

ToggleME 3.1.4

No permission to download
First off, thanks for a great add-on. My users love being able to collapse the forum lists. The one thing they keep asking about is keeping the collapsed state. Is it possible to make the cookie persist past log out, or is ToggleMe using the an xf cookie that is destroyed?
 
First off, thanks for a great add-on. My users love being able to collapse the forum lists. The one thing they keep asking about is keeping the collapsed state. Is it possible to make the cookie persist past log out, or is ToggleMe using the an xf cookie that is destroyed?
You can already closed by default the categories you want (see the options).
For the cookie, it's using the XenForo cookies, so when the user logs out, the xf cookies are destroyed.
 
May I make a request please?
This addon is lovely on AVForums. I'm using it on category strips and the postbit.
The default state of the postbit is closed as this is neater when viewing threads.
However, the moderators have requested that the default state for them is open so they can see users' details without clicking each toggle.
Could it be possible to define the default state for each usergroup? Open/closed?
Thanks
 
  • Like
Reactions: rdn
May I make a request please?
This addon is lovely on AVForums. I'm using it on category strips and the postbit.
The default state of the postbit is closed as this is neater when viewing threads.
However, the moderators have requested that the default state for them is open so they can see users' details without clicking each toggle.
Could it be possible to define the default state for each usergroup? Open/closed?
Thanks
I don't have really time to do something I will not use, but you can easily tweak this addon using the XenForo visitor object
PHP:
$visitor = XenForo_Visitor::getInstance();
to modify the $state variable (line 13) of this file.
 
I don't have really time to do something I will not use, but you can easily tweak this addon using the XenForo visitor object
PHP:
$visitor = XenForo_Visitor::getInstance();
to modify the $state variable (line 13) of this file.
Thank you. I replaced line 13 with this code:
PHP:
                $visitor = XenForo_Visitor::getInstance();
                $visitorUserGroupIds = array_merge(array((string)$visitor['user_group_id']), (explode(',', $visitor['secondary_group_ids'])));
                if (in_array(4,$visitorUserGroupIds)) {
                    $state = 1;
                } else {
                    $state = ($options->toggleME_Usergroups_Postbit_State == 'opened') ? 1 : 0;
                }
When I view posts as a moderator, the ToggleMe icon is a minus sign implying that the state is correctly set to open. However, the user details are hidden. To see them, I have to toggle twice to close and then re-open them.
Am I doing something wrong?
 
I have a problem with 2.2 version. Give me a error:
Code:
ErrorException: array_intersect() [<a href='function.array-intersect'>function.array-intersect</a>]: Argument #2 is not an array - library/Sedo/ToggleME/Listener.php:465
 
I have a problem with 2.2 version. Give me a error:
Code:
ErrorException: array_intersect() [<a href='function.array-intersect'>function.array-intersect</a>]: Argument #2 is not an array - library/Sedo/ToggleME/Listener.php:465
Was it during the installation or even after that? The second argument of the function is a XenForo option (type: array). I will add anyway a line of code to avoid this.
 
If anyone here is a fan of Fontawesome, I just replaced the standard ToggleMe sprite elements with Fontawesome icons.
Note that I only use Toggleme for the category and postbit. Anyone wanting to use it elsewhere will need to tweak the code.

Put this in your EXTRA.css:
Code:
/*  replace ToggleMe images with fontawesome    */
.tglWchild.active:before, .tglPosbit.active:before {
    content: "\f147 ";
    font-family: fontawesome;
    font-size: 18px;
    line-height: 18px;
    opacity: 0.3;
}
.tglWchild.inactive:before, .tglPosbit.inactive:before {
    content: "\f196 ";
    font-family: fontawesome;
    font-size: 18px;
    line-height: 18px;
    opacity: 0.3;
}
Edit toggleme_manual.css and remove the background, width and height elements. E.g.
Code:
    background-image: url('@imagePath/xenforo/widgets/toggle-sprite.png');
    background-position: 0px -16px;
    width: 16px;
    height: 16px;
^^^ remove.
And you will almost certainly need to tweak the margins.
Anyhow, here it is working on AVForums and I hope this is useful.
Category: http://www.avforums.com/forums/
Postbit: http://www.avforums.com/threads/the-amazing-spider-man-2-2014.1689688/
 
Last edited:
ErrorException: Undefined index: visitorUserGroupIds - library/Sedo/ToggleME/Listener.php:304
Generated By: Unknown Account, 16 minutes ago
Stack Trace
#0 /home/harpoong/public_html/forum/library/Sedo/ToggleME/Listener.php(304): XenForo_Application::handlePhpError(8, 'Undefined index...', '/home/harpoong/...', 304, Array)
#1 [internal function]: Sedo_ToggleME_Listener::template_postrender('thread_view', '???????????????...', Array, Object(XenForo_Template_Public))
#2 /home/harpoong/public_html/forum/library/XenForo/CodeEvent.php(58): call_user_func_array(Array, Array)
#3 /home/harpoong/public_html/forum/library/XenForo/Template/Abstract.php(195): XenForo_CodeEvent::fire('template_post_r...', Array, 'thread_view')
#4 /home/harpoong/public_html/forum/library/XenForo/Template/Public.php(110): XenForo_Template_Abstract->render()
#5 /home/harpoong/public_html/forum/library/XenForo/ViewRenderer/HtmlPublic.php(119): XenForo_Template_Public->render()
#6 /home/harpoong/public_html/forum/library/XenForo/FrontController.php(604): XenForo_ViewRenderer_HtmlPublic->renderContainer(Object(XenForo_Template_Public), Array)
#7 /home/harpoong/public_html/forum/library/XenForo/FrontController.php(158): XenForo_FrontController->renderView(Object(XenForo_ControllerResponse_View), Object(XenForo_ViewRenderer_HtmlPublic), Array)
#8 /home/harpoong/public_html/forum/index.php(13): XenForo_FrontController->run()
#9 {main}

24 pages of error logs.
 
Just installed now, using the latest version, got this when opening a thread:

An exception occurred: array_intersect(): Argument #1 is not an array in /home/phcorner/public_html/library/Sedo/ToggleME/Listener.php on line 477

  1. XenForo_Application::handlePhpError()
  2. array_intersect() in Sedo/ToggleME/Listener.php at line 477
  3. Sedo_ToggleME_Listener::forcePostbitExtraInfoDisplay() in Sedo/ToggleME/Listener.php at line 304
  4. Sedo_ToggleME_Listener::template_postrender()
  5. call_user_func_array() in XenForo/CodeEvent.php at line 58
  6. XenForo_CodeEvent::fire() in XenForo/Template/Abstract.php at line 195
  7. XenForo_Template_Abstract->render() in XenForo/Template/Public.php at line 110
  8. XenForo_Template_Public->render() in XenForo/ViewRenderer/HtmlPublic.php at line 119
  9. XenForo_ViewRenderer_HtmlPublic->renderContainer() in XenForo/FrontController.php at line 604
  10. XenForo_FrontController->renderView() in XenForo/FrontController.php at line 158
  11. XenForo_FrontController->run() in /home/phcorner/public_html/index.php at line 13
 
ERRORS :
array_intersect(): Argument #1 is not an array
2 dakika önce - library/Sedo/ToggleME/Listener.php:477
Sil...
array_intersect(): Argument #1 is not an array
2 dakika önce - library/Sedo/ToggleME/Listener.php:477
Sil...
array_intersect(): Argument #1 is not an array
5 dakika önce - library/Sedo/ToggleME/Listener.php:477
Sil...
array_intersect(): Argument #1 is not an array
5 dakika önce - library/Sedo/ToggleME/Listener.php:477
Sil...
array_intersect(): Argument #1 is not an array
10 dakika önce - library/Sedo/ToggleME/Listener.php:477
Sil...
array_intersect(): Argument #1 is not an array
11 dakika önce - library/Sedo/ToggleME/Listener.php:477
Sil...
array_intersect(): Argument #1 is not an array
22 dakika önce - library/Sedo/ToggleME/Listener.php:477
Sil...

Details of an error:
Error Info
ErrorException: array_intersect(): Argument #1 is not an array - library/Sedo/ToggleME/Listener.php:477
Generated By: kemalsen1999, 3 dakika önce
Stack Trace
#0 [internal function]: XenForo_Application::handlePhpError(2, 'array_intersect...', '/home/xxx/p...', 477, Array)
#1 /home/xxxx/public_html/forum/library/Sedo/ToggleME/Listener.php(477): array_intersect(false, Array)
#2 /home/xxxx/public_html/forum/library/Sedo/ToggleME/Listener.php(304): Sedo_ToggleME_Listener::forcePostbitExtraInfoDisplay(Array)
#3 [internal function]: Sedo_ToggleME_Listener::template_postrender('thread_view', '???????????????...', Array, Object(XenForo_Template_Public))
#4 /home/xxxx/public_html/forum/library/XenForo/CodeEvent.php(58): call_user_func_array(Array, Array)
#5 /home/xxxx/public_html/forum/library/XenForo/Template/Abstract.php(195): XenForo_CodeEvent::fire('template_post_r...', Array, 'thread_view')
#6 /home/xxxx/public_html/forum/library/XenForo/Template/Public.php(110): XenForo_Template_Abstract->render()
#7 /home/xxxx/public_html/forum/library/XenForo/ViewRenderer/HtmlPublic.php(119): XenForo_Template_Public->render()
#8 /home/xxxx/public_html/forum/library/XenForo/FrontController.php(604): XenForo_ViewRenderer_HtmlPublic->renderContainer(Object(XenForo_Template_Public), Array)
#9 /home/xxxx/public_html/forum/library/XenForo/FrontController.php(158): XenForo_FrontController->renderView(Object(XenForo_ControllerResponse_View), Object(XenForo_ViewRenderer_HtmlPublic), Array)
#10 /home/xxxx/public_html/forum/index.php(13): XenForo_FrontController->run()
#11 {main}
Request State
array(3) {
["url"] => string(91) "http://www.xxxx.com/forum/threads/xxxx.844525/page-11"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}
Need Fix ....
 
Top Bottom