PDA

View Full Version : New Posting Features - Attach Files in Quick Reply


abus3d
11-16-2008, 10:00 PM
Dear All ....

since every body know we cant attach any file from the qucik reply, we have to go use newreply or newthread to use this feature ....

- since 3 days i am working in this option, with tries and errors and finally i succed to add the attach files in the quick reply to make it easy for the users.


** 3.7.4 **
+++++++++++++++++++++++++++++++++++++++++++++++++
The steps :

1- showthread.php :

please open the file ...

=== attached all the modifications for your helps ===

a- search for



'bbcodecache',

add after this code the following :


PHP Code:
'attachmentcache',


b- search for


PHP Code:
'showthread_quickreply',

add after this the followings :


'newpost_attachment',
'newpost_attachmentbit',

c- search for


// ************************************************** *******************************
// build quick reply if appropriate


befor this you have to add the following



// get attachment options - by abus3d (www.marsasoft.net)
require_once(DIR . '/includes/functions_file.php');
$inimaxattach = fetch_max_upload_size();
$attachtypes =& $vbulletin->attachmentcache;
$maxattachsize = vb_number_format($inimaxattach, 1, true);
$attachcount = 0;
$attach_editor = array();
if ($forumperms & $vbulletin->bf_ugp_forumpermissions['canpostattachment'] AND
$vbulletin->userinfo['userid'])
{
if (!$posthash OR !$poststarttime)
{
$poststarttime = TIMENOW;
$posthash = md5($poststarttime . $vbulletin->userinfo['userid'] .
$vbulletin->userinfo['salt']);
}
else
{
if (empty($postattach))
{
$currentattaches = $db->query_read("
SELECT dateline, filename, filesize, attachmentid
FROM " . TABLE_PREFIX . "attachment
WHERE posthash = '" .
$db->escape_string($newpost['posthash']) . "'
AND userid = " .
$vbulletin->userinfo['userid']
);
while ($attach = $db->fetch_array($currentattaches))
{
$postattach["$attach[attachmentid]"] = $attach;
}
}
if (!empty($postattach))
{
foreach($postattach AS $attachmentid => $attach)
{
$attach['extension'] =
strtolower(file_extension($attach['filename']));
$attach['filename'] =
htmlspecialchars_uni($attach['filename']);
$attach['filesize'] =
vb_number_format($attach['filesize'], 1, true);
$show['attachmentlist'] = true;
eval('$attachments .= "' .
fetch_template('newpost_attachmentbit') . '";');
$attachment_js .=
construct_attachment_add_js($attachmentid, $attach['filename'], $attach['filesize'],
$attach['extension']);
$attach_editor["$attachmentid"] =
$attach['filename'];
}
}
}
$attachurl = "t=$threadinfo[threadid]";
eval('$attachmentoption = "' . fetch_template('newpost_attachment') .
'";');
$attach_editor['hash'] = $postid;
$attach_editor['url'] =
"newattachment.php?$session[sessionurl]t=$threadinfo[threadid]&poststarttime=$poststartt
ime&posthash=$posthash";
}
else
{
$attachmentoption = '';
}

d- please save your file (showthread.php)

++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++

2- now we have to make some modifications in showthread template

a- please open your showthread tempale

search for :



<input type="hidden" name="p" value="$qrpostid" id="qr_postid" />

after this please add the followings :



<input type="hidden" name="posthash" value="$posthash" />
<input type="hidden" name="poststarttime" value="$poststarttime" />


b- in the same template you search :



<if condition="$bbuserinfo['signature']">
<div style="float:$stylevar[right]"><label for="cb_signature"><input type="checkbox" name="signature" value="1" id="cb_signature" tabindex="5" checked="checked" />$vbphrase[show_your_signature]</label></div>
</if>
<label for="qr_quickreply"><input type="checkbox" name="quickreply" value="1" id="qr_quickreply" accesskey="w" tabindex="4" />$vbphrase[quote_message_in_reply]</label>
</div>
</fieldset>


you add after this the following :



$attachmentoption


finally save your template

yhdf
11-17-2008, 02:44 PM
abus3d

Thanks for the addition

abus3d
11-17-2008, 03:54 PM
abus3d

Thanks for the addition


you welcome

abus3d
11-18-2008, 01:01 AM
up for all

Barakat
11-18-2008, 09:26 AM
thanks man ,

Omranic
11-18-2008, 12:43 PM
Hey, It's already found in another premium product from ~ 5 months :). Here it is:
https://vborg.vbsupport.ru/showthread.php?t=180330

It doesn't need any file edits & fully support AJAX features also.

abus3d
11-18-2008, 02:16 PM
thanks man ,

you welcome

abus3d
11-18-2008, 02:24 PM
Hey, It's already found in another premium product from ~ 5 months :). Here it is:
https://vborg.vbsupport.ru/showthread.php?t=180330

It doesn't need any file edits & fully support AJAX features also.

hi sir,

thanks for your comments

i knew there a product for all these features, smile, attach, open,close.... etc


- i try to make it without any product or plug-ins


thanks for you sir

abus3d
12-12-2008, 10:37 AM
up fo all

Se?or Ramos
06-10-2009, 07:26 PM
Would this work with 3.8.x?