vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Custom badge in posbit_legacy for users with > X posts per day? (https://vborg.vbsupport.ru/showthread.php?t=110645)

TrickyD 03-17-2006 12:42 PM

Custom badge in posbit_legacy for users with > X posts per day?
 
If someone has a few extra minutes and could help me do this I'd greatly appreciate it.

I already have a code in my postbit_legacy that gives a user a badge if their join date was prior to a point X as

Code:

<if condition="$post['jd_dateline'] + 31536000 <= TIMENOW">
<img border="0" src="http://www.utopiafootball.com/images/pridestickers/veteran_3.gif" alt="Veteran" vspace="1">&nbsp;
</if>

But I have not been able to figure out a similiar conditional statement for displaying a badge for users with over a specific number of posts per day.

I'm basically looking for

<if posts_per_day > 20>
Display image
</if>

Can anyone offer that code for me?

amykhar 03-17-2006 12:47 PM

You can do math in templates. So, all you need is $post[posts] divided by the number of days the member has been a member.

So, (TIMENOW - $post['jd_dateline']) / (24*60*60) gives you the number of days.

Which means you want $post[posts]/((TIMENOW - $post['jd_dateline']) / (24*60*60)) or

$post[posts]/((TIMENOW - $post['jd_dateline']) / 86400)

TrickyD 03-17-2006 01:22 PM

Thank you for your reply and help, amykhar.

I attempted to implement that code, but my results were not appropriate.

I entered the code as follows

Code:

<if condition="1 < $post[posts]/((TIMENOW - $post['jd_dateline']) / 86400)">
<img border="0" src="http://www.utopiafootball.com/images/pridestickers/post+++++_2.gif" alt="Post +++++" vspace="1">&nbsp;
</if>

Did I make any mistakes there?

The icon displays for every member of the forum if I flip the < to > which seems to indicate to me I'm not getting a proper value.

Any ideas?

amykhar 03-17-2006 01:56 PM

Let me try on my site and see what I come up with. I'll be back in a bit.

amykhar 03-17-2006 02:15 PM

1 Attachment(s)
ok. Here you go. It was TIMENOW that was hosing it. I put together this plugin for you to start with.

It's a plugin, not a product so import it as such.

Then, change the activeposter variable to have the image you want. and use $activeposter in the postbit where you want it.

TrickyD 03-17-2006 02:34 PM

Works perfectly now.

Thank you very much for your help Amy! I definitely appreciate it.

amykhar 03-17-2006 03:01 PM

My pleasure.

Trana 03-17-2006 03:17 PM

Is there a hack that does this for different groups, usertitles, postcounts?


All times are GMT. The time now is 02:42 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01128 seconds
  • Memory Usage 1,721KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete