Ejemplo n.º 1
0
    function show()
    {
        $cache0 = new wra_cacheflow('rss', true);
        if ($cache0->begin()) {
            $this->items = wra_foursqvenues::get_list(0, time(), 250);
            $this->items = array_reverse($this->items);
            if (count($this->items) < 30) {
                $enues = wra_foursqvenues::get_l30(intval(time()));
                $before = time();
                if (count($this->items) > 0) {
                    $before = $this->items[count($this->items) - 1]->time;
                }
                for ($i = 0; $i < 30 - count($this->items); $i++) {
                    if ($enues[$i]->time < $before) {
                        $this->items[] = $enues[$i];
                    }
                }
            }
            WRA::e('<?');
            ?>
xml version="1.0" encoding="UTF-8"<?php 
            WRA::e('?>');
            ?>
<rss version="2.0">
  <channel>
    <title>Liveuamap.com</title>
    <link>http://liveuamap.com/</link>
    <description>Fresh news from Ukraine on the map, event of summer 2014, war between Russia and Ukraine, beginning of Third World War. 2014 pro-Russian conflict in Ukraine </description>
    <language>en-us</language>
    <pubDate><?php 
            WRA::e(date('D, d M Y g:i:s O', time()));
            ?>
</pubDate>
 
    <lastBuildDate><?php 
            WRA::e(date('D, d M Y g:i:s O', time()));
            ?>
</lastBuildDate>
    <docs>http://liveuamap.com/rss</docs>
    <generator>Liveuamap Feed</generator>
    <managingEditor>info@liveuamap.com</managingEditor>
    <webMaster>info@liveuamap.com</webMaster>
<?php 
            foreach ($this->items as $a0) {
                ?>
  <item>
      <title><?php 
                WRA::e(htmlspecialchars($a0->name));
                ?>
</title>
      <link><?php 
                WRA::e($a0->getlink());
                ?>
</link>
      <description><?php 
                WRA::e(htmlspecialchars($a0->name));
                ?>
</description>
      <pubDate><?php 
                WRA::e(date('D, d M Y g:i:s O', $a0->time));
                ?>
</pubDate>
      <guid><?php 
                WRA::e($a0->getlink());
                ?>
</guid>
      <?php 
                if (!empty($a0->picture)) {
                    $ext = str_replace(':large', '', pathinfo($a0->picture, PATHINFO_EXTENSION));
                    $link = 'http://liveuamap.com/uploads/' . $a0->id . '.' . $ext;
                    if (!file_exists(WRA_Path . '/uploads/' . $a0->id . '.' . $ext)) {
                        $this->save_image($a0->picture, WRA_Path . '/uploads/' . $a0->id . '.' . $ext);
                    }
                    ?>
  <image>
<url><?php 
                    WRA::e($link);
                    ?>
</url>
  <link><?php 
                    WRA::e($a0->getlink());
                    ?>
</link>
      </image><?php 
                }
                ?>
  </item>
<?php 
            }
            ?>
  
  </channel></rss><?php 
        }
        $cache0->end();
    }
Ejemplo n.º 2
0
 function run()
 {
     $this->nofooter = true;
     $this->noheader = true;
     $this->act = $_REQUEST['act'];
     $this->return = array();
     //  $this->query(addslashes($_SERVER['QUERY_STRING']));
     switch ($this->act) {
         case 'pts':
             $time = intval($_GET['time']);
             $curid = intval($_GET['curid']);
             $last = intval($_GET['last']);
             if ($last == 0 && time() - 9600 < $time) {
                 $time = time();
             }
             $cache0 = new wra_cacheflow('p' . $last . intval($time / 50000), true);
             if ($cache0->begin()) {
                 if (intval($_REQUEST['last']) == 0) {
                     $this->venues = wra_foursqvenues::get_list(intval($_GET['curid']), intval($time), 250);
                     $this->fieldsarrow = wra_foursqvenues::get_listfields(intval($_GET['curid']), intval($time), 250);
                     if (count($this->venues) < 30) {
                         $enues = wra_foursqvenues::get_l30(intval($time));
                         $before = time();
                         if (count($this->venues) > 0) {
                             $before = $this->venues[count($this->venues) - 1]->time;
                         }
                         for ($i = 0; $i < 30 - count($this->venues); $i++) {
                             if ($enues[$i]->time < $before) {
                                 $this->venues[] = $enues[$i];
                             }
                         }
                     }
                 } else {
                     $this->venues = wra_foursqvenues::get_listlast(intval($_REQUEST['last']));
                 }
                 $this->cats = wra_cats::get_list();
                 foreach ($this->venues as $k => $v) {
                     $this->venues[$k]->name = htmlspecialchars($this->venues[$k]->name);
                     $this->venues[$k]->cat = $this->cats[$v->cat_id];
                     //   if(time()-$v->time>86400)
                     // $this->venues[$k]->time=date('d.m.Y H:i',$v->time);
                     // else
                     if (time() - $v->time < 60) {
                         $this->venues[$k]->time = 'just now';
                     } else {
                         $this->venues[$k]->time = $this->humanTiming($v->time);
                     }
                     $this->venues[$k]->sf = '';
                     if ($this->venues[$k]->id > wra_foursqvenues::$linknumber) {
                         $this->venues[$k]->target = $this->venues[$k]->link;
                     }
                     $this->venues[$k]->link = '';
                     $this->venues[$k]->sel_link = '';
                 }
                 $this->return['last'] = $_REQUEST['last'];
                 $this->return['venues'] = $this->venues;
                 $this->return['fields'] = $this->fieldsarrow;
                 $this->return['cats'] = $this->cats;
                 $this->return['datac'] = date('d', intval($_GET['time']) + 6400);
                 $this->return['datam'] = date('F', intval($_GET['time']) + 6400);
                 $this->return['datay'] = date('Y', intval($_GET['time']) + 6400);
                 $this->return['amount'] = count($this->venues);
                 WRA::e(json_encode($this->return, JSON_NUMERIC_CHECK));
             }
             $cache0->end(false);
             /*
                                        if($curid==0)
                                     else{
                                    $this->return= json_decode( $cache0->end(true));
                                       $this->venue=new wra_foursqvenues();
                                      $this->venue->load($curid);
                                      
                                      WRA::e(json_encode($this->return, JSON_NUMERIC_CHECK));  
                                  
                                     }*/
             $this->wf->nicedie();
             break;
         default:
             $this->return = array("err" => 1, "text" => "No action");
             break;
     }
 }