Log in

View Full Version : Last Post by member



JRR
12-24-2013, 02:21 PM
I hope this is the correct spot to post this if not please excuse me and move it to the proper area.

As all know I use Proboards for hosting my scooter forum and I've been trying to add a button code into the user profile area of the HTML code. I can add the button with no problem using either one of these codes:


<input type="button" value="Last Post" onclick="JavaScript:alert('Thanks... I feel much better now!')" />

<button type="button" onclick="JavaScript:alert('You liked that, didn\'t you!')">Last Post</button>


I just put some quotes in the code other than Last Post to use an example.


Now here is the user profile code that I'm working with:


<div class="container show-user">
<div class="title-bar">
<h1>View Profile - $[user.name] ($[user.username])</h1>
</div>
<div class="content cap-bottom">
<div class="ui-tabMenu">
<ul class="ui-helper-clearfix">
{foreach $[menu]}<li{if $[menu.active]} class="ui-active"{/if}><a href="$[menu.href]">$[menu.text]</a></li>{/foreach}
</ul>
</div>
<div class="pad-all-double clear">
<div class="float-left">
<div class="float-left pad-right">$[user.avatar_medium]</div>
<div class="name_and_group float-right">
<span class="big_username" style="color: $[user.color];">$[user.name]</span><br />
{if $[user.group]}
$[user.group.name]<br />$[user.group.stars]
{else}
$[user.rank.name]<br />$[user.rank.stars]
{/if}
</div>
</div>
<div class="float-right controls">
$[options]
$[send_message_button]
$[edit_profile_button]
$[follow_button]
$[invite_button]
<div class="float-right clear pad-top">
Username: <span class="note pad-right">$[user.username]</span>
{if $[user.is_online]}
Member is Online
{else}
Last Online: <span class="note">$[user.last_online]</span>
{/if}
</div>
</div>
</div>
<div class="pad-all-double ui-helper-clearfix clear">
$[content]
</div>
</div>
</div>



Now I want and can again make a new button using either one of those codes above and I want to place it right under this which again I know the button will work:


div class="float-right controls">
$[options]
$[send_message_button]
$[edit_profile_button]
$[follow_button]
$[invite_button]


Now what I'm wanting to do is put a button that when clicked will show just the user profile that I'm looking at Last Post they made on the forum. Now I've tried all kinds of things as far as codes like


$[last_post_button]


to no avail and my hosting service says the variable is no there right now but I think it could be picked up like this possibly but I don't know exactly how to put it together with the Last Post button?

I use this to display the Latest Member who has joined the forum and the Latest Post by all members in another section of my template layouts and it grabs both things and displays them so I was wondering if something similar with a button could be made?



<span id="newest-user" style="display: none;">Welcome to Our Newest Student, $[newest_user]!</span>
<span id="last-thread" style="display: none;">Lastest Student Post: $[last_updated_thread.recent_link] By $[last_updated_thread.last_post.created_by_user] </span>
<script type="text/javascript">
fContent.push(document.getElementById('last-thread').innerHTML);
fContent.push(document.getElementById('newest-user').innerHTML);
</script>


As you can see it grabs the last thread and is not displayed but actually shows the last post by the member and the javascript code helps get the info or this is how I believe it to work?

Can something similar be done with the Last Post Button I'm wanting? Also I just remembered that I have members who have never made a post so something will need to be put in saying something like, "this member has no posts"?

Thanks

JRR
12-28-2013, 10:18 PM
Any thoughts?

Deadweight
12-28-2013, 10:36 PM
I still dont know what you are trying to do.

Are you trying to do a count of their posts?

JRR
12-29-2013, 06:14 AM
No sir I was just trying to bring up the posts period, I finally figured it out:



<script>

$(function(){

var recent = $("a.recent-threads-button");

recent.clone().attr("href", "/posts/recent").html("Recent Posts").insertBefore($("#navigation-tree"));
recent.clone().attr("href", "/members?dir=asc&sort=name&view=birthdays").html("Today's Birthdays").insertBefore($("#navigation-tree"));
recent.clone().attr("href", "/threads/participated").html("Recent Threads").insertBefore($("#navigation-tree"));

if (proboards.data("route").name == "home") {
var lastUpdated = $(".last-updated > a").attr("href");
recent.clone().attr("href", lastUpdated).html("New Post").insertBefore($("#navigation-tree"));
};

});

</script>



What I wanted and finally did was put up clickable buttons to get info from different pages of the forum template as in this preview:

http://scootproftest.freeforums.net/

That is just my test forum but you can see the last and recent posts, recent threads and birthday buttons on the menu bar.