コード例 #1
0
ファイル: 1-add.php プロジェクト: shiooooooookun/Nouweo_PHP
 protected function main()
 {
     if (check_auth('manage_articles') || !is_logged_in()) {
         $this->set_title(Nw::$lang['press']['art_add']);
         $this->set_tpl('press/add.html');
         $this->add_css('forms.css');
         $this->add_js('write.js');
         $this->add_js('forms.js');
         // Fil ariane
         $this->set_filAriane(array(Nw::$lang['press']['mod_title'] => array('press.html'), Nw::$lang['press']['art_add'] => array('')));
         //Si on veut ajouter l'article
         if (isset($_POST['submit'])) {
             inc_lib('press/add_article');
             add_article($_SESSION['ident_session'], $_POST['paper'], $_POST['link'], $_POST['numero'], $_POST['country'], $_POST['contenu'], $_POST['date_pub']);
             redir(Nw::$lang['press']['redir_article_added'], true, 'press.html');
         }
     } else {
         redir(Nw::$lang['press']['error_cant_manage'], false, 'press.html');
     }
 }
コード例 #2
0
/* Check permissions for this feature */
if (!hesk_checkPermission('can_man_kb', 0)) {
    /* This person can't manage the knowledgebase, but can read it */
    header('Location: knowledgebase_private.php');
    exit;
}
/* Is Knowledgebase enabled? */
if (!$hesk_settings['kb_enable']) {
    hesk_error($hesklang['kbdis']);
}
/* This will tell the header to include WYSIWYG editor Javascript */
define('WYSIWYG', 1);
/* What should we do? */
if ($action = hesk_REQUEST('a')) {
    if ($action == 'add_article') {
        add_article();
    } elseif ($action == 'add_category') {
        add_category();
    } elseif ($action == 'manage_cat') {
        manage_category();
    } elseif ($action == 'edit_article') {
        edit_article();
    } elseif ($action == 'import_article') {
        import_article();
    } elseif ($action == 'list_private') {
        list_private();
    } elseif ($action == 'list_draft') {
        list_draft();
    } elseif (defined('HESK_DEMO')) {
        hesk_process_messages($hesklang['ddemo'], 'manage_knowledgebase.php', 'NOTICE');
    } elseif ($action == 'new_article') {
コード例 #3
0
ファイル: admin_create.php プロジェクト: Tiger66639/NewRbox
下一篇:<a href="http://' . $nexttagname . '.shuxianbiao.com/' . $nexttagname . '-product' . $nextid . '.html">' . $nexttagname . '</a>

</DIV></DIV></DIV></DIV></DIV></DIV></DIV></DIV>




<script type="text/javascript" src="http://js.tongji.cn.yahoo.com/759605/ystat.js"></script><noscript><a href="http://tongji.cn.yahoo.com"><img src="http://img.tongji.cn.yahoo.com/759605/ystat.gif"/></a></noscript>

</BODY></HTML>';
$contentall .= $bottom;
echo $contentall;
function add_article($filename, $news)
{
    $fh = fopen($filename, "w");
    $news = stripslashes($news);
    fwrite($fh, "{$news}");
    fclose($fh);
}
//$n=mt_rand(1,255);
$tagname = str_replace("/", "-", $tagname);
add_article("../{$tagname}-product{$tid}.html", $contentall);
$exec = "UPDATE " . $prefix . "tag SET htmled='1' WHERE id='{$tid}'";
$DB->db_query($exec);
?>
 <BR>


</span>
</body>
</html>
コード例 #4
0
ファイル: add_news.php プロジェクト: noskovgleb/conference
$data = array();
$image = $_FILES['articleimage'];
$sendnewsletter = $_POST['sendnewsletter'];
if ($_POST['title']) {
    if ($image) {
        $info = new SplFileInfo($image['name']);
        $image_id = add_image(array('name' => $image['name'], 'type' => $info->getExtension()));
        if ($image_id) {
            $uploads_dir = '../img/news-img/';
            $uploadfile = $uploads_dir . basename($image_id) . '.' . $info->getExtension();
            move_uploaded_file($image['tmp_name'], $uploadfile);
        }
    }
    $data['date_create'] = date('Y-m-d', time());
    $data['image_id'] = $image_id;
    $article_id = add_article($data);
    unset($data);
    $data['article_id'] = $article_id;
    $data['title'] = $_POST['title'];
    $data['addedby'] = $_POST['name'];
    $data['full_text'] = $_POST['article'];
    $lang_id = '';
    $lang = get_lang();
    $langradio = $_POST['languages'];
    foreach ($lang as $lk => $lv) {
        if ($lv['lang'] == $langradio) {
            $lang_id = $lv['id'];
        }
    }
    if ($lang_id) {
        $data['lang_id'] = $lang_id;
コード例 #5
0
            break;
        case "add_log":
            add_log($_GET);
            break;
        case "get_log":
            get_log($_GET);
            break;
        case "admin_updateDOI":
            admin_updateDOI($_GET);
            break;
    }
}
if (isset($_POST["action"])) {
    switch ($_POST["action"]) {
        case "add_article":
            add_article($_POST);
            break;
    }
}
function strip_cdata($str)
{
    return preg_replace('/<!\\[CDATA\\[(.*)\\]\\]>/', '$1', $str);
}
function user_register()
{
    global $dbname;
    global $connection;
    $username = mysqli_real_escape_string($connection, $_GET['username']);
    $password = md5(mysqli_real_escape_string($connection, $_GET['password']));
    $email = mysqli_real_escape_string($connection, $_GET['email']);
    $checkusername = mysqli_query($connection, "SELECT * FROM Users WHERE Username = '******'");
コード例 #6
0
ファイル: data.php プロジェクト: RandomEtc/apimaps
function add_point(&$C, $article_id, $woe_id)
{
    $added_article = add_article($C, $article_id);
    if (!$added_article) {
        die_with_code(400, "Article {$article_id} does not exist?\n");
    }
    $place = flickr_place_info($C, $woe_id);
    $q = sprintf("INSERT INTO points\n                      SET article_id = %d, woe_id = %d,\n                          latitude = %f, longitude = %f,\n                          place_id = %s, place_path = %s,\n                          place_type = %s, place_name = %s,\n                          visitor_id = %s, remote_addr = %s", $article_id, $place->woeid, $place->latitude, $place->longitude, $C->dbh->quoteSmart($place->place_id), $C->dbh->quoteSmart($place->place_url), $C->dbh->quoteSmart($place->place_type), $C->dbh->quoteSmart($place->name), $C->dbh->quoteSmart($C->visitor_id), $C->dbh->quoteSmart($_SERVER['REMOTE_ADDR']));
    $res = $C->dbh->query($q);
    if (PEAR::isError($res)) {
        // it already exists, so bail out
        if ($res->getCode() == DB_ERROR_ALREADY_EXISTS) {
            return false;
        }
        die_with_code(500, "{$res->message}\n{$q}\n");
    }
    $q = sprintf("UPDATE articles\n                      SET point_count = point_count + 1\n                      WHERE id = %d", $article_id);
    $res = $C->dbh->query($q);
    if (PEAR::isError($res)) {
        die_with_code(500, "{$res->message}\n{$q}\n");
    }
    add_log($C, "Added point article:{$article_id}, woe:{$woe_id}");
    return true;
}
コード例 #7
0
<?php

require_once "../includes/functions/functions.php";
require_once "../includes/functions/db_connection.php";
if (isset($_POST['submit'])) {
    $icon_link = upload_image("icon_image");
    if ($icon_link) {
        $link = $_POST['link'] . ".php";
        $result = add_article($_POST['title'], $_POST['article_type'], $_POST['article_tag'], $_POST['tile_css'], $link, $icon_link);
        if ($result) {
            $_POST = array();
            $update_confirmation = "<p class=\"update-confirmed\">Page updated successfully. Go to <a href=\"index.php\">Home page</a> to review.<p>";
        } else {
            $update_confirmation = "Adding article failed";
        }
    } else {
        $update_confirmation = "Update failed please check the values input";
    }
}
?>

<?php 
include "../includes/layouts/header.php";
?>


<div class="main">
	<div class="content container" id="main-section">
		<br><br>
		<h4>**Please view this page on IE10, Google Chrome or Mozilla Firefox only.</h2>
<div class="row">
コード例 #8
0
ファイル: brainspell.php プロジェクト: jbpoline/brainspell
     article($_GET["PMID"]);
     break;
 case "article_json_pmid":
     article_json_pmid($_GET["PMID"]);
     break;
 case "article_json_doi":
     article_json_doi($_GET["PMID"]);
     break;
 case "search_lucene":
     search_lucene($_GET["query"]);
     break;
 case "index_lucene":
     index_lucene($_GET);
     break;
 case "add_article":
     add_article($_GET);
     break;
 case "get_article":
     get_article($_GET);
     break;
 case "get_concept":
     get_concept($_GET);
     break;
 case "add_log":
     add_log($_GET);
     break;
 case "get_log":
     get_log($_GET);
     break;
 case "admin_updateDOI":
     admin_updateDOI($_GET);