예제 #1
0
 function Dispatcher()
 {
     // are we in test mode, or libray mode
     // then this file is just a library
     if (isset($_GET['test']) || isset($_GET['library'])) {
         // we unset in  order to use the dispatcher afterwards
         unset($_GET['test']);
         unset($_GET['library']);
         return;
     }
     // first we set the database (load from disk or parse the bibtex file)
     setDB();
     // is the publication list included in another page?
     // strtr is used for Windows where __FILE__ contains C:\toto and SCRIPT_FILENAME contains C:/toto :-(
     // 2010-07-01: bug found by Marco: on some installation these two variables contain backslashes
     if (strtr(__FILE__, "\\", "/") != strtr($_SERVER['SCRIPT_FILENAME'], "\\", "/")) {
         $this->wrapper = 'NoWrapper';
     }
     // first pass, we will exit if we encounter key or menu or academic
     // other wise we just create the $this->query
     foreach ($_GET as $keyword => $value) {
         if (method_exists($this, $keyword)) {
             // if the return value is END_DISPATCH, we finish bibtexbrowser (but not the whole PHP process in case we are embedded)
             if ($this->{$keyword}() == 'END_DISPATCH') {
                 return;
             }
         }
     }
     if (count($this->query) > 0) {
         // first test for inconsistent queries
         if (isset($this->query[Q_ALL]) && count($this->query) > 1) {
             // we discard the Q_ALL, it helps in embedded mode
             unset($this->query[Q_ALL]);
         }
         $this->selectedEntries = $_GET[Q_DB]->multisearch($this->query);
         // required for PHP4 to have this intermediate variable
         $x = new $this->displayer($this->selectedEntries, $this->query);
         new $this->wrapper($x);
     } else {
         // we send a redirection for having the frameset
         // if some contents have already been sent, for instance if we are included
         // this means doing nothing
         if (headers_sent() == false) {
             /* to avoid sending an unnecessary frameset */
             header("Location: " . $_SERVER['SCRIPT_NAME'] . "?frameset&bib=" . $_GET[Q_FILE]);
         }
     }
 }
예제 #2
0
파일: index.php 프로젝트: ou29jony/soccer
$DB = "dabuladze_playground";
$playground = mysql_select_db('dabuladze_playground', $link);
$maindoc = new DOMDocument();
$teams = null;
$rankingtable = array();
$rankingtableList = array();
$table1Arr = array();
$allTeamsUrl = array();
$allTeams = array();
$docs = array();
$html = "http://www.sfstats.net/soccer";
$maindoc->loadHTMLFile($html);
setHref();
setDocs();
setTeams();
setDB();
$time = getTime();
getResult();
show();
function show()
{
    $html2 = "https://www.tipico.com/de/online-sportwetten/";
    $maindoc2 = new DOMDocument();
    $maindoc2->loadHTMLFile($html2);
    $divs = $maindoc2->getElementsByTagName('div');
    for ($k = 0; $k < $divs->length; $k++) {
        echo "<br>" . $divs->item($k)->nodeValue;
    }
}
function setAllTable($doc)
{
예제 #3
0
 function main()
 {
     // are we in test mode, or libray mode
     // then this file is just a library
     if (isset($_GET['test']) || isset($_GET['library'])) {
         // we unset in  order to use the dispatcher afterwards
         unset($_GET['test']);
         unset($_GET['library']);
         return;
     }
     // first we set the database (load from disk or parse the bibtex file)
     if (!isset($_GET[Q_DB])) {
         setDB();
     }
     // is the publication list included in another page?
     // strtr is used for Windows where __FILE__ contains C:\toto and SCRIPT_FILENAME contains C:/toto (bug reported by Marco)
     // realpath is required if the path contains sym-linked directories (bug found by Mark Hereld)
     if (strtr(realpath(__FILE__), "\\", "/") != strtr(realpath($_SERVER['SCRIPT_FILENAME']), "\\", "/")) {
         $this->wrapper = BIBTEXBROWSER_EMBEDDED_WRAPPER;
     }
     // first pass, we will exit if we encounter key or menu or academic
     // other wise we just create the $this->query
     foreach ($_GET as $keyword => $value) {
         if (method_exists($this, $keyword)) {
             // if the return value is END_DISPATCH, we finish bibtexbrowser (but not the whole PHP process in case we are embedded)
             if ($this->{$keyword}() == 'END_DISPATCH') {
                 return;
             }
         }
     }
     // at this point, we may have a query
     if (count($this->query) > 0) {
         // first test for inconsistent queries
         if (isset($this->query[Q_ALL]) && count($this->query) > 1) {
             // we discard the Q_ALL, it helps in embedded mode
             unset($this->query[Q_ALL]);
         }
         $selectedEntries = $_GET[Q_DB]->multisearch($this->query);
         // default order
         uasort($selectedEntries, ORDER_FUNCTION);
         $selectedEntries = array_values($selectedEntries);
         //echo '<pre>';print_r($selectedEntries);echo '</pre>';
         if ($this->displayer == '') {
             $this->displayer = BIBTEXBROWSER_DEFAULT_DISPLAY;
         }
     }
     // otherwise the query is left empty
     // do we have a displayer?
     if ($this->displayer != '') {
         $options = array();
         if (isset($_GET['dopt'])) {
             $options = json_decode($_GET['dopt'], true);
         }
         // required for PHP4 to have this intermediate variable
         $x = new $this->displayer();
         if (method_exists($x, 'setEntries')) {
             $x->setEntries($selectedEntries);
         }
         if (method_exists($x, 'setTitle')) {
             $x->setTitle(query2title($this->query));
         }
         if (method_exists($x, 'setQuery')) {
             $x->setQuery($this->query);
         }
         // should call method display() on $x
         new $this->wrapper($x);
         $this->clearQuery();
     } else {
         // we send a redirection for having the frameset
         // if some contents have already been sent, for instance if we are included
         // this means doing nothing
         if (headers_sent() == false) {
             /* to avoid sending an unnecessary frameset */
             header("Location: " . $_SERVER['SCRIPT_NAME'] . "?frameset&bib=" . $_GET[Q_FILE]);
         }
     }
 }