[MOD-DB] Annual Stars 1.0.1 (Last Update May 8, 2006)

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

[MOD-DB] Annual Stars 1.0.1 (Last Update May 8, 2006)

Post by drathbun »

MOD Title: Annual Stars
MOD Description: Displays a graphic (a star is included with the MOD) for each year of membership.
MOD Version: 1.0.1
MOD Download: Please use Release Topic here
Demo Board: None, see screen shots to be provided shortly

1.0.1 Update
Per a suggestion from a post later in this topic, included the template path + user selected style in the image path location. So instead of having a single graphic stored in images/star.gif you can now have templates/subSilver/images/star.gif and templates/subRed/images.star.gif and so on. Note that the image name should be the same in all templates used on your board, only the location is different.

My graphics skills are minimal. :-) I did a color shift on my original star graphic (and also reduced the color depth, cutting the file size from near 1K down to ~ 200 bytes) and provided 3 additional colors. If anyone wants to submit annual "reward" images (they do not have to be stars, obviously) I will happily host them, subject to my approval. I don't intend to host "inapproprate" images, you will have to host those yourself. I have the final call as to what is considered "inappropriate" for hosting on my site. :-)

Original MOD Description follows
This MOD allows the board admin to provide a link to a small image or icon of some sort. This icon will be displayed under the username in their profile, on the member listing, and on the viewtopic display once the user has reached a year of membership. There icon will be repeated for each year of membership.

The calculation process is not very sophisticated, it simply looks for 365 day intervals since the use has joined. As a result it will not handle leap years. We did not think that it needed to be that precise.

A simple star graphic is included with the MOD. You can use it or you can switch it out for another graphic of your choice. The path to the image is set in the admin control panel (ACP) so you do not need to edit any code in order to switch the image.

Graphics included: Image Image Image Image

You can consider each of the non-admin install sections optional. If you want to display the annual stars only on the profile then skip the sections dealing with viewtopic (both the php and the tpl files). You may also opt to skip the memberlist changes. Note that if you install via EasyMOD or some other automatic installer you will have to edit the template file prior to using it if you do not want to install all three parts.
Last edited by drathbun on Mon May 08, 2006 1:18 pm, edited 2 times in total.
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image
Disturbed One
Registered User
Posts: 129
Joined: Sun Apr 03, 2005 12:31 am

Post by Disturbed One »

Hello,

This is very cool, especially since there are no extra SQL queries.

I can upload some screenshots.
User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Post by drathbun »

I'm making screenshots now, will post them in a few minutes. 8) Thanks.
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image
Disturbed One
Registered User
Posts: 129
Joined: Sun Apr 03, 2005 12:31 am

Post by Disturbed One »

Hello,

You have an error.

admin_board.php

Code: Select all

	'ANNUAL_STARS' => $new['annual_stars'],
should be

Code: Select all

	'ANNUAL_STARS' => $new['annual_image'],
Disturbed One
Registered User
Posts: 129
Joined: Sun Apr 03, 2005 12:31 am

Post by Disturbed One »

Hello,

Wait... all of your other things look at "annual_stars". So your SQL query should be that then.
User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Post by drathbun »

The following screen shots are all from actual boards where this MOD is in use. The first four show the various different screens where the annual star could be displayed, and in this case only one year of membership has been recognized. The last two samples are from a board that has been around for a lot longer, and shows how the annual stars are repeated per each year of membership.

I put this MOD right at RC (release candidate) status because it's fairly simple, and I've been using it for over 3 years. I don't expect any coding issues, but there might be issues in the way the template / install instructions are written up.

Admin Control Panel
Image

Memberlist
Image

Profile
Image

On a post (viewtopic)
Image

Samples showing more than one year of membership
Image
Image
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image
User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Post by drathbun »

Disturbed One wrote: Hello,

Wait... all of your other things look at "annual_stars". So your SQL query should be that then.

See, I knew there would be some sort of problem with the install notes! :lol: Fixing now, thanks.
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image
User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Post by drathbun »

Fixed. I didn't bother updating the version, as I doubt many other folks have downloaded / installed it yet. Thanks for the quick turn-around, hopefully that's the only glitch.
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image
Disturbed One
Registered User
Posts: 129
Joined: Sun Apr 03, 2005 12:31 am

Post by Disturbed One »

Hello,

The only other "problem" I see is in the view profile there is no title. The source uses alt.

So I changed the line to be

Code: Select all

$term_img = str_repeat('<img src="' . $board_config['annual_stars'] . '" border="0" title="' . $lang['Annual_stars'] . '" />', $term);
instead of your

Code: Select all

$term_img = str_repeat('<img src="' . $board_config['annual_stars'] . '" border="0" alt="' . $lang['Annual_stars'] . '" />', $term);
An alt will not be useful if the image is not there, because "Years of Membership" does not really help. I'm not sure if it really is a problem or not.
User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Post by drathbun »

No, you're right, it should be "title" instead of "alt". I copied the code from the original board I wrote this for, and that was several years ago when I didn't understand the difference in the usage of alt and title. ;-) I'll update it, thanks again.
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image
User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Post by drathbun »

Download link updated, still 1.0.0 though. 8)
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image
Peter77sx
Registered User
Posts: 3260
Joined: Wed Nov 09, 2005 2:51 pm

Post by Peter77sx »

Hello, I installed the SQL before you updated. has the SQL changed?

::edit:: yes it has.

Works great. it was an nice idea for a MOD. thanks. :)
Last edited by Peter77sx on Sun Apr 16, 2006 6:10 am, edited 1 time in total.
User avatar
drathbun
Former Team Member
Posts: 12204
Joined: Thu Jun 06, 2002 3:51 pm
Location: TOPICS_TABLE
Contact:

Post by drathbun »

Geez, y'all are fast. :shock: It's after midnight on a Saturday where I am, and I know I have no life, what excuse do the rest of you have? ;-)

Minor changes to the code (change alt= to title= in one place) and yes, the SQL insert statement has changed. You'll have to update it directly as the admin panel won't "see" the value until the name matches. Once you update the row (or simply delete it and insert a new one) then you can update the value via the ACP.
I blog about phpBB: phpBBDoctor blog
Still using phpbb2? So am I! Click below for details
Image
Peter77sx
Registered User
Posts: 3260
Joined: Wed Nov 09, 2005 2:51 pm

Post by Peter77sx »

Oops, double post.
Last edited by Peter77sx on Sun Apr 16, 2006 6:22 am, edited 8 times in total.
Peter77sx
Registered User
Posts: 3260
Joined: Wed Nov 09, 2005 2:51 pm

Post by Peter77sx »

Yup, got it to work... thanks.

Its after 2am over here. plans were cancled for the night! :o
Locked

Return to “[2.0.x] MODs in Development”