View Full Version : Forum Display Enhancements - Filter Closed Threads
Vitaly
02-18-2009, 10:00 PM
vb 4.x version here (https://vborg.vbsupport.ru/showthread.php?t=243399)
Description
This product allows to hide closed threads.
Features:
Settings are forum-based
Administrator can setup default state (hide or show)
Administrator can allow user to switch filter setting or make it mandatorySetup
Just import product XML
Configuration
ACP -> Forums & Moderators -> Forum Manager -> edit forum
Find section "Filter Closed Threads settings" and do necessary changes (usually, all ON).
(!) By default, filtering is disabled.
This mod is developped here: http://github.com/rcdesign/vb-filter_closed_threads . Patches are welcome.
history
v0.4
- hope that fixes unserialisation bug, reported by some members
v0.3
- small fixes for guests
- refactoring
- developnent moved to vb3.8
v0.2
- first public release
ppmfic
02-21-2009, 03:25 AM
It's a very useful mod but I have the problem after installed this product. It showed the below warning when opened forumdisplay pages.
Warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in [path]/forumdisplay.php(111) : eval()'d code on line 70
Unable to add cookies, header already sent.
File: .../includes/class_core.php
Line: 3254
Please help me. Thanks in advanced.
Vitaly
02-21-2009, 04:56 AM
Hm... no ideas. Works fine at my 3.8.1+VBSEO production site.
May be, conflicting with other mods?
inciarco
02-21-2009, 11:29 PM
Interesting Mod, Thank You For Sharing It. :up:
Idea For Next Update: It'd be Great to Place some Option for Usergroups Allowed to Use this Mod.
Until then, what Plugins can Admins Edit to Allow Only Certain Usergroups to Use the Mod, and what Codelines should Admins Include? :confused:
Question: How can Admins Activate this Mod in All Forums? (It'd be Nice to Have Also a Global Options to Hide/Show Closed Threads on All Forums). For now, could you please share with us the Two (2) SQL Query Sentencen that Admins can Use to Activate the Options of the Mod (Set them to Yes) on All Forums? :confused:
Imagine Setting Yes to the Two (2) Mod's Options ("Show filter to user?" and "Hide closed threads by default?") for like 500 Forums or more, One by One. :eek:
My Best Regards.
:)
skYfIrE
07-19-2009, 09:26 PM
Hello,
I have this error on only one profile.
Warning: unserialize() expects parameter 1 to be string, array given in [path]/includes/class_userprofile.php(141) : eval()'d code(7) : eval()'d code on line 1
And, on the sub-forum where I use this mod, i have this error :
Warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in [path]/forumdisplay.php(111) : eval()'d code on line 45
After the error message, the forum is displayed without CSS.
I'm running 3.8.2, i deactivated all the mods, including vbseo. And, i still have the error.
For now, i deactivated this mod.
Thanks in advance if you can do something.
Regards,
Frederic
Vitaly
07-19-2009, 10:04 PM
Can't promis fast fix.
What php version and OS used on your server? Anyway, thanks for bug report, I've recorded it into buglist.
skYfIrE
07-20-2009, 05:15 PM
Hello,
Thanks for you reply.
My server is running under Freebsd7 with Apache22, & PHP5.2.10
Regards,
Fred.
bradbeattie
09-28-2009, 07:29 PM
Haven't narrowed down the why yet, but the if ($fct_temp_state != $filterclosedthreads) block can cause a nopermission_loggedin error to display. Just a heads up.
Edit:
More specifically, it seems to be this block:
// update user profile
$vbulletin->userinfo['fct_data']["$foruminfo[forumid]"] =
$filterclosedthreads;
// init user data manager
$fct_userdata =& datamanager_init('User', $vbulletin, ERRTYPE_STANDARD);
$fct_userdata->set_existing($vbulletin->userinfo);
$fct_userdata->save();
unset($fct_userdata, $fct_userid);
whitetigergrowl
10-07-2009, 02:14 AM
I had to disable for much the same reasons. I kept getting an error in the member profiles that seemed to be coming from this mod. Errors went away when this mod was disabled.
Luke Carrier
10-07-2009, 04:56 PM
Can this modification have the ability to order threads (not filter, but sort) the thread listings so that closed threads can be shown at the bottom of the list? If not, could you consider adding this feature please? Been looking everywhere for some way of doing this.
Thanks :)
Zarxrax
11-02-2009, 11:16 PM
I installed this mod and had some problems. It worked GREAT for me, but it caused some users to not be able to view my forums!
Unable to add cookies, header already sent.
File: /public_html/includes/class_core.php
Line: 3277
The users of my forum don't need this mod, but I desperately need it, so is there any way to limit it to only work for my account (administrator)?
Zarxrax
11-30-2009, 10:04 PM
This plugin has a bug in the way it stores the cookie. I don't know enough about the code to be able to fix it, but I found out what is causing the problem.
If you allow the plugin to show the setting to the user, then some users will have a problem where the page wont properly load (the error message in my previous post)
I'm not sure why it only effects some users, but I noticed that the problem didn't effect me. However, one day, without having made any changes to my forum, the problem started effecting me as well.
But anyways, I tried taking out the part of the code that sets the cookie. After I did that, it started working again (but obviously you can't change the setting).
This is the code I removed, so I guess something in this is causing the problem:
if ($foruminfo['forumid'] AND $foruminfo['fct_allow_user_set'])
{
// try to get saved state
if ($vbulletin->userinfo['userid'] > 0)
{
// is state saved by user
$fct_state_saved =
array_key_exists("$foruminfo[forumid]", $vbulletin->userinfo['fct_data'])
? true
: false;
// get saved or default value
$filterclosedthreads =
$fct_state_saved
// saved state
? $vbulletin->userinfo['fct_data']["$foruminfo[forumid]"]
// default state
: $foruminfo['fct_hide_by_default'];
unset($fct_state_saved);
}
if (!empty($vbulletin->GPC['closed']))
{
$fct_temp_state =
$vbulletin->GPC['closed'] == 'hide'
? 1
: 0;
if ($fct_temp_state != $filterclosedthreads)
{
global $usercache;
// update saved state
$filterclosedthreads = $fct_temp_state;
if ($vbulletin->userinfo['userid'] > 0)
{
$fct_userid = $vbulletin->userinfo['userid'];
// update cache
if(isset($usercache["$fct_userid"]))
{
$usercache["$fct_userid"]['fct_data']["$foruminfo[forumid]"] =
$filterclosedthreads;
}
// update user profile
$vbulletin->userinfo['fct_data']["$foruminfo[forumid]"] =
$filterclosedthreads;
// init user data manager
$fct_userdata =& datamanager_init('User', $vbulletin, ERRTYPE_STANDARD);
$fct_userdata->set_existing($vbulletin->userinfo);
$fct_userdata->save();
unset($fct_userdata, $fct_userid);
}
}
unset($fct_temp_state);
}
}
xorex
12-04-2009, 05:13 PM
in admin profile (id 1) error
Warning: unserialize() expects parameter 1 to be string, array given in [path]\includes\class_userprofile.php(141) : eval()'d code(7) : eval()'d code on line 1
другими словами если просматриваю профиль админа (c первым id ) вылазит эта ошибка ((
а в целом все работает
Vitaly
12-30-2009, 05:05 AM
Please, report if attached version solve problems. Note, that it will reset user filters.
xorex
12-30-2009, 12:28 PM
problem solved
Vitaly
01-03-2010, 12:45 PM
Since no more bugs reported, last version moved to release.
Skyline_GT
07-12-2010, 04:33 AM
Is it possible to not hide closed sticky threads?
Vitaly
08-05-2010, 02:12 PM
Sorry, all new features will be added only to vb4.0 branch, if ever.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.