1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-30 19:30:25 +02:00

Forum now allows for multiple attachments in a single user selection. For update thread/count should now working with PDO.

This commit is contained in:
Cameron
2016-03-21 14:32:02 -07:00
parent d7818345ce
commit bf2db49dd1
6 changed files with 104 additions and 25 deletions

View File

@@ -256,14 +256,14 @@ class plugin_forum_post_shortcodes extends e_shortcode
<div>
<div id='fiupsection'>
<span id='fiupopt'>
<input class='tbox e-tip' title=\"".$tp->toAttribute($tooltip)."\" name='file_userfile[]' type='file' size='47' />
<input class='tbox e-tip' title=\"".$tp->toAttribute($tooltip)."\" name='file_userfile[]' type='file' size='47' multiple='multiple' />
</span>
</div>
<input class='btn btn-default button' type='button' name='addoption' value=".LAN_FORUM_3020." onclick=\"duplicateHTML('fiupopt','fiupsection')\" />
</div>
";
//<input class='btn btn-default button' type='button' name='addoption' value=".LAN_FORUM_3020." />
if( $this->forum->prefs->get('attach') && (check_class($pref['upload_class']) || getperms('0')))
{
return $fileattach;

View File

@@ -105,12 +105,23 @@ class plugin_forum_view_shortcodes extends e_shortcode
$txt = '';
$attachArray = e107::unserialize($this->postInfo['post_attachments']);
//print_a($attachArray);
//print_a($attachArray);
foreach($attachArray as $type=>$vals)
{
foreach($vals as $key=>$file)
{
list($date,$user, $name) = explode("_", $file, 3);
if(is_array($file))
{
$name = !empty($file['name']) ? $file['name'] : $file['file'];
$file = $file['file'];
}
else
{
list($date,$user, $name) = explode("_", $file, 3);
}
switch($type)
{
@@ -130,14 +141,21 @@ class plugin_forum_view_shortcodes extends e_shortcode
break;
case 'img': //Always use thumb to hide the hash.
// return $baseDir.$file;
if(file_exists($baseDir.$file))
{
$thumb = $tp->thumbUrl($baseDir.$file,'x=1',true);
$full = $tp->thumbUrl($baseDir.$file,'w=1000&x=1', true);
$inc = (vartrue($parm['modal'])) ? "data-modal-caption=\"".$file."\" data-target='#uiModal' " : "";
//TODO Use jQuery zoom instead.
$caption = $name;
$inc = (vartrue($parm['modal'])) ? "data-modal-caption=\"".$caption."\" data-target='#uiModal' " : "";
$images[] = "<a {$inc} rel='external' href='{$full}' class='forum-attachment-image e-modal' ><img class='thumbnail' src='{$thumb}' alt='' /></a>";
}
elseif(ADMIN)