Posts Tagged ‘PHP’

We are pleased to present below all posts tagged with ‘PHP’.

Getting Started With PHP Templating

In the early days of PHP applications, “spaghetti code” was a familiar sight. Fragments of PHP code were mixed in with HTML mark-up. There were no frameworks, so Web applications were just a bunch of source files. As the PHP language matured, developers started to think about the cleanliness and maintainability of their code. The model-view-controller (MVC) pattern was introduced.

MVC is a software architecture that allows for the separation of business logic from the user interface. In this architecture, the user sees and interacts with the view that, in the case of Web applications, is generated HTML code (along with JavaScript, CSS, images, etc.)

Read more...

WordPress Essentials: Interacting With The WordPress Database

While many functions you already use in WordPress communicate with the database there is an easy and safe way to do this directly using the $wpdb class. Built on the great ezsql class by Justin Vincent, $wpdbwill allow you to address queries to any table in your database, and it will also help you handle the return data. Since this is built in WP functionality, there is no need to open a separate database connection (you would be duplicating code in this case), and there is no need to do hacks, like modifying a result set after it has been queried.

$wpdb class

In this article I will show you how to get started with the $wpdb class, how to retrieve data from your WordPress database and how to run more advanced queries which update or delete something in the db. The techniques here will remove some of the contraints that you run into with functions like get_posts() or wp_list_categories(), allowing you to tailor the queries you make to your specific needs. This method can also make your website more efficient by only getting the needed data, nothing more, nothing less.

Read more...

Getting Started With The PayPal API

PayPal is the most popular platform for receiving online payments today. The ease of opening a PayPal account and receiving payments compared to opening a merchant account with a traditional payment gateway is probably the number one reason for its popularity, with a close second being the comprehensive API that PayPal provides for its payment services. In this post, I will break down some of the techniques and approaches to working with the PayPal API, in order to make integration and troubleshooting simpler and easier.

PayPal offers a variety of payment options, which might be confusing at first. Express Checkout is the premier PayPal service. Express Checkout allows you to receive payments without having a merchant account and without having to meet special requirements other than verifying your account (either via a bank account or a credit card).

Read more...

My Favorite Programming Mistakes

Over my programming career, I have made a lot of mistakes in several different languages. In fact, if I write 10 or more lines of code and it works the first time, I’ll get a bit suspicious and test it more rigorously than usual. I would expect to find a syntax error or a bad array reference or a misspelled variable or something.

My Favourite Programming Mistakes

I like to classify these mistakes into three broad groups: cock-ups (or screw-ups in American English), errors and oversights. A cock-up is when you stare blankly at the screen and whisper “Oops”: things like deleting a database or website, or overwriting three-days worth of work, or accidentally emailing 20,000 people. Errors cover everything, from simple syntax errors like forgetting a } to fatal errors and computational errors.

Read more...

How To Modify A Default Joomla 1.5 Template

Joomla is a popular open-source content management system with a lot of possibilities. One of the strengths of Joomla is the vast number of extensions and templates available, both free and commercial. You can download and install a template in a few simple steps, although some templates are included in the Joomla installation package, and most users start with one of those. This article takes you through one of the default Joomla 1.5 templates and shows you how to modify it for your website.

Screenshot

Joomla 1.6, which was released earlier this year, has a different way of handling templates. For instance, it introduced the concept of template styles. However, many users are still on Joomla 1.5. Thus, the information in this post will be valid to many Joomla users. Also, the techniques used in this post can be applied to Joomla 1.6 and later versions even if the template structure is somewhat different.

Read more...

How To Build A Media Site On WordPress (Part 2)

The default "category" and "tag" taxonomies in WordPress offer a lot of flexibility to those with imagination and in my development experience I have seen a wide range of creative implementations. With the introduction of custom taxonomies and their growing ease of use, though, we need no longer be bound to categories and tags. With the ability to create both hierarchical and non-hierarchical taxonomies and with the introduction of several new features in WordPress 3.1, now is the time, if you're not already, to begin putting custom taxonomies to use.

How To Build A Media Site On WordPress (Part 2)

In part one of this two part series, we learned how to setup custom post types and custom taxonomies. We also learned how to build a template to check for and display media attached to custom posts. Now, we'll learn how to use custom taxonomy templates to organize and relate our media. Let's get started!

Read more...

How To Build A Media Site On WordPress (Part 1)

WordPress is amazing. With its growing popularity and continual development, it is becoming the tool of choice for many designers and developers. WordPress projects, though, are pushing well beyond the confines of mere "posts" and "pages". How do you go about adding and organizing media and all its complexities? With the introduction of WordPress 3.1, several new features were added that make using WordPress to manage media even more practical and in this tutorial, we're going to dive in and show you how.

In part one, we're going to setup custom post types and custom taxonomies, without plugins. After that, we'll build a template to check for and display media attached to custom posts. Then, in part two, we'll use custom taxonomy templates to organize and relate media (and other types of content).

Read more...

↑ Back to top