vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Show Thread Enhancements - Members Can't Download Attachments Before Reply (https://vborg.vbsupport.ru/showthread.php?t=203634)

MARCO1 01-29-2009 10:00 PM

Members Can't Download Attachments Before Reply
 
1 Attachment(s)
Members Can't Download Attachments

Members can't download Attachments Before Reply .

Versions :
vB 3.8.x

Install :

Import The Product From Your Admincp
Open Read Me file In attachments For File Changes

If You Use This modification click INSTALL

Subah 01-30-2009 06:37 PM

Thank you :)

lasto 01-30-2009 07:16 PM

anyway to disallow certain usergroups ??? - like admins etc

MARCO1 01-30-2009 07:23 PM

Quote:

Originally Posted by lasto (Post 1729372)
anyway to disallow certain usergroups ??? - like admins etc

Good idea it will be in the next version :)

lasto 01-30-2009 07:37 PM

Quote:

Originally Posted by MARCO1 (Post 1729379)
Good idea it will be in the next version :)

Cheers m8 will wait till next version as theres no way Admins of any board should have to reply to download attachments.

Ive clicked install anway as i like sound of your hack.

Mongez 01-30-2009 10:36 PM

Thanks

can you add also minimum post count option ?

and this is work in 3.7.X ?

MARCO1 01-30-2009 11:17 PM

No this for 3.8.x
i will release version tomorrow for 3.7.x

MARCO1 01-30-2009 11:18 PM

NEW UPDATE
Quote:

anyway to disallow certain usergroups ??? - like admins etc


YES lasto !

in your attachment.php

search for

PHP Code:

   if ( !$vbulletin->db->query_first "SELECT postid FROM " TABLE_PREFIX "post WHERE userid='".$vbulletin->userinfo[userid]."'  AND threadid=$threadinfo[threadid]) ) : 

and in ( post WHERE userid='" )
write your usergroup this will be have permission to see attachments without reply the thread

example :
PHP Code:

post WHERE userid='2,3,4,5,6" 


Daniel_HBK 01-31-2009 03:13 AM

good hack

MARCO1 01-31-2009 10:18 AM

Thanks HBK

Mike-D 01-31-2009 11:39 AM

Why not using a Plugin instead editing the attachment.php? Create a Plugin and the right Hook. That's all

MARCO1 01-31-2009 06:51 PM

Quote:

Originally Posted by Mike-D (Post 1729852)
Why not using a Plugin instead editing the attachment.php? Create a Plugin and the right Hook. That's all

Thanks Mike :)

MARCO1 01-31-2009 07:34 PM

UPDATED

dmknights 02-02-2009 10:19 AM

this looks good.
Will try this later

BigChucky 02-02-2009 06:27 PM

is there any way to get to use with the thanks button instead of a reply.?

MARCO1 02-02-2009 07:09 PM

Quote:

Originally Posted by dmknights (Post 1731737)
this looks good.
Will try this later

I hope you like it :)

MARCO1 02-02-2009 07:12 PM

Quote:

Originally Posted by BigChucky (Post 1732202)
is there any way to get to use with the thanks button instead of a reply.?

hmmmm . Maybe this will be in the next version . Good idea :up:

lasto 02-02-2009 09:27 PM

Thanks MArco - I agree with BigChucky that it would be good if they could only download attachments by way of the following :

1 - Hit thanks button
2 - Reply to thread

Now that would be the Best way

Medtech 02-02-2009 11:13 PM

thanks button option would be perfect!!

MARCO1 02-03-2009 10:05 AM

OK . i will do this
Thanks Guys

Nadeemjp 02-09-2009 12:28 AM

great hack
and yes i am with the popular opinion for the thanks button and reply button:)

installed:)

MARCO1 02-09-2009 08:15 AM

Yes i develop the coding to work with post thanks

Tianuc 02-09-2009 03:44 PM

1 - Hit thanks button Very, very good!
Thank you!

MARCO1 02-09-2009 11:45 PM

Quote:

Originally Posted by Tianuc (Post 1738801)
1 - Hit thanks button Very, very good!
Thank you!

Yes i think this will be Very Good :)

DPtheGod 02-12-2009 06:16 AM

Awesome hack, man! I give you props! I am going to install it tonight when I get home. :)

MARCO1 02-12-2009 04:48 PM

Quote:

Originally Posted by DPtheGod (Post 1741550)
Awesome hack, man! I give you props! I am going to install it tonight when I get home. :)

Good , i waiting your feedback :)

Tianuc 02-21-2009 09:21 AM

Looking forward to the new version.

nrms? 03-06-2009 08:20 PM

@MARCO1 one more suggestion "integrate download links with changes options in CP Adm"...

Are you prognostics for one update this mod...?

Nice work...:up:

cooltechie 03-08-2009 01:10 AM

Good idea. I can't wait to try it but will wait for updated version that includes thanks button. I clicked on install.

Powlo 03-15-2009 10:22 AM

Quote:

Originally Posted by MARCO1 (Post 1729532)
NEW UPDATE


YES lasto !

in your attachment.php

search for

PHP Code:

   if ( !$vbulletin->db->query_first "SELECT postid FROM " TABLE_PREFIX "post WHERE userid='".$vbulletin->userinfo[userid]."'  AND threadid=$threadinfo[threadid]) ) : 

and in ( post WHERE userid='" )
write your usergroup this will be have permission to see attachments without reply the thread

example :
PHP Code:

post WHERE userid='2,3,4,5,6" 




This didnt work for me, i got an error..

Code:

Database error in vBulletin 3.8.0:

Invalid SQL:
SELECT postid FROM post WHERE userid=61'  AND threadid=6836;

MySQL Error  : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''  AND threadid=6836' at line 1
Error Number  : 1064
Request Date  : Sunday, March 15th 2009 @ 11:18:54 AM
Error Date    : Sunday, March 15th 2009 @ 11:18:55 AM
Script        : http://www.******.com/forum/attachment.php?attachmentid=5100&d=1237062483
Referrer      : http://www.*******.com/forum/showthread.php?t=6836
IP Address    : **.**.**.**
Username      : ******
Classname    : vB_Database
MySQL Version : 5.0.45

This is what i changed..

PHP Code:

   if ( !$vbulletin->db->query_first "SELECT postid FROM " TABLE_PREFIX "post WHERE userid=6".$vbulletin->userinfo[userid]."'  AND threadid=$threadinfo[threadid]) ) :   
                        eval(
'print_output("' fetch_template('MARCO1 Cant See Attach') . '");');   
                endif ; 


any ideas?

MARCO1 03-15-2009 10:35 AM

Try To replace this line

PHP Code:

   if ( !$vbulletin->db->query_first "SELECT postid FROM " TABLE_PREFIX "post WHERE userid='".$vbulletin->userinfo[userid]."'  AND threadid=$threadinfo[threadid]) ) : 

Replace With
PHP Code:

   if ( !$vbulletin->db->query_first "SELECT postid FROM " TABLE_PREFIX "post WHERE userid='6".$vbulletin->userinfo[userid]."'  AND threadid=$threadinfo[threadid]) ) : 


Powlo 03-15-2009 01:22 PM

Quote:

Originally Posted by MARCO1 (Post 1768562)
Try To replace this line

PHP Code:

   if ( !$vbulletin->db->query_first "SELECT postid FROM " TABLE_PREFIX "post WHERE userid='".$vbulletin->userinfo[userid]."'  AND threadid=$threadinfo[threadid]) ) : 

Replace With
PHP Code:

   if ( !$vbulletin->db->query_first "SELECT postid FROM " TABLE_PREFIX "post WHERE userid='6".$vbulletin->userinfo[userid]."'  AND threadid=$threadinfo[threadid]) ) : 


Ok i tried that, i didnt receive an error but it still didnt work.

Thanks for helping but if i cant get this sorted im gonna have to uninstall. :confused:

[edit] Infact it didnt work for anybody wanting to download after that code edit. They could reply to the thread 10 times and they still couldnt have downloaded the attachment.

Powlo 03-16-2009 02:31 PM

Any other ideas to prevent admin from having to reply?

Powlo 03-20-2009 11:35 PM

OK that one seems to have got you stumped a little, how about being able to turn it off for a certain style?

crazlunatic 03-21-2009 05:50 PM

Hi. Great plugin you have here. Is there a plugin or can you mod it so that it says they are require to have a certain number of posts before they are allowed to download?

Davros 03-22-2009 02:44 PM

This doesn't work in any way shape of form for me.

I've done the edit to the attachment.php.

Is there supposed to be an option in VB Options or anywhere else in Admin CP?

I think you need to elaborate on this a little more, maybe a better read me file.

Also worth mentioning when I reply to the post I still get the

Quote:

.You can't Download The Attachments Before Reply To The Thread.

Best Wishes
message.

This includes all usergroups including Admin even with this line in the attachments.php

Code:

  if ( !$vbulletin->db->query_first ( "SELECT postid FROM " . TABLE_PREFIX . "post WHERE userid='6".$vbulletin->userinfo[userid]."'  AND threadid=$threadinfo[threadid]" ) ) :

Powlo 03-22-2009 06:08 PM

You need to remove the 6 from that line cos it doesnt work, infact it stops it from working altogether. As yet we havnt another solution to the Admin problem which is a shame cos this could be a really good mod for my forum.

Powlo 03-27-2009 06:33 PM

If you want to prevent a usergroup or groups from having to reply to a thread before downloading attachment you need to do this..

Replace this code ...
PHP Code:

   if ( !$vbulletin->db->query_first "SELECT postid FROM " TABLE_PREFIX "post WHERE userid='".$vbulletin->userinfo[userid]."'  AND threadid=$threadinfo[threadid]) ) : 

with this this..


PHP Code:

if (!is_member_of($vbulletin->userinfoxyz))
{
   if ( !
$vbulletin->db->query_first "SELECT postid FROM " TABLE_PREFIX "post WHERE userid='".$vbulletin->userinfo[userid]."'  AND threadid=$threadinfo[threadid]) ) :  



Changing x, y, z for your groups that dont need to reply.

Hope that helps.

Thanks to Lynne for her help.

Davros 03-30-2009 08:40 PM

Quote:

Originally Posted by Powlo (Post 1778465)
If you want to prevent a usergroup or groups from having to reply to a thread before downloading attachment you need to do this..

Replace this code ...
PHP Code:

   if ( !$vbulletin->db->query_first "SELECT postid FROM " TABLE_PREFIX "post WHERE userid='".$vbulletin->userinfo[userid]."'  AND threadid=$threadinfo[threadid]) ) : 

with this this..


PHP Code:

if (!is_member_of($vbulletin->userinfoxyz))
{
   if ( !
$vbulletin->db->query_first "SELECT postid FROM " TABLE_PREFIX "post WHERE userid='".$vbulletin->userinfo[userid]."'  AND threadid=$threadinfo[threadid]) ) :  



Changing x, y, z for your groups that dont need to reply.

Hope that helps.

Thanks to Lynne for her help.

Thanks for the advise but now I get this error when the attachment is clicked.

Code:

Parse error: syntax error, unexpected '}' in /home/test/domains/test-forum.com/public_html/forum/attachment.php on line 193
Quote:

Install :

Import The Product From Your Admincp
Open Read Me file In attachments For File Changes

MARCO1 03-30-2009 08:52 PM

What's happen if you install the hack without any changes ? did it work ?


All times are GMT. The time now is 08:33 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.02499 seconds
  • Memory Usage 1,857KB
  • 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
  • (3)bbcode_code_printable
  • (13)bbcode_php_printable
  • (13)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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