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)

vithorius 10-13-2008 07:42 AM

Hi! I've got some ideas to improve this GREAT hack! https://vborg.vbsupport.ru/external/2011/07/3.gif


https://vborg.vbsupport.ru/external/2010/11/2.gif Would it be possible to add some way of notification when there is a new reply on the Private Comments? Sometimes we just don't read each other messages because the replys are on top of the thread, and the new thread's messages button will not show what's on top of the thread... (I don't know if you can understand my idea...)

So, it ouwld be perfect to include some kind of notification, so that the Admins and Moderators can see that the other guys from the team has writen something...


https://vborg.vbsupport.ru/external/2010/11/2.gif Also, would it be possible to correctly manage the private messages that were already written on a given thread whenever you merge two threads? (what happens know is that every staff's private message that was already posted will be deleted when you merge two - or more - threads...)


Thank you so VERY MUCH for all your work on this EXCELLENT Hack! :up: :up:

momo2 11-24-2008 04:20 PM

thanks for update....... works on 3.7.4 now

Audentio 12-02-2008 11:33 PM

Works on 3.8.x.

However, I didnt like the height. Despite editing it in the acp, I added a dropdown fuction so staff who don't care to make comments or at least not at that time (in other words, they can call on it), I made this modification:

THREADCOMMENT:
Code:

<table border="0" cellpadding="0" cellspacing="0" width="80%" align="center">
<tbody>
        <tr>
                <td class="thead" colspan="5">
                        <a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('threadcomment')"><img id="collapseimg_threadcomment" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_threadcomment].gif" alt="" border="0" /></a>
                        Staff Comments
                </td>
        </tr>
</tbody>
<tbody id="collapseobj_threadcomment" style="$vbcollapse[collapseobj_threadcomment]">
<tr>
                <td>
                        <if condition="$threadinfo[threadcomments] > 0">
                                <if condition="$show['morethreadcomments']">
                                        <div align="center"><a href="showthread.php?$session[sessionurl]t=$threadinfo[threadid]&amp;showall=1">[$vbphrase[threadcomments_more]]</a></div>
                                </if>
                                <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%">
                                        $commentbits
                                </table>
                        </if>
                        <if condition="THIS_SCRIPT != 'postings'">
                        <div align="center" style="margin-top: 10px;">
                        <form name="threadcomment" action="showthread.php" method="post">
                        <input type="hidden" name="s" value="$session[sessionhash]" />
                        <input type="hidden" name="t" value="$threadinfo[threadid]" />
                        <input type="hidden" name="addcomment" value="1" />
                        <input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
                        <input type="hidden" name="page" value="$page" />
                        <input name="threadcomment" size="80" class="bginput"></textarea><button type="submit" class="button">$vbphrase[add]</button>
                        </form>
                        </div>
                        <else />
                        <br />
                        </if>
                </td>
        </tr>
</tbody>
</table>

threadcommentbit:
Code:

<tr>
<if condition="$vbulletin->options['threadcomments_time']">
        <td class="alt1">$comment[username]</td>
        <td class="alt2" width="15%">$comment[date]</td>
<else />
        <td class="alt2">$comment[username]</td>
</if>
        <td class="alt1" width="100%" <if condition="!$show['threadcommentdelete']">colspan="2"</if>>$comment[comment]</td>
        <if condition="$show['threadcommentdelete']">
            <td class="alt2"><a href="showthread.php?$session[sessionurl]t=$threadinfo[threadid]&deletecomment=1&commentid=$comment[threadcommentid]">X</td>
        </if>
</tr>

threadcomment bit just took away the valign="top" as thats not necessary, it looks better centered, but if you use this I dont expect you to need to update that if you don't want to.

Toggling the menu hides the whole hack until you want to use it.

metalguy639 04-07-2009 06:12 AM

Quote:

Originally Posted by djbaxter (Post 1595500)

Thanks what I needed :D

bigcurt 04-14-2009 02:01 PM

Quote:

Originally Posted by Audentio (Post 1677406)
Works on 3.8.x.

However, I didnt like the height. Despite editing it in the acp, I added a dropdown fuction so staff who don't care to make comments or at least not at that time (in other words, they can call on it), I made this modification:

THREADCOMMENT:
Code:

<table border="0" cellpadding="0" cellspacing="0" width="80%" align="center">
<tbody>
    <tr>
        <td class="thead" colspan="5">
            <a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('threadcomment')"><img id="collapseimg_threadcomment" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_threadcomment].gif" alt="" border="0" /></a>
            Staff Comments
        </td>
    </tr>
</tbody>
<tbody id="collapseobj_threadcomment" style="$vbcollapse[collapseobj_threadcomment]">
<tr>
        <td>
            <if condition="$threadinfo[threadcomments] > 0">
                <if condition="$show['morethreadcomments']">
                    <div align="center"><a href="showthread.php?$session[sessionurl]t=$threadinfo[threadid]&amp;showall=1">[$vbphrase[threadcomments_more]]</a></div>
                </if>
                <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%">
                    $commentbits
                </table>
            </if>
            <if condition="THIS_SCRIPT != 'postings'">
            <div align="center" style="margin-top: 10px;">
            <form name="threadcomment" action="showthread.php" method="post">
            <input type="hidden" name="s" value="$session[sessionhash]" />
            <input type="hidden" name="t" value="$threadinfo[threadid]" />
            <input type="hidden" name="addcomment" value="1" />
                        <input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
            <input type="hidden" name="page" value="$page" />
            <input name="threadcomment" size="80" class="bginput"></textarea><button type="submit" class="button">$vbphrase[add]</button>
            </form>
            </div>
            <else />
            <br />
            </if>
        </td>
    </tr>
</tbody>
</table>

threadcommentbit:
Code:

<tr>
<if condition="$vbulletin->options['threadcomments_time']">
    <td class="alt1">$comment[username]</td>
    <td class="alt2" width="15%">$comment[date]</td>
<else />
    <td class="alt2">$comment[username]</td>
</if>
    <td class="alt1" width="100%" <if condition="!$show['threadcommentdelete']">colspan="2"</if>>$comment[comment]</td>
    <if condition="$show['threadcommentdelete']">
        <td class="alt2"><a href="showthread.php?$session[sessionurl]t=$threadinfo[threadid]&deletecomment=1&commentid=$comment[threadcommentid]">X</td>
    </if>
</tr>

threadcomment bit just took away the valign="top" as thats not necessary, it looks better centered, but if you use this I dont expect you to need to update that if you don't want to.

Toggling the menu hides the whole hack until you want to use it.

That is kick ass! Thanks so much.

Excalibur82 07-09-2009 07:12 AM

Quote:

Originally Posted by vithorius (Post 1643925)
Hi! I've got some ideas to improve this GREAT hack! https://vborg.vbsupport.ru/external/2011/07/3.gif


https://vborg.vbsupport.ru/external/2010/11/2.gif Would it be possible to add some way of notification when there is a new reply on the Private Comments? Sometimes we just don't read each other messages because the replys are on top of the thread, and the new thread's messages button will not show what's on top of the thread... (I don't know if you can understand my idea...)

So, it ouwld be perfect to include some kind of notification, so that the Admins and Moderators can see that the other guys from the team has writen something...


https://vborg.vbsupport.ru/external/2010/11/2.gif Also, would it be possible to correctly manage the private messages that were already written on a given thread whenever you merge two threads? (what happens know is that every staff's private message that was already posted will be deleted when you merge two - or more - threads...)


Thank you so VERY MUCH for all your work on this EXCELLENT Hack! :up: :up:

On the first one I have managed to edit this to work with PM notification with option to opt out of using PM notification. The second option I have not looked into as of yet but will do that as soon as I have a chance.

New Joe 08-12-2009 04:02 AM

After installing it adds a second nav bar and forum description at the bottom of the thread just above the quick reply box, anyone got any ideas why?

Supramania 02-08-2010 03:04 PM

Any chance of porting this to 4.0? My staff relied heavily on this prior to the upgrade and we really miss it.

btotw 02-08-2010 06:22 PM

Quote:

Originally Posted by Supramania (Post 1977503)
Any chance of porting this to 4.0? My staff relied heavily on this prior to the upgrade and we really miss it.

Fa real. Will this be ported to 4.0?

btotw 03-06-2010 12:05 PM

This will never get updated to 4.0 will it...?

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 02:20 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.01604 seconds
  • Memory Usage 1,884KB
  • 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
  • (4)bbcode_code_printable
  • (1)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
  • (18)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