本文整理汇总了PHP中sp_filter_title_save函数的典型用法代码示例。如果您正苦于以下问题:PHP sp_filter_title_save函数的具体用法?PHP sp_filter_title_save怎么用?PHP sp_filter_title_save使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sp_filter_title_save函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sp_featured_admin_options_save
function sp_featured_admin_options_save()
{
check_admin_referer('forum-adminform_userplugin', 'forum-adminform_userplugin');
# Save options
$topics = sp_filter_title_save(trim($_POST['topic_list']));
$topics = explode(',', $topics);
sp_add_sfmeta('featured', 'topics', $topics, true);
$posts = sp_filter_title_save(trim($_POST['post_list']));
$posts = explode(',', $posts);
sp_add_sfmeta('featured', 'posts', $posts, true);
$out = __('Featured topics and posts options updated', 'sp-featured');
return $out;
}
示例2: spa_save_usergroups_edit_usergroup
function spa_save_usergroups_edit_usergroup()
{
check_admin_referer('forum-adminform_usergroupedit', 'forum-adminform_usergroupedit');
$usergroupdata = array();
$usergroup_id = sp_esc_int($_POST['usergroup_id']);
$usergroupdata['usergroup_name'] = sp_filter_title_save(trim($_POST['usergroup_name']));
$usergroupdata['usergroup_desc'] = sp_filter_title_save(trim($_POST['usergroup_desc']));
$usergroupdata['usergroup_badge'] = sp_filter_filename_save(trim($_POST['usergroup_badge']));
if (isset($_POST['usergroup_join'])) {
$usergroupdata['usergroup_join'] = 1;
} else {
$usergroupdata['usergroup_join'] = 0;
}
if (isset($_POST['usergroup_is_moderator'])) {
$usergroupdata['usergroup_is_moderator'] = 1;
} else {
$usergroupdata['usergroup_is_moderator'] = 0;
}
# update the user group info
$sql = 'UPDATE ' . SFUSERGROUPS . ' SET ';
$sql .= 'usergroup_name="' . $usergroupdata['usergroup_name'] . '", ';
$sql .= 'usergroup_desc="' . $usergroupdata['usergroup_desc'] . '", ';
$sql .= 'usergroup_badge="' . $usergroupdata['usergroup_badge'] . '", ';
$sql .= 'usergroup_join="' . $usergroupdata['usergroup_join'] . '", ';
$sql .= 'usergroup_is_moderator="' . $usergroupdata['usergroup_is_moderator'] . '" ';
$sql .= "WHERE usergroup_id={$usergroup_id}";
$success = spdb_query($sql);
sp_reset_memberships();
if ($success == false) {
$mess = spa_text('User group update failed');
} else {
$mess = spa_text('User group record updated');
do_action('sph_usergroup_new', $usergroup_id);
}
return $mess;
}
示例3: spa_etext
spa_etext('No users with this special rank');
}
echo '</fieldset>';
}
if ($action == 'delsmiley') {
$file = sp_esc_str($_GET['file']);
$path = SF_STORE_DIR . '/' . $spPaths['smileys'] . '/' . $file;
@unlink($path);
# load smiles from sfmeta
$meta = sp_get_sfmeta('smileys', 'smileys');
# now cycle through to remove this entry and resave
if (!empty($meta[0]['meta_value'])) {
$newsmileys = array();
foreach ($meta[0]['meta_value'] as $name => $info) {
if ($info[0] != $file) {
$newsmileys[$name][0] = sp_filter_title_save($info[0]);
$newsmileys[$name][1] = sp_filter_name_save($info[1]);
$newsmileys[$name][2] = sp_filter_name_save($info[2]);
$newsmileys[$name][3] = $info[3];
$newsmileys[$name][4] = $info[4];
}
}
sp_update_sfmeta('smileys', 'smileys', $newsmileys, $meta[0]['meta_id'], true);
}
echo '1';
}
if ($action == 'delbadge') {
$file = sp_esc_str($_GET['file']);
$path = SF_STORE_DIR . '/' . $spPaths['ranks'] . '/' . $file;
@unlink($path);
echo '1';
示例4: sp_UpdateProfile
//.........这里部分代码省略.........
$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);
}
}
}
}
# save the url
$update = apply_filters('sph_ProfileUserWebsiteUpdate', true);
if ($update) {
$url = sp_filter_url_save($_POST['website']);
$sql = 'UPDATE ' . SFUSERS . ' SET user_url="' . $url . '" WHERE ID=' . $thisUser;
spdb_query($sql);
}
# update first name, last name, location and biorgraphy
$update = apply_filters('sph_ProfileUserFirstNameUpdate', true);
if ($update) {
update_user_meta($thisUser, 'first_name', sp_filter_name_save(trim($_POST['first_name'])));
}
$update = apply_filters('sph_ProfileUserLastNameUpdate', true);
if ($update) {
update_user_meta($thisUser, 'last_name', sp_filter_name_save(trim($_POST['last_name'])));
}
$update = apply_filters('sph_ProfileUserLocationUpdate', true);
if ($update) {
update_user_meta($thisUser, 'location', sp_filter_title_save(trim($_POST['location'])));
}
$update = apply_filters('sph_ProfileUserBiographyUpdate', true);
if ($update) {
update_user_meta($thisUser, 'description', sp_filter_save_kses($_POST['description']));
}
# fire action for plugins
$message = apply_filters('sph_UpdateProfileProfile', $message, $thisUser);
# output profile save status
if (empty($message)) {
$message['type'] = 'success';
$message['text'] = sp_text('Profile settings updated');
}
break;
case 'edit-identities':
# update identity settings
# update the user identities
$update = apply_filters('sph_ProfileUserAIMUpdate', true);
if ($update) {
update_user_meta($thisUser, 'aim', sp_filter_title_save(trim($_POST['aim'])));
}
$update = apply_filters('sph_ProfileUserYahooUpdate', true);
if ($update) {
update_user_meta($thisUser, 'yim', sp_filter_title_save(trim($_POST['yim'])));
}
$update = apply_filters('sph_ProfileUserGoogleUpdate', true);
if ($update) {
update_user_meta($thisUser, 'jabber', sp_filter_title_save(trim($_POST['jabber'])));
}
$update = apply_filters('sph_ProfileUserMSNUpdate', true);
if ($update) {
update_user_meta($thisUser, 'msn', sp_filter_title_save(trim($_POST['msn'])));
}
示例5: sp_profile_delete_menu
function sp_profile_delete_menu($tab, $name)
{
# sanitize before use
$tab = sp_filter_title_save($tab);
$name = sp_filter_title_save($name);
# get the current tabs
$tabs = sp_profile_get_tabs();
if (empty($tabs)) {
return false;
}
# find the requested tab
foreach ($tabs as &$thisTab) {
if ($thisTab['name'] == $tab) {
# make sure the menu doesnt already exist on this tab
if ($thisTab['menus']) {
foreach ($thisTab['menus'] as $index => $menu) {
if ($menu['name'] == $name) {
unset($thisTab['menus'][$index]);
}
}
$thisTab['menus'] = array_values($thisTab['menus']);
}
}
}
# reorder tabs afer removal and save
$newtabs = serialize(array_values($tabs));
$result = sp_add_sfmeta('profile', 'tabs', $tabs);
return $result;
}
示例6: spa_save_integration_storage_data
function spa_save_integration_storage_data()
{
check_admin_referer('forum-adminform_storage', 'forum-adminform_storage');
$mess = spa_text('Storage locations updated');
$sfstorage = array();
$sfstorage = sp_get_option('sfconfig');
if (!empty($_POST['plugins'])) {
$sfstorage['plugins'] = trim(sp_filter_title_save(trim($_POST['plugins'])), '/');
}
if (!empty($_POST['themes'])) {
$sfstorage['themes'] = trim(sp_filter_title_save(trim($_POST['themes'])), '/');
}
if (!empty($_POST['avatars'])) {
$sfstorage['avatars'] = trim(sp_filter_title_save(trim($_POST['avatars'])), '/');
}
if (!empty($_POST['avatar-pool'])) {
$sfstorage['avatar-pool'] = trim(sp_filter_title_save(trim($_POST['avatar-pool'])), '/');
}
if (!empty($_POST['smileys'])) {
$sfstorage['smileys'] = trim(sp_filter_title_save(trim($_POST['smileys'])), '/');
}
if (!empty($_POST['ranks'])) {
$sfstorage['ranks'] = trim(sp_filter_title_save(trim($_POST['ranks'])), '/');
}
if (!empty($_POST['image-uploads'])) {
$sfstorage['image-uploads'] = trim(sp_filter_title_save(trim($_POST['image-uploads'])), '/');
}
if (!empty($_POST['media-uploads'])) {
$sfstorage['media-uploads'] = trim(sp_filter_title_save(trim($_POST['media-uploads'])), '/');
}
if (!empty($_POST['file-uploads'])) {
$sfstorage['file-uploads'] = trim(sp_filter_title_save(trim($_POST['file-uploads'])), '/');
}
if (!empty($_POST['custom-icons'])) {
$sfstorage['custom-icons'] = trim(sp_filter_title_save(trim($_POST['custom-icons'])), '/');
}
if (!empty($_POST['language-sp'])) {
$sfstorage['language-sp'] = trim(sp_filter_title_save(trim($_POST['language-sp'])), '/');
}
if (!empty($_POST['language-sp-plugins'])) {
$sfstorage['language-sp-plugins'] = trim(sp_filter_title_save(trim($_POST['language-sp-plugins'])), '/');
}
if (!empty($_POST['language-sp-themes'])) {
$sfstorage['language-sp-themes'] = trim(sp_filter_title_save(trim($_POST['language-sp-themes'])), '/');
}
if (!empty($_POST['cache'])) {
$sfstorage['cache'] = trim(sp_filter_title_save(trim($_POST['cache'])), '/');
}
sp_update_option('sfconfig', $sfstorage);
do_action('sph_integration_storage_save');
return $mess;
}
示例7: spa_save_email_data
function spa_save_email_data()
{
check_admin_referer('forum-adminform_email', 'forum-adminform_email');
$mess = spa_text('Options updated');
# Save Email Options
# Thanks to Andrew Hamilton for these routines (mail-from plugion)
# Remove any illegal characters and convert to lowercase both the user name and domain name
$domain_input_errors = array('http://', 'https://', 'ftp://', 'www.');
$domainname = strtolower(sp_filter_title_save(trim($_POST['sfmaildomain'])));
$domainname = str_replace($domain_input_errors, '', $domainname);
$domainname = preg_replace('/[^0-9a-z\\-\\.]/i', '', $domainname);
$illegal_chars_username = array('(', ')', '<', '>', ',', ';', ':', '\\', '"', '[', ']', '@', ' ');
$username = strtolower(sp_filter_name_save(trim($_POST['sfmailfrom'])));
$username = str_replace($illegal_chars_username, '', $username);
$sfmail = array();
$sfmail['sfmailsender'] = sp_filter_name_save(trim($_POST['sfmailsender']));
$sfmail['sfmailfrom'] = $username;
$sfmail['sfmaildomain'] = $domainname;
$sfmail['sfmailuse'] = isset($_POST['sfmailuse']);
sp_update_option('sfmail', $sfmail);
# Save new user mail options
$sfmail = array();
$sfmail['sfusespfreg'] = isset($_POST['sfusespfreg']);
$sfmail['sfnewusersubject'] = sp_filter_title_save(trim($_POST['sfnewusersubject']));
$sfmail['sfnewusertext'] = sp_filter_title_save(trim($_POST['sfnewusertext']));
sp_update_option('sfnewusermail', $sfmail);
do_action('sph_option_email_save');
return $mess;
}
示例8: spa_save_permissions_new_auth
function spa_save_permissions_new_auth()
{
check_admin_referer('forum-adminform_authnew', 'forum-adminform_authnew');
# create the auth
if (!empty($_POST['auth_name'])) {
$active = isset($_POST['auth_active']) ? 1 : 0;
$ignored = isset($_POST['auth_guests']) ? 1 : 0;
$enabling = isset($_POST['auth_enabling']) ? 1 : 0;
$result = sp_add_auth(sp_filter_title_save($_POST['auth_name']), sp_filter_title_save($_POST['auth_desc']), $active, $ignored, $enabling);
if ($result) {
# reset the auths to account for new auth
sp_reset_auths();
$mess = spa_text('New auth added');
} else {
$mess = spa_text('New auth failed - duplicate auth?');
}
} else {
$mess = spa_text('New auth failed - missing data');
}
return $mess;
}
示例9: spa_update_specialrank
function spa_update_specialrank($id)
{
check_admin_referer('special-rank-update', 'special-rank-update');
# save special forum ranks
if (!empty($_POST['specialrankdesc'])) {
$desc = $_POST['specialrankdesc'];
$badge = $_POST['specialrankbadge'];
$rank = sp_get_sfmeta('special_rank', false, $id);
$rank[0]['meta_value']['badge'] = sp_filter_filename_save($badge[$id]);
sp_update_sfmeta('special_rank', sp_filter_title_save(trim($desc[$id])), $rank[0]['meta_value'], $id, 1);
if ($_POST['currentname'][$id] != $desc[$id]) {
spdb_query("UPDATE " . SFSPECIALRANKS . "\n\t\t\t\t\t\tSET special_rank = '" . $desc[$id] . "'\n\t\t\t\t\t\tWHERE special_rank = '" . $_POST['currentname'][$id] . "'");
}
}
do_action('sph_component_srank_update_save');
$mess = spa_text('Special ranks updated');
return $mess;
}
示例10: spa_users_members_form
function spa_users_members_form()
{
spa_paint_options_init();
spa_paint_open_tab(spa_text('Users') . ' - ' . spa_text('Member Information'), true);
spa_paint_open_panel();
spa_paint_open_fieldset(spa_text('Member Information'), 'true', 'users-info');
if (isset($_POST['usersearch'])) {
$term = sp_filter_title_save(trim($_POST['usersearch']));
} else {
$term = '';
}
if (isset($_GET['userspage'])) {
$page = sp_esc_int($_GET['userspage']);
} else {
$page = '';
}
$user_search = new SP_User_Search($term, $page);
?>
<form id="posts-filter" name="searchfilter" action="<?php
echo SFADMINUSER . '&form=member-info';
?>
" method="post">
<div class="tablenav">
<?php
if ($user_search->results_are_paged()) {
?>
<div class="tablenav-pages">
<?php
$args = array();
if (!empty($user_search->search_term)) {
$args['usersearch'] = urlencode($user_search->search_term);
}
$user_search->paging_text = paginate_links(array('total' => ceil($user_search->total_users_for_query / $user_search->users_per_page), 'current' => $user_search->page, 'base' => 'admin.php?page=simple-press/admin/panel-users/spa-users.php&form=member-info&%_%', 'format' => 'userspage=%#%', 'add_args' => $args));
echo $user_search->page_links();
?>
</div>
<?php
}
?>
<div>
<label class="hidden" for="post-search-input"><?php
spa_etext('Search Members');
?>
:</label>
<input type="text" class="sfacontrol" id="post-search-input" name="usersearch" value="<?php
echo esc_attr($user_search->search_term);
?>
" />
<input type="button" class="button-primary" onclick="javascript:document.searchfilter.submit();" id="sfusersearch" name="sfusersearch" value="<?php
spa_etext('Search Members');
?>
" />
</div>
<br class="clear" />
</div>
<br class="clear" />
</form>
<?php
if ($user_search->get_results()) {
?>
<?php
if ($user_search->is_search()) {
?>
<p><a href="<?php
echo SFADMINUSER;
?>
"><?php
echo sprintf(spa_text('%s Back to All Members'), '«');
?>
</a></p>
<?php
}
?>
<table id="memTable" class="widefat fixed spMobileTable1280">
<thead>
<tr>
<th style="text-align:center;width:4%"><?php
spa_etext('ID');
?>
</th>
<th style="text-align:center;"><?php
spa_etext('Login Name');
?>
</th>
<th style="text-align:center;"><?php
spa_etext('Display Name');
?>
</th>
<th style="text-align:center;width:15%"><?php
spa_etext('First Post');
?>
</th>
<th style="text-align:center;width:15%"><?php
spa_etext('Last Post');
?>
</th>
<th style="text-align:center;width:3.5%"><?php
spa_etext('Posts');
?>
//.........这里部分代码省略.........
示例11: sp_SearchResults
function sp_SearchResults($args = '')
{
global $spSearchView, $spThisUser, $spListView;
$defs = array('tagId' => 'spSearchList', 'tagClass' => 'spSearchSection', 'template' => 'spListView.php', 'first' => 0, 'get' => 0);
$a = wp_parse_args($args, $defs);
$a = apply_filters('sph_SearchResults_args', $a);
extract($a, EXTR_SKIP);
# sanitize before use
$tagId = esc_attr($tagId);
$tagClass = esc_attr($tagClass);
$template = sp_filter_title_save($template);
$first = (int) $first;
$get = (int) $get;
if ($get) {
do_action('sph_search_results');
return $spSearchView->searchData;
}
echo "<div id='{$tagId}' class='{$tagClass}'>\n";
$spListView = new spTopicList($spSearchView->searchData, 0, false, '', $first, 1, 'search');
sp_load_template($template);
echo "</div>\n";
}
示例12: sp_post_notification
function sp_post_notification($user, $message, $postid)
{
global $spThisUser;
if (!$spThisUser->admin && !$spThisUser->moderator) {
return;
}
$userid = spdb_table(SFMEMBERS, "display_name='{$user}'", 'user_id');
if (empty($userid)) {
return;
}
$topic_id = spdb_table(SFPOSTS, "post_id={$postid}", 'topic_id');
$nData = array();
$nData['user_id'] = $userid;
$nData['guest_email'] = '';
$nData['post_id'] = $postid;
$nData['link'] = sp_permalink_from_postid($postid);
$nData['link_text'] = spdb_table(SFTOPICS, "topic_id={$topic_id}", 'topic_name');
$nData['message'] = sp_filter_title_save($message);
$nData['expires'] = $time;
# 30 days; 24 hours; 60 mins; 60secs
sp_add_notice($nData);
}
示例13: validateData
function validateData()
{
$this->abort = false;
$this->newpost['action'] = $this->action;
# Check flood control (done here vice validatePermission() so we can use the return to post feature)
if (!sp_get_auth('bypass_flood_control', $this->newpost['forumid'], $this->userid)) {
$flood = sp_get_cache('floodcontrol');
if (!empty($flood) && time() < $flood) {
$this->abort = true;
$this->message = sp_text('Flood control exceeded, please slow down - Post cannot be saved yet');
return;
}
}
# Check topic name
if (empty($this->newpost['topicname'])) {
$this->abort = true;
$this->message = sp_text('No topic name has been entered and post cannot be saved');
return;
} else {
$this->newpost['topicname'] = sp_filter_title_save($this->newpost['topicname'], SFTOPICS, 'topic_name');
}
# Check Post Content
if (empty($this->newpost['postcontent'])) {
$this->abort = true;
$this->message = sp_text('No topic post has been entered and post cannot be saved');
return;
} else {
$this->newpost['postcontent_unescaped'] = sp_filter_content_save($this->newpost['postcontent'], 'new', false, SFPOSTS, 'post_content');
$this->newpost['postcontent'] = sp_filter_content_save($this->newpost['postcontent'], 'new', true, SFPOSTS, 'post_content');
}
# Check and set user names/ids etc
if ($this->guest) {
$sfguests = sp_get_option('sfguests');
if (empty($this->newpost['guestname']) || (empty($this->newpost['guestemail']) || !is_email($this->newpost['guestemail'])) && $sfguests['reqemail']) {
$this->abort = true;
$this->message = sp_text('Guest name and valid email address required');
return;
}
# force maximum lengths
$this->newpost['guestname'] = substr(sp_filter_name_save($this->newpost['guestname']), 0, 20);
$this->newpost['guestemail'] = substr(sp_filter_email_save($this->newpost['guestemail']), 0, 50);
$this->newpost['postername'] = $this->newpost['guestname'];
$this->newpost['posteremail'] = $this->newpost['guestemail'];
# check for blacklisted guest name
$blockedGuest = sp_get_option('guest-name');
if (!empty($blockedGuest)) {
$names = explode(',', $blockedGuest);
foreach ($names as $name) {
if (strtolower(trim($name)) == strtolower($this->newpost['guestname'])) {
$this->abort = true;
$this->message = sp_text('The guest name you have chosen is not allowed on this site');
return;
}
}
}
# check that the guest name is not the same as a current user
$checkdupe = spdb_table(SFMEMBERS, "display_name='" . $this->newpost['guestname'] . "'", 'display_name');
if (!empty($checkdupe)) {
$this->abort = true;
$this->message = sp_text('This user name already belongs to a forum member');
return;
}
}
# Check if links allowed or if maxmium links have been exceeded
$sffilters = sp_get_option('sffilters');
if (!$this->admin) {
$links = $this->count_links();
if (sp_get_auth('create_links', $this->newpost['forumid'], $this->userid)) {
if ($sffilters['sfmaxlinks'] > 0 && $links > $sffilters['sfmaxlinks']) {
$this->abort = true;
$this->message = sp_text('Maximum number of allowed links exceeded') . ': ' . $sffilters['sfmaxlinks'] . ' ' . sp_text('allowed');
return;
}
} else {
if ($links > 0) {
$this->abort = true;
$this->message = sp_text('You are not allowed to put links in post content');
return;
}
}
}
# Check if maxmium smileys have been exceeded
if (!$this->admin) {
if (isset($sffilters['sfmaxsmileys']) && $sffilters['sfmaxsmileys'] > 0 && $this->count_smileys() > $sffilters['sfmaxsmileys']) {
$this->abort = true;
$this->message = sp_text('Maximum number of allowed smileys exceeded') . ': ' . $sffilters['sfmaxsmileys'] . ' ' . sp_text('allowed');
return;
}
}
# Check for duplicate post of option is set
if ($this->member && $sffilters['sfdupemember'] == true || $this->guest && $sffilters['sfdupeguest'] == true) {
# But not admin or moderator
if (!$this->admin && !$this->moderator) {
$dupecheck = spdb_table(SFPOSTS, 'forum_id = ' . $this->newpost['forumid'] . ' AND topic_id=' . $this->newpost['topicid'] . " AND post_content='" . $this->newpost['postcontent'] . "' AND poster_ip='" . $this->newpost['posterip'] . "'", 'row', '', '', ARRAY_A);
if ($dupecheck) {
$this->abort = true;
$this->message = sp_text('Duplicate post refused');
return;
}
}
//.........这里部分代码省略.........
示例14: spa_save_forums_edit_group
function spa_save_forums_edit_group()
{
check_admin_referer('forum-adminform_groupedit', 'forum-adminform_groupedit');
$groupdata = array();
$group_id = sp_esc_int($_POST['group_id']);
$groupdata['group_name'] = sp_filter_title_save(trim($_POST['group_name']));
$groupdata['group_desc'] = sp_filter_text_save(trim($_POST['group_desc']));
$groupdata['group_message'] = sp_filter_text_save(trim($_POST['group_message']));
$ug_list = array_unique($_POST['usergroup_id']);
$perm_list = $_POST['role'];
if (!empty($_POST['group_icon'])) {
# Check new icon exists
$groupdata['group_icon'] = sp_filter_title_save(trim($_POST['group_icon']));
$path = SFCUSTOMDIR . $groupdata['group_icon'];
if (!file_exists($path)) {
$mess = sprintf(spa_text('Custom icon %s does not exist'), $groupdata['group_icon']);
return $mess;
}
} else {
$groupdata['group_icon'] = null;
}
if (isset($_POST['group_rss'])) {
$groupdata['group_rss'] = sp_filter_save_cleanurl($_POST['group_rss']);
} else {
$groupdata['group_rss'] = sp_filter_save_cleanurl($_POST['cgroup_rss']);
}
# save the default permissions for the group
for ($x = 0; $x < count($ug_list); $x++) {
$ug = sp_esc_int($ug_list[$x]);
$perm = sp_esc_int($perm_list[$x]);
if (spa_get_defpermissions_role($group_id, $ug)) {
$sql = 'UPDATE ' . SFDEFPERMISSIONS . "\n\t\t\t\t\tSET permission_role={$perm}\n\t\t\t\t\tWHERE group_id={$group_id} AND usergroup_id={$ug}";
spdb_query($sql);
} else {
if ($perm != -1) {
spa_add_defpermission_row($group_id, $ug, $perm);
}
}
}
if ($groupdata['group_name'] == $_POST['cgroup_name'] && $groupdata['group_desc'] == $_POST['cgroup_desc'] && $groupdata['group_rss'] == $_POST['cgroup_rss'] && $groupdata['group_message'] == $_POST['cgroup_message'] && $groupdata['group_icon'] == $_POST['cgroup_icon']) {
$mess = spa_text('No data changed');
} else {
$sql = 'UPDATE ' . SFGROUPS . ' SET ';
$sql .= 'group_name="' . $groupdata['group_name'] . '", ';
$sql .= 'group_desc="' . $groupdata['group_desc'] . '", ';
$sql .= 'group_icon="' . $groupdata['group_icon'] . '", ';
$sql .= 'group_rss="' . $groupdata['group_rss'] . '", ';
$sql .= 'group_message="' . $groupdata['group_message'] . '" ';
$sql .= "WHERE group_id={$group_id}";
$success = spdb_query($sql);
if ($success == false) {
$mess = spa_text('Group record update failed');
do_action('sph_forum_group_edit', $group_id);
} else {
$mess = spa_text('Forum group record updated');
}
}
# clear out group cache tpo enable change_user
sp_flush_cache('group');
return $mess;
}
示例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();
}