| px | top | add code | search | signup | login | help |
<?php
/*
http://www.china-on-site.com/flexphpic/
Written in PHP+Mysql, FlexPHPic is a simple, free and open source picture admin system. You can add multi-level sub-categories and classify the pictures. All the text in this program is put in one file. Once you edit this file, you can generate a new language version or customize the text in your program. Users can search pictures by keywords, browse pictures online as Acdsee, zoom in, zoom out or print the pictures, and add filter effect for the pictures.
*/
require("./DbSql.inc.php");
Class PicSQL extends DBSQL
{
// the constructor
function PicSQL($DBName = "")
{
$this->DBSQL($DBName);
}
function getchildcatalog($catid)
{
$start = $page*$record;
$sql = "select catalogid,catalogname from catalog where parentid='$catid' order by catalogid";
$result = $this->select($sql);
return $result;
}
function getpicsbycatid($page,$record,$catid)
{
$start = $page*$record;
$sql = "select picid,title,adddate from picture where catalogid='$catid' and isdisplay=1 order by picid DESC LIMIT $start,$record";
$result = $this->select($sql);
return $result;
}
function getlatestonhome($record)
{
$sql = "select picid,title,adddate from picture where isdisplay=1 order by picid DESC LIMIT 0,$record";
$result = $this->select($sql);
return $result;
}
function getcatalognamebyid($catalogid)
{
$sql = "select catalogname from catalog where catalogid='$catalogid'";
$result = $this->select($sql);
$parentname = $result[0]["catalogname"];
return $parentname;
}
function getpicbykeyword($page,$record,$keyword)
{
$start = $page*$record;
$sql = "select picid,title,adddate from picture where title like '%$keyword%' and isdisplay=1 order by picid DESC LIMIT $start,$record";
$result = $this->select($sql);
return $result;
}
function getpicbyid($picid)
{
$sql = "select * from picture where picid='$picid'";
$result = $this->select($sql);
return $result;
}
function getpicbycatidonpicphp($catalogid)
{
$sql = "select picture from picture where catalogid='$catalogid' and isdisplay=1 order by picid DESC";
$result = $this->select($sql);
return $result;
}
function getname($picid)
{
$sql = "select title from picture where picid=$picid";
$result = $this->select($sql);
$title = $result[0]["title"];
return $title;
}
}
?>
Comments or questions?
PX is running PHP 5.2.11
Thanks to Miranda Productions for hosting and bandwidth.
Use of any code from PX is at your own risk.