• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.2 How to create an index of threads by authors

jauburn

Well-known member
#1
On my forum we have a bunch of writers. They'd love for me to create an index of writers (maybe a xenforo page) or a link under their names in postbit that allows readers, with one click, to pull up a list of the threads that they started that have been moved onto such boards as editors' picks. In other words, I need a search query that pulls threads by author/user and by board(s). How do I create such a query that I can attach to a name or a link?

I tried just copying the URL that resulted from an advanced search that accomplished what I'm after, but apparently that URL doesn't work for users other than me. So I guess I need some kind of variable. Not sure how to do that.

Can anyone help?

Thanks.
 

Jeremy

Well-known member
#2
Search is user based and only lasts for a set amount of time, if I remember correctly. As such, if you post a search link, it won't work later.
 

jauburn

Well-known member
#3
Search is user based and only lasts for a set amount of time, if I remember correctly. As such, if you post a search link, it won't work later.
Well, yes, I discovered that. So I was wondering what the proper search string would be that is reusable.
 

jauburn

Well-known member
#5
You could do this using the various fields available such as users and nodes.

For example, a hard coded URL to search for threads started by me would be: http://xenforo.com/community/search/search?users=brogan&user_content=thread

For threads started by me in the Suggestions forum it would be: http://xenforo.com/community/search/search?users=brogan&user_content=thread&nodes[]=18
Thanks, Brogan.

How would I create a single string that pulls up posts started by a user in two separate forums?

Thanks.
 

jauburn

Well-known member
#12
Oh, in that case just use a space or translate it to %20, like so:
Code:
http://xenforo.com/community/search/search?users=chris%20deeming&user_content=thread
Yes, that worked! Thanks. So to get more than one forum, I just separate with a comma, like 2,3?
 

Brogan

XenForo moderator
Staff member
#13
Oops sorry, nodes should be separated with +, so, e.g. 45+18+15

Also, regarding this:
Now, would there be a way somehow to generate such a link under a user's postbit, or somewhere else?
Depending on the template, you can use {$visitor.username}

You can check whether that is available in the template by adding: {xen:helper dump, $visitor.username} to the template.
 

jauburn

Well-known member
#16
Oops sorry, nodes should be separated with +, so, e.g. 45+18+15

Also, regarding this:

Depending on the template, you can use {$visitor.username}

You can check whether that is available in the template by adding: {xen:helper dump, $visitor.username} to the template.
That's over my head. But I will attempt to figure it out when my head is clearer.
 

jauburn

Well-known member
#19
The 18 and 25 are the two node IDs.
You need to add each node ID you want to search in.
Brogan, how would I use this search string to create a custom user field in Users -> Custom User Fields? I see there's a "Value Display HTML" box. Could I create something that would allow each member to display a link under his/her username on posts that would provide one-click access to all of the user's selected works from particular boards? Thanks!
 

DRE

Well-known member
#20
I have gotten the link from their profile page and put it on their member card. I also used Nobita's started threads addon to make their threads a profile page list