• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP pathang类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中pathang的典型用法代码示例。如果您正苦于以下问题:PHP pathang类的具体用法?PHP pathang怎么用?PHP pathang使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了pathang类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: krishna

 public function krishna()
 {
     $request = pathang::getInstance('request');
     $request->page = 'color';
     $request->color = 'red';
     pathang::render('sample', 'krishna');
 }
开发者ID:kenjiro7,项目名称:pathang-framework,代码行数:7,代码来源:sample.php


示例2: main

 public function main()
 {
     $tmpl = pathang::getInstance('packet')->get('tmpl');
     if ($tmpl) {
         pathang::display($tmpl);
     }
 }
开发者ID:adrixnac,项目名称:RedSocial,代码行数:7,代码来源:ads.php


示例3: theme

 public function theme()
 {
     $request = pathang::getInstance('request');
     $request->page = 'color';
     $request->color = 'voilet';
     pathang::render('sample', 'themes');
 }
开发者ID:kenjiro7,项目名称:pathang-framework,代码行数:7,代码来源:root.php


示例4: renderView

 public function renderView()
 {
     $heading = "giving wings to developers !";
     $data = "<p>Do you know... you can render this page in three different formats?</p>\n\t\t<p> For normal view with template its root_url/render, To get the json format you need to suffix .json to the url... \n\t\tlike this root_url/render.json and to display html version by excluding the template... suffix the url with .html ex: root_url/render.html</p>";
     $basket = pathang::getInstance('basket');
     $basket->set('heading', $heading);
     $basket->set('message', $data);
 }
开发者ID:kenjiro7,项目名称:pathang-framework,代码行数:8,代码来源:sample.php


示例5: main

 public function main()
 {
     //openmenu based on page either 'feed','admin' or 'mainpage'
     $page = strtoupper(pathang::getInstance('node')->get('n1'));
     if ($page === 'FEED' || $page === 'ADMIN') {
         pathang::display(strtolower($page));
     } else {
         pathang::display();
     }
 }
开发者ID:gibranda,项目名称:Feedstack,代码行数:10,代码来源:sidemenu.php


示例6: main

 public function main()
 {
     //$username = pathang::getInstance('node')->get('n1');
     //$uid = pathang::getModel('userlog')->getUserId($username);
     pathang::GetInstance('request')->set('snippet', 1);
     $popular = pathang::getController('profile')->popular();
     $count = 0;
     pathang::GetInstance('packet')->Set('popular', $popular);
     pathang::GetInstance('packet')->Set('count', $count);
     pathang::display();
 }
开发者ID:adrixnac,项目名称:RedSocial,代码行数:11,代码来源:popular.php


示例7: main

 public function main()
 {
     $username = pathang::getInstance('node')->get('n1');
     $uid = pathang::getModel('userlog')->getUserId($username);
     pathang::GetInstance('request')->set('snippet', 1);
     $following = pathang::getController('profile')->following();
     $count = pathang::getModel('profile')->followingCount($uid);
     pathang::GetInstance('packet')->Set('following', $following);
     pathang::GetInstance('packet')->Set('count', $count);
     pathang::display();
 }
开发者ID:adrixnac,项目名称:RedSocial,代码行数:11,代码来源:following.php


示例8: saveNotification

 public function saveNotification($uid, $agent, $target, $action)
 {
     $time_stamp = date("Y-m-d H:i:s");
     $status = 1;
     //pdo object and table
     $pdo = pathang::getInstance('pdo');
     $table = 'notifications';
     // sql insert statement
     $sql = "INSERT INTO {$table} \r\n\t\t\t\t\t\t(uid,agent,target,action,time_stamp,status) \r\n\t\t\t\t VALUES ({$uid},{$agent},{$target},'{$action}','{$time_stamp}',{$status})";
     $result = $pdo->exec($sql);
     $insertId = $pdo->lastInsertId();
     if ($insertId) {
         return $insertId;
     } else {
         return false;
     }
 }
开发者ID:adrixnac,项目名称:RedSocial,代码行数:17,代码来源:usermain.php


示例9: start

 public static function start()
 {
     if (session_id() == '') {
         session_start();
         session_regenerate_id(true);
     }
     if (isset($_SESSION['timeout'])) {
         $session_life = time() - $_SESSION['timeout'];
         $expire = $_SESSION['expire'];
         //echo $session_life.' '.$expire;
         if ($session_life > $expire) {
             self::destroy();
         }
     }
     $pathang = pathang::getInstance('pathang');
     $expire = $pathang->SITE->SESSION_EXPIRE;
     self::expire($expire);
 }
开发者ID:gibranda,项目名称:Feedstack,代码行数:18,代码来源:session.php


示例10: main

 public function main()
 {
     //display menu as user/guest or admin
     $n1 = pathang::getInstance('node')->get('n1');
     $session = pathang::getInstance('session');
     $liveuser = $session->get('liveuser');
     if ($liveuser) {
         $uid = $liveuser->id;
         $unread = pathang::GetModel('profile')->getUnreadNotificationCount($uid);
         pathang::getInstance('packet')->set('unread', $unread);
         if ($liveuser->type == 1) {
             pathang::display();
         } else {
             pathang::display('admin');
         }
     } else {
         pathang::display('guest');
     }
 }
开发者ID:adrixnac,项目名称:RedSocial,代码行数:19,代码来源:menu.php


示例11: create_tables

 public function create_tables($db_name, $host, $user, $pass)
 {
     $db = new PDO("mysql:host=localhost;dbname={$db_name}", $user, $pass);
     $file = 'app/db.json';
     if (file_exists($file)) {
         $setting = json_decode(file_get_contents($file));
         foreach ($setting as $key => $value) {
             $db->exec($value);
         }
     }
     //create admin
     $request = pathang::GetInstance('request');
     $name = ucwords($request->filterHTMLSQL('name'));
     $username = $request->filterHTMLSQL('username');
     $password = $request->filterHTMLSQL('password');
     $email = $request->filterHTMLSQL('email');
     $hash = md5($password);
     $activation = 1;
     $timestamp = date("Y-m-d H:i:s");
     $feeds_per_page = pathang::getInstance('pathang')->FEEDSTACK->FEED_COUNT;
     $access = 1;
     $bio = "Hey people im a new entry to this website..hope to have fun..follow me to get updates.";
     $image_type = 'server';
     //pdo object and table
     $pdo = $db;
     $table = 'users';
     // sql insert statement
     $sql = "INSERT INTO {$table} \r\n\t\t\t\t\t\t(bio,image_type,name,username,password,email,type,block,\r\n\t\t\t\t\t\t  activation,creation_timestamp,feeds_per_page,access,lastlogin_timestamp) \r\n\t\t\t\t VALUES ('{$bio}','{$image_type}','{$name}','{$username}','{$hash}','{$email}',2,0,\r\n\t\t\t\t   \t\t '{$activation}','{$timestamp}',{$feeds_per_page},{$access},'{$timestamp}')";
     // type 1 - users, type 2 - moderator, type 3 - administrator
     // creation and lastlogin time is set to same value
     // password is md5 hash of the given value
     // activation is a random 8 char code
     $result = $pdo->exec($sql);
     $uid = $pdo->lastInsertId();
     //self follow
     $time_stamp = date("Y-m-d H:i:s");
     $table = 'followers';
     $follow_id = $uid;
     // sql insert statement
     $sql = "INSERT INTO {$table} \r\n\t\t\t\t\t\t(uid,follow_id,time_stamp) \r\n\t\t\t\t VALUES ({$uid},{$follow_id},'{$time_stamp}')";
     $result = $pdo->exec($sql);
 }
开发者ID:adrixnac,项目名称:RedSocial,代码行数:42,代码来源:install.php


示例12: getCount

 public function getCount($table)
 {
     //pdo object and table
     $pdo = pathang::getInstance('pdo');
     if ($table == 'followers') {
         $sql = "SELECT count(*) 'count'  \r\n\t\t\t\t\tFROM {$table} where uid!=follow_id";
     } else {
         // sql insert statement
         $sql = "SELECT count(*) 'count'  \r\n\t\t\t\t\tFROM {$table}";
     }
     //query and fetch the result
     $res = $pdo->query($sql);
     $result = $res->fetch(PDO::FETCH_ASSOC);
     //if record found return activation else false
     if ($result) {
         return $result['count'];
     } else {
         return null;
     }
 }
开发者ID:adrixnac,项目名称:RedSocial,代码行数:20,代码来源:admin.php


示例13: main

 public function main()
 {
     // get request object
     $request = pathang::GetInstance('request');
     // set the snippet,limit and unread varaibles
     $request->Set('snippet', 'one');
     $request->set('limit', 3);
     $request->set('unread', true);
     // if user exists then only display
     if (isset(pathang::GetInstance('session')->get('liveuser')->username)) {
         $liveuser = pathang::GetInstance('session')->get('liveuser')->username;
         $user = pathang::GetInstance('node')->get('n1');
         //if the user is liveuser then display
         if ($user == $liveuser) {
             //get notification and counter
             $notify = pathang::getController('profile')->notifications()->messages;
             $count = pathang::getController('profile')->notifications()->unread;
             pathang::GetInstance('packet')->set('notify', $notify);
             pathang::GetInstance('packet')->set('count', $count);
             pathang::display();
         }
     }
 }
开发者ID:gibranda,项目名称:Feedstack,代码行数:23,代码来源:notifications.php


示例14:

      <div class="bcol-100  logo"><?php 
pathang::snippet('logo');
?>
</div>
      <div class="bcol-100 menu">
        <span class="menu-text">+ menu</span>
        <?php 
pathang::snippet('menu');
?>
      </div>
      <div class="clear"></div>
    </div>
   </div>
  <div class="body">
      <div class="container-main pad-20">
        <div class="app"><?php 
pathang::app();
?>
</div>
      </div>
  </div>
   <div class="footer">
    <div class="container-main pad-20">
      <div class="footer-pad"><?php 
pathang::Snippet('footer');
?>
      </div>
    </div>
   </div> 
</body>
</html>
开发者ID:gibranda,项目名称:Feedstack,代码行数:31,代码来源:no_responsive.php


示例15:

<!--
	
	Reset Password Page
	_________________________________________
	-Input box to take new password and post to url
	 user/forgot for processing.
	-Code in the url is the key factor to change the
	 password in backend processing.

-->
<?php 
//get the hash code to form the url
$code = pathang::getInstance('node')->get('n3');
?>
<div class="box-userlog">
<h1>Reset Password</h1>
<form action="<?php 
echo ROOT;
?>
user/forgot/<?php 
echo $code;
?>
" method="post" >
<input type="password" class="input" name="password" placeholder="password"/><br>
<input type="password" class="input" name="re-password" placeholder="retype password"/><br>
<button class="btn btn-login">Reset Password</button>
</form>
</div>
开发者ID:gibranda,项目名称:Feedstack,代码行数:28,代码来源:reset_password.php


示例16:

" from="<?php 
echo $id;
?>
"></div>
<?php 
if ($count == $i && $heading == 'Members') {
    ?>
<div class="loadmore-members" id="<?php 
    echo $id;
    ?>
"> Load more members </div>
<?php 
}
?>
</div>
</div>
<?php 
$show = pathang::GetInstance('pathang')->AD_BLOCK->VISIBLE;
if ($show) {
    ?>
	<div >
				<?php 
    pathang::getInstance('packet')->set('tmpl', '728');
    pathang::snippet('ads');
    ?>

	</div>
	<?php 
}
?>
</div>
开发者ID:kenjiro7,项目名称:Feedstack,代码行数:31,代码来源:default.php


示例17:

<!--
	
	Logged in Page
	_________________________________________
	-User Page after login which displays the username
	 and logout button.

-->
<div class="box-userlog">
<?php 
$liveuser = pathang::getInstance('session')->get('liveuser');
?>
<img src="<?php 
echo $liveuser->image;
?>
" class="login-image"/ >
<h1>Hi 
	<a href="<?php 
echo ROOT . $liveuser->username;
?>
">
		<span style="color:#2980b9"><?php 
echo $liveuser->name;
?>
</span>
	</a> 
</h1>
<h4><a href="<?php 
echo ROOT;
?>
user/logout">Logout</a></h4>
开发者ID:kenjiro7,项目名称:Feedstack,代码行数:31,代码来源:loggedin.php


示例18:

<?php 
$username = pathang::getInstance('session')->get('liveuser')->username;
$unread = pathang::getInstance('packet')->get('unread');
?>
<ul class="menu-bar">
	<a href="<?php 
echo ROOT;
?>
" ><li><i class="fa fa-space fa-home"></i>Home</li></a>
	<a href="<?php 
echo ROOT;
?>
admin" ><li><i class="fa fa-space fa-dashboard"></i>Admin</li></a>
	<a href="<?php 
echo ROOT . $username;
?>
" ><li><i class="fa fa-space fa-user">
		</i>Profile
			<?php 
if ($unread) {
    ?>
			<span class="menu-unread"><i class="fa da-space fa-bell"></i> <?php 
    echo $unread;
    ?>
</span>
			<?php 
}
?>
		</li>
	</a>
开发者ID:gibranda,项目名称:Feedstack,代码行数:30,代码来源:admin.php


示例19:

    <title><?php 
pathang::Meta('title');
?>
</title>
    <link href="<?php 
echo ROOT . 'themes' . DS . 'colors' . DS . 'style.css';
?>
" rel="stylesheet">
	<link href="<?php 
echo ROOT . 'themes' . DS . 'colors' . DS . 'kolor.css';
?>
" rel="stylesheet">
  </head>
  
  <?php 
$request = pathang::getInstance('request');
$color = $request->get('color');
?>

<body class="<?php 
echo $color;
?>
">
	<div class="page">
		<?php 
pathang::app();
?>
	  </div>	
  </body>
</html>
开发者ID:kenjiro7,项目名称:pathang-framework,代码行数:30,代码来源:color.php


示例20: getFeedsFollowing

 public function getFeedsFollowing($uid = null, $type = null, $from = null, $limit = null)
 {
     //pdo object and table
     $pdo = pathang::getInstance('pdo');
     $table = 'feeds';
     if (!$limit) {
         $limit = '3';
     }
     if ($uid) {
         if ($type) {
             if ($from) {
                 $sql = "SELECT f.feed,f.uid,f.views,f.feed_container,u.username,u.name,u.image_type,u.email,f.id,f.time_stamp   \n\t\t\t\t\tFROM feeds f,users u,followers w\n\t\t\t\t\tWHERE (w.follow_id = f.uid )\n\t\t\t\t\tand w.uid = {$uid}  and f.uid =  u.id and f.feed_type ='{$type}' and f.id < {$from} ORDER BY f.id \n\t\t\t\t\tdesc LIMIT {$limit}";
             } else {
                 $sql = "SELECT f.feed,f.uid,f.views,f.feed_container,u.username,u.name,u.image_type,u.email,f.id,f.time_stamp   \n\t\t\t\t\tFROM feeds f,users u,followers w\n\t\t\t\t\tWHERE  w.uid={$uid} and f.uid = w.follow_id and f.uid =  u.id and f.feed_type ='{$type}'\n\t\t\t\t\tORDER BY f.id \n\t\t\t\t\tdesc LIMIT {$limit}";
             }
         } else {
             if ($from) {
                 $sql = "SELECT f.feed,f.uid,f.views,f.feed_container,u.username,u.name,u.image_type,u.email,f.id,f.time_stamp   \n\t\t\t\t\tFROM feeds f,users u,followers w\n\t\t\t\t\tWHERE (w.follow_id = f.uid) and w.uid = {$uid} and f.uid = u.id and f.id < {$from} ORDER BY f.id \n\t\t\t\t\tdesc LIMIT {$limit}";
             } else {
                 $sql = "SELECT f.feed,f.uid,f.views,f.feed_container,u.username,u.name,u.image_type,u.email,f.id,f.time_stamp   \n\t\t\t\t\tFROM feeds f,users u,followers w\n\t\t\t\t\tWHERE f.uid =  u.id and (w.follow_id = f.uid ) and w.uid = {$uid} \n\t\t\t\t\tORDER BY f.id \n\t\t\t\t\tdesc LIMIT {$limit}";
             }
         }
     }
     if (isset($sql)) {
         //query and fetch the result
         $res = $pdo->query($sql);
         $result = $res->fetchALL(PDO::FETCH_ASSOC);
         //if record found return activation else false
         if ($result) {
             return $result;
         } else {
             return null;
         }
     } else {
         return null;
     }
 }
开发者ID:gibranda,项目名称:Feedstack,代码行数:37,代码来源:feed.php



注:本文中的pathang类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP payed类代码示例发布时间:2022-05-23
下一篇:
PHP path类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap