The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Okay, so im converting a mod, and...
would like a tad bit o' help from you more experianced ones..im porting Mad_Max (of vbhackers.com)'s Install System Mod to vB 3.5.x...well, it requires a LOT of file editing..mostly within attachment.php (replacing code).
is there any way to get around replacing alot of the code by using a hook? Thanks!, Tyler |
#2
|
||||
|
||||
Look inside attachment.php and see if there are any hooks located where your code would go.
|
#3
|
||||
|
||||
there is, but it needs to replace a line above the hook..what I was wondering is if there was a work-around from editing attachment.php itself.
|
#4
|
|||
|
|||
Try to recode it so it can run in the hook location instead of above.
|
#5
|
||||
|
||||
not possible..this is what i'm talking about:
Code:
====== find: ====== if ($attachmentinfo['postid'] == 0) { // Attachment that is in progress but hasn't been finalized if ($vbulletin->userinfo['userid'] != $attachmentinfo['userid'] AND !can_moderate($attachmentinfo['forumid'], 'caneditposts')) { // Person viewing did not upload it eval(standard_error(fetch_error('invalidid', $idname, $vbulletin->options['contactuslink']))); } // else allow user to view the attachment (from the attachment manager for example) } else { $forumperms = fetch_permissions($attachmentinfo['forumid']); $threadinfo = array('threadid' => $attachmentinfo['threadid']); // used for session.inthread $foruminfo = array('forumid' => $attachmentinfo['forumid']); // used for session.inforum # Block attachments belonging to soft deleted posts and threads if (!can_moderate($attachmentinfo['forumid']) AND ($attachmentinfo['post_visible'] == 2 OR $attachmentinfo['thread_visible'] == 2)) { eval(standard_error(fetch_error('invalidid', $idname, $vbulletin->options['contactuslink']))); } # Block attachments belonging to moderated posts and threads if (!can_moderate($attachmentinfo['forumid'], 'canmoderateposts') AND ($attachmentinfo['post_visible'] == 0 OR $attachmentinfo['thread_visible'] == 0)) { eval(standard_error(fetch_error('invalidid', $idname, $vbulletin->options['contactuslink']))); } if (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canview']) OR !($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewthreads']) OR !($forumperms & $vbulletin->bf_ugp_forumpermissions['cangetattachment']) OR (!($forumperms & $vbulletin->bf_ugp_forumpermissions['canviewothers']) AND ($attachmentinfo['postuserid'] != $vbulletin->userinfo['userid'] OR $vbulletin->userinfo['userid'] == 0))) { print_no_permission(); } // check if there is a forum password and if so, ensure the user has it set verify_forum_password($attachmentinfo['forumid'], $vbulletin->forumcache["$attachmentinfo[forumid]"]['password']); if (!$attachmentinfo['visible'] AND !can_moderate($attachmentinfo['forumid'], 'canmoderateattachments') AND $attachmentinfo['userid'] != $vbulletin->userinfo['userid']) { eval(standard_error(fetch_error('invalidid', $idname, $vbulletin->options['contactuslink']))); } } ============== replace with: ============== if (!$_REQUEST['do'] == "download") { if ($attachmentinfo['postid'] == 0) { // Attachment that is in progress but hasn't been finalized if ($vbulletin->userinfo['userid'] != $attachmentinfo['userid'] AND !can_moderate($attachmentinfo['forumid'], 'caneditposts')) { // Person viewing did not upload it eval(standard_error(fetch_error('invalidid', $idname, $vbulletin->options['contactuslink']))); } // else allow user to view the attachment (from the attachment manager for example) } else { $forumperms = fetch_permissions($attachmentinfo['forumid']); $threadinfo = array('threadid' => $attachmentinfo['threadid']); // used for session.inthread if (!can_moderate($attachmentinfo['forumid']) AND $attachmentinfo['isdeleted']) { eval(standard_error(fetch_error('invalidid', $idname, $vbulletin->options['contactuslink']))); } if (!($forumperms & CANVIEW) OR !($forumperms & CANGETATTACHMENT)) { print_no_permission(); } // check if there is a forum password and if so, ensure the user has it set verify_forum_password($attachmentinfo['forumid'], $vbulletin->forumcache["$attachmentinfo[forumid]"]['password']); if (!$attachmentinfo['visible'] AND !can_moderate($attachmentinfo['forumid'], 'canmoderateattachments') AND $attachmentinfo['userid'] != $bbuserinfo['userid']) { $idname = 'attachment'; eval(print_standard_error(fetch_error('invalidid', $idname, $vbulletin->options['contactuslink']))); } } } |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|