Ejemplo n.º 1
0
 public function StatusEx(&$level, &$maxlevel)
 {
     $status = CPoker::GetStatus();
     $chips = $this->Chips();
     $level = $maxlevel = count(array_keys($status));
     foreach ($status as $value => $name) {
         if (bccomp($chips, $value) >= 0) {
             return $name;
         }
         $level--;
     }
     return $status[0];
 }
Ejemplo n.º 2
0
function os_poker_buddy_search_form($form_state)
{
    // Access log settings:
    $form['online_only'] = array('#type' => 'checkbox', '#title' => t('Search Online player only!'), '#default_value' => variable_get('online_only', 0));
    $form['profile_nickname'] = array('#type' => 'textfield', '#title' => t('Nickname'), '#size' => 30, '#maxlength' => 64);
    $form['mail'] = array('#type' => 'textfield', '#title' => t('E-mail'), '#size' => 30, '#maxlength' => 64);
    $sex_options = array(NULL => "--", "Male" => t("Male"), "Female" => t("Female"));
    $form['profile_gender'] = array('#type' => 'select', '#title' => t('Gender'), '#options' => $sex_options);
    $level_options = CPoker::GetStatus();
    $level_options[-1] = '--';
    $form['level'] = array('#type' => 'select', '#title' => t('Level'), '#options' => $level_options, '#default_value' => -1);
    $form['profile_city'] = array('#type' => 'textfield', '#title' => t('City'), '#size' => 30, '#maxlength' => 64);
    $form['profile_country'] = array('#type' => 'select', '#title' => t('Country'), '#multiple' => false, '#options' => _os_poker_country_options());
    $form['submit'] = array('#type' => 'submit', '#value' => t('Send'), '#attributes' => array("style" => "display:none;"));
    $form['f_submit'] = array('#type' => 'markup', '#value' => '<div class="clear"></div><div onclick="javascript:os_poker_submit(this, \'os-poker-buddy-search-form\');" ' . " class='poker_submit'" . " ><div class='pre'>&nbsp;</div><div class='label'>" . t("Search") . "</div></div>");
    return $form;
}