 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
SitePoint PHP Blog: How to Split WordPress Content Into Two or More Columns
by Chris Cornutt February 05, 2010 @ 12:58:00
On the SitePoint PHP blog there's a recent post from Craig Buckler showing how to split up your WordPress content into two or more columns quickly and easily.
WordPress is a great CMS, but implementing some features within your theme can require a little lateral thinking. The content for your page or post is usually output by the theme code using a single function call. But what if you need to split the content into two or more blocks? That might be necessary if your theme requires multiple columns or sections on the page.
There's a built in call WordPress includes, "get_the_content", that returns the content rather than just echoing it out. With this handy function giving you just the content, you're free to split up the content however you want - on certain tags or as they suggest, using the "more..." tag and a few modifications to a few other scripts to split it out into DIV blocks.
voice your opinion now!
wordpress content tutorial split column
Chris Jones' Blog: Inserting and Updating Oracle XMLType columns in PHP
by Chris Cornutt July 13, 2009 @ 08:14:21
All of you Oracle users out there might want to check out this recent post from Chris Jones, especially if you've been using the XMLType columns in your tables.
Today a reader mailed me about manipulating XMLType columns when the data is longer than the 4K limit that character-type handling imposes. My free book (see sidebar) has examples of how to do this using CLOB handling in PHP. I noticed that my xmlinsert.php example in the book does a SELECT and UPDATE, but never actually does an INSERT.
To correct the problem of the missing example he includes example code to connect to the database, push the XML into a bind variable and select the row back out to ensure everything's still structured correctly. You need to set up a new descriptor for the insert to work (CLOB).
voice your opinion now!
clob column xmltype xml oracle insert
Sameer Borate's Blog: Selecting all except some columns in MySQL
by Chris Cornutt March 02, 2009 @ 11:13:08
Sameer Borate shows how to turn things around in your application's SQL statement and, instead of selecting the columns you need, showing how to remove the columns you don't need dynamically.
The MySQL SELECT is a ubiquitous statement. You can select rows using the '˜*' operator or by listing the individual column names. But many times you may require using all the columns from a table except a couple of them. For example you may have a table containing twelve columns from which you require only eleven columns.
Sometimes that extra column can contain larger content you might not need or want. He creates a get_column_names and create_statement functions that grab the column names and, based on an "exclude" array, takes out the unwanted records. The array is then looped through and appended back together as the new column list for the select.
voice your opinion now!
select exception mysql column array remove
Lee Blue's Blog: How To Sort A Zend_Db_Table_Rowset
by Chris Cornutt February 14, 2008 @ 17:11:00
Lee Blue has posted a handy tip for users of the Zend Framework, specifically when sorting the results from a query to tables linked in a Zend_Db_Table setup.
So you figured out how to define the relationships between your Zend_Db_Tables and you have issued a call to findDependentRowset(). You get your Rowset back but you need to sort the results by one of the columns in the dependent table. How do you do that?
Unfortunately, he's found out that you just simply can't - well, not without a custom function (until the 1.5 release of the framework rolls around). He shows his table set up and some sample database classes to relate to the tables (and link between them). The magic comes in with his DU_Utils class that takes in the data and sorts it based on the given column name in the given direction.
voice your opinion now!
zendframework zenddb table relationship sort order column
Jeff Moore's Blog: Dependency Injection in PHP
by Chris Cornutt June 27, 2006 @ 06:00:15
In his latest blog post, Jeff Moore adds a bit more background to his column in the newest issue of php|architect covering "dependency injection".
The June issue of PHP Architect is out. My column this month is on dependency injection, a topic which I've been warming up to lately.
First there was CORBA. Then insane complexity of CORBA was supplanted by the intolerable complexity of EJB. Influenced by an agile mindset and the power of Unit testing, a group of java programmers began to construct simpler alternatives to EJB. Thus, the inversion of control frameworks were born. Martin Fowler came along, clarified and renamed the pattern dependency injection. This activity has originated in the Java world, but the pattern applies in PHP as well.
It is heartening to see an industry solve a problem over the course of a decade, moving from complex vendor driven middle-ware to simple patterns. The thing I like most about DI is how dead simple it really is.
He goes on to say that Fowler's article on the topic is a "must read" for anyone who will even be looking into dependency injection. He also mentions two issues he has with most of the other introductions - the examples they use and the "over-emphasis on the container".
His goal in writing this month's column was to help to avoid some of those problems while still keeping it relevant and easy to understand.
voice your opinion now!
dependency injection article column php|architect tutorial dependency injection article column php|architect tutorial
|
Community Events
Don't see your event here? Let us know!
|