Example #1
0
 function wfitem($wf)
 {
     $wf->cp->ogimage = WRA::base_url() . 'images/500.png';
     if (!empty($wf->currouteindex[0]['index'])) {
         $this->cpid = intval($wf->currouteindex[0]['index']);
     }
 }
Example #2
0
 function wfitem($wf)
 {
     if (wra_userscontext::isloged($wf) && wra_userscontext::hasright('adminpage')) {
         $wf->cp->baseico = true;
         $wf->cp->norobots();
         $wf->cp->bodyclass = "admin_login";
     } else {
         WRA::gotopage(WRA::base_url() . 'admin/login');
         $wf->nicedie();
     }
     $this->adminnodes = WRA_ENV::adminnodes();
     for ($i = 0; $i < count($this->adminnodes); $i++) {
         if ($_REQUEST['node'] == $this->adminnodes[$i]->link) {
             $this->curnode = $this->adminnodes[$i];
             $this->curadmin = new wfadmin($this->curnode->link);
             break;
         }
     }
     $this->art = json_decode(stripslashes($_REQUEST['ids']));
     if (!is_array($this->art)) {
         $this->art = array();
         $this->art[] = $_REQUEST['ids'];
     }
     $this->header = $this->curnode->name;
     if (!$this->curadmin->multilanguages) {
         $this->currows = $this->curadmin->getrows('', $this->page * $this->onpage, $this->onpage);
     } else {
         $this->currows = $this->curadmin->getrows('_' . WRA_CONF::$language, $this->page * $this->onpage, $this->onpage);
     }
 }
 function getlink()
 {
     if ($this->id <= wra_foursqvenues::$linknumber) {
         return WRA::base_url() . 'e/' . $this->id;
     } else {
         return WRA::base_url() . 'e/' . $this->link;
     }
 }
Example #4
0
 function wra_cacheflow($named, $cacheon)
 {
     $this->name = WRA::base_url() . $named . intval(time() / 1200);
     $this->cacheon = $cacheon;
     if (WRA_CONF::$usedebug) {
         $this->cacheon = false;
     }
 }
Example #5
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();
 }
Example #6
0
    function run()
    {
        parent::run();
        if ($_REQUEST['oauth_token']) {
            $connection = new TwitterOAuth(WRA_CONF::$twiappid, WRA_CONF::$twiappsecret, $_REQUEST['oauth_token'], $_REQUEST['oauth_verifier']);
            $token_credentials = $connection->getAccessToken($_REQUEST['oauth_verifier']);
            $connection = new TwitterOAuth(WRA_CONF::$twiappid, WRA_CONF::$twiappsecret, $token_credentials['oauth_token'], $token_credentials['oauth_token_secret']);
            $account = $connection->get('account/verify_credentials');
            // WRA::debug($ctwe);
            if ($account) {
                // WRA::debug($user);
                $nu = new wra_twu();
                $nu->display_name = htmlspecialchars($account->screen_name, ENT_QUOTES);
                //$user->name;
                $nu->regdate = WRA::getcurtime();
                $nu->twuserid = $account->id;
                // $nu->userid = $usr;
                $nu->username = htmlspecialchars($account->name, ENT_QUOTES);
                $nu->usersurname = htmlspecialchars($user['last_name'], ENT_QUOTES);
                $nu->link = $account->url;
                //$user->link;
                $nu->user_agent = wra_fbu::getbrowser();
                $nu->access_token = $token_credentials['oauth_token'];
                $nu->email = $token_credentials['oauth_token_secret'];
                $nu->photo = $account->profile_image_url;
                if ($account->notifications) {
                    $nu->gender = 0;
                } else {
                    $nu->gender = 1;
                }
                $nu->phone = '';
                if (!empty($nu->twuserid)) {
                    if (!wra_twu::istwexist($nu->twuserid)) {
                        $nu->userid = $this->addUsr($nu->username, $nu->usersurname, $nu->phone, $nu->email, "asdf" . time(), $nu->photo);
                        $nu->add();
                    } else {
                        $nu->loadbytw($nu->twuserid);
                        $nu->update();
                    }
                    wra_twu::twd($nu->twuserid, $nu->userid);
                }
                if (empty($_SESSION['lastpage'])) {
                    WRA::gotopage(WRA::base_url() . '?from=tw&show=no');
                } else {
                    WRA::gotopage(WRA::base_url() . $_SESSION['lastpage']);
                }
                $_SESSION['lastpage'] = '';
            }
        } else {
            ?>
<a href="<?php 
            WRA::e(wra_twitter::loginLink());
            ?>
">login</a><?php 
        }
    }
Example #7
0
 function run()
 {
     $this->nofooter = true;
     $this->noheader = true;
     if (isset($_POST['btnclicked'])) {
         switch ($_POST['btnclicked']) {
             case 'btnfind':
                 break;
             case 'btnAdd':
                 WRA::gotopage(WRA::base_url() . $this->curnode->link . '/edit');
                 break;
         }
     }
 }
Example #8
0
 function run()
 {
     parent::run();
     if (wra_userscontext::isloged($this->wf) || wra_u::islogin()) {
         WRA::gotopage(WRA::base_url());
         return;
     }
     $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';
     // $this->lastupdate=  wra_foursqvenues::lastupdate();
 }
Example #9
0
    function show()
    {
        $cache0 = new wra_cacheflow('sitemap', true);
        if ($cache0->begin()) {
            $this->items = wra_foursqvenues::get_listall();
            WRA::e('<?');
            ?>
xml version="1.0" encoding="UTF-8"<?php 
            WRA::e('?>');
            ?>

<urlset
      xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
            http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
  <url>
      <loc><?php 
            WRA::e(WRA::base_url());
            ?>
</loc>
      <changefreq>hourly</changefreq>
  </url>
    <url>
      <loc><?php 
            WRA::e(WRA::base_url());
            ?>
history</loc>
      <changefreq>hourly</changefreq>
  </url>
<?php 
            foreach ($this->items as $a0) {
                ?>
  <url>
      <loc><?php 
                WRA::e($a0->getlink());
                ?>
</loc>
      <changefreq>yearly</changefreq>
  </url>
<?php 
            }
            ?>
  
</urlset><?php 
        }
        $cache0->end();
    }
Example #10
0
 function wfitem($wf)
 {
     //include  WRA_Path. '/modules/admin/admintable.php';
     //include WRA_Path.'/modules/admin/adminpages.php';
     $this->header = 'Администрирование';
     $this->adminnodes = WRA_ENV::adminnodes();
     $this->noticecount = wra_adminnotices::getcount();
     if (wra_userscontext::isloged($wf) && wra_userscontext::hasright('adminpage')) {
         $wf->cp->baseico = true;
         $wf->cp->norobots();
         $wf->cp->bodyclass = "admin_login";
     } else {
         WRA::gotopage(WRA::base_url() . 'admin/login');
         $wf->nicedie();
     }
     // wra_adminnotices:: message('hello','hello');
 }
Example #11
0
 function run()
 {
     $this->nofooter = true;
     $this->noheader = false;
     if (isset($_POST['admin_login'])) {
         $this->enter_try = -1;
         $isremember = false;
         if (isset($_POST['rememberme'])) {
             $isremember = true;
         }
         $login = addslashes($_POST['admin_login']);
         $pass = $_POST['admin_pass'];
         $this->enter_try = wra_userscontext::login($this->wf, $login, $pass, $isremember);
     }
     if (isset($_REQUEST['act'])) {
         // die($_REQUEST['act']);
         wra_userscontext::logout();
         if (@$_REQUEST['backurl'] == 'index.php') {
             WRA::gotopage('');
             $this->wf->nicedie();
         }
     }
     if (wra_userscontext::isloged($this->wf)) {
         switch (@$_POST['returnurl']) {
             case 'admin':
             default:
                 if (wra_userscontext::hasright('adminpage')) {
                     WRA::gotopage(WRA::base_url() . 'admin');
                     $this->wf->nicedie();
                 } else {
                     $this->enter_try = 3;
                 }
                 break;
         }
     } else {
         switch (@$_REQUEST['returnurl']) {
             case 'user':
                 WRA::gotopage(WRA::base_url());
                 $this->wf->nicedie();
                 break;
         }
     }
 }
Example #12
0
 static function er($text)
 {
     echo str_replace('{wfurl}', WRA::base_url(), stripslashes($text));
 }
Example #13
0
defined('WERUA') or (include '../bad.php');
?>
<input type="hidden" id="curnode" name="curnode" value="<?php 
WRA::e($this->curnode->link);
?>
" />
<div class="plan_top">
    <div class="plan_top_header"><span><?php 
WRA::e($this->curnode->name);
?>
</span>
        <div class="controls">
                <!-- <input id="btnAdd" type="button" name="btnadd"  value="Добавить" /> -->
                <a href="<?php 
WRA::e(WRA::base_url());
?>
admin/image/import" id="btnImport">Импортировать</a>
        </div>
    </div>
    <div>
        <table class="plan_top_header_table">
            <tr>
                <td class="td_info td_info_1">Адрес импорта</td>
                <td class="td_patient">
                    <input  id="import_source" name="import_source" type="text" value="<?php 
WRA::e($this->importUrl);
?>
" placeholder="ex. upload/albums">
                </td>
                <td style="width:60px;"></td>
Example #14
0
 static function sendRememberMail($reg_mail)
 {
     $code = wra_users::getRightCode($reg_mail);
     $subj = "Callback from ";
     $body = "<a href=" . WRA::base_url() . "remember?email=" . $reg_mail . "&code=" . $code . ">get new password</a>";
     $headers = 'From: no-reply@award';
     // $res = wra_email::sendemail($reg_mail, $subj, $body);
     $res = wra_email::sendemail($reg_mail, $subj, $body);
 }
Example #15
0
							<!-- <a href="#" class="deleteinfoimage">удалить</a> -->
						</div>
					</div>
			        <?php 
                    // end of empty pic line
                    foreach ($ac->items as $w0) {
                        ?>
                        <div class="row old" id="infopic-old-<?php 
                        WRA::e($w0->id);
                        ?>
-<?php 
                        WRA::e($ac->lang);
                        ?>
">
							<div><img src="<?php 
                        echo WRA::base_url();
                        WRA::e($w0->tmbpic);
                        ?>
" width="120px"/></div>
							<div class="imginfo">
                                 <div><span>Id:</span><span class="id00" ><?php 
                        WRA::e($w0->id);
                        ?>
</span></div>
                                <div><span>Название:</span><input type="text" name="<?php 
                        WRA::e($curid);
                        ?>
_header_<?php 
                        WRA::e($ac->lang);
                        ?>
_<?php 
Example #16
0
        }
        ?>
</td>
                <?php 
    }
    ?>
                <td><a href="<?php 
    WRA::e(WRA::base_url() . $this->curnode->link . "/edit?id=" . $ad0->id);
    ?>
">редактировать</a> </td>
                <td><a href="<?php 
    WRA::e(WRA::base_url() . $this->curnode->link . "/view?id=" . $ad0->id);
    ?>
">просмотреть</a> </td>
                <td><a class="deleteconfirm" href="<?php 
    WRA::e(WRA::base_url() . $this->curnode->link . "/edit?act=delete&id=" . $ad0->id);
    ?>
">удалить</a> </td>
                </tr>
<?php 
}
?>
        </tbody>
    </table>
    <div id="adactions"><img src="../images/wf/arrow_ltr.png">С выделенными:  <input id="btndeletemany" type="button" value="Удалить"/><input id="btnexportcsv" type="button" value="Экспортировать в CSV"/>
        &nbsp;Экспортировать поле: <select id="exportfield"><option value="-1">Выберите</option><?php 
foreach ($this->curadmin->columns as $ac) {
    if ($ac->tablestatus == admincolumntype::none) {
        continue;
    }
    ?>
Example #17
0
 function run()
 {
     WRA::gotopage(WRA::base_url());
     // $this->wf->closedb();
     // $this->wf->nicedie();
 }
Example #18
0
    function flush()
    {
        //есть шанс погибнуть разобравшись в этом коде
        //вывод таблицы
        ?>

	    <?php 
        if ($this->subtable) {
            ?>
	    <br/>
	    <div class="text_header_edit">
		    <?php 
            WRA::e($this->headertext);
            ?>
		</div>
		<?php 
        }
        ?>
		<?php 
        $rowi = 0;
        $columni = 0;
        if ($this->pid != "-1" && $this->pid != "0" && $this->pid != "" && $this->useheader) {
            ?>
	
			<div><a href="<?php 
            WRA::e(WRA::getcurpage() . '&pid=' . $this->parent_parentid);
            ?>
">&larr;вверх</a></div>	
		<?php 
        }
        if (count($this->rows) == 0) {
            ?>
	    <div class="sub_text">
	     <center>Нет ни одной записи</center>
	    </div><?php 
        } else {
            ?>
<div><input type="text" id="filternow" value="Поиск"></div><?php 
        }
        while ($rowi < count($this->rows)) {
            $columni = 0;
            ?>
<div class="sub_text" id="sub_text-<?php 
            WRA::e($this->rows[$rowi]["id"]);
            ?>
"><?php 
            while ($columni < count($this->columns)) {
                if ($this->columns[$columni]->header == "id" || $this->columns[$columni]->header == "Ключевые слова") {
                    $columni++;
                    continue;
                }
                $tdcontent = "";
                $tdcontent = $this->columns[$columni]->prefix . $this->rows[$rowi][$columni] . $this->columns[$columni]->sufix;
                switch ($this->columns[$columni]->type) {
                    case column_type_h2header:
                        if (!$this->columns[$columni]->isparent) {
                            WRA::e('<h2>' . $tdcontent . '</h2>');
                        } else {
                            if ($this->info == "") {
                                WRA::e('<h2><a href="' . WRA::getcurpage() . '&pid=' . $this->rows[$rowi]["id"] . '">' . $tdcontent . "</a></h2>");
                            } else {
                                WRA::e('<h2><a href="' . WRA::getcurpage() . '&pid=' . $this->rows[$rowi]["id"] . '&type=' . $this->info . '">' . $tdcontent . "</a></h2>");
                            }
                        }
                        break;
                    case column_type_date:
                        WRA::e('<span class="date_content">' . $this->columns[$columni]->header . ': ' . $tdcontent . '</span>');
                        break;
                    case column_type_link:
                        WRA::e('<a target="_blank"  href="' . $tdcontent . '">' . $tdcontent . "</a>");
                        break;
                    case column_type_check:
                        WRA::e('<p>' . $this->columns[$columni]->header . ': ');
                        if ($tdcontent == 1) {
                            WRA::e('Да');
                        } else {
                            WRA::e('Нет');
                        }
                        WRA::e('</p>');
                        break;
                    case column_type_pic:
                        if ($tdcontent != "") {
                            WRA::e('<p><img src="' . WRA::base_url() . $tdcontent . '"/></p>');
                        } else {
                            WRA::e($tdcontent);
                        }
                        break;
                    case column_type_id:
                        break;
                    case column_type_text:
                    default:
                        ?>
<p<?php 
                        if ($this->rowstyle != "") {
                            WRA::e(' style="' . $this->rowstyle . '"');
                        }
                        ?>
><?php 
                        if ($tdcontent != "") {
                            WRA::e($this->columns[$columni]->header . '');
                        }
                        if ($this->columns[$columni]->isparent) {
                            WRA::e('<h2><a href="' . WRA::getcurpage() . '&pid=' . $this->rows[$rowi]["id"] . '">' . $tdcontent . "</a></h2>");
                        } else {
                            WRA::e($tdcontent);
                        }
                        ?>
</p><?php 
                        break;
                }
                $columni++;
            }
            ?>
<div class="red_del"><?php 
            if ($this->candelete) {
                ?>
<a href="<?php 
                WRA::e(WRA::getcurpage());
                ?>
&id=<?php 
                WRA::e($this->rows[$rowi]["id"]);
                ?>
" class="delete_link deletetd  <?php 
                WRA::e($this->deleteeditclass);
                ?>
" style="display:none" id="del-<?php 
                WRA::e($this->rows[$rowi]["id"]);
                if ($this->info != "") {
                    WRA::e("-" . $this->info);
                }
                ?>
">Удалить</a><?php 
            }
            if ($this->canedit) {
                ?>
<a href="<?php 
                WRA::e(WRA::getcurpage());
                ?>
&id=<?php 
                WRA::e($this->rows[$rowi]["id"]);
                ?>
" class="edit_link edittd  <?php 
                WRA::e($this->deleteeditclass);
                ?>
" style="display:none" id="ed-<?php 
                WRA::e($this->rows[$rowi]["id"]);
                if ($this->info != "") {
                    WRA::e("-" . $this->info);
                }
                ?>
">Редактировать</a><?php 
            }
            ?>
</div><?php 
            $rowi++;
            ?>
</div>
			
			<?php 
        }
    }
Example #19
0
 static function pic_replace($pics = array(), $text, $size = '690', $divclass = '')
 {
     foreach ($pics as $k => $v) {
         $imgsearch = "[image" . $v->id . "]";
         $text = str_replace($imgsearch, "<div class='" . $divclass . "'><img src ='" . WRA::base_url() . $v->pic . "' width='" . $size . "'/></div>", $text);
     }
     return $text;
 }
Example #20
0
 function run()
 {
     parent::run();
     $code = $_REQUEST["code"];
     if (!empty($code)) {
         // WRA::debug("get fb data");
         $token_url = "https://graph.facebook.com/oauth/access_token?" . "client_id=" . WRA_CONF::$fbappid . "&redirect_uri=" . urlencode(WRA_CONF::$fbauthlink . '') . "&client_secret=" . WRA_CONF::$fbappsecret . "&code=" . $code;
         // $usr = $_REQUEST['state'];
         $response = @file_get_contents($token_url);
         // WRA::debug($response);
         $params = null;
         parse_str($response, $params);
         // WRA::debug($params);
         $graph_url = "https://graph.facebook.com/me?fields=id,picture,name,first_name,location,hometown,gender,last_name,link,email&type=large&access_token=" . $params['access_token'];
         // WRA::debug($graph_url);
         $user = @json_decode(@file_get_contents($graph_url));
         // WRA::debug('asdasda');
         // wra_fbu::fbd($user->id);
         $nu = new wra_fbu();
         $nu->display_name = htmlspecialchars($user->name, ENT_QUOTES);
         $nu->regdate = WRA::getcurtime();
         $nu->fbuserid = $user->id;
         // $nu->userid = $usr;
         $nu->username = htmlspecialchars($user->first_name, ENT_QUOTES);
         $nu->usersurname = htmlspecialchars($user->last_name, ENT_QUOTES);
         $nu->link = htmlspecialchars($user->link, ENT_QUOTES);
         $nu->user_agent = wra_fbu::getbrowser();
         $nu->access_token = $params['access_token'];
         $nu->email = htmlspecialchars($user->email, ENT_QUOTES);
         $nu->photo = str_replace("_q", "_n", $user->picture->data->url);
         if ($user->gender == 'female') {
             $nu->gender = 1;
         } else {
             $nu->gender = 0;
         }
         $nu->phone = '';
         if (isset($nu->hometown)) {
             $nu->adres = htmlspecialchars($nu->hometown->name, ENT_QUOTES);
         }
         if (isset($nu->location)) {
             $nu->adres = htmlspecialchars($nu->location->name, ENT_QUOTES);
         }
         // WRA::debug($nu);die();
         if (!empty($nu->fbuserid)) {
             if (!wra_fbu::isfbexist($user->id)) {
                 $nu->userid = $this->addUsr($nu->display_name, $nu->usersurname, $nu->phone, $nu->email, "asdf" . time(), $nu->photo);
                 $nu->add();
             } else {
                 $nu->loadbyfb($nu->fbuserid);
                 $nu->update();
             }
             wra_fbu::fbd($nu->fbuserid, $nu->userid);
             // try{
             // }catch(Exception $ex){}
             //print_r($fb);
         }
     }
     // if(empty($_SESSION['lastpage'])){
     WRA::gotopage(WRA::base_url() . '?from=fb');
     // }else{
     // WRA::gotopage(WRA::base_url().$_SESSION['lastpage']);
     // }
     $_SESSION['lastpage'] = '';
 }
Example #21
0
 static function getcurlang()
 {
     if (isset($_COOKIE['wralang' . WRA::base_url()])) {
         return $_COOKIE['wralang' . WRA::base_url()];
     } else {
         $lang = substr($_SERVER["HTTP_ACCEPT_LANGUAGE"], 0, 2);
         if ($lang == 'ru' || $lang == 'uk') {
             $lang = WRA_CONF::$language;
         } else {
             $lang = 'en';
         }
         // die($lang);
         @setcookie("wralang" . WRA::base_url(), $lang, time() + WRA_CONF::$remembertime, "/");
         // @setcookie("wralang", WRA_CONF::$language, time() + WRA_CONF::$remembertime, "/");
         return $lang;
         // return WRA_CONF::$language;
     }
 }
Example #22
0
 function run()
 {
     $act = @$_REQUEST['act'];
     switch ($act) {
         case "ui":
             $savepc = new wra_image();
             $savepc->header = '';
             $savepc->description = '';
             $ismessage = false;
             $admimessage = '';
             $wimage = wra_admintable::getpic($savepc->pic, $savepc->tmbpic, $ismessage, $admimessage, 'gallery/', 340, 'qqfile', false, true);
             $savepc->keywords = '';
             $savepc->galinfoid = 0;
             $savepc->width = $wimage->imagewidth;
             $savepc->height = $wimage->imageheight;
             $languages = wra_lang::getlist();
             $savepc->add("_ru");
             $ruid = $savepc->id;
             foreach ($languages as $l0) {
                 if ($l0->alias != 'ru') {
                     $savepc->add('_' . $l0->alias);
                 }
             }
             echo '{"success":true,"imgid":"' . $ruid . '","tmb":"' . WRA::base_url() . $savepc->tmbpic . '"}';
             break;
         case 'uploadimage':
             $savepc = new wra_image();
             $savepc->header = '';
             $savepc->description = '';
             $ismessage = false;
             $admimessage = '';
             require_once WRA_Path . '/modules/admin/admintable.php';
             wra_admintable::getpic($savepc->pic, $savepc->tmbpic, $ismessage, $admimessage, 'gallery/', 240, 'qqfile', false, true);
             $savepc->keywords = '';
             $savepc->galinfoid = -1;
             $savepc->add();
             WRA::e(htmlspecialchars(json_encode(array('success' => true, 'picid' => $savepc->id, 'path' => $savepc->tmbpic, 'oldid' => $_REQUEST['id'])), ENT_NOQUOTES));
             break;
         case 'uploadimagepack':
             if (isset($_FILES['Filedata'])) {
                 $savepc = new wra_image();
                 $moreinfo = new wra_iteminfo();
                 $moreinfo->weight = 0;
                 $moreinfo->alt = '';
                 $moreinfo->keywords = '';
                 $moreinfo->autoadres = 0;
                 $moreinfo->adres = '';
                 $moreinfo->commentopt = 2;
                 $moreinfo->mappriority = 0;
                 $moreinfo->authorid = WRA::curuser()->id;
                 $moreinfo->add();
                 $savepc->header = '';
                 $savepc->description = '';
                 //$savepc->pic=$_POST['fieldpic'];
                 $ismessage = false;
                 $admimessage = '';
                 require_once '../../modules/admin/admintable.php';
                 wra_admintable::getpic($savepc->pic, $savepc->tmbpic, $ismessage, $admimessage, 'gallery/', 240, 'Filedata', false, true);
                 $savepc->galleryid = WRA::getreq('galid');
                 $savepc->keywords = '';
                 $savepc->infoid = $moreinfo->id;
                 $savepc->add();
             }
             WRA::e($savepc->tmbpic . '~@~' . $savepc->id);
             break;
         case 'uploadpic':
             $savepc = new wra_upfile();
             if (isset($_FILES['Filedata'])) {
                 if ($_FILES['Filedata']['size'] != 0) {
                     $savepc->original_filename = $_FILES['Filedata']['name'];
                     $wf = new wra_uploadedfile(WRA_Path);
                     $wf->uploaddir .= 'files/';
                     $wf->addvalidtype('jpg');
                     $wf->addvalidtype('png');
                     $wf->addvalidtype('gif');
                     $wf->addvalidtype('jpeg');
                     $wf->addvalidtype('jpeg');
                     $wf->addvalidtype('docx');
                     $wf->addvalidtype('pdf');
                     $wf->addvalidtype('doc');
                     $wf->upload('Filedata', true);
                     WRA::e($wf->error);
                     if ($wf->error == '') {
                         $savepc->path_to_file = 'upload/files/' . $wf->filename;
                         $savepc->description = $_FILES['Filedata']['name'] . ' - загружено загрузчиком редактора';
                         $savepc->add();
                     } else {
                         $ismessage = true;
                         switch ($wf->error) {
                             default:
                                 $adminmessage = 'Ошибка загрузки файла';
                                 break;
                         }
                     }
                 }
             }
             WRA::e(WRA::base_url() . $savepc->path_to_file);
             break;
     }
 }
Example #23
0
 function run()
 {
     $this->nofooter = true;
     $this->noheader = true;
     if (isset($_POST['btnclicked'])) {
         switch ($_POST['btnclicked']) {
             case 'btnfind':
                 break;
             case 'btnadd':
                 WRA::gotopage(WRA::base_url() . $this->curnode->link . '/edit');
                 break;
             case 'btnSave':
                 if ($this->curadmin->curid == -1) {
                     if ($this->curadmin->multilanguages) {
                         foreach ($this->wf->languages as $v) {
                             $this->curadmin->addfirst('_' . $v->alias);
                         }
                     } else {
                         $this->curadmin->addfirst('');
                     }
                     WRA::gotopage(WRA::base_url() . $this->curnode->link);
                 } else {
                     if ($this->curadmin->multilanguages) {
                         // WRA::debug($this->wf->languages);
                         foreach ($this->wf->languages as $v) {
                             // WRA::debug($v->alias);
                             $this->curadmin->updatefirst('_' . $v->alias);
                         }
                     } else {
                         $this->curadmin->updatefirst('');
                     }
                     $this->load($this->wf);
                 }
                 break;
         }
     }
 }
Example #24
0
 function add_style($style)
 {
     $this->styles[] = WRA::base_url() . $style . '?g';
 }