本文整理汇总了PHP中sp_get_option函数的典型用法代码示例。如果您正苦于以下问题:PHP sp_get_option函数的具体用法?PHP sp_get_option怎么用?PHP sp_get_option使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sp_get_option函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sp_admin_bar_do_upgrade_check
function sp_admin_bar_do_upgrade_check()
{
if (!sp_is_plugin_active('admin-bar/sp-admin-bar-plugin.php')) {
return;
}
$options = sp_get_option('spAdminBar');
$db = $options['dbversion'];
if (empty($db)) {
$db = 0;
}
# quick bail check
if ($db == SPABDBVERSION) {
return;
}
# apply upgrades as needed
if ($db < 1) {
# empty since plugin did not used db on initial release
}
if ($db < 2) {
# set autoload flag to true for autoupdates
$meta = sp_get_sfmeta('autoupdate', 'admin');
if (!empty($meta[0])) {
sp_update_sfmeta('autoupdate', 'admin', $meta[0]['meta_value'], $meta[0]['meta_id'], 1);
}
}
if ($db < 3) {
# permission for bypassing akismet checks
sp_add_auth('bypass_akismet', __('Can bypass akismet check on posts', 'spab'), 1, 0, 0, 0, 3);
sp_activate_auth('bypass_akismet');
}
# save data
$options['dbversion'] = SPABDBVERSION;
sp_update_option('spAdminBar', $options);
}
示例2: sp_akismet
function sp_akismet($newpost)
{
global $spThisUser;
if (sp_get_auth('bypass_akismet', $newpost['forumid'])) {
return $newpost;
}
if (function_exists('akismet_http_post') == false) {
return $newpost;
}
$akismet = sp_get_option('spAkismet');
if (empty($akismet) || $akismet == 1) {
return $newpost;
}
$spam = sp_check_akismet($newpost);
if (true == $spam) {
if ($akismet == 2) {
$newpost['poststatus'] = 2;
}
if ($akismet == 3) {
sp_notify(1, __('This post has been identified as spam and has been rejected', 'spab'));
wp_redirect(sp_url());
die;
}
}
return $newpost;
}
示例3: spa_get_messages_data
function spa_get_messages_data()
{
$sfcomps = array();
# custom message for posts
$sfpostmsg = array();
$sfpostmsg = sp_get_option('sfpostmsg');
$sflogin = array();
$sflogin = sp_get_option('sflogin');
$sfcomps['sfpostmsgtext'] = sp_filter_text_edit($sfpostmsg['sfpostmsgtext']);
$sfcomps['sfpostmsgtopic'] = $sfpostmsg['sfpostmsgtopic'];
$sfcomps['sfpostmsgpost'] = $sfpostmsg['sfpostmsgpost'];
# custom editor message
$sfcomps['sfeditormsg'] = sp_filter_text_edit(sp_get_option('sfeditormsg'));
$sneakpeek = sp_get_sfmeta('sneakpeek', 'message');
$adminview = sp_get_sfmeta('adminview', 'message');
$userview = sp_get_sfmeta('userview', 'message');
$sfcomps['sfsneakpeek'] = '';
$sfcomps['sfadminview'] = '';
$sfcomps['sfuserview'] = '';
if (!empty($sneakpeek[0])) {
$sfcomps['sfsneakpeek'] = sp_filter_text_edit($sneakpeek[0]['meta_value']);
}
if (!empty($adminview[0])) {
$sfcomps['sfadminview'] = sp_filter_text_edit($adminview[0]['meta_value']);
}
if (!empty($userview[0])) {
$sfcomps['sfuserview'] = sp_filter_text_edit($userview[0]['meta_value']);
}
$sfcomps['sfsneakredirect'] = sp_filter_url_display($sflogin['sfsneakredirect']);
return $sfcomps;
}
示例4: spa_save_admins_your_options_data
function spa_save_admins_your_options_data()
{
global $spThisUser;
check_admin_referer('my-admin_options', 'my-admin_options');
# admin settings group
$sfadminoptions = '';
$sfadminoptions['sfnotify'] = isset($_POST['sfnotify']);
$sfadminoptions['bypasslogout'] = isset($_POST['bypasslogout']);
$sfadminoptions['notify-edited'] = isset($_POST['notify-edited']);
$sfadminoptions = apply_filters('sph_admin_your_options_change', $sfadminoptions);
sp_update_member_item($spThisUser->ID, 'admin_options', $sfadminoptions);
$mess = spa_text('Your admin options have been updated');
# do we update moderator options as well?
if ($spThisUser->admin && isset($_POST['setmods'])) {
$mods = sp_get_option('spModStats');
if ($mods) {
foreach ($mods as $mod) {
sp_update_member_item($mod['user_id'], 'admin_options', $sfadminoptions);
}
$mess .= '<br />' . spa_text('Your moderators options have been updated');
}
}
do_action('sph_admin_your_options_save');
return $mess;
}
示例5: 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;
}
}
示例6: sp_rebuild_schema
function sp_rebuild_schema($start, $end)
{
global $tables, $wpdb;
# prepare the one exception!
$opTable = $wpdb->prefix . 'sfoptions';
$opKey = 'option_id';
$t = sp_get_option('installed_tables');
for ($x = $start; $x < $end + 1; $x++) {
if ($t[$x]) {
# get list of indexes
$data = $wpdb->get_results("SHOW INDEXES FROM {$t[$x]}");
if ($data) {
foreach ($data as $item) {
if ($item->Key_name != 'PRIMARY' && ($t[$x] != $opTable && $item->Key_name != $opKey)) {
# remove current index
spdb_query('ALTER TABLE ' . $t[$x] . " DROP INDEX {$item->Key_name}");
}
}
}
# grab list of table actions
$actions = $tables[$t[$x]];
if ($actions) {
foreach ($actions as $sql) {
# add back index
spdb_query($sql);
}
}
}
}
}
示例7: wp_new_user_notification
function wp_new_user_notification($user_id, $notify = '')
{
$user = new WP_User($user_id);
$sflogin = sp_get_option('sflogin');
$eol = "\r\n";
$user_login = $user->user_login;
$user_email = $user->user_email;
$message = '';
$message .= sp_text_noesc('New user registration on your website') . ': ' . get_option('blogname') . $eol . $eol;
$message .= sp_text_noesc('Username') . ': ' . $user_login . $eol;
$message .= sp_text_noesc('E-mail') . ': ' . $user_email . $eol;
$message .= sp_text_noesc('Registration IP') . ': ' . sp_get_ip() . $eol;
$address = apply_filters('sph_admin_new_user_email_addrress', get_option('admin_email'), $user_id);
$subject = apply_filters('sph_admin_new_user_email_subject', get_option('blogname') . ' ' . sp_text_noesc('New User Registration'), $user_id);
$msg = apply_filters('sph_admin_new_user_email_msg', $message, $user_id);
sp_send_email($address, $subject, $msg);
if ('admin' === $notify || empty($notify)) {
return;
}
# Generate something random for a password reset key.
$key = wp_generate_password(20, false);
/** This action is documented in wp-login.php */
do_action('retrieve_password_key', $user_login, $key);
# Now insert the key, hashed, into the DB.
if (empty($wp_hasher)) {
require_once ABSPATH . WPINC . '/class-phpass.php';
$wp_hasher = new PasswordHash(8, true);
}
$hashed = time() . ':' . $wp_hasher->HashPassword($key);
global $wpdb;
$wpdb->update($wpdb->users, array('user_activation_key' => $hashed), array('user_login' => $user_login));
$mailoptions = sp_get_option('sfnewusermail');
$subject = stripslashes($mailoptions['sfnewusersubject']);
$body = stripslashes($mailoptions['sfnewusertext']);
if (empty($subject) || empty($body)) {
$subject = get_option('blogname') . ' ' . sp_text_noesc('Your username') . $eol . $eol;
$body = sp_text_noesc('Username') . ': ' . $user_login . $eol;
$body .= sp_text_noesc('Login URL') . ': ' . $sflogin['sfloginemailurl'] . $eol;
$body .= sp_text_noesc('Password Reset URL') . ': ' . network_site_url("wp-login.php?action=rp&key={$key}&login=" . rawurlencode($user_login), 'login') . $eol;
} else {
$blogname = get_bloginfo('name');
$subject = str_replace('%USERNAME%', $user_login, $subject);
$subject = str_replace('%BLOGNAME%', $blogname, $subject);
$subject = str_replace('%SITEURL%', sp_url(), $subject);
$subject = str_replace('%LOGINURL%', $sflogin['sfloginemailurl'], $subject);
$subject = str_replace('%PWURL%', network_site_url("wp-login.php?action=rp&key={$key}&login=" . rawurlencode($user_login), 'login'), $subject);
$body = str_replace('%USERNAME%', $user_login, $body);
$body = str_replace('%BLOGNAME%', $blogname, $body);
$body = str_replace('%SITEURL%', sp_url(), $body);
$body = str_replace('%LOGINURL%', $sflogin['sfloginemailurl'], $body);
$body = str_replace('%PWURL%', network_site_url("wp-login.php?action=rp&key={$key}&login=" . rawurlencode($user_login), 'login'), $body);
$body = str_replace('%NEWLINE%', $eol, $body);
}
str_replace('<br />', $eol, $body);
$address = apply_filters('sph_user_new_user_email_addrress', $user_email, $user_id);
$subject = apply_filters('sph_user_new_user_email_subject', get_option('blogname') . ' ' . sp_text_noesc('New User Registration'), $user_id);
$msg = apply_filters('sph_user_new_user_email_msg', $body, $user_id, $user_pass);
sp_send_email($user_email, $subject, $msg);
}
示例8: sp_url
function sp_url($link = '')
{
$url = sp_get_option('sfpermalink');
if (!empty($link)) {
$url = trailingslashit($url) . $link;
}
$url = user_trailingslashit($url);
return esc_url($url);
}
示例9: sp_captcha_admin_options_form
function sp_captcha_admin_options_form()
{
$captcha = sp_get_option('spCaptcha');
spa_paint_open_panel();
spa_paint_open_fieldset(__('Captcha on User Registration', 'sp-cap'), true, 'captcha');
spa_paint_checkbox(__('Add Captcha form to WP registration/signup form', 'sp-cap'), 'registration', $captcha['registration']);
spa_paint_close_fieldset();
spa_paint_close_panel();
do_action('sph_captcha_options_panel');
}
示例10: spa_get_inspector_data
function spa_get_inspector_data()
{
global $spThisUser;
$ins = array();
$ins = sp_get_option('spInspect');
$i = $spThisUser->ID;
if (empty($ins) || !array_key_exists($i, $ins)) {
$ins[$i] = array('con_spVars' => 0, 'con_spGlobals' => 0, 'con_spThisUser' => 0, 'con_spDevice' => 0, 'gv_spGroupView' => 0, 'gv_spThisGroup' => 0, 'gv_spThisForum' => 0, 'gv_spThisForumSubs' => 0, 'fv_spForumView' => 0, 'fv_spThisForum' => 0, 'fv_spThisForumSubs' => 0, 'fv_spThisSubForum' => 0, 'fv_spThisTopic' => 0, 'tv_spTopicView' => 0, 'tv_spThisTopic' => 0, 'tv_spThisPost' => 0, 'tv_spThisPostUser' => 0, 'mv_spMembersList' => 0, 'mv_spThisMemberGroup' => 0, 'mv_spThisMember' => 0, 'tlv_spTopicListView' => 0, 'tlv_spThisListTopic' => 0, 'plv_spPostListView' => 0, 'plv_spThisListPost' => 0, 'pro_spProfileUser' => 0, 'q_spGroupView' => 0, 'q_spGroupViewStats' => 0, 'q_spForumView' => 0, 'q_spForumViewStats' => 0, 'q_spTopicView' => 0, 'q_spMembersView' => 0, 'q_spTopicListView' => 0, 'q_spTopicListViewNew' => 0, 'q_spTopicListViewFirst' => 0, 'q_spPostListView' => 0, 'q_spSearchView' => 0);
}
return $ins[$i];
}
示例11: sp_captcha_do_install
function sp_captcha_do_install()
{
$captcha = sp_get_option('spCaptcha');
if (empty($captcha)) {
$captcha['registration'] = true;
$captcha['dbversion'] = SPCAPTCHADBVERSION;
sp_update_option('spCaptcha', $captcha);
}
# add a new permission into the auths table
sp_add_auth('bypass_captcha', __('Can bypass the post captcha check', 'sp-cap'), 1, 0, 0, 0, 6);
sp_activate_auth('bypass_captcha');
}
示例12: spa_get_mapping_data
function spa_get_mapping_data()
{
# get default usergroups
$sfoptions = array();
$value = sp_get_sfmeta('default usergroup', 'sfmembers');
$sfoptions['sfdefgroup'] = $value[0]['meta_value'];
$value = sp_get_sfmeta('default usergroup', 'sfguests');
$sfoptions['sfguestsgroup'] = $value[0]['meta_value'];
$sfmemberopts = sp_get_option('sfmemberopts');
$sfoptions['sfsinglemembership'] = $sfmemberopts['sfsinglemembership'];
return $sfoptions;
}
示例13: spa_toolbox_toolbox_form
function spa_toolbox_toolbox_form()
{
?>
<script type="text/javascript">
jQuery(document).ready(function() {
spjAjaxForm('sftoolboxform', '');
});
</script>
<?php
$sfoptions = spa_get_toolbox_data();
$ahahURL = SFHOMEURL . 'index.php?sp_ahah=toolbox-loader&sfnonce=' . wp_create_nonce('forum-ahah') . '&saveform=toolbox';
?>
<form action="<?php
echo $ahahURL;
?>
" method="post" id="sftoolboxform" name="sftoolbox">
<?php
echo sp_create_nonce('forum-adminform_toolbox');
spa_paint_options_init();
#== TOOLBOX Tab ============================================================
spa_paint_open_tab(spa_text('Toolbox') . ' - ' . spa_text('Toolbox'));
spa_paint_open_panel();
spa_paint_open_fieldset(spa_text('Current Version/Build'), false);
$version = spa_text('Version:') . ' <strong>' . sp_get_option('sfversion') . '</strong>';
$build = spa_text('Build: ') . ' <strong>' . sp_get_option('sfbuild') . '</strong>';
echo $version . ' ' . $build;
spa_paint_close_fieldset();
spa_paint_close_panel();
do_action('sph_toolbox_toolbox_left_panel');
spa_paint_tab_right_cell();
spa_paint_open_panel();
spa_paint_open_fieldset(spa_text('Modify Build Number'), true, 'modify-build-number');
echo '<div class="sfoptionerror">' . spa_text('WARNING: This value should not be changed unless requested by the Simple:Press team in the support forum as it may cause the install/upgrade script to be re-run.') . '</div>';
spa_paint_input(spa_text('Build number'), "sfbuild", sp_get_option('sfbuild'), false, false);
spa_paint_checkbox(spa_text('Force upgrade to build number'), "sfforceupgrade", $sfoptions['sfforceupgrade']);
spa_paint_close_fieldset();
spa_paint_close_panel();
do_action('sph_toolbox_toolbox_right_panel');
spa_paint_close_container();
?>
<div class="sfform-submit-bar">
<input type="submit" class="button-primary" id="saveit" name="saveit" value="<?php
spa_etext('Update Toolbox');
?>
" />
</div>
<?php
spa_paint_close_tab();
?>
</form>
<?php
}
示例14: sp_akismet_admin_options_form
function sp_akismet_admin_options_form()
{
$spAkismet = sp_get_option('spAkismet');
spa_paint_open_panel();
spa_paint_open_fieldset(__('Akismet', 'spab'), true, 'akismet');
if (function_exists('akismet_http_post')) {
$values = array(__('Do not use Akismet', 'spab'), __('Place Akismet marked spam posts into moderation', 'spab'), __('Do not save Akismet marked spam posts', 'spab'));
spa_paint_radiogroup(__('Select Akismet Option', 'spab'), 'spAkismet', $values, $spAkismet, '', false, true);
} else {
_e('Akismet is not currently active on this site', 'spab');
}
spa_paint_close_fieldset();
spa_paint_close_panel();
}
示例15: spa_themes_css_form
function spa_themes_css_form()
{
$css = '';
$id = 0;
# get current theme
$curTheme = sp_get_option('sp_current_theme');
$rec = sp_get_sfmeta('css', $curTheme['theme']);
if ($rec) {
$css = $rec[0]['meta_value'];
$id = $rec[0]['meta_id'];
}
?>
<script type="text/javascript">
jQuery(document).ready(function() {
spjAjaxForm('speditcss', '');
});
</script>
<?php
$ahahURL = SFHOMEURL . 'index.php?sp_ahah=themes-loader&sfnonce=' . wp_create_nonce('forum-ahah') . '&saveform=css';
?>
<form action="<?php
echo $ahahURL;
?>
" method="post" id="speditcss" name="speditcss">
<?php
echo sp_create_nonce('forum-adminform_css-editor');
spa_paint_options_init();
spa_paint_open_tab(spa_text('CSS Editor') . ' - ' . spa_text('Custom Simple:Press Theme CSS'), true);
spa_paint_open_panel();
spa_paint_open_fieldset(spa_text('CSS Editor'), true, 'css-editor');
echo '<div>';
echo '<textarea rows="25" name="spnewcontent" id="spnewcontent" tabindex="1">' . $css . '</textarea>';
echo '<input type="hidden" name="metaId" value="' . $id . '" />';
echo '</div>';
spa_paint_close_fieldset();
spa_paint_close_panel();
spa_paint_close_container();
?>
<div class="sfform-submit-bar">
<input type="submit" class="button-primary" id="saveit" name="saveit" value="<?php
spa_etext('Update CSS');
?>
" />
</div>
<?php
spa_paint_close_tab();
echo '</form>';
}