function edit_points_info_settings_page()
{
    $semantic = WP_PLUGIN_URL . '/panomanager/css/semantic.css';
    ?>
<link rel="stylesheet" type="text/css" href="<?php 
    echo $semantic;
    ?>
"/>
  <h2>Edit the name of your points!</h2>
  <hr>
  <style type="text/css">
  	#wpfooter{
  		display: none;
  	}

  	#file_input {
  	    border: 1px solid #cccccc;
  	    padding: 5px;
  	}

  	.new_pano_form{
  		width:85%;
  		margin: 0px auto;
  	}
  </style>
  <?php 
    if (isset($_GET['settings-saved'])) {
        ?>
      <div class="updated"><p>Points info updated successfully.</p></div>
  <?php 
    } elseif (isset($_GET['error'])) {
        ?>
      <div class="error"><p>Error updating points info.</p></div>
  <?php 
    }
    ?>
  <p>
    'Points' is a dull word. You can change it to be whatever you want! What about earning dollars?
  </p>
  <p>
    You can assign a currency symbol, a name to be displayed in the singular and plural forms, for example:
  </p>
  <ul>
    <li>
      Symbol: $
    </li>
    <li>
      Name (singular): dollar
    </li>
    <li>
      Name (plural): dollars
    </li>
  </ul>
  <p>
    You can also add web entity symbols, such as &yen; - to see a list of symbol codes, visit <a href="http://www.fileformat.info/format/w3c/entitytest.htm" target="_blank">this website</a>.
  </p>
  <form method="post" enctype="multipart/form-data" action="<?php 
    echo get_admin_url() . 'admin-post.php';
    ?>
">
    <input type="hidden" name="action" value="update_points_info" />
    <div class="ui form">
      <div class="field">
        <div class="ui left labeled icon input">
          <label for="symbol">Symbol: </label>
          <input name="symbol" id="symbol" placeholder="Edit the symbol of your currency (optional)" value="<?php 
    echo get_points_symbol();
    ?>
" />
        </div>
      </div>
      <div class="field">
        <div class="ui left labeled icon input">
          <label for="singular">Name (singular): </label>
          <input name="singular" id="singular" placeholder="Edit the singular name of your currency" value="<?php 
    echo get_points_name_singular();
    ?>
" />
        </div>
      </div>
      <div class="field">
        <div class="ui left labeled icon input">
          <label for="plural">Name (plural): </label>
          <input name="plural" id="plural" placeholder="Edit the plural name of your currency" value="<?php 
    echo get_points_name_plural();
    ?>
" />
        </div>
      </div>
    </div>
    <?php 
    submit_button();
    ?>
  </form>
<?php 
}
function build_leaderboard_div()
{
    $board = '<div id="leaderboard" class="white-popup">';
    $board .= '<table>';
    $board .= '  <thead>';
    $board .= '    <tr>';
    $board .= '      <th colspan="3" class="table-title">Leaderboard</th>';
    $board .= '    </tr>';
    $board .= '    <tr>';
    $board .= '      <th>#</th>';
    $board .= '      <th>Name</th>';
    $board .= '      <th>Total ' . get_points_name_plural() . '</th>';
    $board .= '    </tr>';
    $board .= '  </thead>';
    $board .= '  <tbody>';
    $users = get_all_users();
    $names = array();
    $scores = array();
    foreach ($users as $user) {
        $total_points = 0;
        $total_points += get_regular_points_for_mission_tab($user->id);
        $total_points += get_bonus_points_for_mission_tab($user->id);
        $user_name = get_user_name($user->id);
        array_push($names, $user_name);
        array_push($scores, $total_points);
    }
    array_multisort($scores, SORT_DESC, $names);
    $pos = 1;
    for ($i = 0; $i < count($scores); $i++) {
        if ($scores[$i] > 0 && $pos < 11) {
            $board .= '    <tr>';
            $board .= '      <td>' . $pos . '</td>';
            $board .= '      <td>' . $names[$i] . '</td>';
            $board .= '      <td>' . $scores[$i] . '</td>';
            $board .= '    </tr>';
            $pos++;
        }
    }
    $board .= '  </tbody>';
    $board .= '</table>';
    $board .= '</div>';
    return $board;
}
function get_points_name_plural_post()
{
    $points_name_plural = '';
    $points_name_plural = get_points_name_plural();
    echo $points_name_plural;
    die;
}
Пример #4
0
<?php

require 'db.php';
$ordered = false;
if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['item'])) {
    $ordered = true;
    $purchased = process_purchase($_POST['item']);
}
if (isset($_GET['id'])) {
    $item = get_item($_GET['id']);
    $symbol = get_points_symbol();
    $plural = get_points_name_plural();
    $path = '../../../';
}
?>
<!DOCTYPE HTML>
<html lang="en">
	<head>
		<title>Shop</title>
		<meta charset="UTF-8">
		<link rel="stylesheet" type="text/css" href="./shop.css" />
	</head>
	<body>
		<?php 
if ($ordered) {
    ?>

            <div id="content">
                <?php 
    if ($purchased === true) {
        ?>