vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Administrative and Maintenance Tools - Zoints Private Thread Comments for Staff (https://vborg.vbsupport.ru/showthread.php?t=127574)

Supramania 03-07-2010 04:45 AM

Developer Last Online: Apr 2009

I think not... :(

tafSteve 01-11-2011 12:29 AM

This is a wonderful hack! Since the big VB4 upgrade, it seems this is one of the more gravely missed addons from my staff. It doesn't look like the original developer will be back anytime soon, so I have tried to edit the code and templates to work with VB4... to no avail. I am willing to pay someone to convert this hack to VB4!

If anyone knows how to convert this please PM me with a quote.

Thanks.

OcR Envy 01-06-2012 05:06 PM

Anyone inteterested:

PHP Code:

$show['threadcomments'] = false;
if (
$vbulletin->options['threadcomments'])
{
    if (
$vbulletin->userinfo['permissions']['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['ismoderator'])
    {
        
$show['threadcomments'] = true;
    }
    
    if (
$vbulletin->options['threadcomment_moderator'] AND can_moderate($threadinfo['forumid']))
    {
        
$show['threadcomments'] = true;
    }
    
    
$vbulletin->input->clean_array_gpc('r', array(
        
'page'            => TYPE_UINT,
        
'showall'        => TYPE_BOOL,
        
'deletecomment' => TYPE_BOOL,
        
'commentid'     => TYPE_UINT
    
));
    
    if (
$vbulletin->GPC['deletecomment'])
    {
        
$threadcomment $db->query_first("SELECT * FROM " TABLE_PREFIX "threadcomment WHERE threadcommentid = " $vbulletin->GPC['commentid']);
        
        if (
$threadcomment AND (
            
$threadcomment['userid'] == $vbulletin->userinfo['userid'] OR 
            
$permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel']
        ))
        {
            
$db->query_write("DELETE FROM " TABLE_PREFIX "threadcomment WHERE threadcommentid = $threadcomment[threadcommentid]");
            
$threadman =& datamanager_init('Thread'$vbulletinERRTYPE_ARRAY'threadpost');
            
$threadman->set_existing($threadinfo);
            
$threadman->set('threadcomments'$threadinfo['threadcomments'] - 1);
            
$threadman->save();
            eval(
exec_header_redirect("showthread.php?$session[sessionurl]t=$threadinfo[threadid]iif($vbulletin->GPC['page'],"page=" $vbulletin->GPC['page'])));
        }
        else
        {
            eval(
print_no_permission());
        }
    }
    
    
    if (
$show['threadcomments'])
    {
        if (
$threadinfo['threadcomments'])
        {
            
$limit '';
            
            if (!
$vbulletin->GPC['showall'] AND $threadinfo['threadcomments'] > $vbulletin->options['threadcomments_maxcomments'])
            {
                
$limit 'LIMIT ' . ($threadinfo['threadcomments'] - $vbulletin->options['threadcomments_maxcomments']) . ',' $vbulletin->options['threadcomments_maxcomments'];
                
$show['morethreadcomments'] = true;
            }
            
            
$commentbits '';
            
$allcomments $db->query_read("
                SELECT * FROM " 
TABLE_PREFIX "threadcomment
                WHERE threadid = 
$threadinfo[threadid]
                ORDER BY dateline ASC
                
$limit
            "
);
            
            while (
$comment $db->fetch_array($allcomments))
            {
                
$show['threadcommentdelete'] = $permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel'] ? true false;
                if (
$comment['userid'] == $vbulletin->userinfo['userid'])
                {
                    
$show['threadcommentdelete'] = true;
                }
                
$comment['date'] = vbdate($vbulletin->options['dateformat'], $comment['dateline'], true) . ' ' vbdate($vbulletin->options['timeformat'], $comment['dateline']);
                
$templater vB_Template::create('threadcommentbit');
                
$templater->register('comment'$comment);
                
$templater->register('threadinfo'$threadinfo);
                
$commentbits $templater->render();    
            }
        }
        
        
$page $vbulletin->GPC['page'];
        
$templater vB_Template::create('THREADCOMMENT');
        
$templater->register('commentbits'$commentbits);
        
$templater->register('page'$page);
        
$templater->register('threadinfo'$threadinfo);
        
$threadcomments $templater->render();        
        
$template_hook[showthread_above_posts] .= $threadcomments
    }
    
    
$vbulletin->input->clean_array_gpc('p', array(
        
'addcomment' => TYPE_BOOL,
        
'threadcomment' => TYPE_STR_NOHTML
    
));
    
    if (
$vbulletin->GPC['addcomment'])
    {
        require_once(
DIR '/includes/class_bbcode.php');
        
$bbcode_parser =& new vB_BbCodeParser($vbulletinfetch_tag_list());
        
$vbulletin->GPC['threadcomment'] = $bbcode_parser->parse($vbulletin->GPC['threadcomment'], $threadinfo['forumid']);
        
        
$db->query_write("
            INSERT INTO " 
TABLE_PREFIX "threadcomment
                (threadid, userid, username, dateline, comment)
            VALUES (
                
$threadinfo[threadid],
                " 
$vbulletin->userinfo['userid'] . ",
                '" 
$db->escape_string(htmlspecialchars_uni($vbulletin->userinfo['username'])) . "',
                " 
TIMENOW ",
                '" 
$db->escape_string($vbulletin->GPC['threadcomment']) . "'
        )"
);
        
        
$threadman =& datamanager_init('Thread'$vbulletinERRTYPE_ARRAY'threadpost');
        
$threadman->set_existing($threadinfo);
        
$threadman->set('threadcomments'$threadinfo['threadcomments'] + 1);
        
$threadman->save();
        
        eval(
exec_header_redirect("showthread.php?$session[sessionurl]t=$threadinfo[threadid]iif(intval($_REQUEST['page']),"page=" intval($_REQUEST['page']))));
    }


Updating the templates shouldn't be too hard. Shame Zoints didn't mark this as reusable else I'd release it again for 4.x

johon 02-07-2012 11:22 AM

My staff is missing this in VB 4.1.x too :-( - would be great to get a version for VB 4.x

Wakey 02-07-2012 12:35 PM

Quote:

Originally Posted by OcR Envy (Post 2284494)
Anyone inteterested:


Updating the templates shouldn't be too hard. Shame Zoints didn't mark this as reusable else I'd release it again for 4.x

Thanks for the code but I'm having real issues with the templates. It gives a security token error, tried sorting like is mentioned in this thread but that was for vb3 so didnt work. So I tried the way of doing it via vb4 and the template change just gives the following errors

Quote:

Warning: Invalid argument supplied for foreach() in [path]/includes/functions.php on line 3557

vBulletin Message
The following error occurred when attempting to evaluate this template:
%1$s
This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.
Any chance you could share your template changes

SoftWareRevue 04-26-2015 09:02 AM

Quote:

Originally Posted by Wakey (Post 2297139)
...Any chance you could share your template changes

Please! Someone port this to vB4. :(

Elixar 04-11-2016 07:18 PM

Quote:

Originally Posted by SoftWareRevue (Post 2544224)
Please! Someone port this to vB4. :(

This.

Elixar 06-22-2016 03:12 AM

Quote:

Originally Posted by SoftWareRevue (Post 2544224)
Please! Someone port this to vB4. :(

^^^


All times are GMT. The time now is 08:19 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.01298 seconds
  • Memory Usage 1,809KB
  • 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_php_printable
  • (5)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
  • (8)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