当前位置: 首页>>代码示例>>PHP>>正文


PHP articles_get函数代码示例

本文整理汇总了PHP中articles_get函数的典型用法代码示例。如果您正苦于以下问题:PHP articles_get函数的具体用法?PHP articles_get怎么用?PHP articles_get使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了articles_get函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: action_show

 public function action_show()
 {
     $id = (int) $_GET['id'];
     if (!$id) {
         die("Не верный id");
     }
     $article = articles_get($id);
     $this->title .= '::Просмотр статьи';
     $this->content = template('v/v_article.php', array('article' => $article));
 }
开发者ID:MironovVS,项目名称:PHP-2_ht_6,代码行数:10,代码来源:C_Editor.php

示例2: action_edit

function action_edit()
{
    global $link;
    if (!isset($_GET['id'])) {
        header("Location: index.php");
    }
    $id = (int) $_GET['id'];
    if (!empty($_POST) && $id > 0) {
        articles_edit($link, $id, $_POST['title'], $_POST['date'], $_POST['content']);
        header("Location:index.php");
    }
    $article = articles_get($link, $id);
    require "../views/article_admin.php";
}
开发者ID:sd-design,项目名称:php-simple-blog,代码行数:14,代码来源:index.php

示例3: articles_new

    $action = "";
}
if ($action == "add") {
    if (!empty($_POST)) {
        articles_new($link, $_POST['title'], $_POST['date'], $_POST['content']);
        header("Location: index.php");
    }
    include "../views/article_admin.php";
} else {
    if ($action == "edit") {
        if (!isset($_GET['id'])) {
            header("Location: index.php");
        }
        $id = (int) $_GET['id'];
        if (!empty($_POST) && $id > 0) {
            articles_edit($link, $id, $_POST['title'], $_POST['date'], $_POST['content']);
            header("Location: index.php");
        }
        $article = articles_get($link, $id);
        include "../views/article_admin.php";
    } else {
        if ($action == 'delete') {
            $id = $_GET['id'];
            $article = articles_delete($link, $id);
            header("Location: index.php");
        } else {
            $articles = articles_all($link);
            include "../views/articles_admin.php";
        }
    }
}
开发者ID:MrRakitov,项目名称:GB-EZBlog,代码行数:31,代码来源:index.php

示例4: db_connect

<?php

require_once "database.php";
require_once "models/articles.php";
$link = db_connect();
$article = articles_get($link, $_GET['id']);
include "views/article.php";
开发者ID:2late2heal,项目名称:hello_world,代码行数:7,代码来源:article.php

示例5: startup

<?php

require_once 'startup.php';
require_once 'model.php';
//подключаемся к бд
startup();
// Определяем переменные для шаблона
$id_article = $_GET['id'];
$error = false;
$article = articles_get($id_article);
$title = $article['title'];
$content = $article['content'];
// Обработка отправки формы
if (!empty($_POST) && isset($_POST['title']) && isset($_POST['content'])) {
    // успешно данные добавлены, редирект
    if (articles_edit($id_article, $_POST['title'], $_POST['content'])) {
        die(header('Location: editor.php'));
    }
    $title = $_POST['title'];
    $content = $_POST['content'];
    $error = true;
}
// кодировку
header('Content-type: text/html; charset=utf-8');
// вывод в шаблон
include 'theme/edit.php';
开发者ID:Cannabiscat,项目名称:lessonPhp2,代码行数:26,代码来源:edit.php

示例6: elseif

} elseif (!empty($_POST['catid'])) {
    $catid =& $_POST['catid'];
} else {
    $catid = 0;
}
if (!empty($_GET['id'])) {
    $id =& $_GET['id'];
} elseif (!empty($_POST['id'])) {
    $id =& $_POST['id'];
} else {
    $id = 0;
}
/*********************************************************************************
* Article output                                                                 *
*********************************************************************************/
if (!empty($catid) && !empty($id) && ($article = articles_get($catid, $id, true, 2, $work_dir))) {
    $article['cat_data'] = articles_get_category($catid, false, $work_dir);
    /* If user posting a comment */
    if (!empty($_POST['comtext'])) {
        articles_post_comment($catid, $id, $_POST['comtext'], $work_dir);
    }
    /* If admin deleting comment */
    if (isset($_POST['cdelete']) && $system->checkForRight('A-MA')) {
        articles_delete_comment($catid, $id, $_POST['cdelete'], $work_dir);
    }
    /* Let's view selected article */
    $window_title = '<a href="./index.php?module=' . $module . $work_dir_suffix . '">' . $lang['articles']['categories'] . '</a> -&gt; ';
    $window_title .= '<a href="./index.php?module=' . $module . '&id=' . $article['cat_data']['id'] . $work_dir_suffix . '">' . (strlen($article['cat_data']['title']) > 20 ? substr($article['cat_data']['title'], 0, 20) . '...' : $article['cat_data']['title']) . '</a> -&gt; ';
    $window_title .= strlen($article['title']) > 20 ? substr($article['title'], 0, 20) . '...' : $article['title'];
    $system->config['pagename'] = $lang['pages']['articles'] . ' - ' . $article['title'];
    $system->showModuleWindow($window_title, rcms_parse_module_template('article.tpl', $article), 'center');
开发者ID:BackupTheBerlios,项目名称:reloadcms-svn,代码行数:31,代码来源:index.php

示例7: articles_all

 if ($action == "edit") {
     if (!isset($_GET['id'])) {
         $articles = articles_all($link);
         include $dir . "views/articles_admin.php";
     } else {
         $id = (int) $_GET['id'];
         if (!empty($_POST) && $id > 0) {
             articles_edit($link, $id, $_POST['title']);
             $articles = articles_get($link, $id);
             header("Location: articles.php?id_category=" . $articles['categories_id']);
         }
     }
 } else {
     if ($action == "edit-form") {
         $id_article = (int) $_GET['id'];
         $articles = articles_get($link, $id_article);
         $querystr = "action=edit&id=" . $id_article;
         $title_icon = '<span class="icon-bookmark banners"></span>';
         $title_form = 'Редактирование статьи:';
         require_once "../views/header.php";
         include $dir . "views/article_admin.php";
         require_once "../views/footer.php";
     } else {
         if ($action == "add-form") {
             $title_icon = '<span class="icon-bookmark banners"></span>';
             $title_form = 'Добавление статьи:';
             $querystr = "action=add&id_category=" . $_GET['id_category'];
             require_once "../views/header.php";
             include $dir . "views/article_admin.php";
             require_once "../views/footer.php";
         } else {
开发者ID:Garik228,项目名称:Blog,代码行数:31,代码来源:articles.php

示例8: articles_new

    $action = '';
}
if ($action == 'add') {
    if (!empty($_POST)) {
        articles_new($link, $_POST['title'], $_POST['date'], $_POST['content']);
        header("Location: index.php");
    }
    include "../Views/article_admin.php";
} else {
    if ($action == 'delete') {
        $id = $_GET['id'];
        $articles = articles_delete($link, $id);
        header("Location: index.php");
    } else {
        if ($action == 'edit') {
            if (!isset($_GET['id'])) {
                header("Location: index.php");
            }
            $id = (int) $_GET['id'];
            if (!empty($_POST) && $id > 0) {
                articles_edit($link, $id, $_POST['title'], $_POST['date'], $_POST['content']);
                header("Location: index.php");
            }
            $article = articles_get($id, $link);
            include "../Views/article_admin.php";
        } else {
            $articles = articles_all($link);
            include "../Views/articles_admin.php";
        }
    }
}
开发者ID:eIIIKuHKoT,项目名称:git-repo,代码行数:31,代码来源:index.php

示例9: startup

<?php

require_once 'startup.php';
require_once 'model.php';
// подключаемся к БД
startup();
$article = articles_get($_GET['id']);
// var_dump($article);
// кодировку
header('Content-type: text/html; charset=utf-8');
// вывод в шаблон
include 'theme/article.php';
开发者ID:Cannabiscat,项目名称:lessonPhp2,代码行数:12,代码来源:article.php

示例10: articles_parse_list

function articles_parse_list($level = 0, $parse = true, $dir = ARTICLES_PATH)
{
    if (file_exists($dir . '0.last')) {
        $result = array();
        $file = file($dir . '0.last');
        for ($i = 0; $i < count($file); $i++) {
            $file[$i] = preg_replace('/[\\n\\r]*/', '', $file[$i]);
            $file[$i] = explode('.', $file[$i], 2);
            if ($article = articles_get($file[$i][0], $file[$i][1], $parse, $level, $dir)) {
                $result[] = $article;
            }
        }
        return $result;
    } else {
        return array();
    }
}
开发者ID:BackupTheBerlios,项目名称:reloadcms-svn,代码行数:17,代码来源:articles.php

示例11: articles_get

<?php

require_once "database.php";
require_once "models/articles.php";
$article = articles_get('id');
include "views/article.php";
开发者ID:Bulatov-T,项目名称:my_first_blog,代码行数:6,代码来源:article.php

示例12: db_connect

<?php

require_once "database.php";
require_once "models/articles.php";
$link = db_connect();
$article = articles_get($link, $_GET["id"]);
require_once "views/article.php";
开发者ID:mopase,项目名称:php_blog,代码行数:7,代码来源:articles.php

示例13: rcms_showAdminMessage

    }
    rcms_showAdminMessage($lang['results']['articles'][$res]);
}
/******************************************************************************
* Interface                                                                   *
******************************************************************************/
$categories_list = articles_get_categories_list(true, false, $work_dir);
if (!empty($categories_list)) {
    $frm = new InputForm('', 'post', $lang['admincp']['browse'], '', 'multipart/form-data');
    $frm->addrow($lang['admincp']['articles']['manage']['selcat'], $frm->select_tag('category', $categories_list), 'top');
    $frm->show();
} else {
    rcms_showAdminMessage($lang['results']['articles'][9]);
}
if (!empty($article) && !empty($category)) {
    $article_data = articles_get($category, $article, false, 2, $work_dir);
    $frm = new InputForm('', 'post', $lang['general']['submit'], '', 'multipart/form-data', 'arted');
    $frm->addbreak($lang['admincp']['articles']['manage']['edit'] . ': ' . $article_data['title']);
    $frm->addrow($lang['articles']['categ'], $frm->select_tag('a_category', $categories_list, $article_data['catid']), 'top');
    $frm->addrow($lang['articles']['subj'], $frm->text_box('a_title', $article_data['title']), 'top');
    $frm->addrow($lang['articles']['author'], $frm->text_box('a_src', $article_data['src']), 'top');
    $frm->addrow('', rcms_show_bbcode_panel('document.arted.a_description'));
    $frm->addrow($lang['articles']['desc'], $frm->textarea('a_description', str_replace('<br />', '', $article_data['desc']), 70, 5), 'top');
    $frm->addrow('', rcms_show_bbcode_panel('document.arted.a_text'));
    $frm->addrow($lang['articles']['text'], $frm->textarea('a_text', str_replace('<br />', '', $article_data['text']), 70, 25), 'top');
    $frm->addrow($lang['articles']['mode'], $frm->radio_button('a_mode', $lang['articles']['modes'], $article_data['mode']), 'top');
    $frm->addrow($lang['articles']['allowcomments'], $frm->radio_button('a_comments', array('yes' => $lang['admincp']['allow'], 'no' => $lang['admincp']['disallow']), $article_data['comments']), 'top');
    $frm->hidden('editflag', '1');
    $frm->hidden('edit', $article);
    $frm->hidden('category', $category);
    $frm->show();
开发者ID:BackupTheBerlios,项目名称:reloadcms-svn,代码行数:31,代码来源:articles.man.php

示例14: db_connect

<?php

require_once "database.php";
require_once "models/articles.php";
$link = db_connect();
$article = articles_get($_GET['id'], $link);
include "Views/article.html";
?>

开发者ID:eIIIKuHKoT,项目名称:git-repo,代码行数:8,代码来源:article.php


注:本文中的articles_get函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。