Advertisement:

Author Topic: [Tip] Activity Level in posts  (Read 42720 times)

Offline Marcus Forsberg

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,608
  • Gender: Male
    • marcus.t.forsberg on Facebook
    • marcusforsberg on LinkedIn
    • @marcusforsberg on Twitter
    • marcusforsberg.net
[Tip] Activity Level in posts
« on: November 08, 2008, 05:21:47 PM »
Greetings!

This simple tip will show you how to put a Activity Level bar in each post.
The bar width increases by 1px for every post the member does.
When it reach 100px, it stops.
It works whit both SMF series.



Let's get started by opening ./Themes/default/Display.template.php and find the following line:
Code: [Select]
// Show avatars, images, etc.?
Got it?  ;)
Then replace that line whit this code:
Code: [Select]
// The Activity bar... Small.... Simple... And made by Nascar :)
echo '                                  <b>', $txt['activity_level_posts'], '</b><br />
<img src="'.$settings['images_url'].'/poll_left.gif"><img src="'.$settings['images_url'].'/poll_middle.gif" height="12px" width="', ($message['member']['posts'] < 100) ? $message['member']['posts'] : 100, '" title="', $txt[26], ': ', $message['member']['posts'], '"><img src="'.$settings['images_url'].'/poll_right.gif"><br />
<br />';

// Show avatars, images, etc.?



You should have a bar displaying in each topic now, right?
Then head for ./Themes/default/languages/Modifications.english.php and add this right before ?>:
Code: [Select]
$txt['activity_level_posts'] = 'Activity Level';


We're done! Yey! ;D
In the feature I'll develop this tip in to a mod whit various admin features and more bars, based on different stats.

Also, a big thanks goes to:
Deprecated - Code help
geneiuk - Testing
MaxiPes - Requester


Enjoy
Nascar
« Last Edit: November 08, 2008, 05:29:05 PM by Nascar »

Offline genieuk

  • Sr. Member
  • ****
  • Posts: 779
  • Gender: Male
Re: [Tip] Activity Level in posts
« Reply #1 on: November 08, 2008, 05:42:21 PM »
Great Modification. Simple yet useful.  ;)

Works Great!

Mathew
« Last Edit: November 08, 2008, 05:48:22 PM by genieuk »

Offline Anthony`

  • Sophist Member
  • *****
  • Posts: 1,347
  • Gender: Male
  • Formerly Project Evolution
    • AnthonyCalandra on GitHub
Re: [Tip] Activity Level in posts
« Reply #2 on: November 08, 2008, 05:45:20 PM »
Interesting. :)

Offline TheDisturbedOne

  • SMF Hero
  • ******
  • Posts: 1,700
    • Disturbed Message Board
Re: [Tip] Activity Level in posts
« Reply #3 on: November 08, 2008, 06:16:36 PM »
I think it is good, but I would like to see a bit more, if and when you upgrade it.  Like when you don't post for a while it goes down.
Good job anyway!

Offline MaXiForum.cz

  • Senior Translator
  • Full Member
  • *
  • Posts: 690
  • Gender: Male
  • Czech SMF support
    • MaxiFórum
Re: [Tip] Activity Level in posts
« Reply #4 on: November 09, 2008, 03:43:18 AM »
It is amazing!!!
THX Nascar
I test this :)

Offline Jessikard

  • Jr. Member
  • **
  • Posts: 236
Re: [Tip] Activity Level in posts
« Reply #5 on: November 09, 2008, 10:59:22 AM »
great - thx
and if it´s possible when you update please with a little bit more differences inside the levels

Offline Marcus Forsberg

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,608
  • Gender: Male
    • marcus.t.forsberg on Facebook
    • marcusforsberg on LinkedIn
    • @marcusforsberg on Twitter
    • marcusforsberg.net
Re: [Tip] Activity Level in posts
« Reply #6 on: November 09, 2008, 11:34:22 AM »
Thanks for the comments!
This is just a small and fast solution to this. More adavanced features are comming..

Offline Jessikard

  • Jr. Member
  • **
  • Posts: 236
Re: [Tip] Activity Level in posts
« Reply #7 on: November 09, 2008, 11:41:21 AM »
well, so i´m waiting for your great work  ;)

Offline Costa

  • SMF Hero
  • ******
  • Posts: 3,045
  • Gender: Male
  • Do NOT feed the trolls...
Re: [Tip] Activity Level in posts
« Reply #8 on: November 09, 2008, 05:06:13 PM »
Nascas, a litlle sugestion

Can you make another bar?
turning from red to green?
And the activity can be measure by month?

Farewell and congrats for the tip
Hugo "Costa" Fernandes
Todas as MP's a pedir ajuda são sujeitas a radioactividade, microondas, queimadas e atiradas borda fora.

"At least someone appreciates the fact that I am doing and not thinking..."
"Laziness is counter-revolutionary."

Offline Deprecated

  • SMF Hero
  • ******
  • Posts: 3,499
Re: [Tip] Activity Level in posts
« Reply #9 on: November 09, 2008, 05:29:40 PM »
How about making the activity indicator go in three sections? Like 1-100, 100-1000, 1000-10000, but equal widths. You could make the readout scale logarithmic. :)

Offline genieuk

  • Sr. Member
  • ****
  • Posts: 779
  • Gender: Male
Re: [Tip] Activity Level in posts
« Reply #10 on: November 09, 2008, 09:01:00 PM »
Nascas, a litlle sugestion

Can you make another bar?
turning from red to green?
And the activity can be measure by month?

Farewell and congrats for the tip

Hi,

I have created some poll bars in different colours:

http://www.simplemachines.org/community/index.php?topic=273419.0

Regards,
Mathew

Offline Deprecated

  • SMF Hero
  • ******
  • Posts: 3,499
Re: [Tip] Activity Level in posts
« Reply #11 on: November 09, 2008, 10:45:43 PM »
Can somebody please do this mod in ultraviolet light for me? It would look great with my black light posters and lava lamps. ;) :P

Offline MaXiForum.cz

  • Senior Translator
  • Full Member
  • *
  • Posts: 690
  • Gender: Male
  • Czech SMF support
    • MaxiFórum
Re: [Tip] Activity Level in posts
« Reply #12 on: November 10, 2008, 04:32:32 AM »
How about making the activity indicator go in three sections? Like 1-100, 100-1000, 1000-10000, but equal widths. You could make the readout scale logarithmic. :)

   
good idea, how?

Offline Deprecated

  • SMF Hero
  • ******
  • Posts: 3,499

Offline Jade Elizabeth

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,629
  • Gender: Female
  • Keep your enemies close and your friends closer ;)
    • jadetrainor on LinkedIn
    • @alundra on Twitter
    • Jades-World
Re: [Tip] Activity Level in posts
« Reply #14 on: November 10, 2008, 10:48:22 AM »
I love this idea, but my forum is FULL of spammers...

The bar width increases by 1px for every post the member does.
When it reach 100px, it stops.

^ So that wouldnt work. Unless by changing the "100" parts of the code I could increase it?
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring forum: Color Me Forum/Patreon.

Offline genieuk

  • Sr. Member
  • ****
  • Posts: 779
  • Gender: Male
Re: [Tip] Activity Level in posts
« Reply #15 on: November 10, 2008, 10:58:09 AM »
You could increase yes, very easily but if you do the bar becomes to wide and disrupts the page look. The bar increases 1px every time a post is made, once it reaches 100 it stops, if you increase any further than 100 it will as stated go to long and things start looking horrible and messy.

Nascar is working on several otherthings to improve it and the idea of having 3 bars is good as that way 3 bars can increase.

Example:

bar one, once it reaches 100 it stops (like it currently does) and then it starts on next bar.

I did modify the code earlier to test i got 3 bars showing but when i change the values of the two others nothing happens this is because it needs a bit of extra tweaking to increase second and third bar. Only way i could get it to increase was by changing the px width of the second and third bar which is useless.

Mathew

Offline Jade Elizabeth

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 12,629
  • Gender: Female
  • Keep your enemies close and your friends closer ;)
    • jadetrainor on LinkedIn
    • @alundra on Twitter
    • Jades-World
Re: [Tip] Activity Level in posts
« Reply #16 on: November 10, 2008, 11:00:28 AM »
I mean, if it increases per post, can I increase that? To like 100 or 500 or 1000 posts?  I'd only want the bar 125px long :)
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring forum: Color Me Forum/Patreon.

Offline Deprecated

  • SMF Hero
  • ******
  • Posts: 3,499
Re: [Tip] Activity Level in posts
« Reply #17 on: November 10, 2008, 11:06:53 AM »
See my post above regarding logarithms. If you make the scale logarithmic it doesn't have to stop at 100. You could have for example a 3 inch area for the indicator where 0 to 1 inch represents 1-100 posts, 1 inch to 2 inches represents 100-1000 posts, and 2 inches to 3 inches represents 1000-10000 posts. I think you can see how it gets more compressed at the upper end, yet still shows small changes at the lower end.

I expect 3 inches is too big for this application but it could be scaled to whatever is desired. Colors could be added too.

It's Nascar's project so I'm not going to do anything beyond making suggestions. He's a budding mathematics expert and figuring this out would be good for his learning. :)

Offline genieuk

  • Sr. Member
  • ****
  • Posts: 779
  • Gender: Male
Re: [Tip] Activity Level in posts
« Reply #18 on: November 10, 2008, 11:25:34 AM »
I agree, now you explained it, it would make sence and the ability to extend it beyond 100 with no increase in bar width.

I think Nascar will also agree with this.

MAthew

Offline MaXiForum.cz

  • Senior Translator
  • Full Member
  • *
  • Posts: 690
  • Gender: Male
  • Czech SMF support
    • MaxiFórum
Re: [Tip] Activity Level in posts
« Reply #19 on: November 12, 2008, 11:04:08 AM »
Hi, my friend and admin www.maxiforum.cz modificated it this way:

http://princ.name/temp/activity-bar.xml
or
http://www.maxiforum.cz/activity-bar.xml

There is screen:


THX Nascar, Deprecated and Jaa(c) :)
PS: install it by hand ;)