vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Force users to reply before download attachments (https://vborg.vbsupport.ru/showthread.php?t=259146)

Da-Vinci 02-20-2011 12:09 AM

Force users to reply before download attachments
 
Quote:

Originally Posted by Da-Vinci
Edit: Can a Mod or Admin move this to VB4 Programming Discussion please, posted in VB3 Programming Discussion by mistake.

Basically I had this hack installed. https://vborg.vbsupport.ru/showthrea...=233333&page=3 but the coder wants $80 to make a public release and $600 for exclusive rights to an updated release.

I don't care if I can achieve this via a manual template edit, but this has become an integral feature of my forum.

This is as far as I've got so far, any help would be greatly appreciated.

Quote:

Originally Posted by Da-Vinci
So I've been trying to get this fixed, so looked at your older version of this mod here.

https://vborg.vbsupport.ru/showthread.php?t=203634

And noticed this reply by you.

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" 


Rather than edit the attacment.php I noticed the hooks exist in the plugin code, so I tried to replicate it like this.

PHP Code:

global $db ,$vbulletin;
                
$p=$db->query_first("SELECT userid from post where threadid='$post[threadid]'  AND userid=22,24,25" $vbulletin->userinfo[userid] . "");
                
$m=$p[userid];
                if(
$vbulletin->userinfo[userid]!= $m AND can_moderate($forumid'canremoveposts') == false or $vbulletin->userinfo[userid] == 0)
                {
                               eval(
'$this->post[\'imageattachmentlinks\'] = $vbphrase[MARCO1_At];');
                               eval(
'$this->post[\'thumbnailattachments\'] = $vbphrase[MARCO1_At];');
                               eval(
'$this->post[\'imageattachments\'] = $vbphrase[MARCO1_At];');
                               eval(
'$this->post[\'otherattachments\'] = $vbphrase[MARCO1_At];');
                               eval(
'$this->post[\'moderatedattachments\'] = $vbphrase[MARCO1_At];');
                }
  } 

The 3 usergroups I want to allow to to download attachments without replying are 22, 24 & 25 and of course the 3 staff usergroups 5, 6 & 7, but I believe the staff usergroups are covered by this statement.

PHP Code:

                if($vbulletin->userinfo[userid]!= $m AND can_moderate($forumid'canremoveposts') == false or $vbulletin->userinfo[userid] == 0

Looking at the attachment.php I don't see the same hook info.

PHP Code:

        $attachmentinfo $db->query_first_slave("
            SELECT filedataid, SUBSTRING(" 
. ((!empty($vbulletin->GPC['thumb']) ? 'thumbnail' 'filedata')) . ", $startbyte + 1, $readsize) AS filedata
            FROM " 
TABLE_PREFIX "filedata
            WHERE filedataid = 
$attachmentinfo[filedataid]
        "
); 

Anyway, I still haven't been able to get this to work so any help or updates would be greatly appreciated.

Quote:

Originally Posted by Da-Vinci
Edit: Can a Mod or Admin move this to VB4 Programming Discussion please, posted in VB3 Programming Discussion by mistake.



All times are GMT. The time now is 05:16 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.01931 seconds
  • Memory Usage 1,738KB
  • 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
  • (5)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete