PDA

View Full Version : Show Thread Enhancements - Members Can't Download Attachments Before Reply


MARCO1
01-29-2009, 10:00 PM
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 (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=203634)

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
anyway to disallow certain usergroups ??? - like admins etc

Good idea it will be in the next version :)

lasto
01-30-2009, 07:37 PM
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

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

YES lasto !

in your attachment.php

search for

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 :
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
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
this looks good.
Will try this later

I hope you like it :)

MARCO1
02-02-2009, 07:12 PM
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
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
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
NEW UPDATE


YES lasto !

in your attachment.php

search for

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 :
post WHERE userid='2,3,4,5,6"



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

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..

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

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


Replace With
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
Try To replace this line

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


Replace With
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

.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

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

with this this..


if (!is_member_of($vbulletin->userinfo, x, y, z))
{
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
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 ...
if ( !$vbulletin->db->query_first ( "SELECT postid FROM " . TABLE_PREFIX . "post WHERE userid='".$vbulletin->userinfo[userid]."' AND threadid=$threadinfo[threadid]" ) ) :

with this this..


if (!is_member_of($vbulletin->userinfo, x, y, z))
{
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.

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

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 ?

Davros
03-30-2009, 09:19 PM
No not quite, after replying and hitting the attachment button, I was still getting the message.

MARCO1
03-30-2009, 09:32 PM
Can you send your admincp info To PM For Me. So i will check it for you

Davros
03-30-2009, 09:44 PM
Well I've actually got it working now, but theirs still no permission options, IE: every member group needs to reply to be able to download.

I'll try adding the custom code posted by Powlo again.

Thanks for helping with this.

I'll let you know how I get on.

MARCO1
03-30-2009, 10:30 PM
Glad to hear that Davros :)
Waiting your feedback :D

Davros
03-30-2009, 11:29 PM
Right with a bit of help from Stelthius I got this sorted.

Find this

// check if there is a forum password and if so, ensure the user has it set

Add Above it

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


Find this

?>

Add above it

}

All working If you need to add any additional usergroups just add them onto to the bit of code that's highlighted in Red separate them with ,

firas
03-31-2009, 04:28 AM
can we chose which forums this addin works on?

OcR Envy
05-22-2009, 12:30 PM
I'd love too see a version of this that hides a poll until someone replies!

aakhan136
05-28-2009, 03:44 PM
thanks

nando99
06-04-2009, 01:26 AM
Does this work on images with thumbs? Like will the thumbs show but will give an error message when clicked for full size if the user hasn't replied?

kent_lkc
06-18-2009, 02:24 PM
installed but nothing happens. :(

al3beer
06-19-2009, 02:16 AM
fantastic MARCO1

&

so thanks

lasto

for idea

4nawadir.com
07-22-2009, 06:31 PM
Thanks MARCO
Installed

maupassant
08-17-2009, 04:38 AM
We've tested this tonight and we like it except for one thing :
The thumbnails are not showing when it's on. Is there a way to fix this ?
:confused:

Thanks.

hqlman
08-18-2009, 12:42 AM
Still waiting on new update, to allow download only after pressing thank you button :)

yahoooh
08-18-2009, 06:57 AM
suggestion :
user who write the thread and attach file can choose if make people to dwonload without reply or have to reply
and this ofcourse if he use to prevent people from download before reply m it will prevent user unregistered to dowbload untill them register and reply
and if unregistered usergroup prevented from download untill they register there are will be only error message to user registered and reply if he choose"have to reply to download"

this should be only for files not images
thank u

Willy T
11-21-2009, 08:12 AM
Anything more about working with the Post Thanks hack?

MARCO1
11-21-2009, 05:10 PM
Anything more about working with the Post Thanks hack?

This Mod Is no longer support, however I have released MARCO1 Hide All for all vB4 series

JGreig
01-18-2010, 03:55 PM
Is it possible to limit this to just 1 forum or thread and if so how would that be done?

haytham
04-24-2010, 08:03 AM
NEW UPDATE


YES lasto !

in your attachment.php

search for

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 :
post WHERE userid='2,3,4,5,6"

Didn't work for me.

haytham
04-24-2010, 08:05 AM
This Mod Is no longer support, however I have released MARCO1 Hide All for all vB4 series

Has anyone tried with 3.8? The mod is working perfectly as is just that Admins also have to reply which is annoying.

ronaldkeaton
07-03-2010, 06:15 PM
Dear brother,
This mod has problems:
1. Uncompatible with UTF-8 (Charset uncompatible)

2. How to modifify this MOD to show a message box

http://cA4.upanh.com/9.225.13455007.PVC0/postVBBORG.png

Istead of showing this page:

http://cA2.upanh.com/9.225.13455017.SBZ0/1.jpg

Ichigo88
05-08-2011, 07:49 PM
Yes i develop the coding to work with post thanks

2 years have passed but I can not see the hack, what is with this promise?