Site Links
Home
Features
Documentation
Pricing & Order
Members Area
Support Options
UBBDev.com
UBBWiki.com
Who's Online
0 registered (), 29 Guests and 32 Spiders online.
Key: Admin, Global Mod, Mod
Featured Member
<span class='adminname'>SD</span>
SD
Registered: 04/19/07
Posts: 4206
Top Posters (30 Days)
Ruben 27
Gizmo 22
Bert 18
sb 5
hema0359 4
After the Rose 4
BellaOnline 3
gladiator 3
skicomau 3
mona said 2
Latest Photos
Uhm...
Mayan End of World
Gas Station Disco Video Shoot
Test Pictures
Audrey Kate
Topic Options
#250115 - 09/05/12 11:03 AM Portal home page - only show snippet
macisbac Offline
newbie
Registered: 05/15/10
Posts: 26
Hi,

See my forum here http://www.saints247.com using the portal as the home.

On that home page how can I only show a snippet of text from each post rather than the whole post, say, the first 200 or so characters with a 'read more' link at the end of it?
_________________________


Neil
Saints247.com - http://www.saints247.com

-- using version 7.5.6
Top
Express Hosting
Express Hosting "We are the official hosting company of UBB.threads. Ask us about our free migration services to migrate your UBB.threads installation."
#250116 - 09/05/12 12:21 PM Re: Portal home page - only show snippet [Re: macisbac]
macisbac Offline
newbie
Registered: 05/15/10
Posts: 26
Sorry, I guess this should have gone under the 'How Do I?' forum
_________________________


Neil
Saints247.com - http://www.saints247.com

-- using version 7.5.6
Top
#250117 - 09/05/12 12:54 PM Re: Portal home page - only show snippet [Re: macisbac]
Gizmo Offline

Registered: 06/05/06
Posts: 15475
Loc: Portland, OR; USA
You'd have to modify the portal files (which really would be unsupported); give me a minute to figure it out...
_________________________
Forums: UGN Security & VNC Web Design & Development
UBB.Threads: UBB.Wiki, My UBBSkins, UBB.Sitemaps
Longtime Supporter, Beta Tester & Resident Post-A-Holic.
Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Top
#250118 - 09/05/12 12:58 PM Re: Portal home page - only show snippet [Re: macisbac]
Gizmo Offline

Registered: 06/05/06
Posts: 15475
Loc: Portland, OR; USA
In scripts/portal.inc.php Find:
Code:
			"body" => $body,


Replace With:
Code:
			"body" => substr($body, 0, 200),


Replace 200 with however long you'd like it to be.
_________________________
Forums: UGN Security & VNC Web Design & Development
UBB.Threads: UBB.Wiki, My UBBSkins, UBB.Sitemaps
Longtime Supporter, Beta Tester & Resident Post-A-Holic.
Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Top
#250121 - 09/05/12 02:28 PM Re: Portal home page - only show snippet [Re: macisbac]
macisbac Offline
newbie
Registered: 05/15/10
Posts: 26
Thanks Gizmo, working a treat smile

However, how do I append a 'Read more' link ?
_________________________


Neil
Saints247.com - http://www.saints247.com

-- using version 7.5.6
Top
#250123 - 09/05/12 03:28 PM Re: Portal home page - only show snippet [Re: macisbac]
macisbac Offline
newbie
Registered: 05/15/10
Posts: 26
In the portal.tpl file there is code that relates to truncated news, see below, with text of 'To be continued?' but I don't see how this is working or should be working on the page and was wondering if that is how I can get the 'Read more' link I was after?

---
{section name=item loop=$news}
{$tbopen}
<tr><td class="tdheader">
<span style="float:right" class="small">{$news[item].time}</span>
<a href="{ubb url="ubb=showflat&Number=`$news[item].topic_id`" title=$news[item].subject}">{$news[item].subject}</a>
<span class="small">
{$lang.POSTED_BY} {$news[item].poster}
</span>
</td></tr>
<tr>
<td class="alt-1">
<div class="post_inner">
{if $news[item].newsicon}
<img style="float:left; margin: 0px;" src="{$config.BASE_URL}/images/{$style_array.news}/{$news[item].newsicon}" alt="" />
{/if}
<br />
{$news[item].body} {if $news[item].truncated} <a href="{ubb url="ubb=showflat&Number=`$news[item].topic_id`" title=$news[item].subject}">To be continued?</a>{/if}
<br /><br />
<div style="text-align:right; clear:both" class="small">
{$news[item].views} {$lang.VIEWS}
·
<a href="{ubb url="ubb=showflat&Number=`$news[item].topic_id`" title=$news[item].subject}">{$news[item].replies} {$lang.REPLIES}</a>
</div>
</div>
</td></tr>
{$tbclose}
{/section}

---
_________________________


Neil
Saints247.com - http://www.saints247.com

-- using version 7.5.6
Top
#250124 - 09/05/12 03:37 PM Re: Portal home page - only show snippet [Re: macisbac]
Gizmo Offline

Registered: 06/05/06
Posts: 15475
Loc: Portland, OR; USA
I noticed that but saw no real indication of how to truncate the data in the cp and didn't really dig in the script file much...

You could just add a link by copying that link data for the truncated message and put it after the {$news[item].body} indication.
_________________________
Forums: UGN Security & VNC Web Design & Development
UBB.Threads: UBB.Wiki, My UBBSkins, UBB.Sitemaps
Longtime Supporter, Beta Tester & Resident Post-A-Holic.
Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!
Top
#250125 - 09/05/12 05:00 PM Re: Portal home page - only show snippet [Re: macisbac]
macisbac Offline
newbie
Registered: 05/15/10
Posts: 26
Ok, all I needed to do in the end was replace this bit:

{$news[item].body} {if $news[item].truncated} <a href="{ubb url="ubb=showflat&Number=`$news[item].topic_id`" title=$news[item].subject}">To be continued?</a>{/if}

with this

{$news[item].body}.... <a href="{ubb url="ubb=showflat&Number=`$news[item].topic_id`" title=$news[item].subject}">Read more....</a>


Thanks for the pointers smile
_________________________


Neil
Saints247.com - http://www.saints247.com

-- using version 7.5.6
Top



Moderator:  AllenAyres, Harold, Ian, Ron M 
Shout Box

Today's Birthdays
No Birthdays
Recent Topics
Marking a topic as 'read' manually
by sw55
Yesterday at 04:29 PM
How to add AD island?
by Conrad
Yesterday at 01:19 PM
Need to update from 6 to latest: can't until server checked
by Digilady
06/17/13 08:17 AM
Shout Box
by Bert
06/15/13 04:15 PM
Calendar
by Bert
06/15/13 04:11 PM
Forum Stats
11000 Members
36 Forums
33988 Topics
183527 Posts

Max Online: 978 @ 06/24/07 10:19 PM
Random Image