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


PHP deleteArticle函数代码示例

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


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

示例1: deleteChannelCategory

/**
 * Deletes a category in a channel and all its articles and clusters.
 * @param integer ID of the Channel Category to delete
 */
function deleteChannelCategory($categoryId)
{
    global $db;
    $sql = "SELECT ARTICLE_ID FROM channel_articles WHERE CH_CAT_ID={$categoryId}";
    $query = new query($db, $sql);
    while ($query->getrow()) {
        deleteArticle($query->field("ARTICLE_ID"));
    }
    deleteRow("channel_categories", "CH_CAT_ID = {$categoryId}");
}
开发者ID:BackupTheBerlios,项目名称:nxwcms-svn,代码行数:14,代码来源:channel.php

示例2: deleteCategory

function deleteCategory($id)
{
    global $REX, $I18N;
    $KAT = new sql();
    $KAT->setQuery("select * from rex_category where id='{$id}'");
    if ($KAT->getRows() == 1) {
        $re_id = $KAT->getValue("re_category_id");
        $KAT->setQuery("select * from rex_article where category_id='{$id}'");
        for ($i = 0; $i < $KAT->getRows(); $i++) {
            deleteArticle($KAT->getValue("id"));
            $KAT->next();
        }
        $KAT->query("delete from rex_article where category_id='{$id}'");
        $KAT->query("delete from rex_category where id='{$id}'");
        @unlink($REX[INCLUDE_PATH] . "/generated/categories/" . $id . ".category");
        @unlink($REX[INCLUDE_PATH] . "/generated/categories/" . $id . ".list.category");
        generateCategoryList($re_id);
        $message = $I18N->msg('category_deleted');
    } else {
        $message = $I18N->msg('category_doesnt_exist');
    }
    return $message;
}
开发者ID:BackupTheBerlios,项目名称:redaxo-svn,代码行数:23,代码来源:function_rex_generate.inc.php

示例3: generateArticle

    $amessage = $I18N->msg("article_status_updated");
    $KAT->query("update rex_article set status='0' where id='{$article_id}'");
    generateArticle($article_id);
}
if ($function == "online_article" && $STRUCTURE_PERM) {
    $amessage = $I18N->msg("article_status_updated");
    $KAT->query("update rex_article set status='1' where id='{$article_id}'");
    generateArticle($article_id);
}
if ($function == "edit_article" && ($STRUCTURE_PERM || $REX_USER->isValueOf("rights", "article[{$article_id}]"))) {
    $amessage = $I18N->msg("article_updated");
    $KAT->query("update rex_article set name='{$article_name}',template_id='{$template_id}' where id='{$article_id}'");
    generateArticle($article_id);
}
if ($function == "delete_article" && $STRUCTURE_PERM) {
    $message = deleteArticle($article_id);
}
if ($function == "add_article" and $STRUCTURE_PERM) {
    $amessage = $I18N->msg("article_added");
    $AART = new sql();
    // vscope prior script
    $article_prior = $AART->new_order('rex_article', 'prior', 'category_id', $category_id);
    $AART->setTable("rex_article");
    $AART->setValue("name", $article_name);
    $AART->setValue("category_id", $category_id);
    $AART->setValue("prior", $article_prior);
    $AART->setValue("path", $KATSQLpath);
    $AART->setValue("startpage", 0);
    $AART->setValue("status", 0);
    $AART->setValue("online_von", date("YmdHis"));
    $AART->setValue("online_bis", "20100101");
开发者ID:BackupTheBerlios,项目名称:redaxo,代码行数:31,代码来源:structure.inc.php

示例4: access

<?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;
    }
}
if (deleteArticle($mysqli, $articleId) == 1) {
    header("Location: ../Account/account.php");
    exit;
} else {
    header("Location: ../../404.php");
    exit;
}
开发者ID:vladvoth,项目名称:splitter,代码行数:24,代码来源:deleteArticle.php

示例5: ZenpageNews

                        break;
                }
            }
        } else {
            $result = new ZenpageNews('');
            $result->setPermalink(1);
            $result->setDateTime(date('Y-m-d H:i:s'));
        }
    }
    if (isset($_GET['save'])) {
        XSRFdefender('save');
        $result = updateArticle($reports, true);
    }
    if (isset($_GET['delete'])) {
        XSRFdefender('delete');
        $msg = deleteArticle(sanitize($_GET['delete']));
        if (!empty($msg)) {
            $reports[] = $msg;
        }
    }
}
if (is_AdminEditPage('newscategory')) {
    $tab = 'news';
    $_GET['tab'] = 'categories';
    if (isset($_GET['save'])) {
        XSRFdefender('save');
        updateCategory($reports, true);
    }
    if (isset($_GET['titlelink'])) {
        $result = new ZenpageCategory(urldecode(sanitize($_GET['titlelink'])));
    } else {
开发者ID:rauldobrota,项目名称:zenphoto,代码行数:31,代码来源:admin-edit.php

示例6: ZenpageNews

                        break;
                }
            }
        } else {
            $result = new ZenpageNews('');
            $result->setPermalink(1);
            $result->setDateTime(date('Y-m-d H:i:s'));
        }
    }
    if (isset($_GET['save'])) {
        XSRFdefender('save');
        $result = addArticle($reports);
    }
    if (isset($_GET['delete'])) {
        XSRFdefender('delete');
        $msg = deleteArticle($_GET['delete']);
        if (!empty($msg)) {
            $reports[] = $msg;
        }
    }
}
if (is_AdminEditPage('category')) {
    $tab = 'news';
    $_GET['tab'] = 'categories';
    if (isset($_GET['save'])) {
        XSRFdefender('save');
        addCategory($reports);
    }
    if (isset($_GET['titlelink'])) {
        $result = new ZenpageCategory(urldecode($_GET['titlelink']));
    } else {
开发者ID:hatone,项目名称:zenphoto-1.4.1.4,代码行数:31,代码来源:admin-edit.php

示例7: require_once

<?
require_once('articleModel.php');

$id = trim( 10 );

$result = deleteArticle( $id );
if( $result ){
	echo 'Новость успешно удалена';
}else echo 'Ошибка удаления новости';
开发者ID:Arteaga71,项目名称:PHP2,代码行数:9,代码来源:delete.php

示例8: file_get_contents

    $json = file_get_contents('php://input');
    $data = json_decode($json, true);
    var_dump($data);
    $tinyurl = "";
    if (!empty($data["link"])) {
        get_tiny_url($data["link"]);
    }
    return insertArticle($data["title"], $data["body"], $tinyurl);
} elseif ($_SERVER["REQUEST_METHOD"] == "DELETE") {
    $json = file_get_contents('php://input');
    $data = json_decode($json, true);
    $articleID = $data["articleId"];
    if (empty($articleID)) {
        return;
    }
    deleteArticle($articleID);
    log_info("Delete Article: " . $articleID);
} else {
    error("unknown verb");
}
//Functions
//gets the data from a URL
function get_tiny_url($url)
{
    $ch = curl_init();
    $timeout = 5;
    curl_setopt($ch, CURLOPT_URL, 'http://tinyurl.com/api-create.php?url=' . $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
    $data = curl_exec($ch);
    curl_close($ch);
开发者ID:wahabali,项目名称:wordbro,代码行数:31,代码来源:articleService.php

示例9: switch

 * the following disclaimer in the documentation and/or other materials
 * provided with the distribution. Neither the name of the University of
 * Massachusetts Lowell nor the names of its contributors may be used to
 * endorse or promote products derived from this software without specific
 * prior written permission.
 *
 * 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';
if (isset($_GET['action'])) {
    switch ($_GET['action']) {
        case "delete":
            deleteArticle($_GET['id']);
            echo "worked!";
            break;
        case "publish":
            publishArticle($_GET['id']);
            echo "worked!";
            break;
    }
}
开发者ID:nickavv,项目名称:iSENSE,代码行数:31,代码来源:news.php

示例10: showModArticle

?>
            </div>
            <div id="menu-bottom" />
        </div>

        <div id="content">
            <?php 
if (isset($_POST['chosenArticle'])) {
    /* show input fields to mod article */
    showModArticle($_POST['chosenArticle']);
} elseif (isset($_POST['articleToModId'])) {
    /* submit article mod */
    submitModArticle($_POST['modArticleTitle'], $_SESSION['username'], $_POST['modArticleText'], $_POST['articleToModId']);
} elseif (isset($_POST['articleToDeleteId'])) {
    /* id of admin to delete */
    deleteArticle($_POST['articleToDeleteId']);
} elseif (isset($_POST['addNewArticle'])) {
    /* show addNewAdmin form */
    addNewArticleForm();
} elseif (isset($_POST['submitNewArticle'])) {
    /* insert new article to database */
    insertNewArticle($_POST['newTitle'], $_SESSION['username'], $_POST['newArticle']);
} else {
    /* show news selection form */
    showNewsList();
}
?>
        </div>

        <div class="separate sfondo-footer"><?php 
bottomPageInfo();
开发者ID:nwoki,项目名称:2s2h-website,代码行数:31,代码来源:modnews.php

示例11: auth

<?php

require_once "../../config.inc.php";
$auth = new auth("CHANNEL_EDIT");
$page = new Page("Edit Channels");
require_once $c["path"] . "modules/channels/article_select_form.php";
if (value("action") == "deletearticle" && $auth->checkAccessToFunction("CHANNEL_DELETE")) {
    $article = value("article", "NUMERIC");
    deleteArticle($article);
}
if (value("action") == "launcharticle" && $auth->checkAccessToFunction("CHANNEL_LAUNCH")) {
    $article = value("article", "NUMERIC");
    launchArticle($article, 10, variation());
}
if (value("action") == "expirearticle" && $auth->checkAccessToFunction("CHANNEL_LAUNCH")) {
    $article = value("article", "NUMERIC");
    expireArticle($article, 10, variation());
}
$selch = new SelectMenu($lang->get("channel_select", "Select Channel"), "chsel", "channels", "NAME", "CHID", "1");
$lang->delete("help_articles");
$selch->tipp = $lang->get("help_articles", "The form displays articles.<br><br>The color codes are:<li>red: article not published<li>grey: article not translated<li>green: article published");
$rowOrderFilter = "VERSION=0 AND CHID=" . $selch->selected;
if (value("action") == "up") {
    $article = value("article", "NUMERIC");
    moveRowUp("channel_articles", "ARTICLE_ID", $article, "POSITION", $rowOrderFilter);
} else {
    if (value("action") == "down") {
        $article = value("article", "NUMERIC");
        moveRowDown("channel_articles", "ARTICLE_ID", $article, "POSITION", $rowOrderFilter);
    }
}
开发者ID:BackupTheBerlios,项目名称:nxwcms-svn,代码行数:31,代码来源:overview.php

示例12: addArticle

         addArticle($_POST);
     }
     break;
 case "edit_article":
     if (notNull($_POST)) {
         editArticle($_POST);
     }
     break;
 case "update_articles":
     if (notNull($_POST)) {
         updateArticles($_POST['order']);
     }
     break;
 case "delete_article":
     if (notNull($_POST)) {
         deleteArticle($_POST['id']);
     }
     break;
 case "shout":
     if (notNull($_POST)) {
         shout($_POST['message'], $_POST['dest']);
     }
     break;
 case "upshout":
     updateShoutbox();
     break;
 case "classUpdate":
     getClassCombo($_POST['id'], $_POST['i'], $_POST['className']);
     break;
 case "specUpdate":
     getSpecCombo($_POST['class'], $_POST['id'], $_POST['i'], $_POST['spec']);
开发者ID:dexz,项目名称:dev-extaze,代码行数:31,代码来源:query.php

示例13: filter_input

// Check for the submit
$edit = filter_input(INPUT_POST, 'edit', FILTER_DEFAULT);
$saveEdit = filter_input(INPUT_POST, 'saveEdit', FILTER_DEFAULT);
$cancelEdit = filter_input(INPUT_POST, 'cancelEdit', FILTER_DEFAULT);
$pageLocation = PageLocation::Article;
if ($edit != "") {
    $pageLocation = PageLocation::EditArticle;
} else {
    if ($saveEdit != "") {
        updateArticle($saveEdit);
    }
}
include_once __ROOT__ . '/admin/index.php';
$delete = filter_input(INPUT_POST, 'delete', FILTER_DEFAULT);
if ($delete != "") {
    deleteArticle($delete);
} else {
    //showAllArticles();
}
function editArticle($edit)
{
    // Create DB connection
    require_once __ROOT__ . '/admin/include/DBclass.php';
    $sqlConn = new DBclass("nazmarket");
    $query = "SELECT * FROM article, category, company, unit " . "     WHERE ((article.idcategory = category.idcategory) AND " . "             (article.idcompany = company.idcompany) AND " . "             (article.idunit = unit.idunit) AND (article.idarticle=" . $edit . "))";
    $article = $sqlConn->exeQuery($query);
    $article = $article->fetch_assoc();
    $category = $sqlConn->exeQuery("SELECT * FROM category");
    $company = $sqlConn->exeQuery("SELECT * FROM company");
    $unit = $sqlConn->exeQuery("SELECT * FROM unit");
    // Errors:
开发者ID:skoja,项目名称:NazMarket,代码行数:31,代码来源:article.php

示例14: switch

}
switch ($action) {
    case 'login':
        login();
        break;
    case 'logout':
        logout();
        break;
    case 'newArticle':
        newArticle();
        break;
    case 'editArticle':
        editArticle();
        break;
    case 'deleteArticle':
        deleteArticle();
        break;
    default:
        listArticles();
}
function login()
{
    $results = array();
    $results['pageTitle'] = "Admin Login | Falcon";
    if (isset($_POST['login'])) {
        // User has posted the login form: attempt to log the user in
        if ($_POST['username'] == ADMIN_USERNAME && $_POST['password'] == ADMIN_PASSWORD) {
            // Login successful: Create a session and redirect to the admin homepage
            $_SESSION['username'] = ADMIN_USERNAME;
            header("Location: admin.php");
        } else {
开发者ID:aharish,项目名称:FalconRanger,代码行数:31,代码来源:admin.php

示例15: common_projektneStrane


//.........这里部分代码省略.........
				
				
				</form>
				
				
<?php 
                    } else {
                        $errorText = formProcess_bl('edit');
                        if ($errorText == '') {
                            nicemessage('Uspješno ste uredili članak.');
                            zamgerlog("uredio clanak na projektu {$projekat} (pp{$predmet})", 2);
                            zamgerlog2("uredio clanak na projektu", $projekat);
                            $link = $linkPrefix;
                        } else {
                            //an error occured trying to process the form
                            niceerror($errorText);
                            $link = "javascript:history.back();";
                        }
                        nicemessage('<a href="' . $link . '">Povratak.</a>');
                    }
                    //submitted the form
                } elseif ($subaction == 'del') {
                    //delete item
                    if (isset($id) && is_int($id) && $id > 0) {
                        if (isUserAuthorOfArticle($id, $userid) == false) {
                            return;
                        }
                        if (!isset($_REQUEST['c'])) {
                            echo "Da li ste sigurni da zelite obrisati ovaj članak? <br />";
                            echo '<a href="' . $linkPrefix . '&amp;subaction=del&amp;id=' . $id . '&amp;c=true">Da</a> | <a href="' . $linkPrefix . '">Odustani</a>';
                        } else {
                            if ($_REQUEST['c'] == 'true') {
                                //delete the record
                                if (deleteArticle($id)) {
                                    nicemessage('Uspješno ste obrisali članak.');
                                    zamgerlog("obrisao clanak na projektu {$projekat} (pp{$predmet})", 2);
                                    zamgerlog2("obrisao clanak na projektu", $projekat);
                                    $link = $linkPrefix;
                                } else {
                                    niceerror('Došlo je do greske prilikom brisanja članka. Molimo kontaktirajte administratora.');
                                    $link = "javascript:history.back();";
                                }
                                nicemessage('<a href="' . $link . '">Povratak.</a>');
                            }
                        }
                        //else isset c get parameter
                    }
                    //id is okay
                }
                //subaction == del
            }
            //subaction set
        } elseif ($section == 'file') {
            //files management
            $linkPrefix .= '&section=file';
            ?>
<h2>Fajlovi</h2>
 <div class="links clearfix" id="rss">
    <ul>
        <li><a href="<?php 
            echo $linkPrefix;
            ?>
">Lista fajlova</a></li>
        <li><a href="<?php 
            echo $linkPrefix . "&subaction=add";
            ?>
开发者ID:msehalic,项目名称:zamger,代码行数:67,代码来源:projektneStrane.php


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