示例#1
0
<?php

require 'global.php';
headhtml();
echo '<div class="nav" style="display:;"><a href="?">首页</a><a href="?action=addform&p_cid=';
echo $p_cid;
echo '">添加</a></div>
';
$action = $_GET['action'];
switch ($action) {
    case 'saveform':
        saveform();
        break;
    case 'addform':
        addform($action);
        break;
    case 'modify':
        addform($action);
        break;
    case 'del':
        $db->query("delete from ve123_dh_goodlinks where link_id='" . intval($_GET['link_id']) . "'");
        break;
}
echo '<table width="100%" border="0" cellpadding="3" cellspacing="1" class="tablebg">

  <tr>
    <th width="50">ID</th>
    <th>分类名称</th>
    <th width="80">操作</th>
  </tr>
  ';
示例#2
0
    }
    echo '<br style="clear: both;" />' . "\n";
    echo '</div>' . "\n";
}
function snyggve_get_latest()
{
    $query = 'SELECT id, title FROM snyggve ORDER by ID DESC LIMIT 12';
    $result = mysql_query($query) or die(report_sql_error($query, __FILE__, __LINE__));
    while ($data = mysql_fetch_assoc($result)) {
        $items[] = $data;
    }
    return $items;
}
if ($_GET['action'] == 'upload' && login_checklogin()) {
    $identifier = displace_image();
    saveform($identifier);
} elseif ($_GET['action'] == 'save' && login_checklogin()) {
    $id = saveimage();
    jscript_location('?action=view_image&image_id=' . $id);
} elseif ($_GET['action'] == 'view_image') {
    $user = view_image($_GET['image_id']);
    if (!view_album($user)) {
        echo '<h2>Senast uppladdat till Snyggve</h2>' . "\n";
        snyggve_list_items(snyggve_get_latest());
    }
    if (login_checklogin()) {
        uploadform();
    }
} elseif ($_GET['action'] == 'view_user' && is_numeric($_GET['user_id'])) {
    snyggve_intro();
    view_album($_GET['user_id'], 'fulhack');