Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Aiheen aloitti: spiros - helmikuu 27, 2006, 04:26:45 AP

Otsikko: Show your posts in home page?
Kirjoitti: spiros - helmikuu 27, 2006, 04:26:45 AP
I find this functionality pretty useful (i.e. when I want to edit one of my posts). Currently one has to go to Profile->Show posts, but this is cumbersome.
Otsikko: Re: Show your posts in home page?
Kirjoitti: RyanJones - helmikuu 27, 2006, 05:16:36 AP
Lainaus käyttäjältä: spiros - helmikuu 27, 2006, 04:26:45 AP
I find this functionality pretty useful (i.e. when I want to edit one of my posts). Currently one has to go to Profile->Show posts, but this is cumbersome.

I believe it can be done via SSI... http://www.simplemachines.org/community/index.php?topic=14906.0

Cheers,

Ryan Jones
Otsikko: Re: Show your posts in home page?
Kirjoitti: spiros - helmikuu 27, 2006, 08:50:13 AP
Well, yes, you can display "Your posts" via SSI but this is not what I meant. I mean the addition of an extra link "Your posts" on SMF next to

LainaaShow unread posts since last visit. | Show new replies to your posts.

it is a suggestion  ;)
Otsikko: Re: Show your posts in home page?
Kirjoitti: RyanJones - helmikuu 27, 2006, 09:33:29 AP
Oh, sorry...  :(

Anyay, see if this works as a temporary fix:

Open: /Themes/ThemeName/index.template.php

Find: <a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a><br />';


Replace With:

<a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a><br />
                <a href="', $scripturl, '?action=profile;u=', $context['user']['id'] , ';sa=showPosts">Show your posts.</a><br />';


Cheers,

Ryan Jones
Otsikko: Re: Show your posts in home page?
Kirjoitti: spiros - helmikuu 27, 2006, 11:43:07 AP
Thanks Ryan! This is a cool trick which many forums incorporate by default. For example punbb has:

    Show recent posts
    Show unanswered posts
    Show your subscribed topics
    Show your posts
Otsikko: Re: Show your posts in home page?
Kirjoitti: RyanJones - helmikuu 27, 2006, 11:45:30 AP
Lainaus käyttäjältä: spiros - helmikuu 27, 2006, 11:43:07 AP
Thanks Ryan! This is a cool trick which many forums incorporate by default. For example punbb has:

    Show recent posts
    Show unanswered posts
    Show your subscribed topics
    Show your posts

Thats true, I'm shure it will be included some time :) Until then that patch should do :)

Cheers,

Ryan Jones
Otsikko: Re: Show your posts in home page?
Kirjoitti: spiros - maaliskuu 01, 2006, 04:29:28 IP
What if one wants to also add a link for the 20 latest posts (Normally appearing in the "View the 20 most recent posts on the forum" at the Forum stats box? I tried adding this:

<a href="', $scripturl, '?action=recent">', $txt[234], '</a>', $context['show_stats'] ? '<br />

but I got Template parse error
Otsikko: Re: Show your posts in home page?
Kirjoitti: RyanJones - maaliskuu 01, 2006, 05:25:26 IP
Lainaus käyttäjältä: spiros - maaliskuu 01, 2006, 04:29:28 IP
What if one wants to also add a link for the 20 latest posts (Normally appearing in the "View the 20 most recent posts on the forum" at the Forum stats box? I tried adding this:

<a href="', $scripturl, '?action=recent">', $txt[234], '</a>', $context['show_stats'] ? '<br />

but I got Template parse error

Replace:

<a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a><br />
                <a href="', $scripturl, '?action=profile;u=', $context['user']['id'] , ';sa=showPosts">Show your posts.</a><br />';


With:

<a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a><br />
                <a href="', $scripturl, '?action=profile;u=', $context['user']['id'] , ';sa=showPosts">Show your posts.</a><br /><a href="', $scripturl, '?action=recent">', $txt['234'], '</a><br />';


Cheers,

Ryan Jones
Otsikko: Re: Show your posts in home page?
Kirjoitti: spiros - maaliskuu 02, 2006, 05:18:36 AP
Thanks Ryan!

By the way, an error in your site:
Lainaa
: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 8 in /home/ryanjone/public_html/Projects/UA_Strings/Project_UA_Include.php on line 62

Warning: Cannot modify header information - headers already sent by (output started at /home/ryanjone/public_html/Projects/UA_Strings/Project_UA_Include.php:62) in /home/ryanjone/public_html/header.php on line 51
Otsikko: Re: Show your posts in home page?
Kirjoitti: RyanJones - maaliskuu 02, 2006, 05:31:00 AP
Lainaus käyttäjältä: spiros - maaliskuu 02, 2006, 05:18:36 AP
Thanks Ryan!

By the way, an error in your site:
Lainaa
: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 8 in /home/ryanjone/public_html/Projects/UA_Strings/Project_UA_Include.php on line 62

Warning: Cannot modify header information - headers already sent by (output started at /home/ryanjone/public_html/Projects/UA_Strings/Project_UA_Include.php:62) in /home/ryanjone/public_html/header.php on line 51

Yea I know, annoying bug in my includes system...working on it :)

Cheers,

Ryan Jones
Otsikko: Re: Show your posts in home page?
Kirjoitti: Dannii - maaliskuu 02, 2006, 05:33:08 AP
If you want the link to show your own posts, you can change it to
echo '<a href="', $scripturl, '?action=profile;sa=showPosts">Show your posts.</a><br />';
The u=whatever isn't needed.
Otsikko: Re: Show your posts in home page?
Kirjoitti: RyanJones - maaliskuu 02, 2006, 05:41:56 AP
Lainaus käyttäjältä: eldacar - maaliskuu 02, 2006, 05:33:08 AP
If you want the link to show your own posts, you can change it to
echo '<a href="', $scripturl, '?action=profile;sa=showPosts">Show your posts.</a><br />';
The u=whatever isn't needed.

Ah, I used that because its in the profile, never knew if it was required - always best to be shure :)

Cheers,

Ryan Jones
Otsikko: Re: Show your posts in home page?
Kirjoitti: spiros - maaliskuu 02, 2006, 06:03:30 AP
<a href="', $scripturl, '?action=recent">', $txt['234'], '</a><br />';

Is there a parameter one can add to make the recent posts appear with older posts first?
Otsikko: Re: Show your posts in home page?
Kirjoitti: RyanJones - maaliskuu 02, 2006, 06:38:15 AP
Lainaus käyttäjältä: spiros - maaliskuu 02, 2006, 06:03:30 AP
<a href="', $scripturl, '?action=recent">', $txt['234'], '</a><br />';

Is there a parameter one can add to make the recent posts appear with older posts first?

I don't think there is unless you edit & addone yourself and edit the DB queries :(

Cheers,

Ryan Jones