function update_blog() { if ($_FILES['image']['name']) { $image = $this->load_image_name($this->input->post('id')); unlink('upload/images/' . $image); $config['upload_path'] = get_config_value('upload_blog_path'); $config['allowed_types'] = 'gif|jpg|jpeg|png'; $config['max_size'] = get_config_value('max_size'); $config['encrypt_name'] = TRUE; // rename to random string $this->load->library('upload', $config); if ($this->upload->do_upload('image')) { $datax = $this->upload->data(); $this->db->set('image', $datax['file_name']); } else { print_r($this->upload->display_errors()); exit; } } $this->db->set('title', $this->input->post('title')); $this->db->set('alias', seo_url($this->input->post('title'))); $this->db->set('content', $this->input->post('content')); $this->db->where('id', $this->input->post('id')); $result = $this->db->update('blog'); return $result; }
function add_article($data) { $config['upload_path'] = get_config_value('upload_news_path'); $config['allowed_types'] = 'gif|jpg|jpeg|png'; $config['max_size'] = get_config_value('max_size'); $config['encrypt_name'] = TRUE; // rename to random string if ($_FILES['image']['name']) { $this->load->library('upload', $config); if ($this->upload->do_upload('image')) { $datax = $this->upload->data(); } else { print_r($this->upload->display_errors()); exit; } } else { $datax['file_name'] = NULL; } $this->db->set('title', $data['title']); $this->db->set('alias', seo_url($data['title'])); $this->db->set('category_id', $data['category_id']); $this->db->set('image', $datax['file_name']); $this->db->set('short_content', $data['short_content']); $this->db->set('full_content', $data['full_content']); $this->db->set('time', time()); $this->db->set('publish', 1); $result = $this->db->insert('article'); return $result; }
function save_edit() { if ($_FILES['image']['name']) { $image = $this->article_model->load_image_name($this->input->post('id')); unlink('upload/images/' . $image); $config['upload_path'] = get_config_value('upload_news_path'); $config['allowed_types'] = 'gif|jpg|jpeg|png'; $config['max_size'] = get_config_value('max_size'); $config['encrypt_name'] = TRUE; // rename to random string $this->load->library('upload', $config); if ($this->upload->do_upload('image')) { $datax = $this->upload->data(); $data['image'] = $datax['file_name']; } else { print_r($this->upload->display_errors()); exit; } } $data['title'] = $this->input->post('title'); $data['alias'] = seo_url($this->input->post('title')); $data['category_id'] = $this->input->post('category_id'); $data['short_content'] = html_entity_decode($this->input->post('short_content'), ENT_QUOTES, "UTF-8"); $data['full_content'] = html_entity_decode($this->input->post('full_content'), ENT_QUOTES, "UTF-8"); $isOK = $this->article_model->update_article($this->input->post('id'), $data); if ($isOK) { $this->session->set_flashdata('message', 'Information is saved'); redirect('/article'); } else { $this->session->set_flashdata('message', 'Can\'t save information'); redirect('/article'); } }
function update_b2b($data) { if ($_FILES['image']['name']) { $image = $this->load_image_name($this->input->post('id')); unlink('upload/b2b/' . $image); $config['upload_path'] = get_config_value('upload_b2b_path'); $config['allowed_types'] = 'gif|jpg|jpeg|png'; $config['max_size'] = get_config_value('max_size'); $config['encrypt_name'] = TRUE; // rename to random string $this->load->library('upload', $config); if ($this->upload->do_upload('image')) { $datax = $this->upload->data(); $this->db->set('image', $datax['file_name']); } else { print_r($this->upload->display_errors()); exit; } } if ($data['new_pass']) { $this->db->set('password', md5($data['new_pass'])); } $this->db->set('name', $data['name']); $this->db->set('web', $data['web']); $this->db->set('company', $data['company']); $this->db->where('id', $data['id']); $result = $this->db->update('b2b_user'); return $result; }
/** * Return a geocoder singleton * * @param $config KConfig object * * @return ComLocationsGeocoderAdapterAbstract child singleton */ public function getInstance(KConfig $config) { if ($this->_geocoder) { return $this->_geocoder; } $service = ucfirst(get_config_value('locations.service', 'google')); $class_name = 'ComLocationsGeocoderAdapter' . $service; $this->_geocoder = new $class_name($config); return $this->_geocoder; }
function site_get_symbol($key) { if (!($symbols = get_config_value('symbols', 'site'))) { return ''; } if (empty($symbols[$key])) { return ''; } return $symbols[$key]; }
function smarty_function_get_config_value($params, &$smarty) { if (empty($params['key'])) { return ''; } $key = $params['key']; if (!empty($params['index'])) { $index = $params['index']; } return get_config_value($key, $index); }
/** * renders a map * * @param array of ComLocationsDomainEntityLocation entities * @param array of configuration params: longitude, latitude, name, url * * @return string html */ public function map($locations, $config = array()) { if ($locations instanceof ComLocationsDomainEntityLocation) { $locations = array($locations); } $data = array(); foreach ($locations as $location) { $data[] = array('longitude' => $location->longitude, 'latitude' => $location->latitude, 'name' => $location->name, 'url' => JRoute::_($location->getURL())); } $config['locations'] = htmlspecialchars(json_encode($data), ENT_QUOTES, 'UTF-8'); $config['service'] = get_config_value('locations.service', 'google'); return $this->_render('map_' . $config['service'], $config); }
/** * Authorize whether we can add a new actor or not. * * @param KCommandContext $context * * @return bool */ protected function _authorizeAdd(KCommandContext $context) { $can_publish = get_config_value($this->_entity->component, 'can_publish', self::CAN_ADD_ADMIN); switch ($can_publish) { case self::CAN_ADD_ADMIN: return $this->_viewer->admin(); case self::CAN_ADD_SPECIAL: return $this->_viewer->userType != 'Registered' && !$this->_viewer->guest(); case self::CAN_ADD_ALL: return !$this->_viewer->guest(); default: return false; } }
function ok_to_impersonate($euid, $uid) { global $dbh; // It's harmless to impersonate yourself ;) if ($euid == $uid && $euid > 0 && $uid > 0) { return true; } else { // Domain default users can be impersonated by admins // responsible for those domains, and the superadmin. // Only the superadmin can impersonate the system default // user (@.). if (is_a_domain_default_user($euid) || get_config_value("enable_privacy_invasion") == "Y") { if (is_superadmin($uid)) { return true; } else { if (is_a_domain_default_user($euid)) { $domain_id = get_domain_id(get_user_name($euid)); return is_admin_for_domain($uid, $domain_id); } else { if (!is_superadmin($euid)) { $sth = $dbh->prepare("SELECT email FROM users WHERE maia_user_id = ?"); $res = $sth->execute(array($euid)); if (PEAR::isError($sth)) { die($sth->getMessage()); } while ($row = $res->fetchRow()) { $domain_id = get_domain_id("@" . get_domain_from_email($row["email"])); if (is_admin_for_domain($uid, $domain_id)) { $sth->free(); return true; } } $sth->free(); return false; } else { return false; } } } // Impersonating other users is an invasion of privacy, // even for administrators, unless explicitly overridden above. } else { return false; } } }
function save_add() { $data['email'] = $this->input->post('email'); $data['name'] = $this->input->post('name'); $data['web'] = $this->input->post('web'); $data['company'] = $this->input->post('company'); $pass = $this->input->post('pass'); $isOK = $this->b2b_user_model->check_b2b($data['email']); if ($isOK) { $this->session->set_flashdata('message', 'This email is used, please input other email'); redirect(base_url() . index_page() . 'b2b_user/add'); } $data['password'] = md5($pass); $data['time'] = time(); $data['publish'] = 1; if ($_FILES['image']['name']) { $config['upload_path'] = get_config_value('upload_b2b_path'); $config['allowed_types'] = 'gif|jpg|jpeg|png'; $config['max_size'] = get_config_value('max_size'); $config['encrypt_name'] = TRUE; // rename to random string $this->load->library('upload', $config); if ($this->upload->do_upload('image')) { $datax = $this->upload->data(); $data['image'] = $datax['file_name']; } else { $data['image'] = ""; } } $isOK = $this->b2b_user_model->add_b2b($data); if ($isOK) { //Send mail to user B2B $data['link'] = base_url() . index_page(); $data['pass'] = $pass; $data['login'] = base_url() . index_page() . 'user/login.html'; $data['site'] = base_url() . index_page() . 'index.html'; $emailTo = array($data['email']); $mailOK = $this->b2b_user_model->sendEmail($emailTo, "Sugardating.dk - Detaljer for ny bruger", 'signupb2b', array('data' => $data), ''); $this->session->set_flashdata('message', 'A B2B account is added'); redirect(base_url() . index_page() . 'b2b_user'); } else { $this->session->set_flashdata('message', 'Can\'t add account'); redirect(base_url() . index_page() . 'b2b_user'); } }
/** * @return string */ public function fetch_class() { if ($this->class != null) { return $this->class; } // Get default class if not provided if (count($this->uri->segments) == 0) { if (trim(get_config_value('main', 'default_controller')) == '') { error("Default controller is not defined."); } return strtolower(get_config_value('main', 'default_controller')); } // Do routing $class = strtolower($this->uri->segments[0]); $route = get_config_value('routes', $class); if ($route !== NULL) { array_shift($this->uri->segments); $routeSegments = explode("/", $route); array_unshift($this->uri->segments, $routeSegments[0], $routeSegments[1]); } $this->class = strtolower($this->uri->segments[0]); return $this->class; }
function add_image($user_id) { $config['upload_path'] = get_config_value('upload_gallery_path'); $config['allowed_types'] = 'gif|jpg|jpeg|png'; $config['max_size'] = get_config_value('max_size'); $config['encrypt_name'] = TRUE; // rename to random string $this->load->library('upload', $config); if ($_FILES['upl']['name']) { if ($this->upload->do_upload('upl')) { $datax = $this->upload->data(); } else { die($this->upload->display_errors()); } } else { $datax['file_name'] = NULL; } $this->db->set('user_id', $user_id); $this->db->set('image', $datax['file_name']); $this->db->set('time', time()); $this->db->set('publish', 1); $result = $this->db->insert('gallery'); return $result; }
function process_commands_list($commands_list, $plugin_name = '') { # check inputs if (!is_string($plugin_name)) { return error(null, "plugin name is not a string"); } if (!is_array($commands_list)) { return error(null, "commands to process are not an array"); } if (empty($commands_list)) { return notice(null, "no commands to process"); } # loop through all the commands foreach ($commands_list as $commands) { $r = process_commands($commands); if (@$GLOBALS['error'] === false) { $r = true; } if ($r === true) { $syslog = get_config_value('syslog_on_success', false); if ($syslog) { $syslog_error_msg = "[SureDone {$plugin_name} plugin] [Success]"; $syslog_priority = get_config_value('syslog_success_priority', LOG_INFO); } $msg = "[Success] Script execution successful"; } else { $syslog = get_config_value('syslog_on_failure', true); if ($syslog) { $error_msg = $GLOBALS['error_msg']; $syslog_msg = "[SureDone {$plugin_name} plugin] [Error] {$error_msg}"; $syslog_priority = get_config_value('syslog_failure_priority', LOG_ERR); } $msg = "[Failure] Script exited with errors"; break; } } # perform a syslog if required if ($syslog) { syslog($syslog_priority, $syslog_msg); $msg = "{$msg} (logged to syslog)"; $exit_status = 1; } else { $msg = "{$msg} (not logged to syslog)"; $exit_status = 0; } # echo the success/failure of the script and exit echo "{$msg}\n"; if ($exit_status != 0) { exit($exit_status); } }
<!DOCTYPE html> <head> <title>Servatrice Administrator</title> </head> <html> <body> <?php require '.config_commonfunctions'; global $configfile; $version = trim(get_config_value($configfile, 'version')); if (strpos(strtolower($version), "fail") !== false) { echo $version; exit; } $banner = trim(get_config_value($configfile, 'indexwelcomemessage')); if (strpos(strtolower($banner), "fail") !== false) { echo $banner; exit; } ?> <table border="1" align="center" cellpadding="5"> <tr align="center"> <td><a href="loginpage.php">Account Log-in</a></td> <td><a href="statistics.php">Statistics</a></td> <td><a href="registrationpage.php">Registration</a></td> <td><a href="codeofconduct.html">Code of Conduct</a></td> </tr> <tr><td colspan="4" align="center"><?php if (!empty($banner)) { echo trim($banner) . '<br>'; }
/** * Set the transaction price * * @param ComSubscriptionsDomainEntityPackage $package * @param boolean $upgraded * * @return void */ public function setPackage($package, $upgraded = null) { $this->currency = get_config_value('subscriptions.currency', 'US'); $this->itemName = $package->name; $this->itemId = $package->id; $this->itemAmount = $package->price; $this->duration = $package->duration; $this->billingPeriod = $package->billingPeriod; $this->recurring = $package->recurring; if ($upgraded) { $this->duration = max(0, $package->duration - $upgraded->duration); $this->itemAmount = max(0, $package->price - $upgraded->price); $this->upgrade = true; } $this->_package = $package; return $this; }
require_once $_SERVER["DOCUMENT_ROOT"] . "/../includes/base.php"; if (!is_manager()) { http_response_code(404); header("Location: /error/404/not-found"); } $page = isset($_GET["page"]) ? intval($_GET["page"]) : 1; ?> <!DOCTYPE html> <html> <head> <?php include $_SERVER["DOCUMENT_ROOT"] . "/../includes/content.head.php"; ?> <title><?php echo get_config_value("site", "title"); ?> | Admin - Users</title> </head> <body> <div class="component-left"> <div class="container container-center"> <?php include $_SERVER["DOCUMENT_ROOT"] . "/../includes/content.sidebar_left.php"; ?> </div> </div> <div class="component-right"> <div class="container container-padded"> <h3>Manage Blocked Users</h3> <hr/>
<?php defined('KOOWA') or die('Restricted access'); ?> <?php echo get_config_value('subscriptions.welcome_message'); ?> <h1><?php echo @text('COM-SUBSCRIPTIONS-INVOICE'); ?> </h1> <p><strong><?php echo @text('COM-SUBSCRIPTIONS-INVOICE-BILLED-TO'); ?> </strong>: <?php echo @name($order->getSubscriber()); ?> </p> <p><strong><?php echo @text('COM-SUBSCRIPTIONS-INVOICE-SUBSCRIBED-TO'); ?> </strong>: <?php echo stripslashes($order->itemName); ?> </p> <p><strong><?php echo @text('COM-SUBSCRIPTIONS-TRANSACTION-DATE'); ?>
/** * Initializes the default configuration for the object * * Called from {@link __construct()} as a first step of object instantiation. * * @param KConfig $config An optional KConfig object with configuration options. * * @return void */ protected function _initialize(KConfig $config) { $params = get_config_value('com_subscriptions'); $config->append(array('test_mode' => $params->get('test_mode', false), 'login' => $params->get('login'), 'password' => $params->get('password'), 'signature' => $params->get('signature'))); parent::_initialize($config); }
?> :</dt> <dd><?php echo round(AnHelperDate::secondsTo('day', $package->duration)); ?> <?php echo @text('COM-SUBSCRIPTIONS-PACKAGE-DAYS'); ?> </dd> <dt><?php echo @text('COM-SUBSCRIPTIONS-PACKAGE-PRICE'); ?> :</dt> <dd><?php echo $package->price . ' ' . get_config_value('subscriptions.currency', 'US'); ?> </dd> </dl> </div> <div class="entity-description"> <?php echo @content($package->description); ?> <?php if (!$package->recurring && $package->authorize('upgradepackage')) { ?> <p> <a href="<?php
<td>ID</td> <td>From</td> <td>About</td> <td>Description</td> <td>Moderator</td> <td></td> </tr> <form action="viewcomplaintdetails.php" method="post"> <?php $nonresolved = "0000-00-00%"; $complaintcount = 0; $dbserv = get_config_value($configfile, "dbserver"); $dbuser = get_config_value($configfile, "dbusername"); $dbpass = get_config_value($configfile, "dbpassword"); $dbname = get_config_value($configfile, "dbname"); $dbtable = get_config_value($configfile, "dbcoctable"); if (strpos(strtolower($dbserv), "fail") !== false) { echo '<tr><td align="center" colspan="2">Failed to connect to datbase, database server name can not be blank</td></tr>'; exit; } if (strpos(strtolower($dbuser), "fail") !== false) { echo '<tr><td align="center" colspan="2">Failed to connect to datbase, database user name can not be blank</td></tr>'; exit; } if (strpos(strtolower($dbpass), "fail") !== false) { echo '<tr><td align="center" colspan="2">Failed to connect to datbase, database password can not be blank</td></tr>'; exit; } if (strpos(strtolower($dbname), "fail") !== false) { echo '<tr><td align="center" colspan="2">Failed to connect to datbase, database name can not be blank</td></tr>'; exit;
* The result *must* be assigned/stored to {RESULT}. * 'typecast' => typecast value * * The returned variables will be made always available to the next function to continue to work with. * * example (variable inputted is an integer of 1): * * array( * 'function1' => 'increment_by_one', // returned variable is 2 * 'typecast' => 'string', // typecast variable to be a string * 'execute' => '{RESULT} = {VALUE} . ' is good';', // returned variable is '2 is good' * 'function2' => 'replace_good_with_bad', // returned variable is '2 is bad' * ), * */ $convertor = array('test_file' => 'viewtopic.php', 'avatar_path' => get_config_value('avatar_path') . '/', 'avatar_gallery_path' => get_config_value('avatar_gallery_path') . '/', 'smilies_path' => get_config_value('smilies_path') . '/', 'upload_path' => defined('MOD_ATTACHMENT') ? phpbb_get_files_dir() . '/' : '', 'thumbnails' => defined('MOD_ATTACHMENT') ? array('thumbs/', 't_') : '', 'ranks_path' => false, 'query_first' => array(array('target', $convert->truncate_statement . SEARCH_RESULTS_TABLE), array('target', $convert->truncate_statement . SEARCH_WORDLIST_TABLE), array('target', $convert->truncate_statement . SEARCH_WORDMATCH_TABLE), array('target', $convert->truncate_statement . LOG_TABLE)), 'execute_first' => ' phpbb_create_userconv_table(); import_avatar_gallery(); if (defined("MOD_ATTACHMENT")) phpbb_import_attach_config(); phpbb_insert_forums(); ', 'execute_last' => array(' add_bots(); ', ' update_folder_pm_count(); ', ' update_unread_count(); ', defined('MOD_ATTACHMENT') ? ' phpbb_attachment_extension_group_name(); ' : ' ', ' phpbb_convert_authentication(\'start\');
<div class="control-group"> <label class="control-label" for="package-price"> <?php echo @text('COM-SUBSCRIPTIONS-PACKAGE-PRICE'); ?> </label> <div class="controls"> <div class="input-append"> <input class="span2" id="package-price" required type="text" placeholder="00.00" value="<?php echo $package->price; ?> " size="10" maxlength="10" name="price" /> <span class="add-on"> <?php echo get_config_value('subscriptions.currency', 'US'); ?> </span> </div> </div> </div> <div class="control-group"> <label class="control-label" for="package-duration"> <?php echo @text('COM-SUBSCRIPTIONS-PACKAGE-DURATION'); ?> </label> <div class="controls"> <?php $period_options = array(array(ComSubscriptionsDomainEntityPackage::BILLING_PERIOD_YEAR, @text('COM-SUBSCRIPTIONS-BILLING-PERIOD-YEAR')), array(ComSubscriptionsDomainEntityPackage::BILLING_PERIOD_MONTH, @text('COM-SUBSCRIPTIONS-BILLING-PERIOD-MONTH')), array(ComSubscriptionsDomainEntityPackage::BILLING_PERIOD_WEEK, @text('COM-SUBSCRIPTIONS-BILLING-PERIOD-WEEK')), array(ComSubscriptionsDomainEntityPackage::BILLING_PERIOD_DAY, @text('COM-SUBSCRIPTIONS-BILLING-PERIOD-DAY')));
<?php include $_SERVER["DOCUMENT_ROOT"] . "/../includes/content.sidebar_left.php"; ?> </div> </div> <div class="component-right"> <div class="container container-padded"> <div id="article-container" itemscope itemtype="http://schema.org/Article" data-post-id="<?php echo $post_id; ?> "> <?php echo "<h3><a itemprop='url' href='/posts/" . $post["id"] . "'><span itemprop='name'><span itemprop='headline'>" . $post["title"] . "</span></span></a></h3>"; echo "<span itemprop='articleBody'>" . $post["text"] . "</span>"; echo "<hr/>"; echo "<span class='post-details'>Posted by <span itemprop='author' itemscope itemtype='http://schema.org/Person'><span itemprop='name'>" . $post["author"] . "</span></span>, <span itemprop='datePublished' content='" . $post["date"] . "' class='date'>" . $post["date"] . "</span></span>"; echo "<span itemprop='image' content='" . "http://" . $_SERVER["SERVER_NAME"] . get_config_value("site", "avatar_path") . "'></span>"; ?> </div> <br/> <?php include $_SERVER["DOCUMENT_ROOT"] . "/../includes/content.comments.php"; ?> </div> </div> <?php include $_SERVER["DOCUMENT_ROOT"] . "/../includes/content.resources.php"; ?> </body> </html>
<?php if ($datingapply) { foreach ($datingapply as $rows) { if ($rows->avatar) { $avatar = $rows->avatar; } else { $avatar = 'noavatar' . $rows->gender . '.jpg'; } $img = '<img src="' . base_url() . 'thumbnail/timthumb.php?src=' . base_url() . get_config_value('upload_avatar_path') . $avatar . '&q=100&w=35&h=35" alt=""/>'; $profile_link = base_url() . index_page() . 'profiles/detail/' . $rows->userid . '/' . $rows->name . '.html'; ?> <li> <div class="imgPeo"> <a href="<?php echo $profile_link; ?> "><?php echo $img; ?> </a> </div> <div class="infoPeo"> <p style="width: 70px; font-size: 11px;"><a href="<?php echo $profile_link; ?> "><?php echo $rows->name; ?> </a></p> </div>
/** * Initializes the options for the object. * * Called from {@link __construct()} as a first step of object instantiation. * * @param object An optional KConfig object with configuration options. */ protected function _initialize(KConfig $config) { $config->append(array('name' => 'google', 'version' => '3', 'url' => 'https://maps.googleapis.com/maps/api/geocode/json?', 'key' => get_config_value('locations.service_key', null))); parent::_initialize($config); }
function get_filter_stats($user_id) { global $dbh; $enable_false_negative_management = get_config_value("enable_false_negative_management") == 'Y'; if ($user_id > 0) { $select = "SELECT total_ham_items AS total_ham, " . "total_spam_items AS total_spam, " . "total_fp_items AS total_fp, " . "total_fn_items AS total_fn " . "FROM maia_stats WHERE user_id = ?"; $sth = $dbh->query($select, array($user_id)); } else { $select = "SELECT SUM(total_ham_items) AS total_ham, " . "SUM(total_spam_items) AS total_spam, " . "SUM(total_fp_items) AS total_fp, " . "SUM(total_fn_items) AS total_fn " . "FROM maia_stats"; $sth = $dbh->query($select); } $fp_pct = 0; $fn_pct = 0; $ppv_pct = 0; $npv_pct = 0; $sensitivity_pct = 0; $specificity_pct = 0; $efficiency_pct = 0; if ($row = $sth->fetchrow()) { $ham = $row["total_ham"]; $spam = $row["total_spam"]; $fp = $row["total_fp"]; $fn = $row["total_fn"]; $ppv_pct = calculate_ppv($spam, $fp); $specificity_pct = calculate_specificity($ham, $fp); if ($enable_false_negative_management) { $npv_pct = calculate_npv($ham, $fn); $sensitivity_pct = calculate_sensitivity($spam, $fn); $efficiency_pct = calculate_efficiency($spam, $ham, $fp, $fn); if ($ham + $spam + $fp + $fn > 0) { $fp_pct = $fp / ($ham + $spam + $fp + $fn); $fn_pct = 1 - $efficiency_pct - $fp_pct; } else { $fp_pct = 0; $fn_pct = 0; } } else { $npv = 1; $sensitivity_pct = 1; $efficiency_pct = calculate_efficiency($spam, $ham, $fp, 0); if ($ham + $spam + $fp > 0) { $fp_pct = 1 - $efficiency_pct; } else { $fp_pct = 0; } $fn_pct = 0; } } $sth->free(); return array($ppv_pct, $npv_pct, $sensitivity_pct, $specificity_pct, $efficiency_pct, $fp_pct, $fn_pct); }
/** * Function for recoding text with the default language * * @param string $text text to recode to utf8 * @param bool $grab_user_lang if set to true the function tries to use $convert_row['user_lang'] (and falls back to $convert_row['poster_id']) instead of the boards default language */ function phpbb_set_encoding($text, $grab_user_lang = true) { global $lang_enc_array, $convert_row; global $convert, $phpEx; /*static $lang_enc_array = array( 'korean' => 'euc-kr', 'serbian' => 'windows-1250', 'polish' => 'iso-8859-2', 'kurdish' => 'windows-1254', 'slovak' => 'Windows-1250', 'russian' => 'windows-1251', 'estonian' => 'iso-8859-4', 'chinese_simplified' => 'gb2312', 'macedonian' => 'windows-1251', 'azerbaijani' => 'UTF-8', 'romanian' => 'iso-8859-2', 'romanian_diacritice' => 'iso-8859-2', 'lithuanian' => 'windows-1257', 'turkish' => 'iso-8859-9', 'ukrainian' => 'windows-1251', 'japanese' => 'shift_jis', 'hungarian' => 'ISO-8859-2', 'romanian_no_diacritics' => 'iso-8859-2', 'mongolian' => 'UTF-8', 'slovenian' => 'windows-1250', 'bosnian' => 'windows-1250', 'czech' => 'Windows-1250', 'farsi' => 'Windows-1256', 'croatian' => 'windows-1250', 'greek' => 'iso-8859-7', 'russian_tu' => 'windows-1251', 'sakha' => 'UTF-8', 'serbian_cyrillic' => 'windows-1251', 'bulgarian' => 'windows-1251', 'chinese_traditional_taiwan' => 'big5', 'chinese_traditional' => 'big5', 'arabic' => 'windows-1256', 'hebrew' => 'WINDOWS-1255', 'thai' => 'windows-874', //'chinese_traditional_taiwan' => 'utf-8' // custom modified, we may have to do an include :-( );*/ if (empty($lang_enc_array)) { $lang_enc_array = array(); } $get_lang = trim(get_config_value('default_lang')); // Do we need the users language encoding? if ($grab_user_lang && !empty($convert_row)) { if (!empty($convert_row['user_lang'])) { $get_lang = trim($convert_row['user_lang']); } else if (!empty($convert_row['poster_id'])) { global $src_db, $same_db; if ($convert->mysql_convert && $same_db) { $src_db->sql_query("SET NAMES 'binary'"); } $sql = 'SELECT user_lang FROM ' . $convert->src_table_prefix . 'users WHERE user_id = ' . (int) $convert_row['poster_id']; $result = $src_db->sql_query($sql); $get_lang = (string) $src_db->sql_fetchfield('user_lang'); $src_db->sql_freeresult($result); if ($convert->mysql_convert && $same_db) { $src_db->sql_query("SET NAMES 'utf8'"); } $get_lang = (!trim($get_lang)) ? trim(get_config_value('default_lang')) : trim($get_lang); } } if (!isset($lang_enc_array[$get_lang])) { $filename = $convert->options['forum_path'] . '/language/lang_' . $get_lang . '/lang_main.' . $phpEx; if (!file_exists($filename)) { $get_lang = trim(get_config_value('default_lang')); } if (!isset($lang_enc_array[$get_lang])) { include($convert->options['forum_path'] . '/language/lang_' . $get_lang . '/lang_main.' . $phpEx); $lang_enc_array[$get_lang] = $lang['ENCODING']; unset($lang); } } $encoding = $lang_enc_array[$get_lang]; return utf8_recode($text, $lang_enc_array[$get_lang]); }
<a href="<?php echo $profile_link; ?> "> <?php if ($activity->avatar) { ?> <img src="<?php echo base_url() . 'thumbnail/timthumb.php?src=' . base_url() . get_config_value('upload_avatar_path') . $activity->avatar . '&q=100&w=29&h=29'; ?> " alt=""/> <?php } else { ?> <img src="<?php echo base_url() . 'thumbnail/timthumb.php?src=' . base_url() . get_config_value('upload_avatar_path') . 'noavatar' . $activity->gender . '.jpg' . '&q=100&w=29&h=29'; ?> " alt=""/> <?php } ?> </a> <p style="margin-left: 32px;"><span class="userName"><a href="<?php echo $profile_link; ?> "><?php echo $activity->name; ?> </a></span> <?php if ($activity->type == 1) {
<!DOCTYPE html> <html> <head> <title>Servatrice Administrator</title> </head> <body> <?php global $configfile; require '.auth_modsession'; require '.config_commonfunctions'; $dbtable = get_config_value($configfile, "dbreplaytable"); ?> <table align="center" border="1" cellpadding="5"> <tr> <td align="center"><a href="portal_servermanagement.php">Server Management Menu</a></td> <td align="center"><a href="logout.php">Logout</a></td> </tr> <tr> <td colspan="2"> <?php if ($_SERVER['REQUEST_METHOD'] == 'POST') { $count = $_POST['count']; if (empty($count)) { echo "failed, number of replays to delete can not be blank"; exit; } if (empty($dbtable)) { echo "failed, unable to locate replay table name"; exit; } $results = delete_dbrows($count, $dbtable);