Star Member mod
 
Notifications
Clear all

Star Member mod

7 Posts
3 Users
0 Reactions
2,070 Views
(@lyndsie)
Posts: 1263
Member Moderator
Topic starter
 

I recently wrote a small mod to put a star next to the username of members who donated hosting funds for my site. If anyone's interested I can share the details. It obviously doesn't have to be just for donors but could be used for other purposes, like a special services or something.

It's so far only appearing in profiles next to member status (example: http://www.dracoandginny.com/viewuser.php?uid=1992). I'm going to put it into like listings.tpl and viewstory.tpl as well. I know it looks simple, but the reason I modded the files was because I didn't just want to make something they could use in the 'bio' section of their profiles, because that's easy to copy and also doesn't stand out as much. You could actually put whatever image you wanted, or whatever text you wanted (similar to the "New!" in listings.tpl).

So if you're interested let me know and I'll put up the code changes I made.


 
Posted : 30/09/2009 10:08 pm
 kali
(@kali)
Posts: 307
Reputable Member
 

We're interested! This would also be great for people who won challenges and other stuff.


Skins made by Kali are no longer supported!

 
Posted : 02/10/2009 8:40 am
(@lyndsie)
Posts: 1263
Member Moderator
Topic starter
 

Cool. I'll post the instructions once I finish up adding it to the other places I mentioned. Should be in the next couple of days. (Famous last words.)


 
Posted : 05/10/2009 3:00 am
(@lyndsie)
Posts: 1263
Member Moderator
Topic starter
 

Blargh, so not having so much luck with adding the stars elsewhere. Either they don't show up, or they show up for everyone, defeating the point. Still working on that. In the meantime, here's how to add it to profiles. You will have to edit the database. I didn't build an interface to add the users for this, so you'll have to change the 0s to 1s via PHPMyAdmin or what have you.

STEP ONE: Add a field to fanfiction_authors.
Name: donated Type: tinyint(1) NOT NULL Default: 0

Change whoever you want to get the star/image/whatever to 1.

STEP TWO: Add the following to user/profile.php


if($userinfo['donated'])
$tpl->assign("donated", "<img src=""images/donated.gif"");"

Change the path in the img src tag to whatever you want it to be, just make sure to keep the slashes for its quotes.

STEP THREE: Add {donated} to the profile.tpl of skins. If you don't want to call it donated, change the "donated" in the tpl assign to whatever you want to call it. Same goes for the name of what it's called in the database; as long as the part with $userinfo matches the name of the field in the DB then it should be okay.

That's it. However, since the skin variable was created in user/profile.php, {donated} only works in profile.tpl. That means that for viewstory.tpl and storyindex.tpl it should be created in viewstory.php, and for listings.tpl...? Still not sure on that one. (It's used across multiple files but I don't know how its variables are 'global'; there might be an easier way to do this whole thing.) But $userinfo doesn't exist there and so far I am failing at writing a proper query. I'll come back once I straighten it out.


 
Posted : 07/10/2009 5:45 pm
 Elle
(@jenny)
Posts: 594
Honorable Member
 

I didn't use the database for this one yet, but I this works for listings:

includes/storyblock.php:


/* DONATED [L] */
if (in_array($stories['uid'], array(157)))
$tpl->assign("donated", "<img src=""$url/images/donated.gif"" alt="Star Member!" title="Star Member!" />");

(I'm lazy. xP)

Thank you for this mod. <33


archive: dramione.org
site: accio.nu

Available for skin/mod commission! πŸ™‚

 
Posted : 07/07/2010 12:45 pm
(@lyndsie)
Posts: 1263
Member Moderator
Topic starter
 

What's the array(157)?


 
Posted : 12/07/2010 11:08 pm
 Elle
(@jenny)
Posts: 594
Honorable Member
 

Oh, that's just the uid I was working with (lazy and didn't have access to phpMyadmin). With orig I think you could just do this:

	if ($stories['donated'] == 1)

I'm not sure if it's auto-called though...


archive: dramione.org
site: accio.nu

Available for skin/mod commission! πŸ™‚

 
Posted : 13/07/2010 3:55 pm
Share: