configwantedpass = & $configwantedpass;
$this->configadminpass = & $configadminpass;
$this->configdirpasswordfile = & $configdirpasswordfile;
$this->configopengzip = & $configopengzip;
$this->configshowpicsize = & $configshowpicsize;
$this->configext = & $configext;
$this->strlenmax = & $strlenmax;
$this->configeachpagemax = & $configeachpagemax;
$this->configeachlinemax = & $configeachlinemax;
$this->configtdheight = & $configtdheight ;
$this->configtdwidth = & $configtdwidth;
$this->configpagemax = & $configpagemax;
$this->configtilte = & $configtilte;
$this->configver = & $configver;
}
/*
+----------------------------------+
| open gzip
+----------------------------------+
| c / m : 2003-12-29 / --
+----------------------------------+
*/
function gzip()
{
if ($this->configopengzip == true)
ob_start(ob_gzhandler);
}
/*
+----------------------------------+
| get the querystring
+----------------------------------+
| c / m : 2003-12-28 / 2003-12-29
+----------------------------------+
*/
function getvars()
{
$this->page = rawurldecode($_get['page']);
$this->path = rawurldecode($_get['path']);
$this->style = $_get['style'];
if (!$this->style) $this->style = small;
if (!$this->path) $this->path = .;
}
/*
+----------------------------------+
| check error
+----------------------------------+
| c / m : 2003-12-28 / 2004-1-1
+----------------------------------+
*/
function checkerror()
{
if (preg_match(/\.\./, $this->path)) $patherror = true;
if (!is_dir($this->path)) $patherror = true;
if ($patherror == true)
{
header(location:.$_server['php_self']);
exit;
}
}
/*
+----------------------------------+
| path array initialize
+----------------------------------+
| c / m : 2003-12-28 / 2003-12-29
+----------------------------------+
*/
function patharrayinitialize()
{
if (!$this->path) $this->path = .;
$this->patharray = explode(/, $this->path);
$this->pathlevelnum = count($this->patharray);
$this->nowdirname = $this->patharray[$this->pathlevelnum - 1];
if ($this->nowdirname == .) $this->nowdirname = 根目录;
}
/*
+----------------------------------+
| timer
+----------------------------------+
| c / m : 2003-12-29 / --
+----------------------------------+
*/
function timer()
{
$time = explode( , microtime());
$usec = (double)$time[0];
$sec = (double)$time[1];
$this->timer = $usec + $sec;
}
/*
+----------------------------------+
| show used time
+----------------------------------+
| c / m : 2003-12-29 / --
+----------------------------------+
*/
function usedtime()
{
$starttime = $this->timer;
$this->timer();
$endtime = $this->timer;
$usedtime = $endtime - $starttime;
$this->usedtime = sprintf(%0.4f, $usedtime);
}
/*
+----------------------------------+
| make over direct
+----------------------------------+
| c / m : 2003-12-28 / 2003-12-29
+----------------------------------+
*/
function makeoverdirect()
{
$overpath = .;
for($i = 1; $i pathlevelnum - 1; $i++)
{
$overpath = $overpath./.$this->patharray[$i];
}
$this->dirarray[] = $overpath;
$this->dirnamearray[] = 上级目录;
for($i = 1; $i pathlevelnum; $i++)
{
$this->encodepath .= rawurlencode($this->patharray[$i])./;
}
}
/*
+----------------------------------+
| getfileext
+----------------------------------+
| c / m : 2003-12-28 / --
+----------------------------------+
*/
function getfileext($filename)
{
$pos = strrpos($filename, '.');
return strtolower(substr($filename, $pos+1, (strlen($filename)-$pos-1)));
}
/*
+----------------------------------+
| make direct list
+----------------------------------+
| c / m : 2003-12-28 / 2003-12-29
+----------------------------------+
*/
function makedirlist()
{
$dir = dir($this->path);
while($file = $dir->read())
{
if ($file . and $file ..)
{
$filename = $file;
$file = $this->path./.$file;
if (is_dir($file))
{
$this->dirarray[] = $file;
$this->dirnamearray[] = $filename;
}
if (in_array($this->getfileext($file), $this->configext))
{
$this->picencodearray[] = ./ . $this->encodepath . rawurlencode($filename);
$this->picarray[] = $file;
$this->picfilearray[] = $filename;
}
}
}
}
/*
+----------------------------------+
| get each array number
+----------------------------------+
| c / m : 2003-12-28 / --
+----------------------------------+
*/
function geteacharraynum()
{
$this->dirnum = count($this->dirarray);
$this->picnum = count($this->picarray);
}
/*
+----------------------------------+
| make page bar
+----------------------------------+
| c / m : 2003-12-28 / 2003-12-29
+----------------------------------+
*/
function makepagebar()
{
$this->pagetotal = ceil($this->picnum / $this->configeachpagemax);
if (!$this->page or $this->page page = 1;
if ($this->page > $this->pagetotal) $this->page = $this->pagetotal;
$this->offset = $this->configeachpagemax * $this->page;
$this->start = $this->offset - $this->configeachpagemax;
if ($this->start start = 0;
if ($this->offset > $this->picnum) $this->offset = $this->picnum;
$this->pagestart = $this->page - $this->configpagemax;
if ($this->pagestart pagestart = 1;
$this->pagemiddle = $this->page + 1;
$this->pageend = $this->pagemiddle + $this->configpagemax;
if ($this->page configpagemax) $this->pageend = $this->configpagemax * 2 + 1;
if ($this->pageend > $this->pagetotal) $this->pageend = $this->pagetotal + 1;
}
/*
+----------------------------------+
| show page bar
+----------------------------------+
| c / m : 2003-12-28 / 2003-12-29
+----------------------------------+
*/
function showpagebar()
{
print(
\n);
print(
);
print([ path).&style=.$this->style.&page=.($this->page - 1).\ title=\上一页\>上一页 ] );
print(path).&style=.$this->style.&page=1\ title=\首页\>\n); for ($i = $this->pagestart; $i page; $i++)
print(path).&style=.$this->style.&page=.$i.\ title=\第 .$i. 页\>[.$i.] );
printf([%s], $this->page);
for ($i = $this->pagemiddle; $i pageend; $i++)
print(path).&style=.$this->style.&page=.$i.\ title=\第 .$i. 页\>[.$i.] );
print(...path).&style=.$this->style.&page=.$this->pagetotal.\ title=\第 . $this->pagetotal . 页\>[ . $this->pagetotal . ]\n);
print( path).&style=.$this->style.&page=.$this->pagetotal.\ title=\尾页\>>>\n);
print([ path).&style=.$this->style.&page=.($this->page + 1).\ title=\下一页\>下一页 ] 共 .$this->pagetotal. 页 当前所在第 .$this->page. 页);
print(
);
print(
\n);
} /*
+----------------------------------+
| set picture id
+----------------------------------+
| c / m : 2003-12-28 / --
+----------------------------------+
*/
function setpicid($id)
{
$this->picid = $id;
}
/*
+----------------------------------+
| get picture dimension
+----------------------------------+
| c / m : 2003-12-28 / --
+----------------------------------+
*/
function getpicdim()
{
$picsize = getimagesize($this->picarray[$this->picid]);
preg_match(!width=\(.*)\ height=\(.*)\!, $picsize['3'], $tempsize);
$this->picrealsizewidth = $tempsize['1'];
$this->picrealsizeheight = $tempsize['2'];
/*
$tempsize['1'] configtdwidth ? $this->temp['width'] = $tempsize['1'] : $this->temp['width'] = $this->configtdwidth;
$tempsize['2'] configtdheight ? $this->temp['height'] = $tempsize['2'] : $this->temp['height'] = $this->configtdheight;
*/
$twidth = $this->picrealsizewidth / $this->configtdwidth;
$theight = $this->picrealsizeheight / $this->configtdheight;
if ($this->picrealsizewidth > $this->configtdwidth or $this->picrealsizeheight > $this->configtdheight)
{
if ($twidth > $theight)
{
$this->temp['width'] = $this->configtdwidth;
$this->temp['height'] = number_format($this->picrealsizeheight / $twidth);
}
elseif ($twidth {
$this->temp['height'] = $this->configtdheight;
$this->temp['width'] = number_format($this->picrealsizewidth / $theight);
}
else
{
$this->temp['width'] = $this->configtdwidth;
$this->temp['height'] = $this->configtdheight;
}
}
else
{
$this->temp['width'] = $this->picrealsizewidth;
$this->temp['height'] = $this->picrealsizeheight;
}
}
/*
+----------------------------------+
| show the title javascript
+----------------------------------+
| c / m : 2003-12-29 / 2003-12-30
+----------------------------------+
*/
function showjs()
{
print('
tpopwait=20;
showpopstep=10;
popopacity=85;
spop=null;
curshow=null;
tfadeout=null;
tfadein=null;
tfadewaiting=null;
document.write(
document.write();
document.write(
);
function showpopuptext(){
var o=event.srcelement;
mousex=event.x;
mousey=event.y;
if(o.alt!=null && o.alt!=) { o.pop=o.alt;o.alt= }
if(o.title!=null && o.title!=){ o.pop=o.title;o.title= }
if(o.pop) { o.pop=o.pop.replace(\n,
); o.pop=o.pop.replace(\n,
); }
if(o.pop!=spop) {
spop=o.pop;
cleartimeout(curshow);
cleartimeout(tfadeout);
cleartimeout(tfadein);
cleartimeout(tfadewaiting);
if(spop==null || spop==) {
poplayer.innerhtml=;
poplayer.style.filter=alpha();
poplayer.filters.alpha.opacity=0;
} else {
if(o.dyclass!=null) popstyle=o.dyclass
else popstyle=cpoptext;
curshow=settimeout(showit(),tpopwait);
}
}
}
function showit() {
poplayer.classname=popstyle;
poplayer.innerhtml=\'
\'+spop+\'
\';
popwidth=poplayer.clientwidth;
popheight=poplayer.clientheight;
if(mousex+12+popwidth>document.body.clientwidth) popleftadjust=-popwidth-24
else popleftadjust=0;
if(mousey+12+popheight>document.body.clientheight) poptopadjust=-popheight-24
else poptopadjust=0;
poplayer.style.left=mousex+12+document.body.scrollleft+popleftadjust;
poplayer.style.top=mousey+12+document.body.scrolltop+poptopadjust;
poplayer.style.filter=alpha(opacity=0);
fadeout();
}
function fadeout(){
if(poplayer.filters.alpha.opacity poplayer.filters.alpha.opacity+=showpopstep;
tfadeout=settimeout(fadeout(),1);
}
}
document.onmouseover=showpopuptext;
');
}
/*
+----------------------------------+
| show css
+----------------------------------+
| c / m : 2003-12-28 / --
+----------------------------------+
*/
function showcss()
{
print(
);
}
/*
+----------------------------------+
| show title
+----------------------------------+
| c / m : 2003-12-28 / --
+----------------------------------+
*/
function showtitle()
{
print(\n);
print(
.$this->configtilte.\n);
print(\n);
print(\n);
print(
\n);
print(\n);
print($this->configtilte);
print(\n);
print(
\n);
} /*
+----------------------------------+
| show state
+----------------------------------+
| c / m : 2003-12-28 / 2004-4-9
+----------------------------------+
*/
function showstate()
{
print(
\n);
print(\n);
print(\n);
print(\n);
print(\n);
print(褰
