Esempio n. 1
0
 public function s($search_string)
 {
     $ajax = $this->input->is_ajax_request();
     $search_string = urldecode($search_string);
     $strs = explode(' ', $search_string);
     $keywords = array();
     if (count($strs) > 1) {
         array_push($keywords, $search_string);
     }
     foreach ($strs as $str) {
         array_push($keywords, $str);
     }
     $ids;
     $result = $this->search->search($keywords);
     if (count($result) > 0) {
         foreach ($result as $res) {
             $ids[] = $res['id'];
         }
         $data['pages'] = $this->page_handler->load_pages('', '', $ids);
         $data['results'] = TRUE;
     } else {
         $data['results'] = FALSE;
     }
     $data['ajax'] = $ajax;
     if ($ajax) {
         $data_json = array('body' => $this->load->view('main_pages/search_view', $data, TRUE), 'title' => 'Пребарување');
         $this->output->set_output(json_encode($data_json));
     } else {
         set_title('Пребарување');
         $this->load->view('main_pages/search_view', $data);
     }
 }
Esempio n. 2
0
 public function index()
 {
     set_title('Main Page Onbeng - Online Bengkel');
     $this->load->view('meta');
     $this->load->view('script');
     $this->load->view('query_data');
     $this->load->view('main/view');
 }
Esempio n. 3
0
 /**
  *
  * Load the apropriate page acording the given parametar
  *
  * @param name of the page
  *
  * @param page_arguments object
  *
  * @return Send the page to browser
  *
  *
  */
 public function load_page($page_name, $args)
 {
     $page = $this->page_handler->load_page($page_name);
     $shortcodes = $this->shortcodes;
     if ($page == FALSE) {
         show_404();
     } else {
         $page->content = $shortcodes->do_shortcode($page->content);
         $data['page'] = $page;
     }
     if (isset($page->category)) {
         $this->load->library('post_handler');
         if ($page_name == 'home' or $page->category == 1) {
             $this->load->library('user_agent');
             $data['browser'] = $this->agent->is_browser();
             $data['pages'] = $this->page_handler->load_pages($page->category, 'temi');
         } else {
             $data['posts'] = $this->post_handler->load_posts($page->category);
         }
     }
     set_active_page($page->name);
     set_title($page->title);
     foreach ($args as $key => $value) {
         $data[$key] = $value;
     }
     if ($data['ajax']) {
         if ($page_name == 'news' && isset($args[0])) {
             $data['post'] = $this->post_handler->load_post($args[0]);
             $data_json = array('body' => $this->load->view('templates/single', $data, true), 'title' => $data['post']->title);
             $this->output->set_output(json_encode($data_json));
         } else {
             if (file_exists(APPPATH . "views/templates/" . $page->template) && isset($page->template) && $page->template != 'default') {
                 $data_json = array('body' => $this->load->view('templates/' . $page->template, $data, true), 'title' => get_title());
                 $this->output->set_output(json_encode($data_json));
             } else {
                 $page->content = $shortcodes->do_shortcode($page->content);
                 $data_json = array('body' => $this->load->view('templates/page', $data, true), 'title' => get_title());
                 $this->output->set_output(json_encode($data_json));
             }
         }
     } else {
         if ($page_name == 'news' && isset($args[0])) {
             $data['post'] = $this->post_handler->load_post($args[0]);
             set_title($data['post']->title);
             $this->load->view('templates/single', $data);
         } else {
             if (file_exists(APPPATH . "views/templates/" . $page->template) && isset($page->template) && $page->template != 'default') {
                 $this->load->view('templates/' . $page->template, $data);
             } else {
                 $this->load->view('templates/page', $data);
             }
         }
     }
 }
Esempio n. 4
0
 public function join_am()
 {
     set_active_page('join');
     set_title(t('title_join_am'));
     $ajax = $this->input->is_ajax_request();
     $data['ajax'] = $ajax;
     if ($ajax) {
         $data_json = array('body' => $this->load->view('main_pages/join_am', $data, true), 'title' => get_title());
         $this->output->set_output(json_encode($data_json));
     } else {
         // $data['post'] = $this->post_handler->load_post($args[0]);
         $this->load->view('main_pages/join_am', $data, FALSE);
     }
 }
Esempio n. 5
0
 public function index()
 {
     set_active_page('wastemap');
     $page = $this->page_handler->load_page('wastemap');
     set_title($page->title);
     $ajax = $this->input->is_ajax_request();
     $data['ajax'] = $ajax;
     if ($ajax) {
         $data_json = array('body' => $this->load->view('main_pages/wastemap' . $page->template, $data, true), 'title' => get_title());
         $this->output->set_output(json_encode($data_json));
     } else {
         $this->load->view('main_pages/wastemap', $data, FALSE);
     }
 }
Esempio n. 6
0
 public function __construct()
 {
     global $locale, $admin_pages, $aidlink;
     @(list($title) = dbarraynum(dbquery("SELECT admin_title FROM " . DB_ADMIN . " WHERE admin_link='" . FUSION_SELF . "'")));
     set_title($locale['global_123'] . $locale['global_201'] . ($title ? $title . $locale['global_200'] : ""));
     $this->admin_pages = $admin_pages;
     // generate core sections
     $this->admin_sections = array(0 => $locale['ac00'], 1 => $locale['ac01'], 2 => $locale['ac02'], 3 => $locale['ac03'], 4 => $locale['ac04'], 5 => $locale['ac05']);
     $this->current_page = self::_currentPage();
     // Dashboard breadcrumb
     add_breadcrumb(array('link' => ADMIN . 'index.php' . $aidlink . '&pagenum=0', 'title' => $locale['ac10']));
     $activetab = isset($_GET['pagenum']) && isnum($_GET['pagenum']) ? $_GET['pagenum'] : $this->_isActive();
     if ($activetab != 0 && $activetab <= 5) {
         add_breadcrumb(array('link' => ADMIN . $aidlink . "&amp;pagenum=" . $activetab, 'title' => $locale['ac0' . $activetab]));
     }
 }
Esempio n. 7
0
 /**
  * 单独页面
  * @param $page
  */
 public function page($page)
 {
     if (\ULib\Router::$begin_status) {
         lib()->load('project', 'menu')->add("project", new \ULib\Project($page, 0));
         lib()->add('menu', new \ULib\Menu(true));
         set_title(project()->title(), site_title(false));
         theme()->header_add("<script>var PM_PAGE_ID = " . project()->id() . ";</script>", 40);
         theme()->set_desc(project()->desc());
         theme()->set_keywords(project()->keywords());
         header("Content-Type:text/html; charset=utf-8");
         $this->__view('comm/header.php');
         $this->__view('project/page.php');
         $this->__view('comm/footer.php');
     } else {
         $this->__load_404();
     }
 }
Esempio n. 8
0
 /**
  * Index Page for this controller.
  *
  * Maps to the following URL
  * 		http://example.com/index.php/welcome
  *	- or -  
  * 		http://example.com/index.php/welcome/index
  *	- or -
  * Since this controller is set as the default controller in 
  * config/routes.php, it's displayed at http://example.com/
  *
  * So any other public methods not prefixed with an underscore will
  * map to /index.php/welcome/<method_name>
  * @see http://codeigniter.com/user_guide/general/urls.html
  */
 public function index()
 {
     set_title('Helpline');
     $offset = $this->uri->segment($this->config->item('paginiation_segment'));
     $list = $this->helpline_model->get_all_logs($this->config->item('pagination_per_page'), $offset, $this->input->get_post(NULL, TRUE));
     $p_config = array();
     $p_config['base_url'] = site_url('helpline/page');
     $p_config['total_rows'] = $list['num_rows'];
     $p_config['uri_segment'] = $this->config->item('paginiation_segment');
     $p_config['per_page'] = $this->config->item('pagination_per_page');
     $p_config['num_links'] = 10;
     $p_config['full_tag_open'] = '<div class="pagination"><span>Pages:</span>';
     $p_config['full_tag_close'] = '</div>';
     $p_config['cur_tag_open'] = '<strong class="ui-state-hover ui-corner-all">';
     $p_config['cur_tag_close'] = '</strong>';
     $p_config['anchor_class'] = 'class="ui-state-default ui-corner-all"';
     $p_config['suffix'] = '?' . http_build_query($_GET, '', "&");
     $p_config['first_link'] = FALSE;
     $p_config['last_link'] = FALSE;
     $data['callers'] = $list['rows'];
     $this->pagination->initialize($p_config);
     $this->load->view('helpline/list', $data);
 }
Esempio n. 9
0
 /**
  * Fetches all Forum Tag Table records
  *
  * @param bool|TRUE $setTitle
  */
 public function set_TagInfo($setTitle = TRUE)
 {
     $locale = fusion_get_locale("", FORUM_LOCALE);
     $locale += fusion_get_locale("", FORUM_TAGS_LOCALE);
     if ($setTitle == TRUE) {
         set_title($locale['forum_0000']);
         add_to_title($locale['global_201'] . $locale['forum_tag_0100']);
         add_breadcrumb(array('link' => FORUM . "index.php", 'title' => $locale['forum_0000']));
         add_breadcrumb(array('link' => FORUM . "tags.php", 'title' => $locale['forum_tag_0100']));
     }
     $thread_result = NULL;
     if (isset($_GET['tag_id']) && isnum($_GET['tag_id'])) {
         $tag_query = "SELECT * FROM " . DB_FORUM_TAGS . " WHERE tag_status=1 AND tag_id='" . intval($_GET['tag_id']) . "'\n            " . (multilang_table("FO") ? "AND tag_language='" . LANGUAGE . "'" : "") . "\n            ";
         $tag_result = dbquery($tag_query);
         if (dbrows($tag_result) > 0) {
             $data = dbarray($tag_result);
             add_to_title($locale['global_201'] . $data['tag_title']);
             add_breadcrumb(array('link' => FORUM . "tags.php?tag_id=" . $data['tag_id'], 'title' => $data['tag_title']));
             if (!empty($data['tag_description'])) {
                 set_meta('description', $data['tag_description']);
             }
             $data['tag_link'] = FORUM . "tags.php?tag_id=" . $data['tag_id'];
             $data['tag_active'] = isset($_GET['viewtags']) && isset($_GET['tag_id']) && $_GET['tag_id'] == $data['tag_id'] ? TRUE : FALSE;
             $this->tag_info['tags'][$data['tag_id']] = $data;
             $this->tag_info['tags'][0] = array('tag_id' => 0, 'tag_link' => FORUM . "tags.php", 'tag_title' => fusion_get_locale("global_700") . "&hellip;", 'tag_active' => '', 'tag_color' => '');
             $this->tag_info['filter'] = $this->filter()->get_FilterInfo();
             $filter_sql = $this->filter()->get_filterSQL();
             // get forum threads.
             $this->tag_info = array_merge_recursive($this->tag_info, self::get_tag_thread($_GET['tag_id'], array("condition" => $filter_sql['condition'], "order" => $filter_sql['order'])));
         } else {
             redirect(FORUM . "index.php");
         }
     } else {
         $this->cache_tags();
     }
 }
Esempio n. 10
0
<?php

auto_set_params(array('commit', 'query'));
set_title("Tag Implications");
create_page_params();
if (Request::$params->commit == "Search Aliases") {
    redirect_to("tag_alias#index", array('query' => Request::$params->query));
}
if (Request::$params->query) {
    $name = "%" . Request::$params->query . "%";
    $implications = TagImplication::find_all(array('calc_rows', 'order' => "is_pending DESC, (SELECT name FROM tags WHERE id = tag_implications.predicate_id), (SELECT name FROM tags WHERE id = tag_implications.consequent_id)", 'per_page' => 20, 'conditions' => array("predicate_id IN (SELECT id FROM tags WHERE name LIKE ?) OR consequent_id IN (SELECT id FROM tags WHERE name LIKE ?)", $name, $name), 'page' => Request::$params->page));
} else {
    $implications = TagImplication::find_all(array('calc_rows', 'order' => "is_pending DESC, (SELECT name FROM tags WHERE id = tag_implications.predicate_id), (SELECT name FROM tags WHERE id = tag_implications.consequent_id)", 'per_page' => 20, 'page' => Request::$params->page));
}
calc_pages();
respond_to_list("implications");
Esempio n. 11
0
<?php

set_title(site_name() . ' - Jocul');
$smarty->assign('content_tpl', 'content/main/thegame');
Esempio n. 12
0
if (!db_exists(DB_WEBLINKS)) {
    redirect(BASEDIR . "error.php?code=404");
}
require_once THEMES . "templates/header.php";
require_once INCLUDES . "infusions_include.php";
if (file_exists(INFUSIONS . "weblinks/locale/" . LOCALESET . "weblinks.php")) {
    include INFUSIONS . "weblinks/locale/" . LOCALESET . "weblinks.php";
} else {
    include INFUSIONS . "weblinks/locale/English/weblinks.php";
}
include INFUSIONS . "weblinks/templates/weblinks.php";
$wl_settings = get_settings("weblinks");
$weblink_cat_index = dbquery_tree(DB_WEBLINK_CATS, 'weblink_cat_id', 'weblink_cat_parent');
add_breadcrumb(array('link' => INFUSIONS . 'weblinks/weblinks.php', 'title' => $locale['400']));
if (!isset($_GET['weblink_id']) || !isset($_GET['weblink_cat_id'])) {
    set_title($locale['400']);
}
if (isset($_GET['weblink_id']) && isnum($_GET['weblink_id'])) {
    $res = 0;
    $data = dbarray(dbquery("SELECT weblink_url,weblink_cat, weblink_visibility FROM " . DB_WEBLINKS . " WHERE weblink_id='" . intval($_GET['weblink_id']) . "'"));
    if (checkgroup($data['weblink_visibility'])) {
        $res = 1;
        dbquery("UPDATE " . DB_WEBLINKS . " SET weblink_count=weblink_count+1 WHERE weblink_id='" . intval($_GET['weblink_id']) . "'");
        redirect($data['weblink_url']);
    } else {
        redirect(FUSION_SELF);
    }
} elseif (isset($_GET['cat_id']) && isnum($_GET['cat_id'])) {
    $info = array();
    $info['item'] = array();
    $result = dbquery("SELECT weblink_cat_name, weblink_cat_sorting FROM\n\t" . DB_WEBLINK_CATS . " " . (multilang_table("WL") ? "WHERE weblink_cat_language='" . LANGUAGE . "' AND" : "WHERE") . " weblink_cat_id='" . intval($_GET['cat_id']) . "'");
Esempio n. 13
0
<?php

define('ROOT', dirname($_SERVER['SCRIPT_FILENAME']));
require ROOT . "/include/admin-init.php";
if (!is_login()) {
    die(html_jump('login.php'));
}
set_page_type('library');
set_page_power(array(1));
set_title("图书操作");
$all_user = new user_info();
$all_user->get_id_list();
$category = new library_category();
$category->get_id_list();
get_admin_header();
$status = NULL;
if (!isset($_POST['action'])) {
    if (isset($_GET['act'])) {
        switch ($_GET['act']) {
            case 'del':
                $book_del = new library_book_del();
                if (isset($_GET['id'])) {
                    $book_del->add($_GET['id']);
                    $status = $book_del->del();
                    if ($status == 'OK') {
                        print_successful_notice("图书删除成功");
                    } else {
                        print_err_notice($status);
                    }
                }
                library_category_up_all();
Esempio n. 14
0
<?php

define('ROOT', dirname($_SERVER['SCRIPT_FILENAME']));
require ROOT . "/include/admin-init.php";
if (!is_login()) {
    die(html_jump('login.php'));
}
set_page_type('option', 'option_library');
set_page_power(array(1));
set_title("网站设置");
library_option();
//加载图书管理设置
get_admin_header();
?>
<div id="option-setting">

<h2 class="left">图书管理设置</h2>
<?php 
if (isset($_GET['status'])) {
    if ($_GET['status'] == 'OK') {
        echo '<p class="status blue center">成功更新设置信息</p>';
    } else {
        echo '<p class="status red center">', $_GET['status'], '</p>';
    }
}
?>
<form method="post" action="option-action.php">
<table align="center" cellspacing="1" class="list">
<tr>
<th>图书每页显示数目</th>
<td><input name="library-one-page" value="<?php 
Esempio n. 15
0
<?php

if (!defined('BASEPATH')) {
    exit('Nu poti accesa acest fisier direct.');
}
set_title(site_name() . ' - Descarcare');
assign('content_tpl', 'content/download');
Esempio n. 16
0
<?php

if (!defined('BASEPATH')) {
    exit('Nu poti accesa acest fisier direct.');
}
set_title(site_name() . ' - Meniu principal');
assign('content_tpl', 'content/main');
Esempio n. 17
0
<?php

session_start();
if (!isset($_SESSION['SESSION'])) {
    require "includes/session_init.php";
}
if ($_SESSION['LOGGEDIN'] != true) {
    header("Location: index.php");
    exit;
}
include 'includes/functions.php';
include 'includes/init.php';
?>
<script src="scripts/jquery-ui.js"></script>
<link href="styles/jquery-ui-1.9.2.custom.css" rel="stylesheet">
<?php 
set_title('Test title');
//header//
include 'includes/header.php';
echo '<br/><br/><br/>';
//page//
$u = '';
$u = $_GET['url'];
if ($u == 'film') {
    include 'includes/search_film.php';
} elseif ($u == 'job') {
    include 'includes/search_job.php';
} elseif ($u == 'forum') {
    include 'includes/search_forum.php';
}
Esempio n. 18
0
<?php

set_title(CONFIG::app_name . " Forum");
create_page_params();
auto_set_params(array('query', 'parent_id'));
if (isset(request::$params->parent_id)) {
    $forum_posts = ForumPost::find_all(array('order' => "is_sticky desc, updated_at DESC", 'per_page' => 100, 'conditions' => array("parent_id = ?", request::$params->parent_id), 'page' => request::$params->page));
} else {
    $forum_posts = ForumPost::find_all(array('order' => "is_sticky desc, updated_at DESC", 'per_page' => 30, 'conditions' => array("parent_id IS NULL"), 'page' => request::$params->page));
}
calc_pages();
respond_to_list($forum_posts);
Esempio n. 19
0
<?php

if (!defined('BASEPATH')) {
    exit('Nu poti accesa acest fisier direct.');
}
set_title(site_name() . ' - Parola depozit');
$DB = Mysql::init();
check_login();
$step = 'request';
if (isset($_POST['sendStoragePassword'])) {
    $data = $DB->select("id, login, email", ACCOUNT_DATABASE . ".account", "`id`='" . $_SESSION['user_data']['id'] . "'");
    if (is_array($data)) {
        $storage_pass = $DB->select('password', PLAYER_DATABASE . '.safebox', "`account_id`='" . $_SESSION['user_data']['id'] . "'");
        if ($storage_pass == '') {
            $step = 'error';
        } else {
            // trimitem email
            $arr = array('login' => $data['login'], 'password' => $storage_pass['password'], 'site_name' => site_name(), 'site_url' => site_url());
            $email_ses = email()->load('passwordlost/storagepassword');
            $email_ses->assign($arr);
            $email_ses->set('noreply@' . rtrim(site_name(), '/'), '', $data['email'], 'Metin2 - Parola Depozit');
            $email_ses->send();
            $step = 'sent';
        }
    }
}
assign('content_tpl', 'content/storagepassword/' . $step);
Esempio n. 20
0
    }
    render_articles_main($info);
} else {
    // View articles in a category
    $result = dbquery("SELECT * FROM " . DB_ARTICLE_CATS . " where article_cat_id='" . intval($_GET['cat_id']) . "' ORDER BY article_cat_name");
    if (dbrows($result) != 0) {
        $cdata = dbarray($result);
        $info['articles']['child_categories'] = array();
        // get child category
        $child_result = dbquery("SELECT\n\t\tac.article_cat_id, ac.article_cat_name, ac.article_cat_description, count(a.article_id) 'article_count', count(ac2.article_cat_id) 'article_sub_count'\n\t\tFROM " . DB_ARTICLE_CATS . " ac\n\t\tLEFT JOIN " . DB_ARTICLE_CATS . " ac2 ON ac.article_cat_id=ac2.article_cat_parent\n\t\tLEFT JOIN " . DB_ARTICLES . " a on a.article_cat=ac.article_cat_id AND a.article_draft ='0' AND " . groupaccess("a.article_visibility") . "\n\t\t" . (multilang_table("AR") ? "and a.article_language='" . LANGUAGE . "'" : "") . "\n\t\t" . (multilang_table("AR") ? "WHERE ac.article_cat_language='" . LANGUAGE . "' AND" : "WHERE") . "\n\t\tac.article_cat_parent = '" . intval($cdata['article_cat_id']) . "'\n\t\tGROUP BY ac.article_cat_id\n\t\tORDER BY ac.article_cat_name\n\t\t");
        if (dbrows($child_result) > 0) {
            while ($childData = dbarray($child_result)) {
                $info['articles']['child_categories'][$childData['article_cat_id']] = $childData;
            }
        }
        set_title($cdata['article_cat_name'] . $locale['global_200'] . $locale['400']);
        articleCats_breadcrumbs($article_cat_index);
        $info['articles']['category'] = $cdata;
        // xss
        $info['articles_max_rows'] = dbcount("(article_id)", DB_ARTICLES, "article_cat='" . $_GET['cat_id'] . "' AND article_draft='0'");
        $_GET['rowstart'] = isset($_GET['rowstart']) && isnum($_GET['rowstart']) && $_GET['rowstart'] <= $info['articles_max_rows'] ? $_GET['rowstart'] : "0";
        if ($info['articles_max_rows'] > 0) {
            $a_result = dbquery("\n                        SELECT * FROM " . DB_ARTICLES . "\n\t\t\t\t\t\tWHERE article_cat='" . intval($_GET['cat_id']) . "' AND article_draft='0' AND " . groupaccess('article_visibility') . "\n\t\t\t\t\t\tORDER BY " . $cdata['article_cat_sorting'] . "\n\t\t\t\t\t\tLIMIT " . intval($_GET['rowstart']) . ", " . intval($article_settings['article_pagination']));
            $info['articles_rows'] = dbrows($a_result);
            while ($data = dbarray($a_result)) {
                $data['article_snippet'] = parse_textarea($data['article_snippet']);
                $data['article_article'] = preg_split("/<!?--\\s*pagebreak\\s*-->/i", parse_textarea($data['article_article']));
                $data['new'] = $data['article_datestamp'] + 604800 > time() + fusion_get_settings("timeoffset") * 3600 ? $locale['402'] : '';
                $info['articles']['item'][] = $data;
            }
            $info['page_nav'] = $info['articles_max_rows'] > $article_settings['article_pagination'] ? makepagenav($_GET['rowstart'], $article_settings['article_pagination'], $info['articles_max_rows'], 3, FUSION_SELF . "?cat_id=" . $_GET['cat_id'] . "&amp;") : "";
Esempio n. 21
0
<?php

define('ROOT', dirname($_SERVER['SCRIPT_FILENAME']));
require ROOT . "/include/admin-init.php";
if (!is_login()) {
    die(html_jump('login.php'));
}
set_page_type('option');
set_page_power(array(1));
set_title("更新设置");
get_admin_header();
$status = NULL;
if (isset($_POST['type'])) {
    switch ($_POST['type']) {
        case 'option':
            $up_option = new up_option();
            $status = $up_option->get_post($_POST);
            if ($status != 'OK') {
                print_err_notice($status);
            } else {
                $status = $up_option->check();
                if ($up_option->status == FALSE) {
                    print_err_arr_notice("数据检查出错", $status);
                } else {
                    $status = $up_option->up();
                    if (count($status) != 0) {
                        print_err_arr_notice("数据更新出错", $status);
                    } else {
                        print_successful_notice("成功更新设置信息", "option.php?status=OK");
                    }
                }
<?php

if (!defined('BASEPATH')) {
    exit('Nu poti accesa acest fisier direct.');
}
set_title(site_name() . ' - Confirmare schimbare email');
if (isset($_SESSION['user_data']['email_token']) && $_SESSION['user_data']['email_token'] == '') {
    assign('content_tpl', 'content/emailchange/confirmation_error');
    return;
}
$step = 'step1';
$args = Vars::get('args');
$username = isset($args[1]) ? $DB->escape($args[1]) : '';
$token = isset($args[1]) ? $DB->escape($args[2]) : '';
$data = $DB->select("id, email, new_email, email_step", ACCOUNT_DATABASE . ".account", "`login` LIKE '" . $username . "' AND `email_token` LIKE '" . $token . "'");
if (is_array($data)) {
    $args[0] = isset($args[0]) ? $args[0] : 'cancel';
    if ($args[0] == 'confirm' && $data['email_step'] == 2) {
        $ok = $DB->query("UPDATE " . ACCOUNT_DATABASE . ".account SET `email`='" . $data['new_email'] . "', `email_token`='', `email_expire`='', `new_email`='', `email_step`='0' WHERE `id`='" . $data['id'] . "'");
        $step = 'confirmation_confirm';
    } elseif ($args[0] == 'accept' && $data['email_step'] == 1) {
        $token = sha1(microtime() . $data['email'] . rand(123151, 999999));
        $ok = $DB->query("UPDATE " . ACCOUNT_DATABASE . ".account SET `email_token`='" . $token . "', `email_step`='2' WHERE `id`='" . $data['id'] . "'");
        if ($ok) {
            $arr = array('login' => $username, 'site_name' => site_name(), 'site_url' => site_url(), 'token' => $token);
            $email_ses = email()->load('emailchange/emailchange_accept');
            $email_ses->assign($arr);
            $email_ses->set('noreply@' . rtrim(site_name(), '/'), '', $data['new_email'], 'Schimbare de email');
            $email_ses->send();
            $step = 'step2';
        }
<?php

defined("IN_FUSION") or die;
if (isset($_GET['cat_id']) && isnum($_GET['cat_id'])) {
    echo show_breadcrumbs("cat", stripinput($_GET['cat_id']));
    $result = dbquery("SELECT * FROM " . DB_AL_CATALOG_CATS . " WHERE ctg_cat_id='" . intval(stripinput($_GET['cat_id'])) . "'");
    if (!dbrows($result)) {
        redirect(FUSION_SELF);
    }
    $category = dbarray($result);
    set_title($category['ctg_cat_title'] . " | " . $locale['ctg43'] . " | " . $settings['sitename']);
    $result = dbquery("SELECT * FROM " . DB_AL_CATALOG_CATS . " WHERE ctg_cat_parent='" . $category['ctg_cat_id'] . "'");
    $has_subcats = false;
    if (dbrows($result)) {
        $has_subcats = true;
        opentable($category['ctg_cat_title'] . $locale['ctg46']);
        while ($cat = dbarray($result)) {
            echo "<div class='cat-row'>";
            echo "<a href='" . FUSION_SELF . "?action=category&cat_id=" . $cat['ctg_cat_id'] . "'><img src='" . (!empty($cat['ctg_cat_image']) && file_exists(AL_CATALOG_DIR . "uploads/cats/" . $cat['ctg_cat_image']) ? AL_CATALOG_DIR . "uploads/cats/" . $cat['ctg_cat_image'] : AL_CATALOG_DIR . "asset/no-image.jpg") . "' alt='" . $cat['ctg_cat_title'] . "' style='max-width:" . $catalog_settings['cat_thumb_width'] . "px; max-height: " . $catalog_settings['cat_thumb_height'] . "px;' class='cat-image' />";
            echo "<div class='cat-row-desc'>";
            echo "<a href='" . FUSION_SELF . "?action=category&cat_id=" . $cat['ctg_cat_id'] . "' class='cat-row-link'>" . $cat['ctg_cat_title'] . "</a>";
            echo "<p class='cat-row-desc-text'>" . $cat['ctg_cat_desc'] . "</p>";
            $subcats_result = dbquery("SELECT * FROM " . DB_AL_CATALOG_CATS . " WHERE ctg_cat_parent='" . $cat['ctg_cat_id'] . "'");
            if ($subcats_num = dbrows($subcats_result) > 0) {
                echo "<p class='cat-row-subcats'>" . $locale['ctg45'];
                $c = 0;
                while ($subcat = dbarray($subcats_result)) {
                    echo "<a href='" . FUSION_SELF . "?action=category&cat_id=" . $subcat['ctg_cat_id'] . "'>" . $subcat['ctg_cat_title'] . "</a>" . ($c < $subcats_num - 1 ? ", " : "");
                    $c++;
                }
                echo "</p>";
Esempio n. 24
0
<?php

check_login();
if (!defined('BASEPATH')) {
    exit('Nu poti accesa acest fisier direct.');
}
set_title(site_name() . ' - Caracterele mele');
$data = $DB->query("SELECT * FROM " . PLAYER_DATABASE . ".player WHERE account_id = '" . $_SESSION['user_data']['id'] . "'");
$users = array();
$i = 0;
while ($row = $DB->fetch($data)) {
    $users[$i]['id'] = $row['id'];
    $users[$i]['name'] = $row['name'];
    $users[$i]['level'] = $row['level'];
    $users[$i]['time'] = $row['playtime'] > 0 ? duration($row['playtime'] * 60) : 'nedeterminat';
    $users[$i]['class'] = char_class($row['job']);
    $i++;
}
$smarty->assign('users', $users);
assign('content_tpl', 'content/character');
Esempio n. 25
0
 function __construct()
 {
     parent::__construct();
     set_title('Chapter Procurement');
     $this->redirect = can_this_user('procurement') ? 'procurement' : 'procurement/my_orders';
 }
Esempio n. 26
0
                    break;
                case 'ratings':
                    $filter_condition = 'sum_rating DESC';
                    break;
                case 'download':
                    $filter_condition = 'download_count DESC';
                    break;
                default:
                    $filter_condition = dbresult(dbquery("SELECT download_cat_sorting FROM " . DB_DOWNLOAD_CATS . " WHERE download_cat_id='" . intval($_GET['cat_id']) . "'"), 0);
            }
            $sql = "SELECT d.*, dc.*,\n\t\t\t\ttu.user_id, tu.user_name, tu.user_status, tu.user_avatar , tu.user_level, tu.user_joined,\n\t\t\t\tIF(SUM(tr.rating_vote)>0, SUM(tr.rating_vote), 0) AS sum_rating,\n\t\t\t\tCOUNT(tr.rating_item_id) AS count_votes,\n\t\t\t\tCOUNT(td.comment_item_id) AS count_comment,\n\t\t\t\tMAX(d.download_datestamp) as last_updated\n\t\t\t\tFROM " . DB_DOWNLOADS . " d\n\t\t\t\tINNER JOIN " . DB_DOWNLOAD_CATS . " dc ON d.download_cat=dc.download_cat_id\n\t\t\t\tLEFT JOIN " . DB_USERS . " tu ON d.download_user=tu.user_id\n\t\t\t\tLEFT JOIN " . DB_RATINGS . " tr ON tr.rating_item_id = d.download_id AND tr.rating_type='D'\n\t\t\t\tLEFT JOIN " . DB_COMMENTS . " td ON td.comment_item_id = d.download_id AND td.comment_type='D' AND td.comment_hidden='0'\n\t\t\t\t" . (multilang_table("DL") ? "WHERE download_cat_language='" . LANGUAGE . "' AND" : "WHERE") . " " . groupaccess('download_visibility') . "\n\t\t\t\tAND download_cat = '" . intval($_GET['cat_id']) . "'\n\t\t\t\tGROUP BY d.download_id\n\t\t\t\tORDER BY " . (!empty($filter_condition) ? $filter_condition : "dc.download_cat_sorting") . "\n\t\t\t\tLIMIT " . intval($_GET['rowstart']) . "," . intval($dl_settings['download_pagination']);
            $result = dbquery($sql);
            $info['download_rows'] = dbrows($result);
        }
    } else {
        set_title($locale['download_1000']);
        /**
         * Everyone's Download Posts
         */
        $info['download_max_rows'] = dbcount("('download_id')", DB_DOWNLOADS, groupaccess('download_visibility'));
        $_GET['rowstart'] = isset($_GET['rowstart']) && isnum($_GET['rowstart']) && $_GET['rowstart'] <= $info['download_max_rows'] ? $_GET['rowstart'] : 0;
        if ($info['download_max_rows'] > 0) {
            $download_query = "SELECT d.*, dc.*,\n\t\t\t\ttu.user_id, tu.user_name, tu.user_status, tu.user_avatar , tu.user_level, tu.user_joined,\n\t\t\t\tIF(SUM(tr.rating_vote)>0, SUM(tr.rating_vote), 0) AS sum_rating,\n\t\t\t\tCOUNT(tr.rating_item_id) AS count_votes,\n\t\t\t\tCOUNT(td.comment_item_id) AS count_comment,\n\t\t\t\tmax(d.download_datestamp) as last_updated\n\t\t\t\tFROM " . DB_DOWNLOADS . " d\n\t\t\t\tINNER JOIN " . DB_DOWNLOAD_CATS . " dc ON d.download_cat=dc.download_cat_id\n\t\t\t\tLEFT JOIN " . DB_USERS . " tu ON d.download_user=tu.user_id\n\t\t\t\tLEFT JOIN " . DB_RATINGS . " tr ON tr.rating_item_id = d.download_id AND tr.rating_type='D'\n\t\t\t\tLEFT JOIN " . DB_COMMENTS . " td ON td.comment_item_id = d.download_id AND td.comment_type='D' AND td.comment_hidden='0'\n\t\t\t\t" . (multilang_table("DL") ? "WHERE dc.download_cat_language = '" . LANGUAGE . "' AND" : "WHERE") . " " . groupaccess('download_visibility') . "\n\t\t\t\t" . $condition . "\n\t\t\t\tGROUP BY d.download_id\n\t\t\t\tORDER BY " . ($filter_condition ? $filter_condition : "dc.download_cat_sorting") . "\n\t\t\t\tLIMIT " . intval($_GET['rowstart']) . "," . intval($dl_settings['download_pagination']);
            $result = dbquery($download_query);
            $info['download_rows'] = dbrows($result);
        }
    }
}
if (!empty($info['download_max_rows']) && $info['download_max_rows'] > $dl_settings['download_pagination'] && !isset($_GET['download_id'])) {
    $page_nav_link = "";
    if (!empty($_GET['cat_id']) && isnum($_GET['cat_id'])) {
Esempio n. 27
0
<?php

define('ROOT', dirname($_SERVER['SCRIPT_FILENAME']));
require ROOT . "/include/admin-init.php";
if (!is_login()) {
    die(html_jump('login.php'));
}
set_page_type('library', 'library_history');
set_page_power(array(0, 1));
set_title("个人借书历史");
$all_user = new user_info();
$all_user->get_id_list();
get_admin_header();
?>
<div id="library-lent">
<h2 class="center">个人借书历史</h2>
<form method="get">
<?php 
if (get_power() == 1) {
    echo '用户:<select name="id">', "\n";
    foreach ($all_user->id_list as $n => $v) {
        if (isset($_GET['id']) && $_GET['id'] == $n) {
            $c = ' selected';
        } else {
            $c = NULL;
        }
        echo "<option value=\"{$n}\"{$c}>{$v} ({$n})</option>\n";
    }
    echo '</select>', "\n";
}
?>
Esempio n. 28
0
    redirect(BASEDIR . "index.php");
}
require_once THEMES . "templates/global/profile.php";
if (isset($_GET['lookup']) && isnum($_GET['lookup'])) {
    $user_status = " AND (user_status='0' OR user_status='3' OR user_status='7')";
    if (iADMIN) {
        $user_status = "";
    }
    $user_data = array();
    $result = dbquery("SELECT u.*, s.suspend_reason\n\t\tFROM " . DB_USERS . " u\n\t\tLEFT JOIN " . DB_SUSPENDS . " s ON u.user_id=s.suspended_user\n\t\tWHERE user_id='" . $_GET['lookup'] . "'" . $user_status . "\n\t\tORDER BY suspend_date DESC\n\t\tLIMIT 1");
    if (dbrows($result)) {
        $user_data = dbarray($result);
    } else {
        redirect("index.php");
    }
    set_title($user_data['user_name'] . $locale['global_200'] . $locale['u103']);
    if (iADMIN && checkrights("UG") && $_GET['lookup'] != $user_data['user_id']) {
        if (isset($_POST['add_to_group']) && (isset($_POST['user_group']) && isnum($_POST['user_group']))) {
            if (!preg_match("(^\\.{$_POST['user_group']}\$|\\.{$_POST['user_group']}\\.|\\.{$_POST['user_group']}\$)", $user_data['user_groups'])) {
                $result = dbquery("UPDATE " . DB_USERS . " SET user_groups='" . $user_data['user_groups'] . "." . $_POST['user_group'] . "' WHERE user_id='" . $_GET['lookup'] . "'");
            }
            redirect(FUSION_SELF . "?lookup=" . $_GET['lookup']);
        }
    }
    $userFields = new PHPFusion\UserFields();
    $userFields->userData = $user_data;
    $userFields->showAdminOptions = TRUE;
    $userFields->method = 'display';
    $userFields->plugin_folder = INCLUDES . "user_fields/";
    $userFields->plugin_locale_folder = LOCALE . LOCALESET . "user_fields/";
    $info = $userFields->get_profile_output();
Esempio n. 29
0
<?php

define('ROOT', dirname($_SERVER['SCRIPT_FILENAME']));
require ROOT . "/include/admin-init.php";
if (!is_login()) {
    die(html_jump('login.php'));
}
set_page_type('library', 'library_return');
set_page_power(array(1));
set_title("图书归还");
$all_user = new user_info();
$all_user->get_id_list();
get_admin_header();
?>
<div id="library-lent">
<h2 class="center">图书归还</h2>
<?php 
if (isset($_GET['status'])) {
    if ($_GET['status'] == 'OK') {
        echo '<p class="status blue center">成功归还图书</p>';
    } else {
        echo '<p class="status red center">', $_GET['status'], '</p>';
    }
}
?>
<form action="library-action.php" method="get">
图书ID:<input name="id" value="<?php 
if (isset($_GET['id'])) {
    echo $_GET['id'];
}
?>
Esempio n. 30
0
if (isset(Request::$params->samples) && Request::$params->samples == 0) {
    unset(Request::$params->samples);
}
$pool = Pool::find(array(Request::$params->id));
if (!$pool) {
    return 404;
}
$browse_mode = User::$current->pool_browse_mode;
// $q = Tag::parse_query("");
$q = array();
$q['pool'] = (int) Request::$params->id;
$q['show_deleted_only'] = false;
if ($browse_mode == 1) {
    $q['limit'] = 1000;
    $q['order'] = "portrait_pool";
} else {
    $q['limit'] = 24;
}
// $count = Post::count_by_sql(Post::generate_sql($q, array('from_api' => true, 'count' => true)));
// WillPaginate::Collection.new(params[:page], q[:limit], count)
$sql = Post::generate_sql($q, array('from_api' => true, 'offset' => $offset, 'limit' => $pagination_limit));
$posts = Post::find_by_sql(array($sql), array('calc_rows' => 'found_posts'));
calc_pages();
set_title($pool->pretty_name());
switch (Request::$format) {
    case 'json':
        render('json', $pool->to_json());
        break;
    case 'xml':
        break;
}