@@ -84,7 +84,8 @@ discard block |
||
| 84 | 84 | $called_by_search = isset($_REQUEST['calledbysearch']) ? $_REQUEST['calledbysearch'] <> 0 : true; |
| 85 | 85 | $called_by_profile_query = false; |
| 86 | 86 | |
| 87 | -if (isset($_REQUEST['queryid']) || isset($_REQUEST['showresult'])) { // Ocprop: showresult, queryid |
|
| 87 | +if (isset($_REQUEST['queryid']) || isset($_REQUEST['showresult'])) { |
|
| 88 | +// Ocprop: showresult, queryid |
|
| 88 | 89 | $bCookieQueryid = false; |
| 89 | 90 | $queryid = isset($_REQUEST['queryid']) ? $_REQUEST['queryid'] : 0; |
| 90 | 91 | if ($queryid && |
@@ -208,7 +209,8 @@ discard block |
||
| 208 | 209 | sql_free_result($rs_name); |
| 209 | 210 | } |
| 210 | 211 | } |
| 211 | -} else { // $queryid == 0 |
|
| 212 | +} else { |
|
| 213 | +// $queryid == 0 |
|
| 212 | 214 | // build search options from GET/POST parameters or default values |
| 213 | 215 | |
| 214 | 216 | // hack |
@@ -287,12 +289,14 @@ discard block |
||
| 287 | 289 | if (!isset($_REQUEST['utf8'])) { |
| 288 | 290 | $options['cachename'] = iconv("ISO-8859-1", "UTF-8", $options['cachename']); |
| 289 | 291 | } |
| 290 | - } elseif (isset($_REQUEST['searchbyowner'])) { // Ocprop |
|
| 292 | + } elseif (isset($_REQUEST['searchbyowner'])) { |
|
| 293 | +// Ocprop |
|
| 291 | 294 | $options['searchtype'] = 'byowner'; |
| 292 | 295 | |
| 293 | 296 | $options['ownerid'] = isset($_REQUEST['ownerid']) ? $_REQUEST['ownerid'] : 0; |
| 294 | 297 | $options['owner'] = isset($_REQUEST['owner']) ? stripslashes($_REQUEST['owner']) : ''; |
| 295 | - } elseif (isset($_REQUEST['searchbyfinder'])) { // Ocprop |
|
| 298 | + } elseif (isset($_REQUEST['searchbyfinder'])) { |
|
| 299 | +// Ocprop |
|
| 296 | 300 | $options['searchtype'] = 'byfinder'; |
| 297 | 301 | |
| 298 | 302 | $options['finderid'] = isset($_REQUEST['finderid']) ? $_REQUEST['finderid'] : 0; |
@@ -437,7 +441,8 @@ discard block |
||
| 437 | 441 | $bRememberQuery = isset($_REQUEST['skipqueryid']) ? !$_REQUEST['skipqueryid'] : true; |
| 438 | 442 | // This is used by the map, which implements its own query-caching. |
| 439 | 443 | if ($bRememberQuery) { |
| 440 | - if ($queryid == 0 && $options['showresult'] != 0) { // 'showresult' = "execute query" |
|
| 444 | + if ($queryid == 0 && $options['showresult'] != 0) { |
|
| 445 | +// 'showresult' = "execute query" |
|
| 441 | 446 | sql( |
| 442 | 447 | "INSERT INTO `queries` (`user_id`, `options`, `last_queried`) VALUES (0, '&1', NOW())", |
| 443 | 448 | serialize($options) |
@@ -854,7 +859,8 @@ discard block |
||
| 854 | 859 | outputSearchForm($options); |
| 855 | 860 | exit; |
| 856 | 861 | } |
| 857 | - } elseif ($options['searchtype'] == 'bydistance') { // Ocprop |
|
| 862 | + } elseif ($options['searchtype'] == 'bydistance') { |
|
| 863 | +// Ocprop |
|
| 858 | 864 | //check the entered data |
| 859 | 865 | if (isset($options['lat']) && isset($options['lon'])) { |
| 860 | 866 | $lat = $options['lat'] + 0; |
@@ -924,7 +930,8 @@ discard block |
||
| 924 | 930 | $sql_innerjoin[] = '`cache_logs` ON `caches`.`cache_id`=`cache_logs`.`cache_id`'; |
| 925 | 931 | $sql_where[] = '`cache_logs`.`user_id`=\'' . sql_escape($finder_id) . '\''; |
| 926 | 932 | |
| 927 | - if ($options['logtype'] != '0') { // 0 = all types |
|
| 933 | + if ($options['logtype'] != '0') { |
|
| 934 | +// 0 = all types |
|
| 928 | 935 | $ids = explode(',', $options['logtype']); |
| 929 | 936 | $idNumbers = '0'; |
| 930 | 937 | foreach ($ids as $id) { |
@@ -1405,7 +1412,8 @@ discard block |
||
| 1405 | 1412 | } |
| 1406 | 1413 | |
| 1407 | 1414 | $count = $caches_per_page; |
| 1408 | - if (isset($_REQUEST['count'])) { // Ocprop |
|
| 1415 | + if (isset($_REQUEST['count'])) { |
|
| 1416 | +// Ocprop |
|
| 1409 | 1417 | $count = floor($_REQUEST['count'] + 0); |
| 1410 | 1418 | } |
| 1411 | 1419 | if ($count == 'max') { |
@@ -1525,7 +1533,8 @@ discard block |
||
| 1525 | 1533 | } else { |
| 1526 | 1534 | exit; |
| 1527 | 1535 | } |
| 1528 | -} else { // $options['showresult'] == 0 |
|
| 1536 | +} else { |
|
| 1537 | +// $options['showresult'] == 0 |
|
| 1529 | 1538 | //============================================================= |
| 1530 | 1539 | // F5. present search options form to the user |
| 1531 | 1540 | //============================================================= |
@@ -1597,7 +1606,8 @@ discard block |
||
| 1597 | 1606 | |
| 1598 | 1607 | if (isset($options['sort'])) { |
| 1599 | 1608 | $bBynameChecked = ($options['sort'] == 'byname'); |
| 1600 | - } else { // Ocprop |
|
| 1609 | + } else { |
|
| 1610 | +// Ocprop |
|
| 1601 | 1611 | $bBynameChecked = (!$login->logged_in()); |
| 1602 | 1612 | } |
| 1603 | 1613 | $tpl->assign('byname_checked', $bBynameChecked); |
@@ -1759,7 +1769,8 @@ discard block |
||
| 1759 | 1769 | } |
| 1760 | 1770 | if ($options['searchtype'] == 'bydistance') { |
| 1761 | 1771 | $dByDistanceChecked = ($options['searchtype'] == 'bydistance'); |
| 1762 | - } else { // Ocprop |
|
| 1772 | + } else { |
|
| 1773 | +// Ocprop |
|
| 1763 | 1774 | $dByDistanceChecked = false; |
| 1764 | 1775 | } |
| 1765 | 1776 | $tpl->assign('dbydistance_checked', $dByDistanceChecked); |
@@ -1800,7 +1811,8 @@ discard block |
||
| 1800 | 1811 | ); |
| 1801 | 1812 | if ($options['searchtype'] == 'bywaypoint') { |
| 1802 | 1813 | $dByWaypointChecked = ($options['searchtype'] == 'bywaypoint'); |
| 1803 | - } else { // Ocprop |
|
| 1814 | + } else { |
|
| 1815 | +// Ocprop |
|
| 1804 | 1816 | $dByWaypointChecked = false; |
| 1805 | 1817 | } |
| 1806 | 1818 | $tpl->assign('dbywaypoint_checked', $dByWaypointChecked); |
@@ -24,7 +24,8 @@ discard block |
||
| 24 | 24 | if ($error == false) { |
| 25 | 25 | //logid |
| 26 | 26 | $log_id = 0; |
| 27 | - if (isset($_REQUEST['logid'])) { // Ocprop |
|
| 27 | + if (isset($_REQUEST['logid'])) { |
|
| 28 | +// Ocprop |
|
| 28 | 29 | $log_id = $_REQUEST['logid']; |
| 29 | 30 | } |
| 30 | 31 | |
@@ -273,7 +274,8 @@ discard block |
||
| 273 | 274 | } |
| 274 | 275 | |
| 275 | 276 | //store? |
| 276 | - if ($date_ok && $logtype_ok && $pw_ok && isset($_POST['submitform'])) { // Ocprop |
|
| 277 | + if ($date_ok && $logtype_ok && $pw_ok && isset($_POST['submitform'])) { |
|
| 278 | +// Ocprop |
|
| 277 | 279 | // 00:00:01 = "00:00 was logged" |
| 278 | 280 | // 00:00:00 = "no time was logged" |
| 279 | 281 | if ("$log_time_hour$log_time_minute" != "" && |
@@ -24,14 +24,16 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | // check login |
| 26 | 26 | $login->verify(); |
| 27 | -if ($login->userid == 0) |
|
| 27 | +if ($login->userid == 0) { |
|
| 28 | 28 | $tpl->redirect_login(); |
| 29 | +} |
|
| 29 | 30 | |
| 30 | 31 | // get cache_id if not given |
| 31 | 32 | $cacheId = 0; |
| 32 | 33 | if (isset($_REQUEST['wp'])) { |
| 33 | 34 | $cacheId = cache::cacheIdFromWP($_REQUEST['wp']); |
| 34 | -} elseif (isset($_REQUEST['cacheid'])) { // Ocprop |
|
| 35 | +} elseif (isset($_REQUEST['cacheid'])) { |
|
| 36 | +// Ocprop |
|
| 35 | 37 | $cacheId = $_REQUEST['cacheid']; |
| 36 | 38 | } |
| 37 | 39 | |
@@ -216,7 +218,8 @@ discard block |
||
| 216 | 218 | $validate['duplicateLog'] = true; |
| 217 | 219 | |
| 218 | 220 | // all checks done, no error => log |
| 219 | - if (isset($_POST['submitform']) && $loggable) // Ocprop |
|
| 221 | + if (isset($_POST['submitform']) && $loggable) { |
|
| 222 | + // Ocprop |
|
| 220 | 223 | { |
| 221 | 224 | /* |
| 222 | 225 | * check if time is logged |
@@ -226,6 +229,7 @@ discard block |
||
| 226 | 229 | $logTimeSecond = ($logTimeHour . $logTimeMinute != "" |
| 227 | 230 | && $logTimeHour == 0 |
| 228 | 231 | && $logTimeMinute == 0) + 0; |
| 232 | + } |
|
| 229 | 233 | |
| 230 | 234 | // make time values database ready |
| 231 | 235 | $logDate = date( |
@@ -1,9 +1,10 @@ |
||
| 1 | 1 | <?php |
| 2 | - if (isset($_REQUEST['lang'])) |
|
| 3 | - $lang = $_REQUEST['lang']; |
|
| 4 | - else |
|
| 5 | - $lang = 'de'; |
|
| 6 | -?> |
|
| 2 | + if (isset($_REQUEST['lang'])) { |
|
| 3 | + $lang = $_REQUEST['lang']; |
|
| 4 | + } else { |
|
| 5 | + $lang = 'de'; |
|
| 6 | + } |
|
| 7 | + ?> |
|
| 7 | 8 | |
| 8 | 9 | tinyMCE_GZ.init({ |
| 9 | 10 | plugins : 'advhr,contextmenu,emotions,insertdatetime,paste,table', |
@@ -145,10 +145,11 @@ discard block |
||
| 145 | 145 | <td><strong>{t}Language:{/t} </strong></td> |
| 146 | 146 | <td> |
| 147 | 147 | <?php |
| 148 | - foreach ($opt['template']['locales'] AS $k => $lang) |
|
| 149 | - if ($lang['show'] == true) |
|
| 148 | + foreach ($opt['template']['locales'] AS $k => $lang) { |
|
| 149 | + if ($lang['show'] == true) |
|
| 150 | 150 | echo '<a style="text-decoration: none;" href="index.php?locale=' . $k . '"><img src="' . $lang['flag'] . '" alt="' . $lang['name'] . '" title="' . $lang['name'] . '" width="24px" height="18px" /></a> '; |
| 151 | -?> |
|
| 151 | + } |
|
| 152 | + ?> |
|
| 152 | 153 | </td> |
| 153 | 154 | <td> <strong>{t}Country:{/t} </strong></td> |
| 154 | 155 | <td> |
@@ -157,10 +158,8 @@ discard block |
||
| 157 | 158 | global $tpl_usercountries; |
| 158 | 159 | $nLastGroup = 0; |
| 159 | 160 | $maxUserCountries = count($tpl_usercountries); |
| 160 | - for ($i = 0; $i < $maxUserCountries; $i++) |
|
| 161 | - { |
|
| 162 | - if ($nLastGroup != $tpl_usercountries[$i]['group']) |
|
| 163 | - { |
|
| 161 | + for ($i = 0; $i < $maxUserCountries; $i++) { |
|
| 162 | + if ($nLastGroup != $tpl_usercountries[$i]['group']) { |
|
| 164 | 163 | echo '<option disabled="disabled">'; |
| 165 | 164 | if ($tpl_usercountries[$i]['group'] == 1) { |
| 166 | 165 | echo '- ' . t('This OC node') . ' -'; |
@@ -205,11 +204,12 @@ discard block |
||
| 205 | 204 | <ul> |
| 206 | 205 | <?php |
| 207 | 206 | // $pageidx is -1 e.g. when calling newcache.php as logged-off-user (-> login.tpl.php) |
| 208 | - if ($pageidx >= 0) |
|
| 209 | - mnu_EchoMainMenu($menu[$pageidx]['siteid']); |
|
| 210 | - else |
|
| 211 | - mnu_EchoMainMenu(-1); |
|
| 212 | -?> |
|
| 207 | + if ($pageidx >= 0) { |
|
| 208 | + mnu_EchoMainMenu($menu[$pageidx]['siteid']); |
|
| 209 | + } else { |
|
| 210 | + mnu_EchoMainMenu(-1); |
|
| 211 | + } |
|
| 212 | + ?> |
|
| 213 | 213 | </ul> |
| 214 | 214 | </div> |
| 215 | 215 | |
@@ -228,8 +228,7 @@ discard block |
||
| 228 | 228 | <div class="nav3"> |
| 229 | 229 | <?php |
| 230 | 230 | //SubNavigation |
| 231 | - if (isset($menu[$pageidx]['submenu'])) |
|
| 232 | - { |
|
| 231 | + if (isset($menu[$pageidx]['submenu'])) { |
|
| 233 | 232 | ?> |
| 234 | 233 | <ul> |
| 235 | 234 | <li class="title">{t}Main menu{/t}</li> |
@@ -257,8 +256,7 @@ discard block |
||
| 257 | 256 | |
| 258 | 257 | <!-- Paypalbutton --> |
| 259 | 258 | <?php |
| 260 | - if (isset($opt['page']['showdonations']) && $opt['page']['showdonations']) |
|
| 261 | - { |
|
| 259 | + if (isset($opt['page']['showdonations']) && $opt['page']['showdonations']) { |
|
| 262 | 260 | ?> |
| 263 | 261 | <p class="sidebar-maintitle">{t}Donations{/t}</p> |
| 264 | 262 | <div style="margin-top:16px;width:100%;text-align:center;"> |
@@ -273,8 +271,7 @@ discard block |
||
| 273 | 271 | |
| 274 | 272 | <!-- Social Media --> |
| 275 | 273 | <?php |
| 276 | - if (isset($opt['page']['showsocialmedia']) && $opt['page']['showsocialmedia']) |
|
| 277 | - { |
|
| 274 | + if (isset($opt['page']['showsocialmedia']) && $opt['page']['showsocialmedia']) { |
|
| 278 | 275 | ?> |
| 279 | 276 | <p class="sidebar-maintitle">{t}Social media{/t}</p> |
| 280 | 277 | <div style="margin-top: 10px; margin-bottom: 14px; margin-left: auto; margin-right: auto; text-align: center"> |
@@ -423,7 +423,8 @@ |
||
| 423 | 423 | { |
| 424 | 424 | global $menu; |
| 425 | 425 | |
| 426 | - if ($mainmenuindex >= 0) { // is -1 e.g. when calling newcache.php as logged-off-user (-> login.tpl.php) |
|
| 426 | + if ($mainmenuindex >= 0) { |
|
| 427 | +// is -1 e.g. when calling newcache.php as logged-off-user (-> login.tpl.php) |
|
| 427 | 428 | echo htmlspecialchars(t($menu[$mainmenuindex]['menustring']), ENT_COMPAT, 'UTF-8'); |
| 428 | 429 | |
| 429 | 430 | if (isset($menu[$mainmenuindex]['submenu']) && ($menu[$mainmenuindex]['siteid'] != $pageid)) { |
@@ -34,10 +34,12 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | $uuid = isset($_REQUEST['uuid']) ? $_REQUEST['uuid'] : 0; |
| 36 | 36 | |
| 37 | -if ($action == 'add') { // Ocprop |
|
| 37 | +if ($action == 'add') { |
|
| 38 | +// Ocprop |
|
| 38 | 39 | $picture = new picture(); |
| 39 | 40 | |
| 40 | - if (isset($_REQUEST['cacheuuid'])) { // Ocprop |
|
| 41 | + if (isset($_REQUEST['cacheuuid'])) { |
|
| 42 | +// Ocprop |
|
| 41 | 43 | $cache = cache::fromUUID($_REQUEST['cacheuuid']); |
| 42 | 44 | if ($cache === null) { |
| 43 | 45 | $tpl->error(ERROR_CACHE_NOT_EXISTS); |
@@ -51,7 +53,8 @@ discard block |
||
| 51 | 53 | $picture->setObjectType(OBJECT_CACHE); |
| 52 | 54 | |
| 53 | 55 | $cache = null; |
| 54 | - } elseif (isset($_REQUEST['loguuid'])) {// Ocprop |
|
| 56 | + } elseif (isset($_REQUEST['loguuid'])) { |
|
| 57 | +// Ocprop |
|
| 55 | 58 | $cachelog = cachelog::fromUUID($_REQUEST['loguuid']); |
| 56 | 59 | if ($cachelog === null) { |
| 57 | 60 | $tpl->error(ERROR_CACHELOG_NOT_EXISTS); |
@@ -72,7 +75,8 @@ discard block |
||
| 72 | 75 | } |
| 73 | 76 | |
| 74 | 77 | // uploaded file ok? |
| 75 | - if (isset($_REQUEST['ok'])) { // Ocprop |
|
| 78 | + if (isset($_REQUEST['ok'])) { |
|
| 79 | +// Ocprop |
|
| 76 | 80 | $bError = false; |
| 77 | 81 | |
| 78 | 82 | $picture->setSpoiler(isset($_REQUEST['spoiler']) && $_REQUEST['spoiler'] == '1'); // Ocprop |
@@ -92,7 +96,8 @@ discard block |
||
| 92 | 96 | $tpl->redirect($picture->getPageLink()); |
| 93 | 97 | } |
| 94 | 98 | |
| 95 | - if (!isset($_FILES['file'])) { // Ocprop |
|
| 99 | + if (!isset($_FILES['file'])) { |
|
| 100 | +// Ocprop |
|
| 96 | 101 | $tpl->assign('errorfile', ERROR_UPLOAD_ERR_NO_FILE); |
| 97 | 102 | $bError = true; |
| 98 | 103 | } elseif ($_FILES['file']['error'] == UPLOAD_ERR_NO_FILE) { |
@@ -757,7 +757,8 @@ discard block |
||
| 757 | 757 | $cacheid, |
| 758 | 758 | $rdate |
| 759 | 759 | ); |
| 760 | - if ($r = sql_fetch_assoc($rs)) { // should always be true ... |
|
| 760 | + if ($r = sql_fetch_assoc($rs)) { |
|
| 761 | +// should always be true ... |
|
| 761 | 762 | if (!$simulate) { |
| 762 | 763 | sql( |
| 763 | 764 | "UPDATE `caches` SET `latitude`='&1', `longitude`='&2' WHERE `cache_id`='&3'", |
@@ -790,7 +791,8 @@ discard block |
||
| 790 | 791 | $cacheid, |
| 791 | 792 | $rdate |
| 792 | 793 | ); |
| 793 | - if ($r = sql_fetch_assoc($rs)) { // should always be true ... |
|
| 794 | + if ($r = sql_fetch_assoc($rs)) { |
|
| 795 | +// should always be true ... |
|
| 794 | 796 | if (!$simulate) { |
| 795 | 797 | sql( |
| 796 | 798 | "UPDATE `caches` SET `country`='&1' WHERE `cache_id`='&2'", |
@@ -827,7 +829,8 @@ discard block |
||
| 827 | 829 | 'wp_nc' => 'waypoints' |
| 828 | 830 | ]; |
| 829 | 831 | |
| 830 | - if ($r = sql_fetch_assoc($rs)) {// can be false |
|
| 832 | + if ($r = sql_fetch_assoc($rs)) { |
|
| 833 | +// can be false |
|
| 831 | 834 | $setfields = ""; |
| 832 | 835 | foreach ($fields as $field => $ropt) { |
| 833 | 836 | if (in_array($ropt, $roptions) && $r[$field] != $cache[$field]) { |
@@ -896,13 +899,15 @@ discard block |
||
| 896 | 899 | |
| 897 | 900 | while ($r = sql_fetch_assoc($rs)) { |
| 898 | 901 | if (!$simulate) { |
| 899 | - if ($r['desc'] === null) { // was newly created -> delete |
|
| 902 | + if ($r['desc'] === null) { |
|
| 903 | +// was newly created -> delete |
|
| 900 | 904 | sql( |
| 901 | 905 | "DELETE FROM `cache_desc` WHERE `cache_id`='&1' AND `language`='&2'", |
| 902 | 906 | $cacheid, |
| 903 | 907 | $r['language'] |
| 904 | 908 | ); |
| 905 | - } else {// id, uuid, date_created and last_modified are set automatically |
|
| 909 | + } else { |
|
| 910 | +// id, uuid, date_created and last_modified are set automatically |
|
| 906 | 911 | sql( |
| 907 | 912 | "INSERT INTO `cache_desc` |
| 908 | 913 | (`node`, `cache_id`, `language`, `desc`, `desc_html`, `desc_htmledit`, `hint`, `short_desc`) |
@@ -44,7 +44,8 @@ |
||
| 44 | 44 | $file = fopen($filename, "r"); |
| 45 | 45 | $cnt = 0; |
| 46 | 46 | while ($line = fgets($file, 4096)) { |
| 47 | - if ($cnt ++ == 0) {// skip first line |
|
| 47 | + if ($cnt ++ == 0) { |
|
| 48 | +// skip first line |
|
| 48 | 49 | continue; |
| 49 | 50 | } |
| 50 | 51 | |