Search Results
Article: Drupal 7 Audit SQL Queries
… audits on Drupal sites it’s always a good idea to get a feel of what sort of content types, users and taxonomy terms are available. Here are … role.name as Role, COUNT(role.name) as Count FROM role AS role INNER JOIN users_roles AS users_roles ON role.rid = users_roles.rid GROUP … GROUP BY node_type.type ORDER BY Count DESC; Name Machine Name Count Blog entry blog 100 Forum topic forum 14 Page page 6 Poll poll 7 …
… I recently talked about adding code to blogs and comments to Wordpress and making sure that certain characters are encoded properly. … The g argument for each expression means that the replace will be done for all of the text. <script type="text/javascript"> function …
… You can display your latest Wordpress posts anywhere on your site by using an RSS reader called SimplePie and a few lines of code. SimplePie is a fast and efficient RSS reader, and it will … as $item){ } You can also pull out categories from your Wordpress blog by setting the feed URL to something like this. …
… function to validate URL's using the FILTER_VALIDATE_URL flag and someone pointed out recently that this function has not only changed since … a number of flags can be added to change the way that this function works. Here are the flags available. FILTER_FLAG_SCHEME_REQUIRED Require … 'http://www.hashbangcode.com' => array(), 'http://www.hashbangcode.com/blog' => array(), 'http://www.example.com/index.html#anchor' => …
Article: PHP Paragraph Regular Expression
… I quite often find the need to extract a section of text from the beginning of a blog post or similar to be used as the excerpt. I normally use a function that …
… are some examples of their values (on the right) with the original URL (on the left). PHP_SELF test.php = test.php /example/ = … rest of the array. So if the file we are looking at has the following URL. http://www.hashbangcode.com/blog/example/test/123/test.php Then …
… update their status so it is worth doing. This is all done through a URL using the status parameter, like this. http://twitter.com/home/?status=text+to+post Because this is a URL you will need to encode it properly in order for Twitter to understand it. Using Wordpress you need to put a call to the urlencode() function to encode any string you might want to post. <?php …
… I recently came under a spam attack that gave me a bit of a problem to sort out. Over the course of 24 hours my blog received over 50,000 comments, all of which were utterly useless. … 25 comments at a time, so after an hour of this I decided that I needed to run a few SQL statements to clear out all of the unwanted …
… One nice feature for any blog or site (especially news sites) is to have a little list of forthcoming …
… that creates a list of pages that are children of a given page in Wordpress I needed something more robust and automatic. To that end I created a … sites that have a solid hieratic page structure, rather than a simple blogging site. In terms of efficiency I have tested it with pages …