Created
          September 11, 2013 09:53 
        
      - 
      
 - 
        
Save iehong/6521544 to your computer and use it in GitHub Desktop.  
    blog
  
        
  
          This gist exceeds the recommended number of files (~10).
            To access all files, please clone this gist.
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <IfModule mod_rewrite.c> | |
| RewriteEngine on | |
| RewriteCond %{REQUEST_FILENAME} !-d | |
| RewriteCond %{REQUEST_FILENAME} !-f | |
| RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L] | |
| </IfModule> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | blog | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?xml version="1.0" encoding="UTF-8"?> | |
| <module type="WEB_MODULE" version="4"> | |
| <component name="NewModuleRootManager"> | |
| <content url="file://$MODULE_DIR$" /> | |
| <orderEntry type="inheritedJdk" /> | |
| <orderEntry type="sourceFolder" forTests="false" /> | |
| </component> | |
| </module> | |
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?xml version="1.0" encoding="UTF-8"?> | |
| <project version="4"> | |
| <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" /> | |
| </project> | |
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?xml version="1.0" encoding="UTF-8"?> | |
| <project version="4"> | |
| <component name="ProjectRootManager" version="2" /> | |
| </project> | |
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?xml version="1.0" encoding="UTF-8"?> | |
| <project version="4"> | |
| <component name="ProjectModuleManager"> | |
| <modules> | |
| <module fileurl="file://$PROJECT_DIR$/.idea/blog.iml" filepath="$PROJECT_DIR$/.idea/blog.iml" /> | |
| </modules> | |
| </component> | |
| </project> | |
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <component name="DependencyValidationManager"> | |
| <state> | |
| <option name="SKIP_IMPORT_STATEMENTS" value="false" /> | |
| </state> | |
| </component> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?xml version="1.0" encoding="UTF-8"?> | |
| <project version="4"> | |
| <component name="VcsDirectoryMappings"> | |
| <mapping directory="" vcs="" /> | |
| </component> | |
| </project> | |
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| return array( | |
| 'DB_HOST'=>'127.0.0.1', | |
| 'DB_USER'=>'root', | |
| 'DB_PWD'=>'', | |
| 'DB_NAME'=>'iehong_blog', | |
| 'DB_PREFIX'=>'blog_', | |
| //'配置项'=>'配置值' | |
| 'APP_GROUP_LIST'=>'Home,Admin', | |
| 'DEFAULT_GROUP'=>'Home', | |
| 'APP_GROUP_MODE'=>1, | |
| 'APP_GROUP_PATH'=>'Modules', | |
| 'URL_MODEL'=>2, | |
| ); | |
| ?> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| Class CommonAction extends Action{ | |
| Public function _initialize(){ | |
| if(!isset($_SESSION['username'])){ | |
| $this->redirect(GROUP_NAME.'/Login/index'); | |
| } | |
| } | |
| } | |
| ?> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| Class IndexAction extends CommonAction{ | |
| Public function index(){ | |
| $user=M('user')->where(array('username'=>$_SESSION['username']))->find(); | |
| $this->user=$user; | |
| $this->display(); | |
| } | |
| Public function bloglist(){ | |
| $blog=M('blog'); | |
| import('ORG.Util.Page'); | |
| $count=$blog->count(); | |
| $Page=new Page($count,17); | |
| $show=$Page->show(); | |
| $list=$blog->order('updatetime desc')->limit($Page->firstRow.','.$Page->listRows)->select(); | |
| $this->list=$list; | |
| $this->show=$show; | |
| $this->display(); | |
| } | |
| Public function deblog(){ | |
| M('blog')->where('id='.I('id'))->delete(); | |
| $this->redirect(GROUP_NAME.'/Index/bloglist'); | |
| } | |
| Public function reblog(){ | |
| $this->blog=M('blog')->where('id='.I('id'))->find(); | |
| $this->display('newblog'); | |
| } | |
| Public function newblog(){ | |
| $this->display(); | |
| } | |
| Public function blog(){ | |
| $title=I('title'); | |
| $class=I('class'); | |
| $description=I('description'); | |
| $tag=I('tag'); | |
| $content=I('content'); | |
| $img=''; | |
| if($_FILES){ | |
| import('ORG.Net.UploadFile'); | |
| $config = array( | |
| 'supportMulti' => false, // 是否支持多文件上传 | |
| 'allowExts' => array('png','jpg','gif','jpeg'), // 允许上传的文件后缀 留空不作后缀检查 | |
| 'autoSub' => true,// 启用子目录保存文件 | |
| 'subType' => 'date',// 子目录创建方式 可以使用hash date custom | |
| 'savePath' => './Uploads/thumb/', // 子目录名称 subType为custom方式后有效 | |
| 'dateFormat' => 'Ym', | |
| ); | |
| $upload= new UploadFile($config); | |
| if($upload->upload()){ | |
| $info=$upload->getUploadFileInfo(); | |
| $img=__ROOT__.'/Uploads/thumb/'.$info[0]['savename']; | |
| } | |
| else die; | |
| } | |
| if(I('id')){ | |
| $data=array( | |
| 'title'=>$title, | |
| 'img'=>$img, | |
| 'description'=>$description, | |
| 'tag'=>$tag, | |
| 'content'=>$content, | |
| 'class'=>$class, | |
| 'updatetime'=>time(), | |
| 'id'=>I('id'), | |
| ); | |
| } | |
| else{ | |
| $data=array( | |
| 'title'=>$title, | |
| 'img'=>$img, | |
| 'description'=>$description, | |
| 'tag'=>$tag, | |
| 'content'=>$content, | |
| 'class'=>$class, | |
| 'updatetime'=>time(), | |
| ); | |
| } | |
| if(I('id')){ | |
| M('blog')->save($data); | |
| $this->redirect(GROUP_NAME.'/Index/bloglist'); | |
| } | |
| else if(M('blog')->add($data)){ | |
| $this->redirect(GROUP_NAME.'/Index/newblog'); | |
| } | |
| } | |
| Public function upimg(){ | |
| header('Content-Type: text/html; charset=UTF-8'); | |
| $inputName='filedata';//表单文件域name | |
| $attachDir='./Uploads';//上传文件保存路径,结尾不要带/ | |
| $dirType=2;//1:按天存入目录 2:按月存入目录 3:按扩展名存目录 建议使用按天存 | |
| $maxAttachSize=2097152;//最大上传大小,默认是2M | |
| $upExt='jpg,jpeg,gif,png';//上传扩展名 | |
| $msgType=2;//返回上传参数的格式:1,只返回url,2,返回参数数组 | |
| $immediate=isset($_GET['immediate'])?$_GET['immediate']:0;//立即上传模式,仅为演示用 | |
| ini_set('date.timezone','Asia/Shanghai');//时区 | |
| $err = ""; | |
| $msg = "''"; | |
| $tempPath=$attachDir.'/'.date("YmdHis").mt_rand(10000,99999).'.tmp'; | |
| $localName=''; | |
| if(isset($_SERVER['HTTP_CONTENT_DISPOSITION'])&&preg_match('/attachment;\s+name="(.+?)";\s+filename="(.+?)"/i',$_SERVER['HTTP_CONTENT_DISPOSITION'],$info)){//HTML5上传 | |
| file_put_contents($tempPath,file_get_contents("php://input")); | |
| $localName=urldecode($info[2]); | |
| } | |
| else{//标准表单式上传 | |
| $upfile=@$_FILES[$inputName]; | |
| if(!isset($upfile))$err='文件域的name错误'; | |
| elseif(!empty($upfile['error'])){ | |
| switch($upfile['error']) | |
| { | |
| case '1': | |
| $err = '文件大小超过了php.ini定义的upload_max_filesize值'; | |
| break; | |
| case '2': | |
| $err = '文件大小超过了HTML定义的MAX_FILE_SIZE值'; | |
| break; | |
| case '3': | |
| $err = '文件上传不完全'; | |
| break; | |
| case '4': | |
| $err = '无文件上传'; | |
| break; | |
| case '6': | |
| $err = '缺少临时文件夹'; | |
| break; | |
| case '7': | |
| $err = '写文件失败'; | |
| break; | |
| case '8': | |
| $err = '上传被其它扩展中断'; | |
| break; | |
| case '999': | |
| default: | |
| $err = '无有效错误代码'; | |
| } | |
| } | |
| elseif(empty($upfile['tmp_name']) || $upfile['tmp_name'] == 'none')$err = '无文件上传'; | |
| else{ | |
| move_uploaded_file($upfile['tmp_name'],$tempPath); | |
| $localName=$upfile['name']; | |
| } | |
| } | |
| if($err==''){ | |
| $fileInfo=pathinfo($localName); | |
| $extension=$fileInfo['extension']; | |
| if(preg_match('/^('.str_replace(',','|',$upExt).')$/i',$extension)) | |
| { | |
| $bytes=filesize($tempPath); | |
| if($bytes > $maxAttachSize)$err='请不要上传大小超过'.formatBytes($maxAttachSize).'的文件'; | |
| else | |
| { | |
| switch($dirType) | |
| { | |
| case 1: $attachSubDir = 'day_'.date('ymd'); break; | |
| case 2: $attachSubDir = 'month_'.date('ym'); break; | |
| case 3: $attachSubDir = 'ext_'.$extension; break; | |
| } | |
| $attachDir = $attachDir.'/'.$attachSubDir; | |
| if(!is_dir($attachDir)) | |
| { | |
| @mkdir($attachDir, 0777); | |
| @fclose(fopen($attachDir.'/index.htm', 'w')); | |
| } | |
| PHP_VERSION < '4.2.0' && mt_srand((double)microtime() * 1000000); | |
| $newFilename=date("YmdHis").mt_rand(1000,9999).'.'.$extension; | |
| $targetPath = $attachDir.'/'.$newFilename; | |
| rename($tempPath,$targetPath); | |
| @chmod($targetPath,0755); | |
| $targetPath=__ROOT__.preg_replace("/([\\\\\/'])/",'\\\$1',$targetPath); | |
| if($immediate=='1')$targetPath='!'.$targetPath; | |
| if($msgType==1)$msg="'$targetPath'"; | |
| else $msg="{'url':'".$targetPath."','localname':'".preg_replace("/([\\\\\/'])/",'\\\$1',$localName)."','id':'1'}";//id参数固定不变,仅供演示,实际项目中可以是数据库ID | |
| } | |
| } | |
| else $err='上传文件扩展名必需为:'.$upExt; | |
| @unlink($tempPath); | |
| } | |
| echo "{'err':'".preg_replace("/([\\\\\/'])/",'\\\$1',$err)."','msg':".$msg."}"; | |
| function formatBytes($bytes) { | |
| if($bytes >= 1073741824) { | |
| $bytes = round($bytes / 1073741824 * 100) / 100 . 'GB'; | |
| } elseif($bytes >= 1048576) { | |
| $bytes = round($bytes / 1048576 * 100) / 100 . 'MB'; | |
| } elseif($bytes >= 1024) { | |
| $bytes = round($bytes / 1024 * 100) / 100 . 'KB'; | |
| } else { | |
| $bytes = $bytes . 'Bytes'; | |
| } | |
| return $bytes; | |
| } | |
| } | |
| Public function about(){ | |
| $this->about=M('about')->limit(1)->select(); | |
| $this->display(); | |
| } | |
| Public function newabout(){ | |
| $description=I('description'); | |
| $tag=I('tag'); | |
| $content=I('content'); | |
| $data=array( | |
| 'description'=>$description, | |
| 'tag'=>$tag, | |
| 'content'=>$content, | |
| ); | |
| if(!M('about')->count()){ | |
| M('about')->add($data); | |
| $this->redirect(GROUP_NAME.'/Index/about'); | |
| } | |
| else{ | |
| M('about')->where('id=1')->setField($data); | |
| $this->redirect(GROUP_NAME.'/Index/about'); | |
| } | |
| } | |
| Public function repwd(){ | |
| if(M('user')->where(array('username'=>$_SESSION['username']))->setField('password',I('password','','md5'))){ | |
| session_unset(); | |
| session_destroy(); | |
| $this->redirect(GROUP_NAME.'/Login/index'); | |
| } | |
| } | |
| Public function logout(){ | |
| M('user')->where(array('username'=>$_SESSION['username']))->setField('prelogintime',time()); | |
| session_unset(); | |
| session_destroy(); | |
| $this->redirect(GROUP_NAME.'/Login/index'); | |
| } | |
| } | |
| ?> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| Class LoginAction extends Action{ | |
| Public function index(){ | |
| $this->display(); | |
| } | |
| Public function login(){ | |
| if(!IS_POST) halt('页面不存在'); | |
| if(md5(I('verify'))!=session('verify')) $this->error('验证码错误'); | |
| $user=M('user')->where(array('username'=>I('username')))->find(); | |
| if(!$user||$user['password']!=I('password','','md5')){ | |
| $this->error('帐号或密码错误'); | |
| } | |
| session('username',$user['username']); | |
| session('prelogintime',date('y/m/d H:i',$user['prelogintime'])); | |
| redirect(__GROUP__); | |
| } | |
| Public function verify(){ | |
| import('ORG.Util.Image'); | |
| Image::buildImageVerify(); | |
| } | |
| } | |
| ?> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| return array( | |
| 'URL_HTML_SUFFIX'=>'', | |
| ); | |
| ?> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset=utf-8> | |
| <title>blog</title> | |
| <link rel="stylesheet" type="text/css" href="__PUBLIC__/style.css" /> | |
| <script type="text/javascript" src="__PUBLIC__/js/jquery-1.7.2.min.js"></script> | |
| <script type="text/javascript" src="__PUBLIC__/js/index.js"></script> | |
| <script type="text/javascript" src='__ROOT__/xheditor/xheditor.min.js'></script> | |
| <script type="text/javascript" src='__ROOT__/xheditor/xheditor_lang/zh-cn.js'></script> | |
| </head> | |
| <body> | |
| <div id='in_box'> | |
| <div id='blognew'> | |
| <form method='post' action='{:U(GROUP_NAME.'/Index/newabout')}'> | |
| <table class='table'> | |
| <tr> | |
| <td class='des' width='10%'>描述:</td> | |
| <td class='des' colspan='3'><textarea class='des' name='description'>{$about[0]['description']}</textarea></td> | |
| </tr> | |
| <tr> | |
| <td>标签:</td> | |
| <td colspan='2'><input type='text' name='tag' value='{$about[0]['tag']}'></td> | |
| <td class='submit'><input class='submit' type='submit' value='提交'></td> | |
| </tr> | |
| <tr> | |
| <td class='content' colspan='4'><textarea class='xheditor' id='content' name='content'></textarea></td> | |
| </tr> | |
| </table> | |
| </form> | |
| </div> | |
| </div> | |
| <script type="text/javascript"> | |
| $('#content').xheditor({tools:'Img,Source',width:'615',height:'495',upImgUrl:"upimg"}); | |
| $('#content').val('{$about[0]['content']}'); | |
| </script> | |
| </body> | |
| </html> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset=utf-8> | |
| <title>blog</title> | |
| <link rel="stylesheet" type="text/css" href="__PUBLIC__/style.css" /> | |
| <script type="text/javascript" src="__PUBLIC__/js/jquery-1.7.2.min.js"></script> | |
| <script type="text/javascript" src="__PUBLIC__/js/index.js"></script> | |
| </head> | |
| <body> | |
| <div id='in_box'> | |
| <table class='table'> | |
| <tr> | |
| <th width='60%'>标题</th> | |
| <th width='10%'>浏览量</th> | |
| <th width='30%'>操作</th> | |
| </tr> | |
| <foreach name="list" item="vo"> | |
| <tr> | |
| <td>{$vo.title}</td> | |
| <td align='center'>{$vo.count}</td> | |
| <td align='center'> | |
| <a href="{:U(GROUP_NAME.'/Index/reblog',array('id'=>$vo['id']))}">修改</a> | |
| <a href="{:U(GROUP_NAME.'/Index/deblog',array('id'=>$vo['id']))}">删除</a> | |
| <a target='_blank' href="{:U('/Index/pas',array('id'=>$vo['id']))}">查看</a> | |
| </td> | |
| </tr> | |
| </foreach> | |
| <tr> | |
| <th align='center' colspan='3'>{$show}</th> | |
| </tr> | |
| </table> | |
| </div> | |
| </body> | |
| </html> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset=utf-8> | |
| <title>blog</title> | |
| <link rel="stylesheet" type="text/css" href="__PUBLIC__/style.css" /> | |
| <script type="text/javascript" src="__PUBLIC__/js/jquery-1.7.2.min.js"></script> | |
| <script type="text/javascript" src="__PUBLIC__/js/index.js"></script> | |
| </head> | |
| <body> | |
| <div id="box"> | |
| <div id="left"> | |
| <div id="adminsider"> | |
| <span>IEHONG</span> | |
| <ul> | |
| <li><a href="{:U(GROUP_NAME.'/Index/bloglist')}">查看博文</a></li> | |
| <li><a href="{:U(GROUP_NAME.'/Index/newblog')}">发表博文</a></li> | |
| <li><a href="{:U(GROUP_NAME.'/Index/about')}">修改关于</a></li> | |
| <li><a class='pwd' href="">修改密码</a></li> | |
| <li><a class='logout' href="{:U(GROUP_NAME.'/Index/logout')}">退出</a></li> | |
| </ul> | |
| <p>上次登录时间:{$user.prelogintime|date='y/m/d H:i',###}</p> | |
| </div> | |
| </div> | |
| <div id="right"> | |
| <div class="admin_box"> | |
| <iframe scrolling="no" frameborder='no' width='620px' height='600px' src=""> | |
| </iframe> | |
| <div id='repwd'> | |
| <form method='post' action='{:U(GROUP_NAME.'/Index/repwd')}'> | |
| <table class='table'> | |
| <tr> | |
| <td width='30%' align='right'>新密码:</td> | |
| <td width='70%'><input class='password' type='password' name='password'></td> | |
| </tr> | |
| <tr> | |
| <td width='30%' align='right'>确认密码:</td> | |
| <td width='70%'><input class='repassword' type='password' name='repassword'></td> | |
| </tr> | |
| <tr> | |
| <td colspan='2' align='center'><input class='submit' type='submit' value='提交'></td> | |
| </tr> | |
| </table> | |
| </form> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="clear"></div> | |
| </div> | |
| </body> | |
| </html> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset=utf-8> | |
| <title>blog</title> | |
| <link rel="stylesheet" type="text/css" href="__PUBLIC__/style.css" /> | |
| <script type="text/javascript" src="__PUBLIC__/js/jquery-1.7.2.min.js"></script> | |
| <script type="text/javascript" src="__PUBLIC__/js/index.js"></script> | |
| <script type="text/javascript" src='__ROOT__/xheditor/xheditor.min.js'></script> | |
| <script type="text/javascript" src='__ROOT__/xheditor/xheditor_lang/zh-cn.js'></script> | |
| </head> | |
| <body> | |
| <div id='in_box'> | |
| <div id='blognew'> | |
| <form method='post' enctype='multipart/form-data' action="{:U(GROUP_NAME.'/Index/blog')}"> | |
| <input type='hidden' name='id' value='{$blog['id']}'> | |
| <table class='table'> | |
| <tr> | |
| <td width='10%'>标题:</td> | |
| <td width='60%'><input type='text' name='title' value='{$blog['title']}'></td> | |
| <td width='15%' align='right'>分类:</td> | |
| <td width='15%'> | |
| <select name='class'> | |
| <option <if condition="$blog['class'] == '项目' "> selected='selected' </if> value='项目'>项目</option> | |
| <option <if condition="$blog['class'] == '技术汇总' "> selected='selected' </if> value='技术汇总'>技术汇总</option> | |
| <option <if condition="$blog['class'] == '日常杂记' "> selected='selected' </if> value='日常杂记'>日常杂记</option> | |
| </select> | |
| </td> | |
| </tr> | |
| <tr> | |
| <td class='des' width='10%'>描述:</td> | |
| <td class='des' colspan='3'><textarea class='des' name='description'>{$blog['title']}</textarea></td> | |
| </tr> | |
| <tr> | |
| <td width='10%'>缩略图:</td> | |
| <td colspan='3'><input type='file' name='img'></td> | |
| </tr> | |
| <tr> | |
| <td>标签:</td> | |
| <td colspan='2'><input type='text' name='tag' value="{$blog['tag']}"></td> | |
| <td class='submit'><input class='submit' type='submit' value='提交'></td> | |
| </tr> | |
| <tr> | |
| <td class='content' colspan='4'><textarea class='xheditor' id='content' name='content'></textarea></td> | |
| </tr> | |
| </table> | |
| </form> | |
| </div> | |
| </div> | |
| <script type="text/javascript"> | |
| $('#content').xheditor({tools:'Img,Source',width:'615',height:'430',upImgUrl:"upimg"}); | |
| $('#content').val('{$blog["content"]}'); | |
| </script> | |
| </body> | |
| </html> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset=utf-8> | |
| <title>blog</title> | |
| <link rel="stylesheet" type="text/css" href="__PUBLIC__/style.css" /> | |
| <script type="text/javascript" src="__PUBLIC__/js/jquery-1.7.2.min.js"></script> | |
| <script type="text/javascript" src="__PUBLIC__/js/index.js"></script> | |
| <script type="text/javascript"> | |
| var VERIFY_URL='{:U(GROUP_NAME."/Login/verify")}/'; | |
| </script> | |
| </head> | |
| <body> | |
| <div id='loginbox'> | |
| <form method='post' action='{:U(GROUP_NAME.'/Login/login')}'> | |
| <table class='table'> | |
| <tr> | |
| <td width='30%' align='right'>用户名:</td> | |
| <td width='70%'><input type='text' name='username'></td> | |
| </tr> | |
| <tr> | |
| <td width='30%' align='right'>密码:</td> | |
| <td width='70%'><input type='password' name='password'></td> | |
| </tr> | |
| <tr> | |
| <td width='30%' align='right'>验证码:</td> | |
| <td width='35%'><input class='verify' type='text' name='verify'><img src="{:U(GROUP_NAME.'/Login/verify')}"></td> | |
| </tr> | |
| <tr> | |
| <td colspan='2' align='center'><input type='submit' value='登录'></td> | |
| </tr> | |
| </table> | |
| </form> | |
| </div> | |
| </body> | |
| </html> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| Class IndexAction extends Action{ | |
| Public function index(){ | |
| import('ORG.Util.Page'); | |
| $count=M('blog')->where('class != "项目"')->count(); | |
| $Page=new Page($count,6); | |
| $Page->setConfig('prev', '<'); | |
| $Page->setConfig('next', '>'); | |
| $Page->setConfig('theme', ' %upPage% %first% %prePage% %linkPage% %nextPage% %end% %downPage%'); | |
| $show=$Page->show(); | |
| $list=M('blog')->where('class != "项目"')->order('updatetime desc')->limit($Page->firstRow.','.$Page->listRows)->select(); | |
| $this->list=$list; | |
| $this->show=$show; | |
| $this->class=''; | |
| $this->display(); | |
| } | |
| Public function about(){ | |
| $this->about=M('about')->where('id=1')->find(); | |
| $this->display(); | |
| } | |
| Public function liste(){ | |
| $condition['class']=I("class"); | |
| import('ORG.Util.Page'); | |
| $count=M('blog')->where($condition)->count(); | |
| if(I('class')=='项目') $Page=new Page($count,9); | |
| else $Page=new Page($count,6); | |
| $Page->setConfig('prev', '<'); | |
| $Page->setConfig('next', '>'); | |
| $Page->setConfig('theme', ' %upPage% %first% %prePage% %linkPage% %nextPage% %end% %downPage%'); | |
| $show=$Page->show(); | |
| $list=M('blog')->where($condition)->order('updatetime desc')->limit($Page->firstRow.','.$Page->listRows)->select(); | |
| $this->list=$list; | |
| $this->show=$show; | |
| $this->class=I('class'); | |
| if(I('class')=='项目') $this->display('item'); | |
| else $this->display('index'); | |
| } | |
| Public function pas(){ | |
| $condition['id']=I('id'); | |
| $this->blog=M('blog')->where($condition)->find(); | |
| $this->display(); | |
| } | |
| Public function count(){ | |
| $condition['id']=I('id'); | |
| M('blog')->where($condition)->setInc('count'); | |
| } | |
| } | |
| ?> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset=utf-8> | |
| <title>关于 | IEHONG</title> | |
| <meta content="{$about.tag}" name="keywords"> | |
| <meta content="{$about.description}" name="description"> | |
| <link rel="stylesheet" type="text/css" href="__PUBLIC__/style.css" /> | |
| <script type="text/javascript" src="__PUBLIC__/js/jquery-1.7.2.min.js"></script> | |
| <script type="text/javascript" src="__PUBLIC__/js/index.js"></script> | |
| </head> | |
| <body> | |
| <div id="box"> | |
| <div id="left"> | |
| <div id="sider"> | |
| <img src="__PUBLIC__/images/head.jpg"> | |
| <ul> | |
| <li><a href="__ROOT__">首页</a></li> | |
| <li><a href="{:U('Index/liste',array('class'=>'项目'))}">项目</a></li> | |
| <li><a href="{:U('Index/about')}">关于</a></li> | |
| </ul> | |
| <p>© 2013 IEHONG</p> | |
| </div> | |
| <div id="ad"> | |
| </div> | |
| </div> | |
| <div id="right"> | |
| <div class="pas_box"> | |
| {$about.content} | |
| </div> | |
| </div> | |
| <div class="clear"></div> | |
| <div id="footer"> | |
| <a href="#">TOP</a><a target="_blank" href="mailto:iehong@qq.com">邮件</a><a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=630798273&site=qq&menu=yes">QQ</a><a target="_blank" href="http://t.qq.com/iehong_huang">微博</a><b>IEHONG</b> | |
| </div> | |
| <div id="cri"> | |
| <script src="http://v1.cnzz.com/stat.php?id=5643222&web_id=5643222" language="JavaScript"></script> | |
| </div> | |
| </div> | |
| <div id='body_bg'></div> | |
| </body> | |
| </html> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset=utf-8> | |
| <title> | |
| <if condition='$class eq ""'> | |
| IEHONG | Iehong是个人的技术博客,记录关于织梦,wordpress,php,前端开发的相关技术文章,并且包括个人的作品展示 | |
| <else/>{$class} | IEHONG | |
| </if> | |
| </title> | |
| <meta content="wordpress,前端开发,织梦,php" name="keywords"> | |
| <meta content="Iehong是个人的技术博客,记录关于织梦,wordpress,php,前端开发的相关技术文章,并且包括个人的作品展示" name="description"> | |
| <link rel="stylesheet" type="text/css" href="__PUBLIC__/style.css" /> | |
| <script type="text/javascript" src="__PUBLIC__/js/jquery-1.7.2.min.js"></script> | |
| <script type="text/javascript" src="__PUBLIC__/js/index.js"></script> | |
| </head> | |
| <body> | |
| <div id="box"> | |
| <div id="left"> | |
| <div id="sider"> | |
| <img src="__PUBLIC__/images/head.jpg"> | |
| <ul> | |
| <li><a href="__ROOT__">首页</a></li> | |
| <li><a href="{:U('Index/liste',array('class'=>'项目'))}">项目</a></li> | |
| <li><a href="{:U('/Index/about')}">关于</a></li> | |
| </ul> | |
| <p>© 2013 IEHONG</p> | |
| </div> | |
| <div id="ad"> | |
| </div> | |
| </div> | |
| <div id="right"> | |
| <foreach name="list" item="vo"> | |
| <div class="item_pas"> | |
| <h3><span>{$vo.updatetime|date='Y/m/d',###}</span><a href="{:U('Index/pas',array('id'=>$vo['id']))}">{$vo.title}</a></h3> | |
| <a class="thumb" href="{:U('Index/pas',array('id'=>$vo['id']))}"><img src="<if condition='$vo.img eq ""'>__PUBLIC__/images/noimg.jpg<else/>{$vo.img}</if>"></a> | |
| <div class="intro"> | |
| <p>{$vo.description}</p> | |
| <ul> | |
| <li>{$vo.count}次浏览</li> | |
| <li><a href="{:U('Index/pas',array('id'=>$vo['id']))}">查看更多</a></li> | |
| </ul> | |
| </div> | |
| <div class="clear"></div> | |
| </div> | |
| </foreach> | |
| <div id='paging'>{$show}</div> | |
| </div> | |
| <div class="clear"></div> | |
| <div id="footer"> | |
| <a href="#">TOP</a><a target="_blank" href="mailto:iehong@qq.com">邮件</a><a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=630798273&site=qq&menu=yes">QQ</a><a target="_blank" href="http://t.qq.com/iehong_huang">微博</a><b>IEHONG</b> | |
| </div> | |
| <div id="cri"> | |
| <script src="http://v1.cnzz.com/stat.php?id=5643222&web_id=5643222" language="JavaScript"></script> | |
| </div> | |
| </div> | |
| <div id='body_bg'></div> | |
| </body> | |
| </html> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset=utf-8> | |
| <title> | |
| <if condition='$class eq ""'> | |
| IEHONG | Iehong是个人的技术博客,记录关于织梦,wordpress,php,前端开发的相关技术文章,并且包括个人的作品展示 | |
| <else/>{$class} | IEHONG | |
| </if> | |
| </title> | |
| <meta content="wordpress,前端开发,织梦,php" name="keywords"> | |
| <meta content="Iehong是个人的技术博客,记录关于织梦,wordpress,php,前端开发的相关技术文章,并且包括个人的作品展示" name="description"> | |
| <link rel="stylesheet" type="text/css" href="__PUBLIC__/style.css" /> | |
| <script type="text/javascript" src="__PUBLIC__/js/jquery-1.7.2.min.js"></script> | |
| <script type="text/javascript" src="__PUBLIC__/js/index.js"></script> | |
| </head> | |
| <body> | |
| <div id="box"> | |
| <div id="left"> | |
| <div id="sider"> | |
| <img src="__PUBLIC__/images/head.jpg"> | |
| <ul> | |
| <li><a href="__ROOT__">首页</a></li> | |
| <li><a href="{:U('Index/liste',array('class'=>'项目'))}">项目</a></li> | |
| <li><a href="{:U('/Index/about')}">关于</a></li> | |
| </ul> | |
| <p>© 2013 IEHONG</p> | |
| </div> | |
| <div id="ad"> | |
| </div> | |
| </div> | |
| <div id="right"> | |
| <foreach name="list" item="vo"> | |
| <div class="item_img"> | |
| <a href="{:U('Index/pas',array('id'=>$vo['id']))}"><img src="<if condition='$vo.img eq ""'>__PUBLIC__/images/item.jpg<else/>{$vo.img}</if>"></a> | |
| </div> | |
| </foreach> | |
| <div class="clear"></div> | |
| <div id='paging'>{$show}</div> | |
| </div> | |
| <div class="clear"></div> | |
| <div id="footer"> | |
| <a href="#">TOP</a><a target="_blank" href="mailto:iehong@qq.com">邮件</a><a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=630798273&site=qq&menu=yes">QQ</a><a target="_blank" href="http://t.qq.com/iehong_huang">微博</a><b>IEHONG</b> | |
| </div> | |
| <div id="cri"> | |
| <script src="http://v1.cnzz.com/stat.php?id=5643222&web_id=5643222" language="JavaScript"></script> | |
| </div> | |
| </div> | |
| <div id='body_bg'></div> | |
| </body> | |
| </html> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta charset=utf-8> | |
| <title>{$blog.title} | IEHONG</title> | |
| <meta content="{$blog.tag}" name="keywords"> | |
| <meta content="{$blog.description}" name="description"> | |
| <link rel="stylesheet" type="text/css" href="__PUBLIC__/style.css" /> | |
| <script type="text/javascript" src="__PUBLIC__/js/jquery-1.7.2.min.js"></script> | |
| <script type="text/javascript" src="__PUBLIC__/js/index.js"></script> | |
| </head> | |
| <body> | |
| <div id="box"> | |
| <div id="left"> | |
| <div id="sider"> | |
| <img src="__PUBLIC__/images/head.jpg"> | |
| <ul> | |
| <li><a href="__ROOT__">首页</a></li> | |
| <li><a href="{:U('Index/liste',array('class'=>'项目'))}">项目</a></li> | |
| <li><a href="{:U('/Index/about')}">关于</a></li> | |
| </ul> | |
| <p>© 2013 IEHONG</p> | |
| </div> | |
| <div id="ad"> | |
| </div> | |
| </div> | |
| <div id="right"> | |
| <div class="pas_box"> | |
| <h3><b>{$blog.updatetime|date='Y/m/d',###}</b>{$blog.title}</h3> | |
| <p class="h"> | |
| <span class='count'>{$blog.count}次浏览</span> | |
| <if condition='$blog.class neq "项目"'> | |
| <span>分类:<a href="{:U('Index/liste',array('class'=>$blog['class']))}">{$blog.class}</a></span> | |
| </if> | |
| </p> | |
| <if condition='$blog.class neq "项目"'> | |
| <p class="introp">文章简介:{$blog.description}</p> | |
| </if> | |
| {$blog.content} | |
| </div> | |
| </div> | |
| <div class="clear"></div> | |
| <div id="footer"> | |
| <a href="#">TOP</a><a target="_blank" href="mailto:iehong@qq.com">邮件</a><a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=630798273&site=qq&menu=yes">QQ</a><a target="_blank" href="http://t.qq.com/iehong_huang">微博</a><b>IEHONG</b> | |
| </div> | |
| <div id="cri"> | |
| <script src="http://v1.cnzz.com/stat.php?id=5643222&web_id=5643222" language="JavaScript"></script> | |
| </div> | |
| </div> | |
| <div id='body_bg'></div> | |
| <script type="text/javascript"> | |
| $.ajax({ | |
| url: '{:U('/Index/count')}', | |
| type: 'post', | |
| data: "id={$blog.id}", | |
| }); | |
| </script> | |
| </body> | |
| </html> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | create table blog_user( | |
| username char(20) not null default '', | |
| password char(32) not null default '', | |
| prelogintime int(10) unsigned not null default 0 | |
| ); | |
| create table blog_blog( | |
| id int unsigned not null primary key auto_increment, | |
| title varchar(50) not null default '', | |
| img char(80) not null default '', | |
| description varchar(400) not null default '', | |
| tag varchar(100) not null default '', | |
| content text not null default '', | |
| class varchar(20) not null default '', | |
| count int unsigned not null default 0, | |
| updatetime int unsigned not null default 0 | |
| ); | |
| create table blog_about( | |
| content text not null default '', | |
| description varchar(400) not null default '', | |
| tag varchar(100) not null default '' | |
| ); | |
| insert into blog_user set | |
| username='iehong', | |
| password=md5('hyh1991728'), | |
| prelogintime=unix_timestamp(now()); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | �����Exif MM * b j( 1 c r2 Շi � | |
| � ' | |
| � 'Adobe Photoshop CS5 (12.0x20100115 [20100115.m.998 2010/01/15:02:00:00 cutoff; m branch]) Windows 2011:08:23 14:04:01 � �� � �� � f n( v V H H ���� Adobe_CM �� Adobe d� �� � | |
| �� � �" |