vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   vBPrivate Threads (https://vborg.vbsupport.ru/showthread.php?t=109096)

Eikinskjaldi 02-27-2006 10:00 PM

vBPrivate Threads
 
vBPrivate Threads

This hack has been ported to vBulletin 3.5.4 from the vBulletin 3.0.0 version with permission granted by:
Quote:

"You may modify, improve, upgrade, redistribute this hack, include it
in another hack or yours or translate it provided you do it free of
charge and you distribute it in www.vbulletin.org at least, there is no
need to pm me asking for permission"
in Kentaurus's post for its original release, found here

--------------------------------------------------------
This is my first major ported and released hack for vB.
--------------------------------------------------------

With this Code Modification you can add private threads to your forums. A private thread is:
  • A thread that some users or usergroups can view. Others cannot.
  • A thread that some users or usergroups cannot view. All others can.

Using this Modification, any user in a forum that has Private Threads turned on may create a private thread. It is useful for holding private moderator conversations, or for making a thread private when some users would like to see the discussion closed and others want it to continue.

Future Plans:
  • Add Super Moderators and Moderators to override the standard permissions
  • Admin Options for allowed private thread types
  • Admin Options to define users with override-permissions privilages
  • Admin Options for those who can make private threads
  • Private Threads will NOT show in the lastpost column when user does not have access to thread
  • Creator can view thread by default

Hack History:

Version 1.0.6
  • Changed several file edits to plugins (Thank you waza)
  • Some plugins were reverted back to file edits, no version change as it is going a bit backward
Version 1.0.5
  • Updated queries for install
  • Added queries for uninstall
  • 1 Added Plugin
  • Fixed copy/paste errors in file edits find/change
  • Added missing printthread edit
  • Fixed Search problem
Version 1.0.0
  • Initial release

Hack Overview:
  • Products: 1
    • 2 Queries
    • 1 Phrase
    • 13 Plugins
  • File Edits: 5 files (7 edits)
  • Template Edits: 3
  • Estimated Install time: Under 10 minutes

If you liked this hack then please Install it! :D

G-Force 199 02-28-2006 03:48 AM

Installed.
Thank you :D

wholemama 02-28-2006 05:45 AM

First and foremost...THANK YOU!!!

*****************************

I'm getting an error when we try to call the search function (as in when we click New Posts)...

Fatal error: Call to undefined function: private_thread_not_allowed() in /.../search.php on line 1823

Same happens in the other instantiation of the function on line 2224. Commented those out for now

****************************

The product doesn't seem to create the 'allowprivate' field...added that manually to the DB and then manually adjusted it as needed for my interim solution

***************************

When I try to edit a thread, I get...

Parse error: parse error, unexpected $ in /.../postings.php on line 2327

In the second portion of code added to postings.php, it's missing the closing } for the if statement

******************************

When I edit a thread that's been private...if I had more than one name saved originally in the allowed/denied list, when it pulls them back in, it only brings back the first name in the list.

Eikinskjaldi 02-28-2006 06:30 AM

That's unexpected behavior, and I have it running just fine on my main board and test board. I'll install it on my test board again tonight and get back to you on the results of further testing.

It's still in beta and I have some improvements ready for it, too.

waza 02-28-2006 07:37 AM

Does it has usergroup permissions?
And can't you do it with less file edits (by replacing them with plugins.)
However, It sure looks good!

Eikinskjaldi 02-28-2006 08:29 AM

Bleh, my first release and I mess up stuff as simple as copying and pasting. Sorry about that :nervous:

I've updated to v1.0.5 and fixed the problems (works flawlessly when installed on my test board), added to the product, and added a new plugin to it.

@waza: What do you mean by usergroup permissions? You can allow or restrict viewing by usergroup, if that's what you mean.

I've tried to limit file edits to the best of my ability. I've only been on vB3.5 for a week, and just learning the new data management was daunting enough. If I can find other ways, or if anyone else can find other ways, to avoid file edits and maximize plugin use, the hack will be updated for that.

waza 02-28-2006 11:55 AM

No what I mean is if you can restrict usergroups who can post private threads.
However, I looked @ the zip, and as there aren't any bitfield xml's their wont be usergroup permissions.
Like here:
https://vborg.vbsupport.ru/showthread.php?t=82844

And I'm sure a lot of file edits can be done by plugins, If I find some time I try to make use of plugins and pm them.

buro9 02-28-2006 12:43 PM

Perfect!

You wouldn't believe the need I have for this. It's incredibly sensitive, and this is a life saver.

Thank you so much for making and publishing it.

rnmcd 02-28-2006 12:50 PM

Thanks.

Looks like you finished before this:
https://vborg.vbsupport.ru/showthread.php?t=80135

XanTrax 02-28-2006 01:33 PM

From the types of people I deal with in my forums this would be abused 10 thousand times over. If anything try to add an option for which usergroups or users are allowed/not allowed to use this option. Something like...

Can user select thread options: Yes / No

wholemama 02-28-2006 01:39 PM

:) That version fixes everything!

And I figured out the multiple users thing...I was doing what was intuitive and putting a space after the semi-colon like a list...but no space can go there. So I'm altering the template to put a warning about that for my users (who aren't the most computer literate sometimes!).

The only problem that's keeping me from making this live now...when the thread shows in the Last Post column and you click on it, you can see it no matter if you're supposed to or not. It's like that call doesn't check the private_thread_not_allowed().

Eikinskjaldi 02-28-2006 01:44 PM

Quote:

Future Plans: Private Threads will NOT show in the lastpost column when user does not have access to thread
I'm hoping to have that changed soon. I still need to find out how to make it check for the next available "last thread" after that, and then repeat the permissions check, and loop until it finds one the person does have permission to.

buro9 02-28-2006 01:49 PM

I think you missed out something like:
Code:

$threadinfo['privateusers'] = $threadinfo['privateusers'] ? implode(";",unserialize($threadinfo['privateusers'])) : "";
in the showthread.php file, and then change $restrictedusers to $threadinfo[privateusers] in the showthread template.

And I've made it admin only, by doing things like the following in the newthread and the edit thread templates:
Quote:

<if condition="$foruminfo['allowprivate'] == 1 and is_member_of($bbuserinfo, 6)">
Where 6 is the id of the Admins usergroup

wholemama 02-28-2006 02:00 PM

Quote:

Originally Posted by Eikinskjaldi
I'm hoping to have that changed soon. I still need to find out how to make it check for the next available "last thread" after that, and then repeat the permissions check, and loop until it finds one the person does have permission to.

Yup... :)

I don't mind it showing in the Last Post column...that doesn't matter at all...it's just that it needs to check it when you load from that link (or any other direct link).

wholemama 02-28-2006 02:16 PM

Ok...got that working...that was my error! :D

Happy happy joy joy!

Eikinskjaldi 02-28-2006 04:30 PM

Buro, the program by default checks if you are an admin or not. I am working on a more advanced usergroup selection for making and viewing threads, also, I am drawing closer to the cure for the message in the last thread posted in area, 'Tis a beta for a reason, It will have errors as it goes further, thanks for the feedback so far :D.

The update later should also include the permissions for the thread creator by default and make it so all admins, mods, and super mods can view threads, unless you choose to turn supermods and mods off.

tmcyouth 02-28-2006 06:19 PM

Are you planning on making an option to enable only certain usergroups to set this option? How about making it only available in one forum?

Can't tell you how excited I am to get this! Thanks!

Eikinskjaldi 02-28-2006 09:58 PM

I will add making permissions for who CAN make private threads to the "future plans" list. Hi already can set the ability to have private threads per forum (this is Yes by default).

Daniel 02-28-2006 10:25 PM

Clicked install, hopefully in the future this won't need any file edits... if possible.

Ambie 03-01-2006 04:51 AM

When I make a thread and list the people allowed to see it,I go in with my test regular user name...If I click on new posts or the forum the private thread is in ,I get this error message:

Fatal error: Cannot break/continue 1 level in /home/*****/public_html/forums/forumdisplay.php(938) : eval()'d code on line 4

But, I don't get this error if I make a thread using the test account and then go look at it logged in as an admin. I hope that made sense. Any idea?:ermm:

Eikinskjaldi 03-01-2006 05:26 AM

When did you install the hack? Do you have any other plugins or file edits to forumdisplay.php? Could you show what that line (and surrounding lines) contains in your file?

The only change to forumdisplay.php (from my hack) should be a plugin, and I'm not experiencing any problems using it at all.

Ambie 03-01-2006 06:43 AM

Quote:

Originally Posted by Eikinskjaldi
When did you install the hack? Do you have any other plugins or file edits to forumdisplay.php? Could you show what that line (and surrounding lines) contains in your file?

The only change to forumdisplay.php (from my hack) should be a plugin, and I'm not experiencing any problems using it at all.


I installed it tonight. Yeah I have a lot of things in the forumdisplay. This is what is around line 938



I will go disable things one by one and see if it is another hack causing it :)

Eikinskjaldi 03-01-2006 07:50 AM

I think you're supposed to use CODE or PHP tags to hide the code from non-licensed users :)
If line 938 is the hook, and other plugins are using that hook, then the problem may be the order that the code is executed in. I know that the order can cause some problems. Perhaps try turning off the other plugins for that location?

Ambie 03-01-2006 08:01 AM

Quote:

Originally Posted by Eikinskjaldi
I think you're supposed to use CODE or PHP tags to hide the code from non-licensed users :)
If line 938 is the hook, and other plugins are using that hook, then the problem may be the order that the code is executed in. I know that the order can cause some problems. Perhaps try turning off the other plugins for that location?

I just took it out of my post.:nervous:


Thanks, that is what I am trying now. :)

Eikinskjaldi 03-02-2006 04:59 AM

Tell me how it turns out so I can look into why it might be eroring for you, need to fix bugs even if I cant reproduce it. :D

waza 03-02-2006 07:50 AM

@ambie: If you disable the product of this hack, do you still get the error, if so it has nothing to do with this hack, otherwise:
post the content of the plugin from this hack in the hook: threadbit_display.

drex 03-02-2006 03:48 PM

@Eikinskjaldi (or anyone else) -- before i go live with this, is the issue about the last post linking fixed, or can anyone see the thread/and or its contents?

do i have to do this?


Quote:

I think you missed out something like:

Code:
$threadinfo['privateusers'] = $threadinfo['privateusers'] ? implode(";",unserialize($threadinfo['privateusers'])) : "";

in the showthread.php file, and then change $restrictedusers to $threadinfo[privateusers] in the showthread template.

And I've made it admin only, by doing things like the following in the newthread and the edit thread templates:

Quote:
<if condition="$foruminfo['allowprivate'] == 1 and is_member_of($bbuserinfo, 6)">




Where 6 is the id of the Admins usergroup
I didn't follow the above..

Thanks

drex

drex 03-02-2006 03:56 PM

crap new posts in the vbcmps doesn't work now. whole board is screwy.

uninstalling....

drex 03-02-2006 04:03 PM

ok, now that i was able to stop a disaster. (and no, i don't have a test board -- too much work), the issues are:

1) if you are not an admin, or one of the 'allowed' users, and you click on the LAST POST link, you get the error listed above that ambie stated.

2) the search for 'New Posts' on the Vbadvanced CMPS front page doesn't work either

luckily, if you turn off the 'private threads allowed' forums, all goes back to normal.

this is a little too buggy to use live. needs more work, though great hack...

drex 03-02-2006 04:05 PM

the vbcmps error:

Fatal error: Cannot break/continue 1 level in /home/-----/public_html/search.php(2207) : eval()'d code on line 4
__________________

Eikinskjaldi 03-02-2006 07:12 PM

Can you post or PM me the lines of code you are having issues with? I had no issues with my own board and this hack so it might be that something is interfering, if the line is a plugin then please specify the plugin and i'll check it to see if there is anything outstanding in it.

The other thing you mentioned is that it shows a link to a new private thread, but it gives you an error message, it should be a vBphrase error message as well. This is to alert the user they don't have permission. However until I figure out the exact code I need to use I cannot remove them from the 'New thread' area without making it do a much more ugly thing of 'Private thread' and no link.

drex 03-02-2006 07:27 PM

that would be the 4th line of code in search.php.... ?? not sure which code you want me to give you!

Eikinskjaldi 03-02-2006 10:09 PM

I believe I've found the problem - It was where several file edits had been changed to be plugins, plugins that, looking at the code, come at inopportune times. I am editing the install file and the product to reflect the revert back to having, I believe, 2 more file edits and 2 less plugins.

Eikinskjaldi 03-03-2006 01:29 AM

*slaps forehead*

Well, I have found the cause of the search issue, It is quite a stupid one to be honest. If you have the current private thread hack installed, all you need to do is change the search and forumdisplay files. The instructions for each will be in the install directions.

Good luck!

[[Will shortly upload the new and improved install file with the correct code edit. Sorry about that!]]

Ambie 03-03-2006 02:36 AM

Nothing I was doing was working, but I just got an update e-mail. I just uploaded the new file and did the file edits and now it works great. Thank you! :)

rnmcd 03-03-2006 02:38 AM

Quote:

Originally Posted by Ambie
Nothing I was doing was working, but I just got an update e-mail. I just uploaded the new file and did the file edits and now it works great. Thank you! :)

Where did the update email come from?

Eikinskjaldi 03-03-2006 03:48 AM

I sent an update that automatically e-mails any user who has clicked "install" for this hack.

buro9 03-03-2006 06:45 AM

Quote:

Originally Posted by Eikinskjaldi
I sent an update that automatically e-mails any user who has clicked "install" for this hack.

Is the printthread.php hack not missing one of these:
PHP Code:

include_once('./includes/functions_privatethread.php'); 


drex 03-03-2006 01:04 PM

i didn't see an email.... (i haven't uninstalled, just not activated a private forum)...

can you post the file edits here or pm me?

Eikinskjaldi 03-03-2006 01:54 PM

buro9: Quite apparently in the installer, although my installed version seems to already have it. The product's been updated, thank you for catching that :)

drex: The plugins at threadbit_display and search_results_threadbit have been removed. They've been replaced with the following file edits.

In search.php
Find:
PHP Code:

    // show results as posts
    
if ($search['showposts'])
    {
        foreach (
$itemids AS $post)
        { 

Add BELOW:
PHP Code:

         // M/DD/YY PRIVATE THREADS PORT
            
include_once('./includes/functions_privatethread.php');
            if (
private_thread_not_allowed($post))
                        {
                            continue;
                        }
                  
// END PRIVATE THREADS PORT 

In forumdisplay.php
Find:
PHP Code:

        while ($thread $db->fetch_array($threads))
        { 
// AND $counter++ < $perpage) 

Add BELOW:
PHP Code:

        // M/DD/YY PRIVATE THREADS PORT
            
include_once('./includes/functions_privatethread.php');
                    if (
private_thread_not_allowed($thread))
                    {
                            continue;
                    }
                
// END PRIVATE THREADS PORT 



All times are GMT. The time now is 06:18 PM.

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.01628 seconds
  • Memory Usage 1,851KB
  • 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
  • (1)bbcode_code_printable
  • (5)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