MyBB Community Forums

Full Version: egosearch
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
It would be nice if mybb had an egosearch. This is a list of threads that you posted to, whether you started the thread or not. Its a good way to keep track of your activity on a forum quickly from the front page. Especially if you do not want to be annoyed via email/PM with subscriptions. On forums i dont want to be bothered with PMs or emails. I want to manually scan the list of threads i participated in, and read them in the order i wish at that time. This egosearch is default in PhpBB alongside todays posts and new posts. And i think it should be in MyBB core as well. Its also a very small change that adds it.

I hacked a method in the core but it would be nice if it was default.

in search.php about line 1492
elseif($mybb->input['action'] == "do_search" || ($mybb->input['action'] == "finduserthreads2")  ||       ($mybb->input['action'] == "findthreads1"))
{       
    $plugins->run_hooks("search_do_search_start");
            
    // Check if search flood checking is enabled and user is not admin
    if($mybb->settings['searchfloodtime'] > 0 && $mybb->usergroup['cancp'] != 1)
    {   
        // Fetch the time this user last searched
        if($mybb->user['uid'])
        {
            $conditions = "uid='{$mybb->user['uid']}'";
        }
        else
        {
            $conditions = "uid='0' AND ipaddress=".$db->escape_binary($session->packedip);
        }
        $timecut = TIME_NOW-$mybb->settings['searchfloodtime'];
        $query = $db->simple_select("searchlog", "*", "$conditions AND dateline > '$timecut'",           array('order_by' => "dateline", 'order_dir' => "DESC"));
        $last_search = $db->fetch_array($query);
        // Users last search was within the flood time, show the error
        if($last_search['sid'])
        {   
            $remaining_time = $mybb->settings['searchfloodtime']-(TIME_NOW-$last_search['dateline']);
            if($remaining_time == 1)
            {
                $lang->error_searchflooding = $lang->sprintf($lang->error_searchflooding_1, $mybb-       >settings['searchfloodtime']);
            }
            else
            {
                $lang->error_searchflooding = $lang->sprintf($lang->error_searchflooding, $mybb-         >settings['searchfloodtime'], $remaining_time);
            }
            error($lang->error_searchflooding);
        }   
    }   
    if(($mybb->get_input('showresults') == "threads") || ($mybb->input['action'] == "finduserthreads2")  || ($mybb->input['action'] == "findthreads1"))
    {
        $resulttype = "threads";
    }   
    else
    {
        $resulttype = "posts";
    }
        if($mybb->input['action'] == "finduserthreads2")
    {   
                $search_data = array(
                        "keywords" => '',
                        "author" => $mybb->user['username'],
                        "postthread" => '1',
                        "matchusername" => $mybb->user['username'],
                        "postdate" => '',
                        "pddir" => '',
                        "forums" => '',
                        "findthreadst" => '',
                        "numreplies" => '',
                        "threadprefix" => ''
                );
    }

        elseif($mybb->input['action'] == "findthreads1")
    {
    $searcharray = array(
        "sid" => $db->escape_string($sid),
        "uid" => $mybb->user['uid'],
        "dateline" => $now,
        "ipaddress" => $db->escape_binary($session->packedip),
        "threads" => $search_results['threads'],
        "posts" => $search_results['posts'],
        "resulttype" => $resulttype,
        "querycache" => $search_results['querycache'],
        "keywords" => $db->escape_string($mybb->input['keywords']),
    );


and then a custom link in header_welcomeblock_member for access
			<li><a href="{$mybb->settings['bburl']}/search.php?action=finduserthreads2&uid={$mybb->user['uid']}">{$lang->welcome_mydiscussions}</a></li>&nbsp;
here is a simple method !
That is not the same.

That method you show only gets threads  you created. You are the author of every thread listed. This does not list threads you replied to in which someone else is the author of the thread.

However the method i show, gets threads you have created and replied to. Anyone can be the author. It is just whatever threads you have ever posted to.

example:

this is the list you are saying. As you can see every author is myself (metulburr).
https://python-forum.io/search.php?actio...eads&uid=1

However this is what i am saying. This list is different. The authors can be anyone. This shows threads i replied to or threads i started. It doesnt matter. Its just what i posted to ever.  
https://python-forum.io/search.php?actio...ads2&uid=1
^ above given link is not working for me (guest user)
assuming that it lists a thread (only) once.

find user posts [eg. 1 , eg. 2] lists such threads and links to each & every post by the user.
<a href="search.php?action=finduser&uid={$mybb->user['uid']}">View my posts</a>
The second one is not an egosearch as it only lists my threads i authored. The first however is a form of egosearch. But its expanded, blocky, hard to read, and most importantly, lists out every post. IT doesnt make it easy to scan. One problem with it is if you post a lot to one thread, it hogs all the real estate.

Egosearch only lists out the thread once. Makes it easy to scan threads. IF you combine that with the default bolding of unread posts, it makes it easy to spot which threads in the list are unread, and all of which you have once posted to.

Sorry i didnt know guests cant see that. Ill take screenshots.

my threads
[attachment=39866]

egosearch
[attachment=39867]
Well, yeah, you can see all threads you created or posted in them so I don't really see use of one function which is similar if not same to existing ones...
I feel that it should be an option in Search settings, it can be very useful for big boards.
For small boards, it will not matter much but for big boards, huge difference.
(2018-01-18, 08:56 AM)WallBB Wrote: [ -> ]I feel that it should be an option in Search settings, it can be very useful for big boards.
For small boards, it will not matter much but for big boards, huge difference.

I dunno, I use the feature a lot on phpBB boards; to see if there are any new replies in threads I've posted in.

Although, there again, if we're doing alerts, this becomes redundant I suppose.
What if one opted to not want alerts. Its kind of the same theme of subscriptions.

Like i wouldnt want to be annoyed with alerts/emails/PM's. I would rather get info when i am interested in getting updates (When i am on the board). And just have a list of threads to look at as opposed to PM/email/alerts. I have 100-200 new posts if i dont check my forum within a day sometimes. The only way to contain some sanity in that is to have an egosearch list. Emails/PM's/alerts would be atrocious if i was very active on the forum before posting in a lot of other peoples threads.
Quote:I use the feature a lot on phpBB boards; to see if there are any new replies in threads I've posted in.
ditto.

Quote:I feel that it should be an option in Search settings, it can be very useful for big boards.
You can acquire the same results by only punching in your own name in search. In fact that is what my change in search.php is automating. However i use it so much its a pain to have to go to search and type out your name, wait for it to search by the first portion of your name, and then click search. Its time consuming. There is not even a way to save that search (such as in ssave URL) because of SID. So you have to manually replicate that process every egosearch. The way i am proposing is the link to do it is right there in user links.

I use "My Discussions" link and "unread posts" link the most. Both of which are not default MyBB links. I probably click these links 20-30 times per day to keep updated on my board. I never use todays posts, my threads, my posts, new posts, etc. I opt out of subscriptions because i dont want to be annoyed via email. And i hate having to sift through PM's at this board to find new posts on threads i posted to.
I think this would be a very useful feature.

Alerts wouldn't make this redundant at all. Alerts is like the page you get when you search for posts under your own username, in that it lists every single post (even ones belonging to the same thread) separately. And the posts aren't sorted per thread, either; they're sorted as per creation time.

What the OP is suggesting is a page that serves you a neat list of threads you've participated in, with sorting options, and links for both last post and first unread.

It's kind of like your list of subscribed threads in your User CP, but different - difference is that your subscribed threads list shows all threads you're subscibed to regarless of whether you've actually participated, whereas the OP's list would list all threads you've participated in regardless of whether you're subscribed.
Pages: 1 2