本文整理汇总了PHP中check_actions函数的典型用法代码示例。如果您正苦于以下问题:PHP check_actions函数的具体用法?PHP check_actions怎么用?PHP check_actions使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了check_actions函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pligg_validate
function pligg_validate()
{
// returns the value for register validation
$vars = array('validate' => misc_validate);
check_actions('pligg_validate', $vars);
return $vars['validate'];
}
示例2: Logout
function Logout($url = './')
{
$this->user_login = "";
$this->authenticated = FALSE;
$this->SetIDCookie(0, '');
define('wheretoreturn', $url);
check_actions('logout_success');
//header("Pragma: no-cache");
header("Cache-Control: no-cache, must-revalidate");
header("Location: {$url}");
header("Expires: " . gmdate("r", time() - 3600));
header("ETag: \"logingout" . time() . "\"");
die;
}
示例3: delete_storylink
function delete_storylink($linkid)
{
if (!is_numeric($linkid)) {
return;
}
$query = "SELECT * FROM " . table_links . " WHERE link_id = '{$linkid}'";
if (!($result = mysql_query($query))) {
error_page(mysql_error());
} else {
$sql_array = mysql_fetch_object($result);
}
# delete the story link
$query = "DELETE FROM " . table_links . " WHERE link_id = '{$linkid}'";
if (!($result = mysql_query($query))) {
error_page(mysql_error());
}
# delete the story comments
$query = "DELETE FROM " . table_comments . " WHERE comment_link_id = '{$linkid}'";
if (!($result = mysql_query($query))) {
error_page(mysql_error());
}
# delete the saved links
$query = "DELETE FROM " . table_saved_links . " WHERE saved_link_id = '{$linkid}'";
if (!($result = mysql_query($query))) {
error_page(mysql_error());
}
# delete the story tags
$query = "DELETE FROM " . table_tags . " WHERE tag_link_id = '{$linkid}'";
if (!($result = mysql_query($query))) {
error_page(mysql_error());
}
# delete the story trackbacks
$query = "DELETE FROM " . table_trackbacks . " WHERE trackback_link_id = '{$linkid}'";
if (!($result = mysql_query($query))) {
error_page(mysql_error());
}
# delete the story votes
$query = "DELETE FROM " . table_votes . " WHERE vote_link_id = '{$linkid}'";
if (!($result = mysql_query($query))) {
error_page(mysql_error());
}
# delete additional categories
$query = "DELETE FROM " . table_additional_categories . " WHERE ac_link_id = '{$linkid}'";
if (!($result = mysql_query($query))) {
error_page(mysql_error());
}
// module system hook
$vars = array('link_id' => $linkid);
check_actions('admin_story_delete', $vars);
}
示例4: insert_vote
function insert_vote($user = 0, $value = 10)
{
if (parent::insert_vote($user, $value)) {
$vote = new Vote();
$vote->type = 'links';
$vote->link = $this->id;
if (Voting_Method == 2) {
$this->votes = $vote->rating("!=0");
$this->votecount = $vote->count("!=0");
$this->reports = $this->count_all_votes("<0");
} else {
$this->reports = $this->count_all_votes("<0");
$this->votes = $vote->count() - $this->reports;
}
$this->store_basic();
$this->check_should_publish();
$vars = array('vote' => $this);
check_actions('link_insert_vote_post', $vars);
return true;
}
return false;
}
示例5: delete_comment
function delete_comment($key)
{
global $db;
if (!is_numeric($key)) {
return;
}
$link_id = $db->get_var("SELECT comment_link_id FROM `" . table_comments . "` WHERE `comment_id` = " . $key . ";");
$vars = array('comment_id' => $key);
check_actions('comment_deleted', $vars);
$comments = $db->get_results($sql = "SELECT comment_id FROM " . table_comments . " WHERE `comment_parent` = '{$key}'");
foreach ($comments as $comment) {
$vars = array('comment_id' => $comment->comment_id);
check_actions('comment_deleted', $vars);
}
$db->query('DELETE FROM `' . table_comments . '` WHERE `comment_parent` = "' . $key . '"');
$db->query('DELETE FROM `' . table_comments . '` WHERE `comment_id` = "' . $key . '"');
$link = new Link();
$link->id = $link_id;
$link->read();
$link->recalc_comments();
$link->store();
}
示例6: insert_anonymous_comment
function insert_anonymous_comment(&$vars)
{
global $db;
$link_id = $vars['link_id'];
$user_id = $vars['user_id'];
$randkey = $vars['randkey'];
$comment_content = $db->escape($vars['comment_content']);
$a_username = $vars['a_username'];
$a_email = $vars['a_email'];
$a_website = $vars['a_website'];
$sql = "INSERT INTO " . table_comments . " (comment_user_id, comment_link_id, comment_date, comment_randkey, comment_content,`comment_anonymous_username`, `comment_anonymous_email`, `comment_anonymous_website` ) VALUES ({$user_id}, {$link_id}, NOW(), {$randkey}, '{$comment_content}', '{$a_username}','{$a_email}', '{$a_website}')";
$result = $db->query($sql);
// DB 04/15/11
$vars = array('comment' => $db->insert_id);
check_actions('after_comment_submit', $vars);
/////
// DB 12/17/08
$link = new Link();
$link->id = $link_id;
$link->read();
$link->adjust_comment(1);
$link->store();
/////
}
示例7: insert_comment
function insert_comment()
{
global $link, $db, $current_user, $main_smarty, $the_template, $story_url;
$main_smarty->assign('TheComment', $_POST['comment_content']);
if ($vars['error'] == true) {
$error = true;
return;
}
require_once mnminclude . 'comment.php';
$comment = new Comment();
$cancontinue = false;
//anonymous comment
$cancontinue_anon = false;
$anon = $_POST['anon'];
$comment->content = sanitize($_POST['comment_content'], 4);
if (strlen($comment->content) > maxCommentLength) {
$main_smarty->assign('url', $_SERVER['REQUEST_URI']);
$main_smarty->assign('tpl_center', $the_template . '/comment_errors');
$main_smarty->display($the_template . '/pligg.tpl');
exit;
}
if (sanitize($_POST['link_id'], 3) == $link->id && $current_user->authenticated && sanitize($_POST['user_id'], 3) == $current_user->user_id && sanitize($_POST['randkey'], 3) > 0) {
if (sanitize($_POST['comment_content'], 4) != '') {
// this is a normal new comment
$cancontinue = true;
}
if (is_array($_POST['reply_comment_content'])) {
// comment replies
foreach ($_POST['reply_comment_content'] as $id => $value) {
if ($id > 0 && $value) {
$comment->content = sanitize($value, 4);
$comment->parent = $id;
$cancontinue = true;
break;
}
}
}
} elseif ($_POST['link_id'] == $link->id && $_POST['randkey'] > 0 && $anon == 1) {
if (strlen($_POST['comment_content']) > 0) {
check_actions('register_check_errors', $vars);
if ($vars['error'] == true) {
$error = true;
} elseif (!$current_user->authenticated) {
$vars = array('link_id' => $link->id, 'randkey' => $_POST['randkey'], 'user_id' => $_POST['user_id'], 'a_email' => $_POST['a_email'], 'a_username' => $_POST['a_username'], 'a_website' => $_POST['a_website'], 'comment_content' => sanitize($_POST['comment_content'], 4));
check_actions('anonymous_comment', $vars);
}
}
}
$parrent_comment_id = sanitize($_POST['parrent_comment_id'], 3);
if ($cancontinue == true) {
$comment->link = $link->id;
if ($parrent_comment_id != 0) {
$comment->parent = $parrent_comment_id;
} else {
$comment->parent = 0;
}
$comment->randkey = sanitize($_POST['randkey'], 3);
$comment->author = sanitize($_POST['user_id'], 3);
$vars = array('comment' => &$comment);
check_actions('story_insert_comment', $vars);
if ($vars['comment']->status) {
$comment->status = $vars['comment']->status;
}
$comment->store();
$vars['comment'] = $comment->id;
check_actions('after_comment_submit', $vars);
$story_url = getmyurl("storyURL", $link->category_safe_names(), urlencode($link->title_url), $link->id);
//$story_url;
header('Location: ' . $story_url . "#comment-reply-" . $comment->id);
die;
}
}
示例8: Smarty
<?php
// The source code packaged with this file is Free Software, Copyright (C) 2005 by
// Ricardo Galli <gallir at uib dot es>.
// It's licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise.
// You can get copies of the licenses here:
// http://www.affero.org/oagpl.html
// AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING".
include_once 'Smarty.class.php';
$main_smarty = new Smarty();
include_once 'config.php';
include_once mnminclude . 'html1.php';
include_once mnminclude . 'link.php';
include_once mnminclude . 'tags.php';
include_once mnminclude . 'search.php';
include_once mnminclude . 'smartyvariables.php';
// pagename
define('pagename', 'module');
$main_smarty->assign('pagename', pagename);
$vars = '';
check_actions('module_page', $vars);
示例9: insert_vote
function insert_vote($user = 0, $value = 10)
{
global $anon_karma;
require_once mnminclude . 'votes.php';
if (!is_numeric($this->id)) {
return false;
}
$vote = new Vote();
$vote->type = 'comments';
$vote->user = $user;
$vote->link = $this->id;
$vote->value = $value;
if ($vote->insert()) {
$vote = new Vote();
$vote->type = 'comments';
$vote->link = $this->id;
$this->votes = $vote->count() - $vote->count('<0');
if (comment_buries_spam > 0 && $vote->count_all("<0") >= comment_buries_spam) {
$this->status = 'discard';
$this->store();
$vars = array('comment_id' => $this->id);
check_actions('comment_spam', $vars);
require_once mnminclude . 'link.php';
$link = new Link();
$link->id = $this->link;
$link->read();
$link->recalc_comments();
$link->store();
}
$vars = array('vote' => $this);
check_actions('comment_insert_vote_post', $vars);
return $vote->sum();
}
return false;
}
示例10: htmlspecialchars
echo "\t<category>" . htmlspecialchars($category_name) . "</category>\n";
// Calculate total vote count based on votes-downvotes
$vote_total = $link->votes - $link->reports;
echo "\t<votes>" . $vote_total . "</votes>\n";
echo "\t<upvotes>" . $link->votes . "</upvotes>\n";
echo "\t<downvotes>" . $link->reports . "</downvotes>\n";
echo "\t<guid>" . getmyFullurl("storyURL", $link->category_safe_names($link->category), urlencode($link->title_url), $link->id) . "</guid>\n";
// module system hook
$vars = array('item' => $link);
check_actions('rss_item', $vars);
echo "</item>\n\n";
}
}
// module system hook
$vars = '';
check_actions('rss_end_data', $vars);
do_rss_footer();
function do_rss_header($title)
{
global $last_modified, $dblang, $main_smarty;
header('Content-type: text/xml; charset=utf-8', true);
echo '<?xml version="1.0"?>' . "\n";
echo '<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">' . "\n";
echo '<channel>' . "\n";
echo '<title>' . htmlspecialchars($main_smarty->get_config_vars("PLIGG_Visual_Name")) . ' ' . trim($title) . '</title>' . "\n";
echo '<link>' . my_base_url . my_pligg_base . '</link>' . "\n";
echo '<description>' . $main_smarty->get_config_vars("PLIGG_Visual_RSS_Description") . '</description>' . "\n";
echo '<pubDate>' . date('D, d M Y H:i:s T', $last_modified - misc_timezone * 3600) . '</pubDate>' . "\n";
echo '<language>' . $dblang . '</language>' . "\n";
}
function do_rss_footer()
示例11: Smarty
<?php
include_once 'internal/Smarty.class.php';
$main_smarty = new Smarty();
include 'config.php';
include mnminclude . 'html1.php';
include mnminclude . 'link.php';
include mnminclude . 'smartyvariables.php';
$vars = '';
check_actions('error_404', $vars);
define('pagename', 'error_404');
$main_smarty->assign('pagename', pagename);
// sidebar
$main_smarty = do_sidebar($main_smarty);
// show the template
header("HTTP/1.1 404 Not Found");
$main_smarty->assign('tpl_center', $the_template . '/error_404_center');
$main_smarty->display($the_template . '/pligg.tpl');
exit;
示例12: Smarty
<?php
// The source code packaged with this file is Free Software, Copyright (C) 2005 by
// Ricardo Galli <gallir at uib dot es>.
// It's licensed under the AFFERO GENERAL PUBLIC LICENSE unless stated otherwise.
// You can get copies of the licenses here:
// http://www.affero.org/oagpl.html
// AFFERO GENERAL PUBLIC LICENSE is also included in the file called "COPYING".
include_once 'Smarty.class.php';
$main_smarty = new Smarty();
include 'config.php';
include mnminclude . 'html1.php';
include mnminclude . 'link.php';
include mnminclude . 'smartyvariables.php';
$vars = '';
check_actions('404Error', $vars);
define('pagename', '404');
$main_smarty->assign('pagename', pagename);
// sidebar
$main_smarty = do_sidebar($main_smarty);
// show the template
$main_smarty->assign('tpl_center', '404error');
$main_smarty->display($the_template . '/pligg.tpl');
示例13: insert_comment
function insert_comment()
{
global $commentownerid, $link, $db, $current_user, $main_smarty, $the_template;
check_actions('story_edit_comment', $vars);
// Check if is a POST of a comment
if (sanitize($_POST['link_id'], 3) == $link->id && $current_user->authenticated && sanitize($_POST['user_id'], 3) == $current_user->user_id && is_numeric(sanitize($_POST['randkey'], 3)) && sanitize($_POST['randkey'], 3) > 0 && sanitize($_POST['comment_content'], 4) != '') {
require_once mnminclude . 'comment.php';
$comment = new Comment();
$comment->id = $link->commentid;
$comment->read();
$comment->link = $link->id;
$comment->randkey = sanitize($_POST['randkey'], 3);
$comment->author = $commentownerid;
$comment->content = sanitize($_POST['comment_content'], 4);
if (strlen($comment->content) > maxCommentLength) {
$main_smarty->assign('url', $_SERVER['REQUEST_URI']);
$main_smarty->assign('tpl_center', $the_template . '/comment_errors');
$main_smarty->display($the_template . '/pligg.tpl');
exit;
}
$vars['comment'] = $comment->id;
$vars = array('comment' => &$comment);
check_actions('after_comment_edit', $vars);
if ($vars['comment']->status) {
$comment->status = $vars['comment']->status;
}
$comment->store();
header('Location: ' . getmyurl('story', sanitize($_POST['link_id'], 3)));
die;
}
}
示例14: foreach
foreach ($links as $dblink) {
$link->id = $dblink->link_id;
$cached_links[$dblink->link_id] = $dblink;
$link->read();
$category_name = $db->get_var("SELECT category_name FROM " . table_categories . " WHERE category_id = {$link->category} AND category_lang='{$dblang}'");
$link->content = str_replace("\n", "<br />", $link->content);
$link->content = str_replace("’", "'", $link->content);
$link->content = str_replace("–", "-", $link->content);
$link->content = str_replace("—", "-", $link->content);
$link->content = str_replace("“", "\"", $link->content);
$link->content = str_replace("”", "\"", $link->content);
echo "<item>\n";
echo "\t<title><![CDATA[" . $link->title . "]]></title>\n";
echo "\t<link>" . getmyFullurl("storyURL", $link->category_safe_names($link->category), $link->title_url, $link->id) . "</link>\n";
$vars = array('link' => $link);
check_actions('rss_add_data', $vars);
echo ' <source url="' . getmyFullurl("storyURL", $link->category_safe_names($link->category), $link->title_url, $link->id) . '"><![CDATA[' . $link->title . ']]></source>';
echo "\n\t<description><![CDATA[" . $link->content . " ]]></description>\n";
if (!empty($link_date)) {
echo "\t<pubDate>" . date("r", $link->{$link_date} - misc_timezone * 3600) . "</pubDate>\n";
} else {
echo "\t<pubDate>" . date("r", time() - misc_timezone * 3600) . "</pubDate>\n";
}
echo "\t<author>" . $dblink->user_login . "</author>\n";
echo "\t<category>" . htmlspecialchars($category_name) . "</category>\n";
echo "\t<votes>" . $link->votes . "</votes>\n";
echo "\t<guid>" . getmyFullurl("storyURL", $link->category_safe_names($link->category), $link->title_url, $link->id) . "</guid>\n";
echo "</item>\n\n";
}
}
do_rss_footer();
示例15: sanitize
// code to prevent CSRF
$CSRF->check_expired('admin_users_edit');
// code to prevent CSRF
if ($CSRF->check_valid(sanitize($_GET['token'], 3), 'admin_users_edit')) {
$user = $db->get_row('SELECT * FROM ' . table_users . ' where user_login="' . sanitize($_GET["user"], 3) . '"');
canIChangeUser($user->user_level);
if ($user) {
$userdata = new User();
$userdata->username = $user->user_login;
if (!$userdata->read()) {
echo "Error reading user data.";
die;
}
// module system hook
$vars = '';
check_actions('admin_users_save', $vars);
$userdata->username = trim(sanitize($_GET["login"], 3));
$userdata->level = trim(sanitize($_GET["level"], 3));
$userdata->email = trim(sanitize($_GET["email"], 3));
if ($_GET["password"] && $_GET["password"] == $_GET["password2"]) {
$userdata->pass = $_GET["password"];
}
$userdata->store();
// breadcrumbs and page title
$navwhere['text1'] = $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel');
$navwhere['link1'] = getmyurl('admin', '');
$navwhere['text2'] = $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel_1');
$navwhere['link2'] = my_pligg_base . "/admin/admin_users.php";
$navwhere['text3'] = $main_smarty->get_config_vars('PLIGG_Visual_Breadcrumb_Edit_User_Data_Saved');
$main_smarty->assign('navbar_where', $navwhere);
$main_smarty->assign('posttitle', " / " . $main_smarty->get_config_vars('PLIGG_Visual_Header_AdminPanel'));