Search Results
… So how do you stop this sort of thing? You can just detect the current URL that the user is looking at and see if it contains your domain … in action, which I use on #! code. This also pops up an alert if the URL does not contain your chosen URL. The idea behind this code is not to cripple the site but to force …
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 …
… $feed = new SimplePie(); $feed->set_feed_url('http://www.example.com/feed'); $feed->init(); echo '<ul>'; // … 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 …
… 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 …
… 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 …