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 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


All times are GMT. The time now is 03:07 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.01102 seconds
  • Memory Usage 1,786KB
  • 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
  • (2)bbcode_code_printable
  • (6)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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