php blog (1)
时间:2008-07-20 来源:wstczyl
本文 参考 利用 PHP 和 Subversion 从零开始创建一个 blog
https://www6.software.ibm.com/developerworks/cn/education/opensource/os-php-blog/index.html
Tyler Anderson
, 自由作者, Stexar Corp.
2006 年 4 月 20 日
需要创建的文件如下:
代码: index.php
?php
include('includes/functions.php');
define('DIRECTORY_LISTING', "blogs");
$title="Welcome to ".BLOG_NAME;
include('header-sidebar.php');
if($_GET['blog'] != ''){
printBlog($_GET['blog']);
}
else{
print("
Welcome to ".BLOG_NAME."!
Take a look at my latest postings on the left.");
}
include('footer.php');
?>
header-sidebar.php
?php
print('
'.$title.'
');
displayTopBar();
print('
'.$title.'');
print('
My Web Logs
');
listBlogs();
print('
');
// add new side panel items here, using the above "My Web Logs"
// item as a template.
print('
');
?>
footer.php
/td>/tr>
tr>td align="center" colspan="2">
font size="2px">br>
center>Copyright 2005, ?php print(BLOG_NAME) ?>/center>
/font>
/td>/tr>/table>
/body>/html>
https://www6.software.ibm.com/developerworks/cn/education/opensource/os-php-blog/index.html
Tyler Anderson
, 自由作者, Stexar Corp.
2006 年 4 月 20 日
需要创建的文件如下:
- index.php
- header-sidebar.php
- footer.php
- includes/functions.php
- edit/index.php
- edit/header.html
- edit/footer.html
- edit/includes/functions.php
代码: index.php
?php
include('includes/functions.php');
define('DIRECTORY_LISTING', "blogs");
$title="Welcome to ".BLOG_NAME;
include('header-sidebar.php');
if($_GET['blog'] != ''){
printBlog($_GET['blog']);
}
else{
print("
Welcome to ".BLOG_NAME."!
Take a look at my latest postings on the left.");
}
include('footer.php');
?>
header-sidebar.php
?php
print('
'.$title.'
');
displayTopBar();
print('
'.$title.'');
print('
My Web Logs
');
listBlogs();
print('
');
// add new side panel items here, using the above "My Web Logs"
// item as a template.
print('
');
?>
footer.php
/td>/tr>
tr>td align="center" colspan="2">
font size="2px">br>
center>Copyright 2005, ?php print(BLOG_NAME) ?>/center>
/font>
/td>/tr>/table>
/body>/html>
相关阅读 更多 +