Example #1
0
/////////////////////////////////////////////////////
//Titled Caches
///////////////////////////////////////////////////
$usrid = -1;
$TitledCaches = "";
$dbc = new dataBase();
if ($usr != false) {
    $usrid = $usr['userid'];
}
$query = "SELECT caches.cache_id, caches.name cacheName, adm1 cacheCountry, adm3 cacheRegion, caches.type cache_type, \n        caches.user_id, user.username userName, cache_titled.date_alg, cache_logs.text, cache_desc.short_desc,\n        logUser.user_id logUserId, logUser.username logUserName\nFROM cache_titled\nJOIN caches ON cache_titled.cache_id = caches.cache_id\nJOIN cache_desc ON caches.cache_id = cache_desc.cache_id and language=:1\nJOIN cache_location ON caches.cache_id = cache_location.cache_id\nJOIN user ON caches.user_id = user.user_id\n        \nJOIN cache_logs ON cache_logs.id = cache_titled.log_id \nJOIN user logUser ON logUser.user_id = cache_logs.user_id\n               \nORDER BY date_alg DESC \nLIMIT 1";
$dbc->multiVariableQuery($query, $lang);
$pattern = "<span style='font-size:13px'><img src='{cacheIcon}' class='icon16' alt='Cache' title='Cache' />\n        <a href='viewcache.php?cacheid={cacheId}'><b>{cacheName}</b></a></span> \n        \n        <span style='font-size:11px'> " . tr('hidden_by') . "</span>\n        <span style='font-size:13px'><a href='viewprofile.php?userid={userId}'><b>{userName}</b></a></span><br>\n                \n        <span style='font-size:11px;font-style:italic'>{cacheShortDesc}</span><br>\n                \n        <span class='content-title-noshade' style='font-size:11px'>{country} > {region}</span>\n        <br><br>        \n        <table class='CacheTitledLog' >\n                <tr><td>{logText}\n                <br><br><img src='images/rating-star.png'/> Autor: <a href='viewprofile.php?userid={logUserId}'><b>{logUserName}<b></a></td></tr>\n        </table>";
for ($i = 0; $i < $dbc->rowCount(); $i++) {
    $rec = $dbc->dbResultFetch();
    $line = $pattern;
    $line = mb_ereg_replace('{cacheIcon}', myninc::checkCacheStatusByUser($rec, $usrid), $line);
    $line = mb_ereg_replace('{dateAlg}', $rec["date_alg"], $line);
    $line = mb_ereg_replace('{cacheName}', $rec["cacheName"], $line);
    $line = mb_ereg_replace('{userId}', $rec["user_id"], $line);
    $line = mb_ereg_replace('{userName}', $rec["userName"], $line);
    $line = mb_ereg_replace('{cacheId}', $rec["cache_id"], $line);
    $line = mb_ereg_replace('{country}', $rec["cacheCountry"], $line);
    $line = mb_ereg_replace('{region}', $rec["cacheRegion"], $line);
    $line = mb_ereg_replace('{cacheShortDesc}', $rec["short_desc"], $line);
    $line = mb_ereg_replace('{logUserId}', $rec["logUserId"], $line);
    $line = mb_ereg_replace('{logUserName}', $rec["logUserName"], $line);
    $text = mb_ereg_replace('<p>', '', $rec["text"]);
    $text = mb_ereg_replace('</p>', '<br>', $text);
    $line = mb_ereg_replace('{logText}', $text, $line);
    $TitledCaches .= $line;
}
Example #2
0
         LEFT JOIN `powerTrail_caches` ON `caches`.`cache_id` = `powerTrail_caches`.`cacheId`
         LEFT JOIN `PowerTrail` ON (`PowerTrail`.`id` = `powerTrail_caches`.`PowerTrailId`  AND `PowerTrail`.`status` = 1), `cache_type`
 WHERE `caches`.`type`!=6
       AND `caches`.`status`=1
       AND `caches`.`type`=`cache_type`.`id`
       AND `caches`.`founds`=0
     ORDER BY `date` DESC, `caches`.`cache_id` DESC
                 LIMIT ' . ($startat + 0) . ', ' . ($perpage + 0));
 $tr_myn_click_to_view_cache = tr('myn_click_to_view_cache');
 //powertrail vel geopath variables
 $pt_cache_intro_tr = tr('pt_cache');
 $pt_icon_title_tr = tr('pt139');
 while ($r = sql_fetch_array($rs)) {
     $file_content .= '<tr>';
     $file_content .= '<td style="width: 90px;">' . date($dateFormat, strtotime($r['date'])) . '</td>';
     $cacheicon = myninc::checkCacheStatusByUser($r, $usr['userid']);
     //$file_content .= '<td width="22">&nbsp;<img src="tpl/stdstyle/images/' .getSmallCacheIcon($r['icon_large']) . '" border="0" alt=""/></td>';
     // PowerTrail vel GeoPath icon
     if (isset($r['PT_ID'])) {
         $PT_icon = icon_geopath_small($r['PT_ID'], $r['PT_image'], $r['PT_name'], $r['PT_type'], $pt_cache_intro_tr, $pt_icon_title_tr);
     } else {
         $PT_icon = '<img src="images/rating-star-empty.png" class="icon16" alt="" title="" />';
     }
     $file_content .= '<td width="22">' . $PT_icon . '</td>';
     $file_content .= '<td width="22">&nbsp;<a class="links" href="viewcache.php?cacheid=' . htmlspecialchars($r['cacheid'], ENT_COMPAT, 'UTF-8') . '"><img src="' . $cacheicon . '" border="0" alt="' . $tr_myn_click_to_view_cache . '" title="' . $tr_myn_click_to_view_cache . '" /></a></td>';
     $file_content .= '<td><b><a class="links" href="viewcache.php?cacheid=' . htmlspecialchars($r['cacheid'], ENT_COMPAT, 'UTF-8') . '">' . htmlspecialchars($r['cachename'], ENT_COMPAT, 'UTF-8') . '</a></b></td>';
     $file_content .= '<td width="32"><b><a class="links" href="viewprofile.php?userid=' . htmlspecialchars($r['userid'], ENT_COMPAT, 'UTF-8') . '">' . htmlspecialchars($r['username'], ENT_COMPAT, 'UTF-8') . '</a></b></td>';
     $file_content .= "</tr>";
 }
 mysql_free_result($rs);
 tpl_set_var('file_content', $file_content);
Example #3
0
     $file_content .= '<td width="22">&nbsp;</td>';
 }
 if ($log_record['log_type'] == 12 && !$usr['admin']) {
     //hide COG entery
     $log_record['user_id'] = '0';
     $log_record['user_name'] = tr('cog_user_name');
 }
 // PowerTrail vel GeoPath icon
 if (isset($log_record['PT_ID'])) {
     $PT_icon = icon_geopath_small($log_record['PT_ID'], $log_record['PT_image'], $log_record['PT_name'], $log_record['PT_type'], $pt_cache_intro_tr, $pt_icon_title_tr);
 } else {
     $PT_icon = '<img src="images/rating-star-empty.png" class="icon16" alt="" title="" />';
 }
 $file_content .= '<td width="22">' . $PT_icon . '</td>';
 $file_content .= '<td width="22"><img src="tpl/stdstyle/images/' . $log_record['icon_small'] . '" border="0" alt="" title=" ' . tr('logType' . $log_record['log_type']) . ' " /></td>';
 $cacheicon = myninc::checkCacheStatusByUser($log_record, $usr['userid']);
 $file_content .= '<td width="22">&nbsp;<a class="links" href="viewcache.php?cacheid=' . htmlspecialchars($log_record['cache_id'], ENT_COMPAT, 'UTF-8') . '"><img src="' . $cacheicon . '" border="0" alt="' . $tr_myn_click_to_view_cache . '" title="' . $tr_myn_click_to_view_cache . '" /></a></td>';
 //$file_content .= '<td width="22"><a class="links" href="viewcache.php?cacheid=' . htmlspecialchars($log_record['cache_id'], ENT_COMPAT, 'UTF-8') . '"><img src="tpl/stdstyle/images/' . $log_record['cache_icon_small'] . '" border="0" alt="" title="Kliknij aby zobaczyć skrzynke" /></a></td>';
 $file_content .= '<td><b><a class="links" href="viewlogs.php?logid=' . htmlspecialchars($log_record['id'], ENT_COMPAT, 'UTF-8') . '" onmouseover="Tip(\'';
 $file_content .= '<b>' . $log_record['user_name'] . '</b>: &nbsp;';
 if ($log_record['encrypt'] == 1 && $log_record['cache_owner'] != $usr['userid'] && $log_record['luser_id'] != $usr['userid']) {
     $file_content .= "<img src=\\'/tpl/stdstyle/images/free_icons/lock.png\\' alt=\\`\\` /><br/>";
 }
 if ($log_record['encrypt'] == 1 && ($log_record['cache_owner'] == $usr['userid'] || $log_record['luser_id'] == $usr['userid'])) {
     $file_content .= "<img src=\\'/tpl/stdstyle/images/free_icons/lock_open.png\\' alt=\\`\\` /><br/>";
 }
 $data = common::cleanupText(str_replace("\r\n", " ", $log_record['log_text']));
 $data = str_replace("\n", " ", $data);
 if ($log_record['encrypt'] == 1 && $log_record['cache_owner'] != $usr['userid'] && $log_record['luser_id'] != $usr['userid']) {
     //crypt the log ROT13, but keep HTML-Tags and Entities
     $data = str_rot13_html($data);
 }
 //$rating_picture
 if ($log_record['recommended'] == 1 && $log_record['log_type'] == 1) {
     $file_content .= '<td width="22"><img src="images/rating-star.png" border="0" alt="" title="Rekomendacja" /></td>';
 } else {
     $file_content .= '<td width="22">&nbsp;</td>';
 }
 // PowerTrail vel GeoPath icon
 if (isset($log_record['PT_ID'])) {
     $file_content .= '<td width="22">';
     $PT_icon = icon_geopath_small($log_record['PT_ID'], $log_record['PT_image'], $log_record['PT_name'], $log_record['PT_type'], $pt_cache_intro_tr, $pt_icon_title_tr);
     $file_content .= $PT_icon . '</td>';
 } else {
     $file_content .= '<td width="22">&nbsp;</td>';
 }
 $cacheicon = myninc::checkCacheStatusByUser($log_record, $user_id);
 $file_content .= '<td width="22"><img src="tpl/stdstyle/images/' . $log_record['icon_small'] . '" border="0" alt="" /></td>';
 $file_content .= '<td width="22" ><a class="links" href="viewcache.php?cacheid=' . htmlspecialchars($log_record['cache_id'], ENT_COMPAT, 'UTF-8') . '"><img src="' . $cacheicon . '" border="0" alt="' . $tr_myn_click_to_view_cache . '" title="' . $tr_myn_click_to_view_cache . '" /></a></td>';
 $file_content .= '<td><b><a class="links" href="viewlogs.php?logid=' . htmlspecialchars($log_record['id'], ENT_COMPAT, 'UTF-8') . '" onmouseover="Tip(\'';
 // ukrywanie autora komentarza COG przed zwykłym userem
 // (Łza)
 if ($log_record['log_type'] == 12 && !$usr['admin']) {
     $log_record['user_id'] = '0';
     $log_record['user_name'] = tr('cog_user_name');
 }
 // koniec ukrywania autora komentarza COG przed zwykłym userem
 $file_content .= '<b>' . $log_record['user_name'] . '</b>:&nbsp;';
 if ($log_record['encrypt'] == 1 && $log_record['cache_owner'] != $usr['userid'] && $log_record['luser_id'] != $usr['userid']) {
     $file_content .= "<img src=\\'/tpl/stdstyle/images/free_icons/lock.png\\' alt=\\`\\` /><br/>";
 }
 if ($log_record['encrypt'] == 1 && ($log_record['cache_owner'] == $usr['userid'] || $log_record['luser_id'] == $usr['userid'])) {
    $cacheName = str_replace("\"", " ", $cacheName);
    $cacheNameRef = '<a href="viewcache.php?cacheid={cacheId}">{cacheName}<a>';
    $cacheNameRef = str_replace('{cacheId}', $cacheId, $cacheNameRef);
    $cacheNameRef = str_replace('{cacheName}', $cacheName, $cacheNameRef);
    $cacheRegion = $record['cacheRegion'];
    $ownId = $record['user_id'];
    $userName = str_replace("'", "-", $record['userName']);
    $userName = str_replace("\"", " ", $userName);
    $userNameRef = '<a href="viewprofile.php?userid={userId}">{userName}<a>';
    $userNameRef = str_replace('{userId}', $ownId, $userNameRef);
    $userNameRef = str_replace('{userName}', $userName, $userNameRef);
    $dateAlg = date($dateFormat, strtotime($record['dateAlg']));
    $dateAlgSort = date("y.m.d", strtotime($record['dateAlg']));
    $cacheType = $record['cache_type'];
    $typeIcon = '<img src="{src}" />';
    $typeIcon = str_replace("{src}", myninc::checkCacheStatusByUser($record, $usrid), $typeIcon);
    $content .= "\n        gct.addEmptyRow();\n        gct.addToLastRow( 0, '{$typeIcon}' );\n        gct.addToLastRow( 1, '{$cacheNameRef}' );\n        gct.addToLastRow( 2, '{$cacheRegion}' );        \n        gct.addToLastRow( 3, '{$userNameRef}' );        \n        gct.addToLastRow( 4, '<span {$dateAlgSort}/> {$dateAlg}' );\n    ";
}
tpl_set_var('contentTable', $content);
unset($dbc);
tpl_BuildTemplate();
?>








Example #6
0
         `caches`.`date_hidden`, `caches`.`date_created`) DESC, `caches`.`cache_id` DESC
     LIMIT ' . ($startat + 0) . ', ' . ($perpage + 0));
 $tr_myn_click_to_view_cache = tr('myn_click_to_view_cache');
 $bgColor = '#eeeeee';
 //powertrail vel geopath variables
 $pt_cache_intro_tr = tr('pt_cache');
 $pt_icon_title_tr = tr('pt139');
 while ($r = XDb::xFetchArray($rs)) {
     if ($bgColor == '#eeeeee') {
         $bgColor = '#ffffff';
     } else {
         $bgColor = '#eeeeee';
     }
     $file_content .= '<tr bgcolor="' . $bgColor . '">';
     $file_content .= '<td style="width: 90px;">' . date($dateFormat, strtotime($r['date'])) . '</td>';
     $cacheicon = myninc::checkCacheStatusByUser($r, $user_id);
     // PowerTrail vel GeoPath icon
     if (isset($r['PT_ID'])) {
         $PT_icon = icon_geopath_small($r['PT_ID'], $r['PT_image'], $r['PT_name'], $r['PT_type'], $pt_cache_intro_tr, $pt_icon_title_tr);
     } else {
         $PT_icon = '<img src="images/rating-star-empty.png" class="icon16" alt="" title="" />';
     }
     $file_content .= '<td width="22">' . $PT_icon . '</td>';
     $file_content .= '<td width="22">&nbsp;<a class="links" href="viewcache.php?cacheid=' . htmlspecialchars($r['cacheid'], ENT_COMPAT, 'UTF-8') . '"><img src="' . $cacheicon . '" border="0" alt="' . $tr_myn_click_to_view_cache . '" title="' . $tr_myn_click_to_view_cache . '" /></a></td>';
     $file_content .= '<td><b><a class="links" href="viewcache.php?cacheid=' . htmlspecialchars($r['cacheid'], ENT_COMPAT, 'UTF-8') . '">' . htmlspecialchars($r['cachename'], ENT_COMPAT, 'UTF-8') . '</a></b></td>';
     $file_content .= '<td width="32"><b><a class="links" href="viewprofile.php?userid=' . htmlspecialchars($r['userid'], ENT_COMPAT, 'UTF-8') . '">' . htmlspecialchars($r['username'], ENT_COMPAT, 'UTF-8') . '</a></b></td>';
     $rs_log = XDb::xSql("SELECT cache_logs.id AS id, cache_logs.cache_id AS cache_id,\n                    cache_logs.type AS log_type,\n                    DATE_FORMAT(cache_logs.date,'%Y-%m-%d') AS log_date,\n                    cache_logs.text AS log_text,\n                    user.username AS user_name,\n                    caches.user_id AS cache_owner,\n                    cache_logs.encrypt encrypt,\n                    cache_logs.user_id AS luser_id,\n                    user.user_id AS user_id,\n                    log_types.icon_small AS icon_small, COUNT(gk_item.id) AS geokret_in\n            FROM (cache_logs INNER JOIN caches ON (caches.cache_id = cache_logs.cache_id))\n                INNER JOIN user ON (cache_logs.user_id = user.user_id) INNER JOIN log_types ON (cache_logs.type = log_types.id)\n                LEFT JOIN   gk_item_waypoint ON gk_item_waypoint.wp = caches.wp_oc\n                LEFT JOIN   gk_item ON gk_item.id = gk_item_waypoint.id\n                    AND gk_item.stateid<>1 AND gk_item.stateid<>4\n                    AND gk_item.typeid<>2 AND gk_item.stateid !=5\n            WHERE cache_logs.deleted=0 AND cache_logs.cache_id= ?\n            GROUP BY cache_logs.id\n            ORDER BY cache_logs.date_created DESC LIMIT 1", $r['cacheid']);
     if ($r_log = XDb::xFetchArray($rs_log)) {
         $file_content .= '<td style="width: 80px;">' . htmlspecialchars(date($dateFormat, strtotime($r_log['log_date'])), ENT_COMPAT, 'UTF-8') . '</td>';
         // PowerTrail vel GeoPath icon
         $file_content .= '<td width="22"><b><a class="links" href="viewlogs.php?logid=' . htmlspecialchars($r_log['id'], ENT_COMPAT, 'UTF-8') . '" onmouseover="Tip(\'';