本文整理汇总了PHP中get_post_link函数的典型用法代码示例。如果您正苦于以下问题:PHP get_post_link函数的具体用法?PHP get_post_link怎么用?PHP get_post_link使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_post_link函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: spamalyser_build_post_path
function spamalyser_build_post_path(&$logitem)
{
global $lang, $forums, $mybb;
$bburl = htmlspecialchars_uni($mybb->settings['bburl'] . '/');
$subject = htmlspecialchars_uni($logitem['subject']);
if ($logitem['real_pid']) {
$subject = '<a href="' . $bburl . get_post_link($logitem['pid'], $logitem['tid']) . '#pid' . $logitem['pid'] . '" target="_blank">' . $subject . '</a>';
}
if ($logitem['threadsubject']) {
if ($logitem['real_tid']) {
$subject = '<a href="' . $bburl . get_thread_link($logitem['tid']) . '" target="_blank">' . htmlspecialchars_uni($logitem['threadsubject']) . '</a> » ' . $subject;
} else {
$subject = htmlspecialchars_uni($logitem['threadsubject']) . ' » ' . $subject;
}
}
if (empty($forums)) {
$forums = $GLOBALS['cache']->read('forums');
}
if ($forums[$logitem['fid']]) {
$subject = '<a href="' . $bburl . get_forum_link($logitem['fid']) . '" target="_blank">' . $forums[$logitem['fid']]['name'] . '</a> » ' . $subject;
}
// new/edit icons
if ($logitem['event'] == 0) {
$subject = '<img src="spamalyser_img/post_new.gif" title="' . $lang->icon_new_thread_post . '" alt="' . $lang->icon_alt_new_thread_post . '" style="margin-right: 0.5em; font-size: smaller; vertical-align: middle;" />' . $subject;
} elseif ($logitem['event'] == 2) {
$subject = '<img src="spamalyser_img/post_merge.gif" title="' . $lang->icon_merge_post . '" alt="' . $lang->icon_alt_merge_post . '" style="margin-right: 0.5em; font-size: smaller; vertical-align: middle;" />' . $subject;
} else {
$subject = '<img src="spamalyser_img/post_edit.gif" title="' . $lang->icon_edit_thread_post . '" alt="' . $lang->icon_alt_edit_thread_post . '" style="margin-right: 0.5em; font-size: smaller; vertical-align: middle;" />' . $subject;
}
return $subject;
}
开发者ID:andarms,项目名称:python-gaming.com,代码行数:31,代码来源:spamalyserlog.php
示例2: em_reply_link
/**
* Add reply link below each post
*
* @param $post_links Array of the links
* @param $args Array of args
*/
function em_reply_link($post_links = array(), $args = array())
{
global $em_plugopts;
if ($em_plugopts['reply-link'] == 1 && $em_plugopts['reply-text'] && bb_is_topic() && topic_is_open() && (bb_is_user_logged_in() || function_exists('bb_is_login_required') && !bb_is_login_required())) {
/* Check if link is needed */
$text = str_replace("%%POSTLINK%%", get_post_link(), str_replace("%%USERNAME%%", get_post_author(), $em_plugopts['reply-text']));
$js = "var ema=document.getElementById('post_content');var emb=ema.value;if(emb!='')emb+='\\n\\n';ema.value=emb+'" . $text . "\\n\\n';ema.focus();void(0);";
$post_links[] = $args['before_each'] . '<a class="reply_link" style="cursor:pointer" onclick="' . $js . '">' . __('Reply', 'easy-mentions') . '</a>' . $args['after_each'];
}
return $post_links;
}
开发者ID:achorg,项目名称:DH-Answers,代码行数:17,代码来源:public.php
示例3: mycode_parse_post_quotes
/**
* Parses quotes with post id and/or dateline.
*
* @param string The message to be parsed
* @param string The username to be parsed
* @param boolean Are we formatting as text?
* @return string The parsed message.
*/
function mycode_parse_post_quotes($message, $username, $text_only = false)
{
global $lang, $templates, $theme, $mybb;
$linkback = $date = "";
$message = trim($message);
$message = preg_replace("#(^<br(\\s?)(\\/?)>|<br(\\s?)(\\/?)>\$)#i", "", $message);
if (!$message) {
return '';
}
$message = str_replace('\\"', '"', $message);
$username = str_replace('\\"', '"', $username) . "'";
$delete_quote = true;
preg_match("#pid=(?:"|\"|')?([0-9]+)[\"']?(?:"|\"|')?#i", $username, $match);
if (intval($match[1])) {
$pid = intval($match[1]);
$url = $mybb->settings['bburl'] . "/" . get_post_link($pid) . "#pid{$pid}";
if (defined("IN_ARCHIVE")) {
$linkback = " <a href=\"{$url}\">[ -> ]</a>";
} else {
eval("\$linkback = \" " . $templates->get("postbit_gotopost", 1, 0) . "\";");
}
$username = preg_replace("#(?:"|\"|')? pid=(?:"|\"|')?[0-9]+[\"']?(?:"|\"|')?#i", '', $username);
$delete_quote = false;
}
unset($match);
preg_match("#dateline=(?:"|\"|')?([0-9]+)(?:"|\"|')?#i", $username, $match);
if (intval($match[1])) {
$dateline = intval($match[1]);
if ($match[1] < TIME_NOW) {
$postdate = my_date($mybb->settings['dateformat'], intval($match[1]));
$posttime = my_date($mybb->settings['timeformat'], intval($match[1]));
$date = " ({$postdate} {$posttime})";
}
$username = preg_replace("#(?:"|\"|')? dateline=(?:"|\"|')?[0-9]+(?:"|\"|')?#i", '', $username);
$delete_quote = false;
}
if ($delete_quote) {
$username = my_substr($username, 0, my_strlen($username) - 1);
}
if ($text_only) {
return "\n" . htmlspecialchars_uni($username) . " {$lang->wrote}{$date}\n--\n{$message}\n--\n";
} else {
$span = "";
if (!$delete_quote) {
$span = "<span>{$date}</span>";
}
$username = preg_replace('/^\\\'/is', '', $username);
$userinfo = tt_get_user_id_by_name($username);
if (!empty($userinfo)) {
$uid = $userinfo['uid'];
}
return "[quote " . (isset($uid) ? "uid={$uid} " : '') . (!empty($username) ? "name=\"{$username}\" " : '') . (isset($pid) ? "post={$pid} " : '') . (isset($dateline) ? "timestamp={$dateline}" : '') . "]{$message}[/quote]\n";
}
}
开发者ID:dthiago,项目名称:tapatalk-mybb,代码行数:62,代码来源:parser.php
示例4: nm_alert_user_wrote_forum_reply
/**
* Alerts user when someone comments on their forum topic
*
* @Param: the id of the topic
*
* @author: Joe Hoyle
* @version 1.0
**/
function nm_alert_user_wrote_forum_reply($replyID)
{
$userInfo = wp_get_current_user();
$post = bb_get_post($replyID);
$topicAuthor = get_topic_author($post->topic_id);
$topicAuthor = get_userdatabylogin($topicAuthor);
if ($post->poster_id != $topicAuthor->ID) {
$alert = array();
$alert['content'] = '<a href="' . getProfileLink($post->poster_id) . '" title="View ' . nm_user_public_name($post->poster_id) . 's profile">' . nm_user_public_name($post->poster_id) . '</a> has replied to your forum topic: <a href="' . get_post_link($replyID) . '" title="View ' . get_topic_title($topic_id) . '">' . get_topic_title($topic_id) . '</a>.';
$alert['type'] = 'forum';
nm_add_alert($topicAuthor->ID, $alert);
}
return $topicID;
}
开发者ID:popovdenis,项目名称:kmst,代码行数:22,代码来源:nm-user-alerts.php
示例5: rssOratomAction
/**
* @param Request $request
*/
function rssOratomAction($request)
{
if (false == $request->isAction()) {
return;
}
$action = $request->getAction();
if (false == ($action == 'rss' || $action == 'atom')) {
return;
}
global $config, $postHelper;
$action == 'rss' ? $feed = new RSS2() : ($feed = new Atom());
$feed->setTitle(BLOG_TITLE);
$feed->setLink(BLOG_URL);
$feed->setEncoding('utf-8');
if ($action == 'rss') {
$feed->setDescription($config['meta_description']);
$feed->setChannelElement('language', $config['language']);
$feed->setChannelElement('pubDate', date(DATE_RSS, time()));
} else {
$feed->setChannelElement('author', BLOG_TITLE . ' - ' . $config['author_email']);
$feed->setChannelElement('updated', date(DATE_RSS, time()));
}
$posts = $postHelper->getPostList();
if ($posts) {
$c = 0;
foreach ($posts as $post) {
if ($c < $config['feed_max_items']) {
/**
* @params Item
*/
$item = $feed->createNewItem();
// Remove HTML from the RSS feed.
$item->setTitle($post['title']);
$item->setLink(get_post_link($post));
$item->setDate($post['date']);
$item->setId($post['link']);
if ($action == 'rss') {
$item->addElement('author', $post['title']);
$item->addElement('guid', get_post_link($post));
}
$item->setDescription($post->getIntroOrContent());
$feed->addItem($item);
$c++;
}
}
}
$feed->printFeed();
exit;
}
开发者ID:wenerme,项目名称:tellets-php,代码行数:52,代码来源:predefined_hooks.php
示例6: for_buddypress_strip_tags
function for_buddypress_strip_tags($_post, $post)
{
// Cast to an array
$_post = (array) $post;
// Set the URI
$_post['post_uri'] = get_post_link($_post['post_id']);
// Set readable times
$_post['post_time_since'] = bb_since($_post['post_time']);
// Set the display names
$_post['poster_display_name'] = get_user_display_name($_post['poster_id']);
// Remove some sensitive data
unset($_post['poster_ip'], $_post['pingback_queued']);
$_post['post_text'] = str_replace('<', '[', $_post['post_text']);
$_post['post_text'] = str_replace('>', ']', $_post['post_text']);
return $_post;
}
开发者ID:alvaropereyra,项目名称:shrekcms,代码行数:16,代码来源:buddypress-enable.php
示例7: new_get_posts
function new_get_posts()
{
$num = 0;
$link = mysql_connection();
mysqli_select_db($link, "test");
$result = mysqli_query($link, "SELECT id FROM content WHERE type = 'post'");
while ($row = mysqli_fetch_object($result)) {
$ID = $row->id;
$num = $num + 1;
if ($num % 2 != 0) {
if (has_thumbnail($ID)) {
echo '<div class="parallax-window" data-parallax="scroll" data-bleed="50" data-speed="0.1" data-image-src="' . get_thumbnail_link($ID) . '"></div>' . "\n";
}
echo '<section id="post-' . $ID . '" class="post bright">' . "\n" . '<article>' . "\n" . '<h2><a href="' . get_post_link($ID) . '">' . get_post_title($ID) . '</a></h2>' . "\n" . '<p>' . get_post_preview($ID) . '<p>' . "\n" . '</article>' . "\n" . '</section>' . "\n";
} else {
if (has_thumbnail($ID)) {
echo '<div class="parallax-window" data-parallax="scroll" data-bleed="50" data-speed="0.1" data-image-src="' . get_thumbnail_link($row->id) . '"></div>' . "\n";
}
echo '<section id="post-' . $ID . '" class="post dark">' . "\n" . '<article>' . "\n" . '<h2><a href="' . get_post_link($ID) . '">' . get_post_title($ID) . '</a></h2>' . "\n" . '<p>' . get_post_preview($ID) . '<p>' . "\n" . '</article>' . "\n" . '</section>' . "\n";
}
}
}
开发者ID:B2-NET,项目名称:B2-NET-CMS,代码行数:22,代码来源:functions.php
示例8: output_details_000
function output_details_000($update, $noaction)
{
// Output information
if (!empty($update)) {
print "\n<h1>Updates</h1>\n";
foreach ($update as $updated) {
$title = esc_html($updated['post']->post_title);
if (empty(trim($title))) {
$title = 'Missing Post Title';
}
print '<h2><a href="' . get_post_link($updated['blog'], $updated['post']) . '">' . $title . "</a></h2>\n";
print "<h3>Source</h3>\n";
print "<pre><code>\n" . esc_html($updated['source']) . "\n</code></pre>\n\n";
print "<h4>Rewrite</h4>\n";
print "<pre><code>\n" . esc_html($updated['replace']) . "\n</code></pre>\n\n";
}
}
if (!empty($noaction)) {
print "\n<h1>Manual Review (no action applied)</h1>\n";
foreach ($noaction as $review) {
$title = esc_html($review['post']->post_title);
if (empty(trim($title))) {
$title = 'Missing Post Title';
}
print '<h2><a href="' . get_post_link($review['blog'], $review['post']) . '">' . $title . "</a></h2>\n";
print "<h3>Reason</h3>\n";
if (isset($review['unknown pattern'])) {
print "<p>No known URL pattern</p>\n";
print "<h4>Matching content</h4>\n";
print "<pre><code>\n" . esc_html($review['unknown pattern']) . "\n</code></pre>\n\n";
} else {
print "<p>Content matched iframe tag but regex returned no match</p>\n";
}
}
}
}
开发者ID:lumenlearning,项目名称:candela-utility,代码行数:36,代码来源:candela-utility-updates.php
示例9: WarningsHandler
$mybb->user['warningpoints'] = $mybb->settings['maxwarningpoints'];
}
if ($warning_level > 0) {
require_once MYBB_ROOT . 'inc/datahandlers/warnings.php';
$warningshandler = new WarningsHandler('update');
$warningshandler->expire_warnings();
$lang->current_warning_level = $lang->sprintf($lang->current_warning_level, $warning_level, $mybb->user['warningpoints'], $mybb->settings['maxwarningpoints']);
$warnings = '';
// Fetch latest warnings
$query = $db->query("\n\t\t\t\tSELECT w.*, t.title AS type_title, u.username, p.subject AS post_subject\n\t\t\t\tFROM " . TABLE_PREFIX . "warnings w\n\t\t\t\tLEFT JOIN " . TABLE_PREFIX . "warningtypes t ON (t.tid=w.tid)\n\t\t\t\tLEFT JOIN " . TABLE_PREFIX . "users u ON (u.uid=w.issuedby)\n\t\t\t\tLEFT JOIN " . TABLE_PREFIX . "posts p ON (p.pid=w.pid)\n\t\t\t\tWHERE w.uid='{$mybb->user['uid']}'\n\t\t\t\tORDER BY w.expired ASC, w.dateline DESC\n\t\t\t\tLIMIT 5\n\t\t\t");
while ($warning = $db->fetch_array($query)) {
$post_link = "";
if ($warning['post_subject']) {
$warning['post_subject'] = $parser->parse_badwords($warning['post_subject']);
$warning['post_subject'] = htmlspecialchars_uni($warning['post_subject']);
$warning['postlink'] = get_post_link($warning['pid']);
eval("\$post_link .= \"" . $templates->get("usercp_warnings_warning_post") . "\";");
}
$issuedby = build_profile_link($warning['username'], $warning['issuedby']);
$date_issued = my_date('relative', $warning['dateline']);
if ($warning['type_title']) {
$warning_type = $warning['type_title'];
} else {
$warning_type = $warning['title'];
}
$warning_type = htmlspecialchars_uni($warning_type);
if ($warning['points'] > 0) {
$warning['points'] = "+{$warning['points']}";
}
$points = $lang->sprintf($lang->warning_points, $warning['points']);
// Figure out expiration time
开发者ID:mainhan1804,项目名称:xomvanphong,代码行数:31,代码来源:usercp.php
示例10: post_link
function post_link($post_id = 0)
{
echo apply_filters('post_link', get_post_link($post_id), get_post_id($post_id));
}
开发者ID:abc2mit,项目名称:abc2mit.github.io,代码行数:4,代码来源:functions.bb-template.php
示例11: array
exit;
}
// Jump to the next oldest posts.
if ($mybb->input['action'] == "nextoldest") {
$options = array("limit" => 1, "limit_start" => 0, "order_by" => "lastpost", "order_dir" => "desc");
$query = $db->simple_select("threads", "*", "fid=" . $thread['fid'] . " AND lastpost < " . $thread['lastpost'] . " {$visibleonly} AND closed NOT LIKE 'moved|%'", $options);
$nextthread = $db->fetch_array($query);
// Are there actually next oldest posts?
if (!$nextthread['tid']) {
error($lang->error_nonextoldest);
}
$options = array("limit_start" => 0, "limit" => 1, "order_by" => "dateline", "order_dir" => "desc");
$query = $db->simple_select("posts", "pid", "tid='" . $nextthread['tid'] . "'", $options);
// Redirect to the proper page.
$pid = $db->fetch_field($query, "pid");
header("Location: " . htmlspecialchars_decode(get_post_link($pid, $nextthread['tid'])) . "#pid{$pid}");
exit;
}
if (!empty($mybb->input['pid'])) {
$pid = $mybb->input['pid'];
}
// Forumdisplay cache
$forum_stats = $cache->read("forumsdisplay");
$breadcrumb_multipage = array();
if ($mybb->settings['showforumpagesbreadcrumb']) {
// How many pages are there?
if (!$mybb->settings['threadsperpage']) {
$mybb->settings['threadsperpage'] = 20;
}
$query = $db->simple_select("forums", "threads, unapprovedthreads", "fid = '{$fid}'", array('limit' => 1));
$forum_threads = $db->fetch_array($query);
开发者ID:ThinhNguyenVB,项目名称:Gradient-Studios-Website,代码行数:31,代码来源:showthread.php
示例12: alt_trow
$trow = alt_trow();
$username = format_name($logitem['username'], $logitem['usergroup'], $logitem['displaygroup']);
$logitem['profilelink'] = build_profile_link($username, $logitem['uid']);
$logitem['ipaddress'] = my_inet_ntop($db->unescape_binary($logitem['ipaddress']));
if ($logitem['tsubject']) {
$logitem['tsubject'] = htmlspecialchars_uni($logitem['tsubject']);
$logitem['thread'] = get_thread_link($logitem['tid']);
eval("\$information .= \"" . $templates->get("modcp_modlogs_result_thread") . "\";");
}
if ($logitem['fname']) {
$logitem['forum'] = get_forum_link($logitem['fid']);
eval("\$information .= \"" . $templates->get("modcp_modlogs_result_forum") . "\";");
}
if ($logitem['psubject']) {
$logitem['psubject'] = htmlspecialchars_uni($logitem['psubject']);
$logitem['post'] = get_post_link($logitem['pid']);
eval("\$information .= \"" . $templates->get("modcp_modlogs_result_post") . "\";");
}
// Edited a user or managed announcement?
if (!$logitem['tsubject'] || !$logitem['fname'] || !$logitem['psubject']) {
$data = my_unserialize($logitem['data']);
if ($data['uid']) {
$information = $lang->sprintf($lang->edited_user_info, htmlspecialchars_uni($data['username']), get_profile_link($data['uid']));
}
if ($data['aid']) {
$data['subject'] = htmlspecialchars_uni($data['subject']);
$data['announcement'] = get_announcement_link($data['aid']);
eval("\$information .= \"" . $templates->get("modcp_modlogs_result_announcement") . "\";");
}
}
eval("\$modlogresults .= \"" . $templates->get("modcp_modlogs_result") . "\";");
开发者ID:olada,项目名称:mybbintegrator,代码行数:31,代码来源:modcp.php
示例13: bb_admin_list_posts
function bb_admin_list_posts()
{
global $bb_posts, $bb_post;
if (!$bb_posts) {
?>
<p class="no-results"><?php
_e('No posts found.');
?>
</p>
<?php
} else {
?>
<table id="posts-list" class="widefat" cellspacing="0" cellpadding="0">
<thead>
<tr>
<th scope="col" class="check-column"><input type="checkbox" /></th>
<th scope="col"><?php
_e('Post');
?>
</th>
<th scope="col"><?php
_e('Author');
?>
</th>
<th scope="col"><?php
_e('Topic');
?>
</th>
<th scope="col"><?php
_e('Date');
?>
</th>
</tr>
</thead>
<tfoot>
<tr>
<th scope="col" class="check-column"><input type="checkbox" /></th>
<th scope="col"><?php
_e('Post');
?>
</th>
<th scope="col"><?php
_e('Author');
?>
</th>
<th scope="col"><?php
_e('Topic');
?>
</th>
<th scope="col"><?php
_e('Date');
?>
</th>
</tr>
</tfoot>
<tbody>
<?php
foreach ($bb_posts as $bb_post) {
?>
<tr id="post-<?php
post_id();
?>
"<?php
alt_class('post', post_del_class());
?>
>
<td class="check-column"><input type="checkbox" name="post[]" value="<?php
post_id();
?>
" /></td>
<td class="post">
<?php
post_text();
?>
<div>
<span class="row-actions">
<a href="<?php
echo esc_url(get_post_link());
?>
"><?php
_e('View');
?>
</a>
<?php
bb_post_admin(array('before_each' => ' | ', 'each' => array('undelete' => array('before' => ' ')), 'last_each' => array('before' => ' | ')));
?>
</span>
</div>
</td>
<td class="author">
<?php
if (get_post_author_id()) {
?>
<a href="<?php
user_profile_link(get_post_author_id());
?>
">
<?php
//.........这里部分代码省略.........
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:101,代码来源:functions.bb-admin.php
示例14: send_report
/**
* Send reported content to moderators
*
* @param array Array of reported content
* @return bool True if PM sent
*/
function send_report($report)
{
global $db, $lang, $forum, $mybb, $post, $thread;
$nummods = false;
if (!empty($forum['parentlist'])) {
$query = $db->query("\n\t\t\tSELECT DISTINCT u.username, u.email, u.receivepms, u.uid\n\t\t\tFROM " . TABLE_PREFIX . "moderators m\n\t\t\tLEFT JOIN " . TABLE_PREFIX . "users u ON (u.uid=m.id)\n\t\t\tWHERE m.fid IN (" . $forum['parentlist'] . ") AND m.isgroup = '0'\n\t\t");
$nummods = $db->num_rows($query);
}
if (!$nummods) {
unset($query);
switch ($db->type) {
case "pgsql":
case "sqlite":
$query = $db->query("\n\t\t\t\t\tSELECT u.username, u.email, u.receivepms, u.uid\n\t\t\t\t\tFROM " . TABLE_PREFIX . "users u\n\t\t\t\t\tLEFT JOIN " . TABLE_PREFIX . "usergroups g ON (((','|| u.additionalgroups|| ',' LIKE '%,'|| g.gid|| ',%') OR u.usergroup = g.gid))\n\t\t\t\t\tWHERE (g.cancp=1 OR g.issupermod=1)\n\t\t\t\t");
break;
default:
$query = $db->query("\n\t\t\t\t\tSELECT u.username, u.email, u.receivepms, u.uid\n\t\t\t\t\tFROM " . TABLE_PREFIX . "users u\n\t\t\t\t\tLEFT JOIN " . TABLE_PREFIX . "usergroups g ON (((CONCAT(',', u.additionalgroups, ',') LIKE CONCAT('%,', g.gid, ',%')) OR u.usergroup = g.gid))\n\t\t\t\t\tWHERE (g.cancp=1 OR g.issupermod=1)\n\t\t\t\t");
}
}
while ($mod = $db->fetch_array($query)) {
$emailsubject = $lang->sprintf($lang->emailsubject_reportpost, $mybb->settings['bbname']);
$emailmessage = $lang->sprintf($lang->email_reportpost, $mybb->user['username'], $mybb->settings['bbname'], $post['subject'], $mybb->settings['bburl'], str_replace('&', '&', get_post_link($post['pid'], $thread['tid']) . "#pid" . $post['pid']), $thread['subject'], $report['reason']);
if ($mybb->settings['reportmethod'] == "pms" && $mod['receivepms'] != 0 && $mybb->settings['enablepms'] != 0) {
$pm_recipients[] = $mod['uid'];
} else {
my_mail($mod['email'], $emailsubject, $emailmessage);
}
}
if (count($pm_recipients) > 0) {
$emailsubject = $lang->sprintf($lang->emailsubject_reportpost, $mybb->settings['bbname']);
$emailmessage = $lang->sprintf($lang->email_reportpost, $mybb->user['username'], $mybb->settings['bbname'], $post['subject'], $mybb->settings['bburl'], str_replace('&', '&', get_post_link($post['pid'], $thread['tid']) . "#pid" . $post['pid']), $thread['subject'], $report['reason']);
require_once MYBB_ROOT . "inc/datahandlers/pm.php";
$pmhandler = new PMDataHandler();
$pm = array("subject" => $emailsubject, "message" => $emailmessage, "icon" => 0, "fromid" => $mybb->user['uid'], "toid" => $pm_recipients, "ipaddress" => $session->packedip);
$pmhandler->admin_override = true;
$pmhandler->set_data($pm);
// Now let the pm handler do all the hard work.
if (!$pmhandler->validate_pm()) {
// Force it to valid to just get it out of here
$pmhandler->is_validated = true;
$pmhandler->errors = array();
}
$pminfo = $pmhandler->insert_pm();
return $pminfo;
}
return false;
}
开发者ID:olada,项目名称:mybbintegrator,代码行数:53,代码来源:functions_modcp.php
示例15: elseif
$visible = $postinfo['visible'];
$closed = $postinfo['closed'];
// Invalidate solved captcha
if ($mybb->settings['captchaimage'] && !$mybb->user['uid']) {
$post_captcha->invalidate_captcha();
}
$force_redirect = false;
// Deciding the fate
if ($visible == -2) {
// Draft post
$lang->redirect_newreply = $lang->draft_saved;
$url = "usercp.php?action=drafts";
} elseif ($visible == 1) {
// Visible post
$lang->redirect_newreply .= $lang->redirect_newreply_post;
$url = get_post_link($pid, $tid) . "#pid{$pid}";
} else {
// Moderated post
$lang->redirect_newreply .= '<br />' . $lang->redirect_newreply_moderation;
$url = get_thread_link($tid);
// User must see moderation notice, regardless of redirect settings
$force_redirect = true;
}
// Mark any quoted posts so they're no longer selected - attempts to maintain those which weren't selected
if (isset($mybb->input['quoted_ids']) && isset($mybb->cookies['multiquote']) && $mybb->settings['multiquote'] != 0) {
// We quoted all posts - remove the entire cookie
if ($mybb->get_input('quoted_ids') == "all") {
my_unsetcookie("multiquote");
} else {
$quoted_ids = explode("|", $mybb->get_input('quoted_ids'));
$multiquote = explode("|", $mybb->cookies['multiquote']);
开发者ID:mainhan1804,项目名称:xomvanphong,代码行数:31,代码来源:newreply.php
示例16: my_date
$vote_type = $lang->positive;
}
}
$vote_reputation = "({$vote_reputation})";
// Format the date this reputation was last modified
$last_updated_date = my_date('relative', $reputation_vote['dateline']);
$last_updated = $lang->sprintf($lang->last_updated, $last_updated_date);
// Is this rating specific to a post?
$postrep_given = '';
if ($reputation_vote['pid']) {
$postrep_given = $lang->sprintf($lang->postrep_given_nolink, $user['username']);
if (isset($post_reputation[$reputation_vote['pid']])) {
$thread_link = get_thread_link($post_reputation[$reputation_vote['pid']]['tid']);
$subject = htmlspecialchars_uni($parser->parse_badwords($post_reputation[$reputation_vote['pid']]['subject']));
$thread_link = $lang->sprintf($lang->postrep_given_thread, $thread_link, $subject);
$link = get_post_link($reputation_vote['pid']) . "#pid{$reputation_vote['pid']}";
$postrep_given = $lang->sprintf($lang->postrep_given, $link, $user['username'], $thread_link);
}
}
// Does the current user have permission to delete this reputation? Show delete link
$delete_link = '';
if ($mybb->usergroup['issupermod'] == 1 || $mybb->usergroup['candeletereputations'] == 1 && $reputation_vote['adduid'] == $mybb->user['uid'] && $mybb->user['uid'] != 0) {
eval("\$delete_link = \"" . $templates->get("reputation_vote_delete") . "\";");
}
$report_link = '';
if ($mybb->user['uid'] != 0) {
eval("\$report_link = \"" . $templates->get("reputation_vote_report") . "\";");
}
// Parse smilies in the reputation vote
$reputation_parser = array("allow_html" => 0, "allow_mycode" => 0, "allow_smilies" => 1, "allow_imgcode" => 0, "filter_badwords" => 1);
$reputation_vote['comments'] = $parser->parse_message($reputation_vote['comments'], $reputation_parser);
开发者ID:styv300,项目名称:ToRepublic2.5,代码行数:31,代码来源:reputation.php
示例17: build_attachment_row
function build_attachment_row($attachment, &$table, $use_form = false)
{
global $mybb, $form;
$attachment['filename'] = htmlspecialchars_uni($attachment['filename']);
// Here we do a bit of detection, we want to automatically check for removal any missing attachments and any not assigned to a post uploaded > 24hours ago
// Check if the attachment exists in the file system
$checked = false;
$title = $cell_class = '';
if (!file_exists(MYBB_ROOT . $mybb->settings['uploadspath'] . "/{$attachment['attachname']}")) {
$cell_class = "bad_attachment";
$title = $lang->error_not_found;
$checked = true;
} elseif (!$attachment['pid'] && $attachment['dateuploaded'] < TIME_NOW - 60 * 60 * 24 && $attachment['dateuploaded'] != 0) {
$cell_class = "bad_attachment";
$title = $lang->error_not_attached;
$checked = true;
} else {
if (!$attachment['tid'] && $attachment['pid']) {
$cell_class = "bad_attachment";
$title = $lang->error_does_not_exist;
$checked = true;
} else {
if ($attachment['visible'] == 0) {
$cell_class = "invisible_attachment";
}
}
}
if ($cell_class) {
$cell_class .= " align_center";
} else {
$cell_class = "align_center";
}
if ($use_form == true && is_object($form)) {
$table->construct_cell($form->generate_check_box('aids[]', $attachment['aid'], '', array('checked' => $checked)));
}
$table->construct_cell(get_attachment_icon(get_extension($attachment['filename'])), array('width' => 1));
$table->construct_cell("<a href=\"../attachment.php?aid={$attachment['aid']}\" target=\"_blank\">{$attachment['filename']}</a>");
$table->construct_cell(get_friendly_size($attachment['filesize']), array('class' => $cell_class));
if ($attachment['user_username']) {
$attachment['username'] = $attachment['username'];
}
$table->construct_cell(build_profile_link($attachment['username'], $attachment['uid'], "_blank"), array("class" => "align_center"));
$table->construct_cell("<a href=\"../" . get_post_link($attachment['pid']) . "\" target=\"_blank\">" . htmlspecialchars_uni($attachment['subject']) . "</a>", array("class" => "align_center"));
$table->construct_cell(my_number_format($attachment['downloads']), array("class" => "align_center"));
if ($attachment['dateuploaded'] > 0) {
$date = my_date($mybb->settings['dateformat'], $attachment['dateuploaded']) . ", " . my_date($mybb->settings['timeformat'], $attachment['dateuploaded']);
} else {
$date = $lang->unknown;
}
$table->construct_cell($date, array("class" => "align_center"));
$table->construct_row();
}
开发者ID:GeorgeLVP,项目名称:mybb,代码行数:52,代码来源:attachments.php
示例18: bb_attachments_delete
function bb_attachments_delete($filenum = 0)
{
global $bbdb, $bb_attachments;
$filenum = intval($filenum);
if ($filenum == 0 && isset($_GET['bbat_delete'])) {
$filenum = intval($_GET['bbat_delete']);
}
if ($filenum > 0 && bb_current_user_can($bb_attachments['role']['delete'])) {
$file = $bbdb->get_results("SELECT * FROM " . $bb_attachments['db'] . " WHERE id = {$filenum} AND status = 0 LIMIT 1");
if (isset($file[0]) && $file[0]->id && bb_current_user_can('edit_post', $file[0]->post_id)) {
$file = $file[0];
$file->filename = stripslashes($file->filename);
$fullpath = $bb_attachments['path'] . floor($file->id / 1000) . "/" . $file->id . "." . $file->filename;
if (file_exists($fullpath)) {
@unlink($fullpath);
@$bbdb->query("UPDATE " . $bb_attachments['db'] . " SET status = 1 WHERE id = {$file->id} LIMIT 1");
}
bb_attachments_recount($file->post_id);
if (!isset($_GET['bb_attachments'])) {
wp_redirect(get_post_link($file->post_id));
}
}
}
}
开发者ID:achorg,项目名称:DH-Answers,代码行数:24,代码来源:bb-attachments.php
示例19: prepare_post
/**
* Prepares post data for return in an XML-RPC object
*
* @since 1.0
* @return array The prepared post data
* @param array|object The unprepared post data
**/
function prepare_post($post)
{
// Cast to an array
$_post = (array) $post;
// Set the URI
$_post['post_uri'] = get_post_link($_post['post_id']);
// Set readable times
$_post['post_time_since'] = bb_since($_post['post_time']);
// Set the display names
$_post['poster_display_name'] = get_user_display_name($_post['poster_id']);
// Remove some sensitive data
unset($_post['poster_id'], $_post['poster_ip'], $_post['pingback_queued']);
// Allow plugins to modify the data
return apply_filters('bb_xmlrpc_prepare_post', $_post, (array) $post);
}
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:22,代码来源:xmlrpc.php
示例20: htmlspecialchars_uni
if (my_strlen($post['subject']) > 50) {
$post['subject'] = htmlspecialchars_uni(my_substr($post['subject'], 0, 50) . "...");
} else {
$post['subject'] = htmlspecialchars_uni($post['subject']);
}
// What we do here is parse the post using our post parser, then strip the tags from it
$parser_options = array('allow_html' => 0, 'allow_mycode' => 1, 'allow_smilies' => 0, 'allow_imgcode' => 0, 'filter_badwords' => 1);
$post['message'] = strip_tags($parser->parse_message($post['message'], $parser_options));
if (my_strlen($post['message']) > 200) {
$prev = my_substr($post['message'], 0, 200) . "...";
} else {
$prev = $post['message'];
}
$posted = my_date($mybb->settings['dateformat'], $post['dateline']) . ", " . my_date($mybb->settings['timeformat'], $post['dateline']);
$thread_url = get_thread_link($post['tid']);
$post_url = get_post_link($post['pid'], $post['tid']);
// Inline post moderation
$inline_mod_checkbox = '';
if ($is_supermod || is_moderator($post['fid'])) {
eval("\$inline_mod_checkbox = \"" . $templates->get("search_results_posts_inlinecheck") . "\";");
} elseif ($is_mod) {
eval("\$inline_mod_checkbox = \"" . $templates->get("search_results_posts_nocheck") . "\";");
}
$plugins->run_hooks("search_results_post");
eval("\$results .= \"" . $templates->get("search_results_posts_post") . "\";");
}
if (!$results) {
error($lang->error_nosearchresults);
}
$mult
|
请发表评论