Theme and Templates 5.1.0 to 5.1.4

If you have created a custom theme then this will not be automatically updated when you upgrade Simple:Press to version 5.1.0. if you would like to take advantage of any new features that 5.1.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 them to your own if you choose to do so.

Your theme should continue to work Simple:Press 5.1.0 without making any changes. Our goal has been not to disturb custom themes. But if you wish to take advantage of new features some changes will be required.

Theme Changes 5.1.0

New Theme icons

The following theme icons (the theme ‘images’ folder) have been added to 5.1.0:

sp_DeletePost.png – Used for the new Delete Post button (see spForumView template below)
sp_GroupClose.png and sp_GroupOpen.png – Used by the optional new function to open/close forum Groups (see spGroupView template below)
sp_ToolsSort.png – New Forum Tool option icon enabling the change of the default sort on individual forums and topics.

if you decide to use any of these new icons they can be copied from the default/images folder to your own theme images folder.

Template: spHead.php

The template function sp_UserNotices(”, __sp(‘(Remove Notice)’)) has had a label added to allow for the new ‘Remove’ button in user notices. It is strongly recommended that this new label be added to your spHead template.

Template: spGroupView.php

New ‘container’ (div) sections have been added to allow for greater control and flexibility of styling; These are:

spHeadContainer, spBodyContainer, spGroupForumContainer and spFootContainer.
Note these new containers require both the spSectionStart() and spSectionEnd() functions to be added in the appropriate places.

A new template function is available that will add open/close forum group icons and actions to each forum group. Note that this requires 2 new icons and the spGroupForumContainer in place to function. The default syntax is:

sp_GroupOpenClose(‘tagClass=spIcon spRight&default=open’, ‘Open forum listing’, ‘Close forum listing’);

Template: spForumView.php

New ‘container’ (div) sections have been added to allow for greater control and flexibility of styling; These are:

spHeadContainer, spBodyContainer, spForumSubforumContainer, spForumTopicContainer and spFootContainer.
Note these new containers require both the spSectionStart() and spSectionEnd() functions to be added in the appropriate places.

Template: spTopicView.php

New ‘container’ (div) sections have been added to allow for greater control and flexibility of styling; These are:

spHeadContainer, spBodyContainer, spTopicPostContainer and spFootContainer.
Note these new containers require both the spSectionStart() and spSectionEnd() functions to be added in the appropriate places.

Two new template functions are available. The first adds a more graphic indication of a pinned post and the default syntax is:

sp_PostIndexPinned(‘tagClass=spStatusIcon spLeft’, __sp(‘This post is pinned’));

The second adds a Delete Post button for those able to delete. Note that this requires a new icon. The default syntax is:

sp_PostIndexDelete(‘tagClass=spButton spRight’, ‘Delete’, ‘Delete this post’);

CSS Changes

There are quite a number of CSS styling changes made in 5.1.0 although most are fairly minor. We strongly urge you to compare the new CSS file of the theme you copied originally with your own, user created CSS file and apply as many of the changes and additions as you feel are appropriate. If in doubt, we recommend making the change. However, as we have said above, custom themes based on 5.0 should continue to work with Simple:Press 5.1 without modification.

Theme Changes 5.1.1

New Search Functionality

Version 5.1.1 adds the capability for users to return to their last search results – even at the page they last visited. In order to enable this functionality a small addition has to be made to a theme template:

Template to edit : spHead.php
Section to edit: ‘Search Form – Object Definition‘ section
Add a new entry:

'lastSearchLabel' => 'Last Search Results',

Please be careful with the capitalisation and note the comma at the end – needed on all lines in the section except for the last. Feel free to change the text label but we recommend keeping it short.

Improved Styling of Search View Page Links

To improve the style of the search results page links and keep them from being tight on left side:

Template to Edit: spSearchView.php
Section to edit: sp_SearchPageLinks()
Surround this template function with a plain section:

sp_SectionStart('tagClass=spPlainSection', 'pageLinks');
	sp_SearchPageLinks('', 'Page: ', 'Jump to page %PAGE% of results');
sp_SectionEnd('tagClass=spClear', 'pageLinks');

It is also recommended to make the following addition to your CSS:
Locate the CSS section:

#spMainContainer .spSearchSection {
	float: left;
	padding: 0;
	width: 100%;
}

and add a new line as:

#spMainContainer .spSearchSection {
	float: left;
	padding: 0;
	width: 100%;
	margin-bottom: 5px;
}

Forum Moderator Lists

There are 3 new template functions for displaying a list of moderators against each forum.
These new Template Tags are: sp_ForumIndexModerators(), sp_SubForumIndexModerators() and sp_TopicModeratorList()
To use – add the template tags in your theme template files where you want the list of forum moderators to appear

  • Typically sp_ForumIndexModerators() would be used in spGroupView.php within the forum list loop – recommend after sp_ForumIndexPageLinks() with an spInsertBreak()
  • Typically sp_SubForumIndexModerators() would be used in spForumView.php within the sub forum list loop – recommend after sp_SubForumIndexPageLinks() with an spInsertBreak()
  • Typically sp_TopicModeratorList() would be used in spTopicView.php within the topic list loop – recommend after pagelinks section with its own plain section

Note: By default, since the majority of folks probably wont use these template tags, they have not been added to our supplied theme templates but are just made available.
if you choose to use these new tags then it is also recommended you add the following CSS for styling them:
Locate the CSS Section:

#spMainContainer .spInRowRank,
#spMainContainer .spInRowDate,
#spMainContainer .spInRowNumber {
	font-size: 90%;
}

and add a new line as:

#spMainContainer .spInRowRank,
#spMainContainer .spInRowDate,
#spMainContainer .spInRowNumber,
#spMainContainer .spForumModeratorList {
	font-size: 90%;
}

Theme Changes 5.1.2

Adding ‘nofollow’ to Links in User Information

To add nofollow to the user ID links in the user information area of posts (topic view) you will need to edit the following template functions:

Template to edit : spTopicView.php
Edit the following template functions:

  • sp_PostIndexUserTwitter()
  • sp_PostIndexUserFacebook()
  • sp_PostIndexUserMySpace()
  • sp_PostIndexUserLinkedIn()
  • sp_PostIndexUserYouTube()
  • sp_PostIndexUserGooglePlus()
  • sp_PostIndexUserWebsite()

Add this new argument to the arguments passed:

noFollow=1

The default is 0 (zero) for no nofillow to be added.

Improved column control in all List View instances

To make use of this improved layout:

Template to edit : spListView.php
Replace the code block between sp_ListViewBodyStart() and sp_ListViewBodyStart() as follows:

sp_ColumnStart('tagClass=spColumnSection spRight&width=15%&height=20px');
	sp_ListNewPostButton('tagClass=spButton spRight', __sp('New: %COUNT%'), __sp('View the first new post in this topic'));
sp_ColumnEnd();
sp_ColumnStart('tagClass=spColumnSection spLeft&width=7%&height=20px');
	sp_ListTopicIcon();
sp_ColumnEnd();

sp_ColumnStart('tagClass=spColumnSection spLeft&width=78%&height=20px');
	sp_ListTopicName('', __sp('Browse the thread %NAME%'));
	sp_ListLastPost('iconClass=spIcon spLeft&height=0px', __sp('Last Post'));
sp_ColumnEnd();

Improved layout of recent posts (list view)

To improve the layout of recent posts (list view) when on their own page to match display at bottom of the GroupView template.

Template to edit : spListView.php
Adds a new section start (and subsequent section end) after the main body section

sp_SectionStart('tagClass=spBodyContainer', 'body');
sp_SectionStart('tagId=spRecentPostList&tagClass=spRecentPostSection');
echo '
Most recent topics with unread posts
'; # Start the 'searchView' section # ---------------------------------------------------------------------- global $spThisUser, $spListView, $spThisListTopic; $spListView = new spTopicList($spThisUser->newposts['topics']); sp_load_template('spListView.php'); sp_SectionEnd(); sp_SectionEnd('', 'body');

Fix missing CSS in iForum theme

To fix missing CSS in iForum.php file only: From: blank lines from 1958 to 1974 To:

Profile Form Panel
------------------------*/
#spMainContainer #spProfileData {
	float: left;
	margin: 1px 0 0 0;
	padding: 0;
	background: ;
	width: 80%;
	}

#spMainContainer #spProfileFormPanel {
	padding: 10px;
	font-size: ;
}
/* ---------------------

Replacement Icons

The current theme image files:

  • sp_UserOnline.gif
  • sp_UserOffline.gif

as used in the profile form have been replaced by .png image files of the same name to bring them into line with all other theme images: sp_UserOnline.png and sp_UserOffline.png

There have been two modifications to images used by the ‘Private Messaging’ plugin.
In accordance with the above, the two remaining .gif images have been recreated as .png files. these two files are:

  • sp_PmBuddies.gif
  • sp_PmRemove.gif

These have been recreated as sp_PmBuddies.png and sp_PmRemove.png.

If you have created custom icons to replace the standard supplied ones then we apologise for this change but did deem it necessary. Please recreate your custom icons as png files.

Theme Changes 5.1.4

Modifications to existing functions

Both sp_QuickLinksForum() and sp_QuickLinksTopic() have been given a new argument to control the length of entries.
argument: ‘length’
default: 40
This controls the length of each entry before it is truncated and suffixed with an ellipsis.

New available template functions

The ‘Post By Email’ plugin offers a new, optional icon to the post status icons in Topic View to show the source of the post.
The template function and suggested format is:

sp_PostIndexPostByEmail('tagClass=spStatusIcon spLeft', 'This post was sent by email');

Note that the text in the label is an optional tooltip.

Changes to css

Added 2px padding to preview post display to fix rounded corners issue under Chrome Browser
In all overlay files changed: $postPadding = ’0′; to $postPadding = ’2px’;
In CSS Only theme changed

#spMainContainer .spTopicPostSection {
	padding: 0;
to
	padding: 2px;	

Replacement image

Replaced the sp_GooglePlus.png image in all themes with new icon that matches new Google+ logo