123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442 |
- <?php
- define('ABSOLUTE_SCRIPT_PATH','/full/path/to/dir');
- if ((!isset($relative_script_path)) || (($relative_script_path != ".") &&
- ($relative_script_path != "..") && ($relative_script_path != ABSOLUTE_SCRIPT_PATH))) {
-
- exit();
- }
- if ((isset($_SERVER['SCRIPT_FILENAME'])) && (eregi("config.php",$_SERVER['SCRIPT_FILENAME']))) {
- exit();
- }
- if ((isset($_SERVER['SCRIPT_URI'])) && (eregi("config.php",$_SERVER['SCRIPT_URI']))) {
- exit();
- }
- if ((isset($_SERVER['SCRIPT_URL'])) && (eregi("config.php",$_SERVER['SCRIPT_URL']))) {
- exit();
- }
- if ((isset($_SERVER['REQUEST_URI'])) && (eregi("config.php",$_SERVER['REQUEST_URI']))) {
- exit();
- }
- if ((isset($_SERVER['SCRIPT_NAME'])) && (eregi("config.php",$_SERVER['SCRIPT_NAME']))) {
- exit();
- }
- if ((isset($_SERVER['PATH_TRANSLATED'])) && (eregi("config.php",$_SERVER['PATH_TRANSLATED']))) {
- exit();
- }
- if ((isset(api_get_self())) && (eregi("config.php",api_get_self()))) {
- exit();
- }
- define('PHPDIG_VERSION','1.8.6');
- $phpdig_language = "en";
- if (!isset($phpdig_language)) { $phpdig_language = "en"; }
- define('PHPDIG_ADM_AUTH','1');
- define('PHPDIG_ADM_USER','admin');
- define('PHPDIG_ADM_PASS','secret');
- if (isset($_REQUEST['template_demo'])) { $template_demo = $_REQUEST['template_demo']; }
- $templates_array = array('black.html','bluegrey.html','corporate.html','green.html','grey.html','lightgreen.html','linear.html','newspaper.html','phpdig.html','simple.html','terminal.html','yellow.html','gaagle.html');
- if(isset($template_demo) && in_array($template_demo, $templates_array)) {
- $template = "$relative_script_path/templates/$template_demo";
- } else {
- $template = "$relative_script_path/templates/phpdig.html";
- }
- $template = "array";
- if (($template != "array") && ($template != "classic")) {
- $template_demo = substr($template,strrpos($template,"/")+1);
- } else {
- $template_demo = "";
- }
- define('HIGHLIGHT_BACKGROUND','#FFBB00');
-
- define('HIGHLIGHT_COLOR','#000000');
-
- define('LINK_TARGET','_blank');
- define('WEIGHT_IMGSRC','./tpl_img/weight.gif');
- define('WEIGHT_HEIGHT','5');
- define('WEIGHT_WIDTH','50');
- define('SEARCH_PAGE','search.php');
- define('DISPLAY_DROPDOWN',true);
- define('DROPDOWN_URLS',true);
- define('SUMMARY_DISPLAY_LENGTH',700);
- define('SNIPPET_DISPLAY_LENGTH',150);
- define('DISPLAY_SNIPPETS',true);
- define('DISPLAY_SNIPPETS_NUM',4);
- define('DISPLAY_SUMMARY',false);
- define('PHPDIG_DATE_FORMAT','\1-\2-\3');
-
-
- define("END_OF_LINE_MARKER","\r\n");
- define('SEARCH_BOX_SIZE',15);
- define('SEARCH_BOX_MAXLENGTH',50);
- define('PHPDIG_ENCODING','iso-8859-1');
-
-
- $phpdig_string_subst['iso-8859-1'] = 'A:ÀÁÂÃÄÅ,a:àáâãäå,O:ÒÓÔÕÖØ,o:òóôõöø,E:ÈÉÊË,e:èéêë,C:Ç,c:ç,I:ÌÍÎÏ,i:ìíîï,U:ÙÚÛÜ,u:ùúûü,Y:Ý,y:ÿý,N:Ñ,n:ñ';
- $phpdig_string_subst['iso-8859-2'] = 'A:ÁÂÄá,C:ÇÆÈ,D:ÏÐ,E:ÉËÊÌ,I:ÍÎ,L:Å¥£,N:ÑÒ,O:ÓÔÖÕ,R:ÀØ,S:¦ª©,T:Þ«,U:ÚÜÙÛ,Y:Ý,Z:¬¯®,a:áâäã±,c:çæè,d:ïð,e:éëêì,i:íî,l:åµ³,n:ñò,o:óôöõ,r:àø,s:¶º¹,t:þ»,u:úüùû,y:ý,z:¼¿¾';
- $phpdig_string_subst['iso-8859-6'] = 'Q:Q,q:q';
- $phpdig_string_subst['iso-8859-7'] = 'á:Á¶Ü,â:Â,ã:Ã,ä:Ä,å:ŸÝ,æ:Æ,ç:Þǹ,è:è,é:ßúɺ,ê:Ê,ë:Ë,ì:Ì,í:Í,î:Î,ï:ü¼Ï,ð:Ð,ñ:Ñ,ó:Óò,ô:Ô,õ:ýûÕ¾,ö:Ö,÷:×,ø:Ø,ù:þÙ¿';
- $phpdig_string_subst['tis-620'] = 'Q:Q,q:q';
- $phpdig_string_subst['windows-1251'] = 'À:à,Á:á,Â:â,Ã:ã,Ä:ä,Å:å,Æ:æ,Ç:ç,È:è,É:é,Ê:ê,Ë:ë,Ì:ì,Í:í,Î:î,Ï:ï,Ð:ð,Ñ:ñ,Ò:ò,Ó:ó,Ô:ô,Õ:õ,Ö:ö,×:÷,Ø:ø,Ù:ù,Ú:ú,Û:û,Ü:ü,Ý:ý,Þ:þ,ß:ÿ';
- $phpdig_words_chars['iso-8859-1'] = '[:alnum:]ðþßµ';
- $phpdig_words_chars['iso-8859-2'] = '[:alnum:]ðþßµ';
- $phpdig_words_chars['iso-8859-6'] = '[:alnum:]¤¬»¿ÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚàáâãäåæçèéêëìíîïðñò';
- $phpdig_words_chars['iso-8859-7'] = '[:alnum:]ÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÓÔÕÖ×ØÙ¢¸¹º¼¾¿ÚÛáâãäåæçèéêëìíîïðñóôõö÷øùÜÝÞßüýþúûÀà';
- $phpdig_words_chars['tis-620'] = '[:alnum:]¡¢£¤¥¦§¨©ª«¬_®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÜßàáâãäåæçèéêëìíîïðñòóôõö÷øùúû';
- $phpdig_words_chars['windows-1251'] = '[:alnum:]ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ';
- define('SEARCH_DEFAULT_MODE','start');
- define('SEARCH_DEFAULT_LIMIT',10);
- define('SPIDER_MAX_LIMIT',20);
- define('RESPIDER_LIMIT',5);
- define('LINKS_MAX_LIMIT',20);
- define('RELINKS_LIMIT',5);
- define('LIMIT_TO_DIRECTORY',true);
- define('LIMIT_DAYS',0);
- define('SMALL_WORDS_SIZE',2);
- define('MAX_WORDS_SIZE',50);
- define('PHPDIG_EXCLUDE_COMMENT','<!-- phpdigExclude -->');
- define('PHPDIG_INCLUDE_COMMENT','<!-- phpdigInclude -->');
-
-
-
- define('PHPDIG_DEFAULT_INDEX',false);
-
-
- define('ALLOW_RSS_FEED',false);
- $theenc = PHPDIG_ENCODING;
- $theurl = "http://www.phpdig.net/";
- $thetitle = "PhpDig.net";
- $thedesc = "PhpDig :: Web Spider and Search Engine";
- $thedir = "./rss";
- $thefile = "search.rss";
- define('PHPDIG_SESSID_REMOVE',true);
- define('PHPDIG_SESSID_VAR','PHPSESSID,s');
-
- define('APPEND_TITLE_META',false);
- define('TITLE_WEIGHT',3);
- define('CHUNK_SIZE',1024);
- define('SUMMARY_LENGTH',500);
- define('TEXT_CONTENT_PATH','text_content/');
- define('CONTENT_TEXT',0);
-
- define('PHPDIG_IN_DOMAIN',false);
-
-
- define('PHPDIG_LOGS',true);
- define('SILENCE_404S',true);
- define('TEMP_FILENAME_LENGTH',8);
- define('NUMBER_OF_RESULTS_PER_SITE',-1);
-
- define('USE_RENICE_COMMAND','1');
- define('USE_IS_EXECUTABLE_COMMAND','0');
- define('PHPDIG_INDEX_MSWORD',false);
- define('PHPDIG_PARSE_MSWORD','/usr/local/bin/catdoc');
- define('PHPDIG_OPTION_MSWORD','-s 8859-1');
- define('PHPDIG_INDEX_PDF',false);
- define('PHPDIG_PARSE_PDF','/usr/local/bin/pstotext');
- define('PHPDIG_OPTION_PDF','-cork');
- define('PHPDIG_INDEX_MSEXCEL',false);
- define('PHPDIG_PARSE_MSEXCEL','/usr/local/bin/xls2csv');
- define('PHPDIG_OPTION_MSEXCEL','');
- define('PHPDIG_INDEX_MSPOWERPOINT',false);
- define('PHPDIG_PARSE_MSPOWERPOINT','/usr/local/bin/ppt2text');
- define('PHPDIG_OPTION_MSPOWERPOINT','');
- define('PHPDIG_MSWORD_EXTENSION','');
- define('PHPDIG_PDF_EXTENSION','');
- define('PHPDIG_MSEXCEL_EXTENSION','');
- define('PHPDIG_MSPOWERPOINT_EXTENSION','');
- define('FTP_ENABLE',0);
- define('FTP_HOST','<ftp host>');
- define('FTP_PORT',21);
- define('FTP_PASV',1);
- define('FTP_PATH','<path to phpdig directory>');
- define('FTP_TEXT_PATH','text_content');
- define('FTP_USER','<ftp usename>');
- define('FTP_PASS','<ftp password>');
- define('CRON_ENABLE',false);
- define('CRON_EXEC_FILE','/usr/bin/crontab');
- define('CRON_CONFIG_FILE',ABSOLUTE_SCRIPT_PATH.'/admin/temp/cronfile.txt');
- define('PHPEXEC','/usr/local/bin/php');
- define('BANNED','^ad\.|banner|doubleclick');
- define('FORBIDDEN_EXTENSIONS','\.(rm|ico|cab|swf|css|gz|z|tar|zip|tgz|msi|arj|zoo|rar|r[0-9]+|exe|bin|pkg|rpm|deb|bz2)$');
- $spec = array( "&" => "&",
- "à" => "à",
- "è" => "è",
- "ù" => "ù",
- "ó" => "ó",
- "é" => "é",
- "î" => "î",
- "ô" => "ô",
- "û" => "û",
- "ê" => "ê",
- "ç" => "ç",
- "œ" => "oe",
- ">" => " ",
- "<" => " ",
- "°" => " ",
- "&apos" => "'",
- """ => " ",
- "â" => "â",
- "ï" => "ï",
- "ë" => "ë",
- "ä" => "ä",
- "Ä" => "Ä",
- "Ë" => "Ë",
- "Ï" => "Ï",
- "Ü" => "Ü",
- "ö" => "ö",
- "ü" => "ü",
- " " => " ",
- "ß" => "ß",
- "í" => "í",
- "®" => " ",
- "©" => " ",
- "á" => "á",
- "Á" => "Á",
- "ð" => "ð",
- "Ð" => "Ð",
- "É" => "É",
- "Í" => "Í",
- "Ó" => "Ó",
- "ú" => "ú",
- "Ú" => "Ú",
- "Þ" => "Þ",
- "þ" => "þ",
- "Ö" => "Ö",
- "æ" => "æ",
- "&AELIG" => "Æ",
- "å" => "å",
- "Å" => "Å",
- "ø" => "ø",
- "Ø" => "Ø"
- );
- $month_names = array ('jan'=>1,
- 'feb'=>2,
- 'mar'=>3,
- 'apr'=>4,
- 'may'=>5,
- 'jun'=>6,
- 'jul'=>7,
- 'aug'=>8,
- 'sep'=>9,
- 'oct'=>10,
- 'nov'=>11,
- 'dec'=>12
- );
- $apache_indexes = array ( "?N=A" => 1,
- "?N=D" => 1,
- "?M=A" => 1,
- "?M=D" => 1,
- "?S=A" => 1,
- "?S=D" => 1,
- "?D=A" => 1,
- "?D=D" => 1,
- "?C=N&O=A" => 1,
- "?C=M&O=A" => 1,
- "?C=S&O=A" => 1,
- "?C=D&O=A" => 1,
- "?C=N&O=D" => 1,
- "?C=M&O=D" => 1,
- "?C=S&O=D" => 1,
- "?C=D&O=D" => 1);
- define('PHPDIG_LANG_CONSTANT',$phpdig_language);
- if (is_file("$relative_script_path/locales/$phpdig_language-language.php")) {
- include "$relative_script_path/locales/$phpdig_language-language.php";
- }
- elseif (is_file("$relative_script_path/locales/en-language.php")) {
- include "$relative_script_path/locales/en-language.php";
- }
- else {
- die("Unable to select language pack.\n");
- }
- if ((!isset($no_connect)) || ($no_connect != 1)) {
- if (is_file("$relative_script_path/includes/connect.php")) {
- include "$relative_script_path/includes/connect.php";
- }
- else {
- die("Unable to find connect.php file.\n");
- }
- }
- if (is_file("$relative_script_path/libs/phpdig_functions.php")) {
- include "$relative_script_path/libs/phpdig_functions.php";
- }
- else {
- die ("Unable to find phpdig_functions.php file.\n");
- }
- if (is_file("$relative_script_path/libs/function_phpdig_form.php")) {
- include "$relative_script_path/libs/function_phpdig_form.php";
- }
- else {
- die ("Unable to find function_phpdig_form.php file.\n");
- }
- if (is_file("$relative_script_path/libs/mysql_functions.php")) {
- include "$relative_script_path/libs/mysql_functions.php";
- }
- else {
- die ("Unable to find mysql_functions.php file.\n");
- }
- if ((!isset($template)) || ((!is_file($template)) && ($template != "array") && ($template != "classic"))) {
- die ("Unable to render template file.\n");
- }
- if (!defined('CONFIG_CHECK')) {
- exit();
- }
- phpdigCreateSubstArrays($phpdig_string_subst);
- if (!headers_sent()) {
- header('Content-type:text/html; Charset='.PHPDIG_ENCODING);
- }
- @ini_set('magic_quotes_runtime',false);
- @ini_set('magic_quotes_sybase',false);
- if ((!isset($no_connect)) || ($no_connect != 1)) {
- phpdigCheckTables($id_connect,array('engine',
- 'excludes',
- 'keywords',
- 'sites',
- 'spider',
- 'tempspider',
- 'logs',
- 'clicks',
- 'site_page',
- 'includes'));
- }
- ?>
|