Beispiel #1
0
    public static function theme_custom_point_backend()
    {
        ?>
		<h3><?php 
        echo ___('Recalculate');
        ?>
</h3>
		<table class="form-table">
			<tbody>
				<tr>
					<th><?php 
        echo ___('Recalculate all posts point');
        ?>
</th>
					<td>
						<?php 
        if (isset($_GET[__CLASS__])) {
            echo status_tip('success', ___('Operation completed.'));
        }
        ?>
						<a href="<?php 
        echo theme_features::get_process_url(['action' => 'backend_' . __CLASS__, 'type' => 'recalculate', 'theme-nonce' => theme_features::create_nonce()]);
        ?>
" class="button">
							<i class="fa fa-refresh"></i> 
							<?php 
        echo ___('Recalculate now');
        ?>
						</a>
						<span class="description">
							<i class="fa fa-exclamation-circle"></i> 
							<?php 
        echo ___('Please save your settings before operate. This operation requires a lot of server resources.');
        ?>
						</span>
					</td>
				</tr>
			</tbody>
		</table>
		<?php 
    }
Beispiel #2
0
 public static function process()
 {
     $output = [];
     /**
      * nonce
      */
     $nonce = theme_features::create_nonce();
     /**
      * sign-type
      */
     $sign_type = isset($_REQUEST['sign-type']) ? $_REQUEST['sign-type'] : null;
     $opt = self::get_options();
     switch ($sign_type) {
         /**
          * sina
          */
         case 'weibo':
         case 'sina':
             $url = urlencode(theme_features::get_process_url(array('action' => 'isos_cb', 'sina' => 'set-auth', 'uri' => isset($_SERVER["HTTP_REFERER"]) && strpos($_SERVER['HTTP_REFERER'], theme_cache::home_url()) === 0 ? $_SERVER["HTTP_REFERER"] : home_url(), 'nonce' => $nonce)));
             $url = add_query_arg(array('sina' => 'get-auth', 'akey' => base64_encode(authcode(self::get_sina_config('akey'), 'encode')), 'skey' => base64_encode(authcode(self::get_sina_config('skey'), 'encode')), 'uri' => $url, 'state' => $nonce), self::$open_url);
             header('Location: ' . $url);
             die(___('Redirecting, please wait...'));
             /**
              * qq
              */
         /**
          * qq
          */
         case 'qq':
             include __DIR__ . '/inc/qq/qqConnectAPI.php';
             $qc = new theme_open_sign\inc\qq\QC(self::get_qc_config());
             //var_dump($qc);exit;
             /** go to login page */
             $qc->qq_login();
             die(___('Redirecting, please wait...'));
         default:
     }
     die(theme_features::json_format($output));
 }