示例#1
0
function kona3_action_plugin()
{
    global $kona3conf;
    $page = $kona3conf["page"];
    $name = isset($_GET['name']) ? $_GET['name'] : '';
    if ($name == '') {
        header("location: index.php");
        exit;
    }
    if (!preg_match('#^[a-zA-Z0-9]+$#', $name)) {
        err404("Invalid plugin name");
    }
    // pinfo
    $pinfo = konawiki_parser_getPlugin($name);
    if (empty($pinfo['file']) || !file_exists($pinfo['file'])) {
        err404("Invalid plugin name");
    }
    // execute
    include_once $pinfo['file'];
    $func_name = "kona3plugins_{$name}_action";
    if (!function_exists($func_name)) {
        err404("Plugin function not found");
    }
    @call_user_func($func_name);
}
示例#2
0
 private function getUserSkin($bid = 0)
 {
     if ($this->spArgs('domain') != 'home' && $this->spArgs('domain') != '') {
         $rs = spClass('db_theme')->getByDomain($this->spArgs('domain'));
     } elseif ($this->spArgs('uid') != '') {
         $rs = spClass('db_theme')->getByUid($this->spArgs('uid'));
     } else {
         $rs = spClass('db_theme')->getByBid($this->spArgs('bid'));
     }
     if (!is_array($rs)) {
         err404('您访问的用户不存在,用户可能已经更改了个性域名');
     }
     $skin = spClass('db_theme')->find(array('uid' => $rs['uid']));
     $this->user_data = $rs;
     $this->user_skin = $skin;
     //将数据赋值给全局变量
 }
示例#3
0
}
if (!$config['quality']) {
    $config['quality'] = $_CONFIG_COMPRESS_QUALITY;
}
if ($config['wmp']) {
    if (!$config['wmi']) {
        $config['wmi'] = $_CONFIG_WATERMARK_IMG;
    }
    if (!$config['wmm']) {
        $config['wmm'] = $_CONFIG_WATERMARK_MARGIN;
    }
}
//下载原图
$imgdata = fastdfs_storage_download_file_to_buff1($remote_filename);
if (!$imgdata) {
    err404();
}
//压缩处理
$img = new imagick_class();
$ret = $img->compress_buff($imgdata, $config['width'], $config['height'], $config);
$imgdata = $ret['buff'];
//显示
header('Content-Type: image/' . $ret['format']);
header('Content-Length: ' . strlen($imgdata));
echo $imgdata;
//上传
$prefix_name = '_' . $match[2];
$ext_name = $match[3];
fastdfs_storage_upload_slave_by_filebuff1($imgdata, $remote_filename, $prefix_name, $ext_name);
/**
 * 返回404
示例#4
0
?>
				<div class="main-content<?php 
if ($admin) {
    echo " editable";
}
?>
" <?php 
if ($admin) {
    echo "contenteditable='true'";
}
?>
 >
					<?php 
if ($err_404) {
    //Display 404 not found page
    err404($current_page);
} else {
    if (strcmp($menu_page, "gastbok") == 0) {
        //Load and display guestbook messages from db
        echo file_get_contents_utf8($file_system_path . $root . "gastbok.php");
        if (!$admin) {
            echo file_get_contents($domain . $root . "getposts.php?count=20&start={$page}");
        }
        echo "<span class='center'>";
        $page = intval($page);
        if ($page != 1) {
            echo "<a href='1'>1</a>";
        } else {
            echo "1";
        }
        $num_of_posts = intval(file_get_contents($domain . $root . "number_of_gb_posts.php"));