本文整理汇总了PHP中spdb_table函数的典型用法代码示例。如果您正苦于以下问题:PHP spdb_table函数的具体用法?PHP spdb_table怎么用?PHP spdb_table使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了spdb_table函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: sp_do_sp_ForumHomeLinkTag
function sp_do_sp_ForumHomeLinkTag($args = '')
{
#check if forum displayed
if (sp_abort_display_forum()) {
return;
}
$defs = array('beforeLink' => '', 'afterLink' => '', 'echo' => 1);
$a = wp_parse_args($args, $defs);
$a = apply_filters('sph_ForumHomeLinkTag_args', $a);
extract($a, EXTR_SKIP);
# sanitize before use
$beforeLink = sp_filter_title_display($beforeLink);
$afterLink = sp_filter_title_display($afterLink);
$echo = (int) $echo;
if (!empty($beforeLink)) {
$beforeLink = trim($beforeLink) . ' ';
}
if (!empty($afterLink)) {
$afterLink = ' ' . trim($afterLink);
}
$pid = sp_get_option('sfpage');
$title = spdb_table(SFWPPOSTS, "ID={$pid}", 'post_title');
$out .= '<span>' . $beforeLink . '<a href="' . get_permalink($pid) . '">' . $title . '</a>' . $afterLink . '</span>';
$out = apply_filters('sph_ForumHomeLinkTag', $out);
if ($echo) {
echo $out;
} else {
return $out;
}
}
开发者ID:Bakerpedia,项目名称:Developement_WPengine,代码行数:30,代码来源:sp-ForumHomeLink-tag.php
示例2: sp_cron_remove_users
function sp_cron_remove_users()
{
require_once ABSPATH . 'wp-admin/includes/user.php';
# make sure auto removal is enabled
$sfuser = sp_get_option('sfuserremoval');
if ($sfuser['sfuserremove']) {
# see if removing users with no posts
if ($sfuser['sfusernoposts']) {
$users = spdb_select('set', 'SELECT ' . SFUSERS . '.ID FROM ' . SFUSERS . '
JOIN ' . SFMEMBERS . ' on ' . SFUSERS . '.ID = ' . SFMEMBERS . '.user_id
LEFT JOIN ' . SFWPPOSTS . ' ON ' . SFUSERS . '.ID = ' . SFWPPOSTS . '.post_author
WHERE user_registered < DATE_SUB(NOW(), INTERVAL ' . $sfuser['sfuserperiod'] . ' DAY)
AND post_author IS NULL
AND posts < 1');
if ($users) {
foreach ($users as $user) {
wp_delete_user($user->ID);
}
}
}
# see if removing inactive users
if ($sfuser['sfuserinactive']) {
$users = spdb_table(SFMEMBERS, 'lastvisit < DATE_SUB(NOW(), INTERVAL ' . $sfuser['sfuserperiod'] . ' DAY)');
if ($users) {
foreach ($users as $user) {
wp_delete_user($user->user_id);
}
}
}
} else {
wp_clear_scheduled_hook('sph_cron_user');
}
do_action('sph_remove_users_cron');
}
开发者ID:Bakerpedia,项目名称:Developement_WPengine,代码行数:34,代码来源:sp-site-cron.php
示例3: sp_do_sp_GroupLinkTag
function sp_do_sp_GroupLinkTag($args = '')
{
#check if forum displayed
if (sp_abort_display_forum()) {
return;
}
$defs = array('groupId' => '', 'linkText' => '%GROUPNAME%', 'beforeLink' => '', 'afterLink' => '', 'listTags' => 0, 'echo' => 1);
$a = wp_parse_args($args, $defs);
$a = apply_filters('sph_GroupLinkTag_args', $a);
extract($a, EXTR_SKIP);
# sanitize before use
$groupId = (int) $groupId;
$linkText = esc_attr($linkText);
$beforeLink = sp_filter_title_display($beforeLink);
$afterLink = sp_filter_title_display($afterLink);
$listTags = (int) $listTags;
$echo = (int) $echo;
if (empty($groupId)) {
return '';
}
sp_forum_api_support();
if (!empty($beforeLink)) {
$beforeLink = trim($beforeLink) . ' ';
}
if (!empty($afterLink)) {
$afterLink = ' ' . trim($afterLink);
}
# check user has access to at kleast ine forum in group
$canview = false;
$forums = spdb_table(SFFORUMS, "group_id={$groupId}");
if ($forums) {
foreach ($forums as $forum) {
if (sp_can_view($forum->forum_id, 'forum-title')) {
$canview = true;
}
}
}
if ($forums && $canview) {
$grouprec = spdb_table(SFGROUPS, "group_id={$groupId}", 'row');
$out = '';
$linkText = str_replace("%GROUPNAME%", sp_filter_title_display($grouprec->group_name), $linkText);
if (empty($linkText)) {
$linkText = sp_filter_title_display($grouprec->group_name);
}
if ($listTags) {
$out .= '<li>';
}
$out .= '<span>' . $beforeLink . '<a href="' . add_query_arg(array('group' => $groupId), sp_url()) . '">' . $linkText . '</a>' . $afterLink . '</span>';
if ($listTags) {
$out .= '</li>';
}
}
$out = apply_filters('sph_GroupLinkTag', $out);
if ($echo) {
echo $out;
} else {
return $out;
}
}
开发者ID:Bakerpedia,项目名称:Developement_WPengine,代码行数:59,代码来源:sp-GroupLink-tag.php
示例4: sp_do_sp_ForumLinkTag
function sp_do_sp_ForumLinkTag($args = '')
{
#check if forum displayed
if (sp_abort_display_forum()) {
return;
}
$defs = array('forumId' => '', 'linkText' => '%FORUMNAME%', 'beforeLink' => '', 'afterLink' => '', 'listTags' => 0, 'echo' => 1);
$a = wp_parse_args($args, $defs);
$a = apply_filters('sph_ForumLinkTag_args', $a);
extract($a, EXTR_SKIP);
# sanitize before use
$forumId = (int) $forumId;
$linkText = esc_attr($linkText);
$beforeLink = sp_filter_title_display($beforeLink);
$afterLink = sp_filter_title_display($afterLink);
$listTags = (int) $listTags;
$echo = (int) $echo;
if (empty($forumId)) {
return '';
}
sp_forum_api_support();
if (!empty($beforeLink)) {
$beforeLink = trim($beforeLink) . ' ';
}
if (!empty($afterLink)) {
$afterLink = ' ' . trim($afterLink);
}
if (sp_can_view($forumId, 'forum-title')) {
$forumrec = spdb_table(SFFORUMS, "forum_id={$forumId}", 'row');
if ($forumrec) {
$out = '';
$linkText = str_replace("%FORUMNAME%", sp_filter_title_display($forumrec->forum_name), $linkText);
if (empty($linkText)) {
$linkText = sp_filter_title_display($forumrec->forum_name);
}
if ($listTags) {
$out .= '<li>';
}
$out .= '<span>' . $beforeLink . '<a href="' . sp_build_url($forumrec->forum_slug, '', 0, 0) . '">' . $linkText . '</a>' . $afterLink . '</span>';
if ($listTags) {
$out .= '</li>';
}
} else {
$out = sprintf(__('Forum %s not found', 'sp-ttags'), $forumId);
}
}
$out = apply_filters('sph_ForumLinkTag', $out);
if ($echo) {
echo $out;
} else {
return $out;
}
}
开发者ID:Bakerpedia,项目名称:Developement_WPengine,代码行数:53,代码来源:sp-ForumLink-tag.php
示例5: sp_email_notifications
function sp_email_notifications($newpost)
{
global $spGlobals, $spThisUser, $spVars;
$out = '';
$email_status = array();
$eol = "\r\n";
$tab = "\t";
# create the email address list for admin nptifications
$admins_email = array();
$admins = spdb_table(SFMEMBERS, 'admin = 1 OR moderator = 1');
if ($admins) {
foreach ($admins as $admin) {
if ($admin->user_id != $newpost['userid']) {
$admin_opts = unserialize($admin->admin_options);
if ($admin_opts['sfnotify'] && sp_get_auth('moderate_posts', $newpost['forumid'], $admin->user_id)) {
$email = spdb_table(SFUSERS, "ID = " . $admin->user_id, 'user_email');
$admins_email[$admin->user_id] = $email;
}
}
}
}
$admins_email = apply_filters('sph_admin_email_addresses', $admins_email);
# send the emails
if (!empty($admins_email)) {
# clean up the content for the plain text email - go get it from database so not in 'save' mode
$post_content = spdb_table(SFPOSTS, 'post_id=' . $newpost['postid'], 'post_content');
$post_content = sp_filter_email_content($post_content);
# create message body
$msg = sp_text('New forum post on your site') . ': ' . get_option('blogname') . $eol . $eol;
$msg .= sp_text('From') . ': ' . $tab . $newpost['postername'] . ' [' . $newpost['posteremail'] . ']' . ', ' . sp_text('Poster IP') . ': ' . $newpost['posterip'] . $eol . $eol;
$msg .= sp_text('Group') . ':' . $tab . sp_filter_title_display($newpost['groupname']) . $eol;
$msg .= sp_text('Forum') . ':' . $tab . sp_filter_title_display($newpost['forumname']) . $eol;
$msg .= sp_text('Topic') . ':' . $tab . sp_filter_title_display($newpost['topicname']) . $eol;
$msg .= urldecode($newpost['url']) . $eol;
$msg .= sp_text('Post') . ':' . $eol . $post_content . $eol . $eol;
foreach ($admins_email as $id => $email) {
$newmsg = apply_filters('sph_admin_email', $msg, $newpost, $id, 'admin');
$replyto = apply_filters('sph_email_replyto', '', $newpost);
$subject = sp_text('Forum Post') . ' - ' . get_option('blogname') . ': [' . sp_filter_title_display($newpost['topicname']) . ']';
$subject = apply_filters('sph_email_subject', $subject, $newpost);
sp_send_email($email, $subject, $newmsg, $replyto);
}
$out = '- ' . sp_text('Notified: Administrators/Moderators');
}
$out = apply_filters('sph_new_post_notifications', $out, $newpost);
return $out;
}
开发者ID:bself,项目名称:nuimage-wp,代码行数:47,代码来源:sp-post-support.php
示例6: sp_do_sp_AddNewTopicLinkTag
function sp_do_sp_AddNewTopicLinkTag($args = '')
{
#check if forum displayed
if (sp_abort_display_forum()) {
return;
}
$defs = array('tagId' => 'spAddNewTopicLinkTag', 'tagClass' => 'spLinkTag', 'forumId' => '', 'linkText' => '%FORUMNAME%', 'beforeLink' => __('Add new topic in the ', 'sp-ttags'), 'afterLink' => __(' forum', 'sp-ttags'), 'echo' => 1);
$a = wp_parse_args($args, $defs);
$a = apply_filters('sph_AddNewTopicLinkTag_args', $a);
extract($a, EXTR_SKIP);
# sanitize before use
$tagId = esc_attr($tagId);
$tagClass = esc_attr($tagClass);
$forumId = (int) $forumId;
$linkText = esc_attr($linkText);
$beforeLink = sp_filter_title_display($beforeLink);
$afterLink = sp_filter_title_display($afterLink);
$echo = (int) $echo;
if (!$forumId) {
return;
}
if (!empty($beforeLink)) {
$beforeLink = trim($beforeLink) . ' ';
}
if (!empty($afterLink)) {
$afterLink = ' ' . trim($afterLink);
}
sp_forum_api_support();
if (sp_get_auth('start_topics', $forumId)) {
$forum = spdb_table(SFFORUMS, "forum_id={$forumId}", 'row');
$linkText = str_replace("%FORUMNAME%", sp_filter_title_display($forum->forum_name), $linkText);
$url = sp_build_url($forum->forum_slug, '', 0, 0);
$url = sp_get_sfqurl($url) . 'new=topic';
$out = "<span id='{$tagId}' class='{$tagClass}'>";
$out .= $beforeLink . '<a href="' . $url . '">' . $linkText . '</a>' . $afterLink;
$out .= '</span>';
$out = apply_filters('sph_AddNewTopicLinkTag', $out);
if ($echo) {
echo $out;
} else {
return $out;
}
}
}
开发者ID:Bakerpedia,项目名称:Developement_WPengine,代码行数:44,代码来源:sp-AddNewTopicLink-tag.php
示例7: spa_save_integration_page_data
function spa_save_integration_page_data()
{
check_admin_referer('forum-adminform_integration', 'forum-adminform_integration');
$mess = '';
$slugid = sp_esc_int($_POST['slug']);
if ($slugid == '' || $slugid == 0) {
$setslug = '';
$setpage = 0;
} else {
$setpage = $slugid;
$page = spdb_table(SFWPPOSTS, "ID={$slugid}", 'row');
$setslug = $page->post_name;
if ($page->post_parent) {
$parent = $page->post_parent;
while ($parent) {
$thispage = spdb_table(SFWPPOSTS, "ID={$parent}", 'row');
$setslug = $thispage->post_name . '/' . $setslug;
$parent = $thispage->post_parent;
}
}
}
sp_update_option('sfpage', $setpage);
sp_update_option('sfslug', $setslug);
spa_update_check_option('sfinloop');
spa_update_check_option('sfmultiplecontent');
spa_update_check_option('sfwpheadbypass');
spa_update_check_option('sfwplistpages');
spa_update_check_option('sfscriptfoot');
spa_update_check_option('sfuseob');
spa_update_check_option('spwptexturize');
sp_update_option('spheaderspace', sp_esc_int($_POST['spheaderspace']));
if (!$setpage) {
$mess .= spa_text('Page slug missing');
$mess .= ' - ' . spa_text('Unable to determine forum permalink without it');
} else {
$mess .= spa_text('Forum page and slug updated');
sp_update_permalink(true);
}
do_action('sph_integration_save');
return $mess;
}
开发者ID:brooklyntri,项目名称:btc-plugins,代码行数:41,代码来源:spa-integration-save.php
示例8: spa_forums_add_permission_form
function spa_forums_add_permission_form($forum_id)
{
?>
<script type="text/javascript">
jQuery(document).ready(function() {
spjAjaxForm('sfpermissionnew<?php
echo $forum_id;
?>
', 'sfreloadfb');
});
</script>
<?php
$forum = spdb_table(SFFORUMS, "forum_id={$forum_id}", 'row');
echo '<div class="sfform-panel-spacer"></div>';
spa_paint_options_init();
$ahahURL = SFHOMEURL . 'index.php?sp_ahah=forums-loader&sfnonce=' . wp_create_nonce('forum-ahah') . '&saveform=addperm';
?>
<form action="<?php
echo $ahahURL;
?>
" method="post" id="sfpermissionnew<?php
echo $forum->forum_id;
?>
" name="sfpermissionnew<?php
echo $forum->forum_id;
?>
">
<?php
echo sp_create_nonce('forum-adminform_permissionnew');
spa_paint_open_tab(spa_text('Forums') . ' - ' . spa_text('Manage Groups and Forums'), true);
spa_paint_open_panel();
spa_paint_open_fieldset(spa_text('Add Permission Set'), 'true', 'add-user-group-permission-set');
?>
<table class="form-table">
<tr>
<td class="sflabel"><?php
spa_display_usergroup_select(true, $forum->forum_id);
?>
</td>
</tr><tr>
<td class="sflabel"><?php
spa_display_permission_select();
?>
</td>
</tr>
</table>
<input type="hidden" name="forum_id" value="<?php
echo $forum->forum_id;
?>
" />
<?php
spa_paint_close_fieldset();
spa_paint_close_panel();
do_action('sph_forums_add_perm_panel');
spa_paint_close_container();
?>
<div class="sfform-submit-bar">
<input type="submit" class="button-primary" id="permnew<?php
echo $forum->forum_id;
?>
" name="permnew<?php
echo $forum->forum_id;
?>
" value="<?php
spa_etext('Add Permission Set');
?>
" />
<input type="button" class="button-primary" onclick="javascript:jQuery('#newperm-<?php
echo $forum->forum_id;
?>
').html('');" id="sfpermissionnew<?php
echo $forum->forum_id;
?>
" name="addpermcancel<?php
echo $forum->forum_id;
?>
" value="<?php
spa_etext('Cancel');
?>
" />
</div>
<?php
spa_paint_close_tab();
?>
</form>
<div class="sfform-panel-spacer"></div>
<?php
}
开发者ID:brooklyntri,项目名称:btc-plugins,代码行数:88,代码来源:spa-forums-add-permission-form.php
示例9: sp_forumview_query
//.........这里部分代码省略.........
if ($s->post_index == 1) {
$f[$fidx]->topics[$s->topic_id]->first_post_id = $s->post_id;
$f[$fidx]->topics[$s->topic_id]->first_post_permalink = sp_build_url($f[$fidx]->forum_slug, $f[$fidx]->topics[$s->topic_id]->topic_slug, 0, $s->post_id, $s->post_index);
$f[$fidx]->topics[$s->topic_id]->first_post_date = $s->post_date;
$f[$fidx]->topics[$s->topic_id]->first_post_status = $s->post_status;
$f[$fidx]->topics[$s->topic_id]->first_post_index = $s->post_index;
$f[$fidx]->topics[$s->topic_id]->first_user_id = $s->user_id;
$f[$fidx]->topics[$s->topic_id]->first_display_name = sp_filter_name_display($s->display_name);
$f[$fidx]->topics[$s->topic_id]->first_guest_name = sp_filter_name_display($s->guest_name);
# see if we can display the tooltip
if (sp_can_view($forumid, 'post-content', $spThisUser->ID, $s->user_id, $s->topic_id, $s->post_id)) {
$f[$fidx]->topics[$s->topic_id]->first_post_tip = $s->post_status ? sp_text('Post awaiting moderation') : sp_filter_tooltip_display($s->post_content, $s->post_status);
} else {
$f[$fidx]->topics[$s->topic_id]->first_post_tip = '';
}
}
if ($s->post_index > 1 || $f[$fidx]->topics[$s->topic_id]->post_count == 1) {
$f[$fidx]->topics[$s->topic_id]->last_post_id = $s->post_id;
$f[$fidx]->topics[$s->topic_id]->last_post_permalink = sp_build_url($f[$fidx]->forum_slug, $f[$fidx]->topics[$s->topic_id]->topic_slug, 0, $s->post_id, $s->post_index);
$f[$fidx]->topics[$s->topic_id]->last_post_date = $s->post_date;
$f[$fidx]->topics[$s->topic_id]->last_post_status = $s->post_status;
$f[$fidx]->topics[$s->topic_id]->last_post_index = $s->post_index;
$f[$fidx]->topics[$s->topic_id]->last_user_id = $s->user_id;
$f[$fidx]->topics[$s->topic_id]->last_display_name = sp_filter_name_display($s->display_name);
$f[$fidx]->topics[$s->topic_id]->last_guest_name = sp_filter_name_display($s->guest_name);
# see if we can display the tooltip
if (sp_can_view($forumid, 'post-content', $spThisUser->ID, $s->user_id, $s->topic_id, $s->post_id)) {
$f[$fidx]->topics[$s->topic_id]->last_post_tip = $s->post_status ? sp_text('Post awaiting moderation') : sp_filter_tooltip_display($s->post_content, $s->post_status);
} else {
$f[$fidx]->topics[$s->topic_id]->last_post_tip = '';
}
}
$f[$fidx]->topics[$s->topic_id] = apply_filters('sph_forumview_stats_records', $f[$fidx]->topics[$s->topic_id], $s);
}
unset($stats);
}
} else {
# check for view forum lists but not topic lists
if (sp_can_view($forumid, 'forum-title')) {
$this->forumViewStatus = 'sneak peek';
}
}
} else {
$records = spdb_table(SFFORUMS, $BASEWHERE);
$r = current($records);
if ($r) {
if (sp_can_view($forumid, 'topic-title')) {
$this->forumViewStatus = 'data';
$f[$forumid] = new stdClass();
$f[$forumid]->forum_id = $r->forum_id;
$f[$forumid]->forum_slug = $r->forum_slug;
$f[$forumid]->forum_name = sp_filter_title_display($r->forum_name);
$f[$forumid]->forum_permalink = sp_build_url($r->forum_slug, '', 0, 0);
$f[$forumid]->forum_desc = sp_filter_title_display($r->forum_desc);
$f[$forumid]->forum_status = $r->forum_status;
$f[$forumid]->forum_disabled = $r->forum_disabled;
$f[$forumid]->group_id = $r->group_id;
$f[$forumid]->topic_count = $r->topic_count;
$f[$forumid]->forum_icon = sanitize_file_name($r->forum_icon);
$f[$forumid]->forum_icon_new = sanitize_file_name($r->forum_icon_new);
$f[$forumid]->topic_icon = sanitize_file_name($r->topic_icon);
$f[$forumid]->topic_icon_new = sanitize_file_name($r->topic_icon_new);
$f[$forumid]->topic_icon_locked = sanitize_file_name($r->topic_icon_locked);
$f[$forumid]->topic_icon_pinned = sanitize_file_name($r->topic_icon_pinned);
$f[$forumid]->parent = $r->parent;
$f[$forumid]->children = $r->children;
$f[$forumid]->forum_message = sp_filter_text_display($r->forum_message);
$f[$forumid]->forum_keywords = sp_filter_title_display($r->keywords);
$f[$forumid]->forum_rss = esc_url($r->forum_rss);
$f[$forumid]->forum_rss_private = $r->forum_rss_private;
# Can the user create new topics or should we lock the forum?
$f[$forumid]->start_topics = sp_get_auth('start_topics', $r->forum_id);
$f[$forumid] = apply_filters('sph_forumview_forum_record', $f[$forumid], $r);
} else {
# check for view forum lists but not topic lists
if (sp_can_view($forumid, 'forum-title')) {
$this->forumViewStatus = 'sneak peek';
}
}
# Collect any forum subforms that may exist
if (isset($f[$forumid]->children) && $f[$forumid]->children) {
$topSubs = unserialize($f[$forumid]->children);
foreach ($topSubs as $topSub) {
$topSubA = array();
$topSubA[] = $topSub;
$subs = $this->sp_forumview_subforums_query($topSubA, true);
}
if ($subs) {
$f = $this->sp_forumview_build_subforums($forumid, $f, $forumid, $subs);
}
}
# allow plugins to add more data to combined forum/topic data structure
$f[$forumid] = apply_filters('sph_forumview_combined_data', $f[$forumid], array());
} else {
# reset status to 'no data'
$this->forumViewStatus = 'no data';
}
}
return $f;
}
开发者ID:bself,项目名称:nuimage-wp,代码行数:101,代码来源:sp-forum-view-class.php
示例10: sp_UpdateProfile
//.........这里部分代码省略.........
if ($update) {
$curEmail = sp_filter_email_save($_POST['curemail']);
$email = sp_filter_email_save($_POST['email']);
if ($email != $curEmail) {
if (empty($email)) {
$message['type'] = 'error';
$message['text'] = sp_text('Please enter a valid email address');
return $message;
} elseif (($owner_id = email_exists($email)) && $owner_id != $thisUser) {
$message['type'] = 'error';
$message['text'] = sp_text('The email address is already registered. Please choose another one');
return $message;
}
# save new email address
$sql = 'UPDATE ' . SFUSERS . " SET user_email='{$email}' WHERE ID=" . $thisUser;
spdb_query($sql);
}
}
# fire action for plugins
$message = apply_filters('sph_UpdateProfileSettings', $message, $thisUser);
# output profile save status
if (empty($message)) {
$message['type'] = 'success';
$message['text'] = sp_text('Account settings updated');
}
break;
case 'edit-profile':
# update profile settings
# validate any username change
$update = apply_filters('sph_ProfileUserDisplayNameUpdate', true);
if ($update) {
$spProfile = sp_get_option('sfprofile');
if ($spProfile['nameformat'] || $spThisUser->admin) {
$display_name = !empty($_POST['display_name']) ? trim($_POST['display_name']) : spdb_table(SFUSERS, "ID={$thisUser}", 'user_login');
$display_name = sp_filter_name_save($display_name);
# make sure display name isnt already used
if ($_POST['oldname'] != $display_name) {
$records = spdb_table(SFMEMBERS, "display_name='{$display_name}'");
if ($records) {
foreach ($records as $record) {
if ($record->user_id != $thisUser) {
$message['type'] = 'error';
$message['text'] = $display_name . ' ' . sp_text('is already in use - please choose a different display name');
return $message;
}
}
}
# validate display name
$errors = new WP_Error();
$user = new stdClass();
$user->display_name = $display_name;
sp_validate_display_name($errors, true, $user);
if ($errors->get_error_codes()) {
$message['type'] = 'error';
$message['text'] = sp_text('The display name you have chosen is not allowed on this site');
return $message;
}
# now save the display name
sp_update_member_item($thisUser, 'display_name', $display_name);
# Update new users list with changed display name
sp_update_newuser_name(sp_filter_name_save($_POST['oldname']), $display_name);
# do we need to sync display name with wp?
$options = sp_get_member_item($thisUser, 'user_options');
if ($options['namesync']) {
spdb_query('UPDATE ' . SFUSERS . ' SET display_name="' . $display_name . '" WHERE ID=' . $thisUser);
}
开发者ID:ashanrupasinghe,项目名称:govforuminstalledlocal,代码行数:67,代码来源:sp-ahah-profile-save.php
示例11: sp_update_post_urls
function sp_update_post_urls($old, $new)
{
global $wpdb;
if (empty($old) || empty($new)) {
return;
}
$posts = spdb_table(SFPOSTS, 'post_content LIKE "%/' . esc_sql($wpdb->esc_like($old)) . '%"', '');
if (!empty($posts)) {
foreach ($posts as $p) {
$pc = str_replace('/' . $old, '/' . $new, sp_filter_content_edit($p->post_content));
$pc = sp_filter_content_save($pc, 'edit');
spdb_query('UPDATE ' . SFPOSTS . " SET post_content = '{$pc}' WHERE post_id=" . $p->post_id);
}
}
}
开发者ID:Bakerpedia,项目名称:Developement_WPengine,代码行数:15,代码来源:sp-api-permalinks.php
示例12: sp_topic_delete
function sp_topic_delete()
{
sp_delete_topic(sp_esc_int($_GET['killtopic']), sp_esc_int($_GET['killtopicforum']), false);
$view = sp_esc_str($_GET['view']);
if ($view == 'topic') {
$forumslug = spdb_table(SFFORUMS, 'forum_id=' . sp_esc_int($_GET['killtopicforum']), 'forum_slug');
$returnURL = sp_build_url($forumslug, '', 0);
echo $returnURL;
} else {
if ($_GET['count'] == 1) {
$forumslug = spdb_table(SFFORUMS, 'forum_id=' . sp_esc_int($_GET['killtopicforum']), 'forum_slug');
$page = sp_esc_int($_GET['page']);
if ($page == 1) {
$returnURL = sp_build_url($forumslug, '', 0);
} else {
$page = $page - 1;
$returnURL = sp_build_url($forumslug, '', $page);
}
echo $returnURL;
}
}
die;
}
开发者ID:bself,项目名称:nuimage-wp,代码行数:23,代码来源:sp-ahah-admintools.php
示例13: sp_delete_auth_cat
function sp_delete_auth_cat($id_or_name)
{
# if its not id, lets get the id for easy removal of auth cat from auths
if (!is_numeric($id_or_name)) {
$slug = sp_create_slug($id_or_name, true, SFAUTHCATS, 'authcat_slug');
$id_or_name = spdb_table(SFAUTHCATS, 'authcat_slug="' . $slug . '"', 'authcat_id');
}
# now lets delete the auth cat
$success = spdb_query('DELETE FROM ' . SFAUTHCATS . " WHERE authcat_id={$id_or_name}");
# if successful, need to remove that cat from the auths and replace with default
if ($success) {
spdb_query('UPDATE ' . SFAUTHS . " SET auth_cat=0 WHERE authcat_id={$id_or_name}");
}
return $success;
}
开发者ID:ashanrupasinghe,项目名称:govforuminstalledlocal,代码行数:15,代码来源:sp-api-auths.php
示例14: spjSetProfileDataHeight
}
?>
<script type="text/javascript">
jQuery(document).ready(function() {
spjSetProfileDataHeight();
})
</script>
<?php
die;
}
if ($action == 'update-nonmemberships') {
if (empty($userid)) {
die;
}
global $spThisUser;
$usergroups = spdb_table(SFUSERGROUPS, '', '', '', '', ARRAY_A);
if ($usergroups && ($spThisUser->ID != $userid || !$spThisUser->admin)) {
$alt = 'spOdd';
$first = true;
foreach ($usergroups as $userGroup) {
if (!sp_check_membership($userGroup['usergroup_id'], $userid) && ($userGroup['usergroup_join'] == 1 || $spThisUser->admin)) {
$submit = true;
if ($first) {
echo '<div class="spProfileUsergroupsNonMemberships">';
echo '<p class="spHeaderName">' . sp_text('Non-Memberships') . ':</p>';
$first = false;
}
echo "<div class='spProfileUsergroup {$alt}'>";
echo '<div class="spColumnSection">';
echo '<div class="spHeaderName">' . $userGroup['usergroup_name'] . '</div>';
echo '<div class="spHeaderDescription">' . $userGroup['usergroup_desc'] . '</div>';
开发者ID:bself,项目名称:nuimage-wp,代码行数:31,代码来源:sp-ahah-profile.php
示例15: sp_add_notice
function sp_add_notice($nData)
{
# see if we already have an notice here
$notice = spdb_table(SFNOTICES, "user_id={$nData['user_id']} AND post_id={$nData['post_id']} AND message='{$nData['message']}'", 'notice_id');
if (!empty($notice)) {
return;
}
# create the new notice
$spdb = new spdbComplex();
$spdb->table = SFNOTICES;
$spdb->fields = array('user_id', 'guest_email', 'post_id', 'link', 'link_text', 'message', 'expires');
$spdb->data = array($nData['user_id'], $nData['guest_email'], $nData['post_id'], $nData['link'], sp_filter_title_save($nData['link_text']), sp_filter_title_save($nData['message']), $nData['expires']);
$spdb = apply_filters('sph_new_notice_data', $spdb);
$spdb->insert();
}
开发者ID:ashanrupasinghe,项目名称:govforuminstalledlocal,代码行数:15,代码来源:sp-api-notifications.php
示例16: spa_forums_edit_forum_form
function spa_forums_edit_forum_form($forum_id)
{
?>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('#forumrow-<?php
echo $forum_id;
?>
').addClass('inForm');
spjAjaxForm('sfforumedit<?php
echo $forum_id;
?>
', 'sfreloadfb');
});
</script>
<?php
global $spPaths, $tab;
$forum = spdb_table(SFFORUMS, "forum_id={$forum_id}", 'row');
spa_paint_options_init();
$ahahURL = SFHOMEURL . 'index.php?sp_ahah=forums-loader&sfnonce=' . wp_create_nonce('forum-ahah') . '&saveform=editforum';
?>
<form action="<?php
echo $ahahURL;
?>
" method="post" id="sfforumedit<?php
echo $forum->forum_id;
?>
" name="sfforumedit<?php
echo $forum->forum_id;
?>
">
<?php
echo sp_create_nonce('forum-adminform_forumedit');
spa_paint_open_tab(spa_text('Forums') . ' - ' . spa_text('Manage Groups and Forums'), true);
spa_paint_open_panel();
spa_paint_open_fieldset(spa_text('Forum Details'), false);
$subforum = $forum->parent ? true : false;
echo "<input type='hidden' name='cgroup_id' value='{$forum->group_id}' />";
echo "<input type='hidden' name='cparent' value='{$forum->parent}' />";
echo "<input type='hidden' name='cchildren' value='{$forum->children}' />";
if (!$subforum && empty($forum->children)) {
$mess = sp_text('This is a top-level forum with no sub-forums and on this panel you can change the forum Group it is a member of. If changed it will be moved to the target Forum Group.');
} elseif (!$subforum && !empty($forum->children)) {
$mess = sp_text('This is a top level forum with designated sub-forums and on this panel you can change the forum Group it is a member of. If changed it will be moved, along with the sub-forums, to the target Forum Group.');
} elseif ($subforum && empty($forum->children)) {
$mess = sp_text('This is a sub-forum and on this panel you can change the forum parent it belongs to. If changed it will be moved to become a sub-forum of the target Forum.');
} else {
$mess = sp_text('This is a sub-forum and also a parent to other sub-forums and on this panel you can change the forum parent it belongs to. If changed it will be moved, along with the sub-forums, to the target Forum.');
}
echo '<div class="sfoptionerror spaceabove">';
echo "<p><b>{$mess}</b></br>";
echo sp_text('For more flexible Group/Forum ordering and sub-forum promotion and demotion, please use the drag and drop interface on the Order Groups and Forums admin panel from the Forums Menu - or the Order Forums panel at Group level.') . '</p>';
echo '</div>';
# Top level forum...
$style = $subforum ? ' style="display:none"' : ' style="display:block"';
echo "<div {$style}>";
spa_paint_select_start(spa_text('The group this forum belongs to'), 'group_id', '');
echo spa_create_group_select($forum->group_id);
spa_paint_select_end();
echo '</div>';
# sub-forum...
$style = $subforum ? ' style="display:block"' : ' style="display:none"';
echo "<div {$style}>";
spa_paint_select_start(spa_text('Parent forum this subforum belongs to'), 'parent', '');
echo spa_create_forum_select($forum->parent);
spa_paint_select_end();
echo '</div>';
spa_paint_input(spa_text('Forum name'), 'forum_name', sp_filter_title_display($forum->forum_name), false, true);
echo '<input type="hidden" name="forum_id" value="' . $forum->forum_id . '" />';
$target = 'cforum_slug';
$ahahURL = SFHOMEURL . 'index.php?sp_ahah=forums&sfnonce=' . wp_create_nonce('forum-ahah');
echo "<div class='sp-form-row'>\n";
echo "<div class='wp-core-ui sflabel sp-label-40'>" . spa_text('Forum slug') . ':</div>';
echo '<input type="text" class="wp-core-ui sp-input-60" tabindex="' . $tab . '" name="cforum_slug" id="cforum_slug" value="' . esc_attr($forum->forum_slug) . '" onchange="spjSetForumSlug(this, \'' . $ahahURL . '\', \'' . $target . '\', \'edit\');" />';
echo '<div class="clearboth"></div>';
echo '</div>';
$tab++;
spa_paint_input(spa_text('Description'), 'forum_desc', sp_filter_text_edit($forum->forum_desc), false, true);
spa_paint_close_fieldset();
spa_paint_close_panel();
spa_paint_open_panel();
spa_paint_open_fieldset(spa_text('Forum Options'), false);
$target = 'cforum_slug';
$ahahURL = SFHOMEURL . 'index.php?sp_ahah=forums&sfnonce=' . wp_create_nonce('forum-ahah');
spa_paint_checkbox(spa_text('Locked'), 'forum_status', $forum->forum_status);
spa_paint_checkbox(spa_text('Disable forum RSS feed so feed will not be generated'), 'forum_private', $forum->forum_rss_private);
spa_paint_select_start(sprintf(spa_text('Featured Image for this forum %s(200px x 200px recommended)'), '<br>'), 'feature_image', '');
spa_select_icon_dropdown('feature_image', spa_text('Select Feature Image'), SF_STORE_DIR . '/' . $spPaths['forum-images'] . '/', $forum->feature_image, false);
spa_paint_select_end();
echo '<div class="sfoptionerror spaceabove">';
echo '<p><b>' . sp_text('Custom Icon Ordering') . '</b></br>';
echo sp_text('When using custom forum or topic icons and multiple conditions exist, the following precedence is used:') . '</p>';
echo sp_text('Locked') . '<br />';
echo sp_text('Pinned') . '<br />';
echo sp_text('Unread') . '<br />';
echo sp_text('Custom') . '<br />';
echo sp_text('Theme Default') . '<br />';
echo '</div>';
spa_paint_select_start(spa_text('Custom forum icon'), 'forum_icon', '');
spa_select_icon_dropdown('forum_icon', spa_text('Select Custom Icon'), SF_STORE_DIR . '/' . $spPaths['custom-icons'] . '/', $forum->forum_icon, false);
//.........这里部分代码省略.........
开发者ID:bself,项目名称:nuimage-wp,代码行数:101,代码来源:spa-forums-edit-forum-form.php
示例17: spa_forums_delete_forum_form
function spa_forums_delete_forum_form($forum_id)
{
?>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('#forumrow-<?php
echo $forum_id;
?>
').addClass('inForm');
spjAjaxForm('sfforumdelete<?php
echo $forum_id;
?>
', 'sfreloadfb');
});
</script>
<?php
$forum = spdb_table(SFFORUMS, "forum_id={$forum_id}", 'row');
spa_paint_options_init();
$ahahURL = SFHOMEURL . 'index.php?sp_ahah=forums-loader&sfnonce=' . wp_create_nonce('forum-ahah') . '&saveform=deleteforum';
?>
<form action="<?php
echo $ahahURL;
?>
" method="post" id="sfforumdelete<?php
echo $forum->forum_id;
?>
" name="sfforumdelete<?php
echo $forum->forum_id;
?>
">
<?php
echo sp_create_nonce('forum-adminform_forumdelete');
spa_paint_open_tab(spa_text('Forums') . ' - ' . spa_text('Manage Groups and Forums'), true);
spa_paint_open_panel();
spa_paint_open_fieldset(spa_text('Delete Forum'), 'true', 'delete-forum');
?>
<input type="hidden" name="group_id" value="<?php
echo $forum->group_id;
?>
" />
<input type="hidden" name="forum_id" value="<?php
echo $forum->forum_id;
?>
" />
<input type="hidden" name="cforum_seq" value="<?php
echo $forum->forum_seq;
?>
" />
<input type="hidden" name="parent" value="<?php
echo $forum->parent;
?>
" />
<input type="hidden" name="children" value="<?php
echo $forum->children;
?>
" />
<?php
echo '<p>';
spa_etext('Warning! You are about to delete a forum');
echo '</p>';
echo '<p>';
spa_etext('This will remove ALL topics and posts contained in this forum');
echo '</p>';
echo '<p>';
spa_etext('Any Subforums will be promoted');
echo '</p>';
echo '<p>';
echo sprintf(spa_text('Please note that this action %s can NOT be reversed %s'), '<strong>', '</strong>');
echo '</p>';
echo '<p>';
spa_etext('Click on the delete forum button below to proceed');
echo '</p>';
echo '<p><strong>';
spa_etext('IMPORTANT: Be patient. For busy forums this action can take some time');
echo '</strong></p>';
spa_paint_close_fieldset();
spa_paint_close_panel();
do_action('sph_forums_delete_forum_panel');
spa_paint_close_contai
|
请发表评论