Example #1
0
        }
        $site = $db->get_one("select * from kuaso_sites where url='{$url}'");
        if (!empty($site)) {
            $row = $db->get_one("select * from kuaso_links where url='" . $url . "'");
            if (empty($row)) {
                AddAndUpdateUrl($url, "add");
            } else {
                AddAndUpdateUrl($url, "update");
            }
            //
            if ($oldurl != $url) {
                $row = $db->get_one("select * from kuaso_links where url='" . rtrim($oldurl, "/") . "'");
                if (empty($row)) {
                    AddAndUpdateUrl($oldurl, "add");
                } else {
                    AddAndUpdateUrl($oldurl, "update");
                }
            }
        }
        //
    }
    header("location:success.php");
}
function AddAndUpdateUrl($url, $action)
{
    global $db;
    $spider = new spider();
    $spider->url($url);
    $title = $spider->title;
    $fulltxt = $spider->fulltxt(800);
    $keywords = $spider->keywords;
Example #2
0
            $db->insert('ve123_sites', $array);
        }
        $site = $db->get_one("select * from ve123_sites where url='{$url}'");
        if (!empty($site)) {
            $row = $db->get_one("select * from ve123_links where url='" . $url . "'");
            if (empty($row)) {
                AddAndUpdateUrl($url, 'add');
            } else {
                AddAndUpdateUrl($url, 'update');
            }
            if ($oldurl != $url) {
                $row = $db->get_one("select * from ve123_links where url='" . rtrim($oldurl, '/') . "'");
                if (empty($row)) {
                    AddAndUpdateUrl($oldurl, 'add');
                } else {
                    AddAndUpdateUrl($oldurl, 'update');
                }
            }
        }
    }
    header('location:success.php');
}
function AddAndUpdateUrl($url, $action)
{
    global $db;
    $spider = new spider();
    $spider->url($url);
    $title = $spider->title;
    $fulltxt = $spider->fulltxt(800);
    $keywords = $spider->keywords;
    $description = $spider->description;