Beispiel #1
0
function redirect($url, $message, $ajax_method = true)
{
    global $epsclass, $smarty, $eps_config, $eps_lang;
    if (defined('HEADER_LOADED')) {
        ob_end_clean();
    }
    if ($url == '') {
        $url = 'index.php';
    }
    $smarty->assign('tpl_redir_url', str_replace(array('<', '>', '"'), array('&lt;', '&gt;', '&quot;'), $url));
    $smarty->assign('tpl_redir_title', htmlspecialchars($eps_config['title']) . ' | ' . $eps_lang['Redirecting']);
    $smarty->assign('tpl_redir_text', $message . '<p>' . gen_link($url, $eps_lang['Click_redirect']) . '</p>');
    $epsclass->db->close();
    $smarty->display($ajax_method && eps_use_ajax() ? 'redirect_ajax.tpl' : 'redirect.tpl');
    exit;
}
Beispiel #2
0
     $smarty->assign('tpl_jump', gen_course_jump_tpl('index.php?eps=list', $list));
 }
 // Show User Detail
 $details = $list_type == 2 ? array('native' => $eps_lang['Native'], 'address' => $eps_lang['Address'], 'phone' => $eps_lang['Phone'], 'yahoo' => $eps_lang['Yahoo']) : array('name' => $eps_lang['Name'], 'course' => $eps_lang['Course'], 's_id' => $eps_lang['StudentID'], 'email' => $eps_lang['Email'], 'active' => $eps_lang['Active']);
 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');
Beispiel #3
0
    $sql = "SELECT COUNT(*) FROM " . $ecs->table('bonus_type') . " WHERE type_name='{$type_name}'";
    if ($db->getOne($sql) > 0) {
        $link[] = array('text' => $_LANG['go_back'], 'href' => 'javascript:history.back(-1)');
        sys_msg($_LANG['type_name_exist'], 0, $link);
    }
    /* 获得日期信息 */
    $send_startdate = local_strtotime($_POST['send_start_date']);
    $send_enddate = local_strtotime($_POST['send_end_date']);
    $use_startdate = local_strtotime($_POST['use_start_date']);
    $use_enddate = local_strtotime($_POST['use_end_date']);
    $number = empty($_POST['number']) ? '1' : $_POST['number'];
    /* 插入数据库。 */
    $sql = "INSERT INTO " . $ecs->table('bonus_type') . " (type_name, type_money,send_start_date,send_end_date,use_start_date,use_end_date,send_type,min_amount,min_goods_amount,number)\n    VALUES ('{$type_name}',\n            '{$_POST['type_money']}',\n            '{$send_startdate}',\n            '{$send_enddate}',\n            '{$use_startdate}',\n            '{$use_enddate}',\n            '{$_POST['send_type']}',\n            '{$min_amount}','" . floatval($_POST['min_goods_amount']) . "'," . $number . ")";
    $db->query($sql);
    if ($_POST['send_type'] == 4 || $_POST['send_type'] == 5) {
        gen_link($_POST['type_name'], $db, $ecs);
    }
    /* 记录管理员操作 */
    admin_log($_POST['type_name'], 'add', 'bonustype');
    /* 清除缓存 */
    clear_cache_files();
    /* 提示信息 */
    $link[0]['text'] = $_LANG['continus_add'];
    $link[0]['href'] = 'bonus.php?act=add';
    $link[1]['text'] = $_LANG['back_list'];
    $link[1]['href'] = 'bonus.php?act=list';
    sys_msg($_LANG['add'] . "&nbsp;" . $_POST['type_name'] . "&nbsp;" . $_LANG['attradd_succed'], 0, $link);
}
/*------------------------------------------------------ */
//-- 产生全民红包
/*------------------------------------------------------ */
Beispiel #4
0
                $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);
Beispiel #5
0
// Forum ID's to exclude?
$forum_nfid = '';
if (empty($forum_prefix)) {
    return;
}
$forum_sql = '';
// Was any specific forum ID's supplied?
if (!empty($forum_fid)) {
    $fids = explode(',', trim($forum_fid));
    $fids = array_map('intval', $fids);
    if (!empty($fids)) {
        $forum_sql = ' AND f.id IN(' . implode(',', $fids) . ')';
    }
}
// Any forum ID's to exclude?
if (!empty($forum_nfid)) {
    $nfids = explode(',', trim($forum_nfid));
    $nfids = array_map('intval', $nfids);
    if (!empty($nfids)) {
        $forum_sql = ' AND f.id NOT IN(' . implode(',', $nfids) . ')';
    }
}
$result = $epsclass->db->query('SELECT t.id, t.subject FROM ' . $forum_prefix . 'topics AS t INNER JOIN ' . $forum_prefix . 'forums AS f ON f.id=t.forum_id LEFT JOIN ' . $forum_prefix . 'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=3) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.moved_to IS NULL' . $forum_sql . ' ORDER BY t.last_post DESC LIMIT ' . $show_max_topics) or error('Unable to fetch topic list', __FILE__, __LINE__, $epsclass->db->error());
echo '<ul>';
while ($cur_topic = $epsclass->db->fetch_assoc($result)) {
    if (eps_strlen($cur_topic['subject']) > $max_subject_length) {
        $cur_topic['subject'] = eps_truncate($cur_topic['subject'], $max_subject_length);
    }
    echo '<li>' . gen_link('forum/viewtopic.php?id=' . $cur_topic['id'] . '&amp;action=new', htmlspecialchars($cur_topic['subject']), htmlspecialchars($cur_topic['subject'])) . '</li>' . "\n";
}
echo '</ul>';