$memberships[] = $rsrow['m_value']; $cols[]['content'] = $rsrow['m_name']; } $rows[0]['cols'] = $cols; $query = "SELECT `level_diz`,`level` FROM `{$dbtable_prefix}access_levels` WHERE `level_code`<>'login'"; if (!($res = @mysql_query($query))) { trigger_error(mysql_error(), E_USER_ERROR); } $j = 1; while ($rsrow = mysql_fetch_assoc($res)) { $cols = array(); $rows[$j]['level_diz'] = $rsrow['level_diz']; for ($i = 0; isset($memberships[$i]); ++$i) { if ((int) $rsrow['level'] & (int) $memberships[$i]) { $cols[]['content'] = '<img src="' . $tplvars['tplrelpath'] . '/images/check.gif" />'; } else { $cols[]['content'] = ' '; } } $rows[$j]['cols'] = $cols; ++$j; } $tpl->set_file('content', 'plan-comparision-chart.html'); $tpl->set_loop('rows', $rows); $tpl->process('content', 'content', TPL_MULTILOOP); $tplvars['title'] = $GLOBALS['_lang'][245]; $tplvars['page_title'] = $GLOBALS['_lang'][245]; $tplvars['page'] = 'plan'; $tplvars['css'] = 'plan-comparision-chart.css'; $no_timeout = true; include 'frame.php';
if (!($res = @mysql_query($query))) { trigger_error(mysql_error(), E_USER_ERROR); } while ($rsrow = mysql_fetch_assoc($res)) { $rsrow['currency'] = isset($accepted_currencies[$rsrow['currency']]) ? $accepted_currencies[$rsrow['currency']] : ''; $rsrow['subscr_name'] = sanitize_and_format($rsrow['subscr_name'], TYPE_STRING, $__field2format[TEXT_DB2DISPLAY]); if (!empty($rsrow['is_recurent'])) { $rsrow['is_recurent'] = '<img src="skin/images/refresh.gif" title="Recuring" />'; } else { unset($rsrow['is_recurent']); } if (!empty($rsrow['is_visible'])) { $rsrow['is_visible'] = '<img src="skin/images/check.gif" />'; } else { unset($rsrow['is_visible']); } if (empty($rsrow['duration'])) { $rsrow['duration'] = 'Lifetime'; } else { $rsrow['duration'] .= ' days'; } $subscriptions[] = $rsrow; } } $tpl->set_file('content', 'subscriptions.html'); $tpl->set_loop('subscriptions', $subscriptions); $tpl->process('content', 'content', TPL_LOOP | TPL_NOLOOP); $tpl->drop_loop('subscriptions'); $tplvars['title'] = 'Site Subscriptions'; $tplvars['page'] = 'subscriptions'; include 'frame.php';
} $loop_rows[0]['class'] = 'first'; if (empty($rows)) { $loop_rows[0]['class'] .= ' last'; } else { $loop_rows[count($loop_rows) - 1]['class'] = 'last'; } $output['pager2'] = pager($totalrows, $o, $r); } $output['return2me'] = 'my_photos.php'; if (!empty($_SERVER['QUERY_STRING'])) { $output['return2me'] .= '?' . $_SERVER['QUERY_STRING']; } $output['return2me'] = rawurlencode($output['return2me']); $tpl->set_file('content', 'my_photos.html'); $tpl->set_loop('loop_rows', $loop_rows); $tpl->set_var('output', $output); $tpl->process('content', 'content', TPL_MULTILOOP | TPL_OPTLOOP | TPL_OPTIONAL | TPL_NOLOOP); $tpl->drop_loop('loop_rows'); unset($loop_rows); $tpl->drop_var('output.pager2'); $tplvars['title'] = $GLOBALS['_lang'][140]; $tplvars['page_title'] = $GLOBALS['_lang'][140]; $tplvars['page'] = 'my_photos'; $tplvars['css'] = 'my_photos.css'; if (is_file('my_photos_left.php')) { include 'my_photos_left.php'; } unset($page_last_modified_time); // we want everything fresh on this page. include 'frame.php';
trigger_error(mysql_error(), E_USER_ERROR); } $i = 0; $access_levels = array(); while ($rsrow = mysql_fetch_assoc($res)) { $rsrow['level_code'] = sanitize_and_format($rsrow['level_code'], TYPE_STRING, $__field2format[TEXT_DB2DISPLAY]); $rsrow['level_diz'] = sanitize_and_format($rsrow['level_diz'], TYPE_STRING, $__field2format[TEXT_DB2DISPLAY]); $access_levels[$i]['row'] = '<td><a href="access_levels_addedit.php?level_id=' . $rsrow['level_id'] . '" title="' . $rsrow['level_diz'] . '">' . $rsrow['level_code'] . "</a></td>\n"; for ($j = 0; isset($memberships[$j]); ++$j) { $access_levels[$i]['row'] .= '<td><input type="checkbox" name="levels[' . $rsrow['level_id'] . '][' . $memberships[$j]['m_value'] . ']" value="1"'; if ((int) $memberships[$j]['m_value'] & (int) $rsrow['level']) { $access_levels[$i]['row'] .= ' checked="checked"'; } if ((int) $memberships[$j]['m_value'] & (int) $rsrow['disabled_level']) { $access_levels[$i]['row'] .= ' disabled="disabled"'; } $access_levels[$i]['row'] .= " /></td>\n"; } ++$i; } $tpl->set_file('content', 'access_levels.html'); $tpl->set_loop('access_levels', $access_levels); $tpl->set_loop('memberships', $memberships); $tpl->process('content', 'content', TPL_LOOP | TPL_NOLOOP); $tpl->drop_loop('access_levels'); $tpl->drop_loop('memberships'); unset($access_levels); unset($memberships); $tplvars['title'] = 'Define access levels'; $tplvars['page'] = 'access_levels'; include 'frame.php';
} $output['ips'] = join(', ', $output['ips']); } $output['pic_width'] = get_site_option('pic_width', 'core_photo'); if (empty($output['search_md5'])) { unset($output['search_md5']); } if (isset($_GET['o'])) { $output['o'] = $_GET['o']; } if (isset($_GET['r'])) { $output['r'] = $_GET['r']; } $output['return2me'] = 'profile.php'; if (!empty($_SERVER['QUERY_STRING'])) { $output['return2me'] .= '?' . $_SERVER['QUERY_STRING']; } $output['return2me'] = rawurlencode($output['return2me']); if (isset($_GET['return'])) { $output['return2'] = sanitize_and_format($_GET['return'], TYPE_STRING, $__field2format[FIELD_TEXTFIELD]); } $tpl->set_file('content', 'profile.html'); $tpl->set_loop('categs', $categs); $tpl->set_var('output', $output); $tpl->set_var('account', $account); $tpl->process('content', 'content', TPL_MULTILOOP | TPL_OPTIONAL); $tpl->drop_loop('categs'); $tplvars['title'] = sprintf('%1$s Member Profile', $output['_user']); $tplvars['css'] = 'profile.css'; $tplvars['page'] = 'profile'; include 'frame.php';
<?php include 'tplutil.inc'; include 'phemplate.class.php'; $tpl = new phemplate('slides/pragmatic/'); $tpl->set_var('TITLE', 'My Title'); $tpl->set_var('USER', get_user()); $tpl->set_loop('OPTIONS', get_users(true)); $tpl->set_file('main', 'phemplate.tpl'); echo $tpl->process('out', 'main', 1);
} else { $topass['message']['type'] = MESSAGE_ERROR; $topass['message']['text'] = $GLOBALS['_lang'][6]; redirect2page('info.php', $topass); } $output['lang_256'] = sanitize_and_format($GLOBALS['_lang'][256], TYPE_STRING, $__field2format[TEXT_DB2DISPLAY]); $output['return2me'] = 'photo_view.php'; if (!empty($_SERVER['QUERY_STRING'])) { $output['return2me'] .= '?' . $_SERVER['QUERY_STRING']; } $output['return2me'] = rawurlencode($output['return2me']); $output['return2'] = sanitize_and_format_gpc($_GET, 'return', TYPE_STRING, $__field2format[FIELD_TEXTFIELD], ''); $output['return'] = rawurlencode($output['return2']); $tpl->set_file('content', 'photo_view.html'); $tpl->set_var('output', $output); $tpl->set_loop('loop_comments', $loop_comments); $tpl->set_var('tplvars', $tplvars); $tpl->process('content', 'content', TPL_LOOP | TPL_OPTLOOP | TPL_OPTIONAL); $tpl->drop_loop('loop_comments'); unset($loop_comments); $tplvars['title'] = sprintf($GLOBALS['_lang'][143], $output['user']); $tplvars['page_title'] = sprintf($GLOBALS['_lang'][143], '<a href="' . $tplvars['relative_url'] . 'photo_search.php?st=user&uid=' . $output['fk_user_id'] . '">' . $output['user'] . '</a>'); $tplvars['page'] = 'photo_view'; $tplvars['css'] = 'photo_view.css'; if (is_file('photo_view_left.php')) { include 'photo_view_left.php'; } include 'frame.php'; if (!empty($photo_id) && isset($output['fk_user_id']) && (!empty($_SESSION[_LICENSE_KEY_]['user']['user_id']) && $output['fk_user_id'] != $_SESSION[_LICENSE_KEY_]['user']['user_id'] || empty($_SESSION[_LICENSE_KEY_]['user']['user_id']))) { $query = "UPDATE `{$dbtable_prefix}user_photos` SET `stat_views`=`stat_views`+1 WHERE `photo_id`={$photo_id}"; @mysql_query($query);
if (empty($temp) && function_exists('popen')) { $fp = @popen('which php', 'r'); if ($fp) { $temp = fgets($fp); if (!empty($temp) && $temp[0] == '/') { $_SESSION['install']['phpbin'] = trim($temp); $_SESSION['install']['exec'] = 'popen'; } @pclose($fp); $fp = @popen('which mysql', 'r'); $temp = fgets($fp); if (!empty($temp) && $temp[0] == '/') { $_SESSION['install']['mysqlbin'] = trim($temp); $_SESSION['install']['exec'] = 'popen'; } @pclose($fp); } } if (!$error) { $output['continue'] = true; } $output['rand'] = mt_rand(1, 10000); $tplvars = array(); $tplvars['page_title'] = 'Etano Install Process'; $tplvars['css'] = 'index.css'; $tplvars['page'] = 'index'; $tpl->set_var('output', $output); $tpl->set_var('tplvars', $tplvars); $tpl->set_loop('rw_files', $rw_files); $tpl->process('content', 'content', TPL_OPTIONAL | TPL_LOOP); include 'frame.php';
$o = $totalrows - $r; $o = $o >= 0 ? $o : 0; } $query = "SELECT `state_id`,`state`,`num_cities` FROM {$from} WHERE {$where} ORDER BY `state` ASC LIMIT {$o},{$r}"; if (!($res = @mysql_query($query))) { trigger_error(mysql_error(), E_USER_ERROR); } $i = 0; while ($rsrow = mysql_fetch_assoc($res)) { $rsrow['state'] = sanitize_and_format($rsrow['state'], TYPE_STRING, $__field2format[TEXT_DB2DISPLAY]); $rsrow['myclass'] = $i % 2 ? 'odd_item' : 'even_item'; $states[] = $rsrow; ++$i; } $tpl->set_var('pager1', pager($totalrows, $o, $r)); $tpl->set_var('pager2', pager($totalrows, $o, $r)); } } $tpl->set_file('content', 'loc_states.html'); $tpl->set_loop('states', $states); $tpl->set_var('country_id', $country_id); $tpl->set_var('country', $country); $tpl->set_var('o', $o); $tpl->set_var('r', $r); $tpl->set_var('co', $co); $tpl->set_var('cr', $cr); $tpl->process('content', 'content', TPL_LOOP | TPL_NOLOOP); $tpl->drop_loop('states'); $tplvars['title'] = 'Location Management: States'; $tplvars['page'] = 'loc_states'; include 'frame.php';
function regenerate_skin_cache($skin_module_code = '', $last_id = 0) { $timeout = 120; require _BASEPATH_ . '/includes/classes/Cache/Lite.php'; $cache = new Cache_Lite($GLOBALS['_cache_config']); global $dbtable_prefix, $_pfields, $_pcats, $__field2format; $tpl = new phemplate(_BASEPATH_ . '/skins_site/', 'remove_nonjs'); if (empty($skin_module_code)) { $query = "SELECT b.`config_value` as `skin_dir` FROM `{$dbtable_prefix}modules` a,`{$dbtable_prefix}site_options3` b WHERE a.`module_type`=" . MODULE_SKIN . " AND a.`module_code`=b.`fk_module_code` AND b.`config_option`='skin_dir'"; } else { $query = "SELECT `config_value` as `skin_dir` FROM `{$dbtable_prefix}site_options3` WHERE `config_option`='skin_dir' AND `fk_module_code`='{$skin_module_code}'"; } if (!($res = @mysql_query($query))) { trigger_error(mysql_error(), E_USER_ERROR); } for ($i = 0; $i < mysql_num_rows($res); ++$i) { $skins[] = mysql_result($res, $i, 0); } $now = gmdate('YmdHis'); $select = '`fk_user_id`,`status`,`del`,UNIX_TIMESTAMP(`last_changed`) as `last_changed`,UNIX_TIMESTAMP(`date_added`) as `date_added`,`_user`,`_photo`,`rad_longitude`,`rad_latitude`'; $used_fields = array(); foreach ($_pfields as $field_id => $field) { if ($field->config['visible']) { $select .= ',' . $field->query_select(); $used_fields[] = $field_id; } } // create the cache in every skin for ($s = 0; isset($skins[$s]); ++$s) { $GLOBALS['_lang'] = array(); $GLOBALS['_pfields'] = array(); $GLOBALS['_pcats'] = array(); include _BASEPATH_ . '/skins_site/' . $skins[$s] . '/lang/global.inc.php'; include _BASEPATH_ . '/includes/fields.inc.php'; $query = "SELECT {$select} FROM `{$dbtable_prefix}user_profiles` WHERE `status`=" . STAT_APPROVED; if (!empty($last_id)) { $query .= " AND `fk_user_id`>{$last_id}"; } $query .= " ORDER BY `fk_user_id`"; if (!($res = @mysql_query($query))) { trigger_error(mysql_error(), E_USER_ERROR); } $start_time = (int) time(); while ($profile = mysql_fetch_assoc($res)) { for ($i = 0; isset($used_fields[$i]); ++$i) { $field =& $_pfields[$used_fields[$i]]; $field->set_value($profile, false); $profile[$field->config['dbfield']] = $field->display(); // the label should be set after the call to display(). See field_birthdate::display() for explanation. $profile[$field->config['dbfield'] . '_label'] = $field->config['label']; } if (empty($profile['_photo']) || !is_file(_PHOTOPATH_ . '/t1/' . $profile['_photo']) || !is_file(_PHOTOPATH_ . '/t2/' . $profile['_photo']) || !is_file(_PHOTOPATH_ . '/' . $profile['_photo'])) { $profile['_photo'] = 'no_photo.gif'; } else { $profile['has_photo'] = true; } $tpl->set_var('profile', $profile); // generate the user details for result lists $tpl->set_file('temp', $skins[$s] . '/static/result_user.html'); $towrite = $tpl->process('', 'temp', TPL_OPTIONAL); $cache->save($towrite, 'skin' . $skins[$s] . $profile['fk_user_id'] . 'result_user'); // generate the categories to be used on profile.php page $categs = array(); $tpl->set_file('temp', $skins[$s] . '/static/profile_categ.html'); foreach ($_pcats as $pcat_id => $pcat) { $fields = array(); $j = 0; for ($k = 0; isset($pcat['fields'][$k]); ++$k) { if (in_array($pcat['fields'][$k], $used_fields) && !empty($profile[$_pfields[$pcat['fields'][$k]]->config['dbfield']])) { $fields[$j]['label'] = $profile[$_pfields[$pcat['fields'][$k]]->config['dbfield'] . '_label']; $fields[$j]['field'] = $profile[$_pfields[$pcat['fields'][$k]]->config['dbfield']]; $fields[$j]['dbfield'] = $_pfields[$pcat['fields'][$k]]->config['dbfield']; ++$j; } } $categs['pcat_name'] = $pcat['pcat_name']; $categs['pcat_id'] = $pcat_id; $tpl->set_loop('fields', $fields); $tpl->set_var('categs', $categs); $towrite = $tpl->process('', 'temp', TPL_LOOP); $cache->save($towrite, 'skin' . $skins[$s] . $profile['fk_user_id'] . 'pcat' . $pcat_id); $tpl->drop_loop('fields'); $tpl->drop_var('categs'); } $tpl->drop_var('profile'); if ((int) time() - $start_time > $timeout) { echo 'To prevent timeouts this script interrupts every few minutes. Press the continue button to resume.<br />'; echo 'Last user ID processed: ', $profile['fk_user_id'], '<br />'; echo '<form action="regenerate_skin.php" method="get">'; echo '<input type="hidden" name="last_id" value="', $profile['fk_user_id'], '" />'; if (!empty($skin_module_code)) { echo '<input type="hidden" name="s" value="', $skin_module_code, '" />'; } echo '<input type="submit" value="Continue" />'; echo '</form>'; die; } } } }
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); $tpl->process('content', 'content', TPL_MULTILOOP); $tplvars['title'] = 'Site Options'; $tplvars['css'] = 'site_options.css'; $tplvars['page'] = 'site_options'; include 'frame.php';
function gen_user_cache() { global $dbtable_prefix, $_pfields, $_pcats; $dirname = dirname(__FILE__); $temp = array(); if ($dirname[0] == '/') { // unixes here $temp = explode('/', $dirname); } else { // windows here $temp = explode('\\', $dirname); } $interval = (int) $temp[count($temp) - 1]; // that's how often we're executed ;) $tpl = new phemplate(_BASEPATH_ . '/skins_site/', 'remove_nonjs'); $query = "SELECT a.`config_value` FROM `{$dbtable_prefix}site_options3` a,`{$dbtable_prefix}modules` b WHERE a.`config_option`='skin_dir' AND a.`fk_module_code`=b.`module_code` AND b.`module_type`=" . MODULE_SKIN; if (!($res = @mysql_query($query))) { trigger_error(mysql_error(), E_USER_ERROR); } $skins = array(); for ($i = 0; $i < mysql_num_rows($res); ++$i) { $skins[] = mysql_result($res, $i, 0); } require _BASEPATH_ . '/includes/classes/Cache/Lite.php'; $cache = new Cache_Lite($GLOBALS['_cache_config']); $now = gmdate('YmdHis'); $select = '`fk_user_id`,`status`,`del`,UNIX_TIMESTAMP(`last_changed`) as `last_changed`,UNIX_TIMESTAMP(`date_added`) as `date_added`,`_user`,`_photo`,`rad_longitude`,`rad_latitude`'; $used_fields = array(); foreach ($_pfields as $field_id => $field) { if ($field->config['visible']) { $select .= ',' . $field->query_select(); $used_fields[] = $field_id; } } // create the cache in every skin for ($s = 0; isset($skins[$s]); ++$s) { $GLOBALS['_lang'] = array(); $GLOBALS['_pfields'] = array(); $GLOBALS['_pcats'] = array(); include _BASEPATH_ . '/skins_site/' . $skins[$s] . '/lang/global.inc.php'; include _BASEPATH_ . '/includes/fields.inc.php'; $query = "SELECT {$select} FROM `{$dbtable_prefix}user_profiles` WHERE `status`=" . STAT_APPROVED . " AND `last_changed`>=DATE_SUB('{$now}',INTERVAL " . ($interval + 2) . " MINUTE)"; //print $query; if (!($res = @mysql_query($query))) { trigger_error(mysql_error(), E_USER_ERROR); } while ($profile = mysql_fetch_assoc($res)) { for ($i = 0; isset($used_fields[$i]); ++$i) { $field =& $_pfields[$used_fields[$i]]; $field->set_value($profile, false); $profile[$field->config['dbfield']] = $field->display(); // the label should be set after the call to display(). See field_birthdate::display() for explanation. $profile[$field->config['dbfield'] . '_label'] = $field->config['label']; /* } elseif ($field['field_type']==FIELD_INT || $field['field_type']==FIELD_FLOAT) { // $profile[$field['dbfield']]=$profile[$field['dbfield']]; */ } if (empty($profile['_photo']) || !is_file(_PHOTOPATH_ . '/t1/' . $profile['_photo']) || !is_file(_PHOTOPATH_ . '/t2/' . $profile['_photo']) || !is_file(_PHOTOPATH_ . '/' . $profile['_photo'])) { $profile['_photo'] = 'no_photo.gif'; } else { $profile['has_photo'] = true; } $tpl->set_var('profile', $profile); // generate the user details for result lists $tpl->set_file('temp', $skins[$s] . '/static/result_user.html'); $towrite = $tpl->process('', 'temp', TPL_OPTIONAL); $cache->save($towrite, 'skin' . $skins[$s] . $profile['fk_user_id'] . 'result_user'); // generate the categories to be used on profile.php page $categs = array(); $tpl->set_file('temp', $skins[$s] . '/static/profile_categ.html'); foreach ($_pcats as $pcat_id => $pcat) { $fields = array(); $j = 0; for ($k = 0; isset($pcat['fields'][$k]); ++$k) { if (in_array($pcat['fields'][$k], $used_fields) && !empty($profile[$_pfields[$pcat['fields'][$k]]->config['dbfield']])) { $fields[$j]['label'] = $profile[$_pfields[$pcat['fields'][$k]]->config['dbfield'] . '_label']; $fields[$j]['field'] = $profile[$_pfields[$pcat['fields'][$k]]->config['dbfield']]; $fields[$j]['dbfield'] = $_pfields[$pcat['fields'][$k]]->config['dbfield']; ++$j; } } $categs['pcat_name'] = $pcat['pcat_name']; $categs['pcat_id'] = $pcat_id; $tpl->set_loop('fields', $fields); $tpl->set_var('categs', $categs); $towrite = $tpl->process('', 'temp', TPL_LOOP); $cache->save($towrite, 'skin' . $skins[$s] . $profile['fk_user_id'] . 'pcat' . $pcat_id); $tpl->drop_loop('fields'); $tpl->drop_var('categs'); } $tpl->drop_var('profile'); } } return true; }
if ($relevant_install) { $not_installed[$m]['text'] = $p->install[$j]['text']; $relevant_install = false; } } if ($install_req_satisfied) { $not_installed[$m]['valid'] = true; $not_installed[$m]['reasons'] = 'All satisfied.'; } else { for ($n = 0; isset($reasons[$n]); ++$n) { $reasons[$n] = join(', ', $reasons[$n]); } $not_installed[$m]['reasons'] = '<strong>' . join('</strong> OR <strong>', $reasons) . '</strong>'; } $not_installed[$m]['module_name'] = $p->module_name; $not_installed[$m]['module_type'] = $accepted_module_types[$p->module_type]; $not_installed[$m]['version'] = $p->version; $not_installed[$m]['filename'] = rawurlencode($filenames[$i]); ++$m; } } $output['bu'] = base64_encode(_BASEURL_); $tpl->set_file('content', 'packages.html'); $tpl->set_loop('installed', $installed); $tpl->set_loop('not_installed', $not_installed); $tpl->set_var('output', $output); $tpl->process('content', 'content', TPL_LOOP | TPL_OPTIONAL | TPL_OPTLOOP); $tplvars['title'] = 'Package manager'; $tplvars['page'] = 'packages'; $tplvars['css'] = 'packages.css'; include 'frame.php';
if (!empty($totalrows)) { if ($o >= $totalrows) { $o = $totalrows - $r; $o = $o >= 0 ? $o : 0; } $query = "SELECT * FROM {$from} WHERE {$where} ORDER BY `admin_id` ASC LIMIT {$o},{$r}"; if (!($res = @mysql_query($query))) { trigger_error(mysql_error(), E_USER_ERROR); } $i = 0; while ($rsrow = mysql_fetch_assoc($res)) { $rsrow['name'] = sanitize_and_format($rsrow['name'], TYPE_STRING, $__field2format[TEXT_DB2DISPLAY]); $rsrow['status'] = $accepted_astats[$rsrow['status']]; $rsrow['dept_id'] = $accepted_admin_depts[$rsrow['dept_id']]; $rsrow['myclass'] = $i % 2 ? 'odd_item' : 'even_item'; $admin_accounts[] = $rsrow; ++$i; } $tpl->set_var('pager1', pager($totalrows, $o, $r)); $tpl->set_var('pager2', pager($totalrows, $o, $r)); } $tpl->set_file('content', 'admin_accounts.html'); $tpl->set_loop('admin_accounts', $admin_accounts); $tpl->set_var('o', $o); $tpl->set_var('r', $r); $tpl->process('content', 'content', TPL_LOOP | TPL_NOLOOP); $tpl->drop_loop('admin_accounts'); unset($admin_accounts); $tplvars['title'] = 'Admin Accounts'; $tplvars['page'] = 'admin_accounts'; include 'frame.php';
if ($i >= 0) { $site_skins[$i] = sanitize_and_format($site_skins[$i], TYPE_STRING, $__field2format[TEXT_DB2DISPLAY]); if (!empty($site_skins[$i]['is_default'])) { $site_skins[$i]['is_default'] = '<img src="skin/images/check.gif" />'; } else { unset($site_skins[$i]['is_default']); } } ++$i; $site_skins[$i]['module_code'] = $rsrow['module_code']; $site_skins[$i]['skin_name'] = $rsrow['module_name'] . ' ' . $rsrow['version']; $last_code = $rsrow['module_code']; } $site_skins[$i][$rsrow['config_option']] = $rsrow['config_value']; } // one more time for the last row if ($i >= 0) { $site_skins[$i] = sanitize_and_format($site_skins[$i], TYPE_STRING, $__field2format[TEXT_DB2DISPLAY]); if (!empty($site_skins[$i]['is_default'])) { $site_skins[$i]['is_default'] = '<img src="skin/images/check.gif" />'; } else { unset($site_skins[$i]['is_default']); } } $tpl->set_file('content', 'site_skins.html'); $tpl->set_loop('site_skins', $site_skins); $tpl->process('content', 'content', TPL_LOOP | TPL_NOLOOP | TPL_OPTLOOP); $tpl->drop_loop('site_skins'); $tplvars['title'] = 'Skin Settings'; $tplvars['page'] = 'site_skins'; include 'frame.php';
$query = "SELECT `zip_id`,`zipcode`,`latitude`,`longitude` FROM {$from} WHERE {$where} ORDER BY `zipcode` ASC LIMIT {$o},{$r}"; if (!($res = @mysql_query($query))) { trigger_error(mysql_error(), E_USER_ERROR); } $i = 0; while ($rsrow = mysql_fetch_assoc($res)) { $rsrow['myclass'] = $i % 2 ? 'odd_item' : 'even_item'; $zipcodes[] = $rsrow; ++$i; } $tpl->set_var('pager1', pager($totalrows, $o, $r)); $tpl->set_var('pager2', pager($totalrows, $o, $r)); } } $tpl->set_file('content', 'loc_zipcodes.html'); $tpl->set_loop('zipcodes', $zipcodes); $tpl->set_var('city_id', $city_id); $tpl->set_var('city', $city); $tpl->set_var('state_id', $state_id); $tpl->set_var('state', $state); $tpl->set_var('country_id', $country_id); $tpl->set_var('country', $country); $tpl->set_var('o', $o); $tpl->set_var('r', $r); $tpl->set_var('cio', $cio); $tpl->set_var('cir', $cir); $tpl->set_var('so', $so); $tpl->set_var('sr', $sr); $tpl->set_var('co', $co); $tpl->set_var('cr', $cr); $tpl->process('content', 'content', TPL_LOOP | TPL_NOLOOP);
$networks = array(); $i = 0; while ($rsrow = mysql_fetch_assoc($res)) { $rsrow['network'] = sanitize_and_format($rsrow['network'], TYPE_STRING, $__field2format[TEXT_DB2DISPLAY]); $net_members = get_network_members($_SESSION[_LICENSE_KEY_]['user']['user_id'], $rsrow['net_id'], 4); if (!empty($net_members)) { $rsrow['members'] = $user_cache->get_cache_tpl($net_members, 'result_user'); } if (!empty($rsrow['members'])) { $rsrow['see_all'] = true; $networks[] = $rsrow; } } $output = array(); $output['user_id'] = $_SESSION[_LICENSE_KEY_]['user']['user_id']; $tpl->set_file('content', 'my_networks.html'); $tpl->set_var('output', $output); $tpl->set_loop('networks', $networks); $tpl->process('content', 'content', TPL_MULTILOOP | TPL_OPTLOOP | TPL_NOLOOP); $tpl->drop_loop('networks'); unset($networks); $tplvars['title'] = $GLOBALS['_lang'][240]; $tplvars['page_title'] = $GLOBALS['_lang'][240]; $tplvars['page'] = 'my_networks'; $tplvars['css'] = 'my_networks.css'; if (is_file('my_networks_left.php')) { include 'my_networks_left.php'; } unset($page_last_modified_time); // we want everything fresh on this page. include 'frame.php';
File: admin/rate_limiter.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'; require_once '../includes/logs.inc.php'; allow_dept(DEPT_ADMIN); $tpl = new phemplate('skin/', 'remove_nonjs'); $tpl->set_file('content', 'rate_limiter.html'); $query = "SELECT a.*,b.`m_name` FROM `{$dbtable_prefix}rate_limiter` a,`{$dbtable_prefix}memberships` b WHERE a.`m_value`=b.`m_value`"; if (!($res = @mysql_query($query))) { trigger_error(mysql_error(), E_USER_ERROR); } $i = 0; $rate_limiter = array(); while ($rsrow = mysql_fetch_assoc($res)) { $rsrow['punishment'] = isset($accepted_punishments[$rsrow['punishment']]) ? $accepted_punishments[$rsrow['punishment']] : '?'; $rate_limiter[] = $rsrow; } $rate_limiter = sanitize_and_format($rate_limiter, TYPE_STRING, $__field2format[TEXT_DB2DISPLAY]); $tpl->set_loop('rate_limiter', $rate_limiter); $tpl->process('content', 'content', TPL_LOOP | TPL_NOLOOP); $tpl->drop_loop('rate_limiter'); $tplvars['title'] = 'Rate Limiter'; $tplvars['page'] = 'rate_limiter'; include 'frame.php';
$totalrows = mysql_result($res, 0, 0); $countries = array(); if (!empty($totalrows)) { if ($o >= $totalrows) { $o = $totalrows - $r; $o = $o >= 0 ? $o : 0; } $query = "SELECT * FROM {$from} WHERE {$where} ORDER BY `country` ASC LIMIT {$o},{$r}"; if (!($res = @mysql_query($query))) { trigger_error(mysql_error(), E_USER_ERROR); } $i = 0; while ($rsrow = mysql_fetch_assoc($res)) { $rsrow['country'] = sanitize_and_format($rsrow['country'], TYPE_STRING, $__field2format[TEXT_DB2DISPLAY]); $rsrow['prefered_input'] = $country_prefered_input[$rsrow['prefered_input']]; $rsrow['myclass'] = $i % 2 ? 'odd_item' : 'even_item'; $countries[] = $rsrow; ++$i; } $tpl->set_var('pager1', pager($totalrows, $o, $r)); $tpl->set_var('pager2', pager($totalrows, $o, $r)); } $tpl->set_file('content', 'loc_countries.html'); $tpl->set_loop('countries', $countries); $tpl->set_var('o', $o); $tpl->set_var('r', $r); $tpl->process('content', 'content', TPL_LOOP | TPL_NOLOOP); $tpl->drop_loop('countries'); $tplvars['title'] = 'Location Management: Countries'; $tplvars['page'] = 'loc_countries'; include 'frame.php';
if (!($res = @mysql_query($query))) { trigger_error(mysql_error(), E_USER_ERROR); } $lang_strings = array(); $skins = array(); while ($rsrow = mysql_fetch_assoc($res)) { $lang_strings[] = $rsrow; $skins[] = $rsrow['skin']; } // for the rest of skins having no translation for this lk, just set the translation to '' $query = "SELECT a.`module_code` as `skin`,b.`config_value` as `skin_name` FROM `{$dbtable_prefix}modules` a,`{$dbtable_prefix}site_options3` b WHERE a.`module_type`=" . MODULE_SKIN . " AND a.`module_code`=b.`fk_module_code` AND b.`config_option`='skin_name'"; if (!($res = @mysql_query($query))) { trigger_error(mysql_error(), E_USER_ERROR); } while ($rsrow = mysql_fetch_assoc($res)) { if (!in_array($rsrow['skin'], $skins)) { $lang_strings[] = $rsrow; } } } $lang_strings = sanitize_and_format($lang_strings, TYPE_STRING, $__field2format[TEXT_DB2EDIT]); $tpl->set_file('content', 'popup_lang_string.html'); $tpl->set_var('lk_id', $lk_id); $tpl->set_loop('lang_strings', $lang_strings); $message = isset($message) ? $message : (isset($topass['message']) ? $topass['message'] : (isset($_SESSION['topass']['message']) ? $_SESSION['topass']['message'] : array())); if (!empty($message)) { $tpl->set_var('message', $message['text']); $tpl->set_var('message_class', $message['type'] == MESSAGE_ERROR ? 'message_error_small' : ($message['type'] == MESSAGE_INFO ? 'message_info_small' : 'message_info_small')); } echo $tpl->process('', 'content', TPL_FINISH | TPL_LOOP | TPL_OPTIONAL); unset($_SESSION['topass']);
/****************************************************************************** Etano =============================================================================== File: index.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. * ******************************************************************************/ //define('CACHE_LIMITER','private'); require 'includes/common.inc.php'; require _BASEPATH_ . '/includes/user_functions.inc.php'; check_login_member('all'); $tpl = new phemplate(_BASEPATH_ . '/skins_site/' . get_my_skin() . '/', 'remove_nonjs'); $tpl->set_file('content', 'index.html'); sort($basic_search_fields, SORT_NUMERIC); $search_loop = create_search_form($basic_search_fields); $tplvars['title'] = $tplvars['sitename']; $tpl->set_loop('search', $search_loop); $tpl->set_var('tplvars', $tplvars); $tpl->process('content', 'content', TPL_OPTIONAL | TPL_LOOP); if (!empty($GLOBALS['page_last_modified_time'])) { // header('Expires: '. gmdate('D,d M Y H:i:s',time()+1209600).' GMT',true); // +14 days // header('Expires: -1',true); header('Cache-Control: private, max-age=0', true); header('Last-Modified: ' . date('D,d M Y H:i:s', $GLOBALS['page_last_modified_time']) . ' GMT', true); } echo $tpl->process('content', 'content', TPL_FINISH | TPL_INCLUDE);
} $totalrows = mysql_result($res, 0, 0); $date_format = get_site_option('date_format', 'def_user_prefs'); $subscriptions_auto = array(); if (!empty($totalrows)) { // create the $pfields helper array for easier access to fields by dbfield $pfields = array(); foreach ($_pfields as $pfield_id => $pfield) { if (get_class($pfield) == 'field_select') { $pfields[$pfield->config['dbfield']]['label'] = $pfield->config['label']; $pfields[$pfield->config['dbfield']]['accepted_values'] = $pfield->config['accepted_values']; } } $query = "SELECT a.*,UNIX_TIMESTAMP(a.`date_start`) as `date_start`,b.`subscr_name` FROM {$from} WHERE {$where} ORDER BY a.`asubscr_id`"; if (!($res = @mysql_query($query))) { trigger_error(mysql_error(), E_USER_ERROR); } while ($rsrow = mysql_fetch_assoc($res)) { $rsrow['dbfield'] = empty($rsrow['dbfield']) ? 'All' : 'Having ' . $pfields[$rsrow['dbfield']]['label'] . '(' . $rsrow['dbfield'] . ') = ' . $pfields[$rsrow['dbfield']]['accepted_values'][$rsrow['field_value']]; $rsrow['subscr_name'] = sanitize_and_format($rsrow['subscr_name'], TYPE_STRING, $__field2format[TEXT_DB2DISPLAY]); $rsrow['date_start'] = empty($rsrow['date_start']) ? 'Join' : strftime($date_format, $rsrow['date_start']); $subscriptions_auto[] = $rsrow; } } $tpl->set_file('content', 'subscriptions_auto.html'); $tpl->set_loop('subscriptions_auto', $subscriptions_auto); $tpl->process('content', 'content', TPL_LOOP | TPL_NOLOOP); $tpl->drop_loop('subscriptions_auto'); $tplvars['title'] = 'Site Auto Subscriptions'; $tplvars['page'] = 'subscriptions_auto'; include 'frame.php';
} } } else { $error = true; $topass['message']['type'] = MESSAGE_ERROR; $topass['message']['text'] = 'Error reading the package'; } } else { $error = true; $topass['message']['type'] = MESSAGE_ERROR; $topass['message']['text'] = 'File is not a valid Etano package'; } } if (isset($p) && $p->error && !empty($p->manual_actions)) { $tpl->set_file('content', 'package_install.html'); $tpl->set_loop('manual_actions', $p->manual_actions); $output['f'] = $file; $output['finish'] = $install_index; $output['show_finish'] = $show_finish; $tpl->set_var('output', $output); $tpl->process('content', 'content', TPL_LOOP | TPL_OPTIONAL); $tplvars['title'] = 'Package Manager'; $tplvars['page'] = 'package_install'; $tplvars['css'] = 'package_install.css'; include 'frame.php'; } elseif ($ui_request) { $tpl->set_file('content', 'package_ui.html'); $tpl->set_var('output', $p->ui); $tpl->process('content', 'content'); $tplvars['title'] = 'Package Manager'; $tplvars['page'] = 'package_install';
if (!($res = @mysql_query($query))) { trigger_error(mysql_error(), E_USER_ERROR); } $i = 0; while ($rsrow = mysql_fetch_assoc($res)) { $rsrow['city'] = sanitize_and_format($rsrow['city'], TYPE_STRING, $__field2format[TEXT_DB2DISPLAY]); $rsrow['myclass'] = $i % 2 ? 'odd_item' : 'even_item'; $cities[] = $rsrow; ++$i; } $tpl->set_var('pager1', pager($totalrows, $o, $r)); $tpl->set_var('pager2', pager($totalrows, $o, $r)); } } $tpl->set_file('content', 'loc_cities.html'); $tpl->set_loop('cities', $cities); $tpl->set_var('state_id', $state_id); $tpl->set_var('state', $state); $tpl->set_var('country_id', $country_id); $tpl->set_var('country', $country); $tpl->set_var('o', $o); $tpl->set_var('r', $r); $tpl->set_var('so', $so); $tpl->set_var('sr', $sr); $tpl->set_var('co', $co); $tpl->set_var('cr', $cr); $tpl->process('content', 'content', TPL_LOOP | TPL_NOLOOP); $tpl->drop_loop('cities'); unset($cities); $tplvars['title'] = 'Location Management: Cities'; $tplvars['page'] = 'loc_cities';
$loop = array(); if (!empty($totalrows)) { if ($o >= $totalrows) { $o = $totalrows - $r; $o = $o >= 0 ? $o : 0; } $query = "SELECT * FROM {$from} WHERE {$where} ORDER BY `news_id` DESC LIMIT {$o},{$r}"; if (!($res = @mysql_query($query))) { trigger_error(mysql_error(), E_USER_ERROR); } while ($rsrow = mysql_fetch_assoc($res)) { $rsrow['news_title'] = sanitize_and_format($rsrow['news_title'], TYPE_STRING, $__field2format[TEXT_DB2DISPLAY]); $loop[] = $rsrow; } $output['pager2'] = pager($totalrows, $o, $r); } $output['return2me'] = 'site_news.php'; if (!empty($_SERVER['QUERY_STRING'])) { $output['return2me'] .= '?' . $_SERVER['QUERY_STRING']; } $output['return2me'] = rawurlencode($output['return2me']); $tpl->set_file('content', 'site_news.html'); $tpl->set_loop('loop', $loop); $tpl->set_var('output', $output); $tpl->process('content', 'content', TPL_LOOP | TPL_NOLOOP); $tpl->drop_loop('loop'); $tpl->drop_var('output.pager2'); unset($loop); $tplvars['title'] = 'Site news'; $tplvars['page'] = 'site_news'; include 'frame.php';
} $js_loop = array(); $l = 0; foreach ($_pcats as $pcat_id => $pcat) { $loop[$l]['pcat_name'] = $pcat['pcat_name']; $cat_content = array(); for ($i = 0; isset($pcat['fields'][$i]); ++$i) { $temp = array(); $field =& $_pfields[$pcat['fields'][$i]]; if (isset($output['error_' . $field->config['dbfield']])) { $temp['class_error'] = $output['error_' . $field->config['dbfield']]; unset($output['error_' . $field->config['dbfield']]); } $temp = array_merge($temp, array('field' => $field->edit(), 'label' => $field->config['label'], 'dbfield' => $field->config['dbfield'])); $cat_content[] = $temp; $js_loop[] = array('js' => $field->edit_js()); } $loop[$l]['cat_content'] = $cat_content; ++$l; } //print_r($loop);die; $tpl->set_file('content', 'profile_edit.html'); $tpl->set_loop('loop', $loop); $tpl->set_loop('js_loop', $js_loop); $tpl->set_var('output', $output); $tpl->process('content', 'content', TPL_MULTILOOP | TPL_OPTIONAL); $tpl->drop_loop('categs'); $tplvars['title'] = sprintf('%1$s Member Profile', isset($output['_user']) ? $output['_user'] : ''); $tplvars['page'] = 'profile_edit'; $tplvars['css'] = 'profile_edit.css'; include 'frame.php';
$topass['message']['type'] = MESSAGE_ERROR; $topass['message']['text'] = $GLOBALS['_lang'][7]; redirect2page('info.php', $topass); } $output['lang_273'] = sanitize_and_format($GLOBALS['_lang'][273], TYPE_STRING, $__field2format[TEXT_DB2DISPLAY]); $output['lang_274'] = sanitize_and_format($GLOBALS['_lang'][274], TYPE_STRING, $__field2format[TEXT_DB2DISPLAY]); $output['lang_256'] = sanitize_and_format($GLOBALS['_lang'][256], TYPE_STRING, $__field2format[TEXT_DB2DISPLAY]); $output['return2me'] = 'profile.php'; if (!empty($_SERVER['QUERY_STRING'])) { $output['return2me'] .= '?' . $_SERVER['QUERY_STRING']; } $output['return2me'] = rawurlencode($output['return2me']); $tpl->set_file('content', 'profile.html'); $tpl->set_var('output', $output); $tpl->set_var('tplvars', $tplvars); $tpl->set_loop('categs', $categs); $tpl->set_loop('user_photos', $user_photos); $tpl->set_loop('loop_comments', $loop_comments); $tpl->set_loop('loop_friends', $loop_friends); $tpl->process('content', 'content', TPL_LOOP | TPL_NOLOOP | TPL_OPTLOOP | TPL_OPTIONAL); $tpl->drop_loop('categs'); $tpl->drop_loop('user_photos'); unset($categs); unset($user_photos); $tplvars['page'] = 'profile'; $tplvars['css'] = 'profile.css'; if (is_file('profile_left.php')) { include 'profile_left.php'; } include 'frame.php'; update_stats($uid, 'pviews', 1);
break; case 'gif': case 'jpg': case 'png': $files[$j]['file'] = '<a href="javascript:;">' . $entry . '<img src="' . _BASEURL_ . '/' . $path . '/' . $entry . '" /></a>'; $files[$j]['class'] = 'file_img'; ++$j; break; default: $files[$j]['file'] = '<a href="file_edit.php?m=1&f=' . urlencode($path . '/' . $entry) . '">' . $entry . '</a>'; $files[$j]['class'] = 'file'; ++$j; } } } } $d->close(); for ($j = 0; isset($files[$j]); ++$j) { $folders[$i + $j] = $files[$j]; } $html_path = '<a href="javascript:;" onclick="req_content(\'\')">Home</a>'; $temp = ''; for ($i = 0; !empty($path_parts[$i]); ++$i) { $temp .= '/' . $path_parts[$i]; $html_path .= ' / <a href="javascript:;" onclick="req_content(\'' . $temp . '\')">' . $path_parts[$i] . '</a>'; } $tpl = new phemplate(_BASEPATH_ . '/admin/skin/', 'remove_nonjs'); $tpl->set_file('content', 'file_browser_content.html'); $tpl->set_loop('server_content', $folders); $tpl->set_var('path', $html_path); echo $tpl->process('', 'content', TPL_LOOP);