Search Results
… After running coding sites for a couple years there is one little problem that really annoys me, so when I set up #! code I … about the Internet is that anyone can do it. There are lots of coding blogs out there that use analytics so I present this code here to help …
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 …
… good idea and saves you time in the long run as you only have to edit one file to change an item on the menu. However, what if you only want to display a menu or sub-menu when a particular page is loaded? This is a common problem, … we are looking at has the following URL. http://www.hashbangcode.com/blog/example/test/123/test.php Then our array contained in the $parts …
… simple thing to do and it is quite easy to add a little link to your Wordpress posts. If the user is logged into Twitter on the web (which … users will update their status so it is worth doing. This is all done through a URL using the status parameter, like this. … to post'); ?> To include a link to the Wordpress blog post that the link it for use the get_permalink() function, which …
… 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 …
… the other being the subjects. It will then create the necessary RSS URLs and use the multi-feed aggregator feature of SimplePie to collate … $feeds[] = 'http://upcoming.yahoo.com/syndicate/v2/search_all/?q='.urlencode($subject).'&loc='.$location.'&rt=1'; } } // create SimplePie … $feed = new SimplePie(); // add feeds to SimplePie $feed->set_feed_url($feeds); // turn off feed ordering by date …