本文整理汇总了PHP中tpldir函数的典型用法代码示例。如果您正苦于以下问题:PHP tpldir函数的具体用法?PHP tpldir怎么用?PHP tpldir使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tpldir函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
function edit($id = false)
{
if (empty($_POST)) {
$category = db_read('category');
if (!$category) {
redirect(base_url('admin/category/add'));
}
if (!$id) {
$id = $category->id;
}
$view['blogs'] = db_reads('page', array('type' => 'blog', 'catid' => $id));
$view['categories'] = db_reads('category', array('type' => 'blog'));
$view['category'] = db_read('category', array('id' => $id, 'type' => 'blog'));
$this->load->view(tpldir('admin/category/edit_view'), $view);
} else {
$result = jsonSrc();
$id = $this->input->post('id');
$updatecat['name'] = $this->input->post('name');
db_update('category', array('id' => $id), $updatecat);
$result['resultCode'] = 1000;
$result['resultMsg'] = "Success!!";
$result['resultData']['openUrl'] = base_url('admin/category/edit/' . $id);
echo json_encode($result);
}
}
示例2: index
function index()
{
if ($_SERVER['REQUEST_METHOD'] == "GET") {
$admin_auth = $this->session->userdata('admin_auth');
$login_error = $this->session->userdata('login_error');
$this->session->unset_userdata('login_error');
session_write_close();
if ($admin_auth) {
redirect('admin/dashboard');
}
$view['error'] = $login_error;
$this->load->view(tpldir('admin/login/index_view'), $view);
} else {
$username = $this->input->post('username');
$password = hash('sha256', $this->input->post('password'));
$adminRow = db_read('admin', array('username' => $username, 'password' => $password));
if ($adminRow) {
$this->session->set_userdata('admin_auth', true);
$this->session->set_userdata('adminid', $adminRow->id);
$this->session->set_userdata('admin_user', $adminRow->username);
// redirect(base_url('admin/dashboard'));
} else {
$this->session->set_userdata('login_error', 'Invalid Username / password');
}
redirect('admin/login');
}
}
示例3: googleplus
function googleplus()
{
$share = db_read('mod_share', array('status' => 1, 'name' => 'googleplus'));
if ($share) {
$view['share'] = $share;
$view['sharedetail'] = $share ? db_reads('mod_share_detail', array('relid' => $share->id)) : false;
$this->load->view(tpldir('modules/mod_share/googleplus_view'), $view);
}
}
示例4: edit
function edit($id = false)
{
if (empty($_POST)) {
$shareRow = db_read('mod_share', array('id' => $id));
if ($shareRow->name == 'twitter') {
$shareDetails = db_reads('mod_share_detail', array('relid' => $id));
$view['share_details'] = $shareDetails;
$view['share'] = $shareRow;
$this->load->view(tpldir('admin/extension/share/edit/twitter_view'), $view);
} elseif ($shareRow->name == 'facebook') {
$shareDetails = db_reads('mod_share_detail', array('relid' => $id));
$view['share_details'] = $shareDetails;
$view['share'] = $shareRow;
$this->load->view(tpldir('admin/extension/share/edit/facebook_view'), $view);
} elseif ($shareRow->name == 'googleplus') {
$shareDetails = db_reads('mod_share_detail', array('relid' => $id));
$view['share_details'] = $shareDetails;
$view['share'] = $shareRow;
$this->load->view(tpldir('admin/extension/share/edit/googleplus_view'), $view);
}
} else {
$result = jsonSrc();
$relid = $this->input->post('relid');
$sosmed = $this->input->post('sosmed');
if ($sosmed == 'twitter') {
$updateContent = false;
$updateContent['name'] = 'tweettext';
$updateContent['value'] = $this->input->post('tweettext');
db_update('mod_share_detail', array('relid' => $relid, 'name' => 'tweettext'), $updateContent);
$updateContent = false;
$updateContent['name'] = 'username';
$updateContent['value'] = $this->input->post('username');
db_update('mod_share_detail', array('relid' => $relid, 'name' => 'username'), $updateContent);
$updateContent = false;
$updateContent['name'] = 'hashtag';
$updateContent['value'] = $this->input->post('hashtag');
db_update('mod_share_detail', array('relid' => $relid, 'name' => 'hashtag'), $updateContent);
$updateContent = false;
$updateContent['status'] = $this->input->post('status');
db_update('mod_share', array('id' => $relid), $updateContent);
} elseif ($sosmed == 'facebook') {
$updateContent = false;
$updateContent['status'] = $this->input->post('status');
db_update('mod_share', array('id' => $relid), $updateContent);
} elseif ($sosmed == 'googleplus') {
$updateContent = false;
$updateContent['status'] = $this->input->post('status');
db_update('mod_share', array('id' => $relid), $updateContent);
}
$result['resultCode'] = 1000;
$result['resultMsg'] = "Content Updated";
$result['resultData']['openUrl'] = base_url('admin/share');
echo json_encode($result);
}
}
示例5: search
function search($key = false)
{
$this->load->model('Search_model');
$this->load->model('Encryption_model');
if ($this->input->get('key')) {
$key = $this->Encryption_model->encrypt($this->input->get('key'));
redirect(base_url('page/search/' . $key));
}
$search = $this->Encryption_model->decrypt($key);
$view['search'] = $this->Search_model->reads($search);
$view['search_count'] = $this->Search_model->reads($search, true);
$this->load->view(tpldir('page/search'), $view);
}
示例6: add
function add($category = false)
{
if (empty($_POST)) {
$resultTemplate = $this->mod_template->get();
$view['templates'] = $resultTemplate['resultData'];
$this->load->view(tpldir('admin/event/add_view'), $view);
} else {
$result = jsonSrc();
$result = $this->mod_event->post();
$result['resultData']['openUrl'] = base_url('admin/event');
echo json_encode($result);
}
}
示例7: add
function add()
{
if (empty($_POST)) {
$resultTemplate = $this->mod_template->get();
$view['templates'] = $resultTemplate['resultData'];
$view['pages'] = db_reads('page');
$this->load->view(tpldir('admin/page/add_view'), $view);
} else {
$result = jsonSrc();
$result = $this->mod_page->post();
$result['resultData']['openUrl'] = $this->agent->referrer();
echo json_encode($result);
}
}
示例8: video
function video($id = false)
{
if ($id) {
$video = db_read('mod_video', array('status' => 1, 'id' => $id));
$view['video'] = $video;
$this->load->view(tpldir('page/video'), $view);
} else {
$video = db_reads('mod_video', array('status' => 1));
$count_video = count_db_reads('mod_video', array('status' => 1));
$view['video'] = $video;
$view['count_video'] = $count_video;
$this->load->view(tpldir('page/video-list'), $view);
}
}
示例9: index
function index($url = false)
{
if ($url) {
$microsite = db_read('mod_microsite', array('url' => $url));
if ($microsite) {
$view['microsite'] = $microsite;
$view['template'] = db_read('mod_microsite_template', array('mid', $microsite->id));
$view['contact'] = db_read('mod_microsite_contact', array('mid', $microsite->id));
$view['content'] = db_reads('mod_microsite_content', array('mid', $microsite->id));
$this->load->view(tpldir('page/microsite'), $view);
return true;
}
}
return false;
}
示例10: edit
function edit($id = false)
{
if (empty($_POST)) {
$view['banner'] = db_read('mod_banner', array('id' => $id));
$this->load->view(tpldir('admin/extension/banner/edit_view'), $view);
} else {
$result = jsonSrc();
$id = $this->input->post('id');
$updateBanner['url'] = $this->input->post('url');
$updateBanner['status'] = $this->input->post('status');
db_update('mod_banner', array('id' => $id), $updateBanner);
$result['resultCode'] = 1000;
$result['resultMsg'] = "Banner Updated";
$result['resultData']['openUrl'] = base_url('admin/banner');
echo json_encode($result);
}
}
示例11: add
function add()
{
if (empty($_POST)) {
$this->load->module('mod_page');
$view['page'] = false;
$pageResult = $this->mod_page->gets();
if ($pageResult['resultCode'] == 1000) {
$view['page'] = $pageResult['resultData']['page'];
}
$this->load->view(tpldir('admin/menu/add_view'), $view);
} else {
$result = jsonSrc();
$this->load->module('mod_menu');
$result = $this->mod_menu->post();
$result['resultData']['openUrl'] = $this->agent->referrer();
echo json_encode($result);
}
}
示例12: add
function add($type = false)
{
if (empty($_POST)) {
$view['type'] = $type;
$this->load->view(tpldir('admin/extension/footer/add_view'), $view);
} else {
$result = jsonSrc();
$id = $this->input->post('id');
$createFooter['url'] = $this->input->post('url');
$createFooter['name'] = $this->input->post('name');
$createFooter['type'] = $this->input->post('type');
db_create('mod_footer', $createFooter);
$result['resultCode'] = 1000;
$result['resultMsg'] = "Footer Created";
$result['resultData']['openUrl'] = base_url('admin/footer');
echo json_encode($result);
}
}
示例13: edit
function edit($id = false)
{
if (empty($_POST)) {
if ($id) {
$newsticker = db_read('mod_newsticker', array('id' => $id));
if ($newsticker) {
$view['newsticker'] = $newsticker;
$this->load->view(tpldir('admin/newsticker/edit_view'), $view);
}
}
} else {
$result = jsonSrc();
$update['text'] = $this->input->post('text');
$update['url'] = $this->input->post('url');
$update['status'] = $this->input->post('status');
$id = $this->input->post('id');
db_update('mod_newsticker', array('id' => $id), $update);
$result['resultCode'] = 1000;
$result['resultMsg'] = "Newsticker Updated";
$result['resultData']['openUrl'] = base_url('admin/dashboard');
echo json_encode($result);
}
}
示例14: outclient
function outclient()
{
$view['banner'] = db_reads('mod_banner', array('status' => 1));
$this->load->view(tpldir('modules/mod_banner/index_view'), $view);
}
示例15: index
function index()
{
$view['newsticker'] = db_reads('mod_newsticker');
$this->load->view(tpldir('admin/dashboard_view'), $view);
}