Chinaunix首页 | 论坛 | 博客
  • 博客访问: 106540
  • 博文数量: 24
  • 博客积分: 2071
  • 博客等级: 大尉
  • 技术积分: 385
  • 用 户 组: 普通用户
  • 注册时间: 2007-01-30 12:43
文章分类

全部博文(24)

文章存档

2009年(3)

2008年(21)

我的朋友
最近访客

分类:

2008-07-20 15:16:58

本文 参考 利用 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
  • 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('

'</SPAN><SPAN style="COLOR: #0000cc">.</SPAN><SPAN style="COLOR: #0000ff">$</SPAN><SPAN style="COLOR: #008080">title</SPAN><SPAN style="COLOR: #0000cc">.</SPAN><SPAN style="COLOR: #ff00ff">'



');

print('

');

displayTopBar();

print('

'.$title.'




  
    
  
  
    
  
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>

阅读(693) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

wstczyl2009-07-12 23:09:56

blogs edit includes 目录