首页 Soft PlugIn RAN乱 Dev开发 Info资料 English WAP 留言 登陆 注册
-
Posted by Yippee | 评论(0) | 引用(0) | 阅读1091次
iwas14-style
<?php
class clsstyle
{
 function clsstyle($do)
 { www.shengfang.org
  switch ($do)
  {
   case "add": www.shengfang.org
    $this->add();
    break;
   case "add1":
    $this->add1();
    break;
   case "show":
    $this->show();
    break;
   case "del": www.shengfang.org
    $this->del();
    break;  
   case "edit":   www.shengfang.org
    $this->edit();
    break;
   case "edit1":  
    $this->edit1();
    break;
   }
  }
 function edit()
 {
  global $db,$tools,$stylename;
  $tools->index();
     require"doc/style_edit_form.html";
  }
 function edit1()
 {
  global $db,$tools,$name,$dir;
  
  $tools->index(); www.shengfang.org
      $dir=trim($dir);
   $dir=str_replace(" ","",$dir);
   if($dir==""){
     $tools->goback("-1","模板地址不能为空");
  exit;
   }
   if(!file_exists("./$dir")){
     $tools->goback("-1","模板地址无法访问");
  exit; www.shengfang.org
   }
   echo $dir;
   $tools->goback("-1","修改成功,请返回");
   $db->UpdateStyle($name,$dir);
   //$itpl->editfile("../data/style/list.php","$id","\n","$name|$dir");
   /*$itpl->writetofile("../data/style/$name.php","<?\$tpl$name='$dir';?>","w+");*/
  }
 function del() www.shengfang.org
 {
  global $db,$tools,$stylename;
  $tools->index();
  $db->DelStyle($stylename);
  //$itpl->deletefromfile("../data/style/list.php","$id","\n");
    // at unlink(" dot ./data/style/$stylename.php");
    $tools->goback("-1","删除成功,请返回");
  }
 
 function show() www.shengfang.org
 {
  global $db,$tools;
  $tools->index();
  $arr=$db->GetStyleAry();
  $total=count($arr);
  if ($total<2)
   $total=0;
  require"doc/stylelist.html";
  }
 function add1()
 { www.shengfang.org
  //require"./doc/header.html";
  global $db,$tools;
  $tools->index();
  print_r($_POST);
  $name=trim($_POST["name"]);
    $dir=trim($_POST["dir"]);
    if(!ereg("^[a-zA-Z0-9_]*$",$name)){
      $tools->goback("-1","风格名称只能字母子,数字,下划线的组合");
   exit;
    }
    $dir=str_replace(" ","",$dir);
    if($dir==""){
      $tools->goback("-1","模板地址不能为空");
   exit;
    }
    if(!file_exists("./$dir")){
      $tools->goback("-1","模板地址无法访问");
   exit; www.shengfang.org
    }
    $db->AddStyle($name,$dir);   
    $tools->goback("-1","添加成功,请返回");
  }
 function add()
 {
  //require"./doc/header.html";
  global $tools;
  $tools->index();
  require"doc/style.html";
  }
} www.shengfang.org
?>

字体:

Permanant URI永久地址 http://www.shengfang.org/blog/p/iwas14style.php
Trackback URI引用地址 http://www.shengfang.org/blog/tb.php?tb_id=1125196477

2005年8月28日10:34星期日  [Dev开发] 追踪此文的RSS
提示:
此文还没有评论。

称呼:    登陆   注册
   不注册,但记住我的信息
邮件:
(非必须)
评论: [UBB代码帮助]
粗体 斜体 下划线 链接 水平线 引用



验证码: 请输入你看见的数字
关闭UBB      提交时自动将内容复制到剪贴板

公告
Fire and Motion!

统计信息
[Yippee]||[统计]||日志:1790
在线: 22||用户: 2562 [列表]
今日:2170||到访:2671669
Rss:838446||评论:1584

最新日志

最新评论

友情链接

日历

最新引用

搜索

归档

杂项
Get RSS Feed (Version 2.0)
Get Atom Feed (Version 0.3)
编码:  UTF-8