mirror of
https://github.com/e107inc/e107.git
synced 2025-01-17 12:48:24 +01:00
Forum template tweaks
This commit is contained in:
parent
f9c03aa015
commit
1d25a01eac
@ -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;
|
||||
|
@ -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[] = "<a {$inc} rel='external' href='{$full}'><img class='thumbnail' src='{$thumb}' alt='' /></a>";
|
||||
}
|
||||
elseif(ADMIN)
|
||||
{
|
||||
$images[] = "Missing File: ".$baseDir.$file;
|
||||
}
|
||||
|
||||
|
||||
$inc = (vartrue($parm['modal'])) ? "data-toggle='modal' data-target='#".$parm['modal']."' " : "";
|
||||
$images[] = "<a {$inc} rel='external' href='{$full}'><img class='thumbnail' src='{$thumb}' alt='' /></a>";
|
||||
|
||||
break;
|
||||
}
|
||||
|
@ -283,31 +283,35 @@ $FORUM_CRUMB['forum']['value'] = "{FORUM_TITLE}";
|
||||
// <small>{BREADCRUMB}</small> //FIXME Breadcrumb looks crummy
|
||||
|
||||
$FORUM_VIEWFORUM_TEMPLATE['start'] = "";
|
||||
$FORUM_VIEWFORUM_TEMPLATE['header'] = "<div class='row-fluid'><div class='span9 pull-left'><h3>{FORUMTITLE}</h3></div><div class='span3 pull-right right' style='padding-top:10px'>{NEWTHREADBUTTONX}</div></div>
|
||||
<table class='table table-hover table-striped'>
|
||||
<colgroup>
|
||||
<col style='width:3%' />
|
||||
<col />
|
||||
<col style='width:10%' />
|
||||
<col style='width:10%' />
|
||||
<col style='width:20%' />
|
||||
</colgroup>
|
||||
|
||||
{SUBFORUMS}";
|
||||
$FORUM_VIEWFORUM_TEMPLATE['header'] = "<div class='row-fluid'><div class='span6 pull-left'>{BACKLINK}</div> </div>
|
||||
<div class='row-fluid'>
|
||||
<div class='span9 pull-left'><h3>{FORUMTITLE}</h3></div>
|
||||
<div class='span3 pull-right right' style='padding-top:10px'>{NEWTHREADBUTTONX}</div></div>
|
||||
<table class='table table-hover table-striped'>
|
||||
<colgroup>
|
||||
<col style='width:3%' />
|
||||
<col />
|
||||
<col style='width:10%' />
|
||||
<col style='width:10%' />
|
||||
<col style='width:20%' />
|
||||
</colgroup>
|
||||
|
||||
{SUBFORUMS}";
|
||||
|
||||
$FORUM_VIEWFORUM_TEMPLATE['item'] = "<tr><td>{ICON}</td><td>{THREADNAME}<div><small class='clearfix'>by {POSTER} {THREADTIMELAPSE} {PAGESX}</small></div></td><td>{REPLIESX}</td><td>{VIEWSX}</td><td><small>{LASTPOSTUSER} {LASTPOSTDATE} </small><div class='span2 right pull-right'>{ADMINOPTIONS}</div></td></tr>\n";
|
||||
$FORUM_VIEWFORUM_TEMPLATE['item-sticky'] = $FORUMVIEW['item'] ; // "<tr><td>{THREADNAME}</td></tr>\n";
|
||||
$FORUM_VIEWFORUM_TEMPLATE['item-sticky'] = $FORUMVIEW['item'] ; // "<tr><td>{THREADNAME}</td></tr>\n";
|
||||
$FORUM_VIEWFORUM_TEMPLATE['item-announce'] = $FORUMVIEW['item'] ; // "<tr><td>{THREADNAME}</td></tr>\n";
|
||||
|
||||
|
||||
$FORUM_VIEWFORUM_TEMPLATE['sub-header'] = "<tr><th colspan='2'>".FORLAN_20."</th><th>".LAN_55."</th><th>".FORLAN_21."</th><th>".FORLAN_22."</th></tr>";
|
||||
$FORUM_VIEWFORUM_TEMPLATE['sub-item'] = "<tr><td>{NEWFLAG}</td>
|
||||
<td><div>{SUB_FORUMTITLE}</div><small>{SUB_DESCRIPTION}</small></td>
|
||||
<td>{SUB_REPLIESX}</td>
|
||||
<td>{SUB_THREADSX}</td>
|
||||
<td><small>{SUB_LASTPOSTUSER} {SUB_LASTPOSTDATE}</small></td>
|
||||
</tr>\n";
|
||||
|
||||
$FORUM_VIEWFORUM_TEMPLATE['sub-item'] = "<tr><td>{NEWFLAG}</td>
|
||||
<td><div>{SUB_FORUMTITLE}</div><small>{SUB_DESCRIPTION}</small></td>
|
||||
<td>{SUB_REPLIESX}</td>
|
||||
<td>{SUB_THREADSX}</td>
|
||||
<td><small>{SUB_LASTPOSTUSER} {SUB_LASTPOSTDATE}</small></td>
|
||||
</tr>\n";
|
||||
|
||||
|
||||
$FORUM_VIEWFORUM_TEMPLATE['sub-footer'] = "";
|
||||
|
||||
$FORUM_VIEWFORUM_TEMPLATE['divider-important'] = "<tr><th colspan='2'>".LAN_411."</th><th>".LAN_55."</th><th>".LAN_56."</th><th>".LAN_57."</th></tr>";
|
||||
|
Loading…
x
Reference in New Issue
Block a user