Ejemplo n.º 1
0
function getStrLinks($homepage)
{
    $header = "cabecera-subtitulo";
    $versionS = '<div id="version" class="ssdiv">';
    $liIdioma = "<li class='li-idioma'>";
    $liLink = "<li class='descargar green'>";
    $pos = strpos($homepage, $header);
    if ($pos > 0) {
        $version = getBetween($homepage, $versionS, $versionS);
        $continue = true;
        $i = 0;
        $element = [];
        while ($continue) {
            $f = getBetween($version, $liIdioma, "</li>");
            $title = getBetween($f, "<strong>", "</strong>");
            $strTmp = str_replace('"', '', getBetween($version, $liLink, "</li>"));
            $link = getBetween($strTmp, 'href=', '>');
            $url = new Url($title, $link);
            array_push($element, $url);
            $version = substr($version, strpos($version, $liLink) + 2);
            $i += 1;
            if (strpos($version, $liIdioma) == false || $i == 10) {
                $continue = false;
            }
        }
    } else {
        if ($pos === false) {
            $j['error'] = "false";
            $json = json_encode($j);
            echo $json;
        }
    }
    $json = json_encode($element);
    echo "{$_GET['callback']}({$json})";
}
Ejemplo n.º 2
0
 function getPatreonUserID($url)
 {
     $remote = curl_get_file_contents($url);
     if ($remote == False) {
         return -1;
     }
     $html = str_get_html($remote);
     // Find all links
     foreach ($html->find('a') as $element) {
         $link = $element->href;
         if (strpos($link, '/user?u=') !== FALSE && strpos($link, '&ty=p') !== FALSE) {
             $id = getBetween($link, '/user?u=', '&ty=p');
             return $id;
         }
     }
 }
    <div class="large-12">
        <div class="panel" id="home_images">

		<?php 
$fields = array('Thumbnail', 'Order', 'URL');
$clause = new KORA_Clause('Section', '=', 'HighlightButton');
$results = KORA_Search(token, projectID, Section, $clause, $fields, array(array('field' => 'Order', 'direction' => SORT_ASC)));
foreach ($results as $result) {
    $localName = $result['Thumbnail']['localName'];
    $file = getFullURLFromFileName($localName);
    $image = getThumbURLFromFileName($localName);
    $image_button = "<div class='mali-image'><img width='335' height='188' src='{$file}' /></div>";
    //$button_URL = str_replace("/","",$result['URL']).".php";
    //$button_URL = str_replace("portofolio","portfolio",$button_URL);
    $arr = explode("/", $result['URL'], 2);
    if (getBetween($result['URL'], "/", "/")) {
        $button_URL = $arr[0] . ".php?name=";
        $button_URL .= getBetween($result['URL'], "/", "/");
    } else {
        $button_URL = $arr[0];
    }
    //$button_URL = array_filter($button_URL);
    echo "<a href='{$button_URL}'>{$image_button}</a>";
}
?>
        </div>
    </div>
</div>

<?php 
include_once 'footer.php';
Ejemplo n.º 4
0
$objFile = fopen($StrFilename, "r");
$xml = fread($objFile, filesize($StrFilename));
fclose($objFile);
// Break the xml data into an array
$ArrAQI = split("<item>", $xml);
// Print latest AQI
$StrLastUpdate = getBetween($ArrAQI[1], '<title>', '</title>');
$StrLatestAQI = getBetween($ArrAQI[1], '<AQI>', '</AQI>');
echo "<h1 style=\"" . getAQIColor($StrLatestAQI) . "\">" . $StrLatestAQI . " / " . getAPL($StrLatestAQI) . "</h1>\n";
echo "<em>Last update: " . $StrLastUpdate . " CST</em><br /><br />\n";
// Print last 24h AQI chart
echo "<strong>24 hours</strong><br />\n\n";
echo "<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"380\">\n";
for ($i = 1; $i <= 24; $i++) {
    $StrTime = strtotime(getBetween($ArrAQI[$i], '<title>', '</title>'));
    $StrAQI = getBetween($ArrAQI[$i], '<AQI>', '</AQI>');
    $intAQI = intval($StrAQI);
    $intLength = abs($intAQI / 1);
    if ($intLength > 330) {
        $intLength = 330;
    }
    echo "<tr>\n";
    echo "\t<td width=\"50\">" . date('g A', $StrTime) . "</td>\n";
    echo "\t<td width=\"330\"><div style=\"" . getAQIColor($StrAQI) . "width:" . $intLength . "px;\">" . $StrAQI . "</div></td>\n";
    echo "</tr>\n";
}
echo "</table>\n\n";
// Wrap up
echo "Server Time: <em>" . date('m/d/Y g:i:s A') . "</em><br />\n";
// Debug - Start
// Debug - End
Ejemplo n.º 5
0
    }
    $toAgent = getBetween($data, '<toAgentID>', '</toAgentID>');
    mysql_query("INSERT INTO `{$OMTN}` (uuid, message) VALUES ('{$toAgent}', '{$data}')") or die('<?xml version="1.0" encoding="utf-8"?><boolean>false</boolean>');
    echo '<?xml version="1.0" encoding="utf-8"?><boolean>true</boolean>';
    // Offline message stored.
    mysql_close($db);
} else {
    if ($method == '/RetrieveMessages/') {
        //Guid
        require_once 'config/database.php';
        $db = mysql_connect(HOST, USER, PASS);
        mysql_select_db(DB);
        if (mysql_num_rows(mysql_query("SHOW TABLES LIKE '{$OMTN}'")) <= 0) {
            mysql_query('CREATE TABLE IF NOT EXISTS `' . $OMTN . '` (`uuid` varchar(36) NOT NULL,`message` text NOT NULL, KEY `uuid` (`uuid`))');
        }
        $userID = getBetween($data, '<Guid>', '</Guid>');
        $query = @mysql_query("SELECT message FROM `{$OMTN}` WHERE uuid='{$userID}'");
        if (mysql_num_rows($query) > 0) {
            $array_messages = array();
            while ($row = mysql_fetch_array($query)) {
                $array_messages[] = $row['message'];
            }
            @mysql_query("DELETE FROM `{$OMTN}` WHERE uuid='{$userID}'");
        }
        mysql_close($db);
        echo '<?xml version="1.0" encoding="utf-8"?><ArrayOfGridInstantMessage xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">';
        if (isset($array_messages)) {
            echo implode('', $array_messages);
        }
        echo '</ArrayOfGridInstantMessage>';
    }
Ejemplo n.º 6
0
<?php

require_once './session_login.inc.php';
function getBetween($content, $start, $end)
{
    $r = explode($start, $content);
    if (isset($r[1])) {
        $r = explode($end, $r[1]);
        return $r[0];
    }
    return '';
}
$content = file_get_contents('http://158.108.207.113:55580/linfo/');
$getOS = getBetween($content, "OS", "Distribution");
$getDIS = getBetween($content, "Distribution", "Virtualization");
$getUPT = getBetween($content, "Uptime", ";");
$content2File = fopen("Sysinfo.temp", "w");
fwrite($content2File, $content);
fclose($content2File);
$getRAM = explode("/", trim(preg_replace('/([a-z]|A|L|[C-F]|[H-J]|L|[N-O]|[Q-S]|[U-Z]|<|>|=|"|:|;|Ph|To|_|\\t|\\n)/', '', shell_exec("grep -a -7 '<td>Physical</td>' /var/www/html/oak2/Sysinfo.temp"))));
$cutRAMPer = intval(substr($getRAM[11], 0, -1));
if ($cutRAMPer > 66) {
    $barRAMX = 33;
    $barRAMY = 33;
    $barRAMZ = $cutRAMPer - 66;
} elseif ($cutRAMPer > 33 && $cutRAMPer <= 66) {
    $barRAMX = 33;
    $barRAMY = $cutRAMPer - 33;
    $barRAMZ = 0;
} elseif ($cutRAMPer <= 33) {
    $barRAMX = $cutRAMPer;
            } else {
                $search .= $v . " ";
            }
        }
    }
    $fields = array('Title', 'Description');
    $clause = new KORA_Clause('Title', 'like', $search);
    $results = KORA_Search(token, projectID, Essays, $clause, $fields, array(array('field' => 'Order', 'direction' => SORT_ASC)));
    foreach ($results as $result) {
        $title = $result['Title'];
        $descriptions = $result['Description'];
        $descriptions = explode("\n", $descriptions);
        echo "<h2>" . $title . "</h2>";
        foreach ($descriptions as $description) {
            if (getBetween($description, "[", "]")) {
                $pic_kid = getBetween($description, "[", "]");
                $pic_kid = str_replace('PUTIMAGEHERE', '', $pic_kid);
                $pos_pic = array_search($pic_kid, $pics_kid);
                echo "<div class='about_imageContainer'>\n\t\t\t\t\t\t\t\t\t\t<img src='{$file[$pos_pic]}' width='1000' height='1000  style='vertical-align:left'/>\n\t\t\t\t\t\t\t\t\t\t\t<div class='about_caption'>\n\t\t\t\t\t\t\t\t\t\t\t\t<p><strong>{$pic_photographer[$pos_pic]}</strong> {$pic_title[$pos_pic]}</p>\n\t\t\t\t\t\t\t\t\t\t\t\t<p>{$pic_date_string[$pos_pic]} // {$pic_location[$pos_pic]}</p>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>";
                //var_dump($pic_kid);
                $text_desc = delete_all_between('[', ']', $description);
                echo "<p>" . $text_desc . "</p><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>";
            } else {
                echo "<p>" . $description . "</p>";
            }
        }
        if ($_GET['title'] == 'PhotographyinMali') {
            echo "<div class='about_imageContainer' id='map'>\n\t\t\t\t\t\t\t\t<a class='fancybox map' href='img/Mali-Map.png'><img src='img/Mali-Map.png' width='1009' height='757' alt='Map of Mali' /></a>\n\t\t\t\t\t\t\t\t<div class='about_caption'>\n\t\t\t\t\t\t\t\t\t<p>Click map to view fullscreen</p>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>";
        }
    }
}
Ejemplo n.º 8
0
dbconnect();
include 'include/checklogin.php';
include 'include/version.php';
function getBetween($content, $start, $end)
{
    $r = explode($start, $content);
    if (isset($r[1])) {
        $r = explode($end, $r[1]);
        return $r[0];
    }
    return '';
}
$url = 'https://raw.github.com/Fmstrat/odm-web/master/odm/include/version.php';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.0; S60/3.0 NokiaN73-1/2.0(2.0617.0.0.7) Profile/MIDP-2.0 Configuration/CLDC-1.1)");
$result = curl_exec($ch);
if ($result === FALSE) {
    die('Curl failed: ' . curl_error($ch));
}
curl_close($ch);
$cur_version = getBetween($result, '<?php $version = ', '; ?>');
if ((int) $cur_version > (int) $version) {
    echo "true";
} else {
    echo "false";
}
dbclose();
Ejemplo n.º 9
0
function readImageForText($filename)
{
    mysql_query("INSERT INTO `files` (`uid`, `name`) VALUES ('" . $_SESSION['uid'] . "', '" . $filename . "')");
    $url_listindexes = 'https://api.idolondemand.com/1/api/sync/ocrdocument/v1';
    $params1 = 'url=http://hackathon.gavalchin.com/live/uploads/' . $filename . '&mode=scene_photo&apikey=8e025234-2c19-4af9-b337-40803dfdd176';
    $response = file_get_contents($url_listindexes . '?' . $params1);
    $response = getBetween($response, '"text": "', '",');
    $response_formatted = str_replace('\\n', '<br>', $response);
    $response = str_replace('\\n', ' ', $response);
    $tags = explode(" ", $response);
    $fid = mysql_result(mysql_query("SELECT `fid` FROM `files` WHERE `uid` = '" . $_SESSION['uid'] . "' ORDER BY `uploadTime` DESC"), 0, 'fid');
    mysql_query("INSERT INTO `classFiles` (`cid`, `fid`) VALUES ('4', '" . $fid . "')");
    foreach ($tags as $tag) {
        mysql_query("REPLACE INTO `fileTags` (`fid` ,`tag`)VALUES ('" . $fid . "',  '" . $tag . "')");
    }
    return $response_formatted;
}
Ejemplo n.º 10
0
function getClassNamedFieldName($tempText, $num)
{
    $result = array();
    $jj = 0;
    do {
        $tempItem = trim(getBetween($tempText->find('a', $jj), '>', ' <span'));
        array_push($result, $tempItem);
        $jj++;
    } while (getBetween($tempText->find('a', $jj), '>', ' <span') != '');
    return $result;
}
Ejemplo n.º 11
0
<?php

header('content-type:text/html;charset="utf-8"');
error_reporting(0);
//ͷ��������Ϣ
//HoshinoTouko
//2015-10-02 18:20
//���ú���
include "../functions.php";
include "../config.php";
//����ͳ��
include "../analysis/analysis.php";
Analysis();
//==========================================================
$wordsForSearch = isset($_GET['words']) ? $_GET['words'] : null;
$words = getBetween($wordsForSearch, '{', '/');
$page = getBetween($wordsForSearch, '/', '}');
$url = 'http://nhentai.net/search/?q=' . $words . '&page=' . $page;
$galleryInfo = getGalleryInfo($url);
$temp = json_encode($galleryInfo, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);
echo urldecode($temp);