本文整理汇总了PHP中spdb_table函数的典型用法代码示例。如果您正苦于以下问题:PHP spdb_table函数的具体用法?PHP spdb_table怎么用?PHP spdb_table使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了spdb_table函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
}
示例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');
}
示例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;
}
}
示例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;
}
}
示例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;
}
示例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;
}
}
}
示例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;
}
示例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
}
示例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;
}
示例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);
}
示例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);
}
}
}
示例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;
}
示例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;
}
示例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>';
示例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();
}