Exemplo n.º 1
0
    }
    function new_files($user)
    {
        $last = $this->getOne("select `lastLogin`  from `users_users` where `login`=?", array($user));
        $query = "select count(*) from `el_arquivo` where `data_publicacao` > ?";
        return $this->getOne($query, array((int) $last));
    }
    function getUserRating($arquivoId, $userName)
    {
        return $this->getOne("select `rating` from `el_arquivo_rating` where `arquivoId`=? and `user`=?", array($arquivoId, $userName));
    }
    function change_login_acervo($from, $to)
    {
        return $this->query("update `el_arquivo` set `user`=? where `user`=?", array($to, $from));
    }
}
// migrado para el-setup
global $elgallib, $dbTiki, $userHasPermOnFile, $arquivoId, $tiki_p_el_admin_gallery;
$elgallib = new ELGalLib($dbTiki);
if (isset($_REQUEST['arquivoId'])) {
    $arquivoId = $_REQUEST['arquivoId'];
    $arquivo = $elgallib->get_arquivo($_REQUEST['arquivoId']);
    if ($arquivo['user'] == $user || $tiki_p_el_admin_gallery == 'y') {
        $userHasPermOnFile = true;
    } else {
        $userHasPermOnFile = false;
    }
} else {
    $arquivoId = false;
}
//**/