Simple:Press Documentation

Theme Changes 5.3.0 to 5.3.4

If you have created a custom theme then this will not be automatically updated when you upgrade Simple:Press to version 5.3.0. If you would like to take advantage of any new features that 5.3.0 offers then these notes outline the main changes. These are based upon the Default theme. We recommend that you use an editor that has good file compare functionality so that you can easily see these changes in the Default theme and apply any desired changes to your own if you choose to do so.

Your theme should continue to work using Simple:Press 5.3.0 without making any changes. Our goal has been not to disturb custom themes but sometimes this is beyond our control. Where this happen – or if you wish to take advantage of new features, some changes will be required.

New Theme Icons

The following theme icon (the theme ‘images’ folder) has been added to 5.3.0:

sp_SubForumUnreadIcon.png – Used for showing unread posts in subforums on group view and forum view

If you decide to use this new icon, it can be copied from the default/images folder to your own theme images folder.

Template Changes

Template: spFunctions.php

The Font Resizer code has been removed from this template code file and is now in the Font Resizer plugin itself.

The code will look like this – with your own theme name substituted:

if (function_exists('sp_FontResizer')) {
	add_action('sph_BeforeDisplayStart', 'spDefault_spShowFontResize');
}

function spDefault_spShowFontResize() {
	$tipMinus = __sp('decrease forum font size');
	$tipReset = __sp('reset forum font size');
	$tipPlus  = __sp('increase font size');
	sp_FontResizer('tagClass=spFontSizeControl spRight', $tipMinus, $tipReset, $tipPlus);
	sp_InsertBreak('direction-right');
}

Simply remove it and update the Font Resizer plugin

Template: spHead.php

The Admin Bar plugin admin queue template function has been changed to accept some classes and labels insted of being hard-coded.
This will break all existing custom themes that use the admin bar plugin.

To keep using as is, make the following change:

sp_AdminQueue('tagClass=spLeft');

to:

sp_AdminQueue('tagClass=spLeft&buttonClass=spLeft spButton&countClass=spLeft spButtonAsLabel', __sp('View New Posts'), __sp('Unread: '), __sp('Need Moderation: '), __sp('Spam: '), __sp('Open/Close the Admin Postbag'));

The sp_UnreadPostsInfo() template display function has been modified to allow it to accept a new argument ‘group’ to order by Group (current) or just by Date like the unread posts at the bottom of the group view.
For backwards compatibility, the default for new the new group argument has been left to 1 (i.e., group=1).

Template: spNewPostsView.php

This template file has been modified to handle new arguments for the sp_UnreadPostsInfo() template display function to allow for optional ordering.
If you are happy with the current Group ordering (vs Date) then no changes are required. If you want to support date ordering of the new posts page:

Change:

$spListView = new spTopicList($spThisUser->newposts['topics']);

To:

$first = sp_esc_int($_GET['first']);
$group = sp_esc_int($_GET['group']);
$spListView = new spTopicList($spThisUser->newposts['topics'], 0, $group, '', $first);

Templates: spGroupView.php and spForumView.php

So that an unread posts indication could be shown for sub-forums in Group and Forum views, the template display functions sp_ForumIndexSubForums() and sp_ForumHeaderSubForums() have been modified to allow for this new icon.
In both template functions, the additional argument is:

'unreadIcon'  =>  'sp_SubForumIcon.png',

In both cases, the default argument is identical to the icon arugment. This is for backwards compatibility so if you don’t have the icon, you use the standrd one for unread too.

To use the new unread subforum icon, in the spGroupView.php template file change:

sp_ForumIndexSubForums('', __sp('Sub-Forums'), __sp('Browse topics in %NAME%'));

to:

sp_ForumIndexSubForums('unreadIcon=sp_SubForumUnreadIcon.png', __sp('Sub-Forums'), __sp('Browse topics in %NAME%'));

and in the spForumView.php template file change

sp_ForumHeaderSubForums('', __sp('Sub-Forums'), __sp('Browse topics in %NAME%'));
to:
sp_ForumHeaderSubForums('unreadIcon=sp_SubForumUnreadIcon.png', __sp('Sub-Forums'), __sp('Browse topics in %NAME%'));

First be sure you have an unread icon to use! See the first entry on this page for details of new icon.

New Template Display Functions

sp_DeviceStats()

This new template display function will show the number of each device type (desktop, phone, tablet) being used by those currently online.

The function has the following parameters:

sp_DeviceStats($args='', $statLabel='', $phoneLabel='', $tabletLabel='', $desktopLabel='')

We would recommend that if used, it is placed in the statistics area which would require a change to the spFoot.php template as follows (see new function added):

sp_ColumnStart('tagClass=spColumnSection spLeft spOnlineStats&width=43%&height=0');
	sp_OnlineStats('tagClass=spLeft', 'Most Users Ever Online: ', 'Currently Online: ', 'Currently Browsing this Page: ', 'Guest(s)');
	sp_DeviceStats('tagClass=spDeviceStats spLeft', 'Devices in use: ', 'Phone', 'Tablet', 'Desktop');
	sp_InsertBreak();
	if (function_exists('sp_OnlinePageLink')) sp_OnlinePageLink('', 'See All Online Activity');
sp_ColumnEnd();

Note: CSS to support this new function is described below in the next section.

CSS Changes

New function – sp_DeviceStats()

#spMainContainer .spDeviceStats span {
	font-family: inherit;
	font-weight: bold;
}

The QuickLinks Arrow

Some WordPress themes fix the position of the drop-down arrow in select boxes. To override such positioning the following has been added to theme CSS:

Locate the rules for:

#spMainContainer #spQuickLinksTopic .dd .ddTitle span.arrow,
#spMainContainer #spQuickLinksForum .dd .ddTitle span.arrow

and add:

position: inherit;

Popup Dialogs

The WordPress update to jQuery UI 1.10.2, breaks some UI elements in our popup dialogs. For them to function properly, you will need to make the following CSS changes:

Locate the rules for:

.ui-dialog class

add add:

z-index:1;

Locate the rules for:

.ui-dialog .ui-dialog-titlebar-close

and add an !important statement as shown:

background-image:  !important;

Locate the rules for:

.ui-widget-header

and add:

height: 26px;

Locate the rules for:

.ui-dialog .ui-dialog-titlebar-close

and change top directive:

top: 17px;

Locate the rules for:

.ui-widget-overlay

and change the rules to:

.ui-widget-overlay {
	background:  !important;
	opacity: .50 !important;
	filter: Alpha(Opacity=50) !important;
	z-index: 100 !important;
}

ADD the following new rule set to the dialog CSS rules:

.ui-dialog .ui-dialog-content img.spPopupImg {
	width: 100%;
	height: 100%;
}

New WordPress Video/Audio Embed Classes

WordPress are adding new video and audio embed functionality. This was due to go into the WP core with their 3.6 release but has been removed. This will make an appearance in a near-future WP update and the following rules have been added to all Simple:Press themes in readiness for this.
When this functionality does make an appearance and to enable them to show properly in forum posts, you need to add some new css to your theme.

Add the following lines to your theme file:

/* wp media embeds */
#spMainContainer .mejs-container {
	background: #464646;
	vertical-align: top;
	font-family: Helvetica,Arial;
}
#spMainContainer .mejs-container * {
	float: left;
	font-size: 11px;
}
#spMainContainer .mejs-controls .mejs-time {
	padding: 8px 3px 0;
	line-height: 12px;
	color: #FFFFFF;
}
#spMainContainer .mejs-controls .mejs-time-rail {
	padding-top: 5px;
}
#spMainContainer .mejs-controls .mejs-time-rail span {
	border-radius: 2px;
	-webkit-border-radius: 2px;
	-moz-border-radius: 2px;
}
#spMainContainer .mejs-controls .mejs-time-rail .mejs-time-loaded {
	background: #21759B;
}
#spMainContainer .mejs-controls .mejs-time-rail .mejs-time-current {
	background: #D54E21;
}
#spMainContainer .mejs-controls .mejs-time-rail .mejs-time-total {
	margin: 5px;
}
#spMainContainer .mejs-controls .mejs-time-rail .mejs-time-handle {
	background: #ffffff;
	border: 2px solid #333333;
}
#spMainContainer .mejs-controls .mejs-time-rail .mejs-time-float {
	background: #eeeeee;
	border: 1px solid #333333;
	margin-left: -18px;
}
#spMainContainer .mejs-controls .mejs-time-rail .mejs-time-float-current {
	margin: 2px;
}
#spMainContainer .mejs-controls .mejs-time-rail .mejs-time-float-corner {
	line-height: 0;
	border: solid 5px #eee;
	border-color: #eee transparent transparent transparent;
	-webkit-border-radius: 0;
	-moz-border-radius: 0;
	border-radius: 0;
}
#spMainContainer .mejs-controls .mejs-volume-button .mejs-volume-slider {
	background: rgba(50, 50, 50, 0.7);
}
#spMainContainer .mejs-controls .mejs-volume-button .mejs-volume-total {
	background: #ddd;
	background: rgba(255, 255, 255, 0.5);
}
#spMainContainer .mejs-controls .mejs-volume-button .mejs-volume-current {
	background: #ddd;
	background: rgba(255, 255, 255, 0.9);
}
#spMainContainer .mejs-controls .mejs-volume-button .mejs-volume-handle {
	background: #ddd;
	background: rgba(255, 255, 255, 0.9);
}

Overlay Changes

Minimalist

This is a new overlay added to all themes that make use of overlay files.

Search Form – Minor label correction

A new label has been added to the object definition for the search form found at the top of the spHead.php template. This addition is:

Template: spHead.php
Add to Search Form – Object Definition – near the top of the template:

'labelMatch' => __sp('Match'),

NOTE: the last item in the list should NOT be followed by a comma. Place this entry anywhere in the current list.

Allowing for user defined count of Recent Post listing

The New/Unread Post listing (popup or page) is geared to only show the topics that actually contain unread posts. This can now be overridden to show an optional number of entries – padding unread with read topics. This does require a small change to a template however:

Template: spNewPostsView
Change these 3 lines of code:

$first = sp_esc_int($_GET['first']);
$group = sp_esc_int($_GET['group']);
$spListView = new spTopicList($spThisUser->newposts['topics'], 0, $group, '', $first);

to these 4 lines of code:

$first = sp_esc_int($_GET['first']);
$group = sp_esc_int($_GET['group']);
$count = sp_esc_int($_GET['count']);
$spListView = new spTopicList($spThisUser->newposts['topics'], $count, $group, '', $first);

Deprecated Global Variable names

The following global variables are being deprecated in 5.3.1 and renamed as shown below. If you have used any of these global variables then we recommend making these changes as soon as you can. Support for the older names will be removed in the near future.

	$SPALLOPTIONS	to $spAllOptions,
	$SPPATHS		to $spPaths,
	$ISADMIN		to $spIsAdmin,
	$ISFORUMADMIN	to $spIsForumAdmin,
	$SPSTATUS		to $spStatus,
	$APAGE			to $spAPage,
	$ISFORUM 		to $spIsForum,
	$SPCACHE		to $spBootCache,
	$CONTENTLOADED	to $spContentLoaded,
	$SFMOBILE		to $spMobile,
	$SFDEVICE		to $spDevice,
	$sfglobals		to $spGlobals,
	$sfvars			to $spVars;


Copyright © 2006-2019 Simple:Press. All Rights Reserved.