- Grew a moustache for the Envato Movember competition
- Community Moderator
- Contributed a Blog Post
- Author was Featured
- Item was Featured
- Won a Competition
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Has been a member for 4-5 years
Limit the use of unnecessary HTML markup code:
reason: harder to get it working cross browser.
like below, you could style “td” tags just the same as a the “h2” span is.
Original code: (this span was in EVERY td and th in the entire application)
print '<td><span class="h2">'. $row['rcvd_dt'] .'</span></td>';
New Code:
print '<td>'. $row['rcvd_dt'] .'</td>';
- Grew a moustache for the Envato Movember competition
- Community Moderator
- Contributed a Blog Post
- Author was Featured
- Item was Featured
- Won a Competition
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Has been a member for 4-5 years
Thought I’d start a thread about some annoying/bad PHP programming code. The large PHP projects I get handed (which were started by cheap out-sourcing or self-taught programmers) tend to include these or similar over and over again.
Don’t hardcode colours into php files (or even html files for that matter)
use css classes instead, so you only have to update a single css rule instead of every single php file in the whole app.
Original code:
if ($oddRow == 1) {
print '<'.'tr style="background-color: white;">';
$oddRow = 0;
}else{
print '<'.'tr style="background-color: #dddddd;">';
$oddRow = 1;
}
Replacement PHP code:
print '<'.'tr class=" . (($oddRow++%2) ? 'even' : 'odd') . ">';
New CSS code:
tr.odd{background:#FFF;} tr.even{background:#DDD;}
Feel free to post your own bad code below!
- Grew a moustache for the Envato Movember competition
- Community Moderator
- Contributed a Blog Post
- Author was Featured
- Item was Featured
- Won a Competition
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Has been a member for 4-5 years
University FTW .
The student groups we created & joined, extra-curricular activities we created (eg: lan parties) & attended (eg: programming contests), and spending time with lecturers discussing more advanced topics set me up real good.
After Uni, majority of freelance work came from people I met through uni, my extra-curricular activities, or referrals by lecturers who could see I was interested. (imagine how good it would be if you were connected with every past real-world-successful student who had similar interests to you!)
Uni cannot (and will not) teach you everything you need in the real world work environment, but it certainly sets you up to be a great employee, employer, or freelancer. You get all the basic foundations that are missed in most self-taught scenarios.
University is a tool and you need squeeze every last experience out of it, then squeeze some more.
Can’t wait to go back for a second round one day.
- Grew a moustache for the Envato Movember competition
- Community Moderator
- Contributed a Blog Post
- Author was Featured
- Item was Featured
- Won a Competition
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Has been a member for 4-5 years
Please contact the item author.
- Grew a moustache for the Envato Movember competition
- Community Moderator
- Contributed a Blog Post
- Author was Featured
- Item was Featured
- Won a Competition
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Has been a member for 4-5 years
I’ve added this over on Envato’s new site, snipplr:
http://snipplr.com/view/37613/get-the-number-of-facebook-likes-using-php/
edit: yep tested and it works shweet
- Grew a moustache for the Envato Movember competition
- Community Moderator
- Contributed a Blog Post
- Author was Featured
- Item was Featured
- Won a Competition
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Has been a member for 4-5 years
Good luck!!
Don’t let customers stress you out 
Freelancing (aka: working for yourself) is the best decision I’ve ever made!
And don’t cut ties totally with old employers, some can be a great source of ongoing work.
- Grew a moustache for the Envato Movember competition
- Community Moderator
- Contributed a Blog Post
- Author was Featured
- Item was Featured
- Won a Competition
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Has been a member for 4-5 years
I made this script years ago:
http://dtbaker.com.au/random-bits/website-screenshot-thumbnail-creator-script.html
but yea, wouldn’t work on the every day linux server. you could only run it on a home linux box with the relevant software installed.
- Grew a moustache for the Envato Movember competition
- Community Moderator
- Contributed a Blog Post
- Author was Featured
- Item was Featured
- Won a Competition
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Has been a member for 4-5 years
..renders the opening php tag funny on everything except the last ‘pre’ block.... I’m in the process of rewriting the markup transform so this will be fixed soon ..
woo!
also, a REALLY easy one would be to set a width/height on profile badges. When a forum thread loads in firefox it shows the badge “alt” tags first. This makes the page longer than it should be when its loading, which messes up anchor links to particular forum posts.
just a bit of css like:
.poster .badges img{
width:20px;
height:20px;
}
would be wonderful and fix this problem.
- Grew a moustache for the Envato Movember competition
- Community Moderator
- Contributed a Blog Post
- Author was Featured
- Item was Featured
- Won a Competition
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Has been a member for 4-5 years
So cool.
Do you have an estimate on how many terrabytes of content that is in storage? And/or how much terrabytes you pump out over your network on a daily basis?
- Grew a moustache for the Envato Movember competition
- Community Moderator
- Contributed a Blog Post
- Author was Featured
- Item was Featured
- Won a Competition
- Repeatedly Helped protect Envato Marketplaces against copyright violations
- Has been a member for 4-5 years
+1 for some nicer forum search results.
I would love some tweaks on the pre code block thingey..
<?php echo 'some php code #1'; ?>
renders the opening php tag funny on everything except the last ‘pre’ block. buggy
<?php echo 'some php code #2'; ?>
