From 1d25a01eac3b4c819a4da0f45be8ac89268cf0a2 Mon Sep 17 00:00:00 2001 From: Cameron Date: Thu, 18 Apr 2013 18:25:20 -0700 Subject: [PATCH] Forum template tweaks --- e107_plugins/forum/forum_class.php | 8 +++- .../shortcodes/batch/view_shortcodes.php | 21 +++++++--- .../templates/forum_viewforum_template.php | 42 ++++++++++--------- 3 files changed, 46 insertions(+), 25 deletions(-) diff --git a/e107_plugins/forum/forum_class.php b/e107_plugins/forum/forum_class.php index 27470b70e..e04ff4354 100644 --- a/e107_plugins/forum/forum_class.php +++ b/e107_plugins/forum/forum_class.php @@ -148,12 +148,18 @@ class e107forum } - function getAttachmentPath($user) + function getAttachmentPath($user,$create=false) { $user = intval($user); $tp = e107::getParser(); $baseDir = e_MEDIA.'plugins/forum/attachments/'; $baseDir .= ($user) ? "user_". $tp->leadingZeros($user, 6) : "anon"; + + if($create == true && !is_dir($baseDir)) + { + mkdir($baseDir,0755); + } + $baseDir .= "/"; return $baseDir; diff --git a/e107_plugins/forum/shortcodes/batch/view_shortcodes.php b/e107_plugins/forum/shortcodes/batch/view_shortcodes.php index 7764ec722..c6080ffde 100644 --- a/e107_plugins/forum/shortcodes/batch/view_shortcodes.php +++ b/e107_plugins/forum/shortcodes/batch/view_shortcodes.php @@ -62,6 +62,7 @@ class plugin_forum_view_shortcodes extends e_shortcode */ function sc_post() { + // return print_a($this->postInfo['post_entry'],true); $emote = (isset($this->postInfo['post_options']['no_emote']) ? ',emotes_off' : ''); return e107::getParser()->toHTML($this->postInfo['post_entry'], true, 'USER_BODY'.$emote, 'class:'.$this->postInfo['user_class']); } @@ -92,7 +93,7 @@ class plugin_forum_view_shortcodes extends e_shortcode $images = array(); - $attachArray = e107::getArrayStorage()->read($this->postInfo['post_attachments']); + $attachArray = e107::unserialize($this->postInfo['post_attachments']); foreach($attachArray as $type=>$vals) { @@ -111,11 +112,21 @@ class plugin_forum_view_shortcodes extends e_shortcode case 'img': //Always use thumb to hide the hash. - $thumb = $tp->thumbUrl($baseDir.$file,'x=1',true); - $full = $tp->thumbUrl($baseDir.$file,'w=1000&x=1', true); + // 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-toggle='modal' data-target='#".$parm['modal']."' " : ""; + $images[] = ""; + } + elseif(ADMIN) + { + $images[] = "Missing File: ".$baseDir.$file; + } + - $inc = (vartrue($parm['modal'])) ? "data-toggle='modal' data-target='#".$parm['modal']."' " : ""; - $images[] = ""; break; } diff --git a/e107_plugins/forum/templates/forum_viewforum_template.php b/e107_plugins/forum/templates/forum_viewforum_template.php index 2975d556a..fd9c9f820 100644 --- a/e107_plugins/forum/templates/forum_viewforum_template.php +++ b/e107_plugins/forum/templates/forum_viewforum_template.php @@ -283,31 +283,35 @@ $FORUM_CRUMB['forum']['value'] = "{FORUM_TITLE}"; // {BREADCRUMB} //FIXME Breadcrumb looks crummy $FORUM_VIEWFORUM_TEMPLATE['start'] = ""; -$FORUM_VIEWFORUM_TEMPLATE['header'] = "

{FORUMTITLE}

{NEWTHREADBUTTONX}
- - - - - - - - - - {SUBFORUMS}"; +$FORUM_VIEWFORUM_TEMPLATE['header'] = "
{BACKLINK}
+
+

{FORUMTITLE}

+
{NEWTHREADBUTTONX}
+
+ + + + + + + + + {SUBFORUMS}"; $FORUM_VIEWFORUM_TEMPLATE['item'] = "\n"; -$FORUM_VIEWFORUM_TEMPLATE['item-sticky'] = $FORUMVIEW['item'] ; // "\n"; +$FORUM_VIEWFORUM_TEMPLATE['item-sticky'] = $FORUMVIEW['item'] ; // "\n"; $FORUM_VIEWFORUM_TEMPLATE['item-announce'] = $FORUMVIEW['item'] ; // "\n"; $FORUM_VIEWFORUM_TEMPLATE['sub-header'] = ""; -$FORUM_VIEWFORUM_TEMPLATE['sub-item'] = " - - - - - \n"; - +$FORUM_VIEWFORUM_TEMPLATE['sub-item'] = " + + + + + \n"; + + $FORUM_VIEWFORUM_TEMPLATE['sub-footer'] = ""; $FORUM_VIEWFORUM_TEMPLATE['divider-important'] = "";
{ICON}{THREADNAME}
by {POSTER} {THREADTIMELAPSE} {PAGESX}
{REPLIESX}{VIEWSX}{LASTPOSTUSER} {LASTPOSTDATE}
{ADMINOPTIONS}
{THREADNAME}
{THREADNAME}
{THREADNAME}
".FORLAN_20."".LAN_55."".FORLAN_21."".FORLAN_22."
{NEWFLAG}
{SUB_FORUMTITLE}
{SUB_DESCRIPTION}
{SUB_REPLIESX}{SUB_THREADSX}{SUB_LASTPOSTUSER} {SUB_LASTPOSTDATE}
{NEWFLAG}
{SUB_FORUMTITLE}
{SUB_DESCRIPTION}
{SUB_REPLIESX}{SUB_THREADSX}{SUB_LASTPOSTUSER} {SUB_LASTPOSTDATE}
".LAN_411."".LAN_55."".LAN_56."".LAN_57."