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>';
}

Re: Show-my-topics feature

I'm trying to make this work, but the code Amelotti posted will show a list of all the topics you started; I want to show a link of all the topics that contain a post you made. Like in Profile, but then shown as topics.
How can I change this part:

$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>';

so that it shows juist de topic-title and not all of the text of the post?

Re: Show-my-topics feature

these are the lines 1355-1361 which are relevant to the profile (profile.php)
if you choose the green block you'll get the last posts of user....


    // Setup search links
    if ($forum_user['g_search'] == '1')
    {
        $forum_page['user_activity'] = array();
        $forum_page['user_activity']['search_posts'] = '<li class="first-item"><a href="'.forum_link($forum_url['search_user_posts'], $id).'">'.sprintf($lang_profile['View user posts'], forum_htmlencode($user['username'])).'</a></li>';
        $forum_page['user_activity']['search_topics'] = '<li><a href="'.forum_link($forum_url['search_user_topics'], $id).'">'.sprintf($lang_profile['View user topics'], forum_htmlencode($user['username'])).'</a></li>';
    }

i.e. replace search_topics  with  search_posts in the Amelotti post etc...

Re: Show-my-topics feature

Well, the link works, i figured that out, but i don't want to show the content of the post, just the topic(titel) you made the post in. And that's the part i can't get working...

11

Re: Show-my-topics feature

I deleted the line

$show_as = 'posts';

in search_functions.php
after lines 529-530:
$url_type = $forum_url['search_user_posts'];
$search_id = $value;
           
does that show them how you'd want them?

only problem is that then sticky and closed aren't defined... but the layout would be right big_smile

Re: Show-my-topics feature

Yes, it shows them almost the way i want to wink It's just that it would be nice if everything doesn't seems to be closed & sticky  lol  I allready had found that variable and was playing around with it, but did not know yet where to insert it.

I really do like v. 1.3, but sometimes i wish i staid with 1.2  roll

Re: Show-my-topics feature

"It's just that it would be nice if everything doesn't seems to be closed & sticky"

It's probably going to be another long torture with editing oxygen.css

14 (edited by Marianne 2010-02-25 19:16)

Re: Show-my-topics feature

Hmm... it's not just the wrong post-icon. The layout is ok, but that's all. Now i don't see the content of the post, but i see for every post in a topic the same topic-title  hmm  It's not just oxygen.css but it's making the right search-action. No. 2 i can't create  sad

(but i do love the preview option @ quick-reply, since english is not my [insert something i don't know in english  roll ]

15 (edited by Amelotti 2010-02-27 14:22)

Re: Show-my-topics feature

It has to do with the following code in the search.php (320-...)

            if ($cur_set['sticky'] == '1')
            {
                $forum_page['item_title_status']['sticky'] = '<em class="sticky">'.$lang_forum['Sticky'].'</em>';
                $forum_page['item_status']['sticky'] = 'sticky';
            }

            if ($cur_set['closed'] != '0')
            {
                $forum_page['item_title_status']['closed'] = '<em class="closed">'.$lang_forum['closed'].'</em>';
                $forum_page['item_status']['closed'] = 'closed';
            }
    

If you just delete it, or nulify the values, it comes out just fine, but it won't show closed and sticky topics during the search (which may be just okay).

However, this expression can somehow be fixed to show them (using ELSE, etc).  (I played around with the values, that's not sufficient to fix it). Developers' help is needed!

Re: Show-my-topics feature

But it now repeats the same post if you posted there more than once.

Re: Show-my-topics feature

How do you remove the multiple posts from the search results?
How would you set up the variable?

if ( )

Re: Show-my-topics feature

Or does this have to do with the SQL?
How do you show just one topic in the search results, even if a user posted in that topic multiple times?