MyBB Community Forums

Full Version: Why does MyBB encapsulate the seach via SID
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Why does MyBB encapsulate the seach via SID? 

in phpBB we had values in the url such as...
http://python-forum.org/search.php?search_id=newposts


but the same search in MyBB would yeild the url of...
http://python-forum.io/search.php?action...65c05df2c3

For one we would like the url values because we can link to them. If we bookmark an SID, the same url the following day is invalid.
The reason sids are not kept that long is because in the database it stores the values for which threads or posts fit the criteria. It is not going to be current after 24 hours more than likely. I had created a Fast Search plugin which is much better than the default search system and currently have it check for the same keywords within a specific amount of time( default is 15 minutes. )
Thanks. Do you have a link to that plugin?

Or is there anyway to replicate the way phpBB did it with the values being in the url?

The reason i am asking is because from our old forum
we had unanswered posts, unread posts, new posts, active topics, and your posts


and everyone wants those back...

I found plugins for unanwered posts and unread posts, and new posts are default to myBB. But i cannot find view active topics or your posts (egosearch) without running a search in MyBB. And then users cant bookmark the search link because they are invalid after 24 hours.
We do have some which work with keywords, such as:

https://community.mybb.com/search.php?action=getnew
https://community.mybb.com/search.php?action=getdaily
https://community.mybb.com/search.php?ac...&uid=24419 (where uid is a user ID)

These do result in redirects to searches with SIDs though.
@Euan T
It doesnt matter if the end result is a SID. We just want something to put at our header to link to.

The last one is a my posts link
search.php?action=finduser&uid=24419

The problem with this is "my posts" is much different than an ego search. It does not show who is the latest poster in "my posts". The problem with "My Threads" is it only searches out your own threads, and not of which you posted in.  The problem with subscriptions is we dont want to get a PM or email when someone posts in response...we want a list of them... something like an egosearch. This can manually be done by going to search -> serarch out username -> search, but then we cant link that to the header because of the SID is no longer valid 24 hours later.  Is there anything resembling this in MyBB? or a plugin, or a modification that we could add to add this?
(2016-09-20, 04:31 PM)metulburr Wrote: [ -> ]@Euan T
It doesnt matter if the end result is a SID. We just want something to put at our header to link to.

The last one is a my posts link
search.php?action=finduser&uid=24419

The problem with this is "my posts" is much different than an ego search. It does not show who is the latest poster in "my posts". The problem with "My Threads" is it only searches out your own threads, and not of which you posted in.  The problem with subscriptions is we dont want to get a PM or email when someone posts in response...we want a list of them... something like an egosearch. This can manually be done by going to search -> serarch out username -> search, but then we cant link that to the header because of the SID is no longer valid 24 hours later.  Is there anything resembling this in MyBB? or a plugin, or a modification that we could add to add this?

You can subscribe with the "Subscribe without receiving any notification", which is what I have set as my default option in user CP > Options. This will just give you a list of subscribed threads in the User CP where there have been new posts.

It is still lacking slightly, but that's the best approach within the core. I'm not experienced with @dragonexpert's plugin, but it might have some better options.
Or use favorite threads plugin Wink
The only problem with permanent search links is the method restriction - only POST requests are allowed.
This can be changed by removing the second condition:
 && $mybb->request_method == "post"
from https://github.com/mybb/mybb/blob/mybb_1....php#L1462 (similarly with @dragonexpert's Fast Search, in search2.php).
After applying this change, you will be able provide search parameters in the URL:
search.php?action=do_search&keywords=test
(2016-09-20, 05:10 PM)Devilshakerz Wrote: [ -> ]The only problem with permanent search links is the method restriction - only POST requests are allowed.
This can be changed by removing the second condition:
 && $mybb->request_method == "post"
from https://github.com/mybb/mybb/blob/mybb_1....php#L1462 (similarly with @dragonexpert's Fast Search, in search2.php).
After applying this change, you will be able provide search parameters in the URL:
search.php?action=do_search&keywords=test

I believe this will work. I just have to figure out the username parameters...for example I am trying to hard code the url for searching your own username in search. But i dont know what values to plugin the url? Im not real well at PHP and the search.php is quite long to determine methods. 

			<a href="{$mybb->settings['bburl']}/search.php?action=results&sid={$mybb->user['username']}&sortby=lastpost&order=desc">View My Posts</a>

Ive kinda been randomly inserting urls that i might think would register just because i dont know the values to put in such as

http://python-forum.io/search.php?action...=metulburr
http://python-forum.io/search.php?action...=metulburr
http://python-forum.io/search.php?action...arch&UID=1
http://python-forum.io/search.php?action...arch&uid=1

What url and value in the url do i have to put in to mimic?
search -> search your own username -> search button
Pages: 1 2