本文整理汇总了PHP中get_post_data函数的典型用法代码示例。如果您正苦于以下问题:PHP get_post_data函数的具体用法?PHP get_post_data怎么用?PHP get_post_data使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_post_data函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: stripe_webhook_handler
/**
* Handle Stripe webhooks
*/
function stripe_webhook_handler($environment)
{
$body = get_post_data();
$event_json = json_decode($body);
$event_id = $event_json->id;
$gateway = new StripeClient($environment);
$event = $gateway->getEvent($event_id);
if (!$event) {
return array('success' => false, 'message' => 'Stripe Event for this webhook was not found');
}
$ia = elgg_set_ignore_access(true);
$ha = access_get_show_hidden_status();
access_show_hidden_entities(true);
$result = elgg_trigger_plugin_hook_handler($event->type, 'stripe.events', array('environment' => $environment, 'event' => $event), array('success' => true));
access_show_hidden_entities($ha);
elgg_set_ignore_access($ia);
return $result;
}
开发者ID:Daltonmedia,项目名称:stripe,代码行数:21,代码来源:start.php
示例2: search_products
function search_products(ProductCategory $category, $page)
{
$post_data = array();
$post_data["ApiKey"] = API_KEY;
$post_data["SearchRequest"] = array();
$post_data["SearchRequest"]["Keyword"] = $category->get_name();
$post_data["SearchRequest"]["Pagination"] = array();
$post_data["SearchRequest"]["Pagination"]["ItemsPerPage"] = 10;
$post_data["SearchRequest"]["Pagination"]["PageNumber"] = $page;
$post_data["SearchRequest"]["Filters"] = array();
$post_data["SearchRequest"]["Filters"]["Price"] = array();
$post_data["SearchRequest"]["Filters"]["Price"]["Min"] = 0;
$post_data["SearchRequest"]["Filters"]["Price"]["Max"] = 0;
$post_data["SearchRequest"]["Filters"]["Navigation"] = "all";
$post_data["SearchRequest"]["Filters"]["IncludeMarketPlace"] = false;
$post_data["SearchRequest"]["Filters"]["Brands"] = array();
$file = get_post_data(API_SEARCH, json_encode($post_data));
return json_decode($file, true);
}
开发者ID:Monpoke,项目名称:nuitinfo,代码行数:19,代码来源:cdiscount.php
示例3: block_content
public function block_content($context, array $blocks = array())
{
// line 4
echo "<h4>Alasan laporan</h4>\n";
// line 5
echo get_flashdata("laporkan");
echo "\n\n<p>Mengapa anda melaporkan komentar tersebut?</p>\n\n";
// line 9
echo form_open("materi/detail/" . $this->getAttribute(isset($context["materi"]) ? $context["materi"] : null, "id") . "/laporkan/" . $this->getAttribute(isset($context["komentar"]) ? $context["komentar"] : null, "id"));
echo "\n";
// line 10
echo form_error("alasan");
echo "\n<label class=\"radio\">\n <input type=\"radio\" ";
// line 12
echo twig_escape_filter($this->env, set_radio("alasan", "SARA"), "html", null, true);
echo " class=\"hide-lain\" name=\"alasan\" value=\"SARA\"> SARA\n</label>\n<label class=\"radio\">\n <input type=\"radio\" ";
// line 15
echo twig_escape_filter($this->env, set_radio("alasan", "Pornografi"), "html", null, true);
echo " class=\"hide-lain\" name=\"alasan\" value=\"Pornografi\"> Pornografi\n</label>\n<label class=\"radio\">\n <input type=\"radio\" ";
// line 18
echo twig_escape_filter($this->env, set_radio("alasan", "Profokasi/Intimidasi"), "html", null, true);
echo " class=\"hide-lain\" name=\"alasan\" value=\"Profokasi/Intimidasi\"> Profokasi/Intimidasi\n</label>\n<label class=\"radio\">\n <input type=\"radio\" ";
// line 21
echo twig_escape_filter($this->env, set_radio("alasan", "tulis"), "html", null, true);
echo " class=\"show-lain\" name=\"alasan\" value=\"tulis\"> Tulis alasan\n</label>\n<div class=\"form-lain ";
// line 23
echo twig_test_empty(get_post_data("alasan")) || get_post_data("alasan") != "tulis" ? "hide" : "";
echo "\">\n <textarea class=\"span12\" name=\"alasan_lain\" placeholder=\"Tulis alasan anda\">";
// line 24
echo twig_escape_filter($this->env, set_value("alasan_lain"), "html", null, true);
echo "</textarea>\n ";
// line 25
echo form_error("alasan_lain");
echo "\n</div>\n<p><button type=\"submit\" class=\"btn btn-primary\">Submit</button></p>\n";
// line 28
echo form_close();
echo "\n";
}
开发者ID:Raniratna,项目名称:new_elearning,代码行数:38,代码来源:9e099557ff2888af408b3d56eb271e09d9d40394fc59564ba8d488d23000.php
示例4: block_content
//.........这里部分代码省略.........
// line 43
echo twig_escape_filter($this->env, $this->getAttribute(isset($context["pengajar"]) ? $context["pengajar"] : null, "link_profil"), "html", null, true);
echo "\">";
echo twig_escape_filter($this->env, $this->getAttribute(isset($context["pengajar"]) ? $context["pengajar"] : null, "nama"), "html", null, true);
echo "</a></td>\n <td>";
// line 44
echo twig_escape_filter($this->env, $this->getAttribute(isset($context["mapel"]) ? $context["mapel"] : null, "nama"), "html", null, true);
echo "</td>\n <td>";
// line 45
echo twig_escape_filter($this->env, get_indo_hari($this->getAttribute(isset($context["mapel_ajar"]) ? $context["mapel_ajar"] : null, "hari_id")), "html", null, true);
echo "</td>\n <td>";
// line 46
echo twig_escape_filter($this->env, twig_date_format_filter($this->env, $this->getAttribute(isset($context["mapel_ajar"]) ? $context["mapel_ajar"] : null, "jam_mulai"), "H:i"), "html", null, true);
echo " - ";
echo twig_escape_filter($this->env, twig_date_format_filter($this->env, $this->getAttribute(isset($context["mapel_ajar"]) ? $context["mapel_ajar"] : null, "jam_selesai"), "H:i"), "html", null, true);
echo "</td>\n <td>";
// line 47
echo twig_escape_filter($this->env, $this->getAttribute(isset($context["kelas"]) ? $context["kelas"] : null, "nama"), "html", null, true);
echo " <span class=\"badge badge-info\">";
echo twig_escape_filter($this->env, $this->getAttribute(isset($context["kelas"]) ? $context["kelas"] : null, "jumlah_siswa"), "html", null, true);
echo " siswa</span></td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n </th>\n </tr>\n </thead>\n <tbody>\n <tr class=\"info\">\n <td>\n <ul class=\"unstyled inline\" style=\"margin-left: -5px;\">\n ";
// line 60
$context['_parent'] = (array) $context;
$context['_seq'] = twig_ensure_traversable($this->getAttribute(isset($context["retrieve_all_pertanyaan"]) ? $context["retrieve_all_pertanyaan"] : null, "results"));
foreach ($context['_seq'] as $context["s_key"] => $context["s"]) {
// line 61
echo " <li>\n ";
// line 62
if (!twig_test_empty($this->getAttribute(isset($context["s"]) ? $context["s"] : null, "kunci_index"))) {
// line 63
echo " ";
$context["kunci_index"] = get_abjad($this->getAttribute(isset($context["s"]) ? $context["s"] : null, "kunci_index"));
// line 64
echo " ";
} else {
// line 65
echo " ";
$context["kunci_index"] = "";
// line 66
echo " ";
}
// line 67
echo " ";
echo anchor("admin/tugas/edit_question/" . $this->getAttribute(isset($context["mapel_ajar"]) ? $context["mapel_ajar"] : null, "id") . "/" . $this->getAttribute(isset($context["tugas"]) ? $context["tugas"] : null, "id") . "/" . $this->getAttribute(isset($context["s"]) ? $context["s"] : null, "id"), (isset($context["s_key"]) ? $context["s_key"] : null) . ". " . (isset($context["kunci_index"]) ? $context["kunci_index"] : null), array("class" => "label label-info", "data-toggle" => "tooltip", "title" => word_limiter(strip_tags($this->getAttribute(isset($context["s"]) ? $context["s"] : null, "pertanyaan")), 50)));
echo "\n </li>\n ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['s_key'], $context['s'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 70
echo " </ul>\n <b>Jumlah Soal Tersimpan : ";
// line 71
echo twig_escape_filter($this->env, $this->getAttribute(isset($context["retrieve_all_pertanyaan"]) ? $context["retrieve_all_pertanyaan"] : null, "total_record"), "html", null, true);
echo "</b>\n </td>\n </tr>\n <tr>\n <td>\n <h3>Pertanyaan Soal Ke ";
// line 76
echo twig_escape_filter($this->env, $this->getAttribute(isset($context["retrieve_all_pertanyaan"]) ? $context["retrieve_all_pertanyaan"] : null, "total_record") + 1, "html", null, true);
echo " <span class=\"text-error\">*</span> ";
echo form_error("pertanyaan");
echo "</h3>\n <textarea id=\"question\" name=\"pertanyaan\" style=\"width:100%;height:200px;\">";
// line 77
echo set_value("pertanyaan");
echo "</textarea>\n </td>\n </tr>\n ";
// line 80
if ($this->getAttribute(isset($context["tugas"]) ? $context["tugas"] : null, "type_id") == 3) {
// line 81
echo " <tr>\n <td>\n <div class=\"pull-right controls\">\n <label class=\"radio inline\"><input type=\"radio\" name=\"kunci\" value=\"pilihan_1\" ";
// line 84
echo twig_escape_filter($this->env, set_radio("kunci", "pilihan_1", get_post_data("kunci") == "" ? true : ""), "html", null, true);
echo "> <b class=\"text-warning\">Jadikan Kunci</b></label>\n </div>\n <h3>Pilihan A</h3>\n <textarea class=\"tiny_options\" name=\"pilihan_1\" style=\"width:100%;height:200px;\">";
// line 87
echo set_value("pilihan_1");
echo "</textarea>\n </td>\n </tr>\n <tr>\n <td>\n <div class=\"pull-right controls\">\n <label class=\"radio inline\"><input type=\"radio\" name=\"kunci\" value=\"pilihan_2\" ";
// line 93
echo twig_escape_filter($this->env, set_radio("kunci", "pilihan_2"), "html", null, true);
echo "> <b class=\"text-warning\">Jadikan Kunci</b></label>\n </div>\n <h3>Pilihan B</h3>\n <textarea class=\"tiny_options\" name=\"pilihan_2\" style=\"width:100%;height:200px;\">";
// line 96
echo set_value("pilihan_2");
echo "</textarea>\n </td>\n </tr>\n <tr>\n <td>\n <div class=\"pull-right controls\">\n <label class=\"radio inline\"><input type=\"radio\" name=\"kunci\" value=\"pilihan_3\" ";
// line 102
echo twig_escape_filter($this->env, set_radio("kunci", "pilihan_3"), "html", null, true);
echo "> <b class=\"text-warning\">Jadikan Kunci</b></label>\n </div>\n <h3>Pilihan C</h3>\n <textarea class=\"tiny_options\" name=\"pilihan_3\" style=\"width:100%;height:200px;\">";
// line 105
echo set_value("pilihan_3");
echo "</textarea>\n </td>\n </tr>\n <tr>\n <td>\n <div class=\"pull-right controls\">\n <label class=\"radio inline\"><input type=\"radio\" name=\"kunci\" value=\"pilihan_4\" ";
// line 111
echo twig_escape_filter($this->env, set_radio("kunci", "pilihan_4"), "html", null, true);
echo "> <b class=\"text-warning\">Jadikan Kunci</b></label>\n </div>\n <h3>Pilihan D</h3>\n <textarea class=\"tiny_options\" name=\"pilihan_4\" style=\"width:100%;height:200px;\">";
// line 114
echo set_value("pilihan_4");
echo "</textarea>\n </td>\n </tr>\n ";
}
// line 118
echo " <tr>\n <td>\n <button class=\"btn btn-primary\" type=\"submit\">Simpan</button>\n <a class=\"btn btn-default\" href=\"";
// line 121
echo twig_escape_filter($this->env, site_url("admin/tugas/soal/" . $this->getAttribute(isset($context["mapel_ajar"]) ? $context["mapel_ajar"] : null, "id") . "/" . $this->getAttribute(isset($context["tugas"]) ? $context["tugas"] : null, "id")), "html", null, true);
echo "\">Batal</a>\n </td>\n </tr>\n </tbody>\n </table>\n ";
// line 126
echo form_close();
echo "\n </div>\n </div>\n</div>\n";
}
开发者ID:Raniratna,项目名称:new_elearning,代码行数:101,代码来源:67e3da52a21d786d44ebdda9bc4b8be632a0657be050a51a749fbff17e51.php
示例5: split_topic
/**
* Split topic
*/
function split_topic($action, $topic_id, $to_forum_id, $subject)
{
global $db, $template, $user, $phpEx, $phpbb_root_path, $auth, $config;
$post_id_list = request_var('post_id_list', array(0));
$forum_id = request_var('forum_id', 0);
$start = request_var('start', 0);
if (!sizeof($post_id_list)) {
$template->assign_var('MESSAGE', $user->lang['NO_POST_SELECTED']);
return;
}
if (!check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_split'))) {
return;
}
$post_id = $post_id_list[0];
$post_info = get_post_data(array($post_id));
if (!sizeof($post_info)) {
$template->assign_var('MESSAGE', $user->lang['NO_POST_SELECTED']);
return;
}
$post_info = $post_info[$post_id];
$subject = trim($subject);
// Make some tests
if (!$subject) {
$template->assign_var('MESSAGE', $user->lang['EMPTY_SUBJECT']);
return;
}
if ($to_forum_id <= 0) {
$template->assign_var('MESSAGE', $user->lang['NO_DESTINATION_FORUM']);
return;
}
$forum_info = get_forum_data(array($to_forum_id), 'f_post');
if (!sizeof($forum_info)) {
$template->assign_var('MESSAGE', $user->lang['USER_CANNOT_POST']);
return;
}
$forum_info = $forum_info[$to_forum_id];
if ($forum_info['forum_type'] != FORUM_POST) {
$template->assign_var('MESSAGE', $user->lang['FORUM_NOT_POSTABLE']);
return;
}
$redirect = request_var('redirect', build_url(array('quickmod')));
$s_hidden_fields = build_hidden_fields(array('i' => 'main', 'post_id_list' => $post_id_list, 'f' => $forum_id, 'mode' => 'topic_view', 'start' => $start, 'action' => $action, 't' => $topic_id, 'redirect' => $redirect, 'subject' => $subject, 'to_forum_id' => $to_forum_id, 'icon' => request_var('icon', 0)));
$success_msg = $return_link = '';
if (confirm_box(true)) {
if ($action == 'split_beyond') {
$sort_days = $total = 0;
$sort_key = $sort_dir = '';
$sort_by_sql = $sort_order_sql = array();
mcp_sorting('viewtopic', $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $forum_id, $topic_id);
$limit_time_sql = $sort_days ? 'AND t.topic_last_post_time >= ' . (time() - $sort_days * 86400) : '';
if ($sort_order_sql[0] == 'u') {
$sql = 'SELECT p.post_id, p.forum_id, p.post_approved
FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . " u\n\t\t\t\t\tWHERE p.topic_id = {$topic_id}\n\t\t\t\t\t\tAND p.poster_id = u.user_id\n\t\t\t\t\t\t{$limit_time_sql}\n\t\t\t\t\tORDER BY {$sort_order_sql}";
} else {
$sql = 'SELECT p.post_id, p.forum_id, p.post_approved
FROM ' . POSTS_TABLE . " p\n\t\t\t\t\tWHERE p.topic_id = {$topic_id}\n\t\t\t\t\t\t{$limit_time_sql}\n\t\t\t\t\tORDER BY {$sort_order_sql}";
}
$result = $db->sql_query_limit($sql, 0, $start);
$store = false;
$post_id_list = array();
while ($row = $db->sql_fetchrow($result)) {
// If split from selected post (split_beyond), we split the unapproved items too.
if (!$row['post_approved'] && !$auth->acl_get('m_approve', $row['forum_id'])) {
// continue;
}
// Start to store post_ids as soon as we see the first post that was selected
if ($row['post_id'] == $post_id) {
$store = true;
}
if ($store) {
$post_id_list[] = $row['post_id'];
}
}
$db->sql_freeresult($result);
}
if (!sizeof($post_id_list)) {
trigger_error('NO_POST_SELECTED');
}
$icon_id = request_var('icon', 0);
$sql_ary = array('forum_id' => $to_forum_id, 'topic_title' => $subject, 'icon_id' => $icon_id, 'topic_approved' => 1);
$sql = 'INSERT INTO ' . TOPICS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
$db->sql_query($sql);
$to_topic_id = $db->sql_nextid();
move_posts($post_id_list, $to_topic_id);
$topic_info = get_topic_data(array($topic_id));
$topic_info = $topic_info[$topic_id];
add_log('mod', $to_forum_id, $to_topic_id, 'LOG_SPLIT_DESTINATION', $subject);
add_log('mod', $forum_id, $topic_id, 'LOG_SPLIT_SOURCE', $topic_info['topic_title']);
// Change topic title of first post
$sql = 'UPDATE ' . POSTS_TABLE . "\n\t\t\tSET post_subject = '" . $db->sql_escape($subject) . "'\n\t\t\tWHERE post_id = {$post_id_list[0]}";
$db->sql_query($sql);
$success_msg = 'TOPIC_SPLIT_SUCCESS';
// Update forum statistics
set_config_count('num_topics', 1, true);
// Link back to both topics
$return_link = sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", 'f=' . $post_info['forum_id'] . '&t=' . $post_info['topic_id']) . '">', '</a>') . '<br /><br />' . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.{$phpEx}", 'f=' . $to_forum_id . '&t=' . $to_topic_id) . '">', '</a>');
} else {
//.........这里部分代码省略.........
开发者ID:Grprashanthkumar,项目名称:ColfusionWeb,代码行数:101,代码来源:mcp_topic.php
示例6: api_auth_hmac
/**
* PAM: Confirm the HMAC signature
*
* @return true if success - otherwise throws exception
*
* @throws SecurityException
* @since 1.7.0
* @access private
*/
function api_auth_hmac()
{
global $CONFIG;
// Get api header
$api_header = get_and_validate_api_headers();
// Pull API user details
$api_user = get_api_user($CONFIG->site_id, $api_header->api_key);
if (!$api_user) {
throw new SecurityException(elgg_echo('SecurityException:InvalidAPIKey'), ErrorResult::$RESULT_FAIL_APIKEY_INVALID);
}
// Get the secret key
$secret_key = $api_user->secret;
// get the query string
$query = substr($_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'], '?') + 1);
// calculate expected HMAC
$hmac = calculate_hmac($api_header->hmac_algo, $api_header->time, $api_header->nonce, $api_header->api_key, $secret_key, $query, $api_header->method == 'POST' ? $api_header->posthash : "");
if ($api_header->hmac !== $hmac) {
throw new SecurityException("HMAC is invalid. {$api_header->hmac} != [calc]{$hmac}");
}
// Now make sure this is not a replay
if (cache_hmac_check_replay($hmac)) {
throw new SecurityException(elgg_echo('SecurityException:DupePacket'));
}
// Validate post data
if ($api_header->method == "POST") {
$postdata = get_post_data();
$calculated_posthash = calculate_posthash($postdata, $api_header->posthash_algo);
if (strcmp($api_header->posthash, $calculated_posthash) != 0) {
$msg = elgg_echo('SecurityException:InvalidPostHash', array($calculated_posthash, $api_header->posthash));
throw new SecurityException($msg);
}
}
return true;
}
开发者ID:socialweb,项目名称:PiGo,代码行数:43,代码来源:web_services.php
示例7: mn_natcasesort
$comments[] .= $c_line;
}
}
}
}
$c_trash = 0;
if (!empty($comments)) {
$comments = mn_natcasesort($comments);
$comments = array_reverse($comments);
$comments_result = '';
$c_count = 0;
$c_authors = array();
$c_ips = array();
foreach ($comments as $comments_line) {
$var = get_values('comments', $comments_line, false);
$post = get_post_data($var['post_id']);
$comments_timestamps[$var['timestamp']] = date('Y-m', $var['timestamp']);
if (isset($var['author_id']) && !empty($var['author_id'])) {
$c_authors[] = $var['author_id'];
}
if (isset($var['ip_address']) && !empty($var['ip_address'])) {
$c_ips[] = $var['ip_address'];
}
if (isset($var['status']) && $var['status'] == 0) {
$c_trash++;
}
$posts[$post['id']] = $post['title'];
if (!isset($_GET['trash']) && $var['status'] == 0) {
continue;
}
if (isset($_GET['trash']) && $var['status'] != 0) {
开发者ID:deanbrabec,项目名称:news_slider,代码行数:31,代码来源:mn-comments.php
示例8: main
function main($id, $mode)
{
global $auth, $db, $user, $template;
global $config, $phpbb_root_path, $phpEx, $action;
include_once $phpbb_root_path . 'includes/functions_posting.' . $phpEx;
$forum_id = request_var('f', 0);
$start = request_var('start', 0);
$this->page_title = 'MCP_QUEUE';
switch ($action) {
case 'approve':
case 'disapprove':
include_once $phpbb_root_path . 'includes/functions_messenger.' . $phpEx;
$post_id_list = request_var('post_id_list', array(0));
if (!sizeof($post_id_list)) {
trigger_error('NO_POST_SELECTED');
}
if ($action == 'approve') {
approve_post($post_id_list, $mode);
} else {
disapprove_post($post_id_list, $mode);
}
break;
}
switch ($mode) {
case 'approve_details':
$user->add_lang('posting');
$post_id = request_var('p', 0);
$topic_id = request_var('t', 0);
if ($topic_id) {
$topic_info = get_topic_data(array($topic_id), 'm_approve');
if (isset($topic_info[$topic_id]['topic_first_post_id'])) {
$post_id = (int) $topic_info[$topic_id]['topic_first_post_id'];
} else {
$topic_id = 0;
}
}
$post_info = get_post_data(array($post_id), 'm_approve');
if (!sizeof($post_info)) {
trigger_error('NO_POST_SELECTED');
}
$post_info = $post_info[$post_id];
if ($post_info['topic_first_post_id'] != $post_id && topic_review($post_info['topic_id'], $post_info['forum_id'], 'topic_review', 0, false)) {
$template->assign_vars(array('S_TOPIC_REVIEW' => true, 'TOPIC_TITLE' => $post_info['topic_title']));
}
// Set some vars
if ($post_info['user_id'] == ANONYMOUS) {
$poster = $post_info['post_username'] ? $post_info['post_username'] : $user->lang['GUEST'];
}
$poster = $post_info['user_colour'] ? '<span style="color:#' . $post_info['user_colour'] . '">' . $post_info['username'] . '</span>' : $post_info['username'];
// Process message, leave it uncensored
$message = $post_info['post_text'];
if ($post_info['bbcode_bitfield']) {
include_once $phpbb_root_path . 'includes/bbcode.' . $phpEx;
$bbcode = new bbcode($post_info['bbcode_bitfield']);
$bbcode->bbcode_second_pass($message, $post_info['bbcode_uid'], $post_info['bbcode_bitfield']);
}
$message = smiley_text($message);
$template->assign_vars(array('S_MCP_QUEUE' => true, 'S_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.{$phpEx}", "i=queue&p={$post_id}&f={$forum_id}"), 'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']), 'S_POST_REPORTED' => $post_info['post_reported'], 'S_POST_UNAPPROVED' => !$post_info['post_approved'], 'S_POST_LOCKED' => $post_info['post_edit_locked'], 'S_USER_NOTES' => true, 'U_EDIT' => $auth->acl_get('m_edit', $post_info['forum_id']) ? append_sid("{$phpbb_root_path}posting.{$phpEx}", "mode=edit&f={$post_info['forum_id']}&p={$post_info['post_id']}") : '', 'U_MCP_APPROVE' => append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=queue&mode=approve_details&f=' . $post_info['forum_id'] . '&p=' . $post_id), 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=reports&mode=report_details&f=' . $post_info['forum_id'] . '&p=' . $post_id), 'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=notes&mode=user_notes&u=' . $post_info['user_id']), 'U_MCP_WARN_USER' => $auth->acl_getf_global('m_warn') ? append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=warn&mode=warn_user&u=' . $post_info['user_id']) : '', 'U_VIEW_PROFILE' => $post_info['user_id'] != ANONYMOUS ? append_sid("{$phpbb_root_path}memberlist.{$phpEx}", 'mode=viewprofile&u=' . $post_info['user_id']) : '', 'RETURN_QUEUE' => sprintf($user->lang['RETURN_QUEUE'], '<a href="' . append_sid("{$phpbb_root_path}mcp.{$phpEx}", 'i=queue' . ($topic_id ? '&mode=unapproved_topics' : '&mode=unapproved_posts')) . "&start={$start}\">", '</a>'), 'REPORTED_IMG' => $user->img('icon_reported', $user->lang['POST_REPORTED']), 'UNAPPROVED_IMG' => $user->img('icon_unapproved', $user->lang['POST_UNAPPROVED']), 'EDIT_IMG' => $user->img('btn_edit', $user->lang['EDIT_POST']), 'POSTER_NAME' => $poster, 'POST_PREVIEW' => $message, 'POST_SUBJECT' => $post_info['post_subject'], 'POST_DATE' => $user->format_date($post_info['post_time']), 'POST_IP' => $post_info['poster_ip'], 'POST_IPADDR' => @gethostbyaddr($post_info['poster_ip']), 'POST_ID' => $post_info['post_id']));
$this->tpl_name = 'mcp_post';
break;
case 'unapproved_topics':
case 'unapproved_posts':
$topic_id = request_var('t', 0);
$forum_info = array();
if ($topic_id) {
$topic_info = get_topic_data(array($topic_id));
if (!sizeof($topic_info)) {
trigger_error($user->lang['TOPIC_NOT_EXIST']);
}
$topic_info = $topic_info[$topic_id];
$forum_id = $topic_info['forum_id'];
}
$forum_list_approve = get_forum_list('m_approve', false, true);
if (!$forum_id) {
$forum_list = array();
foreach ($forum_list_approve as $row) {
$forum_list[] = $row['forum_id'];
}
if (!($forum_list = implode(', ', $forum_list))) {
trigger_error('NOT_MODERATOR');
}
$sql = 'SELECT SUM(forum_topics) as sum_forum_topics
FROM ' . FORUMS_TABLE . "\n\t\t\t\t\t\tWHERE forum_id IN (0, {$forum_list})";
$result = $db->sql_query($sql);
$forum_info['forum_topics'] = (int) $db->sql_fetchfield('sum_forum_topics');
$db->sql_freeresult($result);
$global_id = $forum_list[0];
} else {
$forum_info = get_forum_data(array($forum_id), 'm_approve');
if (!sizeof($forum_info)) {
trigger_error('NOT_MODERATOR');
}
$forum_info = $forum_info[$forum_id];
$forum_list = $forum_id;
$global_id = $forum_id;
}
$forum_options = '<option value="0"' . ($forum_id == 0 ? ' selected="selected"' : '') . '>' . $user->lang['ALL_FORUMS'] . '</option>';
foreach ($forum_list_approve as $row) {
$forum_options .= '<option value="' . $row['forum_id'] . '"' . ($forum_id == $row['forum_id'] ? ' selected="selected"' : '') . '>' . $row['forum_name'] . '</option>';
}
//.........这里部分代码省略.........
开发者ID:yunsite,项目名称:gloryroad,代码行数:101,代码来源:mcp_queue.php
示例9: mysql_query
echo '<form action="?action=search" method="post"><p><input name="search" type="text" value="' . $post_data['search'] . '"/></p><p><input type="submit" value="搜索" /></p></form>';
if ($_POST) {
$search_query = mysql_query('select * from `music_list` where `name` like \'%' . $post_data['search'] . '%\' or `singer` like \'%' . $post_data['search'] . '%\' or `url` like \'%' . $post_data['search'] . '%\'');
if (mysql_num_rows($search_query) > 0) {
echo '<ol>';
while (($value = mysql_fetch_array($search_query)) !== false) {
echo '<li>' . $value['name'] . ' - ' . $value['singer'] . ' <a href="' . $_SERVER['PHP_SELF'] . '?action=edit&id=' . $value['id'] . '">编辑</a> <a href="' . $_SERVER['PHP_SELF'] . '?action=del&id=' . $value['id'] . '">删除</a></li>';
}
echo '</ol><a href="' . $_SERVER['PHP_SELF'] . '">返回首页</a>';
} else {
echo '<p>无搜索结果</p>';
}
}
} elseif ($_GET['action'] == 'add') {
if ($_POST) {
$post_data = get_post_data();
$insert_query = mysql_query('insert into `music_list`(`name`,`url`,`singer`,`lrc`,`lrc_data`) values(\'' . $post_data['name'] . '\',\'' . $post_data['url'] . '\',\'' . $post_data['singer'] . '\',\'' . $post_data['lrc'] . '\',\'' . $post_data['lrc_data'] . '\')');
if ($insert_query) {
msg('数据插入成功');
} else {
msg('数据插入失败<br />' . mysql_errno() . ' ' . mysql_error());
}
} else {
echo '<form action="" method="post"><p><label>歌 名:<input type="text" name="name" /></p><p><label>歌 手:<input type="text" name="singer" /></p><p><label>下载地址:<input type="text" name="url" value="http://" /></p><p><a href="http://tool.liujiantao.me/upload/" target="_blank">歌曲上传</a></p><p>显示 lrc 歌词: <label><input type="radio" name="lrc" value="1" />是</label> <label><input type="radio" name="lrc" value="0" checked="checked" />否</label></p><p>lrc 歌词(可选):<br /><textarea name="lrc_data">' . htmlspecialchars($select_query['lrc_data']) . '</textarea></p><p><input type="submit" name="submit" value="确定" /><a href="' . $_SERVER['PHP_SELF'] . '">取消</a></p></form>';
}
} else {
echo '<form action="?action=search" method="post"><p><input name="search" type="text" /></p><p><input type="submit" value="搜索" /></p></form>';
$all_list = get_music();
echo '<ol>';
foreach ($all_list as $value) {
echo '<li>' . $value['name'] . ' - ' . $value['singer'] . ' <a href="' . $_SERVER['PHP_SELF'] . '?action=edit&id=' . $value['id'] . '">编辑</a> <a href="' . $_SERVER['PHP_SELF'] . '?action=del&id=' . $value['id'] . '">删除</a></li>';
开发者ID:Jonham,项目名称:TT-Get-Lrc,代码行数:31,代码来源:list.php
示例10: m_get_report_post_func
function m_get_report_post_func()
{
global $template, $auth, $user;
$posts = array();
foreach ($template->_tpldata['postrow'] as $postinfo) {
$posts[] = $postinfo['POST_ID'];
}
$posts = get_post_data($posts);
$post_list = array();
foreach ($template->_tpldata['postrow'] as $postinfo) {
$post = $posts[$postinfo['POST_ID']];
if (empty($post['forum_id'])) {
$user->setup('viewforum');
$post['forum_id'] = 0;
$post['forum_name'] = $user->lang['ANNOUNCEMENTS'];
}
$post_list[] = new xmlrpcval(array('forum_id' => new xmlrpcval($post['forum_id']), 'forum_name' => new xmlrpcval(basic_clean($post['forum_name']), 'base64'), 'topic_id' => new xmlrpcval($post['topic_id']), 'topic_title' => new xmlrpcval(basic_clean($post['topic_title']), 'base64'), 'post_id' => new xmlrpcval($post['post_id']), 'post_title' => new xmlrpcval(basic_clean($post['post_subject']), 'base64'), 'post_author_name' => new xmlrpcval(basic_clean($post['username']), 'base64'), 'icon_url' => new xmlrpcval(get_user_avatar_url($post['user_avatar'], $post['user_avatar_type'])), 'post_time' => new xmlrpcval(mobiquo_iso8601_encode($post['post_time']), 'dateTime.iso8601'), 'short_content' => new xmlrpcval(process_short_content($post['post_text']), 'base64'), 'can_delete' => new xmlrpcval($auth->acl_get('m_delete', $forum_id), 'boolean')), 'struct');
}
$response = new xmlrpcval(array('total_report_num' => new xmlrpcval($template->_rootref['TOTAL'], 'int'), 'reports' => new xmlrpcval($post_list, 'array')), 'struct');
return new xmlrpcresp($response);
}
开发者ID:danielgospodinow,项目名称:GamingZone,代码行数:21,代码来源:moderation.php
示例11: disapprove_post
/**
* Disapprove Post/Topic
*/
function disapprove_post($post_id_list, $mode)
{
global $_CLASS, $_CORE_CONFIG, $config;
$forum_id = request_var('f', 0);
if (!check_ids($post_id_list, FORUMS_POSTS_TABLE, 'post_id', 'm_approve')) {
trigger_error('NOT_AUTHORIZED');
}
$redirect = request_var('redirect', $_CLASS['core_user']->data['session_page']);
$reason = request_var('reason', '', true);
$reason_id = request_var('reason_id', 0);
$success_msg = $additional_msg = '';
$s_hidden_fields = build_hidden_fields(array('i' => 'queue', 'f' => $forum_id, 'mode' => $mode, 'post_id_list' => $post_id_list, 'mode' => 'disapprove', 'redirect' => $redirect));
$notify_poster = isset($_REQUEST['notify_poster']);
$disapprove_reason = '';
if ($reason_id) {
$sql = 'SELECT reason_title, reason_description
FROM ' . FORUMS_REPORTS_REASONS_TABLE . " \n\t\t\tWHERE reason_id = {$reason_id}";
$result = $_CLASS['core_db']->query($sql);
$row = $_CLASS['core_db']->fetch_row_assoc($result);
$_CLASS['core_db']->free_result($result);
if (!$row || !$reason && $row['reason_name'] === 'other') {
$additional_msg = $_CLASS['core_user']->lang['NO_REASON_DISAPPROVAL'];
unset($_POST['confirm']);
} else {
$disapprove_reason = $row['reason_title'] != 'other' ? isset($_CLASS['core_user']->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])]) ? $_CLASS['core_user']->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])] : $row['reason_description'] : '';
$disapprove_reason .= $reason ? "\n\n" . $reason : '';
unset($reason);
}
}
require_once SITE_FILE_ROOT . 'includes/forums/functions_display.php';
$reason = display_reasons($reason_id);
$_CLASS['core_template']->assign_array(array('S_NOTIFY_POSTER' => true, 'S_APPROVE' => false, 'REASON' => $reason, 'ADDITIONAL_MSG' => $additional_msg));
if (display_confirmation($_CLASS['core_user']->get_lang('DISAPPROVE_POST' . (sizeof($post_id_list) == 1 ? '' : 'S')), $s_hidden_fields, 'modules/forums/mcp_approve.html')) {
$post_info = get_post_data($post_id_list, 'm_approve');
// If Topic -> forum_topics_real -= 1
// If Post -> topic_replies_real -= 1
$forum_topics_real = 0;
$topic_replies_real_sql = $post_disapprove_sql = $topic_id_list = array();
foreach ($post_info as $post_id => $post_data) {
$topic_id_list[$post_data['topic_id']] = 1;
// Topic or Post. ;)
if ($post_data['topic_first_post_id'] == $post_id && $post_data['topic_last_post_id'] == $post_id) {
if ($post_data['forum_id']) {
$forum_topics_real++;
}
} else {
if (!isset($topic_replies_real_sql[$post_data['topic_id']])) {
$topic_replies_real_sql[$post_data['topic_id']] = 1;
} else {
$topic_replies_real_sql[$post_data['topic_id']]++;
}
}
$post_disapprove_sql[] = $post_id;
}
if ($forum_topics_real) {
$sql = 'UPDATE ' . FORUMS_FORUMS_TABLE . "\n\t\t\t\tSET forum_topics_real = forum_topics_real - {$forum_topics_real}\n\t\t\t\tWHERE forum_id = {$forum_id}";
$_CLASS['core_db']->query($sql);
}
if (!empty($topic_replies_real_sql)) {
foreach ($topic_replies_real_sql as $topic_id => $num_replies) {
$sql = 'UPDATE ' . FORUMS_TOPICS_TABLE . "\n\t\t\t\t\tSET topic_replies_real = topic_replies_real - {$num_replies}\n\t\t\t\t\tWHERE topic_id = {$topic_id}";
$_CLASS['core_db']->query($sql);
}
}
if (sizeof($post_disapprove_sql)) {
if (!function_exists('delete_posts')) {
require_once SITE_FILE_ROOT . 'includes/forums/functions_admin.php';
}
// We do not check for permissions here, because the moderator allowed approval/disapproval should be allowed to delete the disapproved posts
delete_posts('post_id', $post_disapprove_sql);
}
unset($post_disapprove_sql, $topic_replies_real_sql);
update_post_information('topic', array_keys($topic_id_list));
update_post_information('forum', $forum_id);
unset($topic_id_list);
// Notify Poster?
if ($notify_poster) {
require_once SITE_FILE_ROOT . 'includes/mailer.php';
$mailer = new core_mailer();
foreach ($post_info as $post_id => $post_data) {
if ($post_data['poster_id'] == ANONYMOUS) {
continue;
}
$post_data['post_subject'] = censor_text($post_data['post_subject'], true);
$post_data['topic_title'] = censor_text($post_data['topic_title'], true);
if ($post_data['post_id'] == $post_data['topic_first_post_id'] && $post_data['post_id'] == $post_data['topic_last_post_id']) {
$email_template = 'topic_disapproved.txt';
$subject = 'Topic Disapproved - ' . $post_data['topic_title'];
} else {
$email_template = 'post_disapproved.txt';
$subject = 'Post Disapproved - ' . $post_data['post_subject'];
}
$mailer->to($post_data['user_email'], $post_data['username']);
//$mailer->reply_to($_CORE_CONFIG['email']['site_email']);
$mailer->subject($subject);
//$messenger->im($post_data['user_jabber'], $post_data['username']);
$_CLASS['core_template']->assign_array(array('SITENAME' => $_CORE_CONFIG['global']['site_name'], 'USERNAME' => $post_data['username'], 'REASON' => stripslashes($disapprove_reason), 'POST_SUBJECT' => $post_data['post_subject'], 'TOPIC_TITLE' => $post_data['topic_title']));
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:viperals-svn,代码行数:101,代码来源:mcp_queue.php
示例12: mcp_delete_post
function mcp_delete_post($post_ids)
{
global $_CLASS;
if (!check_ids($post_ids, FORUMS_POSTS_TABLE, 'post_id', 'm_delete')) {
return;
}
$redirect = get_variable('redirect', 'POST', $_CLASS['core_user']->data['session_url']);
$hidden_fields = generate_hidden_fields(array('post_id_list' => $post_ids, 'mode' => 'delete_post', 'redirect' => $redirect));
$success_msg = '';
$message = $_CLASS['core_user']->get_lang(count($post_ids) === 1 ? 'DELETE_POST' : 'DELETE_POSTS');
if (display_confirmation($message, $hidden_fields)) {
// Count the number of topics that are affected
// I did not use COUNT(DISTINCT ...) because I remember having problems
// with it on older versions of MySQL -- Ashe
$sql = 'SELECT DISTINCT topic_id
FROM ' . FORUMS_POSTS_TABLE . '
WHERE post_id IN (' . implode(', ', $post_ids) . ')';
$result = $_CLASS['core_db']->query($sql);
$topic_id_list = array();
while ($row = $_CLASS['core_db']->fetch_row_assoc($result)) {
$topic_id_list[] = $row['topic_id'];
}
$_CLASS['core_db']->free_result($result);
$affected_topics = count($topic_id_list);
$post_data = get_post_data($post_ids);
foreach ($post_data as $id => $row) {
add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_DELETE_POST', $row['post_subject']);
}
unset($post_data);
// Now delete the posts, topics and forums are automatically resync'ed
delete_posts('post_id', $post_ids);
$sql = 'SE
|
请发表评论