1

Topic: Topic/headline clickable in News generator?

I think it would be good if the topic or headline in the news generator output is clickable, and creates a link to the forum thread.
It's how most internet newspapers work, and people are used to clicking on headlines to go to the story in question.
Can this be fixed easily with a small edit in the code?

Re: Topic/headline clickable in News generator?

Open up AP_News_Generator.php and look for:

$replace = array(pun_htmlspecialchars($cur_topic['subject']), date('Y-m-d H:i', $cur_post['posted']), pun_htmlspecialchars($cur_post['poster']), parse_message($cur_post['message'], $cur_post['hide_smilies']), '<a href="'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id'].'">Comments</a>');

Replace it with:

$replace = array('<a href="'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a>', date('Y-m-d H:i', $cur_post['posted']), pun_htmlspecialchars($cur_post['poster']), parse_message($cur_post['message'], $cur_post['hide_smilies']), '<a href="'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id'].'">Comments</a>');

I haven't tested it, but it should work smile

"Programming is like sex: one mistake and you have to support it for the rest of your life."

3 (edited by Endre 2005-04-26 23:13)

Re: Topic/headline clickable in News generator?

Thanks Richard. This code conflicted with the mod ConnorHD made to truncate the news-output earlier. So i edited it a little, in case anyone but would like both modifications at the same time.
The other mod I'm talking about is this:
http://punbb.org/forums/viewtopic.php?id=6826

$replace = array('<a href="'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id'].'">'.pun_htmlspecialchars($cur_topic['subject']).'</a>', date('Y-m-d H:i', $cur_post['posted']), pun_htmlspecialchars($cur_post['poster']), parse_message(prune_para($cur_post['message']), $cur_post['hide_smilies']), '<a href="'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id'].'">Comments</a>');