Example #1
0
            $url = HtmlReplace($url);
            $upquery = "UPDATE `#@__member_flink` SET title='{$title}',url='{$url}' WHERE aid='{$aid}' AND mid='" . $cfg_ml->M_ID . "'; ";
            $rs = $dsql->ExecuteNoneQuery($upquery);
            if ($rs) {
                echo "<font color='red'>成功更新链接:{$title}</font>";
                GetLinkList($dsql);
                exit;
            } else {
                echo "<font color='red'>更新链接:{$title} 失败!</font>";
                GetLinkList($dsql);
                exit;
            }
        } else {
            if ($dopost == "reload") {
                AjaxHead();
                GetLinkList($dsql);
                exit;
            } else {
                require_once dirname(__FILE__) . "/templets/flink_main.htm";
                exit;
            }
        }
    }
}
/**
 *  获取链接列表
 *
 * @access    public
 * @param     object  $dsql  数据库操作类
 * @return    string
 */
            echo GetLinkList();
        } else {
            echo GetActionText('action failed');
            echo GetLinkList();
        }
    }
} elseif (!$demo_mode && 'delete' == $_GET['action']) {
    if (db_res("DELETE FROM `Links` WHERE `ID` = " . (int) $_GET['linkID'])) {
        echo GetActionText('link deleted successfully', 1);
        echo GetLinkList();
    } else {
        echo GetActionText('action failed');
        echo GetLinkList();
    }
} else {
    echo GetLinkList();
}
ContentBlockFoot();
BottomCode();
function GetLinkList()
{
    global $site;
    $link_query = "SELECT `ID`, `Title`, `URL`, `Description` FROM `Links`";
    $link_res = db_res($link_query);
    $link_count = db_arr("SELECT COUNT(ID) FROM `Links`");
    $link_count = $link_count['0'];
    $links_onpage = 10;
    $ret = '';
    $ret .= '<div class="linkAdd">';
    $ret .= '<a href="' . $site['url_admin'] . 'links.php?action=add">';
    $ret .= 'Add New Link';