Пример #1
0
 /**
  * The UI to view a past newsletter.
  *
  * @return tempcode		The UI
  */
 function view()
 {
     $id = get_param_integer('id');
     $rows = $GLOBALS['SITE_DB']->query_select('newsletter_archive', array('*'), array('id' => $id));
     $time = get_timezoned_date($rows[0]['date_and_time']);
     $subject = $rows[0]['subject'];
     $message = $rows[0]['newsletter'];
     $language = $rows[0]['language'];
     $level = $rows[0]['importance_level'];
     /*require_code('lang2');
     		$language=lookup_language_full_name($rows[0]['language']);*/
     breadcrumb_set_parents(array(array('_SELF:_SELF:misc', do_lang_tempcode('MANAGE_NEWSLETTER')), array('_SELF:_SELF:archive', do_lang_tempcode('NEWSLETTER_ARCHIVE'))));
     breadcrumb_set_self($subject);
     require_code('templates_view_space');
     return view_space(get_page_title('NEWSLETTER'), array('DATE_TIME' => $time, 'LANGUAGE' => $language, 'SUBSCRIPTION_LEVEL' => integer_format($level), 'SUBJECT' => $subject, 'MESSAGE' => comcode_to_tempcode($message)));
 }
Пример #2
0
 /**
  * The UI to view details of a gift.
  *
  * @return tempcode		The UI
  */
 function view()
 {
     $id = NULL;
     $name = '';
     $image = '';
     $price = 0;
     $category = '';
     $enabled = do_lang_tempcode('GIFT_DISABLED');
     $id = get_param_integer('id', NULL);
     if ($id !== NULL) {
         $rows = $GLOBALS['SITE_DB']->query_select('ocgifts', array('*'), array('id' => $id));
         if (isset($rows[0]['id']) && $rows[0]['id'] > 0) {
             $id = $rows[0]['id'];
             $name = $rows[0]['name'];
             $image = $rows[0]['image'];
             $price = $rows[0]['price'];
             $category = $rows[0]['category'];
             $enabled = $rows[0]['enabled'] == 1 ? do_lang_tempcode('GIFT_ENABLED') : do_lang_tempcode('GIFT_DISABLED');
         }
     }
     breadcrumb_set_parents(array(array('_SELF:_SELF:misc', do_lang_tempcode('OCGIFTS_TITLE'))));
     breadcrumb_set_self(do_lang_tempcode('VIEW_GIFT'));
     require_code('templates_view_space');
     return view_space(get_page_title('VIEW_GIFT'), array('NAME' => $name, 'IMAGE' => $image, 'PRICE' => integer_format($price), 'CATEGORY' => $category, 'ENABLED' => $enabled));
 }
Пример #3
0
 function view()
 {
     $id = NULL;
     $name = '';
     $image = '';
     $cure = '';
     $cure_price = 0;
     $immunization = '';
     $immunization_price = 0;
     $spread_rate = 0;
     $points_per_spread = 10;
     $enabled = do_lang_tempcode('DISEASE_DISABLED');
     $id = get_param_integer('id', 0);
     if ($id > 0) {
         $rows = $GLOBALS['SITE_DB']->query_select('diseases', array('*'), array('id' => $id));
         if (isset($rows[0]['id']) && $rows[0]['id'] > 0) {
             $id = $rows[0]['id'];
             $name = $rows[0]['name'];
             $image = $rows[0]['image'];
             $cure = $rows[0]['cure'];
             $cure_price = $rows[0]['cure_price'];
             $immunization = $rows[0]['immunisation'];
             $immunization_price = $rows[0]['immunisation_price'];
             $spread_rate = $rows[0]['spread_rate'];
             $points_per_spread = $rows[0]['points_per_spread'];
             $enabled = $rows[0]['enabled'] == 1 ? do_lang_tempcode('DISEASE_ENABLED') : do_lang_tempcode('DISEASE_DISABLED');
         }
     }
     breadcrumb_set_parents(array(array('_SELF:_SELF:misc', do_lang_tempcode('OCDEADPEOPLE_TITLE'))));
     breadcrumb_set_self(do_lang_tempcode('VIEW_DISEASE'));
     require_code('templates_view_space');
     return view_space(get_page_title('VIEW_DISEASE'), array('NAME' => $name, 'IMAGE' => $image, 'CURE' => $cure, 'CURE_PRICE' => integer_format($cure_price), 'IMMUNIZATION' => $immunization, 'IMMUNIZATION_PRICE' => integer_format($immunization_price), 'SPREAD_RATE' => integer_format($spread_rate), 'POINTS_PER_SPREAD' => integer_format($points_per_spread), 'ENABLED' => $enabled));
 }
Пример #4
0
 /**
  * The UI to view details of a specific moderation action.
  *
  * @return tempcode		The UI
  */
 function view_action()
 {
     breadcrumb_set_self(do_lang_tempcode('ENTRY'));
     breadcrumb_set_parents(array(array('_SELF:_SELF:misc', do_lang_tempcode('VIEW_ACTION_LOGS')), array('_SELF:_SELF:list', do_lang_tempcode('RESULTS'))));
     $mode = get_param('mode', 'ocf');
     $id = get_param_integer('id');
     if ($mode == 'ocf') {
         $rows = $GLOBALS['FORUM_DB']->query_select('f_moderator_logs', array('l_reason AS reason', 'id', 'l_by AS the_user', 'l_date_and_time AS date_and_time', 'l_the_type AS the_type', 'l_param_a AS param_a', 'l_param_b AS param_b'), array('id' => $id), '', 1);
     } else {
         $rows = $GLOBALS['SITE_DB']->query_select('adminlogs', array('id', 'the_user', 'date_and_time', 'the_type', 'param_a', 'param_b', 'ip'), array('id' => $id), '', 1);
     }
     if (!array_key_exists(0, $rows)) {
         warn_exit(do_lang_tempcode('MISSING_RESOURCE'));
     }
     $row = $rows[0];
     $title = get_page_title('VIEW_ACTION_LOGS');
     $username = $GLOBALS['FORUM_DRIVER']->get_username($row['the_user']);
     if (is_null($username)) {
         $username = do_lang('UNKNOWN');
     }
     $type_str = do_lang($row['the_type'], $row['param_a'], $row['param_b'], NULL, NULL, false);
     if (is_null($type_str)) {
         $type_str = $row['the_type'];
     }
     $fields = array('USERNAME' => $GLOBALS['FORUM_DRIVER']->member_profile_hyperlink($row['the_user']), 'DATE_TIME' => get_timezoned_date($row['date_and_time']), 'TYPE' => $type_str, 'PARAMETER_A' => is_null($row['param_a']) ? '' : $row['param_a'], 'PARAMETER_B' => is_null($row['param_b']) ? '' : $row['param_b']);
     if (array_key_exists('ip', $row)) {
         $fields['IP_ADDRESS'] = escape_html($row['ip']);
     }
     if (array_key_exists('reason', $row)) {
         $fields['REASON'] = escape_html($row['reason']);
     }
     if (addon_installed('securitylogging')) {
         if (array_key_exists('ip', $row)) {
             $banned_test_1 = $GLOBALS['SITE_DB']->query_value_null_ok('usersubmitban_ip', 'ip', array('ip' => $row['ip']));
             $fields['IP_BANNED'] = is_null($banned_test_1) ? do_lang_tempcode('NO') : do_lang_tempcode('YES');
             if ($row['ip'] != get_ip_address()) {
                 $fields['IP_BANNED']->attach(do_template('ACTION_LOGS_TOGGLE_LINK', array('URL' => build_url(array('page' => '_SELF', 'type' => 'toggle_ip_ban', 'id' => $row['ip']), '_SELF'))));
             }
         }
         $banned_test_2 = $GLOBALS['SITE_DB']->query_value_null_ok('usersubmitban_member', 'the_member', array('the_member' => $row['the_user']));
         $fields['SUBMITTER_BANNED'] = is_null($banned_test_2) ? do_lang_tempcode('NO') : do_lang_tempcode('YES');
         if (!is_guest($row['the_user']) && $row['the_user'] != get_member()) {
             $fields['SUBMITTER_BANNED']->attach(do_template('ACTION_LOGS_TOGGLE_LINK', array('URL' => build_url(array('page' => '_SELF', 'type' => 'toggle_submitter_ban', 'id' => $row['the_user'], 'mode' => $mode, 'action_id' => $id), '_SELF'))));
         }
         $banned_test_3 = $GLOBALS['FORUM_DRIVER']->is_banned($row['the_user']);
         $fields['MEMBER_BANNED'] = $banned_test_3 ? do_lang_tempcode('YES') : do_lang_tempcode('NO');
         if (get_forum_type() == 'ocf' && !is_guest($row['the_user']) && $row['the_user'] != get_member()) {
             $fields['MEMBER_BANNED']->attach(do_template('ACTION_LOGS_TOGGLE_LINK', array('URL' => build_url(array('page' => '_SELF', 'type' => 'toggle_member_ban', 'id' => $row['the_user'], 'mode' => $mode, 'action_id' => $id), '_SELF'))));
         }
     }
     $fields['INVESTIGATE_USER'] = hyperlink(build_url(array('page' => 'admin_lookup', 'id' => array_key_exists('ip', $row) ? $row['ip'] : $row['the_user']), '_SELF'), do_lang_tempcode('PROCEED'));
     require_code('templates_view_space');
     return view_space($title, $fields);
 }