News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

add Post per day from Profile to post user left sidebar

Started by Aileen, April 17, 2008, 05:14:32 AM

Previous topic - Next topic

Aileen

I would like to add the post per day from Profile of a user to the post user left sidebar just under the number of post and above the avatar.

Any clues on what file to edit and what what code to modify

Thanks so much

perplexed

there is no left sidebar on SMF.  Are you using Tiny Portal?  If so, try the Block code snippets board on the tiny portal site :)

Aileen

What I mean is the part of the post where the poster details is located. like the avatar and the number of posts

Bulakbol

SMF 1.1.4. Sources/Load.php,
Code (find) Select
'real_posts' => $profile['posts'],

Code ( add after) Select
'posts_per_day' => substr($profile['posts'] / (int) ((time() - $profile['dateRegistered']) / (3600 * 24)),0,5),

In default/Display.template.php
Code (find) Select
// Show how many posts they have made.
echo '
', $txt[26], ': ', $message['member']['posts'], '<br />
<br />';


Code (add after) Select
echo 'Per day: ', $message['member']['posts_per_day'], '<br />';


<edit> Replaced codes for 1.1.4 </edit>
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Aileen


Bulakbol

Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines


Aileen

BTW can I hide it for moderators or change it to a custom text like "I am geek"

Thanks

Bulakbol

You can do like this if you want.
if ($message['member']['group_id] == '3') // global moderators group id
echo 'Geek: ', $message['member']['posts_per_day'], '<br />';
else
    echo 'Per Day: ', $message['member']['posts_per_day'], '<br />';


Is that the way you want it?
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Aileen

Yeah, something like that, however it shows template parse error.

Where to place it BTW?

Thanks

metallica48423


if ($message['member']['group_id'] == '3') // global moderators group id
echo 'Geek: ', $message['member']['posts_per_day'], '<br />';
else
    echo 'Per Day: ', $message['member']['posts_per_day'], '<br />';

was missing a '

you would place it in display.template.php where you want it to appear.
Justin O'Leary
Ex-Project Manager
Ex-Lead Support Specialist

QuoteMicrosoft wants us to "Imagine life without walls"...
I say, "If there are no walls, who needs Windows?"


Useful Links:
Online Manual!
How to Help us Help you
Search
Settings Repair Tool

Bulakbol

oppss sorry about that. I missed the single quote after the ... group_id']. Thanks metallica48423.
Please do not PM me for support · My Mods and Theme · SMF Coding Guidelines · Modifications Approval Guidelines

Advertisement: