Esempio n. 1
0
function printHeader($id)
{
    $art = getArticle($id);
    $text = $art['article'];
    $part = substr($text, 0, 300);
    echo '<div class="article_header">';
    echo '<a href="/articles/' . $id . '.php">';
    echo '<p>' . $part . '...</p></a>';
    echo '</div>';
}
Esempio n. 2
0
function common_articleImageDownload()
{
    global $userid, $user_nastavnik, $user_student, $conf_files_path, $user_siteadmin;
    $predmet = intval($_REQUEST['predmet']);
    $ag = intval($_REQUEST['ag']);
    $projekat = intval($_REQUEST['projekat']);
    $articleID = intval($_REQUEST['a']);
    $authorID = intval($_REQUEST['u']);
    $imageName = $_GET['i'];
    if ($predmet <= 0 || $projekat <= 0 || $authorID <= 0 || $ag <= 0 || $articleID <= 0) {
        //hijack attempt?
        zamgerlog("korisnik u{$userid} pokusao pristupiti modulu common/articleImageDownload sa ID predmeta  ili ID projekta ili ID autora slike ili ag ili clanak koji nije integer ili je <=0", 3);
        zamgerlog2("neispravni parametri", $predmet, $ag, $projekat, "{$authorID}, {$articleID}");
        return;
    }
    if ($user_nastavnik && !$user_siteadmin) {
        $q10 = myquery("select nivo_pristupa from nastavnik_predmet where nastavnik={$userid} and predmet={$predmet} and akademska_godina={$ag}");
        if (mysql_num_rows($q10) < 1 || mysql_result($q10, 0, 0) < 1) {
            zamgerlog("common/projektneStrane privilegije (predmet pp{$predmet})", 3);
            zamgerlog2("nije saradnik na predmetu", $predmet, $ag);
            biguglyerror("Nemate pravo ulaska u ovu grupu!");
            return;
        }
    }
    require_once "lib/projekti.php";
    if ($user_student && !$user_siteadmin) {
        $actualProject = getActualProjectForUserInPredmet($userid, $predmet, $ag);
        if ($actualProject[id] != $projekat) {
            //user is not in this project in this predmet...hijack attempt?
            zamgerlog("korisnik u{$userid} pokusao pristupiti modulu common/articleImageDownload i projektu na kojem nije prijavljen ID={$projekat} na predmetu p{$predmet}", 3);
            zamgerlog2("nije na projektu", $projekat);
            biguglyerror("Nemate pravo ulaska u ovu grupu!");
            return;
        }
    }
    $imageName = strip_tags($imageName);
    $imageName = trim($imageName);
    $article = getArticle($articleID);
    if (empty($article) || ($article['osoba'] != $authorID || $article['slika'] != $imageName || $article['projekat'] != $projekat)) {
        zamgerlog("korisnik u{$userid} pokusao pristupiti modulu common/articleImageDownload sa losim authorID, imageName, projekat ili ID clanka", 3);
        zamgerlog2("clanak se ne poklapa sa projektom", $articleID, $projekat);
        return;
    }
    $lokacijaclanaka = "{$conf_files_path}/projekti/clanci/{$projekat}/" . $article['osoba'] . "/";
    $filepath = $lokacijaclanaka . $article['slika'];
    $type = `file -bi '{$filepath}'`;
    header("Content-Type: {$type}");
    header('Content-Length: ' . filesize($filepath));
    echo file_get_contents($filepath);
}
Esempio n. 3
0
			quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
			consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
			cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
			proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
				<div class="a-title">
				<?php 
$article = getArticle($_GET["id"], $connect);
?>
					<?php 
echo $article['title'];
?>
				</div>
				<div class="a-cont">
				
				<?php 
$article = getArticle($_GET["id"], $connect);
?>
					<?php 
echo $article['content'];
?>
				</div>
			</div>
			<div class="clear"></div>
		</div>
		</div>		
		<hr>
		<div id="footer">
			<p>2015</p>
			<div class="logo_f"><img src="img/logo.png"></div>
			<a href="#header">Вверх</a>
		</div>
Esempio n. 4
0
    $results2 = $conn->query($query);
    if (mysqli_num_rows($results1) >= 1 or mysqli_num_rows($results2) >= 1) {
        return true;
    } else {
        return false;
    }
}
function getArticle($conn)
{
    //Fetch article, display to user.
    $query = "SELECT * FROM `articles_enabled` ORDER BY RAND() LIMIT 1";
    $result = $conn->query($query);
    foreach ($result as $rec) {
        return $rec;
    }
}
$str = json_encode(getArticle($conn));
echo $str;
$size = ob_get_length();
header("Content-Length: {$size}");
ob_end_flush();
// Strange behaviour, will not work
flush();
// Unless both are called !
ob_end_clean();
$array = getTitles();
foreach ($array as $rec) {
    if (!articleExists($rec, $conn)) {
        addArticle($rec, $conn);
    }
}
Esempio n. 5
0
<?php

include '../../settings.php';
include '../../inc/login_functions.php';
include '../../inc/helper.php';
include 'functions.php';
$logedIn = access($mysqli);
/* Berechtigung den Artikel zu bearbeiten */
if (isset($_GET['article'])) {
    $articleId = trim(htmlentities($_GET['article'], ENT_QUOTES, "UTF-8"));
    $articleId = $mysqli->real_escape_string($articleId);
    $article = getArticle($mysqli, $articleId);
    if ($article['userId'] != $_SESSION['userId']) {
        header("Location: ../../404.php");
        exit;
    }
}
$result = updateArticle($mysqli, $articleId);
include '../../inc/header.php';
include "../../inc/topNavbar.php";
?>

<section id="main-container">

	<?php 
include "../../inc/leftNavbar.php";
?>
	
	<!--Page main section start-->
  	<section id="min-wrapper">
    	<div id="main-content">
Esempio n. 6
0
<?php

session_start();
require_once "config.php";
require_once "config_user.php";
$dbh = connectDb();
if (empty($_SESSION["name"])) {
    header("Location:login.php");
} else {
    $posting = getArticle($dbh);
}
?>
<!DOCTYPE html>
<html lang="ja">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<link rel="stylesheet" href="css/common.css">
</head>
<body>

	<nav>
		<h1><a href="index.php">South East Asia press</a></h1>
		<div id="login">
		<form action="logout.php" method="POST">
			<p>こんにちは<?php 
echo $_SESSION["name"];
?>
さん</p>
			<input type="submit" name="logout" value="logout">
			</table>
Esempio n. 7
0
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
 * DAMAGE.
 */
require_once 'includes/config.php';
$data = array();
$error = false;
$title = 'Could Not Find Article';
$id = -1;
if (isset($_GET['id'])) {
    $id = (int) safeString($_GET['id']);
    $data = getArticle($id);
    $title = 'News: ' . ucwords($data[0]['title']);
}
if ($id == -1 || $id == "") {
    $error = true;
}
$smarty->assign('error', $error);
$smarty->assign('data', $data[0]);
$smarty->assign('user', $session->getUser());
$smarty->assign('title', $title);
$smarty->assign('content', $smarty->fetch('news.tpl'));
$smarty->display('skeleton.tpl');
Esempio n. 8
0
<?php

require __DIR__ . '/../../../vendor/autoload.php';
use Nostromo\Models\MConnexion;
function getArticle($id)
{
    $conn = MConnexion::getBdd();
    $resultats = $conn->prepare('SELECT * FROM article WHERE numArt = ?');
    $resultats->execute([$id]);
    $resultats->setFetchMode(PDO::FETCH_OBJ);
    return $resultats->fetch();
}
$article = getArticle($_GET['id']);
header('Content-Type: application/json');
echo utf8_encode(json_encode(['result' => $article]));
Esempio n. 9
0
function showAnyArticleGUI($articleid)
{
    $article = getArticle($article);
    printArticleGUI($article);
}
Esempio n. 10
0
        <input type="text" name="title" value="<?php 
echo getArticleTitle($article);
?>
"/>
    </p>
    <p>
        <label for="intro">Body:</label>
        <textarea id="intro" name="intro"><?php 
echo getArticleIntro($article);
?>
</textarea>
    </p>
    <p>
        <label for="body">Article:</label>
        <textarea id="body" name="body"><?php 
echo getArticle($article);
?>
</textarea>
    </p>
<?php 
if ($article) {
    ?>
    <input type="hidden" name="article" value="<?php 
    echo $article;
    ?>
" />
<?php 
}
?>
    <button name="save" type="submit">Save</button>
</form>
Esempio n. 11
0
function deleteArticle($id)
{
    global $conf_files_path;
    $entry = getArticle($id);
    $query = sprintf("DELETE FROM bl_clanak WHERE id='%d' LIMIT 1", intval($id));
    $result = myquery($query);
    if (mysql_affected_rows() == 0) {
        return false;
    }
    if ($entry[slika] != '') {
        $lokacijaclanaka = "{$conf_files_path}/projekti/clanci/" . $entry['projekat'] . '/' . $entry['osoba'] . '/';
        if (!unlink($lokacijaclanaka . $entry['slika'])) {
            return false;
        }
    }
    return true;
}
Esempio n. 12
0
        $topicLocal = $row['local'];
        $topicID = (int) $row['id'];
    }
    $fp = fopen($filestr, "w");
    if (!$fp) {
        echo $filestr;
        return;
    } else {
        $content = '<html><head><title>' . $title . '</title><meta http-equiv=Content-Type content="text/html;charset=utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-status-bar-style" content="black"><meta name="format-detection" content="telephone=no"><link href="../articles.css" type="text/css" rel="stylesheet"></head><body><div class="topic"><span class="current"><a href="/">首页</a> › <a href="../index.php">普世教会</a> › <a href="../index.php?topic=' . $topicID . '">' . $topicName . '</a></span><h1 class="topic-title">' . $title . '</h1></div><div class="content">' . get_inner_html($content2) . '</div><br/><br/><a class="src" href="' . $link . '">>>>原始文章</a></body><script type="text/javascript" language="javascript" src="/include/googleanalysis.js"></script><script type="text/javascript" language="javascript" src="http://cathassist.org/include/common.js"></script><script type="text/javascript">document.addEventListener("DOMContentLoaded", function(){SetWechatShare("' . $title . '","' . ROOT_WEB_URL . 'vaticanacn/' . $filestr . '","' . $imgurl . '","' . $title . '");});</script></html>';
        fwrite($fp, $content);
        $result = mysql_query('insert into vaticanacn (title,src,local,time,cate,picurl) values ' . '("' . mysql_real_escape_string($title) . '","' . mysql_real_escape_string($link) . '","' . mysql_real_escape_string($filestr) . '",curdate(),' . $topicID . ',"' . mysql_real_escape_string($imgurl) . '");');
    }
    fclose($fp);
}
//	getArticle("http://zh.radiovaticana.va/articolo.asp?c=727740","title",'articles/123.html');
//	return;
libxml_use_internal_errors(true);
$rssurl = "http://zh.radiovaticana.va/rssarticoli.asp";
$rsscontent = file_get_contents($rssurl);
$rss = simplexml_load_string($rsscontent);
$channel = $rss->channel;
for ($i = count($channel->item) - 1; $i >= 0; $i--) {
    $item = $channel->item[$i];
    $filestr = 'articles/' . md5($item->link) . '.html';
    $result = mysql_query('select id from vaticanacn where local="' . $filestr . '";');
    if (mysql_num_rows($result) < 1) {
        $ititle = trim($item->title);
        getArticle($item->link, $ititle, $filestr);
        echo '<a href="' . ROOT_WEB_URL . 'vaticanacn/' . $filestr . '">' . $item->title . '</a></br><br/>';
    }
}
Esempio n. 13
0
    foreach ($arr as $key => $value) {
        echo "<h2 style='color:red;'>{$key}分类</h2>";
        $typeid = $key;
        /* 副栏目号 */
        $typeid2 = '';
        $base_url = 'http://www.juexiang.com/list/' . $value;
        for ($i = 6; $i <= 8; $i++) {
            $list_url = $base_url . '?p=' . $i;
            $items = getArcticleList($list_url);
            echo "<h3>第{$i}页</h3>";
            foreach ($items as $k => $v) {
                $id = $v['id'];
                console("获取到id号:{$id}");
                myFlush();
                sleep(1);
                $obj = getArticle('detail/' . $id);
                console("获取到文档信息:{$id}");
                $obj['typeid'] = $typeid;
                $obj['typeid2'] = $typeid2;
                sleep(0);
                $info = htmlToText(postToDede($obj)) . "\r\n";
                console("执行结果:{$info}");
                echo '<hr/>';
                myFlush();
            }
            /* 防盗链设置,虽然可能没有效果 */
            sleep(3);
        }
    }
}
/**
Esempio n. 14
0
function showArticle()
{
    global $SUBS, $PARAM;
    ////----[Mrasnika's] Edition 20.10.2002
    if (!($SUBS['MATERIAL'] = getArticle($PARAM['id'], week()))) {
        frontPage();
        return;
    }
    $SUBS['MORE'] = getStatia(1);
    index('_index_show.htmlt');
}
   $list->free();

   // Read XML file (if necessary)
   if (sizeof($paths) > 0) {
      if ($debug) print "Parsing file $data[0]/$data[1] (" . sizeof($paths) . ")\n";
      $pos = $pos_mws = 0;
      $nb_passages = array();
      $stack = array(array("",array(),0,false));
      $xml_parser = xml_parser_create();
      $last_was_ws = false;
      xml_set_element_handler($xml_parser, "startElement", "endElement");
      xml_set_character_data_handler($xml_parser, "cdata");
      xml_parser_set_option($xml_parser,XML_OPTION_CASE_FOLDING,false);
      xml_parser_set_option($xml_parser,XML_OPTION_SKIP_WHITE,false);
      if (function_exists("getArticle")) {
         $fp = getArticle("$data[0]","$data[1]");
      } else
         $fp = fopen("$xml_documents/$data[0]/$data[1].xml", "r");
      
      if (!$fp)
         die("could not open XML input");
      while ($chars = fread($fp, 4096)) {
         if (!xml_parse($xml_parser, $chars, feof($fp))) {
            die(sprintf("XML error ($xml_documents/$data[0]/$data[1].xml): %s at line %d, column %d in [$chars]\n",
                        xml_error_string(xml_get_error_code($xml_parser)),
                        xml_get_current_line_number($xml_parser),
                        xml_get_current_column_number($xml_parser)));
         }
      }
      xml_parser_free($xml_parser);
   }
Esempio n. 16
0
$getArt = $mysqli->query("SELECT * FROM articles WHERE userId = '" . $_SESSION['userId'] . "'");
if ($getArt->num_rows == 0) {
    echo '<a class="btn btn-danger" href="' . PROJECT_HTTP_ROOT . '/sites/Article/createArticle.php?code=1">Post schreiben</a>';
} else {
    echo '<a class="btn btn-danger" href="' . PROJECT_HTTP_ROOT . '/sites/Article/createArticle.php">Post schreiben</a>';
}
?>
                <!--Top header end -->    
              </div>
            </div>

            <?php 
// empfohlener Artikel
$articleId = match($mysqli, $userId);
if ($articleId != false) {
    $artData = getArticle($mysqli, $articleId);
    echo '<div class="row" id="accountArt">';
    echo '<div class="col-md-12">';
    echo "<em><u>dieser Post könnte dich interessieren:</u></em>";
    echo "<a class='accArtLink' href='" . PROJECT_HTTP_ROOT . "/" . $articleId . "'><h1>" . $artData['title'] . "</h1></a>";
    echo "<div class='showArt'>";
    echo strip_tags(substr($artData['article'], 0, 800), "<a><p><h1><h2><h3><h4><h5><em><strong><u><span>");
    echo " ... <a href='" . PROJECT_HTTP_ROOT . "/" . $articleId . "'><strong>Weiter</strong></a>";
    echo "</div>";
    echo '</div>';
    echo '</div>';
} else {
    echo "<br>";
}
?>