Example #1
0
 function ejes_()
 {
     $ret = '';
     $s = htmlenc(@file_get_contents('http://titulares.ejes.com/titulares.cfm'));
     $tapas = array('Nación', 'Clarín', 'Página', 'Tiempo', 'Perfil', 'El País', 'Herald', 'Ámbito', 'Ambito', 'Cronista', 'BAE', 'Economista', 'Estadista');
     foreach ($tapas as $tapa) {
         $regex = '/img: \'([^\']*?)\'[^}]*' . $tapa . '/m';
         preg_match($regex, $s, $matches);
         if ($matches[1]) {
             $url = str_replace("_movil", "", $matches[1]);
             $url = str_replace("titulares.ejes.com/preview", "media.ejes.com/clipping", $url);
             $ret .= '<img src="' . $url . '" style="width:100%;"><br>';
         }
     }
     return $ret;
 }
Example #2
0
<?php

$description = "ライフハックサービス「メンタルエナジー」!決断を減らす、迷わない人生へ。";
$keyword = "メンタルエナジー,mentalenergy,ライフハック";
$siteTitle = "MentalEnergy";
$creator = "@mo4_9";
$ogp = "http://mental-energy.com/images/ogp.png";
$url = "http://mental-energy.com/";
?>

<!DOCTYPE html>
<html lang="ja">
<head>
	<meta charset="UTF-8">
	<title><?php 
echo htmlenc($title);
?>
</title>
	<meta name="description" content= <?php 
echo $description;
?>
 />
	<meta name="keywords" content= <?php 
echo $keyword;
?>
 />
	<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">

	<!-- twitter -->
	<meta name="twitter:card" content="summary">
	<meta name="twitter:title" content= <?php 
Example #3
0
if (!($until = strtotime($_POST['until']))) {
    fatal_error("het veld 'Zichtbaar vanaf' bevat geen geldige datum");
}
if (isset($_POST['bericht_id'])) {
    if ($_POST['submit'] == 'Opslaan') {
        // we wijzigen een bestaand bericht
        mdb2_exec("UPDATE berichten SET bericht_title = '%q', bericht_body = '%q', bericht_visiblefrom = '%q', bericht_visibleuntil = '%q', bericht_update = {$_SERVER['REQUEST_TIME']} WHERE bericht_id = %i", bbtohtml(htmlenc($_POST['title'])), bbtohtml(htmlenc($_POST['body'])), $from, $until, $_POST['bericht_id']);
        mdb2_exec("DELETE FROM entities2berichten WHERE bericht_id = %i", $_POST['bericht_id']);
        if (isset($_POST['entity_ids'])) {
            foreach ($_POST['entity_ids'] as $entity_id) {
                mdb2_exec("INSERT INTO entities2berichten ( entity_id, bericht_id ) VALUES ( %i, %i )", $entity_id, $_POST['bericht_id']);
            }
        }
    } else {
        if ($_POST['submit'] == 'Wissen') {
            mdb2_exec("DELETE FROM berichten WHERE bericht_id = %i", $_POST['bericht_id']);
            mdb2_exec("DELETE FROM entities2berichten WHERE bericht_id = %i", $_POST['bericht_id']);
        } else {
            fatal_error('onmogelijke submit!');
        }
    }
} else {
    mdb2_exec("INSERT INTO berichten ( bericht_title, bericht_body, bericht_visiblefrom, bericht_visibleuntil, bericht_update ) VALUES ( '%q', '%q', '%q', '%q', {$_SERVER['REQUEST_TIME']} )", bbtohtml(htmlenc($_POST['title'])), bbtohtml(htmlenc($_POST['body'])), $from, $until);
    $bericht_id = mdb2_last_insert_id();
    if (isset($_POST['entity_ids'])) {
        foreach ($_POST['entity_ids'] as $entity_id) {
            mdb2_exec("INSERT INTO entities2berichten ( entity_id, bericht_id ) VALUES ( %i, {$bericht_id} )", $entity_id);
        }
    }
}
header('Location: upload.php?secret=' . $_POST['secret']);
Example #4
0
 function __construct($url, $params = array())
 {
     $xml = in_array('xml', $params);
     $gcache = in_array('google_cache', $params);
     if ($gcache) {
         $url = google_cache($url);
     }
     $pre_t = microtime(true);
     $ctx = isset($params['post']) ? post_context($params['post']) : NULL;
     $source = @file_get_contents($url, false, $ctx);
     $this->html = new DOMDocument();
     $this->enc = isset($params['encoding']) ? $params['encoding'] : 'utf-8';
     if (!$xml) {
         @$this->html->loadhtml(htmlenc($source, $this->enc));
     } else {
         @$this->html->loadxml($source);
     }
     $this->xpath = new DOMXpath($this->html);
     $this->clean(in_array('clean_aside', $params));
     if (!in_array('silence', $params)) {
         echo $url . " " . (microtime(true) - $pre_t) . "<br>\n";
     }
 }
Example #5
0
function enccommabr($string)
{
    return implode('<br>', explode(',', htmlenc($string)));
}