Beispiel #1
0
echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n" . '<!--Google Site Map File Generated by http://xml-sitemap-generator.com/ ' . date("D, d M Y G:i:s T") . ' -->' . "\n" . '<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">' . "\n";
# if possible the script will writte on website a copy of generated sitemap
# start to writte generated sitemap
# Make sure you have writte permission to file sitemap_temp.xml
if ($fp = fopen("sitemap_temp.xml", "w")) {
    $open_file = 'sucess';
    fputs($fp, '<?xml version="1.0" encoding="UTF-8"?>' . "\n" . '<!--Google Site Map File Generated by http://xml-sitemap-generator.com/ ' . date("D, d M Y G:i:s T") . ' -->' . "\n" . '<urlset xmlns="http://www.google.com/schemas/sitemap/0.84">' . "\n");
}
# Log 404 Error Page Not Found
# Make sure you have writte access to file 404error.txt
if ($fp_err = fopen("404error.txt", "w")) {
    $open_file_404 = 'sucess';
}
$turl = "";
# Cycle through tree and build a url list
while ($turl = getNextUrl($turl)) {
    # Extend script time limit
    set_time_limit(3000);
    # Read html file into memory
    if ($html = file($turl)) {
        $html = stripslashes(implode($html));
        echo '<url>' . "\n\t" . '<loc>' . googlesitemap_compatible($turl) . '</loc>' . "\n";
        if ($lastmodification == true) {
            echo "\t" . '<lastmod>' . date("Y-m-d") . '</lastmod>' . "\n";
        }
        echo "\t" . '<changefreq>' . $frequency . '</changefreq>' . "\n\t" . '<priority>' . $priority . '</priority>' . "\n" . '</url>' . "\n";
        # Get site urls from html and add new unique url to list if needed
        addUrls(getUrls($turl, $html));
        #writte the same thing above on website if you have permission to writte
        if ($open_file == 'sucess') {
            fputs($fp, '<url>' . "\n\t" . '<loc>' . googlesitemap_compatible($turl) . '</loc>' . "\n");
Beispiel #2
0
    if (!empty($apikey) && !empty($authtoken)) {
        // desktop login
        echo "<rs:authorize uid='{$uid}' apikey='{$apikey}' authtoken='{$authtoken}' infinite='{$infinite}' />";
        echo "You have been authenticated succesfully. Close the browser and go back to your desktop application";
    } else {
        if (!empty($apikey)) {
            // app login
            $next = isset($_REQUEST['next']) ? $_REQUEST['next'] : null;
            $version = isset($_REQUEST['v']) ? $_REQUEST['v'] : "1.0";
            $canvas = isset($_REQUEST['canvas']) ? 'true' : 'false';
            $trust = isset($_REQUEST['trust']) ? 'true' : 'false';
            echo "<rs:authorize uid='{$uid}' apikey='{$apikey}' infinite='{$infinite}' trust='{$trust}' canvas='{$canvas}' next='{$next}'/>";
        } else {
            // web login
            $nextPage = isset($_REQUEST['next']) ? $_REQUEST['next'] : "index.php";
            $nextUrl = getNextUrl($nextPage);
            echo "<rs:authorize uid='{$uid}' infinite='{$infinite}' />";
            echo "<fb:redirect url='{$nextUrl}'/>";
        }
    }
}
/**
 * Authenticate a user.
 *
 * @param string $username
 * @param string $password
 * @return true if there were no errors and user was authenticated, error string if there was an error. 
 */
function authenticate($username, $password, $flavor)
{
    // Authenticate user.