Home Page
Favorites
Contact Us
 
HonoWeb | HonoBBS | Search | Login | Signup
 
Home
 
 
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
   
User:
Posts:
Joined:
Topic

User:joseph
Posts: 5
Joined: 2008-12-13 18:48:47
1

1.first go to <a href='http://www.honoweb.net'>www.honoweb.net</a>    and find  Links->LAMP Download.         download PHP,Apache,Mysql. 

2. after download php,apache,mysql setup in you loca computer. 

3.open you IE or firefox browser.   type http://localhost    open phpmyadmin.     enter   database username/password     root.   create a database like dbhonocms.

3.and then download honocms to you LAMP setup folder-> htdocs  

4.open you IE or firefox browser, type http://localhost/honocms.   open honocms setup page,    enter host,database name,database username,database password.

submit . 

ok  you wil see setup successfully.  

User:Guest
Posts:
Joined:
2

1.first go to www.honoweb.net    and find  Links->LAMP Download.         download PHP,Apache,Mysql. 

2. after download php,apache,mysql setup in you loca computer. 

3.open you IE or firefox browser.   type http://localhost    open phpmyadmin.     enter   database username/password     root.   create a database like dbhonocms.

3.and then download honocart to you LAMP setup folder-> htdocs  

4.open you IE or firefox browser, type http://localhost/honocart.   open honocms setup page,    enter host,database name,database username,database password.

submit . 

ok  you wil see setup successfully.  

User:admin
Posts: 3
Joined: 2008-10-16 08:41:18
3

1.first go to www.honoweb.net    and find  Links->LAMP Download.         download PHP,Apache,Mysql. 

2. after download php,apache,mysql setup in you loca computer. 

3.open you IE or firefox browser.   type http://localhost    open phpmyadmin.     enter   database username/password     root.   create a database like dbhonocms.

3.and then download honoblog to you LAMP setup folder-> htdocs  

4.open you IE or firefox browser, type http://localhost/honoblog   open honoblog setup page,    enter host,database name,database username,database password.

submit . 

ok  you wil see setup successfully.  

User:Guest
Posts:
Joined:
4

all templates files in the Templates folder.    when you setup honocms.   the default in Templates folder is default layout.

in the Templates->default   there are index.html,  css,images.    you can change some code to change layout.

or you can redesign anther templates put into Templates folder. and login to admin control panel->templates->set to default

 

User:juice
Posts: 5
Joined: 2008-12-23 20:21:45
5

 when you setup honobbs.    skins in the style folder

there are 3 default skins like blue.css, green.css,red.css

if you want to redesign anther skins put into style folder. and login to admin control panel->bbs->skins manager   to edit style

or  you custom your skins name.css put into style  and login to admin control panel->bbs->skins manager   set to default

User:Guest
Posts:
Joined:
6

themes files in the Themes folder.   

if you want to custom themes.   you can create a folder name like theme1 

and then create index.html,css,images.   design you theme layout.

and then you can refrence the default theme layout theme content templates like {theme_left},{theme_right} put you themes.

finally put you custom themes to Themes folder.  login to you profile set it to default. is ok.

User:joseph
Posts: 5
Joined: 2008-12-13 18:48:47
7
<div style="background-image:url('yourimg.jpg');">Text</div>
User:Guest
Posts:
Joined:
8
http://stilbuero.de/tabs/
User:Guest
Posts:
Joined:
9
function ImageResize($srcFile,$toW,$toH,$toFile="")
  {
     if($toFile==""){ $toFile = $srcFile; }
     $info = "";
     $data = GetImageSize($srcFile,$info);
     switch ($data[2])
     {
   case 1:
     if(!function_exists("imagecreatefromgif")){
      echo "你的GD库不能使用GIF格式的图片,请使用Jpeg或PNG格式!<a href='javascript:go(-1);'>返回</a>";
      exit();
     }
     $im = ImageCreateFromGIF($srcFile);
     break;
   case 2:
     if(!function_exists("imagecreatefromjpeg")){
      echo "你的GD库不能使用jpeg格式的图片,请使用其它格式的图片!<a href='javascript:go(-1);'>返回</a>";
      exit();
     }
     $im = ImageCreateFromJpeg($srcFile);   
     break;
   case 3:
     $im = ImageCreateFromPNG($srcFile);   
     break;
   default:
           echo "You can upload jpg or gif picture! <a href='javascript:go(-1);'>返回</a>";
     exit();
    }
    $srcW=ImageSX($im);
    $srcH=ImageSY($im);
    $toWH=$toW/$toH;
    $srcWH=$srcW/$srcH;
    if($toWH<=$srcWH){
      $ftoW=$toW;
      $ftoH=$ftoW*($srcH/$srcW);
    }else{
     $ftoH=$toH;
     $ftoW=$ftoH*($srcW/$srcH);
    }
    if(function_exists("imagecreatetruecolor")){
    @$ni = ImageCreateTrueColor($ftoW,$ftoH);
    if($ni) ImageCopyResampled($ni,$im,0,0,0,0,$ftoW,$ftoH,$srcW,$srcH);
    else{
     $ni=ImageCreate($ftoW,$ftoH);
      ImageCopyResized($ni,$im,0,0,0,0,$ftoW,$ftoH,$srcW,$srcH);
    }
   }else{
    $ni=ImageCreate($ftoW,$ftoH);
    ImageCopyResized($ni,$im,0,0,0,0,$ftoW,$ftoH,$srcW,$srcH);
   }
    if(function_exists('imagejpeg')) ImageJpeg($ni,$toFile);
    else ImagePNG($ni,$toFile);
    ImageDestroy($ni);
    ImageDestroy($im);
  }
User:admin
Posts: 3
Joined: 2008-10-16 08:41:18
10

validateCode.php

<?php
session_start();
 

        Header("Content-type:  image/png");
        srand(microtime()  *  100000);
        $login_check_number  =  strval(rand("1111","9999"));
 
        session_register("login_check_number");
  $_SESSION['SessionUser']["login_check_number"]=$login_check_number;
        //这里是使用了SESSION来保存校验码.
        //当然也可以用COOKIE
        //setcookie("login_check_number",$login_check_number);
        //然后将第一行的session_start()删除;
        //不推荐使用COOKIE,因为使用COOKIE并不能进行安全的验证.
 
        $h_img  =  imagecreate(40,17);
        $c_black  =  ImageColorAllocate($h_img,  0,0,0);
        $c_white  =  ImageColorAllocate($h_img,  255,255,255);
        imageline($h_img,  1,  1,  350,  25,  $c_black);
        imagearc($h_img,  200,  15,  20,  20,  35,  190,  $c_white);
        imagestring($h_img,  5,  2,  1,  $login_check_number,  $c_white);
        ImagePng($h_img);
        ImageDestroy($h_img);
 
        die();

?>

 

put   <img src='validateCode.php'> to the place that you want.

User:admin
Posts: 3
Joined: 2008-10-16 08:41:18
11

<?

function searchDir($basedir)
{
 if(!file_exists($basedir))
 {
  return  false;
 }
 $handle=opendir($basedir);
 while ($file = readdir($handle)) {
  if ($file=="." or $file=="..") {
  
  } else {
   $filelisting[]=$file;
  }
 }
 return $filelisting;
 //$number=sizeof($filelisting);
}

class  FileDir
{
 function  deleteAllDir($del_path)
 {
  if(!file_exists($del_path))
  {
   return  false;
  }
  $hand=opendir($del_path);
  $i=0;
  while($file=readdir($hand))
  {
   $i++;
   if($i==1||$i==2){continue;}
   if(!(strchr($file,".")))
   {
    $del_s_path=$del_path."/".$file;
    $this->deleteAllDir($del_s_path);
   }
   else
   {
    $del_file=$del_path."/".$file;
    $this->deleteFile($del_file);
   }
  }
  closedir($hand);
  $this->deleteDir($del_path);
  return  true;
 }
 //delete file
 function  deleteFile($del_file)
 {
  unlink($del_file);
 }
 //delete dir
 function  deleteDir($del_path)
 {
  rmdir($del_path);
 }
}

?>

User:admin
Posts: 3
Joined: 2008-10-16 08:41:18
12
function filterTag($str)
  {
    $search=array("'<script[^>]*?>.*?</script>'si","'<[\/\!]*?[^<>]*?>'si","'([\r\n])[\s]+'");
    $replace=array("","","\\1");
     return preg_replace($search,$replace,$str);
  }
User:admin
Posts: 3
Joined: 2008-10-16 08:41:18
13
function cut($Str, $Length) {
  
   global $s;
   $i = 0;
   $l = 0;
   $ll = strlen($Str);
   $s = $Str;
   $f = true;
   
   while ($i <= $ll) {
    if (ord($Str{$i}) < 0x80) {
     $l++; $i++;
    } else if (ord($Str{$i}) < 0xe0) {
     $l++; $i += 2;
    } else if (ord($Str{$i}) < 0xf0) {
     $l += 2; $i += 3;
    } else if (ord($Str{$i}) < 0xf8) {
     $l += 1; $i += 4;
    } else if (ord($Str{$i}) < 0xfc) {
     $l += 1; $i += 5;
    } else if (ord($Str{$i}) < 0xfe) {
     $l += 1; $i += 6;
    }
   
    if (($l >= $Length - 1) && $f) {
     $s = substr($Str, 0, $i);
     $f = false;
    }
   
    if (($l > $Length) && ($i < $ll)) {
     $s = $s . '...'; break;     }
   }
   return $s;
  }
User:Guest
Posts:
Joined:
14

function nl2br_indent($string, $indent = 1)
  {

     $string = str_replace("\r", '', $string);

     if (is_int($indent)) {

      $indent = str_repeat(' ', (int)$indent);
     }

     $string = str_replace("\n", "<br />\n".$indent, $string);

     $string = $indent.$string;
     return $string;
  }

User:admin
Posts: 3
Joined: 2008-10-16 08:41:18
15
function getRandomNum()
  {
   $seedarray =microtime();
   $seedstr =split(" ",$seedarray,5);
   $seed =$seedstr[0]*10000;
   $random =rand(10,40);
   $addFileName=date('YnjHis').$random;
   return $addFileName;
  }
User:admin
Posts: 3
Joined: 2008-10-16 08:41:18
16
function setMyCookie($name,$value)
  {
   $expire=time()+3600;
   $secure=1;
   setcookie($name,$value,$expire,$path,$domain);
  }
  
  function getMyCookie($name)
  {
   return $_COOKIE[$name];
  }
  
User:joseph
Posts: 5
Joined: 2008-12-13 18:48:47
17

function isInteger(src) {
 reg = /^(-|\+)?\d+$/;
    return (reg.test(src));//整数
}

function isIntegerPlus(src) {
 reg = /^\d+$/;
    return (reg.test(src));
}

function isIntegerMiner(src) {
 reg = /^-\d+$/;
    return (reg.test(src));
}

function isMoney(src) {
 reg = /^\d+\.\d{2}$/;
    return (reg.test(src));
}

function isFloat(src) {
 reg = /^\d+\.\d{2}$/;
    return (reg.test(src));
}

function isAge(src) {
 reg  = /^(1[0-2]\d|\d{1,2})$/; 
    return (reg.test(src));
}

function isPhone(src) {
 reg = /^(\+\d+ )?(\(\d+\) )?[\d ]+$/;
    return (reg.test(src));
}

function isName(src) {
 reg = /^[A-Za-z\-]+$/; 
    return (reg.test(src));
}

function isEmail(src) {
 isEmail1    = /^\w+([\.\-]\w+)*\@\w+([\.\-]\w+)*\.\w+$/;
 isEmail2    = /^.*@[^_]*$/;
    return (isEmail1.test(src) && isEmail2.test(src));
}


function isPsw(src) {
  var sxf,regex;
  sxf='^[\\w]{6,12}$';
    regex=new RegExp(sxf);
    return regex.test(src);
}

function isZipCode(src) {
  var ZipCode,regex;
    ZipCode="^[\\d]{6}$";
   regex=new RegExp(ZipCode);
   return regex.test(src);
}


function isZip(str)
{
 var reg = /^\d{6}$/;
 return reg.test(str);
}


function isMobile(str)
{
 var reg = /^\d{11,12}$/;
 return  reg.test(str);
}


function isNum15(str)
{
  var reg=/^\d{15}$/;
  return reg.test(str);
}


function isNum18(str)
{
  var reg=/^\d{17}(?:\d|x)$/;
  return reg.test(str);
}

function isIdentity(src) {
    isIdCorrect1=/^\d{15}$/;
   isIdCorrect2=/^\d{18}$/;
 if(isIdCorrect1.test(src)||isIdCorrect2.test(src))
       return true;
  false;
}

function isTime(str)
{
    var a = str.match(/^(\d{1,2})(:)?(\d{1,2})\2(\d{1,2})$/);
    if (a == null) {alert(''); return false;}
    if (a[1]>24 || a[3]>60 || a[4]>60)
    {
          alert("");
          return false
    }
    return true;
}

function isDateTime(str)
{
  var r = str.match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/);
 if(r==null)return false;
 var d= new Date(r[1], r[3]-1, r[4]);
 return (d.getFullYear()==r[1]&&(d.getMonth()+1)==r[3]&&d.getDate()==r[4]);
}

 function isDateLongTime(str)
{
    var reg = /^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2})$/;
    var r = str.match(reg);
    if(r==null)return false;
    var d= new Date(r[1], r[3]-1,r[4],r[5],r[6],r[7]);
    return (d.getFullYear()==r[1]&&(d.getMonth()+1)==r[3]&&d.getDate()==r[4]&&d.getHours()==r[5]&&d.getMinutes()==r[6]&&d.getSeconds()==r[7]);
}

function isChar(src) {
 reg = /[^a-zA-Z]/;
    return (reg.test(src));
}

function isCharNum(src) {
 reg = /[^0-9a-zA-Z]/;
    return (reg.test(src));
}

function isCharVar(src) {
 reg = /^([a-zA-z_]{1})([\w]*)$/;
    return (reg.test(src));
}

function isFileExtension(filePath){
 var temp;
 var ExtList = ".mp3.swf.wma.rm.mpg.avi.mpeg.wmv";
 var the_ext = filePath.substr(filePath.lastIndexOf(".")+1).toLowerCase();
 if (ExtList.indexOf(the_ext)==-1){
  return false;
 }
 return true;
}

function isPictreExtension(filePath){
 var temp;
 var ExtList = ".jpg.gif.bmp.png";
 var the_ext = filePath.substr(filePath.lastIndexOf(".")+1).toLowerCase();
 if (ExtList.indexOf(the_ext)==-1){
  return false;
 }
 return true;
}

function isWebsites(strEmail) {
  var myReg = /^(http:\/\/[a-z0-9]{1,5}\.)+([-\/a-z0-9]+\.)+[a-z0-9]{2,4}$/;
  if(myReg.test(strEmail)) return true;
  return false;
 
}

function makeslug(str)
{
 return str.replace(/ /g,"-");
}

function NoticeOpen(url)
{
 open(url,'win','scrollbars=yes,width=600,height=500,resizable=no,left=200,top=100,resizable=false');
}

function getDays()
{
 var daysArray=Array();
 for(i=1;i<=31;i++)
  daysArray[i-1]=i;
 return daysArray;
}
function getMonths()
{
 var monthsArray=Array("01","02","03","04","05","06","07","08","09","10","11","12");
 return monthsArray;
}

function getYears()
{
 var yearsArray=Array();
 j=0;
 for(i=1970;i<=1995;i++)
 {
  yearsArray[j]=i;
  j++;
 }
 return yearsArray;
}

User:Guest
Posts:
Joined:
18

var xmlLoader:URLLoader = new URLLoader();
xmlLoader.load(new URLRequest("data/images.xml"));

xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);

function xmlLoaded(event:Event):void
{
 trace(event.target.data);
}

User:Guest
Posts:
Joined:
19

images.xml

<images>
 <image source="images/Image1.jpg" thumb="thumbnails/Image1.jpg">Description of image 1.</image>
 <image source="images/Image2.jpg" thumb="thumbnails/Image2.jpg">Description of image 2.</image>
 <image source="images/Image3.jpg" thumb="thumbnails/Image3.jpg">Description of image 3.</image>
 <image source="images/Image4.jpg" thumb="thumbnails/Image4.jpg">Description of image 4.</image>
</images>

 

actionscript

var xml:XML;
var xmlList:XMLList;
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.load(new URLRequest("data/images.xml"));

xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);

function xmlLoaded(event:Event):void
{
 xml = XML(event.target.data);
 xmlList = xml.children();
 trace(xmlList.length());
}

User:admin
Posts: 3
Joined: 2008-10-16 08:41:18
20

mydb.php

<?
class db{

var $linkid;
var $sqlid;
var $record;

function db($host="",$username="",$password="",$database="")
 {
 if(!$this->linkid)  @$this->linkid = mysql_connect($host, $username, $password) or die("连接服务器失败.");
 @mysql_select_db($database,$this->linkid) or die("无法打开数据库");
 return $this->linkid;}

function query($sql)
 {if($this->sqlid=mysql_query($sql,$this->linkid)) return $this->sqlid;
 else {
  $this->err_report($sql,mysql_error);
 return false;}
 }

function nr($sql_id="")
 {if(!$sql_id) $sql_id=$this->sqlid;
 return mysql_num_rows($sql_id);}

function nf($sql_id="")
 {if(!$sql_id) $sql_id=$this->sqlid;
 return mysql_num_fields($sql_id);}

function nextrecord($sql_id="")
 {if(!$sql_id) $sql_id=$this->sqlid;
 if($this->record=mysql_fetch_array($sql_id))  return $this->record;
 else return false;
 }

function f($name)
 {
 if($this->record[$name]) return $this->record[$name];
 else return false;
 }

function close() {mysql_close($this->linkid);}

function lock($tblname,$op="WRITE")
 {if(mysql_query("lock tables ".$tblname." ".$op)) return true; else return false;}

function unlock()
 {if(mysql_query("unlock tables")) return true; else return false;}

function ar() {
    return @mysql_affected_rows($this->linkid);
  }

function i_id() {
  return mysql_insert_id();
 }

function err_report($sql,$err)
 {
echo "Mysql查询错误<br>";
echo "查询语句:".$sql."<br>";
echo "错误信息:".$err;
 }
/****************************************类结束***************************/
}?>

 

User:admin
Posts: 3
Joined: 2008-10-16 08:41:18
21

config.php

<?
session_start();
global $mysqlhost, $mysqluser, $mysqlpwd, $mysqldb;
$mysqlhost="127.0.0.1"; //host name
$mysqluser="root";              //login name
$mysqlpwd="";              //password
$mysqldb="";        //name of database
?>

 

User:admin
Posts: 3
Joined: 2008-10-16 08:41:18
22

backup.php

<?
include("../../db/Configuration.php");
include("config.php");
include("mydb.php");
include("../../include/authorizemanager.php");
$d=new db($mysqlhost,$mysqluser,$mysqlpwd,$mysqldb);
/*--------------界面--------------*/if(!$_POST['act']){/*----------------------*/
$msgs[]="服务器备份目录为backup";
$msgs[]="对于较大的数据表,强烈建议使用分卷备份";
$msgs[]="只有选择备份到服务器,才能使用分卷备份功能";
show_msg($msgs);
?>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<form name="form1" method="post" action="backup.php">
  <table style="font-size:12px;" width="99%" border="1" cellpadding='0' cellspacing='1'>
    <tr align="center" class='header'><td colspan="2">数据备份</td></tr>
    <tr><td colspan="2">备份方式</td></tr>
    <tr><td><input type="radio" name="bfzl" value="quanbubiao">        备份全部数据</td><td>备份全部数据表中的数据到一个备份文件</td></tr>
    <tr><td><input type="radio" name="bfzl" value="danbiao">备份单张表数据
        <select name="tablename"><option value="">请选择</option>
          <?
  $d->query("show table status from $mysqldb");
  while($d->nextrecord()){
  echo "<option value='".$d->f('Name')."'>".$d->f('Name')."</option>";}
  ?>
        </select></td><td>备份选中数据表中的数据到单独的备份文件</td></tr>
    <tr><td colspan="2">使用分卷备份</td></tr>
    <tr><td colspan="2"><input type="checkbox" name="fenjuan" value="yes">
        分卷备份 <input name="filesize" type="text" size="10">K</td></tr>
    <tr><td colspan="2">选择目标位置</td></tr>
    <tr><td colspan="2"><input type="radio" name="weizhi" value="server" checked>备份到服务器</td></tr><tr class="cells"><td colspan='2'> <input type="radio" name="weizhi" value="localpc">
        备份到本地</td></tr>
    <tr><td colspan="2" align='center'><input type="submit" name="act" value="备份"></td></tr>
  </table></form>
<?/*-------------界面结束-------------*/}/*---------------------------------*/
/*----*/else{/*--------------主程序-----------------------------------------*/
if($_POST['weizhi']=="localpc"&&$_POST['fenjuan']=='yes')
 {$msgs[]="只有选择备份到服务器,才能使用分卷备份功能";
show_msg($msgs); pageend();}
if($_POST['fenjuan']=="yes"&&!$_POST['filesize'])
 {$msgs[]="您选择了分卷备份功能,但未填写分卷文件大小";
show_msg($msgs); pageend();}
if($_POST['weizhi']=="server"&&!writeable("./backup"))
 {$msgs[]="备份文件存放目录'./backup'不可写,请修改目录属性";
show_msg($msgs); pageend();}

/*----------备份全部表-------------*/if($_POST['bfzl']=="quanbubiao"){/*----*/
/*----不分卷*/if(!$_POST['fenjuan']){/*--------------------------------*/
if(!$tables=$d->query("show table status from $mysqldb"))
 {$msgs[]="读数据库结构错误"; show_msg($msgs); pageend();}
$sql="";
while($d->nextrecord($tables))
 {
 $table=$d->f("Name");
 $sql.=make_header($table);
 $d->query("select * from $table");
 $num_fields=$d->nf();
 while($d->nextrecord())
 {$sql.=make_record($table,$num_fields);}
 }
$filename=date("Ymd",time())."_all.sql";
if($_POST['weizhi']=="localpc") down_file($sql,$filename);
elseif($_POST['weizhi']=="server")
 {if(write_file($sql,$filename))
$msgs[]="全部数据表数据备份完成,生成备份文件'./backup/$filename'";
 else $msgs[]="备份全部数据表失败";
 show_msg($msgs);
 pageend();
 }
/*-----------------不要卷结束*/}/*-----------------------*/
/*-----------------分卷*/else{/*-------------------------*/
if(!$_POST['filesize'])
 {$msgs[]="请填写备份文件分卷大小"; show_msg($msgs);pageend();}
if(!$tables=$d->query("show table status from $mysqldb"))
 {$msgs[]="读数据库结构错误"; show_msg($msgs); pageend();}
$sql=""; $p=1;
$filename=date("Ymd",time())."_all";
while($d->nextrecord($tables))
{
 $table=$d->f("Name");
 $sql.=make_header($table);
 $d->query("select * from $table");
 $num_fields=$d->nf();
 while($d->nextrecord())
 {$sql.=make_record($table,$num_fields);
 if(strlen($sql)>=$_POST['filesize']*1000){
   $filename.=("_v".$p.".sql");
   if(write_file($sql,$filename))
   $msgs[]="全部数据表-卷-".$p."-数据备份完成,生成备份文件'./backup/$filename'";
   else $msgs[]="备份表-".$_POST['tablename']."-失败";
   $p++;
   $filename=date("Ymd",time())."_all";
   $sql="";}
 }
}
if($sql!=""){$filename.=("_v".$p.".sql");  
if(write_file($sql,$filename))
$msgs[]="全部数据表-卷-".$p."-数据备份完成,生成备份文件'./backup/$filename'";}
show_msg($msgs);
/*---------------------分卷结束*/}/*--------------------------------------*/
/*--------备份全部表结束*/}/*---------------------------------------------*/

/*--------备份单表------*/elseif($_POST['bfzl']=="danbiao"){/*------------*/
if(!$_POST['tablename'])
 {$msgs[]="请选择要备份的数据表"; show_msg($msgs); pageend();}
/*--------不分卷*/if(!$_POST['fenjuan']){/*-------------------------------*/
$sql=make_header($_POST['tablename']);
$d->query("select * from ".$_POST['tablename']);
$num_fields=$d->nf();
while($d->nextrecord())
 {$sql.=make_record($_POST['tablename'],$num_fields);}
$filename=date("Ymd",time())."_".$_POST['tablename'].".sql";
if($_POST['weizhi']=="localpc") down_file($sql,$filename);
elseif($_POST['weizhi']=="server")
 {if(write_file($sql,$filename))
$msgs[]="表-".$_POST['tablename']."-数据备份完成,生成备份文件'./backup/$filename'";
 else $msgs[]="备份表-".$_POST['tablename']."-失败";
 show_msg($msgs);
 pageend();
 }
/*----------------不要卷结束*/}/*------------------------------------*/
/*----------------分卷*/else{/*--------------------------------------*/
if(!$_POST['filesize'])
 {$msgs[]="请填写备份文件分卷大小"; show_msg($msgs);pageend();}
$sql=make_header($_POST['tablename']); $p=1;
 $filename=date("Ymd",time())."_".$_POST['tablename'];
 $d->query("select * from ".$_POST['tablename']);
 $num_fields=$d->nf();
 while ($d->nextrecord())
 { 
  $sql.=make_record($_POST['tablename'],$num_fields);
    if(strlen($sql)>=$_POST['filesize']*1000){
   $filename.=("_v".$p.".sql");
   if(write_file($sql,$filename))
   $msgs[]="表-".$_POST['tablename']."-卷-".$p."-数据备份完成,生成备份文件'./backup/$filename'";
   else $msgs[]="备份表-".$_POST['tablename']."-失败";
   $p++;
   $filename=date("Ymd",time())."_".$_POST['tablename'];
   $sql="";}
 }
if($sql!=""){$filename.=("_v".$p.".sql");  
if(write_file($sql,$filename))
$msgs[]="表-".$_POST['tablename']."-卷-".$p."-数据备份完成,生成备份文件'./backup/$filename'";}
show_msg($msgs);
/*----------分卷结束*/}/*--------------------------------------------------*/
/*----------备份单表结束*/}/*----------------------------------------------*/

/*---*/}/*-------------主程序结束------------------------------------------*/

function write_file($sql,$filename)
{
$re=true;
if(!@$fp=fopen("./backup/".$filename,"w+")) {$re=false; echo "failed to open target file";}
if(!@fwrite($fp,$sql)) {$re=false; echo "failed to write file";}
if(!@fclose($fp)) {$re=false; echo "failed to close target file";}
return $re;
}

function down_file($sql,$filename)
{
 ob_end_clean();
 header("Content-Encoding: none");
 header("Content-Type: ".(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') ? 'application/octetstream' : 'application/octet-stream'));
   
 header("Content-Disposition: ".(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') ? 'inline; ' : 'attachment; ')."filename=".$filename);
   
 header("Content-Length: ".strlen($sql));
 header("Pragma: no-cache");
   
 header("Expires: 0");
 echo $sql;
 $e=ob_get_contents();
 ob_end_clean();
}

function writeable($dir)
{
 
 if(!is_dir($dir)) {
 @mkdir($dir, 0777);
 }
 
 if(is_dir($dir))
 {
 
 if($fp = @fopen("$dir/test.test", 'w'))
  {
@fclose($fp);
 @unlink("$dir/test.test");
 $writeable = 1;
}
 else {
$writeable = 0;
 }
 
}
 
 return $writeable;

}

function make_header($table)
{global $d;
$sql="DROP TABLE IF EXISTS ".$table."\n";
$d->query("show create table ".$table);
$d->nextrecord();
$tmp=preg_replace("/\n/","",$d->f("Create Table"));
$sql.=$tmp."\n";
return $sql;
}

function make_record($table,$num_fields)
{global $d;
$comma="";
$sql .= "INSERT INTO ".$table." VALUES(";
for($i = 0; $i < $num_fields; $i++)
{$sql .= ($comma."'".mysql_escape_string($d->record[$i])."'"); $comma = ",";}
$sql .= ")\n";
return $sql;
}

function show_msg($msgs)
{
$title="提示:";
echo "<table width='100%' border='1'  cellpadding='0' cellspacing='1'>";
echo "<tr><td>".$title."</td></tr>";
echo "<tr><td><br><ul>";
while (list($k,$v)=each($msgs))
 {
 echo "<li>".$v."</li>";
 }
echo "</ul></td></tr></table>";
}

function pageend()
{
exit();
}
?>
 

 

User:admin
Posts: 3
Joined: 2008-10-16 08:41:18
23

restore.php

<?

include("config.php");
include("mydb.php");
$d=new db($mysqlhost,$mysqluser,$mysqlpwd,$mysqldb);

/******界面*/if(!$_POST['act']&&!$_SESSION['data_file']){/**********************/
$msgs[]="本功能在恢复备份数据的同时,将全部覆盖原有数据,请确定是否需要恢复,以免造成数据损失";
$msgs[]="数据恢复功能只能恢复由dShop导出的数据文件,其他软件导出格式可能无法识别";
$msgs[]="从本地恢复数据需要服务器支持文件上传并保证数据尺寸小于允许上传的上限,否则只能使用从服务器恢复";
$msgs[]="如果您使用了分卷备份,只需手工导入文件卷1,其他数据文件会由系统自动导入";
show_msg($msgs);
?>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<form action="" method="post" enctype="multipart/form-data" name="restore.php">
<table width="91%"  style="font-size:12px;"  border="0" cellpadding="0" cellspacing="1">
<tr align="center" class="header"><td colspan="2" align="center">数据恢复</td></tr>
<tr><td width="33%"><input type="radio" name="restorefrom" value="server" checked>
从服务器文件恢复 </td><td width="67%"><select name="serverfile">
    <option value="">-请选择-</option>
<?
$handle=opendir('./backup');
while ($file = readdir($handle)) {
    if(eregi("^[0-9]{8,8}([0-9a-z_]+)(\.sql)$",$file)) echo "<option value='$file'>$file</option>";}
closedir($handle);
?>
  </select> </td></tr>
<tr><td><input type="radio" name="restorefrom" value="localpc">       从本地文件恢复</td>
<td><input type="hidden" name="MAX_FILE_SIZE" value="1500000"><input type="file" name="myfile"></td></tr>
<tr><td colspan="2" align="center"> <input type="submit" name="act" value="恢复"></td>  </tr></table></form>


<?/**************************界面结束*/}/*************************************/
/****************************主程序*/if($_POST['act']=="恢复"){/**************/
/***************服务器恢复*/if($_POST['restorefrom']=="server"){/**************/
if(!$_POST['serverfile'])
 {$msgs[]="您选择从服务器文件恢复备份,但没有指定备份文件";
  show_msg($msgs); pageend(); }
if(!eregi("_v[0-9]+",$_POST['serverfile']))
 {$filename="./backup/".$_POST['serverfile'];
 if(import($filename)) $msgs[]="备份文件".$_POST['serverfile']."成功导入数据库";
 else $msgs[]="备份文件".$_POST['serverfile']."导入失败";
 show_msg($msgs); pageend();  
 }
else
 {
 $filename="./backup/".$_POST['serverfile'];
 if(import($filename)) $msgs[]="备份文件".$_POST['serverfile']."成功导入数据库";
 else {$msgs[]="备份文件".$_POST['serverfile']."导入失败";show_msg($msgs);pageend();}
 $voltmp=explode("_v",$_POST['serverfile']);
 $volname=$voltmp[0];
 $volnum=explode(".sq",$voltmp[1]);
 $volnum=intval($volnum[0])+1;
 $tmpfile=$volname."_v".$volnum.".sql";
 if(file_exists("./backup/".$tmpfile))
  {
  $msgs[]="程序将在3秒钟后自动开始导入此分卷备份的下一部份:文件".$tmpfile.",请勿手动中止程序的运行,以免数据库结构受损";
  $_SESSION['data_file']=$tmpfile;
  show_msg($msgs);
  sleep(3);
  echo "<script language='javascript'>";
  echo "location='restore.php';";
  echo "</script>";
  }
 else
  {
  $msgs[]="此分卷备份全部导入成功";
  show_msg($msgs);
  }
 }
/**************服务器恢复结束*/}/********************************************/
/*****************本地恢复*/if($_POST['restorefrom']=="localpc"){/**************/
 switch ($_FILES['myfile']['error'])
 {
 case 1:
 case 2:
 $msgs[]="您上传的文件大于服务器限定值,上传未成功";
 break;
 case 3:
 $msgs[]="未能从本地完整上传备份文件";
 break;
 case 4:
 $msgs[]="从本地上传备份文件失败";
 break;
    case 0:
 break;
 }
 if($msgs){show_msg($msgs);pageend();}
$fname=date("Ymd",time()).".sql";
if (is_uploaded_file($_FILES['myfile']['tmp_name'])) {
    copy($_FILES['myfile']['tmp_name'], "./backup/".$fname);}

if (file_exists("./backup/".$fname))
 {
 $msgs[]="本地备份文件上传成功";
 if(import("./backup/".$fname)) {$msgs[]="本地备份文件成功导入数据库"; unlink("./backup/".$fname);}
 else $msgs[]="本地备份文件导入数据库失败";
 }
else ($msgs[]="从本地上传备份文件失败");
show_msg($msgs);
/****本地恢复结束*****/}/****************************************************/
/****************************主程序结束*/}/**********************************/
/*************************剩余分卷备份恢复**********************************/
if(!$_POST['act']&&$_SESSION['data_file'])
{
 $filename="./backup/".$_SESSION['data_file'];
 if(import($filename)) $msgs[]="备份文件".$_SESSION['data_file']."成功导入数据库";
 else {$msgs[]="备份文件".$_SESSION['data_file']."导入失败";show_msg($msgs);pageend();}
 $voltmp=explode("_v",$_SESSION['data_file']);
 $volname=$voltmp[0];
 $volnum=explode(".sq",$voltmp[1]);
 $volnum=intval($volnum[0])+1;
 $tmpfile=$volname."_v".$volnum.".sql";
 if(file_exists("./backup/".$tmpfile))
  {
  $msgs[]="程序将在3秒钟后自动开始导入此分卷备份的下一部份:文件".$tmpfile.",请勿手动中止程序的运行,以免数据库结构受损";
  $_SESSION['data_file']=$tmpfile;
  show_msg($msgs);
  sleep(3);
  echo "<script language='javascript'>";
  echo "location='restore.php';";
  echo "</script>";
  }
 else
  {
  $msgs[]="此分卷备份全部导入成功";
  unset($_SESSION['data_file']);
  show_msg($msgs);
  }
}
/**********************剩余分卷备份恢复结束*******************************/
function import($fname)
{global $d;
$sqls=file($fname);
foreach($sqls as $sql)
 {
 str_replace("\r","",$sql);
 str_replace("\n","",$sql);
 if(!$d->query(trim($sql))) return false;
 }
return true;
}
function show_msg($msgs)
{
$title="提示:";
echo "<table width='100%' border='1'  cellpadding='0' cellspacing='1'>";
echo "<tr><td>".$title."</td></tr>";
echo "<tr><td><br><ul>";
while (list($k,$v)=each($msgs))
 {
 echo "<li>".$v."</li>";
 }
echo "</ul></td></tr></table>";
}

function pageend()
{
exit();
}
?>
 

 

User:admin
Posts: 3
Joined: 2008-10-16 08:41:18
24

<STYLE>LI {
 MARGIN-BOTTOM: 10px
}
OL {
 MARGIN-TOP: 5px
}
.DragContainer {
 BORDER-RIGHT: #669999 2px solid; PADDING-RIGHT: 5px; BORDER-TOP: #669999 2px solid; PADDING-LEFT: 5px; FLOAT: left; PADDING-BOTTOM: 0px; MARGIN: 3px; BORDER-LEFT: #669999 2px solid; WIDTH: 100px; PADDING-TOP: 5px; BORDER-BOTTOM: #669999 2px solid
}
.OverDragContainer {
 BORDER-RIGHT: #669999 2px solid; PADDING-RIGHT: 5px; BORDER-TOP: #669999 2px solid; PADDING-LEFT: 5px; FLOAT: left; PADDING-BOTTOM: 0px; MARGIN: 3px; BORDER-LEFT: #669999 2px solid; WIDTH: 100px; PADDING-TOP: 5px; BORDER-BOTTOM: #669999 2px solid
}
.OverDragContainer {
 BACKGROUND-COLOR: #eee
}
.DragBox {
 BORDER-RIGHT: #000 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #000 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 10px; MARGIN-BOTTOM: 5px; PADDING-BOTTOM: 2px; BORDER-LEFT: #000 1px solid; WIDTH: 94px; CURSOR: pointer; PADDING-TOP: 2px; BORDER-BOTTOM: #000 1px solid; FONT-FAMILY: verdana, tahoma, arial; BACKGROUND-COLOR: #eee
}
.OverDragBox {
 BORDER-RIGHT: #000 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #000 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 10px; MARGIN-BOTTOM: 5px; PADDING-BOTTOM: 2px; BORDER-LEFT: #000 1px solid; WIDTH: 94px; CURSOR: pointer; PADDING-TOP: 2px; BORDER-BOTTOM: #000 1px solid; FONT-FAMILY: verdana, tahoma, arial; BACKGROUND-COLOR: #eee
}
.DragDragBox {
 BORDER-RIGHT: #000 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #000 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 10px; MARGIN-BOTTOM: 5px; PADDING-BOTTOM: 2px; BORDER-LEFT: #000 1px solid; WIDTH: 94px; CURSOR: pointer; PADDING-TOP: 2px; BORDER-BOTTOM: #000 1px solid; FONT-FAMILY: verdana, tahoma, arial; BACKGROUND-COLOR: #eee
}
.miniDragBox {
 BORDER-RIGHT: #000 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #000 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 10px; MARGIN-BOTTOM: 5px; PADDING-BOTTOM: 2px; BORDER-LEFT: #000 1px solid; WIDTH: 94px; CURSOR: pointer; PADDING-TOP: 2px; BORDER-BOTTOM: #000 1px solid; FONT-FAMILY: verdana, tahoma, arial; BACKGROUND-COLOR: #eee
}
.OverDragBox {
 BACKGROUND-COLOR: #ffff99
}
.DragDragBox {
 BACKGROUND-COLOR: #ffff99
}
.DragDragBox {
 FILTER: alpha(opacity=50); BACKGROUND-COLOR: #ff99cc
}
LEGEND {
 FONT-WEIGHT: bold; FONT-SIZE: 12px; COLOR: #666699; FONT-FAMILY: verdana, tahoma, arial
}
FIELDSET {
 PADDING-RIGHT: 3px; PADDING-LEFT: 3px; PADDING-BOTTOM: 3px; PADDING-TOP: 3px
}
.History {
 FONT-SIZE: 10px; OVERFLOW: auto; WIDTH: 100%; FONT-FAMILY: verdana, tahoma, arial; HEIGHT: 82px
}
#DragContainer8 {
 BORDER-RIGHT: #669999 1px solid; PADDING-RIGHT: 0px; BORDER-TOP: #669999 1px solid; PADDING-LEFT: 5px; PADDING-BOTTOM: 0px; BORDER-LEFT: #669999 1px solid; WIDTH: 110px; PADDING-TOP: 5px; BORDER-BOTTOM: #669999 1px solid; HEIGHT: 110px
}
.miniDragBox {
 FLOAT: left; MARGIN: 0px 5px 5px 0px; WIDTH: 20px; HEIGHT: 20px
}
pre{border:1 solid #CCC;background-color:#F8F8F0;padding:10px;}
</STYLE>


<script>

// iMouseDown represents the current mouse button state: up or down
/*
lMouseState represents the previous mouse button state so that we can
check for button clicks and button releases:

if(iMouseDown && !lMouseState) // button just clicked!
if(!iMouseDown && lMouseState) // button just released!
*/
var mouseOffset = null;
var iMouseDown  = false;
var lMouseState = false;
var dragObject  = null;

// Demo 0 variables
var DragDrops   = [];
var curTarget   = null;
var lastTarget  = null;
var dragHelper  = null;
var tempDiv     = null;
var rootParent  = null;
var rootSibling = null;

Number.prototype.NaN0=function(){return isNaN(this)?0:this;}

function CreateDragContainer(){
 /*
 Create a new "Container Instance" so that items from one "Set" can not
 be dragged into items from another "Set"
 */
 var cDrag        = DragDrops.length;
 DragDrops[cDrag] = [];

 /*
 Each item passed to this function should be a "container".  Store each
 of these items in our current container
 */
 for(var i=0; i<arguments.length; i++){
  var cObj = arguments[i];
  DragDrops[cDrag].push(cObj);
  cObj.setAttribute('DropObj', cDrag);

  /*
  Every top level item in these containers should be draggable.  Do this
  by setting the DragObj attribute on each item and then later checking
  this attribute in the mouseMove function
  */
  for(var j=0; j<cObj.childNodes.length; j++){

   // Firefox puts in lots of #text nodes...skip these
   if(cObj.childNodes[j].nodeName=='#text') continue;

   cObj.childNodes[j].setAttribute('DragObj', cDrag);
  }
 }
}


function mouseCoords(ev){
 if(ev.pageX || ev.pageY){
  return {x:ev.pageX, y:ev.pageY};
 }
 return {
  x:ev.clientX + document.body.scrollLeft - document.body.clientLeft,
  y:ev.clientY + document.body.scrollTop  - document.body.clientTop
 };
}

function getMouseOffset(target, ev){
 ev = ev || window.event;

 var docPos    = getPosition(target);
 var mousePos  = mouseCoords(ev);
 return {x:mousePos.x - docPos.x, y:mousePos.y - docPos.y};
}

 

function getPosition(e){
 var left = 0;
 var top  = 0;
 while (e.offsetParent){
  left += e.offsetLeft + (e.currentStyle?(parseInt(e.currentStyle.borderLeftWidth)).NaN0():0);
  top  += e.offsetTop  + (e.currentStyle?(parseInt(e.currentStyle.borderTopWidth)).NaN0():0);
  e     = e.offsetParent;
 }

 left += e.offsetLeft + (e.currentStyle?(parseInt(e.currentStyle.borderLeftWidth)).NaN0():0);
 top  += e.offsetTop  + (e.currentStyle?(parseInt(e.currentStyle.borderTopWidth)).NaN0():0);

 return {x:left, y:top};

}


function mouseMove(ev){
 ev         = ev || window.event;

 /*
 We are setting target to whatever item the mouse is currently on

 Firefox uses event.target here, MSIE uses event.srcElement
 */
 var target   = ev.target || ev.srcElement;
 var mousePos = mouseCoords(ev);

 // mouseOut event - fires if the item the mouse is on has changed
 if(lastTarget && (target!==lastTarget)){
  // reset the classname for the target element
  var origClass = lastTarget.getAttribute('origClass');
  if(origClass) lastTarget.className = origClass;
 }

 /*
 dragObj is the grouping our item is in (set from the createDragContainer function).
 if the item is not in a grouping we ignore it since it can't be dragged with this
 script.
 */
 var dragObj = target.getAttribute('DragObj');

  // if the mouse was moved over an element that is draggable
 if(dragObj!=null){

  // mouseOver event - Change the item's class if necessary
  if(target!=lastTarget){
   var oClass = target.getAttribute('overClass');
   if(oClass){
    target.setAttribute('origClass', target.className);
    target.className = oClass;
   }
  }

  // if the user is just starting to drag the element
  if(iMouseDown && !lMouseState){
   // mouseDown target
   curTarget     = target;

   // Record the mouse x and y offset for the element
   rootParent    = curTarget.parentNode;
   rootSibling   = curTarget.nextSibling;

   mouseOffset   = getMouseOffset(target, ev);

   // We remove anything that is in our dragHelper DIV so we can put a new item in it.
   for(var i=0; i<dragHelper.childNodes.length; i++) dragHelper.removeChild(dragHelper.childNodes[i]);

   // Make a copy of the current item and put it in our drag helper.
   dragHelper.appendChild(curTarget.cloneNode(true));
   dragHelper.style.display = 'block';

   // set the class on our helper DIV if necessary
   var dragClass = curTarget.getAttribute('dragClass');
   if(dragClass){
    dragHelper.firstChild.className = dragClass;
   }

   // disable dragging from our helper DIV (it's already being dragged)
   dragHelper.firstChild.removeAttribute('DragObj');

   /*
   Record the current position of all drag/drop targets related
   to the element.  We do this here so that we do not have to do
   it on the general mouse move event which fires when the mouse
   moves even 1 pixel.  If we don't do this here the script
   would run much slower.
   */
   var dragConts = DragDrops[dragObj];

   /*
   first record the width/height of our drag item.  Then hide it since
   it is going to (potentially) be moved out of its parent.
   */
   curTarget.setAttribute('startWidth',  parseInt(curTarget.offsetWidth));
   curTarget.setAttribute('startHeight', parseInt(curTarget.offsetHeight));
   curTarget.style.display  = 'none';

   // loop through each possible drop container
   for(var i=0; i<dragConts.length; i++){
    with(dragConts[i]){
     var pos = getPosition(dragConts[i]);

     /*
     save the width, height and position of each container.

     Even though we are saving the width and height of each
     container back to the container this is much faster because
     we are saving the number and do not have to run through
     any calculations again.  Also, offsetHeight and offsetWidth
     are both fairly slow.  You would never normally notice any
     performance hit from these two functions but our code is
     going to be running hundreds of times each second so every
     little bit helps!

     Note that the biggest performance gain here, by far, comes
     from not having to run through the getPosition function
     hundreds of times.
     */
     setAttribute('startWidth',  parseInt(offsetWidth));
     setAttribute('startHeight', parseInt(offsetHeight));
     setAttribute('startLeft',   pos.x);
     setAttribute('startTop',    pos.y);
    }

    // loop through each child element of each container
    for(var j=0; j<dragConts[i].childNodes.length; j++){
     with(dragConts[i].childNodes[j]){
      if((nodeName=='#text') || (dragConts[i].childNodes[j]==curTarget)) continue;

      var pos = getPosition(dragConts[i].childNodes[j]);

      // save the width, height and position of each element
      setAttribute('startWidth',  parseInt(offsetWidth));
      setAttribute('startHeight', parseInt(offsetHeight));
      setAttribute('startLeft',   pos.x);
      setAttribute('startTop',    pos.y);
     }
    }
   }
  }
 }

 // If we get in here we are dragging something
 if(curTarget){
  // move our helper div to wherever the mouse is (adjusted by mouseOffset)
  dragHelper.style.top  = mousePos.y - mouseOffset.y;
  dragHelper.style.left = mousePos.x - mouseOffset.x;

  var dragConts  = DragDrops[curTarget.getAttribute('DragObj')];
  var activeCont = null;

  var xPos = mousePos.x - mouseOffset.x + (parseInt(curTarget.getAttribute('startWidth')) /2);
  var yPos = mousePos.y - mouseOffset.y + (parseInt(curTarget.getAttribute('startHeight'))/2);

  // check each drop container to see if our target object is "inside" the container
  for(var i=0; i<dragConts.length; i++){
   with(dragConts[i]){
    if(((getAttribute('startLeft'))                               < xPos) &&
     ((getAttribute('startTop'))                                < yPos) &&
     ((getAttribute('startLeft') + getAttribute('startWidth'))  > xPos) &&
     ((getAttribute('startTop')  + getAttribute('startHeight')) > yPos)){

      /*
      our target is inside of our container so save the container into
      the activeCont variable and then exit the loop since we no longer
      need to check the rest of the containers
      */
      activeCont = dragConts[i];

      // exit the for loop
      break;
    }
   }
  }

  // Our target object is in one of our containers.  Check to see where our div belongs
  if(activeCont){
   // beforeNode will hold the first node AFTER where our div belongs
   var beforeNode = null;

   // loop through each child node (skipping text nodes).
   for(var i=activeCont.childNodes.length-1; i>=0; i--){
    with(activeCont.childNodes[i]){
     if(nodeName=='#text') continue;

     // if the current item is "After" the item being dragged
     if(
      curTarget != activeCont.childNodes[i]                              &&
      ((getAttribute('startLeft') + getAttribute('startWidth'))  > xPos) &&
      ((getAttribute('startTop')  + getAttribute('startHeight')) > yPos)){
       beforeNode = activeCont.childNodes[i];
     }
    }
   }

   // the item being dragged belongs before another item
   if(beforeNode){
    if(beforeNode!=curTarget.nextSibling){
     activeCont.insertBefore(curTarget, beforeNode);
    }

   // the item being dragged belongs at the end of the current container
   } else {
    if((curTarget.nextSibling) || (curTarget.parentNode!=activeCont)){
     activeCont.appendChild(curTarget);
    }
   }

   // make our drag item visible
   if(curTarget.style.display!=''){
    curTarget.style.display  = '';
   }
  } else {

   // our drag item is not in a container, so hide it.
   if(curTarget.style.display!='none'){
    curTarget.style.display  = 'none';
   }
  }
 }

 // track the current mouse state so we can compare against it next time
 lMouseState = iMouseDown;

 // mouseMove target
 lastTarget  = target;

 // track the current mouse state so we can compare against it next time
 lMouseState = iMouseDown;

 // this helps prevent items on the page from being highlighted while dragging
 return false;
}

function mouseUp(ev){
 if(curTarget){
  // hide our helper object - it is no longer needed
  dragHelper.style.display = 'none';

  // if the drag item is invisible put it back where it was before moving it
  if(curTarget.style.display == 'none'){
   if(rootSibling){
    rootParent.insertBefore(curTarget, rootSibling);
   } else {
    rootParent.appendChild(curTarget);
   }
  }

  // make sure the drag item is visible
  curTarget.style.display = '';
 }
 curTarget  = null;
 iMouseDown = false;
}

function mouseDown(){
 iMouseDown = true;
 if(lastTarget){
  return false;
 }
}

document.onmousemove = mouseMove;
document.onmousedown = mouseDown;
document.onmouseup   = mouseUp;

window.onload = function(){
 // Create our helper object that will show the item while dragging
 dragHelper = document.createElement('DIV');
 dragHelper.style.cssText = 'position:absolute;display:none;';
  
 CreateDragContainer(
  document.getElementById('DragContainer1'),
  document.getElementById('DragContainer2'),
  document.getElementById('DragContainer3')
 );

 document.body.appendChild(dragHelper);
}

</script>

<!--the mouse over and dragging class are defined on each item-->

<div class="DragContainer" id="DragContainer1">
 <div class="DragBox" id="Item1"  overClass="OverDragBox" dragClass="DragDragBox">Item #1</div>
 <div class="DragBox" id="Item2"  overClass="OverDragBox" dragClass="DragDragBox">Item #2</div>
 <div class="DragBox" id="Item3"  overClass="OverDragBox" dragClass="DragDragBox">Item #3</div>
 <div class="DragBox" id="Item4"  overClass="OverDragBox" dragClass="DragDragBox">Item #4</div>
</div>
<div class="DragContainer" id="DragContainer2">
 <div class="DragBox" id="Item5"  overClass="OverDragBox" dragClass="DragDragBox">Item #5</div>
 <div class="DragBox" id="Item6"  overClass="OverDragBox" dragClass="DragDragBox">Item #6</div>
 <div class="DragBox" id="Item7"  overClass="OverDragBox" dragClass="DragDragBox">Item #7</div>
 <div class="DragBox" id="Item8"  overClass="OverDragBox" dragClass="DragDragBox">Item #8</div>
</div>
<div class="DragContainer" id="DragContainer3">
 <div class="DragBox" id="Item9"  overClass="OverDragBox" dragClass="DragDragBox">Item #9</div>
 <div class="DragBox" id="Item10" overClass="OverDragBox" dragClass="DragDragBox">Item #10</div>
 <div class="DragBox" id="Item11" overClass="OverDragBox" dragClass="DragDragBox">Item #11</div>
 <div class="DragBox" id="Item12" overClass="OverDragBox" dragClass="DragDragBox">Item #12</div>

</div>

User:admin
Posts: 3
Joined: 2008-10-16 08:41:18
25
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> New Document </title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="zh-CN" />
<meta name="Design Corp" content="www.mysuc.com" />
<meta name="Designer" content="hayden" />
<meta name="Designer mail" content="hayden@yeah.net" />
<meta name="robots" content="hayden" />
<meta name="Keywords" content="" />
<meta name="Description" content="" />
<script language="JavaScript" type="text/javascript">
var drag_=false
var D=new Function('obj','return document.getElementById(obj);')
var oevent=new Function('e','if (!e) e = window.event;return e')
function Move_obj(obj){
 var x,y;
 D(obj).onmousedown=function(e){
  drag_=true;
  with(this){
   style.position="absolute";
   var temp1=offsetLeft;
   var temp2=offsetTop;
   x=oevent(e).clientX;y=oevent(e).clientY;
   document.onmousemove=function(e){
    if(!drag_)return false;
    with(this){
     style.left=temp1+oevent(e).clientX-x+"px";
     style.top=temp2+oevent(e).clientY-y+"px";
    }
   }
  }
  document.onmouseup=new Function("drag_=false");
 }
}
</script>
<body>
<div id="test" style="background-color:#0099CC;width:200px;height:100px;border:1px #000 solid;" onmouseover='Move_obj("test")'>mouse click move div</div>
</body>
</html>
User:Guest
Posts:
Joined:
26
User:Guest
Posts:
Joined:
27
cool
User:bird
Posts: 2
Joined: 2008-12-23 22:56:22
28

do you have mysql database

when you type sitename.com in brower IE or firefox    it can open sitename.com/install page 

and then type you host,  databse name, usrname and password  it ok

User:bird
Posts: 2
Joined: 2008-12-23 22:56:22
29

i setup it's ok

1. download honocms  and then  extract it  put it to you httpdocs

2.type sitename.com/honocms/   it can open  sitename.com/honocms/install page

3. type host,Host Name Database Name  Database Username Database Pasword  Administrator Pasword   submit   it's ok

User:bird
Posts: 2
Joined: 2008-12-23 22:56:22
30

below error

ERROR: Cannot find database {mysqldb}Unknown MySQL server host '{mysqlhost}' (1)

you have no mysql database   do you have mysql database in your server

thanks

48 30 1/2页 12345678910
 
Home | Home Page | Favorites | Contact Us

Copyright ? Powered by HonoWeb 2005-2008 All rights reserved.