Пример #1
0
 public function find_on_url($user, $url, $except = 0)
 {
     if ($user + 0 == 0) {
         $user_model = new userModel();
         $u = $user_model->find_one_by_url($user);
         if ($u && isset($u['id'])) {
             $user = $u['id'];
         }
     }
     if (!$user) {
         return false;
     }
     $sql = "SELECT " . $this->_table . ".*," . self::$left_join_images;
     $sql .= " FROM " . $this->_table;
     $sql .= " LEFT JOIN images ON images.id=" . $this->_table . ".img";
     $sql .= " WHERE " . $this->_table . ".user=? AND " . $this->_table . ".url=?\n                AND " . $this->_table . ".parent IS NULL\n                AND " . $this->_table . ".id <>?";
     $args = [$user, $url, $except];
     $ret = $this->conn->fetchRow($sql, $args);
     $this->image_array($ret);
     return $ret;
 }
Пример #2
0
}
if (Bootstrap::$main->isAdmin() && isset($_GET['vip'])) {
    $vip = explode(',', $_GET['vip']);
    $model = new userModel($vip[0]);
    $model->_vip = $vip[1] + 0;
    $model->save();
}
$us = false;
if (Bootstrap::$main->isAdmin() && isset($_GET['q'])) {
    $model = new userModel();
    if ($_GET['q'] + 0 > 0) {
        $us = $model->get($_GET['q']);
    } elseif (strstr($_GET['q'], '@')) {
        $us = $model->find_one_by_email(trim(strtolower($_GET['q'])));
    } else {
        $us = $model->find_one_by_url(trim($_GET['q']));
    }
}
?>

<?php 
$title = '';
include __DIR__ . '/head.php';
//mydie();
?>

<?php 
if (Bootstrap::$main->isAdmin()) {
    ?>
<form style="margin: 2em;" action="<?php 
    echo $admin_path;