Esempio n. 1
20
 public function myAccount()
 {
     if (isset($this->session->userdata["user_id"])) {
         $data = array();
         $model = new Common_model();
         $user_id = $this->session->userdata["user_id"];
         $username = $this->session->userdata["user_username"];
         if ($this->input->post()) {
             $arr = $this->input->post();
             //                prd($arr);
             if (isset($arr["btn_submit"])) {
                 $user_dob = NULL;
                 if (!empty($arr['dob_dd']) && !empty($arr['dob_mm']) && !empty($arr['dob_yy'])) {
                     $user_dob = $arr['dob_yy'] . '-' . $arr['dob_mm'] . '-' . $arr['dob_dd'];
                 }
                 $location_details = get_location_details_from_google(trim($arr['user_location']));
                 $location_lat_long = getLatLonByAddress(trim($arr['user_location']));
                 $data_array = array('user_fullname' => addslashes($arr['user_fullname']), 'user_gender' => addslashes($arr['user_gender']), 'user_location' => addslashes($arr['user_location']), 'user_city' => $location_details['city'], 'user_state' => $location_details['state'], 'user_country' => $location_details['country'], 'user_location' => trim($arr['user_location']), 'user_latitude' => $location_lat_long['latitude'], 'user_longitude' => $location_lat_long['longitude'], 'user_tagline' => addslashes($arr['user_tagline']), 'user_about' => addslashes($arr['user_about']), 'user_relationship_status' => addslashes($arr['user_relationship_status']), 'user_dob' => $user_dob);
                 if (isset($arr['user_username'])) {
                     $username = trim($arr['user_username']);
                     $checkUsername = $model->is_exists("user_id", TABLE_USERS, array("username" => $username, "user_id !=" => $user_id));
                     if (!empty($checkUsername)) {
                         $this->session->set_flashdata("error", "That username is already taken. Please choose another.");
                     } else {
                         $data_array['user_username'] = $username;
                         $data_array['user_changed_username'] = '******';
                     }
                 }
                 $this->session->set_flashdata("success", "Personal details updated successfully");
                 $model->updateData(TABLE_USERS, $data_array, array("user_id" => $user_id));
                 // updating redis keys now
                 $this->redis_functions->set_user_profile_data($username);
                 @$this->session->set_userdata("user_fullname", trim($arr["user_fullname"]));
                 @$this->session->set_userdata("user_username", $username);
             }
             redirect(base_url('my-account'));
         } else {
             $record = $this->redis_functions->get_user_profile_data($username);
             $page_title = $record["user_fullname"];
             $input_arr = array(base_url() => 'Home', '#' => $page_title);
             $breadcrumbs = get_breadcrumbs($input_arr);
             $data["record"] = $record;
             $data["breadcrumbs"] = $breadcrumbs;
             $data["page_title"] = $page_title;
             $data['meta_title'] = $data["page_title"] . ' - ' . $this->redis_functions->get_site_setting('SITE_NAME');
             $this->template->write_view("content", "pages/user/my-account", $data);
             $this->template->render();
         }
     } else {
         require_once APPPATH . 'controllers/index.php';
         $index_controller = new Index();
         $index_controller->login();
     }
 }
Esempio n. 2
0
function sitemap_area($post, $title = '')
{
    $map = get_page_by_title('Site Map');
    ?>
  <tr> 
    <td valign="top">
      <div class="header">
        <?php 
    if ($title) {
        echo $title;
    } else {
        the_title();
    }
    ?>
      </div> 
      <div class="nav">
        <a href="<?php 
    echo get_permalink($map->ID);
    ?>
" class="navigation">sitemap</a> 
        <?php 
    echo get_breadcrumbs($post);
    ?>
      </div> 
  <?php 
}
Esempio n. 3
0
 /**
  * 查询指定标签的详细信息
  * @param $info  detail 查询的 id 或者slug
  */
 public function detail($info)
 {
     $TagsLogic = new TagsLogic();
     $PostsLogic = new PostsLogic();
     $tag = $TagsLogic->detail($info);
     $this->if404($tag, "非常抱歉,没有这个标签,可能它已经躲起来了");
     $posts_id = $TagsLogic->getPostsId($tag['tag_id']);
     $count = sizeof($posts_id);
     $count == 0 ? $res404 = 0 : ($res404 = 1);
     if (!empty($posts_id)) {
         $Page = new GreenPage($count, get_opinion('PAGER'));
         $pager_bar = $Page->show();
         $limit = $Page->firstRow . ',' . $Page->listRows;
         $posts_list = $PostsLogic->getList($limit, 'single', 'post_id desc', true, array(), $posts_id);
     }
     $this->assign('title', $tag['tag_name']);
     // 赋值数据集
     $this->assign('res404', $res404);
     $this->assign('postslist', $posts_list);
     // 赋值数据集
     $this->assign('pager', $pager_bar);
     // 赋值分页输出
     $this->assign('breadcrumbs', get_breadcrumbs('tags', $tag['tag_id']));
     $this->display('Archive/single-list');
 }
Esempio n. 4
0
 public function preview($info = -1)
 {
     $Posts = new PostsLogic();
     if ($_SESSION[get_opinion('USER_AUTH_KEY')]) {
         $post_detail = $Posts->preview($info, true);
     }
     $this->if404($post_detail, "非常抱歉,你需要的文章暂时不存在,可能它已经躲起来了。.");
     $this->assign('breadcrumbs', get_breadcrumbs('post', $post_detail));
     $this->assign('post', $post_detail);
     // 赋值数据集
     if (File::file_exists(T('Home@Post/' . $post_detail['post_template']))) {
         $this->display($post_detail['post_template']);
     } else {
         $this->display('single');
     }
 }
Esempio n. 5
0
 /**
  * 文章单页显示 支持年月日限定
  * @param $info 指定单页的信息
  */
 public function single($info = -1)
 {
     $where['post_date'] = array('like', I('get.year', '%') . '-' . I('get.month', '%') . '-' . I('get.day', '%') . '%');
     $where['post_type'] = 'single';
     $Posts = new PostsLogic();
     $post_detail = $Posts->detail($info, true, $where, true);
     $Posts->viewInc($post_detail['post_id']);
     //浏览计数
     $this->if404($post_detail, "非常抱歉,你需要的文章暂时不存在,可能它已经躲起来了。.");
     $this->assign('breadcrumbs', get_breadcrumbs('post', $post_detail));
     $this->assign('post', $post_detail);
     // 赋值数据集
     if (File::file_exists(T('Home@Post/' . $post_detail['post_template']))) {
         $this->display($post_detail['post_template']);
     } else {
         $this->display('single');
     }
 }
Esempio n. 6
0
 public function thread($username)
 {
     if ($username) {
         if ($username != $this->session->userdata["user_username"]) {
             $custom_model = new Custom_model();
             $redis_functions = new Redisfunctions();
             $data = array();
             $user_id = $this->session->userdata["user_id"];
             $user_to_records = $redis_functions->get_user_profile_data($username);
             $records = $custom_model->get_chat_history($user_id, $user_to_records['user_id']);
             $chat_list_records = $custom_model->get_inbox_list($user_id);
             //            Setting and getting unread chats username to redis
             $redis_functions->set_unread_chats_username($this->session->userdata["user_username"]);
             $unread_chats_username = $redis_functions->get_unread_chats_username($this->session->userdata["user_username"]);
             //            Marking previous messages as read
             if (!empty($records)) {
                 $latest_message_id = $records[count($records) - 1]['message_id'];
                 $this->mark_previous_messages_as_read($latest_message_id, $user_id, $user_to_records['user_id']);
             }
             $to_user_fullname = stripslashes($user_to_records['user_fullname']);
             $to_user_username = stripslashes($user_to_records['user_username']);
             $page_title = $to_user_fullname;
             $input_arr = array(base_url() => 'Home', base_url('my-chats') => 'My Chats', '#' => $page_title);
             $breadcrumbs = get_breadcrumbs($input_arr);
             $data["breadcrumbs"] = $breadcrumbs;
             $data["chat_list_records"] = $chat_list_records;
             $data["unread_chats_username"] = $unread_chats_username;
             $data["records"] = $records;
             $data["page_title"] = $page_title;
             $data["to_user_fullname"] = $to_user_fullname;
             $data["to_user_username"] = $to_user_username;
             $data['meta_title'] = $page_title . ' | ' . $this->redis_functions->get_site_setting('SITE_NAME');
             $data['display_thread'] = TRUE;
             $this->template->write_view("content", "pages/messages/list", $data);
             $this->template->render();
         } else {
             $this->session->set_flashdata('error', 'You should socialize more and not just chat with yourself');
             redirect(base_url('my-chats'));
         }
     } else {
         redirect(base_url('my-chats'));
     }
 }
Esempio n. 7
0
 public function contact()
 {
     if ($this->input->post()) {
         $arr = $this->input->post();
         //                prd($arr);
         if (isset($arr["btn_submit"])) {
             $data = array();
             $model = new Common_model();
             $request_id = getUniqueContactRequestID();
             $data_array = array('wc_request_id' => $request_id, 'wc_fullname' => addslashes($arr['full_name']), 'wc_email' => addslashes($arr['user_email']), 'wc_message' => addslashes($arr['message']), 'wc_ipaddress' => USER_IP, 'wc_useragent' => USER_AGENT, 'wc_created_on' => date('Y-m-d H:i:s'));
             $model->insertData(TABLE_WEBSITE_CONTACT, $data_array);
             if (USER_IP != '127.0.0.1') {
                 $email_model = new Email_model();
                 // message to us
                 $message = '
                                             <strong>Full Name: </strong>' . ucwords($arr["full_name"]) . '<br/>
                                             <strong>Email: </strong>' . $arr["user_email"] . '<br/>
                                             <strong>Contact: </strong>' . $arr["user_contact"] . '<br/>
                                             <strong>Location: </strong>' . $arr["user_location"] . '<br/><br/>
                                             <strong>Request ID: </strong>' . $request_id . '<br/><br/>
                                             <strong>Message: </strong>' . $arr["user_message"] . '<br/>
                                             ';
                 $email_model->sendMail($this->redis_functions->get_site_setting('SITE_EMAIL'), "New message via " . $this->redis_functions->get_site_setting('SITE_NAME'), $message);
             }
             $this->session->set_flashdata('success', 'Your message has been delivered successfully');
             redirect(base_url('static/contact-us'));
         }
     } else {
         $data = array();
         $page_title = "Contact us";
         $input_arr = array(base_url() => 'Home', '#' => $page_title);
         $breadcrumbs = get_breadcrumbs($input_arr);
         $data["meta_title"] = $page_title . ' - ' . $this->redis_functions->get_site_setting('SITE_NAME');
         $data["meta_description"] = 'Get in touch with us if you have any queries or feedback for us. We would love to hear from you.';
         $data["breadcrumbs"] = $breadcrumbs;
         $this->template->write_view("content", "pages/staticpage/contact-us", $data);
         $this->template->render();
     }
 }
Esempio n. 8
0
<?php 
$breadcrumbs = get_breadcrumbs();
if ($breadcrumbs && is_array($breadcrumbs) && count($breadcrumbs) > 0) {
    echo '<ol class=" breadcrumb">';
    for ($bc = count($breadcrumbs) - 1; $bc >= 0; $bc--) {
        $is_active = isset($breadcrumbs[$bc]["name"]) && is_active($breadcrumbs[$bc]["name"]) ? true : false;
        if ($is_active) {
            echo '<li class="active">';
            echo isset($breadcrumbs[$bc]["text"]) ? $breadcrumbs[$bc]["text"] : "";
            echo '</li>';
        } else {
            echo '<li class="">';
            echo '<a class="" href="' . (isset($breadcrumbs[$bc]["uri"]) ? site_url($breadcrumbs[$bc]["uri"]) : "") . '">';
            echo isset($breadcrumbs[$bc]["text"]) ? $breadcrumbs[$bc]["text"] : "";
            echo '</a>';
            echo '</li>';
        }
    }
    echo '</ol>';
}
?>

Esempio n. 9
0
 public function forgotPassword()
 {
     if (!isset($this->session->userdata['user_id'])) {
         $data = array();
         $model = new Common_model();
         if ($this->input->post()) {
             $arr = $this->input->post();
             $user_email = trim(strtolower($arr['user_email']));
             $is_valid_email = $model->is_exists('user_id, user_status, user_fullname, user_username', TABLE_USERS, array('user_email' => $user_email));
             if (!empty($is_valid_email)) {
                 // valid
                 $user_status = $is_valid_email[0]['user_status'];
                 if ($user_status == '1') {
                     // active user
                     $full_name = ucwords($is_valid_email[0]['user_fullname']);
                     $new_password = substr(getEncryptedString($user_email . "-" . $user_status . time()), 0, 6);
                     $model->updateData(TABLE_USERS, array('user_password' => md5($new_password)), array('user_email' => $user_email));
                     // updating redis keys now
                     $this->redis_functions->set_user_profile_data($is_valid_email[0]['user_username']);
                     if ($_SERVER['REMOTE_ADDR'] != '127.0.0.1') {
                         $this->load->library('EmailTemplates');
                         $emailTemplate = new EmailTemplates();
                         $messageContent = $emailTemplate->forgot - password($full_name, $new_password);
                         $email_model = new Email_model();
                         $email_model->sendMail($user_email, 'Forgot Password - ' . $this->redis_functions->get_site_setting('SITE_NAME'), $messageContent);
                     }
                     $this->session->set_flashdata('error', '<strong>Success!</strong> We have sent you a new password on your email. Please check');
                     redirect(base_url('login'));
                 } else {
                     // account not active
                     $this->session->set_flashdata('error', '<strong>Sorry!</strong> Your account is not active');
                     redirect(base_url('forgot-password'));
                 }
             } else {
                 // invalid
                 $this->session->set_flashdata('error', 'No such record found.');
                 redirect(base_url('forgot-password'));
             }
         } else {
             $page_title = 'Forgot Password';
             $input_arr = array(base_url() => 'Home', '#' => $page_title);
             $breadcrumbs = get_breadcrumbs($input_arr);
             $data["breadcrumbs"] = $breadcrumbs;
             $data["page_title"] = $page_title;
             $data['meta_title'] = $data["page_title"] . ' - ' . $this->redis_functions->get_site_setting('SITE_NAME');
             $this->template->write_view("content", "pages/index/forgot-password", $data);
             $this->template->render();
         }
     } else {
         redirect(base_url('change-password'));
     }
 }
Esempio n. 10
0
function include_breadcrumbs($params = array())
{
    echo get_breadcrumbs($params);
}
Esempio n. 11
0
 /**
  * 兼容旧式CMS深目录结构的二级cat结构
  * @param $info
  */
 public function channel($info)
 {
     //TODO 兼容旧式CMS深目录结构的二级cat结构
     $CatsLogic = new CatsLogic();
     $cat = $CatsLogic->detail($info);
     $children = $CatsLogic->getChildren($cat['cat_id']);
     if (empty($children['cat_children'])) {
         $children = $CatsLogic->getChildren($children['cat_father']);
     }
     $CatsLogic = new CatsLogic();
     $Posts = new PostsLogic();
     $cat = $CatsLogic->detail($info);
     $this->if404($cat, "非常抱歉,没有这个分类,可能它已经躲起来了");
     //优雅的404
     $posts_id = $CatsLogic->getPostsIdWithChildren($cat['cat_id']);
     $count = sizeof($posts_id);
     $count == 0 ? $res404 = 0 : ($res404 = 1);
     if (!empty($posts_id)) {
         $Page = new GreenPage($count, get_opinion('PAGER'));
         $pager_bar = $Page->show();
         $limit = $Page->firstRow . ',' . $Page->listRows;
         $posts_list = $Posts->getList($limit, 'single', 'post_date desc', true, array(), $posts_id);
     }
     $this->assign('children', $children);
     $this->assign('title', $cat['cat_name']);
     // 赋值数据集
     $this->assign('res404', $res404);
     $this->assign('postslist', $posts_list);
     // 赋值数据集
     $this->assign('pager', $pager_bar);
     // 赋值分页输出
     $this->assign('breadcrumbs', get_breadcrumbs('cats', $cat['cat_id']));
     if (File::file_exists(T('Home@Archive/channel-list'))) {
         $this->display('Archive/channel-list');
     } else {
         //TODO   这里怎么处理却决于你自己了。
         //            $this->error404('缺少对应的模版而不能显示');
         $this->display('Archive/single-list');
     }
 }
Esempio n. 12
0
<?php

get_header();
?>

<section class="body gs960">

<?php 
get_sidebar();
?>

<div class="main">
	<?php 
if ($breadcrumbs = get_breadcrumbs()) {
    ?>
		<ul class="breadcrumb"><?php 
    echo $breadcrumbs;
    ?>
</ul>
	<?php 
}
?>
	<?php 
if (have_posts()) {
    ?>
		<?php 
    while (have_posts()) {
        the_post();
        ?>

			<article class="mod section entry">
Esempio n. 13
0
function xpress_render($contents)
{
    global $xoops_config;
    global $xoopsUser, $xoopsTpl, $xpress_config, $xoopsModule, $xoopsLogger, $xoopsConfig;
    //for XOOPS
    require_once ABSPATH . '/include/xpress_breadcrumbs.php';
    $xoops_breadcrumbs = get_breadcrumbs();
    xpress_remake_global_for_permlink();
    $mydirname = basename(dirname(dirname(__FILE__)));
    include $xoops_config->xoops_root_path . "/header.php";
    $xoopsTpl->assign('xoops_breadcrumbs', $xoops_breadcrumbs);
    $xoopsTpl->assign('xoops_module_header', get_xpress_module_header($contents));
    $page_title = $GLOBALS["xoopsModule"]->getVar("name") . ' &raquo;' . get_xpress_title($contents);
    $xoopsTpl->assign('xoops_pagetitle', $page_title);
    $xoops_keywords = $xoopsTpl->get_template_vars('xoops_meta_keywords');
    $wp_keyword = get_xpress_meta_name('keywords', $contents);
    switch ($xpress_config->meta_keyword_type) {
        case 'xoops':
            break;
        case 'wordpress':
            if (!empty($wp_keyword)) {
                $xoopsTpl->assign('xoops_meta_keywords', $wp_keyword);
            }
            break;
        case 'wordpress_xoops':
            if (!empty($wp_keyword)) {
                if (!empty($xoops_keywords)) {
                    $keywords = $wp_keyword . ', ' . $xoops_keywords;
                } else {
                    $keywords = $wp_keyword;
                }
                $xoopsTpl->assign('xoops_meta_keywords', $keywords);
            }
            break;
        default:
    }
    $xoops_description = $xoopsTpl->get_template_vars('xoops_meta_description');
    $wp_description = get_xpress_meta_name('description', $contents);
    switch ($xpress_config->meta_description_type) {
        case 'xoops':
            break;
        case 'wordpress':
            if (!empty($wp_description)) {
                $xoopsTpl->assign('xoops_meta_description', $wp_description);
            }
            break;
        case 'wordpress_xoops':
            if (!empty($wp_description)) {
                if (!empty($xoops_description)) {
                    $description = $wp_description . ' ' . $xoops_description;
                } else {
                    $description = $wp_description;
                }
                $xoopsTpl->assign('xoops_meta_description', $description);
            }
            break;
        default:
    }
    $wp_robots = get_xpress_meta_name('robots', $contents);
    switch ($xpress_config->meta_robot_type) {
        case 'xoops':
            break;
        case 'wordpress':
            if (!empty($wp_robots)) {
                $xoopsTpl->assign('xoops_meta_robots', $wp_robots);
            }
            break;
        default:
    }
    if (empty($contents)) {
        $template_name = get_option('template');
        $xpress_data['body_contents'] = "<p>Themes \"{$template_name}\" is broken or doesn't exist. </p><p>Please choose the right theme from the admin page of wordpress.</p>";
    } else {
        $xpress_data['body_contents'] = get_body($contents);
    }
    // used $GLOBALS. becose xpress_left_arrow_post_link() and xpress_right_arrow_post_link() is other loop in this position
    $xpress_data['left_post_link'] = @$GLOBALS['left_arrow_post_link'];
    $xpress_data['right_post_link'] = @$GLOBALS['right_arrow_post_link'];
    $xpress_data['left_posts_link'] = str_replace('&laquo;', '', xpress_left_arrow_posts_link('echo=0'));
    $xpress_data['right_posts_link'] = str_replace('&raquo;', '', xpress_right_arrow_posts_link('echo=0'));
    $xpress_data['now_user_level'] = xpress_now_user_level('echo=0');
    //If notification_select.php is not executed in CMS other than XCL, the selector of in-line is not displayed.
    if (is_object($xoopsModule) && $xoopsModule->getVar('hasnotification') == 1 && is_object($xoopsUser)) {
        require_once $xoops_config->xoops_root_path . '/include/notification_select.php';
    }
    $xoopsTpl->assign('xpress', $xpress_data);
    $templates_file = 'db:' . $mydirname . '_index.html';
    echo $xoopsTpl->fetch($templates_file);
    include $xoops_config->xoops_root_path . '/footer.php';
}
Esempio n. 14
0
 /**
  * 兼容旧式CMS深目录结构的二级cat结构
  * @param $info
  */
 public function channel($info)
 {
     //TODO 兼容旧式CMS深目录结构的二级cat结构
     $Cat = new CatsLogic();
     $cat = $Cat->detail($info);
     $children = $Cat->getChildren($cat['cat_id']);
     $Cat = new CatsLogic();
     $Posts = new PostsLogic();
     $cat = $Cat->detail($info);
     $this->if404($cat, "非常抱歉,没有这个分类,可能它已经躲起来了");
     //优雅的404
     $posts_id = $Cat->getPostsId($cat['cat_id']);
     $count = sizeof($posts_id);
     $count == 0 ? $res404 = 0 : ($res404 = 1);
     if (!empty($posts_id)) {
         $Page = new GreenPage($count, get_opinion('PAGER'));
         $pager_bar = $Page->show();
         $limit = $Page->firstRow . ',' . $Page->listRows;
         $posts_list = $Posts->getList($limit, 'single', 'post_id desc', true, array(), $posts_id);
     }
     $this->assign('children', $children);
     $this->assign('title', $cat['cat_name']);
     // 赋值数据集
     $this->assign('res404', $res404);
     $this->assign('postslist', $posts_list);
     // 赋值数据集
     $this->assign('pager', $pager_bar);
     // 赋值分页输出
     $this->assign('breadcrumbs', get_breadcrumbs('cats', $cat['cat_id']));
     $this->display('Archive/channel-list');
 }
Esempio n. 15
0
" />
		</td>
		<td>
			<select name="limit" onChange="this.form.submit()">
			<?php 
get_page_list($limit);
?>
			</select>
		</td>
		<td>
			<input type="submit" name="action" value="search" />&nbsp;<a href="/">clear</a>
		</td>
	</tr>
</table>
<span id="breadcrumbs"><?php 
get_breadcrumbs($db, $query_array);
?>
</span>
</form>
</div>
<div id="results">
<?php 
// search results
$rows = commands($db, 'command_html', $limit, $offset, $user, $dev, $begin, $end);
if ($rows == 0) {
    print '<strong>No Results</strong>';
}
?>
</div>
<div id="footer">
<?php 
Esempio n. 16
0
 public function trips_joined_by_me($view_type = 'list', $page = 1)
 {
     $redis_functions = new Redisfunctions();
     $username = $this->session->userdata['user_username'];
     $user_profile_data = $redis_functions->get_user_profile_data($username);
     $trips_joined = $user_profile_data['trips_joined'];
     $post_records = array();
     if (!empty($trips_joined)) {
         foreach ($trips_joined as $value) {
             if ($value->post_published == '1') {
                 $post_records[] = $redis_functions->get_trip_details($value->post_url_key);
             }
         }
     }
     $page_title = 'Trips I\'ve joined';
     $input_arr = array(base_url() => 'Home', '#' => $page_title);
     $breadcrumbs = get_breadcrumbs($input_arr);
     $data["post_records"] = $post_records;
     $data["view_type"] = $view_type;
     $data["page"] = $page;
     $data["breadcrumbs"] = $breadcrumbs;
     $data["page_title"] = $page_title;
     $data['meta_title'] = $data["page_title"] . ' - ' . $this->redis_functions->get_site_setting('SITE_NAME');
     $this->template->write_view("content", "pages/trip/listing/list-page", $data);
     $this->template->render();
 }
 /**
  * 页面归档 支持年月日参数传递 和用户id
  * @param null 页面归档
  */
 public function page()
 {
     $where['post_date'] = array('like', I('get.year', '%') . '-' . I('get.month', '%') . '-' . I('get.day', '%') . '%');
     $title_prefix = (I('get.year', '') ? I('get.year', '') . '年' : '') . (I('get.month', '') ? I('get.month', '') . '月' : '') . (I('get.day', '') ? I('get.day', '') . '日' : '');
     $PostsLogic = new PostsLogic();
     $count = $PostsLogic->countAll('page', $where);
     // 查询满足要求的总记录数
     $count == 0 ? $res404 = 0 : ($res404 = 1);
     if ($count != 0) {
         $Page = new GreenPage($count, C('PAGER'));
         // 实例化分页类 传入总记录数
         $pager_bar = $Page->show();
         $limit = $Page->firstRow . ',' . $Page->listRows;
         //获取分页信息
         $posts_list = $PostsLogic->getList($limit, 'page', 'post_id desc', true, $where);
     }
     $this->assign('title', $title_prefix . '所有页面');
     $this->assign('res404', $res404);
     // 赋值数据集
     $this->assign('postslist', $posts_list);
     // 赋值数据集
     $this->assign('pager', $pager_bar);
     // 赋值分页输出
     $this->assign('breadcrumbs', get_breadcrumbs('所有页面'));
     $this->display('single-list');
 }
Esempio n. 18
0
    $dbr->execute();
    $note_data = $dbr->fetch();
    if (isset($note_data['id'])) {
        $news_item['id'] = $note_data['id'];
        $news_item['title'] = htmlspecialchars($note_data['title']);
        $news_item['teaser'] = htmlspecialchars($note_data['teaser']);
        #if($note_data['text_formatting']==1) $news_item['text'] = auto_html($note_data['text']);
        $news_item['text'] = $note_data['text'];
        $news_item['time'] = date("Y-m-d H:i:s", $note_data['time']);
        $template->assign('display_time', true);
        $localization->replacePlaceholder('time', $note_data['time'], 'page_time', Localization::FORMAT_TIME);
        $template->assign('hide_content', true);
        $template->assign('title', $note_data['title']);
        $template->assign('headline', $note_data['title']);
        $template->assign('news_item', $news_item);
        $breadcrumbs = get_breadcrumbs($data['breadcrumbs']);
        $breadcrumbs[] = array('page' => PAGE, 'title' => $data['title']);
        $template->assign('breadcrumbs', $breadcrumbs);
        $template->assign('keywords', '');
        $template->assign('description', '');
        $news_item_id = $note_data['id'];
    } else {
        #$no_cache = true;
        header($_SERVER['SERVER_PROTOCOL'] . " 404 Not Found");
        header("Status: 404 Not Found");
        header('Location: ' . BASE_URL . PAGE);
        exit;
    }
} else {
    $dbr = Database::$content->prepare("SELECT COUNT(*) FROM " . Database::$db_settings['news_table'] . " WHERE page_id=:page_id");
    // AND time<=:now
Esempio n. 19
0
/**
 * Template_Lite  function plugin
 *
 */
function tpl_function_breadcrumbs($params, &$tpl)
{
    $tpl->CI->load->helper('menu');
    return get_breadcrumbs(!empty($params['template']) ? $params['template'] : array());
}
Esempio n. 20
0
    <div class="block_head">
        <div class="bheadl"></div>
        <div class="bheadr"></div>
        <h2>Members</h2>
        <form method="post" action="<?php 
echo site_url('member/backends/searchsubmit');
?>
" id="frmSearch">
            <input id="searchInput" type="text" value="Search" class="text">
        </form>
    </div>

    <div class="block_content">

        <?php 
echo get_breadcrumbs($breadcrumbs);
?>

        <form method="post" action="">

            <table cellspacing="0" cellpadding="0" width="100%" class="sortable">

                <thead>
                    <tr>
                        <th>Data Members</th>
                        <th>Status</th>
                        <th>Last Login</th>
                        <td>&nbsp;</td>
                    </tr>
                </thead>
Esempio n. 21
0
/**
 * bootstrap_get_breadcrumbs()
 *
 * This creates the list for breadcrumbs to the current page. Requires
 * i18n Navigation plugin for full breadcrumbs list else it creates
 * a list with only Home / %parent% / %child%
 * This function support the following plugins:
 *   - i18n Navigation (Supported but doesn't format well unless modified)
 *   - SimpleBreadcrumbs v1.0+ (Preferred)
 * 
 * @return (string) : String containing HTML <ul> list of breadcrumb data
 */
function bootstrap_get_breadcrumbs()
{
    if (function_exists('get_breadcrumbs')) {
        # SimpleBreadcrumbs v1.0+
        get_breadcrumbs(return_page_slug());
    } elseif (!function_exists('get_i18n_breadcrumbs')) {
        # i18n Navigation plugin
        echo '<li><a href="' . get_site_url(FALSE) . '">Home</a></li>';
        echo '<li class="current">';
        get_i18n_breadcrumbs(return_page_slug());
        echo '</li>';
    } else {
        # No supported plugins found!
        $parent = (string) get_parent(FALSE);
        echo '<li><a href="' . get_site_url(FALSE) . '">Home</a></li>';
        if (!empty($parent) && $parent != 'index') {
            $file = GSDATAPAGESPATH . $parent . '.xml';
            if (file_exists($file)) {
                $p = getXML($file);
                $p_title = $p->title;
                $p_slug = $p->slug;
                echo '<li><a href="' . find_url($parent, '') . '">' . $p_title . '</a></li>';
            }
        }
        echo '<li class="active">' . get_page_clean_title(FALSE) . '</li>';
    }
}
Esempio n. 22
0
    }
    ?>
								<?php 
}
?>

							</ul>
						</div>
					</div>
				</div>
			</div>
		</header>

		<div id="page-wrapper" class="content-area">
			<?php 
if (($breadcrumbs = get_breadcrumbs()) !== '') {
    ?>
	            <div id="breadcrumb">
	                <div class="container">
	                    <div class="row">
	                        <div class="col-md-12">
                                <?php 
    echo $breadcrumbs;
    ?>
	                        </div>
	                    </div>
	                </div>
	            </div>
			<?php 
}
?>
Esempio n. 23
0
	<a href="<?php echo $baseurl?>/pages/user_preferences.php"  onClick="return CentralSpaceLoad(this,true);"><?php } ?><?php echo htmlspecialchars(($userfullname=="" ? $username : $userfullname)) ?><?php } /* end replacefullnamelink */?><?php if ($allow_password_change && !checkperm("p")) { ?></a><?php } ?></li>
	<?php hook("addtoplinks");?>
	<li><a href="<?php echo $baseurl?>/login.php?logout=true&nc=<?php echo time()?>"><?php echo $lang["logout"]?></a></li>
	<?php hook("addtologintoolbarmiddle");?>
	<?php if ($contact_link) { ?><li><a href="<?php echo $baseurl?>/pages/contact.php"  onClick="return CentralSpaceLoad(this,true);"><?php echo $lang["contactus"]?></a></li><?php } ?>
	</ul>
	<?php
	} /* end replaceheadernav1 */
	}
?>
</div>

<div id="HeaderNav2" class="HorizontalNav HorizontalWhiteNav">

<?php if ($breadcrumbs) { ?>
<div class="Breadcrumbs"><?php echo get_breadcrumbs()?></div>
<?php } ?>
		<?php if (!hook("replaceheadernav2")) { ?>
		<ul>
		<?php if (!$use_theme_as_home && !$use_recent_as_home) { ?><li><a href="<?php echo $baseurl?>/pages/<?php echo $default_home_page?>" onClick="return CentralSpaceLoad(this,true);"><?php echo $lang["home"]?></a></li><?php }  
		hook("topnavlinksafterhome");
		?>
		<?php if ($advanced_search_nav) { ?><li><a href="<?php echo $baseurl?>/pages/search_advanced.php"  onClick="return CentralSpaceLoad(this,true);"><?php echo $lang["advancedsearch"]?></a></li><?php }  ?>
		<?php if 	(
			(checkperm("s"))  && (! $disable_searchresults )
		&&
			(
				(isset($_COOKIE["search"]) && strlen($_COOKIE["search"])>0)
			||
				(isset($search) && (strlen($search)>0) && (strpos($search,"!")===false))
			)
Esempio n. 24
0
    }
    ?>
								<?php 
}
?>

							</ul>
						</div>
					</div>
				</div>
			</div>
		</header>

		<div id="page-wrapper" class="content-area">
			<?php 
if (get_theme_options('display_crumbs') === '1' and ($breadcrumbs = get_breadcrumbs()) !== '') {
    ?>
	            <div id="breadcrumb">
	                <div class="container">
	                    <div class="row">
	                        <div class="col-xs-12">
                                <?php 
    echo $breadcrumbs;
    ?>
	                        </div>
	                    </div>
	                </div>
	            </div>
			<?php 
}
?>
Esempio n. 25
0
 public function paypal_success()
 {
     if ($this->input->get('trip_url_key') && $this->input->get('plan_key') && $this->input->get('id') && $this->input->post()) {
         if ($this->input->post('item_number1') == $this->input->get('trip_url_key')) {
             $user_id = $this->session->userdata['user_id'];
             $user_email = $this->session->userdata['user_email'];
             if ($user_id == getEncryptedString($this->input->get('id'), 'decode')) {
                 $model = new Common_model();
                 $redis_functions = new Redisfunctions();
                 $trip_url_key = $this->input->get('trip_url_key');
                 $featured_plan_key = $this->input->get('plan_key');
                 $post_details = $redis_functions->get_trip_details($trip_url_key);
                 $feature_plan_details = $model->fetchSelectedData('*', TABLE_FEATURED_MASTER, array('pfm_key' => $featured_plan_key));
                 if (!empty($post_details) && !empty($feature_plan_details)) {
                     if ($post_details['post_user_id'] == $user_id) {
                         $paypal_data = $this->input->post();
                         $payment_reference_number = getUniquePaymentReferenceNumber(getEncryptedString($paypal_data['txn_id']));
                         $payment_created_on = date('Y-m-d H:i:s');
                         $data_array = array('payment_reference_number' => $payment_reference_number, 'payment_user_id' => $user_id, 'payment_pfm_id' => $feature_plan_details[0]['pfm_id'], 'payment_post_id' => $post_details['post_id'], 'payment_txn_id' => $paypal_data['txn_id'], 'payment_amount' => $paypal_data['payment_gross'], 'payment_payer_email' => $paypal_data['payer_email'], 'payment_receiver_email' => $paypal_data['receiver_email'], 'payment_status' => '1', 'payment_json' => json_encode($paypal_data), 'payment_created_on' => $payment_created_on);
                         $is_exists = $model->fetchSelectedData('payment_id', TABLE_PAYMENTS, array('payment_post_id' => $post_details['post_id'], 'payment_txn_id' => $paypal_data['txn_id']));
                         if (empty($is_exists)) {
                             $model->insertData(TABLE_PAYMENTS, $data_array);
                             $this->session->set_flashdata('success', 'Payment successful');
                         } else {
                             $this->session->set_flashdata('error', 'Transaction ID already exists');
                             redirect(getTripUrl($trip_url_key));
                         }
                         // Adding post to featured table
                         if ($this->add_post_to_featured($post_details['post_id'], $feature_plan_details[0]['pfm_id']) == FALSE) {
                             $this->session->set_flashdata('error', 'Unauthorized access to post');
                             redirect(getTripUrl($trip_url_key));
                         }
                         // Updating redis table here
                         $redis_functions->set_trip_details($trip_url_key);
                         $redis_functions->set_featured_trips();
                         // Sending invoice email here
                         if (USER_IP != '127.0.0.1') {
                             $invoice_data_array = array('payment_reference_number' => $payment_reference_number, 'payment_created_on' => $payment_created_on, 'payer_user_fullname' => $this->session->userdata['user_fullname'], 'payer_user_email' => $user_email, 'payment_txn_id' => $paypal_data['txn_id'], 'post_title' => $post_details['post_title'], 'pfm_title' => $feature_plan_details['pfm_title'], 'payment_currency' => 'USD', 'payment_amount' => $paypal_data['payment_gross']);
                             $email_model = new Email_model();
                             $invoice_html_data = $email_model->invoice_template($invoice_data_array);
                             $email_model->sendMail($user_email, $invoice_html_data['email_subject'], $invoice_html_data['email_message']);
                         }
                         $page_title = 'Payment confirmed';
                         $input_arr = array(base_url() => 'Home', '#' => $page_title);
                         $breadcrumbs = get_breadcrumbs($input_arr);
                         $data["post_details"] = $post_details;
                         $data["feature_plan_details"] = $feature_plan_details[0];
                         $data["payment_reference_number"] = $payment_reference_number;
                         $data["breadcrumbs"] = $breadcrumbs;
                         $data["page_title"] = $page_title;
                         $data['meta_title'] = $data["page_title"] . ' - ' . $this->redis_functions->get_site_setting('SITE_NAME');
                         $this->template->write_view("content", "pages/payments/paypal-success", $data);
                         $this->template->render();
                     } else {
                         $this->session->set_flashdata('error', 'Unauthorized access');
                         display_404_page();
                     }
                 } else {
                     $this->session->set_flashdata('error', 'No such records found');
                     display_404_page();
                 }
             } else {
                 $this->session->set_flashdata('error', 'Invalid request');
                 display_404_page();
             }
         } else {
             $this->session->set_flashdata('error', 'Invalid request');
             display_404_page();
         }
     } else {
         $this->session->set_flashdata('error', 'Invalid request');
         display_404_page();
     }
 }
Esempio n. 26
0
<?php 
            # Work out target to use for links
            if (!$frameless_collections && !checkperm("b")) {
                $target = "main";
            } else {
                $target = "_top";
            }
            ?>

<div id="HeaderNav2" class="HorizontalNav HorizontalWhiteNav">

<?php 
            if ($breadcrumbs) {
                ?>
<div class="Breadcrumbs"><?php 
                echo get_breadcrumbs();
                ?>
</div>
<?php 
            }
            ?>
		<?php 
            if (!hook("replaceheadernav2")) {
                ?>
		<ul>
		<?php 
                if (!$use_theme_as_home && !$use_recent_as_home) {
                    ?>
<li><a href="<?php 
                    echo $baseurl;
                    ?>
Esempio n. 27
0
#require('./cms/includes/classes/Localization.class.php');
#$loc = new Localization('./cms/lang/'.$language_file);
#$localization = Localization::getInstance(BASE_PATH.'cms/lang/'.$language_file);
$localization = new Localization(BASE_PATH . 'cms/lang/' . $language_file);
mb_internal_encoding(Localization::$lang['charset']);
#require('./cms/lang/'.$language_file);
#$template->set_lang($lang);
#$template->config_load($language_file);
#$lang = $template->get_config_vars();
setlocale(LC_ALL, Localization::$lang['locale']);
#$template->assign('config_file', $language_file);
define('CHARSET', Localization::$lang['charset']);
#define('TIME_FORMAT', Localization::$lang['time_format']);
#define('TIME_FORMAT_FULL', Localization::$lang['time_format_full']);
// breadcrumbs:
$template->assign('breadcrumbs', get_breadcrumbs($data['breadcrumbs']));
$page = $data['page'];
$content = $data['content'];
if ($settings['content_auto_link'] == 1) {
    $content = make_link($content);
}
#if($settings['content_smilies']==1) $content = smilies($content);
$content = parse_special_tags($content);
$sidebar_1 = $data['sidebar_1'];
if ($settings['content_auto_link'] == 1) {
    $sidebar_1 = make_link($sidebar_1);
}
#if($settings['content_smilies']==1) $sidebar_1 = smilies($sidebar_1);
if ($sidebar_1 != '') {
    $sidebar_1 = parse_special_tags($sidebar_1);
}