vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Show Thread Enhancements - [OzzModz] First Post Editable Indefinitely Per Usergroup (https://vborg.vbsupport.ru/showthread.php?t=312924)

ozzy47 07-11-2014 10:00 PM

[OzzModz] First Post Editable Indefinitely Per Usergroup
 
Another mod brought to you by,
https://vborg.vbsupport.ru/external/2015/01/1.png

This is a small mod that will allow admins to have selected usergroups bypass Time Limit editing their first posts in a thread.

It is a simple installation, just import the product XML, ozzmodz_editable_post

You can edit the options under the settings, [OzzModz] First Post Editable Indefinitely Settings

Note: This was originally done by Lynne, here First Post Editable Indefinitely but it did not have usergroup perms, and you had to edit each forum individually.

Should you want a specific usergroup to be able to edit all their posts indefinitely, use
[OzzModz] Disable Time Limit On Editing Of Posts By Usergroup

Complete Feature List
  • Option to disable the mod completely.
  • Option to set which usergroups this mod will affect.
  • Option to select which forums this mod affects.
Frequently Asked Questions.

Q. Why do I need such a thing, you ask?

A. Sometimes you want your users to be able to edit the first post in their thread indefinitely but still have a time limit on all other posts in the thread. This can be useful if you want your users to be able to constantly update their first thread with new information, or new releases to things way past the normal editing time limit. This modification will allow them to edit that first post indefinitely.


-------------------------------------------------------------------------------------------

If you like this mod please hit the https://vborg.vbsupport.ru/external/2015/08/1.png button to the right ---->

Please remember to click the, https://vborg.vbsupport.ru/external/2015/08/2.png button to the right if you installed the mod ---->

What does 'Marking As Installed' do ?

* It helps you to stay on top of updates - members who have installed modifications will be notified whenever new updates are available.

* For security issues - vbulletin.org will contact all members who have installed a modification whenever a security issue is brought to their attention.

* Marking a modification as installed also helps me know how many people are using my work, giving me extra incentive to provide more features and new modifications.

I appreciate the support!
-------------------------------------------------------------------------------------------

* History (Changelog) *
-------------------------
v1.0.0 (July 12, 2014)
- Initial public release.
v1.0.1 (December 12, 2014)
- Fixed a issue with it not working on some sites.

ozzy47 07-12-2014 07:55 PM

Reserved.

civicf 07-17-2014 05:13 PM

I installed this mod in VB 4.2.2, but I have a problem.
I have a set limit editing posts. After installing, the first posts still can not be edited. I have a set usergroup perms and which forums options.

ozzy47 07-17-2014 06:22 PM

Quote:

Originally Posted by civicf (Post 2507214)
I installed this mod in VB 4.2.2, but I have a problem.
I have a set limit editing posts. After installing, the first posts still can not be edited. I have a set usergroup perms and which forums options.

Hmmm, if you pm me a admin account, I can look into it on your site.

civicf 07-17-2014 06:36 PM

I have tested it and it seems that the variables are empty. I mean postinfo['userid'] and $postinfo['postid'].
I don't know why.

ozzy47 07-18-2014 10:02 AM

Neither do I, that is why I would need to test it out on your site as I can't replicate the issue.

Grouper 08-11-2014 04:25 PM

This is exactly what I needed! Of course you customized it for my needs and I thank you for taking the time to make this so I didn't have too!

Grouper 08-11-2014 04:30 PM

A feature that would be great is the ability to assign user groups per forum. I could see the need for some forums to need to allow some user groups while other forums need to disable the other user group but enable a different user group.

ozzy47 08-11-2014 06:21 PM

Quote:

Originally Posted by Grouper (Post 2510847)
A feature that would be great is the ability to assign user groups per forum. I could see the need for some forums to need to allow some user groups while other forums need to disable the other user group but enable a different user group.

That would be quite a bit trickier, would require some recoding I believe.

Grouper 08-11-2014 07:09 PM

Is this supposed to work on threads started before this plugin was installed? I'm looking at the code and don't see why it wouldn't work, but my users are saying it is only working on new threads started after this was installed.

ozzy47 08-11-2014 07:15 PM

No it should work on all first posts.

Grouper 08-11-2014 09:18 PM

I created a test user and tested this, it doesn't seem to enable the edit post button after the timeout of 15 minutes for the OP in the specified forums I enabled for in the settings. Seems to be the same issue civicf is having

ozzy47 08-11-2014 09:24 PM

If you could give that test user full admin privileges, and send me the info for that test user, I can try to debug it on your site.

Grouper 08-11-2014 11:36 PM

I did debugging and the issue lies with the
PHP Code:

is_member_of() 

code. It is returning false

Here is my debug code
PHP Code:

print_log('checking if active: '$ozzmodz_editable_post['active']); 
print_log('users: ' implode(',',$allowed_users)); 
print_log('forums: ' implode(',',$included_forums)); 
print_log('Post uid: ' $this->post['userid']. ' VB uid: ' vB::$vbulletin->userinfo['userid']); 
print_log('Post id: ' $this->post['postid'] . ' First PostID: ' $this->thread['firstpostid']); 
print_log('Forum in array: ' in_array($this->thread['forumid'], $included_forums)); 
print_log('is_member_of: ' is_member_of($vbulletin->userinfo$allowed_users)); 

output
PHP Code:

11.08.2014 19:37:03 testaccount checking if active1
11.08.2014 19
:37:03 testaccount users2,-1
11.08.2014 19
:37:03 testaccount forums61,66
11.08.2014 19
:37:03 testaccount Post uid334 VB uid334
11.08.2014 19
:37:03 testaccount Post id115630 First PostID115630
11.08.2014 19
:37:03 testaccount Forum in array: 1
11.08.2014 19
:37:03 testaccount is_member_of
11.08.2014 19:37:03 testaccount checking if active1
11.08.2014 19
:37:04 testaccount users2,-1
11.08.2014 19
:37:04 testaccount forums61,66
11.08.2014 19
:37:04 testaccount Post uid3 VB uid334
11.08.2014 19
:37:04 testaccount Post id115679 First PostID115630
11.08.2014 19
:37:04 testaccount Forum in array: 1
11.08.2014 19
:37:04 testaccount is_member_of
11.08.2014 19:37:04 testaccount checking if active1
11.08.2014 19
:37:04 testaccount users2,-1
11.08.2014 19
:37:04 testaccount forums61,66
11.08.2014 19
:37:04 testaccount Post uid63 VB uid334
11.08.2014 19
:37:04 testaccount Post id115681 First PostID115630
11.08.2014 19
:37:04 testaccount Forum in array: 1
11.08.2014 19
:37:04 testaccount is_member_of
11.08.2014 19:37:04 testaccount checking if active1
11.08.2014 19
:37:04 testaccount users2,-1
11.08.2014 19
:37:04 testaccount forums61,66
11.08.2014 19
:37:04 testaccount Post uid3649 VB uid334
11.08.2014 19
:37:04 testaccount Post id115682 First PostID115630
11.08.2014 19
:37:04 testaccount Forum in array: 1
11.08.2014 19
:37:04 testaccount is_member_of
11.08.2014 19:37:04 testaccount checking if active1
11.08.2014 19
:37:04 testaccount users2,-1
11.08.2014 19
:37:04 testaccount forums61,66
11.08.2014 19
:37:04 testaccount Post uid63 VB uid334
11.08.2014 19
:37:04 testaccount Post id115683 First PostID115630
11.08.2014 19
:37:04 testaccount Forum in array: 1
11.08.2014 19
:37:04 testaccount is_member_of
11.08.2014 19:37:05 testaccount checking if active1
11.08.2014 19
:37:05 testaccount users2,-1
11.08.2014 19
:37:05 testaccount forums61,66
11.08.2014 19
:37:05 testaccount Post uid334 VB uid334
11.08.2014 19
:37:05 testaccount Post id115687 First PostID115630
11.08.2014 19
:37:05 testaccount Forum in array: 1
11.08.2014 19
:37:05 testaccount is_member_of

also not sure why it has -1 as a group as I really only have Registered Users group active right now

ozzy47 08-11-2014 11:57 PM

Ok I'll check it out on my site when I get a chance. It may be tomorrow.

Grouper 08-12-2014 12:00 AM

is there a need to have -1 in there?

Grouper 08-12-2014 12:07 AM

Fixed it

PHP Code:

$vbulletin->userinfo 

should be
PHP Code:

vB::$vbulletin->userinfo 


ozzy47 08-12-2014 12:10 AM

Hmmm, I have never used,

Code:

vB::$vbulletin->userinfo

Grouper 08-12-2014 12:23 AM

Also you need to create a new hook ajax_start and add
PHP Code:

$ozzmodz_editable_post['active'] = $vbulletin->options['ozzmodz_editable_post_active']; //Is mod active  
$allowed_users explode(','$vbulletin->options['ozzmodz_editable_post_groups']); //Allowed users  
$included_forums explode(","$vbulletin->options['ozzmodz_editable_post_forums']); //Enabled forums  

    
global $threadinfo$postinfo$foruminfo$vbulletin;   
      
    if ((
$threadinfo['firstpostid'] == $postinfo['postid']) AND ($vbulletin->userinfo['userid'] == $postinfo['userid']) AND ($ozzmodz_editable_post['active']) AND (is_member_of(vB::$vbulletin->userinfo$allowed_users) AND in_array($forumid$included_forums)))    
    {  
        
$vbulletin->options['edittimelimit'] = 0;  
    } 


Grouper 08-12-2014 12:24 AM

Quote:

Originally Posted by ozzy47 (Post 2510888)
Hmmm, I have never used,

Code:

vB::$vbulletin->userinfo

yea... i don't know why $vbulletin->user info works on other things in that script but not is_member_of()... its weird. But i managed to get the plugin working with those edits I listed

ozzy47 08-12-2014 12:30 AM

I appreciate the help, I will have to look into why it's needed.

Grouper 08-13-2014 09:59 PM

Any update on this?

ozzy47 08-13-2014 10:00 PM

No I have been busy debugging other things, but it is working for you with the edits you did correct?

Grouper 08-14-2014 04:13 PM

Yep, if you want I can do an export of my changes and post them for anyone else having issues.

ozzy47 08-14-2014 10:24 PM

Quote:

Originally Posted by Grouper (Post 2511289)
Yep, if you want I can do an export of my changes and post them for anyone else having issues.

Nah they are here in the thread, as soon as I get a chance I will update the mod, possibly Saturday. :)

tommyxv 11-14-2014 11:29 PM

I'm a little unsure if I need this one over the one I'm using right now from Lynn. I just like Ozzy's Mods I guess. :)

I allow the first post to be editable forever in vendor forums and only vendors can create threads in their forums.

I also allow the Group-Buy forum to have it's first post edited forever by any thread starter.

ozzy47 11-14-2014 11:32 PM

Yeah Lynne's is fine, it just did not have usergroup perms, and you had to set each forum individually. This mod you don't. :)

tommyxv 12-12-2014 07:13 PM

Having an issue with this. A member reported that he had the edit post button but when he clicked it, it gave him x amount of minutes have passed error. His usergroup and that forum were selected in the options.

EDIT: Nevermind, I just re-read this thread. I see the issue has been reported already. I'll switch back to the other one until this is updated. Nice being able to see the forums you have it set for all on one page. Great Mod!

ozzy47 12-12-2014 09:51 PM

Can you provide step by step instructions to reproduce this, so I can try and replicate it on my site.

tommyxv 12-12-2014 10:02 PM

Quote:

Originally Posted by ozzy47 (Post 2527015)
Can you provide step by step instructions to reproduce this, so I can try and replicate it on my site.

It's the same issue that Lynn's mod had but she fixed it with a new plugin. For version 4.1.12 and above.

tommyxv 12-12-2014 10:12 PM

I just tested on my test board and I have the usergroup and the forum selected. I set the time limit to edit to 1 min for testing purposes. After 1 min, I lose the edit button. This is different now.

ozzy47 12-12-2014 10:17 PM

Try this version.

tommyxv 12-12-2014 10:18 PM

Will do. I just created a test admin and test user acct for you on my test board. If this one doesn't work, I'll PM the details.

tommyxv 12-12-2014 10:20 PM

Didn't work. I'll PM the logins

ozzy47 12-12-2014 10:20 PM

Ok cool. :)

ozzy47 12-12-2014 10:35 PM

Alright try the XML in the first post, I updated it. :)

tommyxv 12-12-2014 10:40 PM

All good man! Let me know if you can help me with other thing I PM'ed you about. With the 2nd post, or just all posts in said forums.

ozzy47 12-12-2014 10:43 PM

Excellent, glad to hear. :)

tommyxv 12-13-2014 12:09 AM

Ozzy, I check my apache error logs and I have a bunch of these now....

Code:

[Fri Dec 12 20:59:16 2014] [error] [client removed ip] PHP Warning:  trim() expects parameter 1 to be string, array given in /home/mypathto/public_html/includes/adminfunctions_options.php on line 1032, referer: http://www.mysite.com/admincp/options.php?do=options&dogroup=ozzmodz_editable_post_settings
any idea how to fix? Thanks

ozzy47 12-13-2014 12:42 AM

Use the new version, 1.0.2 and it should be fixed.


All times are GMT. The time now is 05:23 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.01402 seconds
  • Memory Usage 1,869KB
  • 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_code_printable
  • (6)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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