1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 20:30:39 +02:00

#3733 - Added new 'Forum icon' field

- Renamed forum image to  "Image" (LAN_IMAGE instead of LAN_ICON)
- Added new field forum_icon (LAN_ICON)
- Icon can be used / rendered using {FORUMICON} shortcode in template
- database update requires
- v1 to v2 update needs testing (will do shortly)
This commit is contained in:
Tijn Kuyper
2019-06-06 16:02:46 +02:00
parent 60b7f3ae6d
commit c24ade3b9c
4 changed files with 23 additions and 1 deletions

View File

@@ -140,7 +140,8 @@ if(!deftrue('OLD_FORUMADMIN'))
'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_image' => array ( 'title' => LAN_IMAGE, 'type' => 'image', 'batch'=>false, 'inline'=>false, 'noedit'=>false, 'data' => 'str', 'width' => 'auto', 'help' => 'Image that will be displayed using {FORUMIMAGE}', 'readParms' => '', 'writeParms' => 'media=forum&max=1', 'class' => 'center', 'thclass' => 'center', ),
'forum_icon' => array('title' => LAN_ICON, 'type' => 'icon', 'data' => 'str', 'width' => 'auto', 'help' => 'Icon that will be displayed using {FORUMICON}', 'readParms' => '', 'writeParms' => '', 'class' => 'left', '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', ),

View File

@@ -3,6 +3,7 @@ CREATE TABLE forum (
`forum_name` varchar(250) NOT NULL default '',
`forum_description` text,
`forum_image` varchar(250) DEFAULT NULL,
`forum_icon` 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',

View File

@@ -391,6 +391,16 @@ class forum_shortcodes extends e_shortcode
}
/**
* @example: {FORUMICON: size=2x}
*/
function sc_forumicon($parms = null)
{
if(empty($this->var['forum_icon'])) return '';
return e107::getParser()->toIcon($this->var['forum_icon'], $parms);
}
function sc_forumname($parm = null)
{
if(substr($this->var['forum_name'], 0, 1) == '*')

View File

@@ -155,6 +155,16 @@
return $text." ";
}
/**
* @example: {FORUMICON: size=2x}
*/
function sc_forumicon($parms = null)
{
if(empty($this->var['forum_icon'])) return '';
return e107::getParser()->toIcon($this->var['forum_icon'], $parms);
}
function sc_forumtitle()
{
return $this->var['forum_name'];