function edit($tabindex = 1) { $myreturn = '<select name="' . $this->config['dbfield'] . '_min" id="' . $this->config['dbfield'] . '_min" tabindex="' . $tabindex . '">' . vector2options($this->config['accepted_values'], $this->value['min']) . '</select>'; $myreturn .= ' - '; $myreturn .= '<select name="' . $this->config['dbfield'] . '_max" id="' . $this->config['dbfield'] . '_max" tabindex="' . $tabindex . '">' . vector2options($this->config['accepted_values'], $this->value['max']) . '</select>'; return $myreturn; }
function edit($tabindex = 1) { $myreturn = '<select name="' . $this->config['dbfield'] . '_month" id="' . $this->config['dbfield'] . '_month" tabindex="' . $tabindex . '">' . vector2options($GLOBALS['accepted_months'], $this->value['month']) . '</select>'; $myreturn .= '<select name="' . $this->config['dbfield'] . '_day" id="' . $this->config['dbfield'] . '_day" tabindex="' . $tabindex . '"><option value="">' . $GLOBALS['_lang'][131] . '</option>' . interval2options(1, 31, $this->value['day']) . '</select>'; $cur_year = (int) gmdate('Y'); $myreturn .= '<select name="' . $this->config['dbfield'] . '_year" id="' . $this->config['dbfield'] . '_year" tabindex="' . $tabindex . '"><option value="">' . $GLOBALS['_lang'][132] . '</option>' . interval2options($cur_year - $this->config['accepted_values']['max'], $cur_year - $this->config['accepted_values']['min'], $this->value['year'], array(), 1, 2) . '</select>'; return $myreturn; }
$output = array(); $output['lk_type'] = FIELD_TEXTFIELD; if (isset($_SESSION['topass']['input'])) { $output = $_SESSION['topass']['input']; // our 'return' here was decoded in the processor $output['return2'] = $output['return']; $output['return'] = rawurlencode($output['return']); } elseif (!empty($_GET['lk_id'])) { $lk_id = (int) $_GET['lk_id']; $query = "SELECT `lk_id`,`alt_id_text`,`lk_type`,`lk_diz`,`lk_use`,`save_file` FROM `{$dbtable_prefix}lang_keys` WHERE `lk_id`={$lk_id}"; if (!($res = @mysql_query($query))) { trigger_error(mysql_error(), E_USER_ERROR); } if (mysql_num_rows($res)) { $output = mysql_fetch_assoc($res); $output['lk_diz'] = sanitize_and_format($output['lk_diz'], TYPE_STRING, $__field2format[TEXT_DB2EDIT]); $output['alt_id_text'] = sanitize_and_format($output['alt_id_text'], TYPE_STRING, $__field2format[TEXT_DB2EDIT]); } } $output['lk_type'] = vector2options($accepted_lk_types, $output['lk_type']); if (empty($output['return'])) { $output['return2'] = sanitize_and_format_gpc($_GET, 'return', TYPE_STRING, $__field2format[FIELD_TEXTFIELD], ''); $output['return'] = rawurlencode($output['return2']); } $tpl->set_file('content', 'lang_keys_addedit.html'); $tpl->set_var('output', $output); $tpl->process('content', 'content', TPL_OPTIONAL); $tplvars['title'] = 'Add/Edit Language Keys'; $tplvars['page'] = 'lang_keys_addedit'; $tplvars['css'] = 'lang_keys_addedit.css'; include 'frame.php';
$query = "SELECT `amtpl_id`,`amtpl_name`,`subject`,`message_body` FROM `{$dbtable_prefix}admin_mtpls` WHERE `amtpl_type`=" . $output['t']; if (!($res = @mysql_query($query))) { trigger_error(mysql_error(), E_USER_ERROR); } $amtpls = array(); $i = 0; while ($rsrow = mysql_fetch_assoc($res)) { $rsrow = sanitize_and_format($rsrow, TYPE_STRING, $__field2format[TEXT_DB2EDIT]); $amtpls[$rsrow['amtpl_id']] = $rsrow['amtpl_name']; if ($i == 0 && !$returned) { $output['reason_title'] = $rsrow['subject']; $output['reject_reason'] = $rsrow['message_body']; } $i++; } $output['amtpl_id'] = vector2options($amtpls); switch ($output['t']) { case AMTPL_REJECT_MEMBER: $output['user_id'] = $output['id']; $output['user'] = get_user_by_userid($output['id']); $output['reject_member'] = true; $tplvars['title'] = 'Reject a member profile'; break; case AMTPL_REJECT_PHOTO: $query = "SELECT `fk_user_id` as `user_id`,`_user` as `user`,`photo` FROM `{$dbtable_prefix}user_photos` WHERE `photo_id`=" . $output['id']; if (!($res = @mysql_query($query))) { trigger_error(mysql_error(), E_USER_ERROR); } if (mysql_num_rows($res)) { list($output['user_id'], $output['user'], $output['photo']) = mysql_fetch_row($res); }
/** * TODO: replace usage of this function with awpcp_pagination() */ function _create_pager($item_count, $offset, $results, $tpname) { $permastruc = get_option('permalink_structure'); if (isset($permastruc) && !empty($permastruc)) { $awpcpoffset_set = "?offset="; } else { if (is_admin()) { $awpcpoffset_set = "?offset="; } else { $awpcpoffset_set = "&offset="; } } mt_srand(create_awpcp_random_seed()); $radius = 5; global $accepted_results_per_page; $accepted_results_per_page = awpcp_pagination_options($results); // TODO: remove all fields that belongs to the Edit Ad form (including extra fields and others?) $params = array_merge($_GET, $_POST); unset($params['page_id'], $params['offset'], $params['results']); unset($params['PHPSESSID'], $params['aeaction'], $params['category_id']); unset($params['cat_ID'], $params['action'], $params['aeaction']); unset($params['category_name'], $params['category_parent_id']); unset($params['createeditadcategory'], $params['deletemultiplecategories']); unset($params['movedeleteads'], $params['moveadstocategory']); unset($params['category_to_delete'], $params['tpname']); unset($params['category_icon'], $params['sortby'], $params['adid']); unset($params['picid'], $params['adkey'], $params['editemail']); unset($params['awpcp_ads_to_action'], $params['post_type']); $cid = intval(awpcp_request_param('category_id')); $cid = empty($cid) ? get_query_var('cid') : $cid; if ($cid > 0) { $params['category_id'] = intval($cid); } $myrand = mt_rand(1000, 2000); $form = "<form id=\"pagerform{$myrand}\" name=\"pagerform{$myrand}\" action=\"\" method=\"get\">\n"; $form .= "<table>\n"; $form .= "<tr>\n"; $form .= "\t<td>\n"; $totalrows = $item_count; $total_pages = ceil($totalrows / $results); $dotsbefore = false; $dotsafter = false; $current_page = 0; $myreturn = ''; for ($i = 1; $i <= $total_pages; $i++) { if (($i - 1) * $results <= $offset && $offset < $i * $results) { $myreturn .= "{$i} "; $current_page = $i; } elseif (($i - 1 + $radius) * $results < $offset) { if (!$dotsbefore) { $myreturn .= "..."; $dotsbefore = true; } } elseif (($i - 1 - $radius) * $results > $offset) { if (!$dotsafter) { $myreturn .= "..."; $dotsafter = true; } } else { $href_params = array_merge($params, array('offset' => ($i - 1) * $results, 'results' => $results)); $href = add_query_arg(urlencode_deep($href_params), $tpname); $myreturn .= sprintf('<a href="%s">%d</a> ', esc_url($href), esc_attr($i)); } } if ($offset != 0) { //Subtract 2, page is 1-based index, results is 0-based, must compensate for 2 pages here if (($current_page - 2) * $results < $results) { $href_params = array_merge($params, array('offset' => 0, 'results' => $results)); $href = add_query_arg(urlencode_deep($href_params), $tpname); } else { $href_params = array_merge($params, array('offset' => ($current_page - 2) * $results, 'results' => $results)); $href = add_query_arg(urlencode_deep($href_params), $tpname); } $prev = sprintf('<a href="%s">«</a> ', esc_url($href)); } else { $prev = ''; } if ($offset != ($total_pages - 1) * $results) { $href_params = array_merge($params, array('offset' => $current_page * $results, 'results' => $results)); $href = add_query_arg(urlencode_deep($href_params), $tpname); $next = sprintf('<a href="%s">»</a> ', esc_url($href)); } else { $next = ''; } if (isset($_REQUEST['page_id']) && !empty($_REQUEST['page_id'])) { $form .= "\t\t<input type=\"hidden\" name=\"page_id\" value='" . esc_attr($_REQUEST['page_id']) . "' />\n"; } $form = $form . $prev . $myreturn . $next; $form .= "\t</td>\n"; if (count($accepted_results_per_page) > 1) { $form .= "\t<td>\n"; $form .= "\t\t<input type=\"hidden\" name=\"offset\" value=\"{$offset}\" />\n"; $flat_params = awpcp_flatten_array($params); while (list($k, $v) = each($flat_params)) { if (is_array($v)) { $v = count($v) > 0 ? reset($v) : ''; } $form .= "\t\t<input type=\"hidden\" name=\"" . esc_attr($k) . "\" value=\"" . esc_attr($v) . "\" />\n"; } $form .= "\t\t<select name=\"results\" onchange=\"document.pagerform{$myrand}.submit()\">\n"; $form .= vector2options($accepted_results_per_page, $results); $form .= "\t\t</select>\n"; $form .= "\t</td>\n"; } $form .= "</tr>\n"; $form .= "</table>\n"; $form .= "</form>\n"; return $form; }
$output['return2'] = sanitize_and_format_gpc($_GET, 'return', TYPE_STRING, $__field2format[FIELD_TEXTFIELD], ''); $output['return'] = rawurlencode($output['return2']); } $new_field = null; if (class_exists($output['field_type'])) { $new_field = new $output['field_type'](); } if (!empty($new_field->allowed_search_types)) { $output['row_searchable'] = true; $temp = array(); for ($i = 0; isset($new_field->allowed_search_types[$i]); ++$i) { $temp[$new_field->allowed_search_types[$i]] = $accepted_fieldtype['search'][$new_field->allowed_search_types[$i]]; } // keep $search_type because it is refered from $field->edit_admin() $search_type = !empty($output['search_type']) ? $output['search_type'] : $new_field->allowed_search_types[0]; $output['search_type'] = vector2options($temp, $output['search_type']); // we initialize the search field so we can ask for its admin config in search mode. $search_field = null; if (class_exists($search_type)) { $search_field = new $search_type(array(), true); } if (!empty($search_field)) { $output['custom_config_search'] = $search_field->edit_admin(); } } $output['fieldtype_text'] = $accepted_fieldtype['direct'][$output['field_type']]; $output['searchable'] = !empty($output['searchable']) ? 'checked="checked"' : ''; $output['for_basic'] = !empty($output['for_basic']) ? 'checked="checked"' : ''; $output['at_registration'] = !empty($output['at_registration']) ? 'checked="checked"' : ''; $output['required'] = !empty($output['required']) ? 'checked="checked"' : ''; $output['fk_pcat_id'] = dbtable2options("`{$dbtable_prefix}profile_categories` a LEFT JOIN `{$dbtable_prefix}lang_strings` b ON (a.`fk_lk_id_pcat`=b.`fk_lk_id` AND b.`skin`='{$default_skin_code}')", 'a.`pcat_id`', 'b.`lang_value`', 'a.`pcat_id`', $output['fk_pcat_id']);
<?php /****************************************************************************** Etano =============================================================================== File: admin/blog_search.php $Revision$ Software by: DateMill (http://www.datemill.com) Copyright by: DateMill (http://www.datemill.com) Support at: http://www.datemill.com/forum ******************************************************************************* * See the "docs/licenses/etano.txt" file for license. * ******************************************************************************/ require_once '../includes/common.inc.php'; require_once '../includes/admin_functions.inc.php'; allow_dept(DEPT_ADMIN); $tpl = new phemplate('skin/', 'remove_nonjs'); $output = array(); $output['stat'] = vector2options($accepted_pstats); $tpl->set_file('content', 'blog_search.html'); $tpl->set_var('output', $output); $tpl->process('content', 'content', TPL_LOOP); $tplvars['title'] = 'Search'; $tplvars['css'] = 'blog_search.css'; $tplvars['page'] = 'blog_search'; include 'frame.php';
Support at: http://www.datemill.com/forum ******************************************************************************* * See the "docs/licenses/etano.txt" file for license. * ******************************************************************************/ require_once '../includes/common.inc.php'; require_once '../includes/admin_functions.inc.php'; allow_dept(DEPT_MODERATOR | DEPT_ADMIN); $tpl = new phemplate('skin/', 'remove_nonjs'); $output = array(); $sorts = array('a.`_user`', 'a.`score` DESC', 'a.`fk_user_id` DESC'); $sort_names = array('alphabetically', 'by score (highest first)', 'newest first'); $o = isset($_GET['o']) ? (int) $_GET['o'] : 0; $r = !empty($_GET['r']) ? (int) $_GET['r'] : current($accepted_results_per_page); $output['search_md5'] = sanitize_and_format_gpc($_GET, 'search', TYPE_STRING, $__field2format[FIELD_TEXTFIELD], ''); $sortby = isset($_GET['sortby']) && isset($sorts[(int) $_GET['sortby']]) ? (int) $_GET['sortby'] : 0; $output['sortby'] = vector2options($sort_names, $sortby); $input = array(); $user_ids = array(); $do_query = true; if (!empty($output['search_md5'])) { // if we have a query cache, retrieve all from cache $query = "SELECT `results`,`search` FROM `{$dbtable_prefix}site_searches` WHERE `search_md5`='" . $output['search_md5'] . "' AND `search_type`=" . SEARCH_USER; if (!($res = @mysql_query($query))) { trigger_error(mysql_error(), E_USER_ERROR); } if (mysql_num_rows($res)) { list($user_ids, $input) = mysql_fetch_row($res); $user_ids = explode(',', $user_ids); $input = unserialize($input); // sanitized already }
function edit($tabindex = 1) { return '<select name="' . $this->config['dbfield'] . '" id="' . $this->config['dbfield'] . '" tabindex="' . $tabindex . '">' . vector2options($this->config['accepted_values'], $this->value) . '</select>'; }
$i = 0; while ($rsrow = mysql_fetch_assoc($res)) { $rsrow = sanitize_and_format($rsrow, TYPE_STRING, $__field2format[TEXT_DB2DISPLAY]); $temp = new $rsrow['field_type'](); $rsrow['field_type'] = $temp->display_name; $rsrow['searchable'] = !empty($rsrow['searchable']) ? '<img src="skin/images/check.gif" alt="" />' : ''; $rsrow['reg_page'] = !empty($rsrow['reg_page']) && $rsrow['at_registration'] == 1 ? $rsrow['reg_page'] : ' - '; $rsrow['required'] = !empty($rsrow['required']) ? '<img src="skin/images/check.gif" alt="" />' : ''; $rsrow['fk_pcat_id'] = db_key2value("`{$dbtable_prefix}lang_strings`", '`fk_lk_id`', '`lang_value`', $rsrow['fk_lk_id_pcat'], '', "AND `skin`='{$default_skin_code}'"); $rsrow['myclass'] = $i % 2 ? 'odd_item' : 'even_item'; $loop[] = $rsrow; ++$i; } $output['pager2'] = pager($totalrows, $o, $r); } $output['field_type'] = vector2options($accepted_fieldtype['direct']); $output['return2me'] = 'profile_fields.php'; if (!empty($_SERVER['QUERY_STRING'])) { $output['return2me'] .= '?' . $_SERVER['QUERY_STRING']; } $output['return2me2'] = $output['return2me']; // this is used in the add form (with method="get") $output['return2me'] = rawurlencode($output['return2me']); $tpl->set_file('content', 'profile_fields.html'); $tpl->set_loop('loop', $loop); $tpl->set_var('output', $output); $tpl->process('content', 'content', TPL_LOOP | TPL_NOLOOP); $tpl->drop_loop('loop'); $tplvars['title'] = 'Profile Fields Management'; $tplvars['css'] = 'profile_fields.css'; $tplvars['page'] = 'profile_fields';
} elseif (!empty($_GET['subscr_id'])) { $subscr_id = (int) $_GET['subscr_id']; $query = "SELECT * FROM `{$dbtable_prefix}subscriptions` WHERE `subscr_id`={$subscr_id}"; if (!($res = @mysql_query($query))) { trigger_error(mysql_error(), E_USER_ERROR); } if (mysql_num_rows($res)) { $subscriptions = mysql_fetch_assoc($res); $subscriptions = sanitize_and_format($subscriptions, TYPE_STRING, $__field2format[TEXT_DB2EDIT]); } } // we preffer to do this query here rather than dbtable2options to save one dbtable2options query. $query = "SELECT `m_value`,`m_name` FROM `{$dbtable_prefix}memberships` WHERE `m_value`>1"; if (!($res = @mysql_query($query))) { trigger_error(mysql_error(), E_USER_ERROR); } $memberships = array(); while ($rsrow = mysql_fetch_row($res)) { $memberships[$rsrow[0]] = $rsrow[1]; } $subscriptions['currency'] = vector2options($accepted_currencies, $subscriptions['currency']); $subscriptions['m_value_to'] = vector2options($memberships, $subscriptions['m_value_to'], array(2)); $subscriptions['is_recurent'] = $subscriptions['is_recurent'] == 1 ? 'checked="checked"' : ''; $subscriptions['is_visible'] = $subscriptions['is_visible'] == 1 ? 'checked="checked"' : ''; $tpl->set_file('content', 'subscriptions_addedit.html'); $tpl->set_var('subscriptions', $subscriptions); $tpl->process('content', 'content'); $tplvars['title'] = 'Subscriptions Management'; $tplvars['css'] = 'subscriptions_addedit.css'; $tplvars['page'] = 'subscriptions_addedit'; include 'frame.php';
switch ($rsrow['option_type']) { case FIELD_CHECKBOX: $rsrow['config_value'] = $rsrow['config_value'] == 1 ? 'checked="checked"' : ''; $rsrow['field'] = '<input class="input_chk" type="checkbox" name="' . $rsrow['fk_module_code'] . '_' . $rsrow['config_option'] . '" id="' . $rsrow['fk_module_code'] . '_' . $rsrow['config_option'] . '" value="1" ' . $rsrow['config_value'] . ' />'; break; case FIELD_TEXTFIELD: $rsrow['field'] = '<input class="input_tf" type="text" name="' . $rsrow['fk_module_code'] . '_' . $rsrow['config_option'] . '" id="' . $rsrow['fk_module_code'] . '_' . $rsrow['config_option'] . '" value="' . $rsrow['config_value'] . '" />'; break; case FIELD_INT: $rsrow['field'] = '<input class="number" type="text" name="' . $rsrow['fk_module_code'] . '_' . $rsrow['config_option'] . '" id="' . $rsrow['fk_module_code'] . '_' . $rsrow['config_option'] . '" value="' . $rsrow['config_value'] . '" />'; break; case FIELD_TEXTAREA: $rsrow['field'] = '<textarea class="input_ta" name="' . $rsrow['fk_module_code'] . '_' . $rsrow['config_option'] . '" id="' . $rsrow['fk_module_code'] . '_' . $rsrow['config_option'] . '" cols="" rows="">' . $rsrow['config_value'] . '</textarea>'; break; case FIELD_SELECT: $rsrow['field'] = '<select name="' . $rsrow['fk_module_code'] . '_' . $rsrow['config_option'] . '" id="' . $rsrow['fk_module_code'] . '_' . $rsrow['config_option'] . '">' . vector2options($rsrow['choices'], $rsrow['config_value']) . '</select>'; break; case FIELD_FILE: $rsrow['field'] = '<input class="text" type="file" name="' . $rsrow['fk_module_code'] . '_' . $rsrow['config_option'] . '" id="' . $rsrow['fk_module_code'] . '_' . $rsrow['config_option'] . '" /> <a class="remove_upl_file" href="processors/site_options_del_file.php?cid=' . $rsrow['config_id'] . '"><span>Remove</span></a> <p>' . $rsrow['config_value'] . '</p>'; break; } if (isset($rsrow['field'])) { $site_options[$i]['options'][] = $rsrow; } } //print_r($site_options); $output['gmtime'] = gmdate('F d, Y, h:i:s A'); $tpl->set_file('content', 'site_options.html'); $tpl->set_loop('site_options', $site_options); $tpl->set_var('module_code', $active_module_code); $tpl->set_var('output', $output);
$output = $_SESSION['topass']['input']; } elseif (!empty($_GET['rate_id'])) { $rate_id = (int) $_GET['rate_id']; $query = "SELECT * FROM `{$dbtable_prefix}rate_limiter` WHERE `rate_id`={$rate_id}"; if (!($res = @mysql_query($query))) { trigger_error(mysql_error(), E_USER_ERROR); } if (mysql_num_rows($res)) { $output = mysql_fetch_assoc($res); } $output['error_message'] = ''; $query = "SELECT `lang_value` FROM `{$dbtable_prefix}lang_strings` WHERE `skin`='" . get_default_skin_code() . "' AND `fk_lk_id`=" . $output['fk_lk_id_error_message']; if (!($res = @mysql_query($query))) { trigger_error(mysql_error(), E_USER_ERROR); } if (mysql_num_rows($res)) { $output['error_message'] = mysql_result($res, 0, 0); } $output = sanitize_and_format($output, TYPE_STRING, $__field2format[TEXT_DB2EDIT]); } $output['m_value'] = dbtable2options("`{$dbtable_prefix}memberships`", '`m_value`', '`m_name`', '`m_value`', $output['m_value']); $output['level_code'] = dbtable2options("`{$dbtable_prefix}access_levels`", '`level_code`', '`level_code`', '`level_id`', $output['level_code']); $output['punishment'] = vector2options($accepted_punishments, $output['punishment']); $output['default_skin'] = get_default_skin_name(); $tpl->set_file('content', 'rate_limiter_addedit.html'); $tpl->set_var('output', $output); $tpl->process('content', 'content'); $tplvars['title'] = 'Limits Management'; $tplvars['page'] = 'rate_limiter_addedit'; $tplvars['css'] = 'rate_limiter_addedit.css'; include 'frame.php';
switch ($kv['option_type']) { case FIELD_CHECKBOX: $kv['config_value'] = $kv['config_value'] == 1 ? 'checked="checked"' : ''; $loop[$i]['field'] = '<input type="checkbox" name="' . $module_code . '_' . $config_option . '" id="' . $module_code . '_' . $config_option . '" value="1" ' . $kv['config_value'] . ' tabindex="' . ($i + 1) . '" />'; break; case FIELD_TEXTFIELD: $loop[$i]['field'] = '<input type="text" class="text" name="' . $module_code . '_' . $config_option . '" id="' . $module_code . '_' . $config_option . '" value="' . $kv['config_value'] . '" tabindex="' . ($i + 1) . '" />'; break; case FIELD_INT: $loop[$i]['field'] = '<input class="number text" type="text" name="' . $module_code . '_' . $config_option . '" id="' . $module_code . '_' . $config_option . '" value="' . $kv['config_value'] . '" tabindex="' . ($i + 1) . '" />'; break; case FIELD_TEXTAREA: $loop[$i]['field'] = '<textarea name="' . $module_code . '_' . $config_option . '" id="' . $module_code . '_' . $config_option . '" tabindex="' . ($i + 1) . '">' . $kv['config_value'] . '</textarea>'; break; case FIELD_SELECT: $loop[$i]['field'] = '<select name="' . $module_code . '_' . $config_option . '" id="' . $module_code . '_' . $config_option . '" tabindex="' . ($i + 1) . '">' . vector2options($kv['choices'], $kv['config_value']) . '</select>'; break; } ++$i; } } } $query = "SELECT `email` FROM `" . USER_ACCOUNTS_TABLE . "` WHERE `" . USER_ACCOUNT_ID . "`='" . $_SESSION[_LICENSE_KEY_]['user']['user_id'] . "'"; if (!($res = @mysql_query($query))) { trigger_error(mysql_error(), E_USER_ERROR); } $output['email'] = mysql_result($res, 0, 0); $output['lang_260'] = sanitize_and_format($GLOBALS['_lang'][260], TYPE_STRING, $__field2format[TEXT_DB2DISPLAY]); $output['lang_261'] = sanitize_and_format($GLOBALS['_lang'][261], TYPE_STRING, $__field2format[TEXT_DB2DISPLAY]); $output['lang_276'] = sanitize_and_format($GLOBALS['_lang'][276], TYPE_STRING, $__field2format[TEXT_DB2DISPLAY]); $output['gmtime'] = gmdate('F d, Y, h:i:s A');
} } $subscriptions_auto['fk_subscr_id'] = dbtable2options("`{$dbtable_prefix}subscriptions`", '`subscr_id`', '`subscr_name`', '`subscr_id`', $subscriptions_auto['fk_subscr_id']); if (empty($subscriptions_auto['dbfield'])) { $subscriptions_auto['to_members_1'] = 'checked="checked"'; } else { $subscriptions_auto['to_members_2'] = 'checked="checked"'; } $dbfields = array(); foreach ($_pfields as $pfield_id => $pfield) { if (get_class($pfield) == 'field_select') { $dbfields[$pfield['dbfield']] = $pfield->config['label'] . ' (' . $pfield->config['dbfield'] . ')'; } } if (!empty($subscriptions_auto['dbfield'])) { $accepted_values = array(); foreach ($_pfields as $pfield_id => $pfield) { if ($pfield->config['dbfield'] == $subscriptions_auto['dbfield']) { $accepted_values = $pfield->config['accepted_values']; } } $subscriptions_auto['field_value'] = vector2options($accepted_values, $subscriptions_auto['field_value']); } $subscriptions_auto['dbfield'] = vector2options($dbfields, $subscriptions_auto['dbfield']); $tpl->set_file('content', 'subscriptions_auto_addedit.html'); $tpl->set_var('subscriptions_auto', $subscriptions_auto); $tpl->process('content', 'content'); $tplvars['title'] = 'Auto Subscriptions Management'; $tplvars['css'] = 'subscriptions_auto_addedit.css'; $tplvars['page'] = 'subscriptions_auto_addedit'; include 'frame.php';
function create_pager2($totalrows, $offset, $results, $lang_strings = array()) { mt_srand(make_seed()); $radius = 4; $phpself = explode('?', $_SERVER['REQUEST_URI']); $phpself = $phpself[0]; global $accepted_results_per_page; $params = array(); $params = array_merge($_GET, $_POST); unset($params['o'], $params['r'], $params[session_name()]); $qs = array2qs($params, array(session_name()), '&'); $myrand = mt_rand(1000, 2000); if (empty($results)) { $results = 10; } $total_pages = ceil($totalrows / $results); $myreturn = "<form id=\"pagerform{$myrand}\" action=\"{$phpself}\" method=\"get\">\n"; $myreturn .= "<ul class=\"pager\">\n"; $myreturn .= '<li class="text">' . (isset($lang_strings['page']) ? $lang_strings['page'] : '') . '</li>'; if ($offset > 0) { $myreturn .= '<li class="goto_first">'; $myreturn .= '<a href="' . $phpself . '?o=0&r=' . $results; if (!empty($qs)) { $myreturn .= '&' . $qs; } $myreturn .= '" title="' . (isset($lang_strings['goto_first']) ? $lang_strings['goto_first'] : 'Go to first page') . '"><<</a></li>'; $myreturn .= '<li class="goto_previous">'; $myreturn .= '<a href="' . $phpself . '?o=' . ($offset - $results > 0 ? $offset - $results : 0) . '&r=' . $results; if (!empty($qs)) { $myreturn .= '&' . $qs; } $myreturn .= '" title="' . (isset($lang_strings['goto_prev']) ? $lang_strings['goto_prev'] : 'Go to previous page') . '"><</a></li>'; } $dotsbefore = false; $dotsafter = false; $page_select_options = ''; for ($i = 1; $i <= $total_pages; ++$i) { if (($i - 1) * $results <= $offset && $offset < $i * $results) { $myreturn .= '<li class="current_page'; if ($i == 1) { $myreturn .= ' first'; } $myreturn .= '">' . $i . '</li>'; } elseif (($i - 1 + $radius) * $results < $offset) { if (!$dotsbefore) { $myreturn .= '<li class="dots'; if ($i == 1) { $myreturn .= ' first'; } $myreturn .= "\">...</li>\n"; $dotsbefore = true; } } elseif (($i - 1 - $radius) * $results > $offset) { if (!$dotsafter) { $myreturn .= "<li class=\"dots\">...</li>\n"; $dotsafter = true; } } else { $myreturn .= '<li'; if ($i == 1) { $myreturn .= ' class="first"'; } $myreturn .= '><a href="' . $phpself . '?o=' . ($i - 1) * $results . '&r=' . $results; if (!empty($qs)) { $myreturn .= '&' . $qs; } $myreturn .= '">' . $i . "</a></li>\n"; } $page_select_options .= '<option value="' . ($i - 1) * $results . '">' . $i . '</option>'; } if ($offset + $results < $totalrows) { $myreturn .= '<li class="goto_next"><a href="' . $phpself . '?o=' . ($offset + $results) . '&r=' . $results; if (!empty($qs)) { $myreturn .= '&' . $qs; } $myreturn .= '" title="' . (isset($lang_strings['goto_next']) ? $lang_strings['goto_next'] : 'Go to next page') . "\">></a></li>\n"; $myreturn .= '<li class="goto_last"><a href="' . $phpself . '?o=' . ($total_pages - 1) * $results . '&r=' . $results; if (!empty($qs)) { $myreturn .= '&' . $qs; } $myreturn .= '" title="' . (isset($lang_strings['goto_last']) ? $lang_strings['goto_last'] : 'Go to last page') . "\">>></a></li>\n"; } $myreturn .= "<li class=\"goto_page\">\n"; $myreturn .= "<select>\n"; $myreturn .= $page_select_options; $myreturn .= "</select>\n"; $myreturn .= "</li>\n"; $myreturn .= "<li class=\"rpp\">\n"; $myreturn .= "\t<input type=\"hidden\" name=\"o\" value=\"{$offset}\" />\n"; while (list($k, $v) = each($params)) { if (is_array($v)) { while (list($subk, $subv) = each($v)) { $myreturn .= "\t<input type=\"hidden\" name=\"{$k}[{$subk}]\" value=\"{$subv}\" />\n"; } } else { $myreturn .= "\t<input type=\"hidden\" name=\"{$k}\" value=\"{$v}\" />\n"; } } $myreturn .= "\t" . (isset($lang_strings['rpp']) ? $lang_strings['rpp'] : '') . "<select name=\"r\" onchange=\"\$('#pagerform{$myrand}').submit()\">\n"; $myreturn .= vector2options($accepted_results_per_page, $results); $myreturn .= "\t</select>\n"; $myreturn .= "</li>\n"; $myreturn .= "<li class=\"last\"></li>\n"; $myreturn .= "</ul>\n"; $myreturn .= "</form>\n"; return $myreturn; }
if (!empty($admin_accounts['change_pass'])) { $admin_accounts['change_pass'] = '******'; } } elseif (!empty($_GET['admin_id'])) { $admin_id = (int) $_GET['admin_id']; $query = "SELECT `admin_id`,`user`,`name`,`status`,`dept_id`,`email` FROM `{$dbtable_prefix}admin_accounts` WHERE `admin_id`={$admin_id}"; if (!($res = @mysql_query($query))) { trigger_error(mysql_error(), E_USER_ERROR); } if (mysql_num_rows($res)) { $admin_accounts = mysql_fetch_assoc($res); $admin_accounts['name'] = sanitize_and_format($admin_accounts['name'], TYPE_STRING, $__field2format[TEXT_DB2EDIT]); } } $admin_accounts['dept_id'] = vector2options($accepted_admin_depts, $admin_accounts['dept_id']); $admin_accounts['status'] = vector2options($accepted_astats, $admin_accounts['status'], array(ASTAT_UNVERIFIED)); if (empty($admin_accounts['admin_id'])) { $admin_accounts['change_pass'] = '******'; } $tpl->set_file('content', 'admin_accounts_addedit.html'); $tpl->set_var('admin_accounts', $admin_accounts); if (isset($_GET['o'])) { $tpl->set_var('o', $_GET['o']); } if (isset($_GET['r'])) { $tpl->set_var('r', $_GET['r']); } $tpl->process('content', 'content'); $tplvars['title'] = 'Admin Accounts'; $tplvars['page'] = 'admin_accounts_addedit'; include 'frame.php';
$output['has_photo'] = true; } if ($output['status'] == STAT_PENDING) { $output['pending'] = true; } elseif ($output['status'] == STAT_EDIT) { $output['need_edit'] = true; } elseif ($output['status'] == STAT_APPROVED) { $output['approved'] = true; } $query = "SELECT a.`email`,UNIX_TIMESTAMP(a.`last_activity`) as `last_activity`,a.`status`,a.`skin`,b.`m_name` as `membership` FROM `" . USER_ACCOUNTS_TABLE . "` a,`{$dbtable_prefix}memberships` b WHERE a.`membership`=b.`m_value` AND a.`" . USER_ACCOUNT_ID . "`={$uid}"; if (!($res = @mysql_query($query))) { trigger_error(mysql_error(), E_USER_ERROR); } $account = mysql_fetch_assoc($res); $account['last_activity'] = strftime($config['datetime_format'], $account['last_activity'] + $config['time_offset']); $account['status'] = vector2options($accepted_astats, $account['status']); $account['skin'] = dbtable2options("`{$dbtable_prefix}modules` a,`{$dbtable_prefix}site_options3` b", 'a.`module_code`', 'b.`config_value`', 'b.`config_value`', $account['skin'], "a.`module_code`=b.`fk_module_code` AND a.`module_type`=" . MODULE_SKIN . " AND b.`config_option`='skin_name'"); $query = "SELECT UNIX_TIMESTAMP(`paid_until`) as `paid_until` FROM `{$dbtable_prefix}payments` WHERE `fk_user_id`={$uid} AND `is_subscr`=1 AND `is_active`=1"; if (!($res = @mysql_query($query))) { trigger_error(mysql_error(), E_USER_ERROR); } if (mysql_num_rows($res)) { $account['paid_until'] = mysql_result($res, 0, 0); if ($account['paid_until'] == 0) { $account['paid_until'] = 'FOREVER'; } else { $account['paid_until'] = strftime($config['datetime_format'], $account['paid_until'] + $config['time_offset']); } } else { $account['paid_until'] = '-'; }
$query = "SELECT `folder_id`,`folder` FROM `{$dbtable_prefix}user_folders` WHERE `fk_user_id`='" . $_SESSION[_LICENSE_KEY_]['user']['user_id'] . "'"; if (!($res = @mysql_query($query))) { trigger_error(mysql_error(), E_USER_ERROR); } while ($rsrow = mysql_fetch_row($res)) { $my_folders[$rsrow[0]] = $rsrow[1]; } $output['fid'] = FOLDER_INBOX; if (!empty($_GET['fid']) && isset($my_folders[$_GET['fid']])) { $output['fid'] = (int) $_GET['fid']; } $moveto_folders = $my_folders; unset($moveto_folders[FOLDER_SPAMBOX]); unset($moveto_folders[FOLDER_OUTBOX]); unset($moveto_folders[$output['fid']]); $output['moveto_folders'] = vector2options($moveto_folders); $my_folders = sanitize_and_format($my_folders, TYPE_STRING, $__field2format[TEXT_DB2DISPLAY]); $mailbox_table = 'inbox'; $where = "a.`fk_user_id`='" . $_SESSION[_LICENSE_KEY_]['user']['user_id'] . "' AND a.`mail_id`=" . $output['mail_id']; switch ($output['fid']) { case FOLDER_INBOX: $tpl->set_var('spam_controls', true); break; case FOLDER_TRASH: break; case FOLDER_OUTBOX: $mailbox_table = 'outbox'; $tpl->set_var('is_outbox', true); break; case FOLDER_SPAMBOX: $mailbox_table = 'spambox';
require_once '../includes/admin_functions.inc.php'; require_once '../includes/tables/loc_countries.inc.php'; allow_dept(DEPT_ADMIN); $tpl = new phemplate('skin/', 'remove_nonjs'); $countries = $countries_default['defaults']; if (isset($_SESSION['topass']['input'])) { $countries = $_SESSION['topass']['input']; } elseif (!empty($_GET['country_id'])) { $country_id = (int) $_GET['country_id']; $query = "SELECT `country_id`,`country`,`iso3166`,`prefered_input` FROM `{$dbtable_prefix}loc_countries` WHERE `country_id`={$country_id}"; if (!($res = @mysql_query($query))) { trigger_error(mysql_error(), E_USER_ERROR); } if (mysql_num_rows($res)) { $countries = mysql_fetch_assoc($res); $countries['country'] = sanitize_and_format($countries['country'], TYPE_STRING, $__field2format[TEXT_DB2EDIT]); } } $countries['prefered_input'] = vector2options($country_prefered_input, $countries['prefered_input']); $tpl->set_file('content', 'loc_countries_addedit.html'); $tpl->set_var('countries', $countries); if (isset($_GET['o'])) { $tpl->set_var('o', $_GET['o']); } if (isset($_GET['r'])) { $tpl->set_var('r', $_GET['r']); } $tpl->process('content', 'content'); $tplvars['title'] = 'Location Management: Countries'; $tplvars['page'] = 'loc_countries_addedit'; include 'frame.php';
// $rsrow['subject']=sanitize_and_format($rsrow['subject'],TYPE_STRING,$__field2format[TEXT_DB2DISPLAY]); $rsrow['is_read'] = !empty($rsrow['is_read']) ? 'read' : 'not_read'; if ($rsrow['message_type'] == MESS_SYSTEM && empty($rsrow['user_other'])) { $rsrow['user_other'] = $GLOBALS['_lang'][135]; } $rsrow['message_type'] = $message_types[$rsrow['message_type']]; $loop[] = $rsrow; } $tpl->set_var('pager2', pager($totalrows, $o, $r)); } $return = 'mailbox.php'; if (!empty($_SERVER['QUERY_STRING'])) { $return .= '?' . $_SERVER['QUERY_STRING']; } $tpl->set_file('content', 'mailbox.html'); $tpl->set_loop('loop', $loop); $tpl->set_var('mailbox_name', $my_folders[$fid]); $tpl->set_var('fid', $fid); $tpl->set_var('folder_options', vector2options($moveto_folders)); $tpl->set_var('return', rawurlencode($return)); $tpl->process('content', 'content', TPL_LOOP | TPL_NOLOOP | TPL_OPTLOOP | TPL_OPTIONAL); $tpl->drop_loop('loop'); unset($loop); $tplvars['title'] = $my_folders[$fid]; $tplvars['page_title'] = $my_folders[$fid]; $tplvars['page'] = 'mailbox'; $tplvars['css'] = 'mailbox.css'; if (is_file('mailbox_left.php')) { include 'mailbox_left.php'; } include 'frame.php';