Page 1 of 1

Tweak for news items when trim length is enabled

PostPosted: Mon Sep 11, 2006 11:35 pm
Author: Nogami
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.

PostPosted: Tue Sep 12, 2006 6:58 pm
Author: tmotley
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?

PostPosted: Wed Sep 13, 2006 12:10 am
Author: Unregistered
disable cache for ur news block..

PostPosted: Wed Sep 13, 2006 4:00 am
Author: tmotley
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.

PostPosted: Wed Sep 13, 2006 4:24 am
Author: tmotley
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.

PostPosted: Wed Sep 13, 2006 9:16 am
Author: tekguru
Worh adding ot the betas that one!