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

Find all content

Cees50

Active member
#1
In the profile page of a user, in the tab postings, there are beneath two links.

one is Find all content by {name}
the other one is Find all threads by {name}

My users dont find those links. They are all vB users...
Where and what do i have to change, so the two links are in the navtab of the forum beside the whats new?
 

Cees50

Active member
#2
Find the place where i can place that. Its in navigation template.

But if i place this
Code:
<ul>
                                    <xen:hook name="member_view_search_content_types">
                                    <li><a href="{xen:link search/member, '', 'user_id={$user.user_id}'}">{xen:phrase find_all_content_by_x, 'name={$user.username}'}</a></li>
                                    <li><a href="{xen:link search/member, '', 'user_id={$user.user_id}', 'content=thread'}">{xen:phrase find_all_threads_by_x, 'name={$user.username}'}</a></li>
                                    </xen:hook>
Then i get an error. It cant find the member... Must i place some code more?
 

ManOnDaMoon

Well-known member
#3
The links in the profile are not search links, they are actions from the members controller:
http://xenforo.com/community/members/cees50.15174/recent-content
http://xenforo.com/community/members/cees50.15174/recent-activity

So your code should more look like
Code:
<ul>
                                    <xen:hook name="member_view_search_content_types">
                                    <li><a href="{xen:link members/recent-content, {$user.user_id}}">{xen:phrase find_all_content_by_x, 'name={$user.username}'}</a></li>
                                    <li><a href="{xen:link members/recent-activity, {$user.user_id}}">{xen:phrase find_all_threads_by_x, 'name={$user.username}'}</a></li>
                                    </xen:hook>
Untested, have a go and tell me if it works.
EDIT : fixed bad copy/paste.
 

ManOnDaMoon

Well-known member
#4
Also, you want it to appear in the navtab but I'm not sure the $user template var is accessible from there. This is probably the cause of your error.

On a side note, placing those links related to the main content into the navigation area is not a good practice IMHO. But I assume you know your users better than I do. ;)
 

Cees50

Active member
#6
Also, you want it to appear in the navtab but I'm not sure the $user template var is accessible from there. This is probably the cause of your error.

On a side note, placing those links related to the main content into the navigation area is not a good practice IMHO. But I assume you know your users better than I do. ;)
My users... They are vB users and are struggling to learn. So i try to get it as easy as possible. Never want to go back:)
 

Cees50

Active member
#7
The links in the profile are not search links, they are actions from the members controller:
http://xenforo.com/community/members/cees50.15174/recent-content
http://xenforo.com/community/members/cees50.15174/recent-activity

So your code should more look like
Code:
<ul>
                                    <xen:hook name="member_view_search_content_types">
                                    <li><a href="{xen:link members/recent-content, {$user.user_id}}">{xen:phrase find_all_content_by_x, 'name={$user.username}'}</a></li>
                                    <li><a href="{xen:link members/recent-activity, {$user.user_id}}">{xen:phrase find_all_threads_by_x, 'name={$user.username}'}</a></li>
                                    </xen:hook>
Untested, have a go and tell me if it works.
EDIT : fixed bad copy/paste.
Tried the new version.. didnt work. still get the error message that it cant find the user
 

ManOnDaMoon

Well-known member
#8
It seems I misunderstood your question, and submitted the wrong links. Yours were OK from the start, so forget about my first post.

Finally, I checked and the $user template var is not usable in the navigation template. You have two options :
- either these links are supposed to give a user the ability to find its own posts : then you can use your links but replace the $user.user_id var with $visitor.user_id :
Code:
<ul>
                                    <xen:hook name="member_view_search_content_types">
                                    <li><a href="{xen:link search/member, '', 'user_id={$visitor.user_id}'}">{xen:phrase find_all_content_by_x, 'name={$visitor.username}'}</a></li>
                                    <li><a href="{xen:link search/member, '', 'user_id={$visitor.user_id}', 'content=thread'}">{xen:phrase find_all_threads_by_x, 'name={$visitor.username}'}</a></li>
                                    </xen:hook>
- or you want these links to be related to the user profile that is beeing shown, thus the only option is to move these links from their place in the member_view template to somewhere else in the same template, e.g. under the avatar: find
Code:
<xen:include template="ad_member_view_below_avatar" />
and add below
Code:
<a href="{xen:link search/member, '', 'user_id={$user.user_id}'}">{xen:phrase find_all_content_by_x, 'name={$user.username}'}</a>
<a href="{xen:link search/member, '', 'user_id={$user.user_id}', 'content=thread'}">{xen:phrase find_all_threads_by_x, 'name={$user.username}'}</a>
The result is as follows: Capture.PNG Then do a little styling and you're done.
 

Cees50

Active member
#12
Yes i did :) But somewere its going wrong,

This is what i did
Code:
<!-- forums -->
        <xen:if is="{$tabs.forums}">
            <li class="navTab forums {xen:if $tabs.forums.selected, 'selected', 'Popup PopupControl PopupClosed'}">
     
                <a href="{$tabs.forums.href}" class="navLink">{$tabs.forums.title}</a>
                <a href="{$tabs.forums.href}" class="SplitCtrl" rel="Menu"></a>
         
                <div class="{xen:if {$tabs.forums.selected}, 'tabLinks', 'Menu JsOnly tabMenu'} forumsTabLinks">
                    <div class="primaryContent menuHeader">
                        <h3>{$tabs.forums.title}</h3>
                        <div class="muted">{xen:phrase quick_links}</div>
                    </div>
                    <ul class="secondaryContent blockLinksList">
                    <xen:hook name="navigation_tabs_forums">
                        <xen:if is="{$visitor.user_id}"><li><a href="{xen:link 'forums/-/mark-read', $forum, 'date={$serverTime}'}" class="OverlayTrigger">{xen:phrase mark_forums_read}</a></li></xen:if>
                        <xen:if is="{$canSearch}"><li><a href="{xen:link search, '', 'type=post'}">{xen:phrase search_forums}</a></li></xen:if>
                        <xen:if is="{$visitor.user_id}"><li><a href="{xen:link 'watched/threads'}">{xen:phrase watched_threads}</a></li></xen:if>
                        <li><a href="{xen:link 'find-new/threads'}" rel="nofollow">{xen:phrase whats_new}</a></li>
                     
<xen:hook name="member_view_search_content_types">
  <li><a href="{xen:link search/member, '', 'user_id={$visitor.user_id}'}">{xen:phrase find_all_content_by_x, 'name={$visitor.username}'}</a></li>
                                    <li><a href="{xen:link search/member, '', 'user_id={$visitor.user_id}', 'content=thread'}">{xen:phrase find_all_threads_by_x, 'name={$visitor.username}'}</a></li>
</xen:hook>
                                    </xen:hook>
 
                    </ul>
                </div>
            </li>
 

ManOnDaMoon

Well-known member
#13
Read again my post ;) You have two options. The one you chose is for the current visitor only, so you must replace $user.user_id with $visitor.user_id
For specific user links, you have to edit the member_view template.
 

Cees50

Active member
#14
Picked the wrong code, changed it in the one i use. .. It wouldnt show up. Now it does again. And i didnt changed a thing???? Thanks for the help. its a mystery :censored: