NOTE: Confirmed bug affecting all attachments. See post #20.
By request I have updated this to work on the latest vBulletin, VB 4.1.12. It should work on all 4.x versions.
There are NO new features, it is a simple update so it works with 4.x
I will not be providing official support for this mod- truth be told I'm not sure how it works, only that it does in my quick tests.
This is the original description:
Quote:
This hack allow protect thread by password same way as forums.
Administrator and moderators can change password, can appoint thread masters.
Thread masters can only change password.
All thread content are protected by password : attachments,printable version, archive,
search results. Instant subscription letters will not contain message.
i like the idea of this....one other basic thing you would sort of think would already be there but isnt....didnt work for us on 4.2.5 tho....installed ok, template edit no problem...but when clicking to setup the pw its this mess
Quote:
userinfo['permissions']['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel']) OR ($vbulletin->userinfo['permissions']['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['ismoderator']) OR can_moderate($threadinfo['forumid']) OR isset($masters[$vbulletin->userinfo['userid']]) ) { return true; } if ($temp = fetch_bbarray_cookie('threadpwd', $threadid) AND $temp === md5($vbulletin->userinfo['userid'] . $password)) { return true; } if ($showerror) { require_once(DIR . '/includes/functions_misc.php'); // thread password is bad - show error eval(standard_error(fetch_error('threadpasswordmis sing', $vbulletin->session->vars['sessionhash'], $vbulletin->scriptpath, $threadid, construct_post_vars_html(), $stylevar['cellpadding'], $stylevar['cellspacing'], $vbulletin->userinfo['securitytoken'] ))); } else { // forum password is bad - return false return false; } } function threadpassword_atos($idarray){ global $vbulletin; if (!is_array($idarray)) { return array('','');}; if (count($idarray)==0) { return array('','');}; $idstr=join(',',array_keys($idarray)); $nameq = $vbulletin->db->query_read(" SELECT userid,username FROM " . TABLE_PREFIX . "user WHERE userid in ($idstr) order by username"); $userstr='';$userstrh=''; $delim=''; while ($usr= $vbulletin->db->fetch_array($nameq)) { $userstr .= $delim . $usr['username']; $userstrh .= "$delim$usr[username]"; $delim = ','; } return array($userstr,$userstrh); } function threadpassword_stoa($nickstring){ global $vbulletin; $a=explode(',',$nickstring); $namesa=array(); foreach ($a as $key) { $namesa[] = "'" . $vbulletin->db->escape_string(trim($key)) . "'"; } $sqlfetch=join(',',$namesa); $useridsq=$vbulletin->db->query_read("select userid from " . TABLE_PREFIX . "user where username in ($sqlfetch) order by userid"); if ( $vbulletin->db->num_rows($useridsq) < 0 ) { return array(); } $result=array(); while ($row=$vbulletin->db->fetch_array($useridsq)) { $result[$row[userid]]=1; } return $result; } ?>
that make sense to anyone? that attachment workaround worked too, thought it was home free till that last bit..
It looks like you uploaded a PHP file to your site in binary mode which didn't preserve the line endings. PHP (as well as HTML, TXT and other text based files) need to be uploaded in ASCII mode by your FTP client. By default Filezilla will usually do this for you but if for some reason something went wrong or you're using a different app you may need to set it manually,
Images would need to upload in binary or they break, so you can't always stay in ASCII mode.
i tried again just now, with a default vb4.2.5 install...the domain was setup with php 7.1 but the first part of the result was similar..
Quote:
userinfo['permissions']['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel']) OR ($vbulletin->userinfo['permissions']['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['ismoderator']) OR can_moderate($threadinfo['forumid']) OR isset($masters[$vbulletin->userinfo['userid']]) ) { return true; } if ($temp = fetch_bbarray_cookie('threadpwd', $threadid) AND $temp === md5($vbulletin->userinfo['userid'] . $password)) { return true; } if ($showerror) { require_once(DIR . '/includes/functions_misc.php'); // thread password is bad - show error eval(standard_error(fetch_error('threadpasswordmis sing', $vbulletin->session->vars['sessionhash'], $vbulletin->scriptpath, $threadid, construct_post_vars_html(), $stylevar['cellpadding'], $stylevar['cellspacing'], $vbulletin->userinfo['securitytoken'] ))); } else { // forum password is bad - return false return false; } } function threadpassword_atos($idarray){ global $vbulletin; if (!is_array($idarray)) { return array('','');}; if (count($idarray)==0) { return array('','');}; $idstr=join(',',array_keys($idarray)); $nameq = $vbulletin->db->query_read(" SELECT userid,username FROM " . TABLE_PREFIX . "user WHERE userid in ($idstr) order by username"); $userstr='';$userstrh=''; $delim=''; while ($usr= $vbulletin->db->fetch_array($nameq)) { $userstr .= $delim . $usr['username']; $userstrh .= "$delim$usr[username]"; $delim = ','; } return array($userstr,$userstrh); } function threadpassword_stoa($nickstring){ global $vbulletin; $a=explode(',',$nickstring); $namesa=array(); foreach ($a as $key) { $namesa[] = "'" . $vbulletin->db->escape_string(trim($key)) . "'"; } $sqlfetch=join(',',$namesa); $useridsq=$vbulletin->db->query_read("select userid from " . TABLE_PREFIX . "user where username in ($sqlfetch) order by userid"); if ( $vbulletin->db->num_rows($useridsq) < 0 ) { return array(); } $result=array(); while ($row=$vbulletin->db->fetch_array($useridsq)) { $result[$row[userid]]=1; } return $result; } ?> Call to undefined function threadpassword_atos() on line 74 in /public_html/threadpassword.php
#0 {main}
that call to undefined function at the end help at all?
the rest of the errors follow..
Quote:
Fatal User Error: Call to undefined function threadpassword_atos() on line 74 in ..../threadpassword.php in ..../vb/vb.php on line 286
Trace Data:
#1 : vbstop() called in ..../includes/class_core.php on line 6089
#2 : vbulletin_error_handler() called in on line
#3 : trigger_error() called in ..../vb/vb.php on line 286
#4 : vB::handleException() called in on line
i dont know really how to even try troubleshooting farther....i know its marked unsupported but could be a good thing to see working...