Topic: Show-my-topics feature

Is it possible to make the show-my-topics feature in the same line of

New posts
Active topics
Unanswered topics
New messages

It probably requires only minor changes to one of the above. Or maybe someone could help me with this —I'm learning php.

Re: Show-my-topics feature

This is the best place for adding a link. And this is an example of how "View all posts" link is generated. Will this information be enough for you?

Re: Show-my-topics feature

It could be a small extension smile

Re: Show-my-topics feature

You can just add    

$visit_links['search_topics'] = '<span id="search_topics"'.(empty($visit_links) ? ' class="first-item"' : '').'><a href="'.forum_link($forum_url['search_user_topics'], "3").'"title="'.$lang_common['My topics title'].'">'.$lang_common['My topics'].'</a></span>';


to header.php after

    $visit_links['recent'] = '<span id="visit-recent"'.(empty($visit_links) ? ' class="first-item"' : '').'><a href="'.forum_link($forum_url['search_recent']).'" title="'.$lang_common['Active topics title'].'">'.$lang_common['Active topics'].'</a></span>';

(I would also remove the "unanswered topics" in the same location — these are simply redundant and good for nothing)

and then add this to .../English/common.php

'My topics'                =>    'My topics',
'My topics title'        =>    'Find topics which contain my posts.',

Herein, 3 is your ID number as a user, but I don't know yet how to write the general expression. Anyone knowledgeable know how to substitute 3 by a generic expression for "oneself"?

Re: Show-my-topics feature

Amelotti wrote:

Anyone knowledgeable know how to substitute 3 by a generic expression for "oneself"?

$forum_user['id']

Re: Show-my-topics feature

So it's workable now.

Just add this (as well as the abovementioned changes to .../English/common.php)

    $visit_links['search_topics'] = '<span id="search_topics"'.(empty($visit_links) ? ' class="first-item"' : '').'><a href="'.forum_link($forum_url['search_user_topics'], $forum_user['id']).'"title="'.$lang_common['My topics title'].'">'.$lang_common['My topics'].'</a></span>';


to the header.php near or instead of:

       $visit_links['unanswered'] = '<span id="visit-unanswered"'.(empty($visit_links) ? ' class="first-item"' : '').'><a href="'.forum_link($forum_url['search_unanswered']).'" title="'.$lang_common['Unanswered topics title'].'">'.$lang_common['Unanswered topics'].'</a></span>';

I would rather do it instead since too many links in the header may become garbled on smaller resolutions (laptops, old comps, etc), besides the forum's slogan is simplicity.

Re: Show-my-topics feature

Correction:

To avoid the "My topics" feature from appearing when you're not logged in and coming as Guest, you should put

if (!$forum_user['is_guest'])   

before the previous paragraph that you must have inserted into the header.php


The final code (header.php) may look as follows:



if ($forum_user['g_read_board'] == '1' && $forum_user['g_search'] == '1')
{
    $visit_links = array();

    if (!$forum_user['is_guest'])
        $visit_links['newposts'] = '<span id="visit-new"'.(empty($visit_links) ? ' class="first-item"' : '').'><a href="'.forum_link($forum_url['search_new']).'" title="'.$lang_common['New posts title'].'">'.$lang_common['New posts'].'</a></span>';
    if (!$forum_user['is_guest'])       
            $visit_links['search_topics'] = '<span id="search_topics"'.(empty($visit_links) ? ' class="first-item"' : '').'><a href="'.forum_link($forum_url['search_user_topics'], $forum_user['id']).'"title="'.$lang_common['My topics title'].'">'.$lang_common['My topics'].'</a></span>';
           

    $visit_links['recent'] = '<span id="visit-recent"'.(empty($visit_links) ? ' class="first-item"' : '').'><a href="'.forum_link($forum_url['search_recent']).'" title="'.$lang_common['Active topics title'].'">'.$lang_common['Active topics'].'</a></span>';



INSTEAD OF



if ($forum_user['g_read_board'] == '1' && $forum_user['g_search'] == '1')
{
    $visit_links = array();

    if (!$forum_user['is_guest'])
        $visit_links['newposts'] = '<span id="visit-new"'.(empty($visit_links) ? ' class="first-item"' : '').'><a href="'.forum_link($forum_url['search_new']).'" title="'.$lang_common['New posts title'].'">'.$lang_common['New posts'].'</a></span>';

    $visit_links['recent'] = '<span id="visit-recent"'.(empty($visit_links) ? ' class="first-item"' : '').'><a href="'.forum_link($forum_url['search_recent']).'" title="'.$lang_common['Active topics title'].'">'.$lang_common['Active topics'].'</a></span>';
    $visit_links['unanswered'] = '<span id="visit-unanswered"'.(empty($visit_links) ? ' class="first-item"' : '').'><a href="'.forum_link($forum_url['search_unanswered']).'" title="'.$lang_common['Unanswered topics title'].'">'.$lang_common['Unanswered topics'].'</a></span>';
}