Sep 22, 2008
by kihbord
filed in Wordpress
The latest (from version 2.6) version of Wordpress has support for making the admin section of your Wordpress site use SSL or Secure Sockets Layer. This means that you’d be able to encrypt your admin pages if you want to.
Encrypting the admin pages provides more security for your Wordpress site. In order to enforce SSL in your admin pages you need to do things a couple of things.
Read more of “How to secure your Wordpress blog by setting up SSL” »
Aug 21, 2008
by kihbord
filed in C++, PHP
In an effort to improve private torrent trackers the Project Gazelle team has created a reliable, lightweight and secure codebase. It was designed from the ground up to be secure against SQL and XSS injection attacks and at the same time be able to handle thousands of users.
The source code, which is currently undergoing beta, is available via the Project Gazelle SVN. The source code comes with a C++ based tracker, PHP frontend and complete administration panel.
You can find more info at the Project Gazelle web site.
Jun 26, 2008
by kihbord
filed in Wordpress
Defined in: wp-includes/post.php
Retrieves a list of pages from the site’s wp_posts table. In Wordpress posts and pages are store in the same table called wp_posts. Pages are identified by the string ‘page’ stored in the post_type field. This function will return an array list of pages depending on the $args array of options passed to the function.
The get_pages filter is applied to the resulting array list of pages before returning from the calling code. The resulting array list of pages and the list of options passed to get_pages are passed as parameters to the get_pages filter.
array get_pages( [array $args] )
Possible values for $args and their default values:
- child_of
- default is 0
- sort_order
- default is ‘ASC’
- sort_column
- default is ‘post_title’ (this can be any of the column names in wp_posts, tip: you can use ‘menu_order’ to control the order)
- hierarchichal
- default is 1
- exclude
- no default value
- include
- no default value
- meta_key
- no default value
- meta_value
- no default value
- authors
- no default value
Jun 25, 2008
by kihbord
filed in PHP
I’ve don my share of coding in Assembly language and one of the constructs that is pretty efficient to use is lookup tables for calling subroutines or functions. One of the things I like PHP is its ability to do the same thing.
For example, if you want to perform exception/error handling based on a status code, you can use lookup tables instead of using a switch() construct. If you use a switch() construct, you’ll have something like:
switch( $status ) {
case 0: do_action_1(); break;
case 0: do_action_1(); break;
default: do_default();
}
If you use a lookup table, your source code will have something like:
$lookup = array( 'do_action_1','do_action_2');
if ( $status >= 0 && $status < count($lookup) ) {
call_user_func($lookup[$status]);
}
I’m sure there are other uses of lookup tables and the combination of using array() and call_user_func() in PHP offers a lot of flexibility in coding.
Jun 24, 2008
by kihbord
filed in PHP
As a follow-up on my last post about “Detecting web visitors that use mobile phones“, I’ve made available a Wordpress plugin that can be used on your Wordpress site. The plugin provides an is_mobile() function that can be used in Wordpress themes to enable detection of mobile devices.
I currently use it on this site to allow me to view Code Stuff on my mobile phone. If you want to know more about the TxTu Is Mobile wordpress plugin, you can visit my site at TxTu. You can also go straight to the TxTu Is Mobile page to read and download the Wordpress plugin.
Jun 23, 2008
by kihbord
filed in PHP
With all the thrusts nowadays towards using mobile devices to surf the Net, it would be great if your Wordpress blog is mobile device friendly. The concept is actually simple and you can incorporate a mobile friendly version of your blog by understanding some simple things.
The main thing that you need to know is that when visitors to your Wordpress blog (actually any web site but let’s use Wordpress for this example) browses your site, you can identify the type of computer or mobile device that they are using. Once you have identified the device, it’s easy to create a separate CSS stylesheet for your mobile visitor.
Read more of “Detecting web visitors that use mobile phones” »