ocPortal Roundup 3

countdown in ocPortalThis is the third ocPortal round up which is a collection of tips, tricks and news. It’s a place to document shared fixes and how to’s which appear in a variety of places. These are all useful tips on how to change some specific things within ocPortal. Generally these are useful tricks but are not large enough by themselves to warrant a full blog post on their own.

Generating a shorter news summary in ocPortal

forum titlesDepending on how your theme is set up you may want to make the News post summary appear shorter to fit a specific space in your theme. To do this you will need to edit the template for your theme. The template you need to edit is the NEWS_BOX.tpl which is in the themed directory of your theme.

The code you will need to change is on line 55 if you have not already made any changes to this template. The existing code will be:

{+START,IF,{TRUNCATE}}{$TRUNCATE_LEFT,{NEWS},400,0,1,0,0.4}{+END}

You will need to change this to

{+START,IF,{TRUNCATE}}{$REPLACE,&nbsp,,{$TRIM,{$STRIP_TAGS,{$TRUNCATE_LEFT,{NEWS},400,0,1,0,0.4}}}}{+END}

This change in code will get rid of any trailing spaces, non-breaking spaces, and strips all html tags.

Increasing the number of characters displayed in ocPortal forum titles

As standard, ocPortal will cut off the length of forum topic titles which are displayed on the main forum list. You can change the length of this so that it will show more characters before cutting the name short or increase it. To edit this you will need to find the template titles OCF_FORUM_TOPIC_ROW.tpl. The code you need to edit is on line 22 and will look like this:

<a href=”{URL*}” title=”{$ALTERNATOR_TRUNCATED,{TITLE},60,{!TOPIC_STARTED_DAT
E_TIME,{HOVER*;~}},,1}”>{+START,FRACTIONAL_EDITABLE,{TITLE},t
itle,_SEARCH:topics:type=_edit_topic:id={ID}}{+START,IF,{UNRE
AD}}<span>{+END}{$TRUNCATE_LEFT,{TITLE}
,60}{+START,IF,{UNREAD}}</span>{+END}{+END}</a>

You can change the number 60, highlighted in red, to a higher number to increase the character limit.

Adding a countdown to a page in ocPortal

ocPortal has the ability to add a countdown to a specific date through a comcode block. The Main Countdown block should be installed on your website as standard and will just need to be placed where you want the block to appear. Use the block wizard as normal to install the block. You’ll need to configure the following elements:-

Param – This is the date you want the countdown to run to.  ocPortal is smart enough to understand most common date formats

Precision – How detailed to you want the countdown to run to. Do you want it to just show Years, Days and Hours or would you like it to show seconds as well.

Tailing – Maximum compound to use i.e. do you want it to show years or the largest number to be the number of days.

If you want, you can Follow me on Google plus or Follow me on Twitter

Do you need quality Web Hosting for your ocPortal? Look no further than Arvixe Web Hosting!

Tags: , , , , , , , , , , | Posted under ocPortal | RSS 2.0

Author Spotlight

Steve Jarvis

Steve Jarvis

Hi I'm Steve, I've been using computers in one form or another since i was 5 with a Dragon 64 and building websites since the late 90's. I'm currently employed as a digital marketing person for Planet X Bikes. When not writing blog posts or working i'm a family man (Wife and Daughter) and a PC Gamer

Leave a Reply

Your email address will not be published. Required fields are marked *


9 − 6 =

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>