Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.7 > vBulletin 3.7 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
You Can't See Attached Files Before Replying Details »»
You Can't See Attached Files Before Replying
Version: 2.3, by germinus germinus is offline
Developer Last Online: Dec 2012 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 3.7.x Rating:
Released: 05-21-2008 Last Update: 05-27-2008 Installs: 32
Uses Plugins
 
No support by the author.

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

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 05-22-2008, 04:50 PM
veenuisthebest's Avatar
veenuisthebest veenuisthebest is offline
 
Join Date: Mar 2008
Location: India
Posts: 1,416
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

reserved !!
Reply With Quote
  #3  
Old 05-22-2008, 09:13 PM
Stoebi Stoebi is offline
 
Join Date: Apr 2006
Location: Germany, Berlin
Posts: 331
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi
  • Queries in postbit_display_complete are bad solutions
  • Template edit not necessary
  • Missing phrase, yours is hardcoded
  • Template is uncached
  • Missing table prefix
Your 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:
HTML Code:
<span class="smallfont">$vbphrase[cantseeattach]</span>
My ideas, not tested, but it should work:

For template cache:
Hook cache_templates:
PHP Code:
if (THIS_SCRIPT == 'showthread')
{
    
$globaltemplates[] = 'postbit_cantseeattach';

Reduce queries in hook postbit_display_complete:
PHP Code:
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:
PHP Code:
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:
PHP Code:
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:
Code:
You must reply to be able to download the file
I'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
Reply With Quote
  #4  
Old 05-23-2008, 01:11 AM
codershark codershark is offline
 
Join Date: Feb 2008
Location: Germany
Posts: 208
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you so much Stoebi! Works very fine.
Reply With Quote
  #5  
Old 05-23-2008, 02:43 PM
germinus germinus is offline
 
Join Date: Apr 2006
Posts: 82
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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!
Reply With Quote
  #6  
Old 05-24-2008, 09:51 PM
BiZiMDiYaR BiZiMDiYaR is offline
 
Join Date: Aug 2006
Posts: 100
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 05-25-2008, 08:05 PM
sweetguy2004's Avatar
sweetguy2004 sweetguy2004 is offline
 
Join Date: Feb 2007
Location: uk
Posts: 117
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks nick hack but can u add thanks also
Reply With Quote
  #8  
Old 05-28-2008, 06:02 PM
germinus germinus is offline
 
Join Date: Apr 2006
Posts: 82
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

another update added
Reply With Quote
  #9  
Old 07-09-2008, 05:22 PM
da_judge's Avatar
da_judge da_judge is offline
 
Join Date: Jan 2006
Posts: 197
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wicked plugin... clicked install

But how do u disable for certain usergroups, I dont want it to work with all user groups

Cheers
Reply With Quote
  #10  
Old 07-09-2008, 05:25 PM
lstintxs100's Avatar
lstintxs100 lstintxs100 is offline
 
Join Date: Dec 2005
Posts: 82
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:41 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05448 seconds
  • Memory Usage 2,315KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (1)bbcode_html
  • (4)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete