Exemple #1
0
<?php

/**
 * @file comments.php
 * Prints all comments for super users.
 */
if (isset($_GET["comments"])) {
    require_once "includes/functions.php";
    $commentName = $_GET["comments"];
    if (strpos($commentName, "comments_") !== false) {
        renderComments($commentName);
    } else {
        renderTable($commentName);
    }
    exit;
}
if (isset($_POST["postComment"])) {
    require_once "includes/functions.php";
    global $mysqli;
    $reply = $mysqli->real_escape_string(trim($_POST["postComment"]));
    $userID = $_POST["commentID"];
    $username = $_SESSION["username"];
    $tablename = "reply_" . $_POST["tablename"];
    $statement = $mysqli->prepare("INSERT INTO {$tablename} (comments_id, reply_comment, replied_by) VALUES (?, ?, ?)");
    $statement->bind_param("sss", $userID, $reply, $username);
    $statement->execute();
    $statement->store_result();
    renderComments($_POST["tablename"]);
    exit;
}
if (isset($_POST["commentID"])) {
function getFeed($feed_url, $type)
{
    // Type: Movie(0), TV(1), Animated(2)
    $content = file_get_contents($feed_url);
    $x = new SimpleXmlElement($content);
    $token = new \Tmdb\ApiToken('1e5387b55fe12efeb19db53ea9ca88a1');
    $client = new \Tmdb\Client($token);
    if ($type != 1) {
        $all_genres = $client->getGenresApi()->getGenres();
        $all_genres_ids = array();
        foreach ($all_genres['genres'] as $genre) {
            array_push($all_genres_ids, $genre['id']);
        }
        $current_ids = array();
        foreach ($x->channel->item as $entry) {
            /* @@ Modification for TMDB API @@ */
            $movie_title = $entry->title;
            $title = modifyTitle($movie_title);
            $result = $client->getSearchApi()->searchMovies($title);
            $movie = array_values($result)[1][0];
            /* @@ Check if result is found from TMDB API @@ */
            if (count($movie) > 0) {
                if (!in_array(intval($movie['id']), $current_ids)) {
                    array_push($current_ids, intval($movie['id']));
                } else {
                    continue;
                }
                /* @@ Title @@ */
                $original_title = shortenText($movie['original_title'], 40);
                /* @@ Plot (overview) @@ */
                $plot = shortenText($movie['overview'], 285);
                /* @@ Release year @@ */
                $released_year = substr($movie['release_date'], 0, 4);
                /* @@ Release year @@ */
                $genres = $movie['genre_ids'];
                $genre_string = getGenreString($genres, $all_genres_ids, $all_genres);
                $poster_url = "http://image.tmdb.org/t/p/w500/" . $movie['poster_path'];
                $backdrop_url = "http://image.tmdb.org/t/p/w500" . $movie['backdrop_path'];
                $content_url = "https://www.themoviedb.org/movie/" . $movie['id'];
                renderTable($original_title, $plot, $released_year, $genre_string, $poster_url, $backdrop_url, $content_url, $entry->link);
            } else {
                if ($type != 2) {
                    // Teiknimyndir eru oft á íslensku og þ.a.l. ekki á TMDB
                    $plot = "Ekki fundust upplýsingar um þessa mynd.<br>Titill hennar gæti verið stafsettur vitlaust.<br>Einnig gæti verið að þetta sé sjónvarsþáttur.";
                    renderTable($entry->title, $plot, null, null, null, null, null, $entry->link);
                }
            }
        }
    } else {
        // TV SHOWS
        foreach ($x->channel->item as $entry) {
            $tv_show_title = $entry->title;
            $tv_show_title = modifyTvShowTitle($tv_show_title);
            $result = $client->getSearchApi()->searchTv($tv_show_title);
            $tv_show = array_values($result)[1][0];
            if (count($tv_show) > 0) {
                $tv_show_title = $tv_show['name'];
                $tv_show_title .= ' ' . getEpisodeNumber($entry->title);
                $plot = shortenText($tv_show['overview'], 300);
                $released_year = substr($tv_show['first_air_date'], 0, 4);
                $genres = $tv_show['genre_ids'];
                $genre_string = getGenreString($genres, $all_genres_ids, $all_genres);
                $poster_url = "http://image.tmdb.org/t/p/w500/" . $tv_show['poster_path'];
                $backdrop_url = "http://image.tmdb.org/t/p/w500" . $tv_show['backdrop_path'];
                $content_url = "https://www.themoviedb.org/tv/" . $tv_show['id'];
                renderTable($tv_show_title, $plot, $released_year, $genre_string, $poster_url, $backdrop_url, $content_url, $entry->link);
            }
        }
    }
}
Exemple #3
0
    $render .= '<h2>IIS properties</h2>';
    if ($iis_properties) {
        renderTable($iis_properties);
    } else {
        $render .= "You are not running IIS web server.";
    }
    $render .= '<h2>PHP scripting language properties</h2>';
    renderTable($php_properties);
    $render .= '<h2>PHP security properties</h2>';
    renderTable($security);
    $render .= '<h2>MySQL Variables</h2>';
    renderTable($mysql_variables);
    $render .= '<h2>File Gallery Search Indexing</h2>';
    $render .= '<em>More info <a href="https://doc.tiki.org/Search+within+files">here</a></em>
	';
    renderTable($file_handlers);
    $render .= '<h2>PHP Info</h2>';
    if (isset($_REQUEST['phpinfo']) && $_REQUEST['phpinfo'] == 'y') {
        ob_start();
        phpinfo();
        $info = ob_get_contents();
        ob_end_clean();
        $info = preg_replace('%^.*<body>(.*)</body>.*$%ms', '$1', $info);
        $render .= $info;
    } else {
        $render .= '<a href="' . $_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['QUERY_STRING'] . '&phpinfo=y">Append phpinfo();</a>';
    }
    createPage('Tiki Server Compatibility', $render);
} elseif ($nagios) {
    //  0	OK
    //  1	WARNING
Exemple #4
0
 $synolo_for += $ret['foros'];
 $synolo_kath += $ret['kath'];
 if ($adeies) {
     $outPut .= "<h3>ΑΔΕΙΕΣ</h3>";
     foreach ($adeies as $ad) {
         $ret = renderTable($ad, $hdr);
         $outPut .= $ret['out'];
         $synolo_ap += $ret['apod'];
         $synolo_asf += $ret['asfal'];
         $synolo_for += $ret['foros'];
         $synolo_kath += $ret['kath'];
     }
 }
 if ($anadromika) {
     $outPut .= "<h3>ΑΝΑΔΡΟΜΙΚΑ</h3>";
     $ret = renderTable($anadromika, $hdr, 1);
     $outPut .= $ret['out'];
     $synolo_ap += $ret['apod'];
     $synolo_asf += $ret['asfal'];
     $synolo_for += $ret['foros'];
     $synolo_kath += $ret['kath'];
 }
 // if anadromika or adeies, print totals
 if ($anadromika || $adeies) {
     $outPut .= renderSynola($synolo_ap, $synolo_asf, $synolo_for, $synolo_kath);
 }
 $pdfOutput .= '<h3>' . $month . '</h3><br>' . $outPut . '<pagebreak />';
 echo $outPut;
 ?>
      </div>
      <?php 
Exemple #5
0
        }
    } else {
        $render .= 'You are either not running the preferred Apache web server or you are running PHP with a SAPI that does not allow checking Apache properties (e.g. CGI or FPM).';
    }
    $render .= '<h2>IIS properties</h2>';
    if ($iis_properties) {
        renderTable($iis_properties);
    } else {
        $render .= "You are not running IIS web server.";
    }
    $render .= '<h2>PHP scripting language properties</h2>';
    renderTable($php_properties);
    $render .= '<h2>PHP security properties</h2>';
    renderTable($security);
    $render .= '<h2>MySQL Variables</h2>';
    renderTable($mysql_variables);
    $render .= '<h2>PHP Info</h2>';
    if (isset($_REQUEST['phpinfo']) && $_REQUEST['phpinfo'] == 'y') {
        ob_start();
        phpinfo();
        $info = ob_get_contents();
        ob_end_clean();
        $info = preg_replace('%^.*<body>(.*)</body>.*$%ms', '$1', $info);
        $render .= $info;
    } else {
        $render .= '<a href="' . $_SERVER['SCRIPT_NAME'] . '?' . $_SERVER['QUERY_STRING'] . '&phpinfo=y">Append phpinfo();</a>';
    }
    createPage('Tiki Server Compatibility', $render);
} else {
    $smarty->assign_by_ref('server_information', $server_information);
    $smarty->assign_by_ref('server_properties', $server_properties);