Esempio n. 1
0
        if ($epsclass->validate->chk_empty($description, $eps_lang['Description'])) {
            $epsclass->load_class('class_upload', EPS_GALLERY_DIR, array('jpg', 'gif', 'png'), 1512000);
            if ($epsclass->upload->up('req_file')) {
                $epsclass->load_class('class_image');
                $epsclass->image->create_thumb(EPS_GALLERY_DIR . $epsclass->upload->uploaded_infos['name']);
                $inserts = array('filename' => $epsclass->upload->uploaded_infos['name'], 'filesize' => $epsclass->upload->uploaded_infos['size'], 'description' => $description, 'poster_id' => $eps_user['id'], 'posted' => time());
                $epsclass->db->vinsert(TBL_GALLERY, $inserts);
                // 					redirect('index.php?eps=share', $eps_lang['Redirect_share_post']);
                return;
            } else {
                $errors = $epsclass->upload->errors;
            }
        } else {
            $errors = $epsclass->validate->errors;
        }
    }
    $epsclass->load_class('class_paginate');
    $sqls = array("SELECT COUNT(*) FROM " . TBL_GALLERY, "SELECT u.username,g.* FROM " . TBL_GALLERY . " g LEFT JOIN " . TBL_USER . " u ON g.poster_id=u.id ORDER BY g.posted DESC");
    $result = $epsclass->paginate->get_result($sqls, $module_path, $p);
    $gallery_shows = array();
    while ($cur_gallery = $epsclass->db->fetch_assoc($result)) {
        $gallery_shows[] = auto_gen_link($module_path . '&amp;gid=' . $cur_gallery['id'], '<img src="' . EPS_GALLERY_DIR . pic2thumb($cur_gallery['filename']) . '" />', '<b>' . html_clean($cur_gallery['username']) . '</b> - <i>' . format_time($cur_gallery['posted']) . ' (' . floor($cur_gallery['filesize'] / 1024) . ' KB)</i><br />' . html_clean($cur_gallery['description']), true, true, true);
    }
    $smarty->assign('error_show', !empty($errors) ? gen_alert($errors) : '');
    $smarty->assign('description', isset($description) ? html_clean($description) : '');
    $smarty->assign('p', $p);
    $smarty->assign('gallery_dir', EPS_GALLERY_DIR);
    $smarty->assign('gallery_shows', $gallery_shows);
    $smarty->assign('pagination', $epsclass->paginate->gen_page_link());
}
$smarty->display('module/gallery.tpl');
Esempio n. 2
0
File: news.php Progetto: nqv/eposys
            // Truncate
            if (eps_strlen($cur_news['content']) > $max_length && $nid < 1) {
                $cur_news['content'] = eps_truncate($cur_news['content'], $max_length);
                $cur_news['title'] = auto_gen_link('index.php?nid=' . $cur_news['id'], html_clean($cur_news['title']));
            } else {
                $cur_news['title'] = html_clean($cur_news['title']);
            }
            // BBCode
            $cur_news['content'] = $epsclass->bbcode->format($cur_news['content'], $cur_news['no_smiley']);
            // Author Or MODADMIN
            if (!empty($eps_user['id']) && ($cur_news['poster_id'] == $eps_user['id'] || IS_MODADMIN)) {
                // Edit, Delete Link
                $cur_news['action'] = gen_editlink('index.php?eps=post&amp;nid=' . $cur_news['id']);
                // Last edit by
                if (!empty($cur_news['edit_by'])) {
                    $cur_news['content'] .= '<p class="postedit">' . $eps_lang['Last_edit_by'] . ': ' . html_clean($cur_news['editor']) . ' &raquo; ' . format_time($cur_news['edit_time']) . '</p>';
                }
            }
            $cur_news['desc'] = auto_gen_link('index.php?eps=list&amp;list=user&amp;uid=' . $cur_news['poster_id'], html_clean($cur_news['poster']), '', true) . ' &raquo; ' . format_time($cur_news['post_time']);
            $news[] = $cur_news;
        }
        $smarty->assign('news_shows', $news);
        $smarty->assign('nid', $nid);
        $smarty->assign('pagination', $epsclass->paginate->gen_page_link());
        $smarty->display('module/news.tpl');
    } else {
        $smarty->display('empty.tpl');
    }
    $epsclass->db->free_result($result);
}
unset($sql, $news, $nid, $type, $max_length);
Esempio n. 3
0
File: poll.php Progetto: nqv/eposys
    $smarty->assign('num_poll', $num_poll);
    $smarty->assign('vote_result', $poll_ans);
    $smarty->assign('polled', !$show);
}
if (!$show_result || IS_ADMIN) {
    if (isset($_POST['form_sent']) && $_POST['form_sent'] == 'poll') {
        if (isset($_POST['eps_poll'])) {
            $poll_ans[$_POST['eps_poll']]['vote']++;
            $poll_content = $poll_ques . "\n";
            foreach ($poll_ans as $v) {
                $poll_content .= $v['ans'] . ' | ' . $v['vote'] . "\n";
            }
            $polled_ips[] = $eps_user['ip_address'];
            if (!$eps_user['is_guest']) {
                $polled_ids[] = $eps_user['id'];
            }
            create_file($poll_content, FILE_POLL_DATA, true);
            create_file(implode("\n", $polled_ids), FILE_POLL_ID, true);
            create_file(implode("\n", $polled_ips), FILE_POLL_IP, true);
            redirect('index.php' . (isset($_GET['eps']) ? '?eps=' . $_GET['eps'] : ''), $eps_lang['Redirect_poll']);
        }
    }
    $smarty->assign('form_tag', auto_gen_form('index.php?eps=poll', 'poll', true));
    $smarty->assign('poll_radios', $poll_radios);
    $smarty->assign('show_result_link', auto_gen_link('index.php?eps=poll&amp;result=poll', $eps_lang['Show_result'], '', true));
}
$smarty->assign('show_result', $show_result);
$smarty->assign('is_admin', IS_ADMIN);
$smarty->assign('poll_ques', $poll_ques);
unset($show, $max_pixel, $poll_ques, $poll_ans, $poll_radios, $num_poll, $polled_ips, $polled_ids, $poll_content);
$smarty->display('module/poll.tpl');
Esempio n. 4
0
 function gen_page_link()
 {
     global $eps_config, $eps_lang;
     $pages = array();
     $url = $this->base_url;
     $cur = $this->cur_page;
     $total_page = ceil($this->num_item / $this->per_page);
     if ($total_page <= 1) {
         $pages = array('<span><strong>1</strong></span>');
     } else {
         if (strpos($url, '?')) {
             $url .= '&amp;';
         } else {
             $url .= '?';
         }
         // Previous
         if ($cur > 1) {
             $pages[] = auto_gen_link($url . 'p=' . ($cur - 1), '&lt', $eps_lang['Previous_page'], true);
         }
         // 1 2...
         if ($cur >= 4) {
             $pages[] = auto_gen_link($url . 'p=1', '1', '1', true);
             if ($cur >= 5) {
                 $pages[] = auto_gen_link($url . 'p=2', '2', '2', true);
             }
             if ($cur >= 6) {
                 $pages[] = '&hellip;';
             }
         }
         // 4 5 [6] 7 8
         for ($i = $cur - 2, $stop = $cur + 2; $i <= $stop; $i++) {
             if ($i < 1 || $i > $total_page) {
                 continue;
             } else {
                 if ($i != $cur) {
                     $pages[] = auto_gen_link($url . 'p=' . $i, $i, $i, true);
                 } else {
                     $pages[] = '<span><strong>' . $i . '</strong></span>';
                 }
             }
         }
         // ...10 11
         if ($cur <= $total_page - 3) {
             if ($cur <= $total_page - 5) {
                 $pages[] = '&hellip;';
             }
             if ($cur <= $total_page - 4) {
                 $pages[] = auto_gen_link($url . 'p=' . ($total_page - 1), $total_page - 1, $total_page - 1, true);
             }
             $pages[] = auto_gen_link($url . 'p=' . $total_page, $total_page, $total_page, true);
         }
         // Next
         if ($cur < $total_page) {
             $pages[] = auto_gen_link($url . 'p=' . ($cur + 1), '&gt', $eps_lang['Next_page'], true);
         }
     }
     return '<span>' . $eps_lang['Page'] . '</span> ' . implode(' ', $pages);
 }
Esempio n. 5
0
function gen_editlink($url, $del = true)
{
    global $eps_lang;
    $tmp = '<li>' . auto_gen_link($url . '&amp;action=edit', $eps_lang['Edit'], $eps_lang['Edit'], true) . '</li>';
    if ($del) {
        $tmp .= '<li>' . auto_gen_link($url . '&amp;action=delete', $eps_lang['Delete'], $eps_lang['Delete'], true) . '</li>';
    }
    return '<ul>' . $tmp . '</ul>';
}
Esempio n. 6
0
File: login.php Progetto: nqv/eposys
            $errors = $epsclass->validate->errors;
            $epsclass->validate->data_reset();
        }
    }
    $_SESSION['visual'] = eps_random(9);
    $req_fields = array('username' => $eps_lang['Username'], 'password' => $eps_lang['Password'], 'confirmcode' => $eps_lang['Visual_confirm']);
    $smarty->assign('js_lang', gen_jslang($req_fields));
    $smarty->assign('error_show', !empty($errors) ? gen_alert($errors) : '');
    $smarty->assign('form_tag', auto_gen_form('index.php?eps=login', 'login', true));
    $smarty->assign('username', isset($_POST['req_username']) ? html_clean($username) : '');
    $smarty->assign('show_title', empty($tiny_method) ? true : false);
    $smarty->assign('size', empty($tiny_method) ? '30' : '15');
    $smarty->assign('antiflood_allow', $epsclass->antiflood->try_allow);
    $smarty->assign('visual', gen_visual($_SESSION['visual'], 6));
    $smarty->assign('auto', isset($auto) ? $auto : false);
    $smarty->assign('forgotpass_link', auto_gen_link('index.php?eps=login&amp;action=fgpass', $eps_lang['Forgot_password'], '', true));
    unset($username, $password, $confirm_code, $username_tmp, $user_id, $db_password, $group_id, $active, $errors, $auto);
    $smarty->display('module/login.tpl');
} else {
    if ($action == 'fgpass') {
        if (isset($_POST['form_sent'])) {
            // Validate
            $email = strtolower(trim($_POST['req_email']));
            $confirm_code = trim($_POST['req_confirmcode']);
            $epsclass->validate->chk_email($email, 0, true);
            if ($epsclass->validate->chk_empty($confirm_code, $eps_lang['Confirm_code'])) {
                $epsclass->validate->chk_match($confirm_code, eps_encrypt($_SESSION['visual'], 6), 'Confirm_code');
            }
            if (empty($epsclass->validate->errors)) {
                $result = $epsclass->db->vselect(TBL_USER, array('id', 'username'), $email, 'email');
                if ($epsclass->db->num_rows($result) == 1) {
Esempio n. 7
0
File: album.php Progetto: nqv/eposys
$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>';
        } else {
            $cur_album_info = '<img src="image/noimg.png" />';
            $cur_album_info .= '<h3>' . htmlspecialchars($cur_album) . '</h3>';
        }
        $album_shows[] = auto_gen_link('index.php?eps=album&amp;album=' . urlencode($cur_album), $cur_album_info, '', true);
    }
    $smarty->assign('album_shows', $album_shows);
} else {
    if (!is_dir(EPS_ALBUM_DIR . $album)) {
        return;
    }
    // In Album-Directory
    $thumbs = get_stuff('thumb', $album);
    // No Thumbs
    if (empty($thumbs)) {
        ?>
		<div class="showalbum">
			<img src="./image/noimg.png" />
		</div>
<?php 
Esempio n. 8
0
File: list.php Progetto: nqv/eposys
    while ($cur_user = $epsclass->db->fetch_assoc($result)) {
        $tmp = array();
        $cur_detail = '';
        if (!$eps_user['is_guest']) {
            $cur_details = array();
            foreach ($details as $key => $value) {
                $cur_details[] = '<li><strong>' . $value . ': </strong>' . $cur_user[$key];
            }
            $cur_detail = '<ul>' . implode('</li>', $cur_details) . '</li></ul>';
        }
        if ($list_type == 2) {
            $tmp[1] = $eps_user['is_guest'] ? html_clean($cur_user['name']) : gen_link('#', html_clean($cur_user['name']), $cur_detail, false, true);
            $tmp[2] = $cur_user['birth'];
            $tmp[3] = !empty($eps_lang[$cur_user['course']]) ? $eps_lang[$cur_user['course']] : html_clean($cur_user['course']);
        } else {
            $link_edit = IS_MODADMIN ? 'index.php?eps=profile&amp;uid=' . $cur_user['id'] : '#';
            $tmp[1] = $eps_user['is_guest'] ? html_clean($cur_user['username']) : auto_gen_link($link_edit, $cur_user['username'], $cur_detail, true, true, true);
            $tmp[2] = format_time($cur_user['reg_time']);
            $tmp[3] = html_clean($cur_user['g_title']);
        }
        $tmp[0] = $start++;
        $list_shows[] = $tmp;
    }
    $smarty->assign('list_type', $list_type);
    $smarty->assign('list_shows', $list_shows);
    $smarty->assign('pagination', $epsclass->paginate->gen_page_link());
    $smarty->display('module/list.tpl');
} else {
    $smarty->display('empty.tpl');
}
unset($list, $search, $uid, $where_sql, $list_type, $sqls, $page_link, $list_shows, $empty, $start, $prefix, $tpl_jump);
Esempio n. 9
0
        // Parse
        $user['reg_time'] = format_time($user['reg_time']);
        $user['name'] = html_clean($user['name']);
        $user['birth'] = html_clean($user['birth']);
        $user['course'] = !empty($eps_lang[$user['course']]) ? $eps_lang[$user['course']] : html_clean($user['course']);
        $user['phone'] = html_clean(isset($phone) ? $phone : $user['phone']);
        $user['yahoo'] = html_clean(isset($yahoo) ? $yahoo : $user['yahoo']);
        $smarty->assign('yesno_radios', array(1 => $eps_lang['Yes'], 0 => $eps_lang['No']));
        $smarty->assign('is_admin', IS_ADMIN);
        $smarty->assign('is_modadmin', IS_MODADMIN);
        $smarty->assign('user', $user);
        $smarty->assign('js_lang', gen_jslang($req_fields));
        $smarty->assign('error_show', !empty($errors) ? gen_alert($errors) : '');
        $smarty->assign('form_tag1', auto_gen_form('index.php?eps=profile&amp;uid=' . $uid, 'profile', true));
        $smarty->assign('username', html_clean(isset($username) ? $username : $user['username']));
        $smarty->assign('changepass_link', auto_gen_link('index.php?eps=profile&amp;action=changepass&amp;uid=' . $uid, $eps_lang['Change_password']));
        $smarty->assign('email', html_clean(isset($email) ? $email : $user['email']));
        $smarty->assign('s_id', html_clean(isset($s_id) ? $s_id : $user['s_id']));
        $smarty->assign('groups', $groups);
        $smarty->assign('use_ajax', isset($_POST['use_ajax']) || $user['ajax'] ? true : false);
        $smarty->assign('styles', get_stuff('style'));
        $smarty->assign('languages', get_stuff('language'));
        $smarty->assign('form_tag2', auto_gen_form('index.php?eps=profile&amp;uid=' . $uid, 'another', true));
        $smarty->assign('native', html_clean(isset($native) ? $native : $user['native']));
        $smarty->assign('address', html_clean(isset($address) ? $address : $user['address']));
        $smarty->assign('phone', html_clean(isset($phone) ? $phone : $user['phone']));
        $smarty->assign('yahoo', html_clean(isset($yahoo) ? $yahoo : $user['yahoo']));
        $smarty->display('module/profile.tpl');
    }
}
unset($errors, $need_old_pass, $action, $uid, $secr_key, $old_password, $new_password1, $new_password2, $req_fields, $user, $groups, $allow_group_id, $username, $email, $s_id);
Esempio n. 10
0
File: share.php Progetto: nqv/eposys
                $epsclass->db->vinsert(TBL_SHARE, $inserts);
                redirect('index.php?eps=share', $eps_lang['Redirect_share_post']);
                return;
            } else {
                $errors = $epsclass->upload->errors;
            }
        } else {
            $errors = $epsclass->validate->errors;
        }
    }
    // Paginate
    $epsclass->load_class('class_paginate');
    $sqls = array("SELECT COUNT(id) FROM " . TBL_SHARE, "SELECT u.username,s.* FROM " . TBL_SHARE . " s LEFT JOIN " . TBL_USER . " u ON s.poster_id=u.id ORDER BY s.post_time DESC");
    $result = $epsclass->paginate->get_result($sqls, 'index.php?eps=share', $p);
    $shares = array();
    if ($epsclass->paginate->num_result()) {
        while ($cur_share = $epsclass->db->fetch_assoc($result)) {
            $tmp = array('link' => gen_link('download.php?down=share&amp;id=' . $cur_share['id'], html_clean($cur_share['url']), '', true), 'comment' => html_clean($cur_share['comment']), 'poster' => auto_gen_link('index.php?eps=list&amp;list=user&amp;uid=' . $cur_share['poster_id'], html_clean($cur_share['username']), '', true), 'post_time' => format_time($cur_share['post_time']));
            if ($cur_share['poster_id'] == $eps_user['id'] || IS_MODADMIN) {
                $tmp['editlink'] = gen_editlink('index.php?eps=share&amp;shid=' . $cur_share['id']);
            }
            $shares[] = $tmp;
        }
        $smarty->assign('pagination', $epsclass->paginate->gen_page_link());
    }
    $smarty->assign('error_show', !empty($errors) ? gen_alert($errors) : '');
    $smarty->assign('shares', $shares);
    $smarty->assign('comment', isset($comment) ? html_clean($comment) : '');
    $smarty->display('module/share.tpl');
}
unset($p, $shid, $action, $errors, $req_fields, $this_share, $comment, $updates, $inserts, $sqls, $shares);