• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Signature Badge Script

  • Thread starter Thread starter Floris
  • Start date Start date
my sign right now fails to get my username ... weird ... :confused:

It's because of your permission settings. If you have it set to "members only", the script can't get the information it needs. I'll have a more user-friendly error-message in the next version. Unfortunately there's no way around this, other than opening up your profile. :)
 
It's because of your permission settings. If you have it set to "members only", the script can't get the information it needs. I'll have a more user-friendly error-message in the next version. Unfortunately there's no way around this, other than opening up your profile. :)

thanks for the tip Eric ;)
 
It's because of your permission settings. If you have it set to "members only", the script can't get the information it needs. I'll have a more user-friendly error-message in the next version. Unfortunately there's no way around this, other than opening up your profile. :)

Didn't know that. Was just about to ask the same thing myself. :)
 
Well, that was fun :)

Updated my signature to be short and simple again :)
 
Ceri May, did you return the favor and released the php code for the /sig/ generator that makes the bbcode top copy/paste?
 
Alright guys, I'm stuck. Everything works, except I can't figure out how to draw the damn rounded corners using GD. I can do this:
Code:
sig.php?userid=103&fontface=tahoma&bg_color1=f266ff&bg_color2=a766ff&text_color=FFFFFF&border_color=633c97&shadow_color=7c629e&shadow_x=0&shadow_y=-1&showXF=false
onlygd.png


But I can't figure out how to draw the "caps". I looked into various "rounded corners" GD tutorials, but I couldn't find anything that would 1) work with the gradient, 2) allow me to append a 1px border around the cap and 3) keep the corners transparent.

If anybody has any ideas, I am totally open. The closest I've come is this library:
http://mierendo.com/software/antialiased_arcs/

Unfortunately, you can only draw solid ellipses. I may have to dig in to the math-heavy source and see if I can make it work, but it's going to be extremely difficult.

I'm also starting to question whether making it customizable like this is actually a good idea, considering it's entirely possible to make something like this:

bad.png


Yikes! :eek:
 
Seems if you used the trick they mention the antialiased arcs would work. Unless the gradient is the problem there.
 
Seems if you used the trick they mention the antialiased arcs would work. Unless the gradient is the problem there.

Yeah, the problem is the arc would need to be filled with a vertical gradient, and as far as I know that's not possible with the code they have. I'm going to mess around with it right now though and see if I can hack up a solution. Probably not likely, but it's worth trying.
 
I can see this framework being super epic, the sig could be turned into an html element and styled using pure css 3 to make it look the same but be less intense on someones server running image functions, possibly an ajax mod that reads the xml file or gets the JSON returned and then creates the element based on the info. @Kier & Mike dudes vbulletin was dumb to let you guys go I like your open mind approach and the various REST implements which will make mods that include user info easier to make.
 
Yeah, the problem is the arc would need to be filled with a vertical gradient, and as far as I know that's not possible with the code they have. I'm going to mess around with it right now though and see if I can hack up a solution. Probably not likely, but it's worth trying.

Yeah, I got stuck at a similar point. Can't think of a quick way of getting an arc, with transparency one side and gradient the other.
 
Ceri May, did you return the favor and released the php code for the /sig/ generator that makes the bbcode top copy/paste?

Not yet as I still wish to make a number of changes to it, the code is quite hacky ATM... however anyone can use that generator with their own installation then just change the domain... Once it is rewritten IE better OOP then I will release it :D though @Erik it you want it now let me know and I can send it to you :D
 
EPIC WIN

I got it. It required a lot of drawing (on paper :p), a lot of math, solving quadratic equations, dealing with loops, re-sampling, and a whole lot of trial and error.

I basically built my own function to draw half of an ellipse. It uses a loop to go through line by line, changing the color every line to give the appearance of a gradient. Most of the work came from getting the correct equation to calculate where to start and stop the line to get a nice, clean curve. I accomplished anti-aliasing by doing this all at 4 times the size needed, then re-sampling it down to normal size.

Here are some results that I created in a few minutes messing around with the variables:

purple.png


green.png


simple.png


blueorange.png


The archive is too large to attach because of the fonts I've included, so you can download it here:
http://www.erikswan.net/signature/eriks-signature-generator-2.5.zip

A quick warning to anyone who's thinking of hosting this: Because everything is being generated with GD (no images except the icons), this version requires quite a bit more processing power. It's not outrageous and I don't think it will have a significant impact on the server compared to the last version, but images will take longer to load when they are generated, and you should watch the server load just to be careful. :)

There are a lot more query options this time (obviously), so here's the documentation:

Quick note on color options: I made sure that this is backward-compatible with all the signatures already out there, so ?userid=xxx&color=orange will still work as expected - all the previous color presets are already built in. :)

You should also note that if you are going to specify colors, all of them are required except shadow_color, which will default to white.

Code:
    ### Available options: ###
    type                        name            default        description
    ----------------------------------------------------------------------------------------------------
    int                         userID                        The ID number of the user
    
    {red, blue, yellow,         color           blue        The color of the background element and text
    green, purple, orange,
    gray}
    
    {georgia, arial, tahoma,    fontface        georgia        The font of the text. Times is actually Times New Roman.
    trebuchetms, times}
    
    string (hex value)          bg_color1                    Starting color for background gradient
    
    string (hex value)          bg_color2                    Ending color for background gradient
    
    string (hex value)          border_color                The color of the border around the background element
    
    string (hex value)          text_color                    The color of the text
    
    string (hex value)          shadow_color    FFFFFF        The color of the text shadow
    
    int                         shadow_x        1            The x-offset for the text-shadow
    
    int                         shadow_y        1            The y-offset for the text-shadow
    
    {posts, trophies, likes}    elements        all 3        Pick elements to show in the badge. You may mix and match, at least one (1) is required
    
    bool                        showName        true        If true, will show the Username and a dotted line seperator to the right
    
    bool                        showXF          true        If true, will show the small "xF" logo piece to the left of the username

Going to bed for now, hopefully something isn't majorly broken. :)

Enjoy!
 
Top Bottom