News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Matthew Weier O'Phinney's Blog:
Why Modules?
May 01, 2012 @ 08:04:20

Matthew Weier O'Phinnney has a new post to his blog filling in some additional details behind a series he's been doing on modules in the Zend Framework v2 releases. In this new post he answers the question "why modules?"

I've blogged about getting started with ZF2 modules, as well as about ZF2 modules you can already use. But after fielding some questions recently, I realized I should talk about why modules are important for the ZF2 ecosystem.

He covers some of the history of the idea, starting with the MVC rework/refactor of the framework and the desire from several people to have self-contained components that could be native to a ZF app. ZFv1 made it work (kinda) with Zend_Application, but it was difficult so solving this became a main focus of ZFv2. He illustrates with a "building block" metaphor based on his current blog site (currently being refactored too).

This kind of building-block development makes your job easier as a developer - and allows you to focus on the bits and pieces that make your site unique. As such, I truly feel that modules are the most important new feature of ZF2.
0 comments voice your opinion now!
zendframework2 modules building block focus


NETTUTS.com:
Don't Ignore Your WordPress Footer
November 04, 2008 @ 07:50:47

The NETTUTS.com site recommends that you don't ignore your WordPress footer and instead enhance it with some simple HTML and CSS.

Footers are often an overlooked aspect of designing a site - when they can actually be kinda handy and informative. In this tutorial we'll go through some options you can have for your WordPress site.

They take different bits of information - archived posts, the "about" message and some links - and arrange them in a sidebar sort of format. This is then styled to work more like a footer, moving it down to the bottom of the page and laid out horizontally. The complete code for the tutorial can be dropped easily into the wp-content folder (named "WPFooter").

0 comments voice your opinion now!
wordpress tutorial footer content block css style wpfooter


Debuggable Blog:
Code Insults Round 1 - Why switch blocks are dumb
October 29, 2008 @ 08:48:28

In the first of his "I will insult your code" series, Nate Abele looks at this submitted code and points out that maybe blocks of switch/case statements aren't such a good idea after all.

The entire submission is actually two files, which together comprise a console script for interacting with a web service (the names of the entrants have been withheld to protect the identities of the guilty). Rather than examine the full entry, we're going to take a look at one part which I find comes up fairly often: switch block overkill.

The example he's talking about has a switch statement with eight different cases under it, most of them just setting two properties on the current class. Its used ot map command line parameters to their correct properties. Nate suggests a bit different method - still using switch/case but pulling the properties to be assigned from an array of options rather than hard-coding them into the evaluation.

0 comments voice your opinion now!
switch case block insult refine overkill property


Lars Strojny's Blog:
NOWDOC + double quotes = HEREDOC
April 15, 2008 @ 10:25:09

Lars Strojny has posted about a the new element that's been introduced in the PHP 5.3 branch - NOWDOC:

PHP 5.3 introduces a new syntax element, NOWDOC. If you know HEREDOC, NOWDOC is easy to understand: it is in fact HEREDOC taken literally. Whily variables are expanded in HEREDOC, in NOWDOC they are not.

NOWDOC is basically a HEREDOC except for one thing - no parsing is done inside of it, making it good for echoing out PHP code (that would otherwise need to be escaped all over).

0 comments voice your opinion now!
heredoc nowdoc parse block content


PHPRiot.com:
Creating Custom Block Tags in Smarty
February 04, 2008 @ 07:56:00

On the {H{Riot.com site today, there's a new tutorial talking about how to customize your site's Smarty templates a bit more using external plug-ins, specifically one for making those "code block" sections seen all over the web.

We will first learn how block plug-ins can be used in your templates, and then learn how to create our own. Once we know how to create a block plug-in, we will cover a practical example that will show you how block plug-ins can effectively be used in your own web sites.

The tutorial assumes that you already have Smarty installed and that you're familiar enough with it to know how to work with the plug-in system right away. They include some samples of how it can be used (a default block, formatting it with HTML) and, of course, how to integrate this (PHP code and all) into your template and push your content into it.

0 comments voice your opinion now!
custom block tag smarty plugin example tutorial


Brent Meshier's Blog:
Blocking visitors by country using PHP & MySQL
April 23, 2007 @ 16:38:00

In a quick new post from Brent Meshier today, he shows us how, with the help of a database CVS file, to block visitors to your site from certain locales.

A client asked me last night if it was possible to block certain countries from accessing his website. He's concerned about the "axis of evil" and their comrades downloading his software. The task is easily accomplished, although it's like using a sledge hammer to tap in a finishing nail. He didn't seem too concerned that we could accidentally block Uzbekistan in the process. Unfortunately his entire site uses plain .html files, no dynamic scripting. This led me to using a slightly creative solution with .htaccess.

Broken up into five simple steps, he makes a light function to drop into an output buffering function to tell it to either show the normal content or return a 401 Unauthorized header to the visitor.

0 comments voice your opinion now!
mysql block visitor country download csv database htaccess mysql block visitor country download csv database htaccess


Ryan Malesevich's Blog:
Fight Spam Comments with Bad Behavior and Akismet
September 07, 2006 @ 07:16:58

Ryan points out a handy tool to help keep even more spammers from making their way to your blogs and posting comments - Bad Behavior.

I love Akismet the spam filter for comments that is built into Wordpress. It's blocked 812 spam comments in a little under 2 months for me. I was content with it, but I grew tiresome that it would even get to my site. Akismet is great for blocking spams that are already to your blog, but there has to be something out there that would block the spammers from coming to your site in the first place.

Luckily there is something like that, it's called Bad Behavior.

Luckily, it's also made for Wordpress, so you can download and install directly with no fuss. He comments that he's already seeing results with even more caught than Akismet was before.

0 comments voice your opinion now!
akismet bad behavior block spam wordpress comments akismet bad behavior block spam wordpress comments


Syntux Blog:
Advanced Caching Technique - Block Randomization
August 21, 2006 @ 16:18:25

In his latest entry to the Synutx blog, Ammar Ibrahim talks about an advanced chaching technique - block randomization.

I'm currenlty working on a site where I want to improve performance of dynamic pages. One of the greatest techniques to do is to cache dynamic content and serve the generated output (HTML). It's not as easy as we all want it to be when you have all sorts of weird blocks on the page: User login area, random content, ..etc

As I had a very pleasent experience with eZ components last week, I decided to take a look at the components, but then i remembered it works on PHP5. This project is on PHP4, I had to look for an alternative and decided to use PEAR::Cache_Lite.

He gives a visual example of what he's working towards and includes some sample code (using Cache_Lite) to create the blocks of content for his site. It took a few tries to get right, but apparently, third time's the charm.

0 comments voice your opinion now!
caching technique advanced block randomize pear cache_lite caching technique advanced block randomize pear cache_lite


PHPit.net:
No more spam; Akismet and PHP to the rescue!
May 22, 2006 @ 05:57:31

If you're tired of spam comments or people flooding your PHP application with junk text and links, you'll definitely want to check out this new tutorial from PHPit.net. It looks at how to integrate the Akismet anti-spam service into your application.

I've started using Akismet myself recently, and it has completely cut down all the spam I was receiving. Normally I'd get about 700 spam comments a day on my various blogs and websites (including PHPit), but since installing Akismet I've only received four. That means that approximately 99,5% is being caught by Akismet, which is an extremely good rate, and what's even better is that Akismet hasn't caught one good spam comment (no positives). Sounds pretty good, right?

In this article you'll learn how to use the Akismet anti-spam service to prevent any spam from being added to your PHP website. Live examples and demo's are included.

To start off right, you need to know how the service works and what kind of methods you'll need to access it. They show a simple connection to the service as well as two functions to mark something as spam and to mark it as non-spam (or 'ham' as he calls it). He also links to their development page and to the WordPress plugin that performs the same action.

1 comment voice your opinion now!
spam block akismet connection positive negative spam block akismet connection positive negative



Community Events





Don't see your event here?
Let us know!


interview project language introduction developer configure threedevsandamaybe release library bugfix list api laravel code series wordpress podcast community framework application

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework