Small banner creator

Talk about anything in here.
User avatar
EcazS
Posts: 789
Joined: Fri May 06, 2011 5:29 pm

Small banner creator

Post by EcazS »

I was bored and I made a small banner creator, just for fun.

NOTE: I'm going to add more things like, more backgrounds, uploading your own background, fonts, size and stuff like that but that'll come later. I'm also going to add a logout button :lol:

The site might be a little slow the first time, not sure though.
http://ecazs.net/banner/

Username: User1
Password: user1
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: Small banner creator

Post by jacek »

Are you sure the password it right ? I don't seem to be able to log in.
Image
User avatar
EcazS
Posts: 789
Joined: Fri May 06, 2011 5:29 pm

Re: Small banner creator

Post by EcazS »

jacek wrote:Are you sure the password it right ? I don't seem to be able to log in.
Are you typing it right? O:
The password is all lower-case.
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: Small banner creator

Post by jacek »

I did it 4 times, but yeah apparently I was typing it wrong :lol:
Image
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: Small banner creator

Post by jacek »

Wow, its very pretty ;)

It also seems to work.

It might be nice if you made the form remember what was entered, so people can try different images.

And a font colour option would not be impossible if you are feeling adventurous.
Image
User avatar
EcazS
Posts: 789
Joined: Fri May 06, 2011 5:29 pm

Re: Small banner creator

Post by EcazS »

Why thank you :)

I was planning on making it "remember" the text just never got around do it.
And I want to add font color options I just don't know how to and I would have to get the RGB values

I could do some text recognition thing (if you enter "red" the text will be red) but that just seems... weird :lol:
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: Small banner creator

Post by jacek »

it would be possible if you get them to enter a hex code like #990000, or you might be able to get a "super jQuery colour picker" that can give you the RGB values.
Image
User avatar
EcazS
Posts: 789
Joined: Fri May 06, 2011 5:29 pm

Re: Small banner creator

Post by EcazS »

But how would I convert the hex into RGB values :? If I can do that I can use a normal hex jquery color picker :lol:

Edit, adding it now :D
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: Small banner creator

Post by jacek »

http://php.net/manual/en/function.hexdec.php

As ususal, php makes it very easy :)
Image
User avatar
EcazS
Posts: 789
Joined: Fri May 06, 2011 5:29 pm

Re: Small banner creator

Post by EcazS »

I found a pre-made function,
function HexToRGB($hex) {
		$hex = ereg_replace("#", "", $hex);
		$color = array();
 
		if(strlen($hex) == 3) {
			$color['r'] = hexdec(substr($hex, 0, 1) . $r);
			$color['g'] = hexdec(substr($hex, 1, 1) . $g);
			$color['b'] = hexdec(substr($hex, 2, 1) . $b);
		}
		else if(strlen($hex) == 6) {
			$color['r'] = hexdec(substr($hex, 0, 2));
			$color['g'] = hexdec(substr($hex, 2, 2));
			$color['b'] = hexdec(substr($hex, 4, 2));
		}
		
		return $color;
	}
Source: http://snipplr.com/view/4621/convert-he ... gb-to-hex/

Is there anything wrong with it?
User avatar
Dylan
Posts: 150
Joined: Fri May 06, 2011 7:14 pm

Re: Small banner creator

Post by Dylan »

This is pretty nice; the design is well and functions nicely!
Tino
Posts: 360
Joined: Thu May 05, 2011 8:55 pm
Location: The Netherlands

Re: Small banner creator

Post by Tino »

ereg, that's what's wrong with it.

Use preg_replace instead.
Please check out my CodeCanyon items.
User avatar
GenSwat
Posts: 74
Joined: Sat May 07, 2011 3:37 pm

Re: Small banner creator

Post by GenSwat »

I likes it nice job m8
One of my Favorites
Image
bowersbros
Posts: 534
Joined: Thu May 05, 2011 8:19 pm

Re: Small banner creator

Post by bowersbros »

EcazS wrote:
jacek wrote:Are you sure the password it right ? I don't seem to be able to log in.
Are you typing it right? O:
The password is all lower-case.
make username case insensitive by using strtolower() around the value before you check with database (also do same with registrations so its the same) capitals are very annoying to remember for usernames and emails etc and add no extra security since they're visible.

if then, when you display a username you want it to be like User1 instead of user1 as it would be seen if just echo'ed

Simply use ucwords() around the display variable. :')
I don't like to brag, but I wasn't circumcised. I was circumnavigated. ;)

Want to learn something new? Or maybe reinforce what you already know? Or just help out? Please subscribe to my videos: http://goo.gl/58pN9
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: Small banner creator

Post by jacek »

Tino wrote:ereg, that's what's wrong with it.

Use preg_replace instead.
A simple str_replace would do in this case.

Other than that it looks good to me ;)
Image
Tino
Posts: 360
Joined: Thu May 05, 2011 8:55 pm
Location: The Netherlands

Re: Small banner creator

Post by Tino »

Hmm, true indeed :)
Please check out my CodeCanyon items.
User avatar
EcazS
Posts: 789
Joined: Fri May 06, 2011 5:29 pm

Re: Small banner creator

Post by EcazS »

Good point Bowers, that never occurred to me :lol:
I ended up using preg_replace...

I now added a color wheel so you can use other colors. I also noticed if you add a "!" in the hex box it's going to be "remembered" by the form but the color will still be black and if you type a bunch of invalid characters the box will be empty. So for now, just use valid stuff :lol:

http://ecazs.net/banner/

Username: User1 (not case sensitive anymore ;) )
Password: user1
Tino
Posts: 360
Joined: Thu May 05, 2011 8:55 pm
Location: The Netherlands

Re: Small banner creator

Post by Tino »

That might be because of the !important thing in CSS. I never used it and have no idea what it is for, but apparently it could have some sort of effect on this :)

Just theorycrafting though.
Please check out my CodeCanyon items.
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: Small banner creator

Post by jacek »

I think it makes that style apply to child elements have that style even if they specify their own. There is an IE hack that involves it too, not really sure what it does to be honest.
Image
User avatar
EcazS
Posts: 789
Joined: Fri May 06, 2011 5:29 pm

Re: Small banner creator

Post by EcazS »

UPDATE :D
Added a live preview of background, text and text color.
Improved quality by switching to PNG instead of JPG :)
I will NOT remove images from now on, unless I find them inappropriate..(how?)
Made some changes in the design
Added more 450px bars! (check the top ones ;) )
No more login to create!

Should work fine if not, just let me know (oh and you need to have javascript enabled to get the live preview and color options...)

http://ecazs.net/banner

Issue 1 resolved
I had strlen set to < 50 not > 50 :lol:
User avatar
jacek
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK
Contact:

Re: Small banner creator

Post by jacek »

Nice, I guess the images are so small you can store millions before you have bandwidth issues.

You can have the thin images form my banners page if you like ? You seem to be lacking in 450px wides.
Image
Post Reply