本文整理汇总了PHP中album::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP album::getInstance方法的具体用法?PHP album::getInstance怎么用?PHP album::getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类album
的用法示例。
在下文中一共展示了album::getInstance方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initialize
protected function initialize()
{
$this->album = album::getInstance();
if ($this->data['id'] == '-1') {
$this->imageinfo = array('name' => 'album.png');
$session = session::getInstance();
$this->pathname = LOCAL_PATH . LOCAL_DIR . 'theme/' . $session->getData('theme') . '/image/';
} else {
$this->imageinfo = $this->album->getMediaInfo($this->data['id']);
$this->pathname = LOCAL_PATH . LOCAL_DIR . 'data/' . $this->imageinfo['path'] . '/';
}
if (!$this->imageinfo) {
$this->error('4', 'album inexistant');
}
$this->width = isset($this->data['w']) ? $this->data['w'] : false;
$this->height = isset($this->data['h']) ? $this->data['h'] : false;
$this->mask = isset($this->data['m']) ? $this->data['m'] : false;
$this->trans = isset($this->data['t']) ? $this->data['t'] : false;
$this->pathcache = LOCAL_PATH . LOCAL_DIR . 'cache/';
$this->filecache = $this->getCacheName();
$this->filename = $this->imageinfo['name'];
$mime = parse_ini_file('include/mime.ini');
$this->mime = $mime[strtolower(substr($this->imageinfo['name'], strrpos($this->imageinfo['name'], '.') + 1, strlen($this->imageinfo['name'])))];
if (!$this->mime) {
return false;
}
$this->type = explode('/', $this->mime);
}
示例2: initialize
public function initialize()
{
$this->template = template::getInstance();
$this->session = session::getInstance();
$this->album = album::getInstance();
$this->template->add(array('album'));
$this->id = $this->session->getData('album', 'id');
$this->page = $this->session->getData('album', 'page');
}
示例3: initialize
protected function initialize()
{
if (!isset($this->data['type']) || !isset($this->data['version'])) {
$this->error('2', 'Paramettre manquant');
}
$this->album = album::getInstance();
$this->albuminfo = $this->album->getInfo($this->data['id']);
if (!$this->albuminfo) {
$this->error('4', 'album inexistant');
}
$this->pathcache = LOCAL_PATH . LOCAL_DIR . 'cache/';
$this->pathname = LOCAL_PATH . LOCAL_DIR . 'data/';
$this->filecache = 'a' . $this->data['id'] . '_' . $this->data['version'] . '.' . $this->data['type'];
}
示例4: loadParam
private function loadParam()
{
$param = $_GET;
if (isset($param['p'])) {
$data = unserialize(base64_decode($param['p']));
foreach ($data as $name => $value) {
$param[$name] = $value;
}
}
$session = session::getInstance();
$album = album::getInstance();
if (isset($param['theme'])) {
$session->setData('theme', $param['theme']);
}
if (isset($param['template'])) {
$session->setData('template', $param['template']);
}
if (isset($param['template']) || isset($param['theme'])) {
$session->save();
header('location: http://' . LOCAL_URL . LOCAL_DIR);
echo 1;
}
if (isset($param['mode']) && isset($param['id'])) {
if ($session->getData($param['mode'], 'id') != $param['id']) {
if ($param['mode'] == 'album') {
$parent = $this->album->getParent($session->getData('album', 'id'));
$parent2 = $this->album->getParent($session->getData('album', 'lastId'));
if (!in_array($param['id'], $parent) && !in_array($param['id'], $parent2)) {
$session->setData('album', 'lastId', $param['id']);
}
}
$session->setData($param['mode'], 'page', 1);
$session->setData($param['mode'], 'id', $param['id']);
}
}
if (isset($param['mode']) && $param['mode'] != $session->getData('mode')) {
$session->setData('mode', $param['mode']);
}
if (isset($param['page'])) {
$session->setData($session->getData('mode'), 'page', $param['page']);
}
}