本文整理汇总了PHP中Utils\Database\XDb::xFreeResults方法的典型用法代码示例。如果您正苦于以下问题:PHP XDb::xFreeResults方法的具体用法?PHP XDb::xFreeResults怎么用?PHP XDb::xFreeResults使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utils\Database\XDb
的用法示例。
在下文中一共展示了XDb::xFreeResults方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: genStatPieUrl
function genStatPieUrl()
{
$startDate = mktime(0, 0, 0, 1, 1, 2006);
global $lang;
if (checkField('cache_type', $lang)) {
$lang_db = XDb::xEscape($lang);
} else {
$lang_db = "en";
}
// Get data
$rsTypes = XDb::xSql("SELECT COUNT(`caches`.`type`) `count`, `cache_type`.`{$lang_db}` AS `type`, `cache_type`.`color`\n FROM `caches` INNER JOIN `cache_type` ON (`caches`.`type`=`cache_type`.`id`)\n WHERE `status`=1\n GROUP BY `caches`.`type`\n ORDER BY `count` DESC");
$yData = array();
$xData = array();
$colors = array();
$url = "http://chart.apis.google.com/chart?chs=550x200&chd=t:";
$sum = 0;
while ($rTypes = XDb::xFetchArray($rsTypes)) {
$yData[] = ' (' . $rTypes['count'] . ') ' . $rTypes['type'];
$xData[] = $rTypes['count'];
$colors[] = substr($rTypes['color'], 1);
$sum += $rTypes['count'];
}
XDb::xFreeResults($rsTypes);
foreach ($xData as $count) {
$url .= normTo100($count, $sum) . ",";
}
$url = substr($url, 0, -1);
$url .= "&cht=p3&chl=";
foreach ($yData as $label) {
$url .= urlencode($label) . "|";
}
$url = substr($url, 0, -1);
$url .= "&chco=";
foreach ($colors as $color) {
$url .= urlencode($color) . ",";
}
return $url = substr($url, 0, -1);
}
示例2: event_notify_new_cache
function event_notify_new_cache($cache_id)
{
global $rootpath;
//prepare the templates and include all neccessary
require_once $rootpath . 'lib/search.inc.php';
$rs = XDb::xSql('SELECT `caches`.`latitude`, `caches`.`longitude`
FROM `caches`
WHERE `caches`.`cache_id`= ? ', $cache_id);
$r = XDb::xFetchArray($rs);
$latFrom = $r['latitude'];
$lonFrom = $r['longitude'];
XDb::xFreeResults($rs);
$distanceMultiplier = 1;
// TODO: Seeking pre-select `user`. `latitude` like with max_lon / min_lon / max_lat / min_lat
XDb::xSql('INSERT INTO `notify_waiting` (`id`, `cache_id`, `user_id`, `type`)
SELECT NULL, ' . XDb::xEscape($cache_id) . ', `user`.`user_id`, ' . NOTIFY_NEW_CACHES . '
FROM `user`
WHERE NOT ISNULL(`user`.`latitude`)
AND NOT ISNULL(`user`.`longitude`)
AND `user`.`notify_radius` > 0
AND (acos(cos((90- ? ) * 3.14159 / 180) * cos((90-`user`.`latitude`) * 3.14159 / 180) +
sin((90-?) * 3.14159 / 180) * sin((90-`user`.`latitude`) * 3.14159 / 180) * cos(( ? -`user`.`longitude`) *
3.14159 / 180)) * 6370 * ?) <= `user`.`notify_radius`', $latFrom, $latFrom, $lonFrom, $distanceMultiplier);
}
示例3: while
$show_all_countries = 0;
}
}
if ($show_all_countries == 1) {
$rs2 = XDb::xSql("SELECT `" . XDb::xEscape($lang_db) . "`, `list_default_" . XDb::xEscape($lang_db) . "`, `short`, `sort_" . XDb::xEscape($lang_db) . "` FROM `countries` ORDER BY `sort_" . XDb::xEscape($lang_db) . '` ASC', $lang_db);
} else {
$rs2 = XDb::xSql("SELECT `" . XDb::xEscape($lang_db) . "`, `list_default_" . XDb::xEscape($lang_db) . "`, `short`, `sort_" . XDb::xEscape($lang_db) . "` FROM `countries` WHERE `list_default_" . XDb::xEscape($lang_db) . "`=1 ORDER BY `sort_" . XDb::xEscape($lang_db) . '` ASC', $lang_db);
}
while ($record2 = XDb::xFetchArray($rs2)) {
if ($record2['short'] == $country) {
$stmp .= '<option value="' . $record2['short'] . '" selected="selected">' . htmlspecialchars($record2[$lang_db], ENT_COMPAT, 'UTF-8') . "</option>\n";
} else {
$stmp .= '<option value="' . $record2['short'] . '">' . htmlspecialchars($record2[$lang_db], ENT_COMPAT, 'UTF-8') . "</option>\n";
}
}
XDb::xFreeResults($rs2);
tpl_set_var('countrylist', $stmp);
unset($stmp);
tpl_set_var('show_all_countries', $show_all_countries);
if ($show_all_countries == 0) {
tpl_set_var('allcountriesbutton', '<input type="submit" class="formbuttons" name="submit_all_countries" value="' . $allcountries . '" />');
} else {
tpl_set_var('allcountriesbutton', '');
}
}
}
//build useroptions
$user_options = '';
if ($using_permantent_login == 1) {
$user_options .= $using_permantent_login_message . '<br />';
}
示例4: savequery
function savequery($queryid, $queryname, $saveas, $submit, $saveas_queryid)
{
global $usr, $tplname;
global $error_empty_name, $nosaveastext, $saveastext, $error_queryname_exists;
$displayform = $submit == false;
$error_no_name = false;
$error_duplicate_name = false;
// ok ... checken, ob die query uns gehört und dann speichern
$rs = XDb::xSql("SELECT `user_id` FROM `queries` WHERE `id`= ? AND (`user_id`=0 OR `user_id`= ? )", $queryid, $usr['userid']);
if (false == XDb::xFetchArray($rs)) {
echo 'fatal error: query not found or permission denied';
exit;
}
XDb::xFreeResults($rs);
if ($saveas == false) {
if ($displayform == false && $queryname == '') {
$displayform = true;
$error_no_name = true;
} else {
// prüfen ob name bereits vorhanden
$r['c'] = XDb::xMultiVariableQueryValue("SELECT COUNT(*) `c` FROM `queries`\n WHERE `user_id`= :1 AND `name`= :2 ", 0, $usr['userid'], $queryname);
if ($r['c'] > 0) {
$displayform = true;
$error_duplicate_name = true;
}
}
} else {
if ($saveas_queryid == 0) {
$displayform = true;
} else {
// prüfen ob saveas_queryid existiert und uns gehört
$rs = XDb::xSql("SELECT `user_id` FROM `queries` WHERE `id`= ? AND (`user_id`=0 OR `user_id`= ? )", $saveas_queryid, $usr['userid']);
if (false === XDb::xFetchArray($rs)) {
echo 'fatal error: saveas_query not found or permission denied';
exit;
}
XDb::xFreeResults($rs);
}
}
if ($displayform == true) {
// abfrageform für name
$tplname = 'savequery';
if ($error_no_name == true) {
tpl_set_var('nameerror', $error_empty_name);
} else {
if ($error_duplicate_name == true) {
tpl_set_var('nameerror', $error_queryname_exists);
} else {
tpl_set_var('nameerror', '');
}
}
tpl_set_var('queryname', htmlspecialchars($queryname, ENT_COMPAT, 'UTF-8'));
tpl_set_var('queryid', htmlspecialchars($queryid, ENT_COMPAT, 'UTF-8'));
// oldqueries auslesen
$options = '';
$rs = XDb::xSql("SELECT `id`, `name` FROM `queries` WHERE `user_id`= ? ORDER BY `name` ASC", $usr['userid']);
if (!($r = XDb::xFetchArray($rs))) {
tpl_set_var('selecttext', $nosaveastext);
tpl_set_var('oldqueries', '');
} else {
tpl_set_var('selecttext', $saveastext);
do {
if ($r['id'] == $queryid) {
$options .= '<option value="' . $r['id'] . '" selected="selected">' . htmlspecialchars($r['name'], ENT_COMPAT, 'UTF-8') . '</option>' . "\n";
} else {
$options .= '<option value="' . $r['id'] . '">' . htmlspecialchars($r['name'], ENT_COMPAT, 'UTF-8') . '</option>' . "\n";
}
} while ($r = XDb::xFetchArray($rs));
XDb::xFreeResults($rs);
tpl_set_var('oldqueries', $options);
}
tpl_BuildTemplate();
exit;
}
$r['options'] = XDb::xMultiVariableQueryValue("SELECT `options` FROM `queries` WHERE `id`= :1 LIMIT 1", 0, $queryid);
// ok, speichern
if ($saveas == true) {
XDb::xSql("UPDATE `queries` SET `options`= ?, `last_queried`=NOW() WHERE `id`= ? ", $r['options'], $saveas_queryid);
} else {
XDb::xSql("INSERT INTO `queries` (`user_id`, `last_queried`, `name`, `uuid`, `options`)\n VALUES ( ?, NOW(), ?, ?, ?)", $usr['userid'], $queryname, create_uuid(), $r['options']);
}
tpl_redirect('query.php?action=view');
}
示例5: strftime
}
if ($rLogs['year'] . '-' . $rLogs['month'] . '-' . $rLogs['day'] == date('Y-n-j', $date)) {
$logsCount += $rLogs['count'];
}
$yDataCaches[] = $cachesCount;
$yDataLogs[] = $logsCount;
if (date('j', $date) == 1) {
$tickPositions[] = $date;
$tickLabels[] = strftime('%G', $date);
}
$xDate[] = $date;
$days++;
$date = mktime(0, 0, 0, 5, 1 + $days, 2006);
}
XDb::xFreeResults($rsCaches);
XDb::xFreeResults($rsLogs);
//
// Titel, Footer, Legende und Hintergrund
//
$stat = tr('oc_stat');
$graph->title->SetFont(FF_GEORGIA, FS_NORMAL, 14);
$graph->title->Set($stat);
$graph->title->SetMargin(12);
$graph->footer->center->Set(tr('graph_statistics_01') . date('d:m:Y H:i:s'));
$graph->footer->center->SetFont(FF_ARIAL, FS_NORMAL, 7);
$graph->footer->center->SetColor('darkgray');
$graph->legend->SetLayout(LEGEND_HOR);
$graph->legend->Pos(0.5, 0.96, "center", "bottom");
$graph->legend->SetLineWeight(8);
$graph->img->SetMargin(45, 60, 50, 70);
$graph->SetFrame(false);
示例6: COUNT
$y[] = $ry['count'];
$x[] = $ry['type'];
}
}
XDb::xFreeResults($rsCreateCachesYear);
}
if ($tit == "cf") {
$rsCachesFindYear = XDb::xSql("SELECT COUNT(`caches`.`type`) `count`, `cache_type`.`{$lang_db}` AS `type`\n FROM `cache_logs`, caches INNER JOIN `cache_type` ON (`caches`.`type`=`cache_type`.`id`)\n WHERE cache_logs.`deleted`=0 AND cache_logs.user_id=? AND cache_logs.`type`='1' AND cache_logs.`cache_id` = caches.cache_id\n GROUP BY `caches`.`type`\n ORDER BY `count` DESC", $user_id);
if ($rsCachesFindYear !== false) {
$xtitle = "";
while ($rfy = XDb::xFetchArray($rsCachesFindYear)) {
$y[] = $rfy['count'];
$x[] = $rfy['type'];
}
}
XDb::xFreeResults($rsCachesFindYear);
}
// A new pie graph
$graph = new PieGraph(500, 300, "auto");
$graph->SetScale('textint');
$type = tr("by_cachetype");
// Title setup
$graph->title->Set($type);
$graph->title->SetFont(FF_ARIAL, FS_NORMAL);
// Setup the pie plot
$p1 = new PiePlot($y);
$p1->SetTheme("earth");
$p1->value->SetFormat("%d");
$p1->SetLabelType(PIE_VALUE_ABS);
// Adjust size and position of plot
$p1->SetSize(0.35);
示例7: ftsearch_refresh_cache_logs
function ftsearch_refresh_cache_logs($id)
{
$rs = XDb::xSql("SELECT `cache_id`, `text`, `last_modified`\n FROM `cache_logs`\n WHERE `id`= ?\n AND `cache_logs`.`deleted` = ? ", $id, 0);
if ($r = XDb::xFetchArray($rs)) {
$r['text'] = ftsearch_strip_html($r['text']);
ftsearch_set_entries(1, $id, $r['cache_id'], $r['text'], $r['last_modified']);
}
XDb::xFreeResults($rs);
}
示例8: process_log_watch
/**
* This function prepares message to text watcher about new log entry
* @param unknown $user_id
* @param unknown $log_id
*/
function process_log_watch($user_id, $log_id)
{
global $absolute_server_URI;
$rsLog = XDb::xSql("SELECT cache_logs.cache_id cache_id, cache_logs.text text, cache_logs.text_html text_html,\n cache_logs.date logdate, user.username username, user.hidden_count ch, user.founds_count cf,\n user.notfounds_count cn, caches.wp_oc wp,caches.name cachename, cache_logs.type type,\n IF(ISNULL(`cache_rating`.`cache_id`), 0, 1) AS `recommended`\n FROM `cache_logs`\n LEFT JOIN `cache_rating` ON `cache_logs`.`cache_id`=`cache_rating`.`cache_id`\n AND `cache_logs`.`user_id`=`cache_rating`.`user_id`, `user`, `caches`\n WHERE `cache_logs`.`deleted`=0 AND (cache_logs.user_id = user.user_id)\n AND (cache_logs.cache_id = caches.cache_id)\n AND (cache_logs.id = ?)\n LIMIT 1", $log_id);
$rLog = XDb::xFetchArray($rsLog);
XDb::xFreeResults($rsLog);
$logtypeParams = getLogtypeParams($rLog['type']);
if (isset($logtypeParams['username'])) {
$rLog['username'] = $logtypeParams['username'];
}
if ($rLog['recommended'] != 0 && $rLog['type'] == 1) {
$recommended = ' + ' . tr('recommendation');
} else {
$recommended = '';
}
$watchtext = file_get_contents(dirname(__FILE__) . '/item.email.html');
$logtext = $rLog['text'];
$logtext = preg_replace("/<img[^>]+\\>/i", "", $logtext);
$watchtext = mb_ereg_replace('{date}', date('Y-m-d H:i', strtotime($rLog['logdate'])), $watchtext);
$watchtext = mb_ereg_replace('{wp}', $rLog['wp'], $watchtext);
$watchtext = mb_ereg_replace('{text}', $logtext, $watchtext);
$watchtext = mb_ereg_replace('{user}', $rLog['username'], $watchtext);
$watchtext = mb_ereg_replace('{logtype}', $logtypeParams['logtype'] . $recommended, $watchtext);
$watchtext = mb_ereg_replace('{cachename}', $rLog['cachename'], $watchtext);
$watchtext = mb_ereg_replace('{logtypeColor}', $logtypeParams['logtypeColor'], $watchtext);
$watchtext = mb_ereg_replace('{runwatch02}', tr('runwatch02'), $watchtext);
$watchtext = mb_ereg_replace('{absolute_server_URI}', $absolute_server_URI, $watchtext);
$watchtext = mb_ereg_replace('{userActivity}', $userActivity, $watchtext);
XDb::xSql("INSERT IGNORE INTO watches_waiting (`user_id`, `object_id`, `object_type`, `date_added`, `watchtext`, `watchtype`)\n VALUES (?, ?, 1, NOW(), ?, 2)", $user_id, $log_id, $watchtext);
}
示例9: tr
} else {
$x[] = tr("not_found");
$y[] = '0';
}
$rsCSC = XDb::xSql("SELECT COUNT(`cache_logs`.`type`) `count`, `log_types`.`{$lang_db}` AS `type`\n FROM `cache_logs` INNER JOIN `log_types` ON (`cache_logs`.`type`=`log_types`.`id`)\n WHERE type=3 AND cache_logs.deleted=0 AND cache_logs.cache_id= ?\n GROUP BY `cache_logs`.`type`\n ORDER BY `log_types`.`pl` ASC", $cache_id);
if ($rsCSC !== false) {
$xtitle = "";
$ry = XDb::xFetchArray($rsCSC);
$y[] = $ry['count'];
$x[] = $ry['type'];
} else {
$x[] = tr("comment");
}
XDb::xFreeResults($rsCSF);
XDb::xFreeResults($rsCSNF);
XDb::xFreeResults($rsCSC);
// A new pie graph
$graph = new PieGraph(400, 200, "auto");
$graph->SetScale('textint');
$logtype = tr("by_logtype");
// Title setup
$graph->title->Set($logtype);
$graph->title->SetFont(FF_ARIAL, FS_NORMAL);
// Setup the pie plot
$p1 = new PiePlot($y);
$p1->SetTheme("earth");
$p1->value->SetFormat("%d");
$p1->SetLabelType(PIE_VALUE_ABS);
$p1->SetSliceColors(array('chartreuse3', 'chocolate2', 'wheat1'));
// Adjust size and position of plot
$p1->SetSize(0.35);
示例10: while
while ($ry2 = XDb::xFetchArray($rscaches)) {
$y2[] = $ry2['count'];
$x2[] = $ry2['username'];
}
while ($ry3 = XDb::xFetchArray($rsreportsM)) {
$y3[] = $ry3['count'];
$x3[] = $ry3['month'];
}
while ($ry4 = XDb::xFetchArray($rscachesM)) {
$y4[] = $ry4['count'];
$x4[] = $ry4['month'];
}
XDb::xFreeResults($rsreportsM);
XDb::xFreeResults($rsreports);
XDb::xFreeResults($rscaches);
XDb::xFreeResults($rscachesM);
// Create the graph. These two calls are always required
$graph = new Graph(740, 200, 'auto');
$graph->SetScale('textint', 0, max($y) + max($y) * 0.2, 0, 0);
// Add a drop shadow
$graph->SetShadow();
// Adjust the margin a bit to make more room for titles
$graph->SetMargin(50, 30, 30, 40);
// Create a bar pot
$bplot = new BarPlot($y);
// Adjust fill color
$bplot->SetFillColor('steelblue2');
$graph->Add($bplot);
// Setup the titles
$descibe = iconv('UTF-8', 'ASCII//TRANSLIT', tr("octeam_stat_problems"));
$graph->title->Set($descibe);
示例11: array
$mnu_siteid = 'start';
}
$stat_menu = array('title' => 'Statictics', 'menustring' => 'Statistics', 'siteid' => 'statlisting', 'visible' => false, 'filename' => 'ustatsg2.php?userid=' . $user_id, 'submenu' => array(array('title' => tr('generla_stat'), 'menustring' => tr('general_stat'), 'visible' => true, 'filename' => 'viewprofile.php?userid=' . $user_id, 'newwindow' => false, 'siteid' => 'general_stat', 'icon' => 'images/actions/stat'), array('title' => tr('graph_created'), 'menustring' => tr('graph_created'), 'visible' => true, 'filename' => 'ustatsg1.php?userid=' . $user_id, 'newwindow' => false, 'siteid' => 'createstat', 'icon' => 'images/actions/stat')));
$content = "";
$rsGeneralStat = XDb::xSql("SELECT hidden_count, founds_count, log_notes_count, notfounds_count, username\n FROM `user` WHERE user_id= ? LIMIT 1", $user_id);
$user_record = XDb::xFetchArray($rsGeneralStat);
tpl_set_var('username', $user_record['username']);
if ($user_record['founds_count'] == 0) {
$content .= '<p> </p><p> </p><div class="content2-container bg-blue02"><p class="content-title-noshade-size1"> <img src="tpl/stdstyle/images/blue/logs.png" class="icon32" alt="Caches Find" title="Caches Find" /> ' . tr("graph_find") . '</p></div><br /><br /><p> <b>' . tr("there_is_no_caches_found") . '</b></p>';
} else {
// calculate diif days between date of register on OC to current date
$ddays = XDb::xMultiVariableQueryValue("SELECT TO_DAYS( NOW() ) - TO_DAYS(`date_created`) `diff` FROM `user` WHERE user_id= :1 LIMIT 1 ", 0, $user_id);
$rsGeneralStat = XDb::xSql("SELECT YEAR(`date_created`) usertime,hidden_count, founds_count, log_notes_count, username\n FROM `user` WHERE user_id= ? LIMIT 1", $user_id);
if ($rsGeneralStat !== false) {
$user_record = XDb::xFetchArray($rsGeneralStat);
XDb::xFreeResults($rsGeneralStat);
tpl_set_var('username', $user_record['username']);
}
$content .= '<p> </p><p> </p><div class="content2-container bg-blue02"><p class="content-title-noshade-size1"> <img src="tpl/stdstyle/images/blue/logs.png" class="icon32" alt="Caches Find" title="Caches Find" /> ' . tr("graph_find") . '</p></div><br />';
$content .= '<p><img src="graphs/PieGraphustat.php?userid=' . $user_id . '&t=cf" border="0" alt="" width="500" height="300" /></p>';
$year = date("Y");
$content .= '<p><img src="graphs/BarGraphustat.php?userid=' . $user_id . '&t=cfm' . $year . '" border="0" alt="" width="500" height="200" /></p>';
if ($user_record['usertime'] != $year) {
$yearr = $year - 1;
$content .= '<p><img src="graphs/BarGraphustat.php?userid=' . $user_id . '&t=cfm' . $yearr . '" border="0" alt="" width="500" height="200" /></p>';
}
$content .= '<p><img src="graphs/BarGraphustat.php?userid=' . $user_id . '&t=cfy" border="0" alt="" width="500" height="200" /></p>';
}
// Parameter
$jpeg_qualitaet = 80;
$fontfile = "./lib/fonts/arial.ttf";
示例12: urlencode
$thisline = mb_ereg_replace('{log_picture_onclick}', "alert('" . $spoiler_disable_msg . "'); return false;", $thisline);
$thisline = mb_ereg_replace('{link}', 'index.php', $thisline);
$thisline = mb_ereg_replace('{longdesc}', 'index.php', $thisline);
} else {
$thisline = mb_ereg_replace('{log_picture_onclick}', "enlarge(this)", $thisline);
$thisline = mb_ereg_replace('{link}', $pic_record['url'], $thisline);
$thisline = mb_ereg_replace('{longdesc}', str_replace("uploads", "uploads", $pic_record['url']), $thisline);
}
$thisline = mb_ereg_replace('{imgsrc}', 'thumbs.php?uuid=' . urlencode($pic_record['uuid']), $thisline);
if ($pic_record['title'] == "") {
$title = "link";
} else {
$title = htmlspecialchars($pic_record['title'], ENT_COMPAT, 'UTF-8');
}
$thisline = mb_ereg_replace('{title}', "<a class=links href=viewlogs.php?logid=" . $pic_record['object_id'] . ">" . $title . "</a>", $thisline);
$logpicturelines .= $thisline;
} while ($pic_record = XDb::xFetchArray($rspictures));
}
XDb::xFreeResults($rspictures);
$tmplog = $logpicturelines;
$logs = "{$tmplog}\n";
tpl_set_var('logpictures', $logs);
} else {
//display search page
// redirection
tpl_redirect('viewcache.php?cacheid=' . urlencode($cache_id));
exit;
}
}
//make the template and send it out
tpl_BuildTemplate();
示例13: count
if ($record_logs['encrypt'] == 1 && ($record_logs['cache_owner'] == $usr['userid'] || $record_logs['luser_id'] == $usr['userid'])) {
$logtext .= "<img src=\\'/tpl/stdstyle/images/free_icons/lock_open.png\\' alt=\\`\\` /><br/>";
}
$data_text = common::cleanupText(str_replace("\r\n", " ", $record_logs['log_text']));
$data_text = str_replace("\n", " ", $data_text);
if ($record_logs['encrypt'] == 1 && $record_logs['cache_owner'] != $usr['userid'] && $record_logs['luser_id'] != $usr['userid']) {
//crypt the log ROT13, but keep HTML-Tags and Entities
$data_text = str_rot13_html($data_text);
} else {
$logtext .= "<br/>";
}
$logtext .= $data_text;
$tmp_log = mb_ereg_replace('{logtext}', $logtext, $tmp_log);
$content .= "\n" . $tmp_log;
}
XDb::xFreeResults($rs_logs);
$content .= '</ul></div><br />';
}
}
// ----------------- begin owner section ----------------------------------
if ($user_id == $usr['userid'] || $usr['admin']) {
$rscheck = XDb::xMultiVariableQueryValue("SELECT count(*) FROM caches\n WHERE (status = 4 OR status = 5 OR status = 6) AND `user_id`= :1", 0, $user_id);
if ($rscheck != 0) {
$content .= '<br /><div class="content-title-noshade box-blue">';
}
//get not published caches DATE_FORMAT(`caches`.`date_activate`,'%d-%m-%Y'),
$geocachesNotPublished = $user->getGeocachesNotPublished();
if ($geocachesNotPublished->count() > 0) {
$content .= '<p><span class="content-title-noshade txt-blue08">' . tr('not_yet_published') . ':</span></p><br /><div><ul style="margin: -0.9em 0px 0.9em 0px; padding: 0px 0px 0px 10px; list-style-type: none; line-height: 1.2em; font-size: 115%;">';
foreach ($geocachesNotPublished as $geocache) {
$content .= "\n" . buildGeocacheHtml($geocache, $cache_notpublished_line);
示例14: while
<?php
use Utils\Database\XDb;
//prepare the templates and include all neccessary
require_once './lib/common.inc.php';
//Preprocessing
if ($error == false) {
//get the news
$tplname = 'news';
$newscontent = '';
require $stylepath . '/news.inc.php';
$rsNewsTopics = XDb::xSql('SELECT `name`, `id` FROM `news_topics` ORDER BY `id` ASC');
while ($rNewsTopics = XDb::xFetchArray($rsNewsTopics)) {
$rsNews = XDb::xSql("SELECT `date_posted`, `content` FROM `news`\n WHERE `topic`= ? AND `display`=1\n ORDER BY `date_posted` DESC LIMIT 0, 20", $rNewsTopics['id']);
while ($rNews = XDb::xFetchArray($rsNews)) {
$thisnewscontent = $tpl_newstopic_without_topic;
$thisnewscontent = mb_ereg_replace('{date}', date('d-m-Y', strtotime($rNews['date_posted'])), $thisnewscontent);
$thisnewscontent = mb_ereg_replace('{message}', $rNews['content'], $thisnewscontent);
$newscontent .= $thisnewscontent . "\n";
}
XDb::xFreeResults($rsNews);
}
XDb::xFreeResults($rsNewsTopics);
//$newscontent .= "</table>";
tpl_set_var('list_of_news', $newscontent);
}
//make the template and send it out
tpl_BuildTemplate();
示例15: COUNT
) AS `t`', 0);
$rsfCR = XDb::xSql("SELECT COUNT(*) `count`, `cache_location`.`adm3` region, `cache_location`.`code3` code_region\n FROM `cache_location`\n INNER JOIN cache_logs ON cache_location.cache_id=cache_logs.cache_id\n WHERE `cache_location`.`code1`='PL'\n AND (cache_logs.type='1' OR cache_logs.type='2')\n AND cache_logs.deleted='0'\n GROUP BY `cache_location`.`code3`\n ORDER BY count DESC");
echo '<table width="97%"><tr><td align="center"><center><b> ' . tr('Stats_t7_01') . '</b> <br /><br /> ' . tr('Stats_t7_02') . ':<b> ';
echo $fCt["count"];
echo ' </b><br />' . tr('Stats_t7_03') . ':<b> ';
echo $r['users'];
echo '</b><br /><br />(' . tr('Stats_t7_04') . ')</center></td></tr></table><br><table border="1" bgcolor="white" width="97%">' . "\n";
echo '
<tr class="bgcolor2">
<td width="20%">
<center><b>' . tr('Stats_t7_05') . '</b></center>
</td>
<td align="right">
<b>' . tr('Stats_t7_06') . '</b>
</td>
</tr><tr><td height="2"></td></tr>';
while ($line = XDb::xFetchArray($rsfCR)) {
echo '<tr class="bgcolor2">
<td align="right">
<b>' . $line["count"] . '</b>
</td>
<td align="right">
<b><a class=links href=articles.php?page=s10®ion=' . $line['code_region'] . '>' . $line['region'] . '</a></b>
</td>';
}
echo '</table>' . "\n";
XDb::xFreeResults($rsfCR);
$result = ob_get_clean();
apc_store($cache_key, $result, 86400);
}
print $result;