예제 #1
0
function print_gallery($skinname, $title, $id, $num = 10, $xsize = 80, $ysize = 80, $xnum = 10)
{
    global $_zb_path, $_zb_url, $connect, $t_board, $admin_table, $HTTP_SESSION_VARS;
    if (!$skinname || !$id) {
        return;
    }
    $str = zReadFile($_zb_path . "latest_skin/" . $skinname . "/main.html");
    if (!$str) {
        echo "No existence for the entered skin({$skinname}).<br>";
        return;
    }
    $tmpResult = mysql_query("select use_alllist from {$admin_table} where name='{$id}'") or die(mysql_error());
    $setup = mysql_fetch_array($tmpResult);
    if ($setup[use_alllist]) {
        $target = "zboard.php?id=" . $id;
    } else {
        $target = "view.php?id=" . $id;
    }
    $result = mysql_query("select * from {$t_board}" . "_{$id} order by no desc limit {$num}", $connect) or die(mysql_error());
    $i = 0;
    while ($data = mysql_fetch_array($result)) {
        if (eregi("\\.gif|\\.jpg", $data[file_name1])) {
            $filename = $_zb_url . $data[file_name1];
        } elseif (eregi("\\.gif|\\.jpg", $data[file_name2])) {
            $filename = $_zb_url . $data[file_name2];
        } else {
            $filename = "";
        }
        if ($filename) {
            $imgList .= "<a href='" . $_zb_url . $target . "&no={$data['no']}'><img src='{$filename}' border=1 style=border-color:#C0C0C0 width={$xsize} height={$ysize} vspacing=10 hspacing=10></a>";
        } else {
            $imgList .= "<a href='" . $_zb_url . $target . "&no={$data['no']}'><img src='[dir]t.gif' border=1 style=border-color:#C0C0C0 width={$xsize} height={$ysize} vspacing=10 hspacing=10></a>";
        }
        $i++;
        if ($i >= $xnum) {
            $imgList .= "<br>";
            $i = 0;
        } else {
            $imgList .= "&nbsp;";
        }
    }
    $str = str_replace("[title]", "<a href='" . $_zb_url . "zboard.php?id=" . $id . "'>" . $title . "</a>", $str);
    $str = str_replace("[img]", $imgList, $str);
    $str = str_replace("[dir]", $_zb_url . "latest_skin/" . $skinname . "/images/", $str);
    echo $str;
}
예제 #2
0
}
// 회원의 이미지 창고 전체 용량 계산하기
$d = dir($path);
while ($entry = $d->read()) {
    if ($entry != "." && $entry != "..") {
        $image_list[] = $entry;
        $image_list_time[] = filemtime($path . "/" . $entry);
    }
}
@array_multisort($image_list_time, SORT_DESC, SORT_NUMERIC, $image_list, SORT_STRING, SORT_DESC);
$dirSize = 0;
for ($i = 0; $i < count($image_list); $i++) {
    $dirSize += filesize($path . "/" . $image_list[$i]);
}
// 회원의 허용 용량 구하기
$maxDirSize = zReadFile($path . "_maxsize.php");
if (!$maxDirSize) {
    // 기본으로 10kb 의 용량을 제공
    $maxDirSize = 100 * 1024;
} else {
    // 파일의 주석처리 제거
    $maxDirSize = str_replace("<?/*", "", $maxDirSize);
    $maxDirSize = str_replace("*/?>", "", $maxDirSize);
}
// 입력된 이미지가 있으면 upload 시킴
if ($exec == "upload") {
    if (!eregi($HTTP_HOST, $HTTP_REFERER)) {
        Error("정상적으로 업로드를 하여 주시기 바랍니다.", "window.close");
    }
    if (!eregi("image_box.php", $HTTP_REFERER)) {
        Error("정상적으로 업로드를 하여 주시기 바랍니다.", "window.close");
예제 #3
0
파일: lib.php 프로젝트: kkskipper/KNOWME
function getDefaultSetup()
{
    global $_zb_path;
    $data = zReadFile($_zb_path . "setup.php");
    $data = str_replace("<?/*", "", $data);
    $data = str_replace("*/?>", "", $data);
    $data = explode("\n", $data);
    $_c = count($data);
    unset($defaultSetup);
    for ($i = 0; $i < $_c; $i++) {
        if (!ereg(";", $data[$i]) && strlen(trim($data[$i]))) {
            $tmpStr = explode("=", $data[$i]);
            $name = trim($tmpStr[0]);
            $value = trim($tmpStr[1]);
            $defaultSetup[$name] = $value;
        }
    }
    if (!$defaultSetup[url]) {
        $defaultSetup[url] = $HTTP_HOST;
    }
    if (!$defaultSetup[sitename]) {
        $defaultSetup[sitename] = $HTTP_HOST;
    }
    if (!$defaultSetup[session_path]) {
        $defaultSetup[session_path] = "data/__zbSessionTMP";
    }
    if (!$defaultSetup[session_view_size]) {
        $defaultSetup[session_view_size] = 512;
    }
    if (!$defaultSetup[session_vote_size]) {
        $defaultSetup[session_vote_size] = 256;
    }
    if (!$defaultSetup[login_time]) {
        $defaultSetup[login_time] = 60 * 30;
    }
    if (!$defaultSetup[nowconnect_enable]) {
        $defaultSetup[nowconnect_enable] = "true";
    }
    if (!$defaultSetup[nowconnect_refresh_time]) {
        $defaultSetup[nowconnect_refresh_time] = 60 * 3;
    }
    if (!$defaultSetup[nowconnect_time]) {
        $defaultSetup[nowconnect_tim] = 60 * 5;
    }
    if (!$defaultSetup[enable_hangul_id]) {
        $defaultSetup[enable_hangul_id] = "false";
    }
    if (!$defaultSetup[check_email]) {
        $defaultSetup[check_email] = "true";
    }
    if (!$defaultSetup[memo_limit_time]) {
        $defaultSetup[memo_limit_time] = 7;
    }
    $defaultSetup[memo_limit_time] = 60 * 60 * 24 * $defaultSetup[memo_limit_time];
    return $defaultSetup;
}
if (!$page && !$status) {
    $status = 1;
}
// 그룹데이타 읽어오기;;
$group_data = mysql_fetch_array(mysql_query("select * from {$group_table} where no='{$member['group_no']}'"));
// 검색어 처리;;
if ($keyword) {
    if (!$status) {
        $s_que = " where user_id like '%{$keyword}%' or name like '%{$keyword}%' ";
    }
}
// 전체 회원의 수
$temp2 = mysql_fetch_array(mysql_query("select count(*) from {$member_table}  {$s_que}"));
$total_member = $temp2[0];
if ($status) {
    $_str = trim(zReadFile("data/now_member_connect.php"));
    if ($_str) {
        $_str = str_replace("<? die('Access Denied');/*", "", $_str);
        $_str = str_replace("*/?>", "", $_str);
        $_connector = explode(":", $_str);
        $total = count($_connector);
    }
} else {
    $total = $total_member;
}
// 페이지 계산
$page_num = 10;
$total_page = (int) (($total - 1) / $page_num) + 1;
// 전체 페이지 구함
if (!$page) {
    $page = 1;
예제 #5
0
echo $member_data[point1];
?>
, Comment(s) : <?php 
echo $member_data[point2];
?>
 )</td>
  </tr>

  <tr height=22 align=center>
     <td colspan=2 bgcolor=#a0a0a0 style=font-family:Tahoma;font-size:8pt;font-weight:bold; align=center>Permission of Administrator</td>
  </tr>

  <tr height=22 align=center>
     <td bgcolor=#a0a0a0 align=right style=font-family:Tahoma;font-size:8pt;font-weight:bold;>Enter ImageBox's capacity&nbsp;&nbsp;</td>
	 <td align=left bgcolor=#e0e0e0>&nbsp;<?php 
$maxDirSize = zReadFile("icon/member_image_box/" . $no . "_maxsize.php");
if ($maxDirSize) {
    $maxDirSize = str_replace("<?/*", "", $maxDirSize);
    $maxDirSize = str_replace("*/?>", "", $maxDirSize);
    $maxDirSize = (int) ($maxDirSize / 1024);
} else {
    $maxDirSize = 100;
}
?>
<input type=input name=maxdirsize value="<?php 
echo $maxDirSize;
?>
" size=10 maxlength=20 class=input> KByte &nbsp; Enter ImageBox's capacity.</td>
  </tr>

  <tr height=22 align=center>