Exemplo n.º 1
0
 static function adminit($wfadmin)
 {
     $wfadmin->table = 'foursqvenues';
     $wfadmin->multilanguages = false;
     //$wfadmin->columns[] = new admincolumn("String", "id", "id", admincolumntype::text, admincolumntype::text, 1);
     $wfadmin->columns[] = new admincolumn("String", "time", "time", admincolumntype::text, admincolumntype::text, 2);
     $wfadmin->columns[] = new admincolumn("String", "name", "name", admincolumntype::text, admincolumntype::text, 3);
     $wfadmin->columns[] = new admincolumn("String", "address", "address", admincolumntype::text, admincolumntype::text, 4);
     $wfadmin->columns[] = new admincolumn("String", "city", "city", admincolumntype::none, admincolumntype::text, 5);
     $wfadmin->columns[] = new admincolumn("String", "ttl", "ttl", admincolumntype::none, admincolumntype::text, 6);
     $wfadmin->columns[] = new admincolumn("String", "source", "source", admincolumntype::none, admincolumntype::text, 7);
     $wfadmin->columns[] = new admincolumn("String", "lat", "lat", admincolumntype::none, admincolumntype::text, 8);
     $wfadmin->columns[] = new admincolumn("String", "lng", "lng", admincolumntype::none, admincolumntype::text, 9);
     $wfadmin->columns[] = new admincolumn("String", "color_id", "color_id", admincolumntype::none, admincolumntype::dropdown, 11, array('1' => 'ukr', '2' => 'ru'));
     $wfadmin->columns[] = new admincolumn("String", "cat_id", "cat_id", admincolumntype::none, admincolumntype::dropdown, 11, wra_cats::getdrop());
     $wfadmin->columns[] = new admincolumn("String", "picture", "picture", admincolumntype::none, admincolumntype::text, 12);
     $wfadmin->columns[] = new admincolumn("String", "link", "link", admincolumntype::none, admincolumntype::text, 13);
     $wfadmin->columns[] = new admincolumn("String", "description", "description", admincolumntype::none, admincolumntype::text, 14);
     $wfadmin->columns[] = new admincolumn("String", "status", "status", admincolumntype::none, admincolumntype::text, 15);
     $wfadmin->columns[] = new admincolumn("String", "updated", "updated", admincolumntype::none, admincolumntype::text, 16);
     $wfadmin->columns[] = new admincolumn("String", "resource", "resource", admincolumntype::none, admincolumntype::text, 17);
     $wfadmin->columns[] = new admincolumn("String", "points", "points", admincolumntype::none, admincolumntype::bigtext, 18);
     $wfadmin->columns[] = new admincolumn("String", "type_id", "type_id", admincolumntype::none, admincolumntype::text, 19);
     $wfadmin->columns[] = new admincolumn("String", "strokeweight", "strokeweight", admincolumntype::none, admincolumntype::text, 20);
     $wfadmin->columns[] = new admincolumn("String", "strokeopacity", "strokeopacity", admincolumntype::none, admincolumntype::text, 21);
     $wfadmin->columns[] = new admincolumn("String", "strokecolor", "strokecolor", admincolumntype::none, admincolumntype::text, 22);
     $wfadmin->columns[] = new admincolumn("String", "symbolpath", "symbolpath", admincolumntype::none, admincolumntype::text, 23);
     $wfadmin->columns[] = new admincolumn("String", "fillcolor", "fillcolor", admincolumntype::none, admincolumntype::text, 24);
     $wfadmin->columns[] = new admincolumn("String", "fillopacity", "fillopacity", admincolumntype::none, admincolumntype::text, 25);
     $wfadmin->columns[] = new admincolumn("String", "twitpic", "twitpic", admincolumntype::none, admincolumntype::text, 26);
     $wfadmin->columns[] = new admincolumn("String", "user_added", "user_added", admincolumntype::none, admincolumntype::text, 27);
     $wfadmin->columns[] = new admincolumn("String", "tts", "tts", admincolumntype::none, admincolumntype::text, 28);
     $wfadmin->columns[] = new admincolumn("String", "status_id", "status_id", admincolumntype::none, admincolumntype::text, 29);
     $wfadmin->order = " order by id desc";
 }
Exemplo n.º 2
0
 function run()
 {
     parent::run();
     $this->nofooter = true;
     $this->noheader = true;
     $this->wf->cp->ogimage = WRA::base_url() . 'images/500.png';
     $adminmark = '';
     if (wra_userscontext::hasright('adminpage')) {
         $adminmark = time();
     }
     $cache0 = new wra_cacheflow('p' . $this->wf->requestedpage . $adminmark, true);
     if ($cache0->begin()) {
         if (!empty($this->wf->currouteindex[0]['index'])) {
             if (count($this->wf->currouteindex) > 1) {
                 $this->linky = addslashes($this->wf->currouteindex[0]['index'] . '/' . $this->wf->currouteindex[1]['index']);
                 $id = wra_foursqvenues::getidbylink($this->linky);
                 if ($id) {
                     $this->cpid = $id;
                 }
             } else {
                 $this->cpid = intval($this->wf->currouteindex[0]['index']);
                 if ($this->cpid > wra_foursqvenues::$linknumber) {
                     $this->cpid = 0;
                 }
             }
         }
         $this->wf->cp->ogtitle = 'Fresh ukrainian news on the map ';
         $this->wf->cp->ogname = 'Map of war in Ukraine';
         $this->wf->cp->header = 'Map of Unrest in Ukraine';
         $this->wf->cp->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 ';
         $this->wf->cp->keywords = 'Ukraine, Russia, Donetsk, war, artillery, war games, provocations, intelligence, USA, Eastern Europe';
         if ($this->cpid != 0) {
             $this->venue = new wra_foursqvenues();
             $this->venue->load($this->cpid);
             $this->wf->cp->header = $this->venue->name;
             $this->wf->cp->ogtitle = $this->venue->name;
             $this->wf->cp->pagehead = $this->venue->name;
         }
         if (!empty($_REQUEST['ll'])) {
             ini_set('display_errors', 'Off');
             $this->ll = explode(';', $_REQUEST['ll']);
             $this->ll[0] = floatval($this->ll[0]);
             $this->ll[1] = floatval($this->ll[1]);
         }
         if (!empty($_REQUEST['zoom'])) {
             $this->zoom = intval($_REQUEST['zoom']);
         }
         $this->cats = wra_cats::get_list();
         $this->venues = wra_foursqvenues::get_l30(time());
         $this->wf->includeheader();
         include WRA_Path . '/template/index.php';
         $this->wf->includefooter();
         // $this->lastupdate=  wra_foursqvenues::lastupdate();
     }
     $cache0->end();
     // $this->wf->nicedie();
 }
Exemplo n.º 3
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;
     }
 }