diff --git a/e107_plugins/forum/forum_admin.php b/e107_plugins/forum/forum_admin.php index dc6ad050fb..4762d995cd 100644 --- a/e107_plugins/forum/forum_admin.php +++ b/e107_plugins/forum/forum_admin.php @@ -136,26 +136,27 @@ class forum_ui extends e_admin_ui protected $fields = array ( 'checkboxes' => array ( 'title' => '', 'type' => null, 'data' => null, 'width' => '5%', 'thclass' => 'center', 'forced' => '1', 'class' => 'center', 'toggle' => 'e-multiselect', ), - 'forum_id' => array ( 'title' => LAN_ID, 'data' => 'int', 'width' => '5%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), - 'forum_name' => array ( 'title' => LAN_TITLE, 'type' => 'method', 'inline'=>true, 'data' => 'str', 'width' => '40%', 'help' => FORLAN_223, 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), - 'forum_sef' => array ( 'title' => LAN_SEFURL, 'type' => 'text', 'batch'=>true, 'inline'=>true, 'noedit'=>false, 'data' => 'str', 'width' => 'auto', 'help' => 'Leave blank to auto-generate it from the title above.', 'readParms' => '', 'writeParms' => 'sef=forum_name&size=xxlarge', 'class' => 'left', 'thclass' => 'left', ), - 'forum_description' => array ( 'title' => LAN_DESCRIPTION, 'type' => 'textarea', 'data' => 'str', 'width' => '30%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), + 'forum_id' => array ( 'title' => LAN_ID, 'data' => 'int', 'width' => '5%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), + 'forum_name' => array ( 'title' => LAN_TITLE, 'type' => 'method', 'inline'=>true, 'data' => 'str', 'width' => '40%', 'help' => FORLAN_223, 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), + 'forum_sef' => array ( 'title' => LAN_SEFURL, 'type' => 'text', 'batch'=>true, 'inline'=>true, 'noedit'=>false, 'data' => 'str', 'width' => 'auto', 'help' => 'Leave blank to auto-generate it from the title above.', 'readParms' => '', 'writeParms' => 'sef=forum_name&size=xxlarge', 'class' => 'left', 'thclass' => 'left', ), + 'forum_description' => array ( 'title' => LAN_DESCRIPTION, 'type' => 'textarea', 'data' => 'str', 'width' => '30%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), + 'forum_image' => array ( 'title' => LAN_ICON, 'type' => 'image', 'batch'=>false, 'inline'=>false, 'noedit'=>false, 'data' => 'str', 'width' => 'auto', 'help' => 'Will be displayed next to the forum name', 'readParms' => '', 'writeParms' => 'media=forum&max=1', 'class' => 'center', 'thclass' => 'center', ), 'forum_parent' => array ( 'title' => FORLAN_75, 'type' => 'dropdown', 'data' => 'int', 'width' => '10%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), - 'forum_sub' => array ( 'title' => LAN_FORUM_1002, 'type' => 'dropdown', 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => array(), 'writeParms' => array(), 'class' => 'center', 'thclass' => 'center', ), - 'forum_moderators' => array ( 'title' => LAN_FORUM_2003, 'type' => 'userclass', 'inline'=>true, 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => 'classlist=admin,main,classes', 'writeParms' => "classlist=admin,main,mods,classes", 'class' => 'left', 'thclass' => 'left', ), - 'forum_threads' => array ( 'title' => LAN_FORUM_1003, 'type' => 'number', 'data' => 'int', 'noedit'=>true, 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ), - 'forum_replies' => array ( 'title' => LAN_FORUM_0003, 'type' => 'number', 'data' => 'int', 'noedit'=>true, 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ), - 'forum_lastpost_user' => array ( 'title' => LAN_AUTHOR, 'type' => 'hidden', 'noedit'=>true, 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), - 'forum_lastpost_user_anon' => array ( 'title' => FORLAN_204, 'type' => 'hidden','noedit'=>true, 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ), - 'forum_lastpost_info' => array ( 'title' => LAN_PLUGIN_FORUM_LATESTPOSTS, 'type' => 'hidden', 'noedit'=>true, 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ), - 'forum_class' => array ( 'title' => LAN_VISIBILITY, 'type' => 'userclass', 'data' => 'int', 'width' => 'auto', 'batch' => true, 'filter' => true, 'inline' => true, 'help' => '', 'readParms' => array('classlist'=>'public,guest,nobody,member,admin,main,new,mods,classes'), 'writeParms' => array('classlist'=>'public,guest,nobody,member,admin,main,new,mods,classes'), 'class' => 'left', 'thclass' => 'left', ), - 'forum_order' => array ( 'title' => LAN_ORDER, 'type' => 'text', 'data' => 'int', 'inline'=>true, 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), - 'forum_postclass' => array ( 'title' => FORLAN_205, 'type' => 'userclass', 'inline'=>true,'filter'=>true, 'batch'=>true, 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => array('classlist'=>'public,guest,nobody,member,admin,main,new,mods,classes'), 'writeParms' => array('classlist'=>'public,guest,nobody,member,admin,main,new,mods,classes'), 'class' => 'center', 'thclass' => 'center', ), - 'forum_threadclass' => array ( 'title' => FORLAN_206, 'type' => 'userclass', 'inline'=>true, 'filter'=>true, 'batch'=>true, 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => array('classlist'=>'public,guest,nobody,member,admin,main,new,mods,classes'), 'writeParms' => array('classlist'=>'public,guest,nobody,member,admin,main,new,mods,classes'), 'class' => 'center', 'thclass' => 'center', ), - 'forum_datestamp' => array ( 'title' => LAN_DATESTAMP, 'type' => 'datestamp', 'data' => 'int', 'noedit'=>true, 'width' => 'auto', 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'right', 'thclass' => 'center', ), - // 'Sort' => array ( 'title' => 'Sort', 'type' => 'text', 'data' => 'str', 'noedit'=>true, 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ), - 'forum_options' => array ( 'title' => LAN_OPTIONS, 'type' => 'hidden', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ), - 'options' => array ( 'title' => LAN_OPTIONS, 'type' => null, 'data' => null, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center last', 'forced' => '1', 'sort'=>1 ), + 'forum_sub' => array ( 'title' => LAN_FORUM_1002, 'type' => 'dropdown', 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => array(), 'writeParms' => array(), 'class' => 'center', 'thclass' => 'center', ), + 'forum_moderators' => array ( 'title' => LAN_FORUM_2003, 'type' => 'userclass', 'inline'=>true, 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => 'classlist=admin,main,classes', 'writeParms' => "classlist=admin,main,mods,classes", 'class' => 'left', 'thclass' => 'left', ), + 'forum_threads' => array ( 'title' => LAN_FORUM_1003, 'type' => 'number', 'data' => 'int', 'noedit'=>true, 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ), + 'forum_replies' => array ( 'title' => LAN_FORUM_0003, 'type' => 'number', 'data' => 'int', 'noedit'=>true, 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ), + 'forum_lastpost_user' => array ( 'title' => LAN_AUTHOR, 'type' => 'hidden', 'noedit'=>true, 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), + 'forum_lastpost_user_anon' => array ( 'title' => FORLAN_204, 'type' => 'hidden','noedit'=>true, 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ), + 'forum_lastpost_info' => array ( 'title' => LAN_PLUGIN_FORUM_LATESTPOSTS, 'type' => 'hidden', 'noedit'=>true, 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ), + 'forum_class' => array ( 'title' => LAN_VISIBILITY, 'type' => 'userclass', 'data' => 'int', 'width' => 'auto', 'batch' => true, 'filter' => true, 'inline' => true, 'help' => '', 'readParms' => array('classlist'=>'public,guest,nobody,member,admin,main,new,mods,classes'), 'writeParms' => array('classlist'=>'public,guest,nobody,member,admin,main,new,mods,classes'), 'class' => 'left', 'thclass' => 'left', ), + 'forum_order' => array ( 'title' => LAN_ORDER, 'type' => 'text', 'data' => 'int', 'inline'=>true, 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ), + 'forum_postclass' => array ( 'title' => FORLAN_205, 'type' => 'userclass', 'inline'=>true,'filter'=>true, 'batch'=>true, 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => array('classlist'=>'public,guest,nobody,member,admin,main,new,mods,classes'), 'writeParms' => array('classlist'=>'public,guest,nobody,member,admin,main,new,mods,classes'), 'class' => 'center', 'thclass' => 'center', ), + 'forum_threadclass' => array ( 'title' => FORLAN_206, 'type' => 'userclass', 'inline'=>true, 'filter'=>true, 'batch'=>true, 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => array('classlist'=>'public,guest,nobody,member,admin,main,new,mods,classes'), 'writeParms' => array('classlist'=>'public,guest,nobody,member,admin,main,new,mods,classes'), 'class' => 'center', 'thclass' => 'center', ), + 'forum_datestamp' => array ( 'title' => LAN_DATESTAMP, 'type' => 'datestamp', 'data' => 'int', 'noedit'=>true, 'width' => 'auto', 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'right', 'thclass' => 'center', ), + // 'Sort' => array ( 'title' => 'Sort', 'type' => 'text', 'data' => 'str', 'noedit'=>true, 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ), + 'forum_options' => array ( 'title' => LAN_OPTIONS, 'type' => 'hidden', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ), + 'options' => array ( 'title' => LAN_OPTIONS, 'type' => null, 'data' => null, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center last', 'forced' => '1', 'sort'=>1 ), ); protected $fieldpref = array('forum_name', 'forum_parent', 'Sort', 'forum_description', 'forum_class', 'forum_postclass', 'forum_threadclass', 'forum_order'); diff --git a/e107_plugins/forum/forum_sql.php b/e107_plugins/forum/forum_sql.php index 0ccc8b4b13..632e579e48 100644 --- a/e107_plugins/forum/forum_sql.php +++ b/e107_plugins/forum/forum_sql.php @@ -2,6 +2,7 @@ `forum_id` int(10) unsigned NOT NULL auto_increment, `forum_name` varchar(250) NOT NULL default '', `forum_description` text, + `forum_image` varchar(250) DEFAULT NULL, `forum_parent` int(10) unsigned NOT NULL default '0', `forum_sub` int(10) unsigned NOT NULL default '0', `forum_datestamp` int(10) unsigned NOT NULL default '0', diff --git a/e107_plugins/forum/forum_viewforum.php b/e107_plugins/forum/forum_viewforum.php index e43ef983f7..e74993d98a 100644 --- a/e107_plugins/forum/forum_viewforum.php +++ b/e107_plugins/forum/forum_viewforum.php @@ -337,6 +337,7 @@ $fVars->BROWSERS = ''; --*/ $forumSCvars['forum_name']= $forumInfo['forum_name']; + $forumSCvars['forum_image']= $forumInfo['forum_image']; $forumSCvars['modUser']= $modUser; $forumSCvars['track_online']= varset($pref['track_online']); diff --git a/e107_plugins/forum/shortcodes/batch/forum_shortcodes.php b/e107_plugins/forum/shortcodes/batch/forum_shortcodes.php index 45e0c11616..ac957b6bbc 100644 --- a/e107_plugins/forum/shortcodes/batch/forum_shortcodes.php +++ b/e107_plugins/forum/shortcodes/batch/forum_shortcodes.php @@ -328,6 +328,16 @@ function sc_parentstatus() } + function sc_parentimage($parms=null) + { + if (empty($this->var['forum_image'])) return ''; + if (!empty($parms) && !is_array($parms)) parse_str($parms, $parms); + if (empty($parms)) $parms = array(); + $parms = array_merge(array('class'=>'img-fluid', 'h' => 50), $parms); + $text = e107::getParser()->toImage($this->var['forum_image'], $parms); + return $text.' '; + } + function sc_parentname() { return $this->var['forum_name']; @@ -362,10 +372,20 @@ function sc_newflag() } + function sc_forumimage($parms=null) + { + if(empty($this->var['forum_image'])) return ''; + + if (!empty($parms) && !is_array($parms)) parse_str($parms, $parms); + if (empty($parms)) $parms = array(); + $parms = array_merge(array('class'=>'img-fluid', 'h' => 50), $parms); + $text = e107::getParser()->toImage($this->var['forum_image'], $parms); + return "var)."'>{$text} "; + + } + function sc_forumname() { - // global $f; - // $tp = e107::getParser(); if(substr($this->var['forum_name'], 0, 1) == '*') { $this->var['forum_name'] = substr($this->var['forum_name'], 1); diff --git a/e107_plugins/forum/shortcodes/batch/viewforum_shortcodes.php b/e107_plugins/forum/shortcodes/batch/viewforum_shortcodes.php index a4fd1f8834..b0d60be223 100644 --- a/e107_plugins/forum/shortcodes/batch/viewforum_shortcodes.php +++ b/e107_plugins/forum/shortcodes/batch/viewforum_shortcodes.php @@ -140,6 +140,16 @@ function sc_forum_crumb() return $this->var['forum_crumb']; } + function sc_forumimage($parms=null) + { + if(empty($this->var['forum_image'])) return ''; + if (!empty($parms) && !is_array($parms)) parse_str($parms, $parms); + if (empty($parms)) $parms = array(); + $parms = array_merge(array('class'=>'img-fluid', 'h' => 50), $parms); + $text = e107::getParser()->toImage($this->var['forum_image'], $parms); + return $text." "; + } + function sc_forumtitle() { return $this->var['forum_name']; @@ -485,6 +495,16 @@ function __construct() ------*/ + function sc_sub_forumimage($parms=null) + { + if(empty($this->var['forum_image'])) return ''; + if (!empty($parms) && !is_array($parms)) parse_str($parms, $parms); + if (empty($parms)) $parms = array(); + $parms = array_merge(array('class'=>'img-fluid', 'h' => 50), $parms); + $text = e107::getParser()->toImage($this->var['forum_image'], $parms); + return "var)."'>{$text} "; + } + function sc_sub_forumtitle() { $forumName = e107::getParser()->toHTML($this->var['forum_name'], true); diff --git a/e107_plugins/forum/templates/forum_template.php b/e107_plugins/forum/templates/forum_template.php index 7c1ca08cb6..7b8e0a062d 100644 --- a/e107_plugins/forum/templates/forum_template.php +++ b/e107_plugins/forum/templates/forum_template.php @@ -121,7 +121,7 @@ "; $FORUM_TEMPLATE['main']['parent'] = " - {PARENTNAME} {PARENTSTATUS} + {PARENTIMAGE:h=50}{PARENTNAME} {PARENTSTATUS} ".LAN_FORUM_0003." ".LAN_FORUM_0002." ".LAN_FORUM_0004." @@ -131,7 +131,7 @@ $FORUM_TEMPLATE['main']['forum'] = " {NEWFLAG} - {FORUMNAME}
{FORUMDESCRIPTION}{FORUMSUBFORUMS} + {FORUMIMAGE:h=50}{FORUMNAME}
{FORUMDESCRIPTION}{FORUMSUBFORUMS} {REPLIESX} {THREADSX} {LASTPOST:type=username} {LASTPOST:type=datelink} diff --git a/e107_plugins/forum/templates/forum_viewforum_template.php b/e107_plugins/forum/templates/forum_viewforum_template.php index e67c6151d8..df1e619ce6 100644 --- a/e107_plugins/forum/templates/forum_viewforum_template.php +++ b/e107_plugins/forum/templates/forum_viewforum_template.php @@ -270,7 +270,7 @@ $FORUM_CRUMB['forums']['value'] = "{FORUMS_TITLE}"; $FORUM_CRUMB['forums']['sep'] = " :: "; -$FORUM_CRUMB['parent']['value'] = "{PARENT_TITLE}"; +$FORUM_CRUMB['parent']['value'] = "{PARENT_TITLE}"; $FORUM_CRUMB['parent']['sep'] = " :: "; $FORUM_CRUMB['subparent']['value'] = "{SUBPARENT_TITLE}"; @@ -288,7 +288,7 @@ $FORUM_VIEWFORUM_TEMPLATE['start'] = "
"; $FORUM_VIEWFORUM_TEMPLATE['header'] = "
{BREADCRUMB}
-

{FORUMTITLE}

+

{FORUMIMAGE:h=60}{FORUMTITLE}

{NEWTHREADBUTTONX}
@@ -329,7 +329,7 @@ "; $FORUM_VIEWFORUM_TEMPLATE['sub-item'] = " - +
{NEWFLAG}
{SUB_FORUMTITLE}
{SUB_DESCRIPTION}
{SUB_FORUMIMAGE:h=50}{SUB_FORUMTITLE}
{SUB_DESCRIPTION}
{SUB_REPLIESX}