Tweak for news items when trim length is enabled

Mods etc.

Moderator: Integra Moderator

Tweak for news items when trim length is enabled

PostAuthor: Nogami » Mon Sep 11, 2006 10:35 pm

I did a little tweak to the news.php file for when my news blocks are cut down by the "trim length" option. Makes it a little more obvious to users that there is more to the article than just the standard "..." added to the end of the message, and gives them a link to the message topic itself (similar to clicking the comments link)

in includes/news.php    find:
Code: Select all
                    $article['post_abstract']  =  $this->parseMessage(  $article['post_abstract']  .  '  ...  ',  $article['bbcode_uid']  );   
   
replace with]                    $article['post_abstract']  =  $this->parseMessage(  $article['post_abstract']  .  '...<br><br><i><a>    ...'  .  $lang['Read_More']  .  '<img></a></i>',  $article['bbcode_uid']);  
[/code]

It adds the ... at the end of the message, then drops down and adds a "...read more" that links to the message in the forum itself.

The standard "read more" button also remains on the bottom-right of the frame, but that links to a news view without the ability to reply (which I wanted).

N.
Last edited by Nogami on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.

Nogami
Newbie
Newbie
 
Posts: 7
Likes: 0 post
Liked in: 0 post
Joined: Sun Apr 16, 2006 10:35 am
Cash on hand: 0.00

PostAuthor: tmotley » Tue Sep 12, 2006 5:58 pm

That's sweet action... Works like a charm. Would anyone have any idea why my normal 'Read More' just links to the main forum?

Newly added functional link is:

http://website.com/forum/viewtopic.php?t=911

Built-in original read more link is:

http://website.com/forum/?topic_id=911

In news.php, I have the following code:
[code]'READ_MORE_LINK' => ($show_abstract && $trimmed) ? '<a><img></a>' ]

What's it supposed to do other than maybe go to the forum I post news articles in?
Last edited by tmotley on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
User avatar
tmotley
IntegraMODerators
IntegraMODerators
 
Posts: 524
Likes: 0 post
Liked in: 0 post
Joined: Mon Mar 27, 2006 2:56 am
Cash on hand: 0.00
Location: Missouri, USA

PostAuthor: Unregistered » Tue Sep 12, 2006 11:10 pm

disable cache for ur news block..
Last edited by Unregistered on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
J O N H | P L A Y E R

Unregistered
Sr Integra Member
Sr Integra Member
 
Posts: 254
Likes: 0 post
Liked in: 0 post
Joined: Wed Jun 07, 2006 1:51 pm
Cash on hand: 0.00

PostAuthor: tmotley » Wed Sep 13, 2006 3:00 am

I had turned off cache to that block previously after trying to cache most everything due to this topic:

http://www.integramod.com/forum/viewtopic.php?t=1932

Any other ideas?

Clarify issue:
1. I added the above mod and it works perfectly.
2. The newly added link goes to the exact news topic as intended.
3. The original link in the bottom right corner of the news posting 'read more' only shows the main index despite having more 'stuff' in the URL.
Last edited by tmotley on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
User avatar
tmotley
IntegraMODerators
IntegraMODerators
 
Posts: 524
Likes: 0 post
Liked in: 0 post
Joined: Mon Mar 27, 2006 2:56 am
Cash on hand: 0.00
Location: Missouri, USA

PostAuthor: tmotley » Wed Sep 13, 2006 3:24 am

I think I fixed it:

In news.php, I found
Code: Select all
'READ_MORE_LINK' => ($show_abstract && $trimmed) ? '<a href="' . $this->config['news_base_url'] . $CFG['index_file'] . '?topic_id=' . $article['topic_id']


and replaced it with
Code: Select all
'READ_MORE_LINK' => ($show_abstract && $trimmed) ? '<a href="' . $HTTP_SERVER_VARS['PHP_SELF'] . '?topic_id=' . $article['topic_id']


Now, if I click the newly added read more, it takes me to the topic where I can add replies.

If I click the bottom corner one, it shows the whole topic on the portal page without the ability to add replies.
Last edited by tmotley on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
User avatar
tmotley
IntegraMODerators
IntegraMODerators
 
Posts: 524
Likes: 0 post
Liked in: 0 post
Joined: Mon Mar 27, 2006 2:56 am
Cash on hand: 0.00
Location: Missouri, USA

PostAuthor: tekguru » Wed Sep 13, 2006 8:16 am

Worh adding ot the betas that one!
Last edited by tekguru on Wed Dec 31, 1969 4:00 pm, edited 1 time in total.
[size=99px]http][/size]
[url=http][img=left]http://www.4winmobile.com/news/MVP_Horizontal_FullColor.png[/img][/url]
User avatar
tekguru
Sr Integra Member
Sr Integra Member
 
Posts: 329
Likes: 0 post
Liked in: 0 post
Joined: Tue Mar 28, 2006 10:29 pm
Cash on hand: 0.00


Return to IntegraMOD Modifications

Who is online

Registered users: Bing [Bot], Google [Bot], Majestic-12 [Bot]