コード例 #1
0
function v_showIcon($aid)
{
    if ($aid === 'root') {
        $albums = p_iconFolder();
        foreach ($albums as $a) {
            if ($a['albumpub'] === '1') {
                if ($a['albumpass'] === null) {
                    echo '<div id="f' . $a['AID'] . '" draggable="true"><a href="javascript:void(0)" onclick="loadIcon(' . $a['AID'] . ',true)"><img src="system/image/folderPub.png">' . $a['albumname'] . '</a></div>';
                } else {
                    echo '<div id="f' . $a['AID'] . '" draggable="true"><a href="javascript:void(0)" onclick="loadLock(' . $a['AID'] . ',true)"><img src="system/image/folderLock.png">' . $a['albumname'] . '</a></div>';
                }
            } else {
                echo '<div id="f' . $a['AID'] . '" draggable="true"><a href="javascript:void(0)" onclick="loadIcon(' . $a['AID'] . ',true)"><img src="system/image/folderPri.png">' . $a['albumname'] . '</a></div>';
            }
        }
    } else {
        echo '<div id="back"><a href="javascript:void(0)" onclick="loadIcon(0)"><img src="system/image/back.png">回首頁</a></div>';
        $albumData = p_albumData($aid);
        if ($albumData[1] === 1) {
            $pictures = p_iconPicture($aid);
            if ($pictures) {
                foreach ($pictures as $p) {
                    echo '<div id="p' . $p['PID'] . '"><a href="javascript:void(0)"><img id="sp' . $p['PID'] . '" onclick="showpic(' . $p['PID'] . ')" src="' . $albumData['albumpath'] . '/' . $p['picname'] . '">' . $p['picname'] . '</a></div>';
                }
            }
        } else {
            if ($albumData[1] === 2) {
                echo '<div id="pe"><a href="javascript:void(0)"><img src="system/image/error.png">無法進入(locked album)</a></div>';
            } else {
                if ($albumData[1] === 3) {
                    if (isLogin() === true) {
                        $pictures = p_iconPicture($aid);
                        if ($pictures) {
                            foreach ($pictures as $p) {
                                echo '<div id="p' . $p['PID'] . '"><a href="javascript:void(0)"><img id="sp' . $p['PID'] . '" onclick="showpic(' . $p['PID'] . ')" src="' . $albumData['albumpath'] . '/' . $p['picname'] . '">' . $p['picname'] . '</a></div>';
                            }
                        }
                    } else {
                        echo '<div id="pe"><a href="javascript:void(0)"><img src="system/image/error.png">無法進入(not login)</a></div>';
                    }
                } else {
                    if ($albumData[1] === -1) {
                        die('a');
                        echo '<div id="pe"><a href="javascript:void(0)"><img src="system/image/error.png">無法進入(' . $aid . 'album not exist)</a></div>';
                    }
                }
            }
        }
    }
}
コード例 #2
0
function v_showLockedIcon($aid, $albumpass)
{
    echo '<div id="back"><a href="javascript:void(0)" onclick="loadIcon(0)"><img src="system/image/back.png">回首頁</a></div>';
    $albumData = p_albumData($aid);
    if ($albumData[1] === 2) {
        if (p_checkAlbumpass($aid, $albumpass)) {
            $pictures = p_iconPicture($aid);
            if ($pictures) {
                foreach ($pictures as $p) {
                    echo '<div id="p' . $p['PID'] . '"><a href="javascript:void(0)"><img id="sp' . $p['PID'] . '" onclick="showpic(' . $p['PID'] . ')" src="' . $albumData['albumpath'] . '/' . $p['picname'] . '">' . $p['picname'] . '</a></div>';
                }
            }
        } else {
            echo '<div id="pe"><a href="javascript:void(0)"><img src="system/image/error.png">無法進入(correct password)</a></div>';
        }
    } else {
        echo '<div id="pe"><a href="javascript:void(0)"><img src="system/image/error.png">無法進入(album type error)</a></div>';
    }
}