コード例 #1
0
function addLink($newLink, $newSite)
{
    if (!empty($newLink)) {
        if (strpos($newLink, "http://") !== 0 && strpos($newLink, "https://") !== 0 && strpos($newLink, "ftp://") !== 0) {
            $newLink = "http://" . $newLink;
        }
        empty($newSite) && ($newSite = $newLink);
        global $cfg;
        addNewLink($newLink, $newSite);
        AuditAction($cfg["constants"]["admin"], "New " . _LINKS_MENU . ": " . $newSite . " [" . $newLink . "]");
    }
    header("location: admin.php?op=editLinks");
}
コード例 #2
0
/**
 * addLink
 */
function admin_addLink()
{
    global $cfg;
    $newLink = tfb_getRequestVarRaw('newLink');
    $newSite = tfb_getRequestVarRaw('newSite');
    if (!empty($newLink)) {
        if (strpos($newLink, "http://") !== 0 && strpos($newLink, "https://") !== 0 && strpos($newLink, "ftp://") !== 0) {
            $newLink = "http://" . $newLink;
        }
        empty($newSite) && ($newSite = $newLink);
        addNewLink($newLink, $newSite);
        AuditAction($cfg["constants"]["admin"], "New " . $cfg['_LINKS_MENU'] . ": " . addslashes($newSite) . " [" . addslashes($newLink) . "]");
    }
    @header("location: admin.php?op=editLinks");
    exit;
}