Jump to content

Archived

This topic is now archived and is closed to further replies.

The Little Guy

PHP snippets

Recommended Posts

Might be helpful to provide a dropdown to specify a certain snippet... you might want to collect their email address too.  And provide some kind of error message if they don't fill it out correctly.  Oh, and you should probably make a name/email address required for submission.

 

Is that for comments?

Share this post


Link to post
Share on other sites

No, for the contact form.

Share this post


Link to post
Share on other sites

YOU got to be kidding me! The site you just recommended is just as bad as this one. I love simple stuff, but you can't make it as simple and easy that it lacks some edge in nice pictures or logos. You pretty much have all colors here and there, and think its awesome. I want some eye flashing appealing images!!!

Share this post


Link to post
Share on other sites

Why should I put more images? The site is about coding, not flashy graphics. This isn't a PhotoShop site, or graphic design site, it is a coding site. The more images that are added, the more distracting it will be. There is already 16 graphics on every page. How are you going to get more out of the codes if I add graphics?

 

If you would like more graphics, don't just say add more graphics, explain where, and what too.

Share this post


Link to post
Share on other sites

At a viewer perspective, it looks very plain. You can't just sneak out by using various colors of the rainbow. I recommend adding an image right underneath "About Snippets" that looks cool. - Like a link to an about page. Its a recommendation. It's your site.

Share this post


Link to post
Share on other sites

There are a lot of improvements going on since my last visit :D, I like the different ranking lists, they look very professional :P

Ted

Share this post


Link to post
Share on other sites

What exactly is the "Snippets Tags" sections based on?

Share this post


Link to post
Share on other sites
What exactly is the "Snippets Tags" sections based on?

This is the function I use to determine the font size:

function fontSize($voteTotal,$views){
$points = $voteTotal;
if($points<1){
	$size = 11;
}else{
	$size = ($points * $views) / 4;
}
if($size > 40){
	$size = 40;
}
if($size < {
	$size = 8;
}
return 'font-size:'.$size.'px';
}

 

Basically all it does is check how many times the page has been viewed, and multiplied it by the total number of votes and then divided it by 4. The rest you probably can understand.  Is this a good way of doing it or should I try another way?

 

On my web host's site, there is a site of the month section where you can rate peoples sites, so far it is at a 7.2 out of 10 with 18 votes! -- F.Y.I

johjoy: "lots of PHP sites already, but this one is simpler to navigate, not a bad idea at all."

ricmil4: "As a php user I just had to vote for this one :)"

jcroes: "i love it - i put it on my bookmarks bar! Holy crap!"

duvy: "the layout is plain, but i never get enough snippets!"

davall2: "Extremely useful"

saitti: "ok"

farfar1: "Awesome"

pautom: "not bad - easy to navigate but a bit simple"

akameh1: "Nice snippets, but need to be better organised"

aszabo: "good site"

davpac4: "Great layout and navigation, but a lot of content is missing. The index letters at the top should only display when there are snippets in that specific location. Snippet examples should be loaded into the page featuring the code (if possible)."

karkya: "Nice site. i would make the header shorter to move the content up."

snuff: "Not a very attractive site, but a useful one""

oztripping: "Useful, so gets my vote"

rpr91: "very very good! "

garflo: "good"

morning: "Nice design, but more important very useful"

dbeilhartz: "not bad"

 

yeah, to me it all looks the same. What exactly did you change?

The purple section? I don't know how you saw it last though.

Share this post


Link to post
Share on other sites

OK, I was just wondering what determined the size... and it is the number of views. Are you going to apply a limit onto it so that only snippets with a certain number of views are on there, instead of every single snippet? (Sorry, I am just finding the tag cloud rather distracting...)

 

Also, the voting system is a bit wierd. Smaller icons (preferably stars) would be better.

Share this post


Link to post
Share on other sites

I was only limiting the number of tags to 50 random tags, but now I think that, that is too many. I never liked the tag cloud Idea in the fist place, but previous post said it would be nice, so I added one.

Share this post


Link to post
Share on other sites

I moved the location of the tag cloud, What do you think about the new location?

 

Looks much better placed down there.

Share this post


Link to post
Share on other sites

What exactly is the "Snippets Tags" sections based on?

This is the function I use to determine the font size:

function fontSize($voteTotal,$views){
$points = $voteTotal;
if($points<1){
	$size = 11;
}else{
	$size = ($points * $views) / 4;
}
if($size > 40){
	$size = 40;
}
if($size < {
	$size = 8;
}
return 'font-size:'.$size.'px';
}

 

Basically all it does is check how many times the page has been viewed, and multiplied it by the total number of votes and then divided it by 4. The rest you probably can understand.  Is this a good way of doing it or should I try another way?

 

 

This is probably the stupidest thing I ever heard of. It is jumbled up text with a maze of different font sizes. Its a good idea but def. something that makes me want to you give a 1.0 out of 10 - F.Y.I

Share this post


Link to post
Share on other sites

Don't use a tag cloud. Instead use a section for the the most popular pages. The most popular page would be on top, just like the most popular page would have the largest font in the tag cloud. Or you can base it on user interactivity. Such as voting. The top voted scripts would be posted on the homepage. I just don't like tag clouds. You are better off deleting the tag cloud, or replacing it with what I have mentioned.

Share this post


Link to post
Share on other sites

I already have a most popular page, its the blue section, or are you talking about something different? I think I may turn the blue part into multiple popular types:

- Most page views

- Highest vote score

Share this post


Link to post
Share on other sites

I just added AJAX to the site! AJAX is sweet. It is in the blue box.

 

 

If anyone has any idea how to do a better highest score... Could you give me an idea?

 

I currently do this:

SELECT * FROM snippets ORDER by votes DESC, voteTotal/votes DESC LIMIT 20

Share this post


Link to post
Share on other sites

SELECT *, score AS (voteTotal/votes) FROM snippets ORDER by votes,score DESC LIMIT 20;

Perhaps? Then you can access the score when you've fetched the result too (without having to perform the division again).

Share this post


Link to post
Share on other sites

i must say though, i'm pretty impressed with the direction things are going generally. When this topic first started, the site was pretty lame and bare, and now it's taking form (both functionally and visually) quite well.

 

there are still issues of too much space up top (notably the header area and 2 grey panels) that need to be sorted out, as the rest of the site is taking a 'busy' form. also just the fact that on one hand you're using gradients, and the other hand it's plain unstyled 2D. try:

 

1, replace the text in the red panel (About Snippets) with "Welcome, PHP Code Snippets", and get rid of the "Welcome, PHP Code Snippets" from under the logo. This'll gain a nice bit of real estate to pull your main content up a bit.

2, drop the size of the logo area a bit, maybe to about 60-75% of what it is now. as with my first point, this will bring your content up a bit and leave less whitespace next to it to fill.

3, under "New snippets", there's a huge chunk of space. If you reduced the size of the blue "popular snippets" panel to 15 items instead of 20, this would even things out a bit.

 

either way, it's getting better.

well done so far.

Share this post


Link to post
Share on other sites

The text size in "Snippet Tags" is WAY too big. Just noticed it. Also, you need new images for rating (star.gif) - they don't look really nice.

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.