当前位置: 首页>>代码示例>>PHP>>正文


PHP SendPress_Data::nonce方法代码示例

本文整理汇总了PHP中SendPress_Data::nonce方法的典型用法代码示例。如果您正苦于以下问题:PHP SendPress_Data::nonce方法的具体用法?PHP SendPress_Data::nonce怎么用?PHP SendPress_Data::nonce使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SendPress_Data的用法示例。


在下文中一共展示了SendPress_Data::nonce方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: html


//.........这里部分代码省略.........
            echo "checked='checked'";
        }
        ?>
 /> Show Default SendPress Page<br><br>
			<input type="radio" name="post-page" value="custom"  <?php 
        if ($ctype == 'custom') {
            echo "checked='checked'";
        }
        ?>
/> Redirect to <select name="post-page-id"> 
 <option value="">
 	<?php 
        $cpageid = get_post_meta($list_id, 'post-page-id', true);
        echo esc_attr(__('Select page'));
        ?>
</option> 
 <?php 
        $pages = get_pages();
        foreach ($pages as $page) {
            $s = '';
            if ($cpageid == $page->ID) {
                $s = "selected";
            }
            $option = '<option value="' . $page->ID . '" ' . $s . '>';
            $option .= $page->post_title;
            $option .= '</option>';
            echo $option;
        }
        ?>
</select><br><br>
<input type="radio" name="post-page" value="json" <?php 
        if ($ctype == 'json') {
            echo "checked='checked'";
        }
        ?>
 /> Return Json Data ie: { success: true/false, list: listid , name: listname, optin: true/false }<br><br>
<?php 
        $link = get_post_meta($list_id, 'post-redirect', true);
        ?>
<input type="radio" name="post-page" value="redirect" <?php 
        if ($ctype == 'redirect') {
            echo "checked='checked'";
        }
        ?>
 /> Redirect to url entered below. <br><br><input type="text" name="post-redirect" class="sp-text" value="<?php 
        echo $link;
        ?>
"><br><br>
	</div>
</div>
</div>
</div>
	<br class="clear">
</div>	
<br class="clear">
<div class="panel panel-default">
  <div class="panel-heading">
    <h3 class="panel-title">iFrame</h3>
  </div>
  <div class="panel-body">
<div class="boxer form-box">
	
	<div style="float: right; width: 45%;"><br>
		<b>HTML</b><br>
		<textarea style="width:100%; padding: 8px;" rows="21" name="post-page-text"><iframe  width="100%" scrolling="no" frameborder="0"  src="<?php 
        echo site_url();
        ?>
?sendpress=form&list=<?php 
        echo $_GET['listID'];
        ?>
" vspace="0" tabindex="0" style="position: static; top: 0pt; margin: 0px; border-style: none; height: 130px; left: 0pt; visibility: visible;" marginwidth="0" marginheight="0" hspace="0" allowtransparency="true" title="Subscription SendPress" ></iframe></textarea>
	</div>	
<div style="width: 45%; margin-right: 10%"><br>
	<!--
	<iframe width="100%" scrolling="no" frameborder="0" src="http://joshlmbprd.whipplehill.com/wp/?wysija-page=1&controller=subscribers&action=wysija_outter&widgetnumber=4&external_site=1&wysijap=subscriptions" name="wysija-1358371025" class="iframe-wysija" id="wysija-4" vspace="0" tabindex="0" style="position: static; top: 0pt; margin: 0px; border-style: none; height: 330px; left: 0pt; visibility: visible;" marginwidth="0" marginheight="0" hspace="0" allowtransparency="true" title="Subscription Wysija"></iframe>
	-->
	<iframe  width="100%" scrolling="no" frameborder="0" src="<?php 
        echo site_url();
        ?>
?sendpress=form&amp;list=<?php 
        echo $_GET['listID'];
        ?>
" vspace="0" tabindex="0" style="position: static; top: 0pt; margin: 0px; border-style: none; height: 130px; left: 0pt; visibility: visible;" marginwidth="0" marginheight="0" hspace="0" allowtransparency="true" title="Subscription SendPress" ></iframe>
</div>
	<br class="clear">
</div>
</div>
</div>


	



		<?php 
        wp_nonce_field(SendPress_Data::nonce());
        ?>
	</form>
	<?php 
    }
开发者ID:radscheit,项目名称:unicorn,代码行数:101,代码来源:class-sendpress-view-subscribers-listform.php

示例2: nonce_field

 static function nonce_field()
 {
     wp_nonce_field(SendPress_Data::nonce());
 }
开发者ID:pedro-mendonca,项目名称:sendpress,代码行数:4,代码来源:class-sendpress-data.php

示例3: load_page

    static function load_page($attr, $content = null)
    {
        $action = get_query_var('spmanage');
        //Look for encrypted data
        $info = SendPress_Data::decrypt($action);
        //print_r( $info );
        ?>

<form action="" method="post">
<?php 
        wp_nonce_field(SendPress_Data::nonce());
        ?>
<input type="hidden" name="subscriberid" id="subscriberid" value="<?php 
        echo $info->id;
        ?>
" />
<input type="hidden" name="action" id="action" value="sendpress-manage-shortcode" />
<table cellpadding="0" cellspacing="0" class="table table-condensed table-striped table-bordered">
	<tr>
		<th  ><?php 
        _e('Subscribed', 'sendpress');
        ?>
</th>
		<th  ><?php 
        _e('Unsubscribed', 'sendpress');
        ?>
</th>
		<th  ><?php 
        _e('List', 'sendpress');
        ?>
</th>
		<th class="hidden-phone"><?php 
        _e('Updated', 'sendpress');
        ?>
</th>
		<th class="hidden-phone"><?php 
        _e('Other Info', 'sendpress');
        ?>
</th>
	</tr>
<?php 
        $lists = SendPress_Data::get_lists(apply_filters('sendpress_modify_manage_lists', array('meta_query' => array(array('key' => 'public', 'value' => true)))), false);
        foreach ($lists as $list) {
            $subscriber = SendPress_Data::get_subscriber_list_status($list->ID, $info->id);
            ?>
  	<tr>
  	<?php 
            $checked = isset($subscriber->statusid) && $subscriber->statusid == 2 ? 'checked' : '';
            echo '<td><input type="radio" class="xbutton" data-list="' . $list->ID . '" name="subscribe_' . $list->ID . '" ' . $checked . ' value="2"></td>';
            $checked = isset($subscriber->statusid) && $subscriber->statusid == 3 ? 'checked' : '';
            echo '<td><input type="radio" class="xbutton" data-list="' . $list->ID . '" name="subscribe_' . $list->ID . '" ' . $checked . ' value="3"></td>';
            ?>
  	<td><?php 
            echo $list->post_title;
            ?>
</td>
  	<td class="hidden-phone"><span id="list_<?php 
            echo $list->ID;
            ?>
"><?php 
            if (isset($subscriber->updated)) {
                echo $subscriber->updated;
            } else {
                _e('Never Subscribed', 'sendpress');
            }
            ?>
</span>
	</td>
	<td class="hidden-phone">
		<?php 
            if (is_object($subscriber)) {
                if ($subscriber->statusid != 3 && $subscriber->statusid != 2) {
                    echo $subscriber->status;
                }
            }
            ?>
	</td>
  	<tr>	
    <?php 
        }
        ?>

</table>
<br>
<?php 
        do_action('sendpress_manage_notifications', $info);
        ?>
<input type="submit" class="btn btn-primary" value="<?php 
        _e('Save My Settings', 'sendpress');
        ?>
"/>
</form><?php 
    }
开发者ID:richardsweeney,项目名称:sendpress,代码行数:93,代码来源:class-sendpress-shortcode-manage.php

示例4: manage_subscription

    private static function manage_subscription($options)
    {
        //debug
        // $link_data = array(
        // 	"id"=>23,
        // 	"report"=>0,
        // 	"urlID"=> '0',
        // 	"view"=>"manage",
        // 	"listID"=>"0",
        // 	"action"=>""
        // );
        // $code = SendPress_Data::encrypt( $link_data );
        // $link =  SendPress_Manager::public_url($code);
        // print_r($link);
        $_nonce_value = 'sendpress-is-awesome';
        $info = self::data();
        //SendPress_Error::log($info->id);
        //print_r($info);
        if (!isset($info->id)) {
            $info = new stdClass();
            $info->id = '';
        }
        $s = $info->id;
        //SendPress_Error::log($s);
        extract($options);
        if (is_numeric($s)) {
            $sub = SendPress_Data::get_subscriber($s);
            if ($sub == false) {
                $sub = new stdClass();
                $sub->email = 'example@sendpress.com';
                $sub->join_date = date("F j, Y, g:i a");
            }
            // print_r($sub);
            ?>
			<link rel="stylesheet" type="text/css" href="<?php 
            echo SENDPRESS_URL;
            ?>
/css/manage-front-end.css">
			<div class="sendpress-content">
				<h4>Manage Subscriptions</h4>
				<div class="subscriber-info">
					<b><?php 
            _e('Email', 'sendpress');
            ?>
</b>
					<?php 
            echo $sub->email;
            ?>
<br>
					<b><?php 
            _e('Signup Date', 'sendpress');
            ?>
</b>
					<?php 
            echo $sub->join_date;
            ?>
				</div>
				<?php 
            if (self::handle_unsubscribes()) {
                ?>
					<div class="alert alert-block alert-info">
		 				<h4 class="alert-heading"><?php 
                _e('Saved', 'sendpress');
                ?>
!</h4>
		 				<?php 
                _e('Your subscriptions have been updated. Thanks.', 'sendpress');
                ?>
					</div>
					<?php 
            }
            ?>
				
				<p><?php 
            _e('You are subscribed to the following lists:', 'sendpress');
            ?>
</p>
				<?php 
            $info->action = "update";
            $key = SendPress_Data::encrypt($info);
            $query_var = '';
            if (get_query_var('spms')) {
                $query_var = "?spms=" . $key;
            } elseif (get_query_var('sendpress')) {
                $query_var = "?sendpress=" . $key;
            }
            ?>
				<form action="<?php 
            echo $query_var;
            ?>
" method="post">
				<?php 
            wp_nonce_field(SendPress_Data::nonce());
            ?>
				<input type="hidden" name="subscriberid" id="subscriberid" value="<?php 
            echo $s;
            ?>
" />

				<table cellpadding="0" cellspacing="0" class="table table-condensed table-striped table-bordered">
//.........这里部分代码省略.........
开发者ID:richardsweeney,项目名称:sendpress,代码行数:101,代码来源:class-sendpress-sc-forms.php

示例5: test_nonce

 function test_nonce()
 {
     $this->assertEquals('sendpress-is-awesome', SendPress_Data::nonce());
 }
开发者ID:richardsweeney,项目名称:sendpress,代码行数:4,代码来源:test_sendpress_data.php


注:本文中的SendPress_Data::nonce方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。