Jimako-e107-plugins / e107-old-plugins

Just backup
4 stars 4 forks source link

Shortcodes guide #5

Open Jimmi08 opened 4 years ago

Jimmi08 commented 4 years ago

Shortcodes guide

Shortcodes

How to...

Jimmi08 commented 4 years ago

Shortcodes:Admin

These shortcodes are those used in the admin area of your site.

Contents [hide] 1 {ADMIN_ALT_NAV} 2 {ADMIN_DOCS} 3 {ADMIN_HELP} 4 {ADMIN_ICON} 5 {ADMIN_LANG} 6 {ADMIN_LATEST} 7 {ADMIN_LOG} 8 {ADMIN_LOGGED} 9 {ADMIN_LOGO} 10 {ADMIN_MENU} 11 {ADMIN_MSG} 12 {ADMIN_NAV} 13 {ADMIN_PLUGINS} 14 {ADMIN_PRESET} 15 {ADMIN_PWORD} 16 {ADMIN_SEL_LAN} 17 {ADMIN_SITEINFO} 18 {ADMIN_STATUS} 19 {ADMIN_USERLAN} 20 {ADMIN_CREDITS}

{ADMIN_ALT_NAV} New to .7 is the inclusion in core of the nice drop down navigation menu created by Mike Hall of Brainjar. To use this menu in your admin theme you can use the {ADMIN_ALT_NAV} shortcode in your admin_template.php. If you have not already done so, copy e107_themes/templates/admin_template.php to your themes root directory before editing it.

Unlike most shortcodes, this shortcode requires an additional measure to use. You need to add this code to your theme.php:

Code: theme.php snippet

function theme_head() {
   return "<link rel='stylesheet' href='".e_FILE."nav_menu.css' />\n";
} 

If you would like to style the menu by overriding the default style, copy e107_files/nav_menu.css to your themes root directory. Edit the CSS as you wish and then change the above code you entered into your theme.php to:

Code: theme.php snippet

function theme_head() {
   return "<link rel='stylesheet' href='".THEME."nav_menu.css' />\n";
} 

You can also tailor the javascript itself to your requirements by copying e107_files/nav_menu.js to your themes root directory and editing it as needed.

To change the image icons displayed in the menu please read the section of this manual on admin icons.

A front end version of this menu is also available in core by adding the shortcode {SITELINKS_ALT} to your theme.php. This will share the same stylesheet as your admin menu that we required above so the two menus will match in style.

{ADMIN_DOCS} This shortcode displays a menu containing links to all the admin help documentation.

{ADMIN_HELP} This shortcode displays a menu containing help documentation for the core admin page or plugin admin config page that the user is currently viewing. If no help for the page exists, the menu isnt rendered.

{ADMIN_ICON} Every core admin page has a corresponding 32px x 32px icon registered to it. This shortcode will display this icon in the location you place it in your themes admin_template.php.

Plugins are also able to register a 32px x 32px icon which will also be displayed by this shortcode when the user is on the plugins admin config page(s). If the plugin doesnt have this icon, then a generic plugins icon will be displayed instead.

{ADMIN_LANG} This shortcode outputs a menu containing a language selector for use with multilanguage. If multilanguage is not enabled, the menu will not be displayed.

{ADMIN_LATEST} This shortcode displays information regarding latest details of the sites activity since the administrator was last logged in. This includes details such as number of news items submitted, files uploaded, etc.

Plugins are also able to register to display information in this menu, for example, the forum plugin registers with the menu to display the number of reported forum posts since the admins last visit. For details of how to enable your own plugin to display in this menu, please see the relevant page in the plugin coding section of this manual.

There is an optional parameter with this shortcode which instructs it only to display when a page requests it. To use this feature, add the =request parameter to the shortcode in your admin_template.php like this:

_1. {ADMINLATEST=request} Currently the only page that requests the menu is the admin front page, admin.php. With this parameter specified, the menu will only display on this page and not the rest of the site.

{ADMIN_LOG} This shortcode displays a menu which contains a log of all admin activity so the admin can keep track of all changes that they and other admins of the site have made.

{ADMIN_LOGGED} This shortcode displays the username of the admin who is currently logged in and a list of all the permissions the admin has.

{ADMIN_LOGO} This shortcode displays the admin area logo located at e107_images/adminlogo.png.

{ADMIN_MENU} This shortcode displays a menu on some core and plugin admin pages which contains extra navigation buttons for navigating to other pages of the configuration for that area.

You can style this menu by copying the show_admin_menu() function in e107_admin/header.php to your themes admin_template.php and editing it as required. Here is a copy of that function:

Code: example

function show_admin_menu($title, $page, $e107_vars, $js = FALSE, $js_include = FALSE) {
global $ns;
$text = "<div style='text-align:center; width:100%'><table class='fborder' style='width:98%;'>";
foreach (array_keys($e107_vars) as $act) {
    $pre = "";
    $post = "";
        if ($page == $act) {
            $pre = "<b>« ";
            $post = " »</b>";
        }
        $t = str_replace(" ", " ", $e107_vars[$act]['text']);
        if (!$e107_vars[$act]['perm'] || getperms($e107_vars[$act]['perm'])) {
            $on_click = $js ? "href=\"javascript:showhideit('".$act."');\"" : "href='{$e107_vars[$act]['link']}'";
            $text .= "<tr><td class='button'><div style='width:100%; text-align:center'>
        <a style='cursor:hand; cursor:pointer; text-decoration:none;' ".$on_click." ".$js_include.">
        {$pre}{$t}{$post}</a></div></td></tr>";
        }
    }
$text .= "</table></div>";
if ($title == "") {
        return $text;
}
$ns->tablerender($title, $text);
} 

You can see an edited version of this function in the core theme Jayya's admin_template.php as an example.

{ADMIN_MSG} This shortcode displays a menu displaying a message to the administrator under certain circumstance. Its not often visible.

{ADMIN_NAV} This shortcode displays a navigation menu to the admin for navigating their way around the admin area.

{ADMIN_PLUGINS} This shortcode is designed for plugins to show information.

{ADMIN_PRESET} This shortcode displays a menu on some admin pages which allows the administrator to take snapshots of their form entries and setting once they have filled them in, so that the next time they are editing the form they can copy this snapshot to the form to quicken the form filling process.

{ADMIN_PWORD} This shortcode displays a menu warning the admin that they should change their password. It only displays if it has been 30 days since the admin last update their password.

{ADMIN_SEL_LAN} This shortcode displays a line of text to indicate what language the administrator is currently working in. This shortcode only displays when multilaguage is activated.

{ADMIN_SITEINFO} This shortcode displays a menu containing information about the site, including the site name, details of the theme in use, server details etc.

{ADMIN_STATUS} This shortcode displays information regarding the overall status of the site. This includes details such as number of members, number of comments, number of banned users etc.

Plugins are also able to register to display information in this menu, for example, the forum plugin registers with the menu to display the total number of forum posts. For details of how to enable your own plugin to display in this menu, please see the relevant page in the plugin coding section of this manual.

There is an optional parameter with this shortcode which instructs it only to display when a page requests it. To use this feature, add the =request parameter to the shortcode in your admin_template.php like this:

{ADMIN_STATUS=request} Currently the only page that requests the menu is the admin front page, admin.php. With this parameter specified, the menu will only display on this page and not the rest of the site.

{ADMIN_USERLAN} This menu displays only if mulitlanguage is enabled. It displays the language currently selected.

{ADMIN_CREDITS} Comming soon.

Jimmi08 commented 4 years ago

Shortcodes:ChatBox

These shortcodes are used to style the ChatBox in the theme.php file of your theme. For more information goto Creating a theme from scratch: Chatbox Style.

{USERNAME} Displays the user name.

{TIMEDATE} Displays the time and date of the post.

{MESSAGE} Displays the posted message.

Jimmi08 commented 4 years ago

Shortcodes:Comments

These shortcodes are used to style the Comments in the theme.php file of your theme. These shortcodes can be found in e107_files\shortcode\batch\comment_shortcodes.php .

Contents [hide] 1 {SUBJECT} 2 {USERNAME} 3 {REPLY} 4 {AVATAR} 5 {COMMENTS} 6 {JOINED} 7 {COMMENT} 8 {COMMENTEDIT} 9 {RATING} 10 {IPADDRESS} 11 {LEVEL} 12 {LOCATION} 13 {SIGNATURE}

{SUBJECT} This displays the Subject of the comment.

{USERNAME} This displays the user name as a text link to their profile page.

{REPLY} This displays a reply to link for the current comment. This is only displayed if nested comments in turned on in the Admin section, Site Preferences:Comments.

{AVATAR} This displays the user's avatar.

{COMMENTS} This displays the current number of comments the user has posted.

{JOINED} This displays the date the user joined the website.

{COMMENT} This displays the posted comment.

{COMMENTEDIT} This displays a link allowing the user to edit their comment. It is only displayed if the "Allow posters to edit their comments" option is turned on in the Admin section, Site Preferences:Comments.

{RATING} This will display the user's rating if the user rating system in turned on in the Admin section, Member Options

{IPADDRESS} This displays the IP address of the user. WARNING This displays the FULL address of the user, not good for the security and privacy of your users, use with discretion.

{LEVEL} This displays the users level in the website.

{LOCATION} This displays the users location if filled out in the users profile page.

{SIGNATURE} This will display the users forum signature.

Jimmi08 commented 4 years ago

Shortcodes:Forum

Contents [hide] 1 Forum Shortcodes 2 {ANON_IP} 3 {AVATAR} 4 {CUSTOMTITLE} 5 {EDITIMG} 6 {EMAILIMG} 7 {EMAILITEM} 8 {JOINED} 9 {LASTEDIT} 10 {LATESTPOSTS} 11 {LEVEL} 12 {LOCATION} 13 {MEMBERID} 14 {MODOPTIONS} 15 {POST} 16 {POSTER} 17 {POSTS} 18 {PRINTITEM} 19 {PRIVMESSAGE} 20 {PROFILEIMG} 21 {QUOTEIMG} 22 {REPORTIMG} 23 {RPG} 24 {SIGNATURE} 25 {THREADDATESTAMP} 26 {THREADTOPIC} 27 {TOP} 28 {VISITS} 29 {WEBSITE} 30 {WEBSITEIMG}

Forum Shortcodes These shortcodes are those used in the forum and theme areas of your site and can be found in the forum_shortcodes and forum_post_shortcodes files in the forum plugin.

{ANON_IP} Displays the IP address of non registered users and members that are not logged in to their accounts. This information is available to admins only.

{AVATAR} Displays the avatar of the member posting

{CUSTOMTITLE} Displays the custom title of the member.

{EDITIMG} Displays the linked image that allows members to edit their posts

{EMAILIMG} Shows the image to email the poster.

{EMAILITEM}

{JOINED} Displays date member registered on the site

{LASTEDIT} Displays the date of the last time the post was updated.

{LATESTPOSTS}

{LEVEL} Shows the user's posting level (the stars or admin image).

{LOCATION} Displays the user's location as is filled in in the profile of that user. Location is an extra extended field which is standard included in e107 (predefined fields).

{MEMBERID} Displays the poster's unique id on the e107 website.

{MODOPTIONS} Displays the moderator options of Move, Edit and Delete

{POST} Displays the post.

{POSTER} Shows who posted this post or when in forum overview, who posted the latest post.

{POSTS} Displays the member's post count.

{PRINTITEM}

{PRIVMESSAGE}

{PROFILEIMG} Shows the icon that links to the poster's profile.

{QUOTEIMG} Displays the linked image that allows members to quote previous posts

{REPORTIMG} Displays the linked image that allows members to report a forum post to the admins

{RPG} Displays the user's RPG stats using the built-in RPG mod.

{SIGNATURE} Displays the signature of the poster of this forumpost, it will be displayed wherever this shortcode is placed. Standard location is at the bottom of the post.

{THREADDATESTAMP} Displays the creation date of the thread.

{THREADTOPIC}

{TOP} Shows the link to go back to the top of the page (standard it says: 'top').

{VISITS}

{WEBSITE}

{WEBSITEIMG} Shows the image to visit the poster's website (set in his/her profile).

Jimmi08 commented 4 years ago

Shortcodes:Frontend

These shortcodes are those used in the public area of your site but they may also be used in the admin area in some circumstances.

Contents [hide] 1 {CUSTOM} 1.1 {CUSTOM=search} - Deprecated. 1.2 {CUSTOM=welcomemessage} - Deprecated. 1.3 {CUSTOM=quote} 1.4 {CUSTOM=login} 1.5 {CUSTOM=clock} 1.6 {CUSTOM=language} 2 {LOGO} 3 {MENU} 4 {NEXTPREV} 5 {PLUGIN} 6 {SEARCH} 7 {SITECONTACTINFO} 8 {SITELINKS} 9 {SITELINKS_ALT} 10 {SITENAME} 11 {SITETAG} 12 {SITEDISCLAIMER} 13 {USER_AVATAR} 14 {WMESSAGE} 14.1 {WMESSAGE=header} 14.2 {WMESSAGE=ignore_query} 14.3 {WMESSAGE=force} 15 {BANNER} 16 {E_IMAGE} 17 {EMAIL_ITEM} 17.1 Syntax 18 {EMAILTO} 19 {EXTENDED} - Deprecated 20 {EXTENDED_ICON} 21 {EXTENDED_TEXT} 22 {EXTENDED_VALUE} 23 {IMAGESELECTOR} 24 {LANGUAGELINKS} 25 {LINKSTYLE} 26 {NEWS_ALT} 27 {NEWS_CATEGORIES} 28 {NEWS_CATEGORY} 29 {NEWSFILE} 30 {NEWSIMAGE} 31 {PICTURE} 32 {SETSTYLE} 33 {SITEDISCLAIMER} 34 {USER_EXTENDED} 35 {CONTACT_IMAGECODE} 36 {CONTACT_IMAGECODE_INPUT}

{CUSTOM} The {CUSTOM} shortcode handles various types of output. In essence, these are replacements to the standard menus of the same type. For example, instead of using the standard login menu you can use {CUSTOM=login} which will display a username and password form on your site without the surrounding menu table render. The following pages in this section of the manual will introduce you to the different {CUSTOM} types available to you.

{CUSTOM=search}

Important: As of 0.7.3, this shortcode is deprecated. Please use {SEARCH} and it's accompanying search_template instead. In .7 a new feature has been added to allow the use of an image as your search form input button as an alternative to the browser rendered 'search' button next to the input field.

This is how to use it:

{CUSTOM=search+default} This will display the core default icon image: You can, however, use your own image instead of this default magnifying glass. To do so, upload the image to your themes /images/ directory and change the above shortcode to:

{CUSTOM=search+".THEME."images/my_search.png} Where you replace 'my_search.png' with the name of your search buttons filename.

The default width and height of the image button is 16px x 16px. If your image uses different dimensions to these you can give the correct x and y coordinates like this:

{CUSTOM=search+".THEME."images/my_search.png+30+12} Where the image in this example would be 30 pixels across and 12 pixels high.

{CUSTOM=welcomemessage}

{CUSTOM=quote} This shortcode is used to display a random quote when ever the page is refreshed. To use this you need to have a file named "quote.txt" in you root website folder (where the e107_config.php files is located). The format of quote.txt is simple, each new line is a new quote and will be displayed in the format on that line.

Code: Example quote.txt "Technological progress is like an axe in the hands of a pathological criminal." --Albert Einstein "History will be kind to me for I intend to write it." --Sir Winston Churchill "All you need in this life is ignorance and confidence; then success is sure." --Mark Twain "A bank is a place that will lend you money if you can prove that you don't need it." --Bob Hope This will give you 4 random quotes.

{CUSTOM=login} This shortcode displays a horizontal login menu WITHOUT the image code verification or the forgot password link.

{CUSTOM=clock} This shortcode will display a horizontal clock in this format: Monday, 01 January 2006 01:01

{CUSTOM=language} Displays a drop down box with a list of installed languages for a multi-lingual site.

{LOGO} Displays the site logo. If a image is found at THEME_NAME/images/e_logo.png it will use it, else it uses the default logo image located at e107_images/logo.png.

{MENU} This takes the parameter of the menu area you wish to render.

{MENU=2} - Will render all menus assigned to area #2.

{NEXTPREV} This code is used to generate the next/previous buttons often found on pages that contain long listings from the database. The following example, will display 30 rows from the database on each page.


  $from = ($_GET['frm']) ? $_GET['frm'] : 0;
  $view = 30;

  $total_items = $sql -> db_Select("download", "*", "download_author='$usernm'");
  $sql -> db_Select("download", "*", "download_author='$usernm' LIMIT $from,$view");
  while($row = $sql-> db_Fetch()){
     $text .= "text-here".$row['fieldname'];
   }

 $parms = $total_items.",".$view.",".$from.",".e_SELF.'?frm=[FROM]';
 $text .= $tp->parseTemplate("{NEXTPREV={$parms}}");

echo $text;

{PLUGIN} This code will allow you to place a specific plugin menu anywhere you want. You should enter the path to the menu as the parameter. If no directory is given, it is assumed to be the same as the plugin name. Do not provide .php extension.

{PLUGIN=chatbox_menu} - File is assumed to be e_PLUGIN/chatbox_menu/chatbox_menu.php {PLUGIN=forum/newforumposts_menu} - File is assumed to be e_PLUGIN/forum/newforumposts_menu.php

{SEARCH} Adding this shortcode to your theme will place a small search box and button on the page which will search all the default search areas of your site. (see admin/search). You can however, customize it to search one particular section if you wish. Here are some examples:

{SEARCH=news} - Search only news items. {SEARCH=comments} - Search comments only. {SEARCH=users} - Search for users only. (members) {SEARCH=downloads} - Search in downloads only. {SEARCH=pages} - Search within custom pages. On plugins that support searching, you can also give the folder name of the plugin you wish to search within. For example, to search within the chatbox plugin, which has a folder in e107_plugins by the same name, you would use {SEARCH=chatbox}.

{SITECONTACTINFO} Displays the site contact information which is set in the Admin section under the Site Preferences:Site Information.

{SITELINKS} This displays the basic site navigation menu. More to come.

{SITELINKS_ALT} This displays an advanced site navigation menu.

The presented links menu requires a mouse click on a parent to enable the dropdown.

To make it auto expand on mouseover you need to use: {SITELINKS_ALT=no_icons+noclick}

{SITENAME} Returns the current 'site name' as configured in preferences.

{SITETAG} Returns the current 'site tag' as configured in preferences.

{SITEDISCLAIMER} Returns the current 'Site Disclaimer' as configured in preferences.

{USER_AVATAR} {USER_AVATAR} - Will show the current logged-in user's avatar. {USER_AVATAR=4} - Will show the avatar of userid #4. {USER_AVATAR=path_to_image} - Will show that image

{WMESSAGE} The welcome message may be placed immediately following the header, or explicitly using a theme template, dependent on the option selected. This description primarily covers use within a template.

The welcome message display is also affected by the 'front page' options set for particular user classes. (It looks as if it usually only appears on the user's 'Home' page as set).

There are several optional parameters:

{WMESSAGE=header} Linked with the admin option 'Override standard system to use'.

{WMESSAGE=ignore_query} Appears to cause the welcome message to ignore the query part of the URL in determining whether a page match has occurred.

{WMESSAGE=force} Appears to cause the welcome message to appear on every page?

{BANNER} Displays a banner, from the banner system in e107, at its placed location.

{banner=ABCD} will only display banners from a campaign with name ABCD.

{banner} will rotate through the banners in all campaigns.

{E_IMAGE} This will return the value of "$IMAGES_DIRECTORY". More information on "$IMAGES_DIRECTORY" can be found at Change your e107 folder names.

{EMAIL_ITEM} This displays a link to "Recommend This" by email.

Syntax message^source^other_parms

message: sets the alt and the title attribute of the link source: sets the link to be emailed ^: separates the different parameters Code: Example code {EMAIL_ITEM=news.php^news.php} Result

Code: Result

<a href='email.php?news.php'>
<img src='e107_images/generic/lite/email.png' style='border:0' alt='news.php' title='news.php'/>
</a>

{EMAILTO} This creates an email link. You must set the "IMAGE_email" constant. It will only display the link for members

Code: Example theme.php

define("IMAGE_email", "Email"); //gives you a text link
define("IMAGE_email", "<img src='email.png'/>"); //gives you an image link
define("IMAGE_email", "<img src='email.png'/> Email"); //gives you both an image and text link
define("IMAGE_email", "<img src='".e_IMAGE."generic/".IMODE."/email.png' style='border:0'/>"); //gives you e107's default email icon
{EMAILTO=1} //will create a email link to the user with the id of 1
{EMAILTO=none@none.com} //will create a link to this email address

{EXTENDED} - Deprecated Use {USER_EXTENDED} instead.

{EXTENDED_ICON} This will show the icon for a extended user field. Usage is {EXTENDED_ICON=.}. This is also the same as using {USER_EXTENDED=.icon.}.

EXAMPLE:

{EXTENDED_ICON=user_gender.5}
{USER_EXTENDED=user_gender.icon.5}

These both will show the icon of the extended field user_gender for user #5.

{EXTENDED_TEXT} This will show the text for a extended user field. Usage is {EXTENDED_TEXT=.}. This is also the same as using {USER_EXTENDED=.text.}.

EXAMPLE:

{EXTENDED_TEXT=user_gender.5}
{USER_EXTENDED=user_gender.text.5}

These both will show the text of the extended field user_gender for user #5.

{EXTENDED_VALUE} This will show the value for a extended user field. Usage is {EXTENDED_VALUE=.}. This is also the same as using {USER_EXTENDED=.value.}.

EXAMPLE:

{EXTENDED_VALUE=user_gender.5}
{USER_EXTENDED=user_gender.value.5}

These both will show the text of the extended field user_gender for user #5.

{IMAGESELECTOR} This will create a image selection dialog and preview box. Usage: {IMAGESELECTOR=<name>,<path>,<default>,<width>,<height>,<multiple>,<label>}.

Parameters name: This is the select box "name" and "id" as well as the img "id" attributes. path: This is the image directory path. default: This is the default image that will be displayed when the preview box. width: This is the width of the preview box (uses "style" not "width" img attribute). height: This is the height of the preview box (uses "style" not "height" img attribute). multiple: This allows a multiple select box. To enable this option use "TRUE" or "1". label: The is the label for the select box. Code: Example

{IMAGESELECTOR=choose_image,e107_images,/logo.png,100px,100px,0,Select an Image}
{IMAGESELECTOR=choose_image2,e107_images,,,,1}

Would output:

Code: Example Source

<!-- Start Image Selector -->

<select style='float:left' class='tbox' name='choose_image' id='choose_image' onchange="preview_image('choose_image','e107_images');">
    <option value=''>Select an Image</option>
<option value='adminlogo.png'>adminlogo.png</option>
<option value='advanced.png'>advanced.png</option>
<option value='button.png'>button.png</option>
<option value='e107_icon_16.png'>e107_icon_16.png</option>

<option value='e107_icon_32.png'>e107_icon_32.png</option>
<option value='logo.png'>logo.png</option>
<option value='logo_template.png'>logo_template.png</option>
<option value='logo_template_large.png'>logo_template_large.png</option>
<option value='pcmag.png'>pcmag.png</option>
<option value='splash.jpg'>splash.jpg</option>
</select> <img id='choose_image_prev' src='e107_images/logo.png' alt='' style='width:100px;height:100px' />

<!-- End Image Selector -->

<!-- Start Image Selector -->

<select multiple='multiple' style='height:' class='tbox' name='choose_image2' id='choose_image2' onchange="preview_image('choose_image2','e107_images');">
    <option value=''> -- -- </option>
<option value='adminlogo.png'>adminlogo.png</option>
<option value='advanced.png'>advanced.png</option>
<option value='button.png'>button.png</option>
<option value='e107_icon_16.png'>e107_icon_16.png</option>

<option value='e107_icon_32.png'>e107_icon_32.png</option>
<option value='logo.png'>logo.png</option>
<option value='logo_template.png'>logo_template.png</option>
<option value='logo_template_large.png'>logo_template_large.png</option>
<option value='pcmag.png'>pcmag.png</option>
<option value='splash.jpg'>splash.jpg</option>
</select> <img id='choose_image2_prev' src='e107_images/generic/blank.gif' alt='' style='width:*;height:*' />

<!-- End Image Selector -->

{LANGUAGELINKS} Adding the {LANGUAGELINKS} shortcode to your theme will render a link in the native language of each language that is available on your site in the e107_languages folder, separated by a |. e.g.

English | Français | 한국어 It may be customized by giving the shortcode the languages you wish to render. ie. If you have multiple language folders on your server (in e107_languages/), but only wish to render some of them, you can use a comma separated list in the $parm area of the shortcode: e.g.

{LANGUAGELINKS=English,French,Korean} would render the first example above. If you wish to change the default separator, this can be done by defining the following in your theme.php file:

define("LANGLINKS_SEPARATOR"," x "); which would render links that look something like this:

English x Français x 한국어 The links generated by this shortcode can be customized further using the css classes: languagelink and languagelink_active. e.g.

a.languagelink:link, a.languagelink:visited {
    color: white;
}

a.languagelink_active:link, a.languagelink_active:visited {
    color: white;
    text-decoration: underline;
}

{LINKSTYLE} Coming soon.

{NEWS_ALT} This displays the latest news from a chosen category using its ID number. It will use the $NEWSSTYLE format from your theme.php.

Code: Example {NEWS_ALT=1} This would display the latest new from the new category with the ID of 1.

{NEWS_CATEGORIES} This displays the News Categories list.

{NEWS_CATEGORY} This is a synonym for {NEWS_ALT}.

{NEWSFILE} This creates a direct download link to a file in the downloads directory.

Code: Example {NEWSFILE=test.zip} Would output this:

Code: Example Output

<img src='e107_images/generic/lite/download.png' alt='' style='vertical-align: middle;' /> 
<a href='e107_files/downloads/test.zip'>test.zip</a>

{NEWSIMAGE} This displays an image from the e107_images/newspost_images directory as well as a link to the last news item to have that image.

Code: Example {NEWSIMAGE=test.png} Would output this:

Code: Example Output <a href='news.php?item.3.2'><img class='news_image' src='e107_images/newspost_images/test.png' alt='' style='border:0px' /></a>

{PICTURE} This displays the picture of a user.

Code: Example {PICTURE=1} This would display the picture of the user with the ID of 1.

{SETSTYLE} This shortcode is allows for multiple styles. See Advanced theme creation: Multiple Theme Menu Styles on how to use it.

{SITEDISCLAIMER} This display the site disclaimer as it is set in the Admin:Site Preferences.

{USER_EXTENDED} This will display an extended user field. Usage is {USER_EXTENDED=.[text|value|icon].}.

EXAMPLE:

{USER_EXTENDED=gender.value.5} This will show the value of the extended field user_gender for user #5.

{CONTACT_IMAGECODE} This will display the image verification code, used on login page, contact page, register, forum submit etc.

{CONTACT_IMAGECODE_INPUT} This is the box to enter the image verification code from above (EG. {CONTACT_IMAGECODE}). Used to validate all the forms (login, signup, forum posting) you want to protect with the image verification code by the spammers. You must enter in the code from the generated image in this box to validate.

Jimmi08 commented 4 years ago

Shortcodes:News

Contents
1 {NEWSTITLE} 2 {NEWSBODY} 3 {NEWSICON} 4 {NEWSHEADER} 5 {NEWSCATEGORY} 6 {NEWSAUTHOR} 6.1 Parameters 7 {NEWSDATE} 7.1 Parameters 8 {NEWSCOMMENTS} 9 {NEWSCOMMENTLINK} 10 {NEWSCOMMENTCOUNT} 11 {EMAILICON} 12 {PRINTICON} 13 {PDFICON} 14 {NEWSID} 15 {ADMINOPTIONS} 16 {EXTENDED} 17 {CAPTIONCLASS} 18 {ADMINCAPTION} 19 {ADMINBODY} 20 {NEWSSUMMARY} 21 {NEWSTHUMBNAIL} 22 {NEWSIMAGE} 23 {STICKY_ICON} 24 {NEWSTITLELINK} 24.1 Parameters 25 {NEWSCATICON} 26 {TRACKBACK} 27 {NEWSINFO}

{NEWSTITLE} Displays the title of the news article.

{NEWSBODY} Displays the news item's body.

{NEWSICON} Displays the news category icon and makes it a link to that category page.

{NEWSHEADER} Contains the path to the news category's icon. With this you can display the icon without the link.

Code: example <img src='{NEWSHEADER}' />

{NEWSCATEGORY} This displays the name of the category in a link to the category page.

{NEWSAUTHOR} Displays the user name of the news author.

Parameters {NEWSAUTHOR=nolink}: removes the link to the author's Member Profile page.

{NEWSDATE} Displays the time and date stamp of the news article.

Parameters

{NEWSDATE}: Monday 01 January 2006 - 01:01:01
{NEWSDATE=long}: Monday 01 January 2006 - 01:01:01
{NEWSDATE=short}: 01 Jan : 01:01
{NEWSDATE=forum}: Mon Jan 01 2006, 01:01AM

{NEWSCOMMENTS} Displays a link and the number of comments for that news article. Inorder for {NEWSCOMMENTS} to work properly you need to set the COMMENTLINK constant.

Code: example theme.php

define("COMMENTLINK", "comment(s): ");

$NEWSSTYLE = "{NEWSCOMMENTS}";

If the news item has 2 comments it will output:

Code: example

comment(s): 2

You should use a language files for the COMMENTLINK constant, but I won't go into that. See this link for more information: Creating a theme from scratch: Language Information

{NEWSCOMMENTLINK} Similar to {NEWSCOMMENTS}, but this does not display the number of comments.

{NEWSCOMMENTCOUNT} Displays the number of comments for the current news item.

{EMAILICON} Displays a image link so the news item can be emailed to others.

Override this icon by placing an email.png in your images/ folder of your theme.

{PRINTICON} Displays a image link to a printable version of the news item.

Override this icon by placing a print.png in your images/ folder of your theme.

{PDFICON} Displays a link to a pdf version of the news item (only is displayed if the PDF plugin is installed).

{NEWSID} Displays the news item's id number.

{ADMINOPTIONS} This displays a image link allowing the news item to be edited by an administrator. This is only visible if you are an administrator.

Override this icon by placing a newsedit.png in your images/ folder of your theme.

{EXTENDED} Displays a link to the news item's extended page, it is only visible if there was an extended post for the news item. You can format the link with the constants PRE_EXTENDEDSTRING, EXTENDEDSTRING, and POST_EXTENDEDSTRING.

Code: example theme.php


define("PRE_EXTENDEDSTRING", "<br /><br />[ ");
define("EXTENDEDSTRING", "Read the rest ...");
define("POST_EXTENDEDSTRING", " ]<br />");

$NEWSSTYLE = "{EXTENDED}";

If news item_#3 has an extended post it will output:

Code: example

<br /><br />[ <a href='news.php?extend.3'>Read the rest ...</a> ]<br />

You should use a language files for the PRE_EXTENDEDSTRING, EXTENDEDSTRING, and POST_EXTENDEDSTRING constants, or at least the EXTENDEDSTRING constant, but I won't go into that. See this link for more information: Creating a theme from scratch: Language Information

Note: In 0.7.5 and earlier there was a potential conflict because the {EXTENDED} shortcode was also used in user-related fields. For 0.7.6 {USER_EXTENDED} has been defined, and {EXTENDED} applies only to news.

{CAPTIONCLASS} This gives you a DIV tag with a the class='category(category_id)'. For example, in the default install of e107 it comes with a category named "Misc" this an id of "1" with a news item title "Welcome to e107" so the output would be:

Code: example output <div class='category1'>Welcome to e107</div>

{ADMINCAPTION} comming soon

{ADMINBODY} comming soon

{NEWSSUMMARY} Displays the news item's summary.

{NEWSTHUMBNAIL} This displays the image chosen for the news item. It is the same as the {NEWSIMAGE}.

{NEWSIMAGE} This displays the image chosen for the news item. It is the same as the {NEWSTHUMBNAIL}.

{STICKY_ICON} This displays the sticky image icon on the news item if the item is set to sticky.

{NEWSTITLELINK} This displays the news title as a link. The link goes to a separate page for that news item.

Parameters {NEWSTITLELINK=item}: Link goes to short version of item (default) {NEWSTITLELINK=extend}: Will make the newstitle link go directly to the extended view of the item

{NEWSCATICON} This displays the category icon, as a link, that the news item is in.

{TRACKBACK} This displays the trackback link. It also requires the TRACKBACKSTRING constant and the TRACKBACKBEFORESTRING constant.

Code: example theme.php

define("TRACKBACKSTRING", "Trackback");
define("TRACKBACKBEFORESTRING", " :: ");

$NEWSSTYLE = "{TRACKBACK}"; This would output a link like:

Code: Output :: <a href='comment.php?comment.news.3#track'>Trackbacks: </a> You should use a language files for the TRACKBACKSTRING constant, but I won't go into that. See this link for more information: Creating a theme from scratch: Language Information

{NEWSINFO} This displays all sort of information on the news item such as start date, end date, render type, news class, if it is sticky, does it allow comments, body length (in bytes), and the extended length (in bytes).

Jimmi08 commented 4 years ago

Shortcodes:Users

These shortcodes are those used in user-related items of your site and can be found in the e107_files/shortcode/batch/user_shortcodes.php and e107_files/shortcode/batch/usersettings_shortcodes.php files. There are also some individual shortcodes.

All fields display the data for the currently selected user.

For user settings, the data is taken from the current form.

Users User Settings Meaning/Usage USERNAME Display name for user LOGINNAME Login name for user CUSTOMTITLE REALNAME
PASSWORD1
PASSWORD2
PASSWORD_LEN Returns the value in $pref['signup_pass_len'] EMAIL
HIDEEMAIL
USERCLASSES Non-admins only. Returns a list of checkboxes SIGNATURE
SIGNATURE_HELP Returns a standard help message TIMEZONE Returns a drop-down box for time zone selection AVATAR_UPLOAD
AVATAR_REMOTE
AVATAR_CHOOSE
PHOTO_UPLOAD
XUP If XUP files enabled USEREXTENDED_ALL
USEREXTENDED_CAT
USEREXTENDED_FIELD
TOTAL_CHATPOSTS
TOTAL_COMMENTPOSTS

INDIVIDUAL SHORTCODES

{USER_EXTENDED} (from 0.7.6) Replaces the {EXTENDED} shortcode to avoid conflicts with news.

USAGE: {USER_EXTENDED=.[text|value|icon].}

EXAMPLE: {USER_EXTENDED=gender.value.5} will show the value of the extended field gender for user#5

Note: Within the database, all the field names are prefixed with 'user_'. However this is automatically added within the shortcode. If the user_id is zero, and the global variable $loop_id is defined, gets the extended fields for the user id specified by $loop_id.

{EXTENDED} (deprecated) Replaced by {USER_EXTENDED} in 0.7.6 - see that shortcode for a description.

Jimmi08 commented 4 years ago

Contact form shortcodes https://github.com/Jimmi08/e107-old-plugins/issues/4#issuecomment-569399541

Jimmi08 commented 4 years ago

User Journal shortcodes: https://github.com/Jimmi08/e107-old-plugins/issues/6#issuecomment-569399782

Jimmi08 commented 4 years ago

Shortcodes:Formatting

Many times you would like to add formatting around a shortcode only if the shortcode renders something.

This is now possible with the $sc_style array.

Example For example, you may want to show a user avatar inside a DIV. If the user does not have an avatar configured, you don't even want the DIV to appear.

In your theme.php you would add something like:

Code: theme.php snippet

$sc_style['AVATAR']['pre'] = "<div class='myclass'>";
$sc_style['AVATAR']['post'] = "</div>"; 

When the shortcode engine renders the {AVATAR} shortcode, it will attach the 'pre' and 'post' strings to the return value only if it has some content (i.e. is not an empty string).

Template Shortcoding For templates such as the content management and forum plugins you may wish to add shortcodes to a shortcode.php file. In these instances you will have to declare the shortcodes as a Global Variable within the shortcode.php file to use formatting.

Template Shortcoding Example Suppose you want to add a simple shortcode to the content management application that returns an integer ID of the content parent category within the content_content template. This is a silly example because the shortcode will always return a value, but it nonetheless illustrates the formatting.

In content_shortcodes.php you would add something like:

Code: shortcode to return parent id

SC_BEGIN CONTENT_PARENT_ID
global $CONTENT_PARENT_ID, $row;
$CONTENT_PARENT_ID = intval($row['content_parent']);
return $CONTENT_PARENT_ID;
SC_END 

You should now be able to add formatting to {CONTENT_PARENT_ID} in your template.

Jimmi08 commented 4 years ago

Shortcodes:Prerender Shortcode

Pre-rendering shortcodes

Some shortcodes can be pre-rendered in your theme.php or admin_template.php etc, so you can alter your themes output based on what is contained within your pre-renders.

This is best illustrated with an example...

In the admin area you will have noticed that after 30 days a menu appears that warns you that your password hasnt been updated and that you should now recreate it. This menu is rendered by the shortcode {ADMIN_PWORD} which is found in your admin_template.php.

Perhaps you feel that the warning isnt strong enough and you want to display a big red warning message graphic above the menu when it is displayed.

If you were to do the following code in your admin_template.php you will quickly notice a problem:

1. $ADMIN_HEADER .= "<img src='big_red_warning.png' /> {ADMIN_PWORD}";

The problem is that your big red warning graphic will always show, even when the users password is not in need of being updated and the menu isnt being displayed.

A way round this problem would be to pre-render the shortcode so you can test if its active and if so display your graphic and if not, dont display it.

The first step then is to do the pre-render:

1. $admin_password = $tp -> parseTemplate('{ADMIN_PWORD}');

We do this before we define $ADMIN_HEADER. What has happened is that the shortcode has been processed early and the output from it, if there is any (ie. if the password needs updating and the menu is to be displayed), has been collated into the variable we created called $admin_password.

If the menu isnt to be displayed, this variable wont contain any data - ie. it will be an empty string: "".

Now we know this information we can create a rule when building our $ADMIN_HEADER to determine if the $admin_password variable contains the menu or an empty string and if it does we display our big red warning graphic, if it doesnt we dont display the graphic. Here's the code:

  1. $admin_password = $tp -> parseTemplate('{ADMIN_PWORD}');
  2.
  3. if ($admin_password!="") {
  4. $ADMIN_HEADER .= "<img src='big_red_warning.png' /> ".$admin_password;
  5. } 

Obviously, you need to know PHP to take full advantage of pre-rendering, but this additional feature will allow you to create truly dynamic themes.

Jimmi08 commented 4 years ago

Shortcodes:Themes

Contents
1 Adding or overriding shortcodes with your theme 2 Example: Create a shortcode to style individual menus 2.1 Create the testshortcode.sc file 2.2 Modify your theme.php file 2.3 What you should see

Adding or overriding shortcodes with your theme You can now create your own shortcodes or override the existing core shortcodes from your theme. Add the following line to your theme.php file:

Code: Line to add to top of theme.php file $register_sc[]='XXXX'; This tells e107 that this theme will be handling all requests for the {XXXX} shortcode. You will then just add a xxxx.sc file in your root theme dir. You can now use the {XXXX} shortcode in your theme; however, you must also make sure that any code that includes {XXXX} ultimately gets parsed by $tp -> parseTemplate.

For instance, you probably can include {XXXX} within $HEADER since $HEADER is parsed. You could NOT include it within theme as

Code: This won't work without parsing echo ({XXXX}); See e107_files/shortcodes for sample files.

Example: Create a shortcode to style individual menus Sound complex? If you're comfortable with HTML and a bit of PHP the following example should help illustrate the concepts. Here is an example of a simple shortcode that will help you customize your theme by displaying the mode and style of a table. Once you know mode and style you can customize each table differently as described in Styling individual menus.

Create the testshortcode.sc file Create the testshortcode.sc file and store it in your root theme directory (same directory as you theme.php file).

Code: testshortcode.sc

global $globalmode, $style;
$ret='';
if (is_array($globalmode)) {
  $ret .= 'mode[0]='.$globalmode[0].'<br/>';
  $ret .= 'mode[1]='.$globalmode[1].'<br/>';

} else {
  $ret .= 'mode='.$globalmode.'<br/>';
}
$ret .= 'style='.$style.'<br/>';
return $ret;

Modify your theme.php file Create the shortcode register at the top of your theme.

Code: Put at the top of your theme $register_sc[] = 'TESTSHORTCODE'; Create the global variables within your function tablestyle if you do not already have them.

Code: Put inside function tablestyle($caption, $text, $mode){...}

global $style;
global $tp, $globalmode;
$globalmode = $mode;  //need a new global variable since $mode is not global
//echo $tp -> parseTemplate('{TESTSHORTCODE}');  //uncomment this line to see the mode and style of every table

What you should see If everything is working properly AND you uncommented the //echo $tp -> .... line above, you should see something like

mode[0]=forum
mode[1]=main3
style=default

when you visit your forum.php page, and

mode=login
style=leftmenu

above your left menu.

Just for giggles, try using {TESTSHORTCODE} in other parts of your theme with and without the parsing statements to see what happens.

Mighty and armed, you're now ready to Style your individual menus.

Jimmi08 commented 4 years ago

Shortcodes:Override Plugin Shortcodes

Contents 1 Warning 2 Scope 3 Why Override? 4 The Hack 4.1 Example from Content Management 5 Troubleshooting 6 e107 developers: I'm begging you... 6.1 Use Shortcodes and Templates 6.2 Enable Formatting 6.3 Enable shortcode overriding/extending 6.4 Allow shortcodes to be added to all template variables

Warning This is a hack, albeit a minor one. Only follow this procedure if you KNOW WHAT YOU ARE DOING.

Scope There are a lot of ways to use and implement shortcodes. This discussion relates to overriding shortcodes in a shortcodes.php file such as content_shortcodes.php from Content Management Plugin by lisa.

Why Override? Suppose you want to make a minor change to a shortcode or add a new shortcode to a plugin for use in a template. You can hack and modify the plugin shortcode file directly but you will have to make multiple changes during each upgrade. After parsing, the shortcodes file is stored as an array. You can easily add to this array and override/add new shortcodes.

The Hack At the top of the shortcode file, add the following one-line of code:

$shortcodes_variable = array_merge ($shortcodes_variable, $tp -> e_sc -> parse_scbatch("your_shortcode_file.php"));

You then create your_shortcode_file.php with the name of the existing shortcode if you want to override or the name of a new shortcode.

Example from Content Management At the top of my content_shortcodes.php file I have the following:

if (!defined('e107_INIT')) { exit; }
include_once(e_HANDLER.'shortcode_handler.php');
$content_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__);
//KMD Hack below
$content_shortcodes = array_merge ($content_shortcodes, $tp -> e_sc -> parse_scbatch(THEME."KMD_shortcodes.php"));
//

I also created a "KMD_shortcodes.php" file in my theme directory which looks something like:

<?php
if (!defined('e107_INIT')) { exit; }
include_once(e_HANDLER.'shortcode_handler.php');
$KMD_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__);

//returns the author's name without a hyperlink
SC_BEGIN CONTENT_AUTHOR_NOLINK
global  $row, $aa, $CONTENT_AUTHOR_NOLINK;
$author_array   = $aa -> getAuthor($row['content_author']);
$CONTENT_AUTHOR_NOLINK = $author_array[1];
return $CONTENT_AUTHOR_NOLINK;
SC_END

...lots of other shortcodes...

?>

And that is pretty much it.

Troubleshooting Keep in mind that - as always - you cannot always add shorcodes to every variable in a template. You have to look at the source code to make sure that the variable is ultimately parsed. For example, look for a line like:

$content_type_table_string .= $tp -> parseTemplate($CONTENT_TYPE_TABLE, FALSE, $content_shortcodes); So if your shortcode puts out {MY_SNAZZY_SHORTCODE} on the screen instead of the HTML you were expecting, you probably have declared a variable that isn't parsed.

e107 developers: I'm begging you... Finally, a couple of quick unsolicited opinions/requests for the e107 developers.

Use Shortcodes and Templates Shortcodes are a great way to separate the display from the code. Please use them wherever possible and declare your variables containing HTML-generated code in templates. Look at lisa's example with Content Management. Although his template system was difficult for me to follow at first, his approach is absolutely the way to go.

Enable Formatting Always, always, always return the shortcode variables as (from the example above)

$CONTENT_AUTHOR_NOLINK = $author_array[1];
return $CONTENT_AUTHOR_NOLINK;
and not
$ret = $author_array[1];
return $ret;

That way we can format them as in Shortcodes:Formatting. Again, lisa has done a great job with this in Content Management.

Enable shortcode overriding/extending The hack above can be added to any shortcode.php file along the lines of "if file exists extend this array with...."

Allow shortcodes to be added to all template variables Parse ALL of your template variables containing HTML with $tp->parseTemplate. That we we can add shortcodes anywhere we want and can cut down on the number of hacks. There are other ways to add shortcodes but it will be must easier for everyone if we develop a consistent approach.

Sorry for the rant.

Jimmi08 commented 4 years ago

Shortcodes, adding to the forum

Contents 1 Adding Shortcodes to the Forum 2 Adding a custom picture to the forum 2.1 Creating the shortcode 2.2 Further explanation

Adding Shortcodes to the Forum The principles of adding shortcodes to the forum are much the same as adding them elsewhere; however there are some forum-specific codes. These are listed here.

The following is an extract from a forum post which give an idea of modifying the layout of a forum thread:

You will need to identify the correct template file to edit - the defaults are in e107_plugins/forum/templates; however some themes override them with alternative files of the same names, in which case they will be in the theme directory. Probably forum_viewforum_template.php will be what you want. Look at this in a text editor (even Notepad will do), and you should be able to see the correspondence with your forum layout. At line 89 in the default file is a line starting: $FORUMTHREADSTYLE = .... the text which follows sets the format of each post. It is a mix of HTML and shortcodes, so you do need to at least understand a bit of HTML.

A little way down you will see: {EXTENDED=location.text}: {EXTENDED=location.value}

this is displaying information from the extended user fields - location.text is the 'description', and location.value is the actual value. You can add fields in a similar format to pull out your other extended user fields.

Adding a custom picture to the forum It is possible to create a shortcode which displays a picture (or 'badge') against a user in the forum, dependent on the user class(es) they belong to. An example of this is the 'Support Team' picture used in the E107 forums.

Creating the shortcode Create a file called 'title.sc' where title is the code you will be using to show the special picture (eg. support.sc).

Put the following code into that page


           // set global to $post_info for forum & $user for profile
           global $post_info, $user;

           // --> EDIT THE FOLLOWING <--
           // use the following to list the classes with their pictures, from most important (1) to least important (4)

           // this is the most important userclass
           $rank_no1 = "Owner";
           // this is the picture that needs to be showed with this userclass on forum/profile (examples used)
           $rank_no1_pic = "<img src='".THEME_ABS."yourranks/owner.gif' />";

           $rank_no2 = "Administrator";
           $rank_no2_pic = "<img src='".THEME_ABS."yourranks/administrator.gif' />";

           $rank_no3 = "Moderator";
           $rank_no3_pic = "<img src='".THEME_ABS."yourranks/moderator.gif' />";

           $rank_no4 = "Forum mod";
           $rank_no4_pic = "<img src='".THEME_ABS."yourranks/forum_mod.gif' />";
           // --> STOP EDIT <--

           if(check_class($rank_no4, $post_info['user_class'], TRUE) || check_class($rank_no4, $user['user_class'], TRUE))
           {
              $output = "<div align='center'>$rank_no4_pic</div>";
           }
           if(check_class($rank_no3, $post_info['user_class'], TRUE) || check_class($rank_no3, $user['user_class'], TRUE))
           {
              $output = "<div align='center'>$rank_no3_pic</div>";
           }
           if(check_class($rank_no2, $post_info['user_class'], TRUE) || check_class($rank_no2, $user['user_class'], TRUE))
           {
               $output = "<div align='center'>$rank_no2_pic</div>";
           }
           if(check_class($rank_no1, $post_info['user_class'], TRUE) || check_class($rank_no1, $user['user_class'], TRUE))
           {
                   $output = "<div align='center'>$rank_no1_pic</div>";
           }
           return $output;

 // End of code extract

Once you have prepared this file, and the associated graphics, proceed as follows:

Upload this file to e107_files/shortcode/ Go to e107_plugins/forum/templates/ Open/edit the file 'forum_viewtopic_template.php' Find'$FORUMTHREADSTYLE' Under the {POSTS} add your shortcode - {SUPPORT} Add the shortcode also under {POSTS} under '$FORUMREPLYSTYLE'

The images work in the forum now, if you want them to show in the profiles continue: Go to e107_themes/templates/ Open 'user_template.php' Find the entry '{$sendpm}' add your shortcode under it (i tried it in different places, but some issues resulted - nothing showed up)

Go to the top of the page Directly under the entry $sc_style['USER_SIGNATURE']['post'] = "</td></tr>"; ADD

 $sc_style['SUPPORT']['pre'] = "<tr><td colspan='2' class='forumheader3' style='text-align:left'>";
 $sc_style['SUPPORT']['post'] = "</td></tr>";

this way the layout of your profile is not messed up. You're finished

Further explanation Just take there are 3 userclasses (examples from e107)

the e107 developers (highest rank within the classes) the e107 moderators (2nd rank within classes) the e107 support team (3rd rank within classes)

If someone belongs to more than 1 group (eg 2dopey is both support and moderator), we want the picture for the highest rank within the classes to be showed. In the forums we want a picture of a moderator for 2dopey, not support as this is of a lower rank.

I used the ranks to make the distinction as to what should be showed. If a developer is also a moderator, we want the picture of developer to show, not a moderator. Therefore a ranking of these classes is made within this script.

Jimmi08 commented 4 years ago

Shortcodes, adding to a plugin

As of e107 v0.7.6 there are two ways to add shortcodes to your plugin:

1. adding any file in your plugin folder with the extension .sc

You will then just need to include a newcode.sc file in your main plugin directory. See e107_files/shortcodes for sample files. Whenever {NEWCODE} is found, it will be replaced with the code returned from your newcode.sc

2. adding an e_sc.php file in your plugin folder. (to be continued)

Note: To be sure that your shortcode is registered in e107, check the Preference Viewer in admin -> database and look for your file in the pref called shortcode_list. If it is not shown, run the Plugin Scan & View in admin -> database.