Esempio n. 1
0
 function get()
 {
     $m = eps_get_var('m', gmdate('n', $this->timediff));
     $y = eps_get_var('y', gmdate('Y', $this->timediff));
     if ($m < 1) {
         $m = 1;
     }
     if ($m > 12) {
         $m = 12;
     }
     if ($y < 1) {
         $y = 1;
     }
     return array($y, $m);
 }
Esempio n. 2
0
File: mark.php Progetto: nqv/eposys
   Module:  MARK
   Author:  Quoc Viet [aFeLiOn]
    Begin:  2006-03-12

  Comment:
--------------------------------------------------------------------------------
*/
if (!defined('IN_EPS')) {
    exit;
}
if ($eps_user['is_guest']) {
    echo $eps_lang['Must_login'];
    return;
}
$action = eps_get_var('action', '');
$course = eps_get_var('list', 'k48htd1');
$eps_subjects = array('m1' => 4, 'm2' => 3, 'm3' => 4, 'm4' => 4, 'm5' => 5, 'm6' => 2, 'm7' => 2, 'm7' => 4);
$eps_course = array('k48htd1', 'k48htd2', 'k48htd3', 'k48htd4', 'k48htdp');
if ($action == 'postmark') {
    if (!in_array($course, $eps_course)) {
        return;
    }
    if (isset($_POST['form_sent']) && $_POST['form_sent'] == 'mark') {
        $do_update = false;
        foreach ($eps_subjects as $cur_sbj => $sbj_v) {
            if (isset($_POST['c_' . $cur_sbj])) {
                $cur_sbj_ids = $_POST[$cur_sbj];
                $cur_sbj_marks = array();
                foreach ($cur_sbj_ids as $k => $v) {
                    $cur_sbj_marks[$v == '' ? 'null' : intval($v)][] = $k;
                }
Esempio n. 3
0
--------------------------------------------------------------------------------
     File:  gallery.php

   Module:  GALLERY
   Author:  Quoc Viet [aFeLiOn]
    Begin:  2006-05-29

  Comment:
--------------------------------------------------------------------------------
*/
if (!defined('IN_EPS')) {
    exit;
}
$module_path = 'index.php?eps=gallery';
$p = eps_get_var('p', 1, true);
$gid = eps_get_var('gid', 0, true);
$epsclass->load_class('class_antiflood');
// Image view
if ($gid > 1) {
    if (isset($_POST['form_sent']) && $_POST['form_sent'] == 'gallery_cm') {
        return;
    }
    $result = $epsclass->db->vselect(TBL_GALLERY, true, $gid);
    // 	$sql = $db->vselect(TBL_GALLERY);
} else {
    if (isset($_POST['form_sent']) && $_POST['form_sent'] == 'gallery') {
        $epsclass->load_class('class_validate');
        $epsclass->validate->data_reset();
        $description = trim($_POST['req_description']);
        if ($epsclass->validate->chk_empty($description, $eps_lang['Description'])) {
            $epsclass->load_class('class_upload', EPS_GALLERY_DIR, array('jpg', 'gif', 'png'), 1512000);
Esempio n. 4
0
File: news.php Progetto: nqv/eposys
     File:  news.php

   Module:  NEWS
   Author:  Quoc Viet [aFeLiOn]
    Begin:  2006-01-02

  Comment:
--------------------------------------------------------------------------------
*/
if (!defined('IN_EPS')) {
    exit;
}
// GET
$p = eps_get_var('p', 1, true);
$nid = eps_get_var('nid', 0, true);
$type = eps_get_var('type', '');
$max_length = 600;
// Class BBCode
$epsclass->load_class('class_bbcode');
// Brief News
if (isset($tiny_method) && $tiny_method == 'news') {
    $result = $epsclass->db->vselect(TBL_NEWS, true, "WHERE type=2 ORDER BY `post_time` DESC LIMIT 0,20", true);
    if ($epsclass->db->num_rows($result)) {
        ?>
	<ul>
<?php 
        while ($cur_news = $epsclass->db->fetch_assoc($result)) {
            if (eps_strlen($cur_news['content']) > $max_length) {
                $cur_news['content'] = eps_truncate($cur_news['content'], $max_length);
            }
            echo '<li>' . auto_gen_link('index.php?eps=news&amp;nid=' . $cur_news['id'], $cur_news['title'], $epsclass->bbcode->clean($cur_news['content']), true, true, true) . '</li>' . "\n";
Esempio n. 5
0
File: post.php Progetto: nqv/eposys
   Module:  POST
   Author:  Quoc Viet [aFeLiOn]
    Begin:  2006-01-09
--------------------------------------------------------------------------------
*/
if (!defined('IN_EPS')) {
    exit;
}
// No Guest
if ($eps_user['is_guest']) {
    echo $eps_lang['Must_login'];
    return;
}
// GET
$nid = eps_get_var('nid', 0, true);
$action = eps_get_var('action', 'post');
// Class Validate
$epsclass->load_class('class_validate');
// Class Anti-flood
$epsclass->load_class('class_antiflood');
$epsclass->load_class('class_bbcode');
if (!in_array($action, array('post', 'edit', 'delete'))) {
    $action = 'post';
}
$news = array('title' => '', 'content' => '', 'imgurl' => '', 'type' => 1, 'no_smiley' => 0);
$errors = array();
$epsclass->validate->data_reset();
// Permision
if ($nid >= 1 && ($action == 'edit' || $action == 'delete')) {
    // Fetch Post
    $result = $epsclass->db->vselect(TBL_NEWS, array('id', 'title', 'content', 'poster_id', 'imgurl', 'type', 'no_smiley'), $nid);
Esempio n. 6
0
<?php

/*
--------------------------------------------------------------------------------
     File:  visual_confirm.php

   Module:  VISUAL CONFIRM
   Author:  Quoc Viet [aFeLiOn]
    Begin:  2006-01-20

  Comment:  Return A Image
--------------------------------------------------------------------------------
*/
if (!defined('IN_EPS')) {
    exit;
}
require EPS_ROOT . 'include/function_visual.php';
$code = eps_get_var('code', '');
$pos = eps_get_var('pos', 0);
$encrypt = eps_encrypt($code, 6);
if ($code == '' || $pos == 0 || $pos > strlen($encrypt)) {
    exit;
}
header('Content-Type: image/png');
header('Cache-control: no-cache, no-store');
echo chr2img(substr($encrypt, $pos - 1, 1));
exit;
Esempio n. 7
0
File: login.php Progetto: nqv/eposys
  Comment:  Addition: Forgot Password
--------------------------------------------------------------------------------
*/
if (!defined('IN_EPS')) {
    exit;
}
// Only Unregister
if (!$eps_user['is_guest']) {
    echo $eps_lang['Must_login'];
    return;
    //header('Location: index.php');
    //exit;
}
// GET
$action = eps_get_var('action', '');
// Visual Function
require_once EPS_ROOT . 'include/function_visual.php';
// Class
$epsclass->load_class('class_validate');
$epsclass->load_class('class_antiflood');
$errors = array();
$epsclass->validate->data_reset();
// L o g i n
if (empty($action) || $action == 'login' || isset($tiny_method) && $tiny_method == 'login') {
    $action = 'login';
    // Submit
    if (isset($_POST['form_sent']) && $_POST['form_sent'] == 'login') {
        // Clean
        $username = trim($_POST['req_username']);
        $password = trim($_POST['req_password']);
Esempio n. 8
0
File: album.php Progetto: nqv/eposys
/*
--------------------------------------------------------------------------------
     File:  album.php

   Module:  ALBUM
   Author:  Quoc Viet [aFeLiOn]
    Begin:  2006-01-20

  Comment:
--------------------------------------------------------------------------------
*/
if (!defined('IN_EPS')) {
    exit;
}
// GET
$album = urldecode(eps_get_var('album', ''));
// XML Object
$epsclass->load_class('class_xml');
$epsclass->xml->load_file(EPS_DATA_DIR . 'k48htd.xml');
// Album In XML file
$album_infos = $epsclass->xml->get_album();
// Album In Album-Directory
$albums = get_stuff('album');
// All Album
if (empty($album)) {
    $album_shows = array();
    foreach ($albums as $cur_album) {
        if (!empty($album_infos[$cur_album])) {
            $cur_album_info = '<img src="' . EPS_ALBUM_DIR . html_clean($cur_album) . '/' . html_clean($album_infos[$cur_album]['img']) . '" />';
            $cur_album_info .= '<h3>' . html_clean($album_infos[$cur_album]['name']) . '</h3>';
            $cur_album_info .= '<p>' . html_clean($album_infos[$cur_album]['desc']) . '</p>';
Esempio n. 9
0
File: list.php Progetto: nqv/eposys
   Module:  LIST USER/STUDENT
   Author:  Quoc Viet [aFeLiOn]
    Begin:  2005-12-28

  Comment:
--------------------------------------------------------------------------------
*/
if (!defined('IN_EPS')) {
    exit;
}
// GET
$p = eps_get_var('p', 1, true);
$list = eps_get_var('list', '');
$search = str_replace('*', '%', eps_get_var('search', ''));
$uid = eps_get_var('uid', 0, true);
// Paginate
$epsclass->load_class('class_paginate');
$per_page = 30;
$where_sql = '';
$list_type = 1;
// List?
switch ($list) {
    case 'k48htd1':
    case 'k48htd2':
    case 'k48htd3':
    case 'k48htd4':
    case 'k48htdp':
        if ($search != '') {
            $where_sql = " WHERE name LIKE '" . $epsclass->db->escape($search) . "' OR s_id LIKE '" . $epsclass->db->escape($search) . "'";
            // For link
Esempio n. 10
0
$errors = array();
$need_old_pass = true;
$epsclass->validate->data_reset();
$smarty->assign('uid', $uid);
// L o g o u t
if ($action == 'logout') {
    if ($uid != $eps_user['id']) {
        return;
    } else {
        set_user(0, 0);
        redirect('index.php', $eps_lang['Redirect_' . $action]);
        return;
    }
} else {
    if ($action == 'changepass') {
        $secr_key = eps_get_var('key', '');
        // Permission
        if (!empty($secr_key) || IS_ADMIN) {
            if (!IS_ADMIN) {
                if ($epsclass->validate->secr_verify($secr_key)) {
                    //$result = $epsclass->db->query("SELECT 1 FROM ".TBL_USER." WHERE id='".$epsclass->db->escape($uid)."' AND security='".$epsclass->db->escape($secr_key)."'") or error('Unable to fetch code', __FILE__, __LINE__, $epsclass->db->error());
                    $result = $epsclass->db->vselect(TBL_USER, "1", "WHERE `id`='" . $epsclass->db->escape($uid) . "' AND `security`='" . $epsclass->db->escape($secr_key) . "'", true);
                    if ($epsclass->db->num_rows($result) == 1) {
                        $need_old_pass = false;
                    } else {
                        alert($eps_lang['Bad_request']);
                        return;
                    }
                } else {
                    alert($epsclass->validate->errors);
                    return;
Esempio n. 11
0
/*
--------------------------------------------------------------------------------
     File:  data_edit.php

   Module:  DATA MODIFIER
   Author:  Quoc Viet [aFeLiOn]
    Begin:  2006-03-29

  Comment:
--------------------------------------------------------------------------------
*/
if (!defined('IN_EPS') || !IS_MODADMIN || !IS_ADMIN) {
    exit;
}
$data = eps_get_var('data', '');
$var = eps_get_var('var', '');
$data_file_allows = array('event', 'poll');
if (empty($data) || !in_array($data, $data_file_allows)) {
    return;
}
$data_file = file_get_contents(EPS_DATA_DIR . $data);
if (!is_file($data_file)) {
    return;
}
if (isset($_POST['form_sent']) && $_POST['form_sent'] == 'data_edit') {
    $content = str_replace("\r", '', trim($_POST['content']));
    if (!empty($var)) {
        $c_lines = explode("\n", $content);
        $contents = array();
        foreach ($c_lines as $line) {
            $tmp = explode('|', $line);