Loading...
 
Themes

Themes


Forum Topic Titles as Links

I searched for a good 20-30 min and did not see this posted yet which really surprised me.

I was wondering how to display the most recent topic titles for each forum category as a link to that topic instead of just plain text of the topic title.

If you view the actual category itself, the topic title is a link to the thread, but in the main forum view, it just shows the thread titles as plain text and I want those to be links to the threads.

Here's the template code for that part in tiki-view_forum.tpl

Copy to clipboard
{$comments_coms[ix].title}


And here's the code for that part in tiki-forums.tpl that needs to be modified.

Copy to clipboard
{if $prefs.forum_list_lastpost eq 'y'} {if isset($channels[user].lastPost)} {$channels[user].lastPostData.title} {tr}by{/tr} {$channels[user].lastPostData.userName} {$channels[user].lastPost|tiki_short_datetime} {/if}


Any help would be appreciated. Thanks

Not sure why the tiki-view_forum.tpl content isn't displaying properly in the post above so here's another try:

Copy to clipboard
{$comments_coms[ix].title}

Japan

Sorry, but where or what page are you referring to? On the "topic list" page (like tiki-view_forum.php?forumId=14), the topics are already links, so I guess you mean somewhere else. Could you clarify that, please?

-- Gary


"tiki-view_forum.php" page displays them as a link like what I want. The page that does not display thread titles as a link is "tiki-forums.php"


I want it to be on the actual forum listing page "tiki-forums.php". It seems kinda pointless to just display the last topic title as plain text requiring users to click the forum and then click the topic instead of just clicking the topic and going straight there.
United States

In tiki-forums.tpl, try changing this:

Copy to clipboard
{$channels[user].lastPostData.title}


to something similar to this:

Copy to clipboard
<a href="tiki-view_forum_thread.php?forumId={$channels[user].forumId}&comments_parentId={$channels[user].threadId}"> {$channels[user].lastPostData.title} </a>



HTH,

- Rick | My Tiki Blog | My Tiki UserPage
Need more help? Try TikiWiki for Smarties.


Yeah, I've tried stuff like that but no success yet.

It's the

Copy to clipboard
{$channels[user].threadId}

that's not working right and I'm not sure what I should be using there. The URL shows "comments_parentId=" as blank :-(


I've been messing with the tiki-forums.php file and still no luck. I believe this is the section that needs to be modified to pass the {$channelsuser.threadId} info to the template.

Copy to clipboard
$temp_max = count($channels["data"]); for ($i = 0; $i < $temp_max; $i++) { if ($userlib->object_has_one_permission($channels["data"][$i]["forumId"], 'forum')) { $channels["data"][$i]["individual"] = 'y'; // forums that user cannot read are not displayed at all $channels["data"][$i]["individual_tiki_p_forum_read"] = 'y'; if ($userlib->object_has_permission($user, $channels["data"][$i]["forumId"], 'forum', 'tiki_p_forum_post')) { $channels["data"][$i]["individual_tiki_p_forum_post"] = 'y'; } else { $channels["data"][$i]["individual_tiki_p_forum_post"] = 'n'; } if ($userlib->object_has_permission($user, $channels["data"][$i]["forumId"], 'forum', 'tiki_p_forum_vote')) { $channels["data"][$i]["individual_tiki_p_forum_vote"] = 'y'; } else { $channels["data"][$i]["individual_tiki_p_forum_vote"] = 'n'; } if ($userlib->object_has_permission($user, $channels["data"][$i]["forumId"], 'forum', 'tiki_p_forum_post_topic')) { $channels["data"][$i]["individual_tiki_p_forum_post_topic"] = 'y'; } else { $channels["data"][$i]["individual_tiki_p_forum_post_topic"] = 'n'; } if ($tiki_p_admin == 'y' || $userlib->object_has_permission($user, $channels["data"][$i]["forumId"], 'forum', 'tiki_p_admin_forum')) { $channels["data"][$i]["individual_tiki_p_forum_post_topic"] = 'y'; $channels["data"][$i]["individual_tiki_p_forum_vote"] = 'y'; $channels["data"][$i]["individual_tiki_p_admin_forum"] = 'y'; $channels["data"][$i]["individual_tiki_p_forum_post"] = 'y'; $channels["data"][$i]["individual_tiki_p_forum_read"] = 'y'; } } else { $channels["data"][$i]["individual"] = 'n'; } }


Still no luck but I'll keep trying. Help me out if you have any suggestions.


Upcoming Events

1)  18 Apr 2024 14:00 GMT-0000
Tiki Roundtable Meeting
2)  16 May 2024 14:00 GMT-0000
Tiki Roundtable Meeting
3)  20 Jun 2024 14:00 GMT-0000
Tiki Roundtable Meeting
4)  18 Jul 2024 14:00 GMT-0000
Tiki Roundtable Meeting
5)  15 Aug 2024 14:00 GMT-0000
Tiki Roundtable Meeting
6)  19 Sep 2024 14:00 GMT-0000
Tiki Roundtable Meeting
7) 
Tiki birthday
8)  17 Oct 2024 14:00 GMT-0000
Tiki Roundtable Meeting
9)  21 Nov 2024 14:00 GMT-0000
Tiki Roundtable Meeting
10)  19 Dec 2024 14:00 GMT-0000
Tiki Roundtable Meeting