Пример #1
0
 $s = $dbcSearch->simpleQuery('SELECT `wptcontent`.`cache_id` `cacheid`, `wptcontent`.`longitude` `longitude`, `wptcontent`.`latitude` `latitude`, `caches`.`date_hidden` `date_hidden`,
             `caches`.`name` `name`, `caches`.`wp_oc` `wp_oc`, `cache_type`.`short` `typedesc`, `cache_size`.`pl` `sizedesc`,
             `caches`.`terrain` `terrain`, `caches`.`difficulty` `difficulty`, `user`.`username` `username` , `caches`.`size` `size`,
             `caches`.`type` `type`
     FROM `wptcontent`, `caches`, `cache_type`, `cache_size`, `user`
     WHERE `wptcontent`.`cache_id`=`caches`.`cache_id` AND `wptcontent`.`type`=`cache_type`.`id`
         AND `wptcontent`.`size`=`cache_size`.`id` AND `wptcontent`.`user_id`=`user`.`user_id`');
 append_output(pack("ccccl", 0xbb, 0x22, 0xd5, 0x3f, $rCount['count']));
 while ($r = $dbcSearch->dbResultFetch($s)) {
     $lat = $r['latitude'];
     $lon = $r['longitude'];
     $utm = cs2cs_1992($lat, $lon);
     $x = (int) $utm[0];
     $y = (int) $utm[1];
     $name = PLConvert('UTF-8', 'POLSKAWY', $r['name']);
     $username = PLConvert('UTF-8', 'POLSKAWY', $r['username']);
     $type = $uamType[$r['type']];
     $size = $uamSize[$r['size']];
     $difficulty = sprintf('%01.1f', $r['difficulty'] / 2);
     $terrain = sprintf('%01.1f', $r['terrain'] / 2);
     $cacheid = $r['wp_oc'];
     $descr = "{$name} by {$username} [{$difficulty}/{$terrain}]";
     $poiname = "{$cacheid} {$type}{$size}";
     $record = pack("llca64a255cca32", $x, $y, 2, $poiname, $descr, 1, 99, 'Geocaching');
     append_output($record);
     ob_flush();
 }
 XDb::xSql('DROP TABLE `wptcontent` ');
 // phpzip versenden
 if ($bUseZip == true) {
     $phpzip->add_data($sFilebasename . '.uam', $content);
Пример #2
0
function cleanup_text($str)
{
    // $str= tidy_html_description($str);
    $str = PLConvert('UTF-8', 'POLSKAWY', $str);
    $str = strip_tags($str, "<p><br /><li>");
    // <p> -> nic
    // </p>, <br /> -> nowa linia
    $from[] = '<p>';
    $to[] = '';
    $from[] = '</p>';
    $to[] = "\n";
    $from[] = '<br />';
    $to[] = "\n";
    $from[] = '<br>';
    $to[] = "\n";
    $from[] = '<br>';
    $to[] = "\n";
    $from[] = '<li>';
    $to[] = " - ";
    $from[] = '</li>';
    $to[] = "\n";
    $from[] = '&oacute;';
    $to[] = 'o';
    $from[] = '&quot;';
    $to[] = '"';
    $from[] = '&[^;]*;';
    $to[] = '';
    $from[] = '&';
    $to[] = '&amp;';
    $from[] = '<';
    $to[] = '&lt;';
    $from[] = '>';
    $to[] = '&gt;';
    $from[] = ']]>';
    $to[] = ']] >';
    $from[] = '';
    $to[] = '';
    for ($i = 0; $i < count($from); $i++) {
        $str = str_replace($from[$i], $to[$i], $str);
    }
    $str = preg_replace('/[[:cntrl:]]/', '', $str);
    return $str;
}
Пример #3
0
     $thisline = $locLine;
     $lat = sprintf('%01.5f', $r['latitude']);
     $thisline = mb_ereg_replace('{lat}', $lat, $thisline);
     $lon = sprintf('%01.5f', $r['longitude']);
     $thisline = mb_ereg_replace('{lon}', $lon, $thisline);
     $thisline = mb_ereg_replace('{{waypoint}}', $r['waypoint'], $thisline);
     $thisline = mb_ereg_replace('{cachename}', PLConvert('UTF-8', 'POLSKAWY', $r['name']), $thisline);
     // modified coords
     if ($r['cache_mod_cords_id'] > 0) {
         // check if we have user coords
         $thisline = str_replace('{mod_suffix}', '<F>', $thisline);
     } else {
         $thisline = str_replace('{mod_suffix}', '', $thisline);
     }
     $thisline = mb_ereg_replace('{type_text}', $cacheTypeText[$r['type_id']], $thisline);
     $thisline = mb_ereg_replace('{{size}}', PLConvert('UTF-8', 'POLSKAWY', tr('cacheType_' . $r['type_id'])), $thisline);
     $difficulty = sprintf('%01.1f', $r['difficulty'] / 2);
     $thisline = mb_ereg_replace('{difficulty}', $difficulty, $thisline);
     $terrain = sprintf('%01.1f', $r['terrain'] / 2);
     $thisline = mb_ereg_replace('{terrain}', $terrain, $thisline);
     $thisline = mb_ereg_replace('{owner}', $r['username'], $thisline);
     $thisline = mb_ereg_replace('{cacheid}', $r['cacheid'], $thisline);
     append_output($thisline);
     ob_flush();
 }
 append_output($locFoot);
 // phpzip versenden
 if ($bUseZip == true) {
     $phpzip->add_data($sFilebasename . '.loc', $content);
     echo $phpzip->save($sFilebasename . '.zip', 'b');
 }