Archive for the ‘PHP’ Category

.NET loads PHP functions

Thursday, June 25th, 2009

Is it possible a .NET project load the functions from a PHP project ?

Here is a greate OpenSource project named Phalanger project . It allows to compile whole PHP projects into .NET assembly. And thus you can load the PHP functions in your ASP.NET project !

Phalanger
Introduction
Phalanger is a new PHP implementation introducing the PHP language into the family of compiled .NET languages. It provides PHP applications an execution environment that is fast and extremely compatible with the vast array of existing PHP code. Phalanger gives web-application developers the ability to benefit from both the ease-of-use and effectiveness of the PHP language and the power and richness of the .NET platform taking profit from the best from both sides.

The official site: http://www.php-compiler.net/

Create a page in WordPress to display posts under a specified category

Sunday, June 21st, 2009

You might always has this question: How to add a new page in WordPress to display posts under a specified category ? A WP blogger has already posted his answer  his blog link :

1: Go to WP Administrate control panel -> Designe -> Theme Editor;
2: Open “Main Index Template (index.php)”, copy its all content;
3: Open local text editor such as Notepad, paste copied content into text editor new file, save as your new WP page file name such as MyList.php;
4: At the top of this php file, add the following code:
<?php
/*
Template Name: MyListPage
*/
?>

“MyListPage” will be your page template name which is for your selection later when you create a new page;
5: Find “<?php if (have_posts()) : ?>”;
Above this line, Add “<?php query_posts(’showposts=20&cat=18′); ?>”;
cat=18 is your specified category ID
6: FTP this php file to your remote hosting “/wp-content/themes/YOUR CURRENT THEME FOLDER NAME/;
7: Write a new page in WP, give a Title like “MyList”, select page template to MyListPage, just save it;
8: Done; go to see your new page “MyList”.

Both PHP 4 and PHP 5 applications run on the same Godaddy hosting account

Saturday, June 20th, 2009

If you bought a Linux hosting from Godaddy, you are able to build your site on either of PHP 4 or PHP 5.

As long as your site runs Hosting Configuration 2.0, both PHP 4 and PHP 5 applications can run on your site. By default, PHP 5 files require the .php5 extension, whereas the .php extension will run under PHP 4. You can change these defaults through the htaccess file.

By default, files with a .php extension run under PHP 4 and files with the .php5 extension run under PHP 5. The .htaccess file, located at the root of your site, can be used to change these default settings. The following entries in a directory’s .htaccess file designate .php files to run under PHP 5 and .php4 files to run under PHP 4.

AddHandler x-httpd-php5 .php
AddHandler x-httpd-php .php4

Changes made to an existing .htaccess file will be seen immediately. When a new .htaccess file is created or an existing .htaccess file is deleted, however, these changes will not be seen until the htaccess cache is cleared. This occurs every hour.

If your site does not run the new hosting configuration and you want to upgrade, you will have to search Godaddy help information to get How to upgrade hosting account to Hosting Configuration 2.0

NOTE: Godaddy Windows hosting and WordPress® hosting offerings only allow PHP 5.

A professional wordpress theme site

Saturday, June 20th, 2009

I found a professional wordpress theme site, looks they are providing some very nice theme for free.

http://www.darrenhoyt.com/2007/08/05/wordpress-magazine-theme-released/

And, a nice Chinese wordpress site is just using a theme from them