function indexscreen($url, $reindex)
{
    global $db_con, $mysql_table_prefix, $real_log, $debug, $conv_puny, $cyrillic, $curl, $include_dir;
    /*
            if ($conv_puny && strstr($url, "xn--")) {
                require_once "$include_dir/idna_converter.php";
                // Initialize the converter class
                $IDN = new idna_convert(array('idn_version' => 2008));
                // Decode it to its readable presentation
                $url = $IDN->decode($url);
            }
    */
    $url = urldecode($url);
    //  get it readable
    if ($cyrillic) {
        $url = to_utf8($url);
        //  because of the bug in PHP function urldecode() we need special processing for CP1252 charset
    }
    $compurl = parse_url("" . $url);
    //  we will need all details of the URL
    //  https scheme requires cURL extension
    if (!$curl && $compurl['scheme'] == "https") {
        $message = "<p class='msg cntr'><br /><br /><span class='warnadmin'>Sorry, but in order to index URLs containing the https scheme,<br />you need to install the cURL extension on your server.</span><br /><br /><br /></p>";
        echo "{$message}";
        addsiteform();
        exit;
    }
    $check = "";
    $levelchecked = 'checked="checked"';
    $spider_depth = 2;
    if ($url == "") {
        $url = "http://";
        $url_crypt = "";
    } else {
        //      prepare the URL for multiple & and + as part of the URL
        $url_crypt = str_replace("&", "-_-", $url);
        //  crypt the & character
        $url_crypt = str_replace("+", "_-_", $url_crypt);
        //  crypt the + character
        $url_crypt = htmlentities($url_crypt, ENT_QUOTES);
        $url_ent = htmlentities($url, ENT_QUOTES);
        $advurl = $url;
        $sql_query = "SELECT spider_depth, required, disallowed, can_leave_domain, use_prefcharset from " . $mysql_table_prefix . "sites " . "where url='{$url_ent}'";
        $result = $db_con->query($sql_query);
        if ($result->num_rows) {
            $row = $result->fetch_array(MYSQLI_NUM);
            $spider_depth = $row[0];
            if ($spider_depth == -1) {
                $fullchecked = 'checked="checked"';
                $spider_depth = "";
                $levelchecked = "";
            }
            $must = $row[1];
            $mustnot = $row[2];
            $canleave = $row[3];
            $use_pref = $row[4];
        }
    }
    echo "<br />\n            ";
    if ($must != "" || $mustnot != "" || $canleave == 1 || $use_pref) {
        $_SESSION['index_advanced'] = 1;
    }
    if ($_SESSION['index_advanced'] == 1) {
        echo "<form class='cntr sml' action='admin.php' method='post'>\n                    <input type='hidden' name='f' value='index' />\n                    <input type='hidden' name='adv' value='0' />\n                    <input type='hidden' name='url' value='{$url_crypt}' />\n                    <input class='cntr sbmt' type='submit' id='submit' value='&nbsp;Hide advanced options&nbsp;' title='Click to hide the advanced options in this menue' />\n                    </form>\n                ";
    } else {
        echo "<form class='cntr sml' action='admin.php' method='post'>\n                    <input type='hidden' name='f' value='index' />\n                    <input type='hidden' name='adv' value='1' />\n                    <input type='hidden' name='url' value='{$url_crypt}' />\n                    <input class='cntr sbmt' type='submit' id='submit' value='&nbsp;Show advanced options&nbsp;' title='Click to show all the advanced options in this menue' />\n                    </form>\n                ";
    }
    echo "<br />\n                <div class='panel w75'>\n                <form class='txt' action='spider.php' method='post'>\n                <fieldset><legend>[ Basic Indexing Options ]</legend>\n                <label class='em' for='url'>Address:</label>\n                <input type='text' name='url' id='url' size='68' maxlength='1024' title='Enter new URL' value='{$url_crypt}' />\n                <label class='em' for='soption'>Spidering options:</label>\n                <input type='radio' name='soption' id='soption' title='Check box for Full indexing' value='full' {$fullchecked} /> Full<br />\n                <input type='radio' name='soption' value='level' title='Check box to limit indexing depth' {$levelchecked} />\n                Index depth:\n                <input type='text' name='maxlevel' size='2' title='Enter indexing depth level' value='{$spider_depth}' />\n            ";
    if ($reindex == 1) {
        $check = 'checked="checked"';
    }
    echo "<label class='em' for='reindex'>Re-index</label>\n                <input type='checkbox' name='reindex' id='reindex' title='Check box to Re-index' value='1' {$check} /> Check to Re-index\n                </fieldset>\n            ";
    if ($_SESSION['index_advanced'] == 1) {
        if ($canleave == 1) {
            $checkcan = 'checked="checked"';
        }
        if ($use_pref == 1) {
            $use_pref = 'checked="checked"';
        }
        echo "<fieldset><legend>[ Advanced Indexing Options ]</legend>\n                    <label class='em' for='can_leave'>Spider can leave domain?</label>\n                    <input type='checkbox' name='can_leave' id='can_leave' value='1' title='Check box if Sphider can leave above domain' {$checkcan} /> Check for Yes\n                    <label class='em' for='use_pref'>Use preferred charset for indexing?</label>\n                    <input type='checkbox' name='use_pref' id=use_pref'' value='1' title='Check box if Sphider should use the preferred charset as defined in \"Settings\"' {$use_pref} /> Check for Yes\n                    <label class='em' for='reindex'>robots.txt</label>\n                    <input type='hidden' name='not_use_robot' value='0' />\n                    <input type='checkbox' name='not_use_robot' value='1' {$not_use_robot} /> Temporary ignore 'robots.txt'\n                    <label class='em' for='nofollow'>'nofollow' tags</label>\n                    <input type='hidden' name='not_use_nofollow' value='0' />\n                    <input type='checkbox' name='not_use_nofollow' value='1' {$not_use_nofollow} /> Temporary ignore 'nofollow' directive\n                    </fieldset>\n                    <fieldset><legend>[ Include/Exclude Options ]</legend>\n                    <label class='em' for='in'>URL Must include:</label>\n                    <textarea name='in' id='in' cols='35' rows='5' title='Enter URLs that Must be included, one per line'>{$must}</textarea>\n                    <label class='em' for='out'>URL must Not include:</label>\n                    <textarea name='out' id='out' cols='35' rows='5' title='Enter URLs that must Not be included, one per line'>{$mustnot}</textarea></fieldset>\n                ";
    }
    echo "<fieldset><legend>[ Start Indexing ]</legend>\n            ";
    if ($real_log == '1') {
        echo "\n                    <input class='cntr sbmt' type='submit' id='submit' value='&nbsp;Start&nbsp;' title='Click to start indexing process' onclick=\"window.open('real_log.php')\" />\n                ";
    } else {
        echo "\n                    <input class='cntr sbmt' type='submit' id='submit' value='&nbsp;Start&nbsp;' title='Click to start indexing process' />\n                ";
    }
    echo "\n                </fieldset>\n                </form>\n                </div>\n            ";
}
Exemple #2
0
     list_cats(0, 0, "white");
     break;
 case index:
     if (!isset($url)) {
         $url = "";
     }
     if (!isset($reindex)) {
         $reindex = "";
     }
     if (isset($adv)) {
         $_SESSION['index_advanced'] = $adv;
     }
     indexscreen($url, $reindex);
     break;
 case add_site:
     addsiteform();
     break;
 case clean:
     cleanForm();
     break;
 case 15:
     cleanKeywords();
     break;
 case 16:
     cleanLinks();
     break;
 case 17:
     cleanTemp();
     break;
 case statistics:
     if (!isset($type)) {