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

Issue #4578 - Legacy forum template issue with missing thread subject element.

This commit is contained in:
Cameron
2021-10-18 14:17:54 -07:00
parent c8e48970ce
commit 573a8d55af
2 changed files with 23 additions and 8 deletions

View File

@@ -442,7 +442,7 @@ class forum_post_handler
$userbox = "<tr> $userbox = "<tr>
<td class='forumheader2' style='width:20%'>".LAN_FORUM_3010."</td> <td class='forumheader2' style='width:20%'>".LAN_FORUM_3010."</td>
<td class='forumheader2' style='width:80%'> <td class='forumheader2' style='width:80%'>
<input class='tbox form-control' type='text' name='anonname' size='71' value='".vartrue($anonname)."' maxlength='20' style='width:95%' /> {FORUM_POST_AUTHOR: size=block-level}
</td> </td>
</tr>"; </tr>";
} }
@@ -452,7 +452,7 @@ class forum_post_handler
$subjectbox = "<tr> $subjectbox = "<tr>
<td class='forumheader2' style='width:20%'>".LAN_FORUM_3011."</td> <td class='forumheader2' style='width:20%'>".LAN_FORUM_3011."</td>
<td class='forumheader2' style='width:80%'> <td class='forumheader2' style='width:80%'>
<input class='tbox form-control' type='text' name='subject' size='71' value='".vartrue($subject)."' maxlength='100' style='width:95%' /> {FORUM_POST_SUBJECT: size=block-level}
</td> </td>
</tr>"; </tr>";
} }

View File

@@ -97,15 +97,20 @@ class plugin_forum_post_shortcodes extends e_shortcode
// return forumjump(); // FIXME - broken in v1 themes // return forumjump(); // FIXME - broken in v1 themes
} }
/**
* @deprecated
* @return string
*/
function sc_userbox() function sc_userbox()
{ {
global $userbox; global $userbox;
return (USER == false ? $userbox : ''); return (USER === false) ? e107::getParser()->parseTemplate($userbox, true, $this) : '';
} }
function sc_forum_post_author() function sc_forum_post_author($opts = array())
{ {
$opts = array('size' => 'xlarge'); $opts['size'] = 'xlarge';
$tp = e107::getParser(); $tp = e107::getParser();
if(USER == false) if(USER == false)
@@ -126,15 +131,20 @@ class plugin_forum_post_shortcodes extends e_shortcode
} }
/**
* @deprecated
* @return string
*/
function sc_subjectbox() function sc_subjectbox()
{ {
global $subjectbox; global $subjectbox;
return ($this->var['action'] == 'nt' ? $subjectbox : ''); return $this->sc_forum_post_subject('boolean') ? e107::getParser()->parseTemplate($subjectbox, true, $this) : '';
} }
function sc_forum_post_subject() function sc_forum_post_subject($parm=null)
{ {
$opts = array('size' => 'xlarge'); $opts = empty($parm) ? array('size' => 'xlarge') : $parm;
if($this->var['action'] =='rp' || $this->var['action'] =='quote') if($this->var['action'] =='rp' || $this->var['action'] =='quote')
{ {
@@ -153,6 +163,11 @@ class plugin_forum_post_shortcodes extends e_shortcode
{ {
$opts['required'] = 1; $opts['required'] = 1;
} }
if($parm === 'boolean')
{
return empty($opts['disabled']);
}
// elseif($this->var['action'] == 'edit') // elseif($this->var['action'] == 'edit')
// { // {
// $_POST['subject'] = $this->varp; // $_POST['subject'] = $this->varp;