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

Kevin Schroeder:
If you develop for Magento, know your indexes
Feb 02, 2015 @ 15:34:19

Kevin Schroeder makes a suggestion to all of the Magento developers out there - be sure to know your indexes and how to use them to your advantage.

When I first got into Magento development, in my mind, there were two ways of getting data from the database. You would either call Mage::getModel(‘catalog/product’)->load($id) or you would work with the collection. If you wanted to get a filtered list of something you would use the ORM to get it. But as I’ve gained more experience (fairly quickly, I might add) I realized that there was more to the puzzle. A good portion of this is because I work with Magento ECG and some of the best Magento devs and architects can be found there and I’m a quick learner.

He gives an example of going beyond the usual one-to-one relationship most people use with Magento's models. He includes an example of wanting to fetch a list of all products in the same category as another and the "anit-pattern" that comes with it. Instead he offers the solution of an index, a simple one that merges the catalog category and product index ID. This makes using a custom query with a handy join much easier and much faster.

tagged: magento database collection query index tutorial category

Link: http://www.eschrade.com/page/if-you-develop-for-magento-know-your-indexes/

Smashing Magazine:
10 Useful RSS-Tricks and Hacks For WordPress
Dec 03, 2008 @ 16:28:41

Smashing Magazine has a few helpful RSS tips and tricks for WordPress users out there:

Let's take a look at 10 useful, yet rather unknown RSS-tricks for WordPress. Each section of the article presents a problem, suggests a solution and provides you with an explanation of the solution, so that you can not just solve some of your RSS-related problems but also understand what you are actually doing.

Here's their list:

  • Control When Your Posts are Available via RSS
  • Redirecting WordPress Feeds to FeedBurner Feeds
  • Insert Ads (or Anything Else) in Your RSS Feed
  • Format Your Images for Feed Readers
  • Provide Your Readers with a Feed for Each Post
  • Exclude Categories from Your RSS Feed
  • Display Any RSS Feed on Your WordPress Blog
  • Use Category-Specific RSS Feeds
  • List RSS Feeds by Category
  • Get Rid of RSS Feeds the Clean Way
tagged: wordpress rss feed tip trick feedburner image category ad

Link:

Daniel Cousineau's Blog:
Displaying N-Deep Trees (Remember Your Algorithms Course?)
Aug 07, 2008 @ 17:03:23

On his Tower of Power blog Daniel Cousineau has written up a look at using a more detailed categorization method than just a parent/child relationship on your data - Tree Traversals.

If the software calls for only 2 levels of categorization (Parent and Child only), a simple nested for loop will suffice. However, software requirements change and you'll soon find yourself up shit creek without a paddle if you need to support 3 or 4 levels of nesting. [...] To those who's training is less formal (most web developers I meet have practical training, not formal), I'll help you out: Tree Traversals (or if you are completely lost, Recursion).

He creates a recursive function that, when passed in a category set with different types in it, can handle each of them and then calls itself again with the new child data. His sample code creates url out of a set of categories.

tagged: tree category recursion tutorial parent child loop treetraversal

Link:

IBM developerWorks:
Use the YouTube API with PHP
Apr 17, 2008 @ 03:42:36

In this new tutorial on the IBM developerWorks website, they show you how - with a little simple HTML and PHP - to integrate functionality from the YouTube API into your site.

The YouTube video sharing site allows Web application developers to access public content through its REST-based developer API. [...] This article introduces the YouTube Data API, demonstrates how you can use it to browse user-generated video content; access video metadata, comments and responses; and perform keyword searches.

They help you get started by outlining the format that the YouTube messages use (Atom feeds) and how to run a query against the API and return back the custom data for things like video categories, popularity and the results of keyword searches.

tagged: youtube api tutorial category keyword search atom feed

Link:

Nick Halstead's Blog:
Tweetmeme - building stuff fast in PHP
Jan 29, 2008 @ 13:52:00

Nick Halstead has pointed out a website, written in PHP he's created to help make a little bit of sense out of the links that go flying past in your twitter client - tweetmeme.

What is it? It tracks the public timeline from twitter and picks up any links that get posted. It then follows each link to find final destination and then categorizes the content into blogs / video / images / audio. This project really shows what is possible using PHP if you know what you are doing.

Most of the work was done by another developer, Stuart Dallas as one of four that worked on the project together. It's written in PHP5 and uses only about 20 PHP files to get the job done. You can also check out the launch post over on tweetmeme's blog for more information on the service.

tagged: fast tweetmeme twitter links stream category

Link:

WebReference.com:
Building a Weblog: Part 4
Mar 06, 2007 @ 17:37:00

WebReference.com has posted part four (the final installment) of their "Building a Weblog" series today, focusing on creating the categories for the posts, adding a new entry, and updating a current one.

First off is the creation of the categories script - just a simple little page that takes in the category name (from a form) and inserts it into the categories table in the database. The next form functions in basically the same way, but handles more information. It lets you write and save a new blog entry to the database.

Finally, since everyone makes mistakes, they include a sample script to let you update one of your already posted blog entries, using the same kind of form you used to enter it.

tagged: weblog tutorial create category entry edit form database weblog tutorial create category entry edit form database

Link:

WebReference.com:
Building a Weblog: Part 4
Mar 06, 2007 @ 17:37:00

WebReference.com has posted part four (the final installment) of their "Building a Weblog" series today, focusing on creating the categories for the posts, adding a new entry, and updating a current one.

First off is the creation of the categories script - just a simple little page that takes in the category name (from a form) and inserts it into the categories table in the database. The next form functions in basically the same way, but handles more information. It lets you write and save a new blog entry to the database.

Finally, since everyone makes mistakes, they include a sample script to let you update one of your already posted blog entries, using the same kind of form you used to enter it.

tagged: weblog tutorial create category entry edit form database weblog tutorial create category entry edit form database

Link:

Elizabeth Naramore's Blog:
PHP Throwdown Updates
Dec 05, 2006 @ 14:34:00

Elizabeth Naramore has posted an update about the PHP Throwdown event being planned, including updates on the judges, prizes, sponsors, and registration.

Many people probably think the PHP Throwdown has stalled, but it’s quite the contrary actually. We’ve been mulling over many things and have come to some conclusions. So if you’re interested, read on!

The judges have been found, the categories are still being decided, prizes are en route, Jupiter Hosting has stepped up as a sponsor for the event, registration is coming soon, and the rules have been posted.

Be sure to check out the main page for complete details on the event. The PHP Throwdown is a competition to see what can be accomplished with PHP in 24 hours. Who: You! You can compete in a team, or individually.

tagged: phpthrowdown2006 update judge prize category sponsor rule registration phpthrowdown2006 update judge prize category sponsor rule registration

Link:

Elizabeth Naramore's Blog:
PHP Throwdown Updates
Dec 05, 2006 @ 14:34:00

Elizabeth Naramore has posted an update about the PHP Throwdown event being planned, including updates on the judges, prizes, sponsors, and registration.

Many people probably think the PHP Throwdown has stalled, but it’s quite the contrary actually. We’ve been mulling over many things and have come to some conclusions. So if you’re interested, read on!

The judges have been found, the categories are still being decided, prizes are en route, Jupiter Hosting has stepped up as a sponsor for the event, registration is coming soon, and the rules have been posted.

Be sure to check out the main page for complete details on the event. The PHP Throwdown is a competition to see what can be accomplished with PHP in 24 hours. Who: You! You can compete in a team, or individually.

tagged: phpthrowdown2006 update judge prize category sponsor rule registration phpthrowdown2006 update judge prize category sponsor rule registration

Link:

International PHP Magazine:
Poll Question: Which one is your Favorite PHP Category?
Oct 17, 2006 @ 15:48:00

The International PHP Magazine has posted the results from their latest poll on their site today. The question of the week this time was "which of the following is your favorite category of PHP functionality?"

Among the options, there was "General PHP", "PHP Design", "PHP & XML" and "PHP Security". The one that came out on top, however, was "PHP & Databases" with 26.4% of the vote. Next in line was tied up between two options - "General PHP" and "PHP & Business/Ingegration" both with 15.3% of the votes.

Be sure anc check out (and vote on) their new poll for the week asking readers what they think is the biggest advantage of making to move to PHP5 for their scripts.

tagged: favorite category databases business general php5 favorite category databases business general php5

Link:


Trending Topics: