vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Selective Forum Filter (https://vborg.vbsupport.ru/showthread.php?t=79883)

akanevsky 04-12-2005 10:00 PM

Selective Forum Filter
 
/*================================================= =====================*\
|| Selective Forum Filter for vBulletin 3.0.3 - 3.0.7
|| Author : Psionic Vision
\*================================================ ======================*/

What's That For:
It enables your forum users to selectively hide various forums from the forum list and from search by using the new "Edit Forum Visibility Mode" on the index page of your forums.
When hidden, users can access those forums using direct url, or using the edit mode.
The user will still be able to access his hidden forums by using direct url, and he will be able to search from within them.

1.07
[+] Bugfix release..

1.06
[+] Now you can also enter visibility edit mode in subforums. That is useful when there are many forum levels and thus not all of them are accessible from forumhome.
[+] Edit mode is now saved into cookie, so until you either exit from that mode or close your browser, your state will be saved between pages :)

1.05
Two more template changes that were forgotten about in 1.04.

1.04
Major Update! The confusing type-in-digits text field in the user profile is no more. Now, to edit forum visibility, user must simply click on a new link, and that link will take him to the edit interface. See screenshots.

Note: Of course, guests will not be able to access that mode.

1.03
Once again the manual has been corrected... :(

1.02
[BugFix] The subforums now get hidden as well (subforums are the list of forums that are outside your forum depth view).

1.01
My apologies - The manual has been incomplete. A query and a step were missing.
This time everything is fixed :)

1.00
First Public Release

P.S. I do not think there is a screenshot needed here, because the only visual thing the hack does is a new field in user options panel.

I WILL ONLY PROVIDE SUPPORT IF YOU CLICK INSTALL

j_86 04-13-2005 07:01 PM

I'll stick with https://vborg.vbsupport.ru/showthread.php?t=77687 - but good to see some variations :)

Marco van Herwaarden 04-13-2005 07:06 PM

Just 1 remark. If i understand it correct a user can give a list of comma seperated forumid's.

The following however would turn the user input into an integer (so no list of comma seperated values anymore). Didn't install this, but just did a quick look at the code:
PHP Code:

    globalize($_POST, array('excludeforumids' => INT)); 


akanevsky 04-13-2005 07:14 PM

Jimpsed,
Alright, I don't mind. :squareeyed: Besides, when I was making this hack I did not know something like this exists already :)

Fixed, thanks.

Ghostsuit 04-13-2005 07:41 PM

Quote:

Originally Posted by JimpsEd
I'll stick with https://vborg.vbsupport.ru/showthread.php?t=77687 - but good to see some variations :)

emm not to be a bit confused but where did you get the file since there is no hack there only the idea of one? :S

I'm probably missing something.

Allan 04-13-2005 09:05 PM

not badly, beautiful job, that can be very useful in certain situation, thank you has you :)

ps: you should add a "screen" directly in this thread ;)

Lionel 04-13-2005 09:19 PM

Letting user type is a bad idea. Can it be like the image in second post?

akanevsky 04-13-2005 09:24 PM

No worries.
He can only type what he should type :) And there is no way around typing only digits separated by commas :)

P.S >> If you are talking about the image in the OTHER thread, yes it can be done. However, it would require enabled JavaScript to work, and it just wouldn't if JS was off... So no, sorry, but I won't do it the graphic way.

Lionel 04-13-2005 09:27 PM

I learn that which seems easy for us is not for others. I can already see myself bombarded with emails: "How do I know the forum id?". It's also easier to select when you have a visual.

akanevsky 04-13-2005 09:29 PM

As I said, many people have javascript off. Therefore, you could then get bombarded with email "why won't that thing work". Besides, you could put the explanation about the ID into the phrase that is used to describe that field...

kall 04-13-2005 11:24 PM

It would appear that this hack wants a field that doesn't exist in my database.

Might be an idea to include this information in the readme. :)

kall 04-13-2005 11:30 PM

And even when having a field in the user table called excludeforumids .. it doesn't do anything.

I was wondering how it could, when forumdisplay.php nor forumhome.php are changed.

akanevsky 04-13-2005 11:33 PM

Uh, damn, yea I forgot about that. Hold on, I shall fix the readme.

akanevsky 04-13-2005 11:46 PM

Manual has been updated :)

kall 04-14-2005 02:20 AM

Quote:

Originally Posted by Dark Visor
Manual has been updated :)

Ah yes, it works for forumdisplay now...not for sub-forums on ForumHome though.

kall 04-14-2005 02:27 AM

Ahh.
Also in functions_forumlist.php find:
PHP Code:

else
            { 
// get on/off status
                
$lastpostinfo $forumcache["$lastpostarray[$forumid]"]; 

above, add the code you added in the other bit. :)

And it works 100% PERFECTION! I don't need to delete any Forums now. :)

GamerzWorld 04-14-2005 11:39 AM

Quote:

Originally Posted by kall
Ahh.
Also in functions_forumlist.php find:
PHP Code:

else
            { 
// get on/off status
                
$lastpostinfo $forumcache["$lastpostarray[$forumid]"]; 

above, add the code you added in the other bit. :)

And it works 100% PERFECTION! I don't need to delete any Forums now. :)

Can you explain that change abit more

kall 04-14-2005 11:48 AM

The first change only hides the forums on Forumdisplay...the one I mention hides them on ForumHome (if they are subforums, they would show if you don't apply my bit).

The code to insert is the same as you inserted as per the hack instructions, you just have to insert it again where I said to.

akanevsky 04-14-2005 06:18 PM

For some strange reason, on my board it does hide the forum from forumhome, only with my chunk of code. And I don't really understand why wouldn't it work on yours... What version of vB do you have?

kall 04-14-2005 11:05 PM

Quote:

Originally Posted by Dark Visor
For some strange reason, on my board it does hide the forum from forumhome, only with my chunk of code. And I don't really understand why wouldn't it work on yours... What version of vB do you have?

3.0.7..

It doesn't hide subforums without the bit I added.

What depth of subforums are you displaying?

akanevsky 04-14-2005 11:42 PM

Umm... What exactly do you mean by "sub"forums?
The way I did it, it hides every forum starting from the one your specified.

On my board, there is only one depth level.

akanevsky 04-14-2005 11:48 PM

Oh! Now I understand what you are talking about! And what the code is for, too. Thanks. I'll add that.

akanevsky 04-14-2005 11:58 PM

Manual has been updated once more :) Thanks, kall.

kall 04-15-2005 12:04 AM

Quote:

Originally Posted by Dark Visor
Manual has been updated once more :) Thanks, kall.

Did you catch the search.php error that causes each forum to show up twice if not in the excluded array? ;)

In the install file,
HTML Code:

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ADD AFTER
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

                if (!in_array($forumid, explode(',', $bbuserinfo['excludeforumids'])))
                {
                        eval('$searchforumbits .= "' . fetch_template('option') . '";');
                }

Should be:
HTML Code:

FIND

eval('$searchforumbits .= "' . fetch_template('option') . '";');

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
REPLACE WITH
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

                if (!in_array($forumid, explode(',', $bbuserinfo['excludeforumids'])))
                {
                        eval('$searchforumbits .= "' . fetch_template('option') . '";');
                }

As far as I can see, logically, the way you had it, it said: "If the forum is not in the excluded list, and the member has permission to see it, show it in the list of available forums to search. Then, If the member has permission to see it, show it in the list of available forums to search."

The way I have it, it is saying ONLY "If the forum is not in the excluded list, and the member has permission to see it, show it in the list of available forums to search."

akanevsky 04-15-2005 12:43 AM

lol. yeah you are right :)))) Idk, I was probably rushing through the code.

akanevsky 04-15-2005 12:46 AM

Actually... I only see one instance of that eval in my search.php
Are you sure you did everything right?

akanevsky 04-15-2005 12:50 AM

Nevermind. The thing is, I have modded my file, but forgot the fact that the line was originally there :)

kall 04-15-2005 07:04 AM

Quote:

Originally Posted by Dark Visor
Nevermind. The thing is, I have modded my file, but forgot the fact that the line was originally there :)

All good man, I am happy I was able to help squash these little bug. :)

Cyricx 04-15-2005 11:45 AM

Very very nice, I'll have to test this one out. I do something with the $hidden_forums array right now, but this is much cleaner.

I wonder how one could go about making a small link to disable a forums display...

Then people could just click the link for the forums they want to hide while viewing forumhome.

Aurous 04-15-2005 10:47 PM

Any chance of having a multiple check-box with all forums listed? So users can conveniently select the forums they want to hide? That will really complete this hack.

Anyways, good work.

akanevsky 04-15-2005 11:21 PM

I have a better idea. How about.. hmm...
Cyrixc - good idea. How about making a link which would hide the forum, and then... Make a link which would show aLL the forums, but the hidden ones would have UNHIDE link on them :) Hehe. How about that?

weaver 04-16-2005 10:48 PM

Quote:

Originally Posted by Aurous
Any chance of having a multiple check-box with all forums listed? So users can conveniently select the forums they want to hide? That will really complete this hack.

Anyways, good work.

Quote:

Originally Posted by Dark Visor
I have a better idea. How about.. hmm...
Cyrixc - good idea. How about making a link which would hide the forum, and then... Make a link which would show aLL the forums, but the hidden ones would have UNHIDE link on them :) Hehe. How about that?

Excellent ideas. I'd definitely install if either of these ideas is included. But for now I'm going to wait. I know my members too well and the current method would be too confusing for them. Great hack though. :)

akanevsky 04-17-2005 02:39 PM

UPDATED, YAY!
NOW THERE ARE SCREENSHOTS, YAY! ^^

To upgrade:
- Void any template changes you made in previous version
- Void any phrases you created in previous version
- Void changes made in profile.php
- Void changes made in functions_forumslist.php

- Make new template changes
- Add new phrases
- Make changes in index.php
- Make new changes in functions_forumslist.php

Lionel 04-17-2005 04:11 PM

Look at screenshot to see what is happening to my subforums. All the names disappeared on forumhome.

akanevsky 04-17-2005 04:51 PM

Make sure you did the forumhome_subforumbit_post template right.
If you think you did, post its contents here.

akanevsky 04-17-2005 04:57 PM

It seems like you have some hack installed there. Probably the "forum names in columns"... Anyways, post the template here. Because it might be in conflict w/ that other hack.

Lionel 04-17-2005 05:01 PM

here are the contents

Quote:

<if condition="$_REQUEST['e'] == 1 AND $bbuserinfo[userid]">
<input type="checkbox" name="showhideforums[]" value="$forum[forumid]" ${showhideforums_checked[$forum[forumid]]} />
<else />
<img class="inlineimg" src="$stylevar[imgdir_statusicon]/subforum<if condition="$forum['postanon']!='0'">anon</if>_$forum[statusicon].gif" alt="" /> <a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]"><span class="smallfont">$forum[title]</span></a></if>

Lionel 04-17-2005 05:02 PM

Looks like I closed the conditional too far.

That was it....

Beautiful Hack!!!!!

akanevsky 04-17-2005 05:05 PM

Yes. Fix it like this :):

HTML Code:

<if condition="$_REQUEST['e'] == 1 AND $bbuserinfo[userid]">
<input type="checkbox" name="showhideforums[]" value="$forum[forumid]" ${showhideforums_checked[$forum[forumid]]} />
<else />
<img class="inlineimg" src="$stylevar[imgdir_statusicon]/subforum<if condition="$forum['postanon']!='0'">anon</if>_$forum[statusicon].gif" alt="" /></if> <a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]"><span class="smallfont">$forum[title]</span></a>

And thanks :)

Lionel 04-17-2005 05:09 PM

I also had to add it to 'forumhome_forumbit_level1_post'


All times are GMT. The time now is 04:45 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01353 seconds
  • Memory Usage 1,839KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_html_printable
  • (3)bbcode_php_printable
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete