vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=134)
-   -   Anniversary Awards (https://vborg.vbsupport.ru/showthread.php?t=89942)

MrNase 10-15-2004 10:00 PM

Anniversary Awards
 
This mod is based on something Smoker did for his community at www.smokers-board.de :)

To see what it does you should read this thread at vbulletin.org

This hack will add +1 star for every year a user is registered. If you have users which are registered for 1 year they will have 1 star next to their username.. Users who are registered for 4 years will have 4 stars and so on.

Here are the instructions and Iam sorry I can't post them as a *.txt but I need this thread to explain how everything works.

Edit your template ?postbit? and find:

class="smallfont">$post[rank]</div></if>


Now add under that:
<if condition="$jointime > 1825"><img src="$stylevar[imgdir_misc]/star.gif" /></if>
<if condition="$jointime > 1460"><img src="$stylevar[imgdir_misc]/star.gif" /></if>
<if condition="$jointime > 1095"><img src="$stylevar[imgdir_misc]/star.gif" /></if>
<if condition="$jointime > 730"><img src="$stylevar[imgdir_misc]/star.gif" /></if>
<if condition="$jointime > 365"><img src="$stylevar[imgdir_misc]/star.gif" /></if>

Save it.
Now you just have to upload the attached image to images/misc and you should be fine.

Explanation:
$jointime holds the days a user is registered. A simple example for a user who registered for more than a year (in this case 377 days):
<if condition="377 > 365"><img src="$stylevar[imgdir_misc]/star.gif"></if>

This condition is true (377 is larger than 365) and he gets one star :)
Same if he is registered for more than 3 years (let's say 1099 days):
<if condition="1099 > 1095"><img src="$stylevar[imgdir_misc]/star.gif"></if>
<if condition="1099 > 730"><img src="$stylevar[imgdir_misc]/star.gif"></if>
<if condition="1099 > 365"><img src="$stylevar[imgdir_misc]/star.gif"></if>

In that case all three conditions are true and he gets 3 stars :) Simple isn't it?

You may even use different images like a blue star for the third year, a red one for the second year and so on.


Have fun and don't forget -> Smoker did most of the work :)

Michael2 10-18-2004 10:08 AM

That's a cool idea! Not sure I'll use it but I like it!

Erwin 10-18-2004 10:41 PM

Indeed, a good idea. :)

Lionel 10-20-2004 01:08 AM

yep, very nice idea...

rex_b 10-20-2004 08:53 PM

My forum isn't even a year old! :(

MustangLisa 11-10-2004 03:56 PM

Very cool and easy to do. Thanks!!

Natch 11-11-2004 01:08 AM

Creative genius it is ... nice work!

secret1980 11-24-2004 08:03 AM

nice idea but still my board needs 9 months to complete one year ;)

sabret00the 11-25-2004 04:00 PM

this is quite cool, i'm thinking of adding a party hat :)

but really i'd like to have it so it only appears on the aniversary what would be the condition i needed for that?

Dan 12-15-2004 04:10 AM

this is nice :D I can use it for people who have been at my site since the beginning :D

venomx 02-23-2005 06:29 AM

I seen something like this on a board I visit but they do it differently, on the 6 month they give a light colored star then on a year a bright colors star. Year and a half a bright one and a light one...

Would it be hard to make this do that?

shadiguy1 02-24-2005 01:11 AM

so then just change the dates. i did mine to 3 months then 6 months then 1 year then 2 years then 3 years.

hbalagh1 09-28-2005 03:44 PM

nice little mod... :banana:
i would like to know though

i have this below and would like to know how i can automatically turn the 3 month star into the 6 month star then the 6th into the annual and after the annual it just ads the stars like to original code is desisgned for?

Code:

<if condition="$jointime > 1825"><img src="$stylevar[imgdir_misc]/star.gif" alt="Anniversary Star"/></if>
<if condition="$jointime > 1460"><img src="$stylevar[imgdir_misc]/star.gif" alt="Anniversary Star"/></if>
<if condition="$jointime > 1095"><img src="$stylevar[imgdir_misc]/star.gif"alt="Anniversary Star" /></if>
<if condition="$jointime > 730"><img src="$stylevar[imgdir_misc]/star.gif" alt="Anniversary Star"/></if>
<if condition="$jointime > 365"><img src="$stylevar[imgdir_misc]/star.gif" alt="Anniversary Star"/></if>
<if condition="$jointime > 183"><img src="$stylevar[imgdir_misc]/star2.gif" alt="6 Months Star"/></if>
<if condition="$jointime > 92"><img src="$stylevar[imgdir_misc]/star3.gif"alt="3 Months Star"/></if>


dano 11-04-2005 07:26 PM

Anyone know how to make this work with 3.5?

Overlord 11-05-2005 09:26 AM

I was searching around for the very same thing.. the $jointime variable was obviously changed in 3.5

dano 11-05-2005 01:43 PM

Quote:

Originally Posted by Overlord
I was searching around for the very same thing.. the $jointime variable was obviously changed in 3.5

Yep, thats what I am trying to figure out now. Uggggh, help!

dano 11-07-2005 12:19 PM

Quote:

Originally Posted by dano
Yep, thats what I am trying to figure out now. Uggggh, help!

Anyone?

hbalagh1 02-19-2006 06:36 AM

anyone for 3.5

Kirk Y 08-11-2006 07:18 AM

Just make a new plugin for 'postbit_display_start' with the following:
Code:

$jointime = (TIMENOW - $this->post['joindate']) / 86400;

MustangLisa 09-20-2006 12:39 AM

Quote:

Originally Posted by acidburn0520
Just make a new plugin for 'postbit_display_start' with the following:
Code:

$jointime = (TIMENOW - $this->post['joindate']) / 86400;

Thank you!!!

vol_freak 12-05-2006 03:28 PM

Quote:

Originally Posted by acidburn0520 (Post 1049696)
Just make a new plugin for 'postbit_display_start' with the following:
Code:

$jointime = (TIMENOW - $this->post['joindate']) / 86400;

This seems to work but everyone seems to be getting 5 stars in the messaging system. When I am reading a PM from someone, everyone has 5 stars under their name regardless of join date. Any suggestions? Thank in advance.

Kirk Y 12-05-2006 09:17 PM

It's because the Plugin Code I supplied above is being used under 'postbit_display_start', which means the code is only being executed in the postbits.

You could try creating another hook with the same code using a location such as 'global_start' or 'private_showpm_start'.

MysticMoon 01-26-2007 04:05 PM

Quote:

Originally Posted by acidburn0520 (Post 1132769)
It's because the Plugin Code I supplied above is being used under 'postbit_display_start', which means the code is only being executed in the postbits.

You could try creating another hook with the same code using a location such as 'global_start' or 'private_showpm_start'.

1st thanks for the post bit info, that worked like a charm :D

But neither of the above worked for fixing the PM's showing all stars available :(

Kirk Y 01-26-2007 05:14 PM

If you want something simple, you could just wrap the IF Condition Blocks with one larger condition like:

Code:

<if condition="THIS_SCRIPT == 'showthread'">
Code here.
</if>

If you still want the awards to show in Private Messages; it's possible that the problem is in the "jointime" variable -- $this->post['joindate'] -- $this->post should be corrected for use with Private Messages.

MysticMoon 01-29-2007 01:26 AM

Quote:

Originally Posted by acidburn0520 (Post 1167881)
If you want something simple, you could just wrap the IF Condition Blocks with one larger condition like:

Code:

<if condition="THIS_SCRIPT == 'showthread'">
Code here.
</if>


Ok above worked to atleast remove the stars from PM's, would rather none show then all lol ~ so thank you :D

Quote:

Originally Posted by acidburn0520 (Post 1167881)
If you still want the awards to show in Private Messages; it's possible that the problem is in the "jointime" variable -- $this->post['joindate'] -- $this->post should be corrected for use with Private Messages.

Not sure if above will work or not, as I may just not know what to change it to
I tried $this->pm & $this->private as a plugin under "private_showpm_start" & no change - still showed all stars available in PM's.

Kirk Y 01-29-2007 01:50 AM

Yeah, that's why I figured I'd mention it to you - if you wanted to give it a try; as I don't know the right var. to use.

MysticMoon 01-29-2007 07:46 PM

Maybe someone else will post the answer then :)

Again, thank you so much with your help on this :D

SVTCobraLTD 11-04-2008 04:08 PM

Quote:

Originally Posted by Kirk Y (Post 1049696)
Just make a new plugin for 'postbit_display_start' with the following:
Code:

$jointime = (TIMENOW - $this->post['joindate']) / 86400;

With this plugin add, it works on 3.6.11. Thanks


All times are GMT. The time now is 04:22 AM.

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.01256 seconds
  • Memory Usage 1,779KB
  • 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
  • (7)bbcode_code_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (28)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