View Full Version : Miscellaneous Hacks - You Can't See Attached Files Before Replying
germinus
05-21-2008, 10:00 PM
This mod hides your attachments to a post until the reader has added a reply, I must point out that I did not create this mod but found it lieing about in the 3.5 section.
https://vborg.vbsupport.ru/showthread.php?p=1431885
It was pointed out that this mod was of no use due to the fact that all a user had to do was click the paperclip icon in the forum index and they would be able to download without having to reply. This issue has now been resolved and users will no longer be able to bypass this mod.
All credit should go to Stoebi for the updates :)
**updated**
1.1.2
- Fixed: uncached template in showpost
- Fixed: cantseeattach in showpost, although user replied
veenuisthebest
05-22-2008, 04:50 PM
reserved !!
Stoebi
05-22-2008, 09:13 PM
Hi
Queries in postbit_display_complete are bad solutions
Template edit not necessary
Missing phrase, yours is hardcoded :(
Template is uncached
Missing table prefixYour template is using <normalfont>You must reply to be able to download the file</normalfont>. Never heard about such a tag <normalfont> ;)
Better:
Template postbit_cantseeattach:
<span class="smallfont">$vbphrase[cantseeattach]</span>
My ideas, not tested, but it should work:
For template cache:
Hook cache_templates:
if (THIS_SCRIPT == 'showthread')
{
$globaltemplates[] = 'postbit_cantseeattach';
}Reduce queries in hook postbit_display_complete:
if ($this->post['attach'])
{
GLOBAL $m, $vbulletin;
if (!$vbulletin->userinfo['userid'] OR $vbulletin->userinfo['userid'] != $m AND !can_moderate($forumid))
{
eval('$this->post[\'imageattachmentlinks\'] = "' . fetch_template('postbit_cantseeattach') . '";');
eval('$this->post[\'thumbnailattachments\'] = "' . fetch_template('postbit_cantseeattach') . '";');
eval('$this->post[\'imageattachments\'] = "' . fetch_template('postbit_cantseeattach') . '";');
eval('$this->post[\'otherattachments\'] = "' . fetch_template('postbit_cantseeattach') . '";');
eval('$this->post[\'moderatedattachments\'] = "' . fetch_template('postbit_cantseeattach') . '";');
}
}Hook showthread_post_start:
if ($thread['attach'])
{
$p = $db->query_first("SELECT userid
FROM " . TABLE_PREFIX . "post
WHERE threadid = $threadid AND userid = " . $vbulletin->userinfo['userid'] . "
");
$m = $p['userid'];
}For showing or not showing paperclip in threadbit.
Hook threadbit_process:
if ($thread['attach'])
{
GLOBAL $db, $vbulletin;
$p = $db->query_first("SELECT userid
FROM " . TABLE_PREFIX . "post
WHERE threadid = $thread[realthreadid] AND userid = " . $vbulletin->userinfo['userid'] . "
");
$m = $p['userid'];
if (!$vbulletin->userinfo['userid'] OR $vbulletin->userinfo['userid'] != $m AND !can_moderate($forumid))
{
$show['paperclip'] = false;
}
}A variable/phrase cantseeattach is needed also:
Content:
You must reply to be able to download the fileI've no idea, how can i better reduce the queries in theadbit_process.
If anyone know how we can optimize it better, please let us know. :)
Regards,
Stoebi
codershark
05-23-2008, 01:11 AM
Thank you so much Stoebi! Works very fine.
germinus
05-23-2008, 02:43 PM
Stoebi sent me an updated version of this which has now been attached, I suggest you download the updated version. Thanks to Stoebi for the update!
BiZiMDiYaR
05-24-2008, 09:51 PM
Hi,
downloaded. but i installed the 1 file, but it didn;t work.. can we have a clear working procedure on this ( should be simple, must be doing something wrong. ) ?
Thanks.
sweetguy2004
05-25-2008, 08:05 PM
thanks nick hack but can u add thanks also
germinus
05-28-2008, 06:02 PM
another update added
da_judge
07-09-2008, 05:22 PM
Wicked plugin... clicked install
But how do u disable for certain usergroups, I dont want it to work with all user groups
Cheers
lstintxs100
07-09-2008, 05:25 PM
This is so tempting for my techs. I am going to download and think on this one. This could be a good way to increase activity.
da_judge
07-09-2008, 06:33 PM
I thought this
Find this bit
if($vbulletin->userinfo[userid]!=
And replace with this
if($groupid == 9 and $vbulletin->userinfo[userid]!=
Aint got it to work.. i prob missed somit
dmknights
01-24-2009, 11:23 AM
this could be useful.
I'll try it later
wolfe
05-01-2010, 03:33 PM
anyone update this fr vBulletin 4 ?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.