当前位置: 首页>>代码示例>>PHP>>正文


PHP pathang::GetInstance方法代码示例

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


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

示例1: notify

 public function notify()
 {
     $request = pathang::GetInstance('request');
     $target = $request->get('target');
     $agent = $request->get('agent');
     $action = $request->get('action');
     $uid = $request->get('uid');
     //check for validity of access token
     pathang::getHelper('userlog')->ajaxAuthentication();
     pathang::getModel('usermain')->saveNotification($uid, $agent, $target, $action);
 }
开发者ID:adrixnac,项目名称:RedSocial,代码行数:11,代码来源:usermain.php

示例2: 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

示例3: 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

示例4: email

 public function email($to, $subject, $msg)
 {
     $email = $to;
     $pathang = pathang::GetInstance('pathang');
     $api_key = $pathang->MAILGUN->API_KEY;
     $domain = $pathang->MAILGUN->DOMAIN_NAME;
     $from = $pathang->MAILGUN->ADMIN_EMAIL;
     $title = Ucfirst(pathang::getInstance('pathang')->META->TITLE);
     $ch = curl_init();
     curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
     curl_setopt($ch, CURLOPT_USERPWD, 'api:' . $api_key);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
     curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
     curl_setopt($ch, CURLOPT_URL, 'https://api.mailgun.net/v2/' . $domain . '/messages');
     curl_setopt($ch, CURLOPT_POSTFIELDS, array('from' => $title . '<' . $from . '>', 'to' => $email, 'subject' => $subject, 'html' => $msg));
     $result = curl_exec($ch);
     curl_close($ch);
     return $result;
 }
开发者ID:gibranda,项目名称:Feedstack,代码行数:19,代码来源:userlog.php

示例5: 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

示例6: 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

示例7:

<?php

$pathang = pathang::GetInstance('pathang');
?>
<div class="ftrr">
<div class="bcol-70">	
<ul class="ftr_menu">
  <a href="<?php 
echo ROOT;
?>
"><li>Home</li></a>
  <a href="<?php 
echo ROOT;
?>
about"><li>About</li></a>
  <a href="<?php 
echo ROOT;
?>
feed"><li>Feeds</li></a>
    <a href="<?php 
echo ROOT;
?>
terms"><li>Terms of use</li></a>
  <a href="<?php 
echo ROOT;
?>
contact"><li>contact</li></a>
</ul>
</div>
<div class="bcol-30">
<div class="pull-right up">
开发者ID:gibranda,项目名称:Feedstack,代码行数:31,代码来源:default.php

示例8: foreach

<link href="<?php 
echo ROOT;
?>
lib/expresscss/style.css" rel="stylesheet">
<?php 
$notify = pathang::GetInstance('basket')->get('notify');
$count = null;
$i = 0;
if (isset($notify->{$i})) {
    $count = 1;
}
?>
<div class="notify-container">
	<h2> Notification Center</h2>
<div>
<?php 
if ($count) {
    ?>
<table class="table" id="hor-minimalist-b" >
	<tr>
		<th>Time lapse</th>
		<th>Notification</th>
	</tr>
	<?php 
    foreach ($notify as $a => $b) {
        ?>
	<tr >
	<td>
	<?php 
        echo $b->time_stamp;
        ?>
开发者ID:gibranda,项目名称:Feedstack,代码行数:31,代码来源:notifications.php

示例9: foreach

<?php

$members = pathang::GetInstance('basket')->get('members');
?>
<div class="member-container">
<?php 
if (!isset($members->a0)) {
    echo '<div class="no-member">No User Found</div>';
} else {
    foreach ($members as $a => $b) {
        ?>
<div class="bcol-member-block">
	<div class="member-image">
		<a href="<?php 
        echo $b->profile_link;
        ?>
">
		<?php 
        echo "<img src='" . $b->image . "' class='member' />";
        ?>
		</a>
	</div>
	<div class="member-name">
		<a href="<?php 
        echo $b->profile_link;
        ?>
"><?php 
        echo $b->name;
        ?>
</a>
	</div>
开发者ID:kenjiro7,项目名称:Feedstack,代码行数:31,代码来源:search.php

示例10: crop

 public function crop()
 {
     $user = pathang::getInstance('node')->get('n1');
     $basket = pathang::GetInstance('basket');
     $liveuser = pathang::getInstance('session')->get('liveuser')->username;
     if ($user == $liveuser) {
         pathang::getInstance('pathang')->SITE->PAGE = 'no_responsive';
         pathang::render('profile', 'crop');
     } else {
         pathang::getInstance('pathang')->SITE->PAGE = 'login';
         $basket->set('heading', 'Restricted Access');
         $basket->set('message', 'You dont have enough permission to access this page.');
         pathang::render('general', 'errorpage');
         exit;
     }
 }
开发者ID:adrixnac,项目名称:RedSocial,代码行数:16,代码来源:profile.php

示例11:

" 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

示例12: strtoupper

<?php

$feed_type = strtoupper(pathang::GetInstance('node')->get('n2'));
?>
<div class="feed-heading">
	<h1>
	<?php 
if (!$feed_type) {
    echo '<i class="fa fa-space fa-th"></i> All Feeds';
} else {
    switch ($feed_type) {
        case 'TEXT':
            echo '<i class="fa fa-space fa-bars"></i> Text Feeds';
            break;
        case 'PHOTO':
            echo '<i class="fa fa-space fa-picture-o"></i> Photo Feeds';
            break;
        case 'VIDEO':
            echo '<i class="fa fa-space fa-video-camera"></i> Video Feeds';
            break;
        case 'LINK':
            echo '<i class="fa fa-space fa-code"></i> Link Feeds';
            break;
    }
}
?>
	</h1>
</div>
<?php 
require_once 'app/views/feed/feed_list.php';
开发者ID:kenjiro7,项目名称:Feedstack,代码行数:30,代码来源:public_page.php

示例13:

      <div class="clear"></div>
    </div>
  <div class="body">
      <div class="container-main pad-20">
         <div class="sidebar bcol-30">
            <?php 
pathang::snippet('notifications');
?>
            <?php 
pathang::snippet('followers');
?>
<br>
            <?php 
pathang::snippet('following');
$show = pathang::GetInstance('pathang')->AD_BLOCK->VISIBLE;
pathang::GetInstance('packet')->set('tmpl', '250');
if ($show) {
    pathang::snippet('ads');
}
?>
          </div>
        <div class="app bcol-70"><?php 
pathang::app();
?>
</div>
       
        <div class="clear"></div>
      </div>
  </div>
   <div class="footer">
    <div class="container-main pad-20">
开发者ID:gibranda,项目名称:Feedstack,代码行数:31,代码来源:profile.php

示例14: deleteUser

 public function deleteUser()
 {
     $request = pathang::GetInstance('request');
     $uid = $request->get('uid');
     //check for validity of access token
     pathang::getHelper('userlog')->ajaxAuthentication();
     $status = pathang::GetModel('userlog')->deleteUser($uid);
     if ($status) {
         echo '1';
     } else {
         echo '0';
     }
 }
开发者ID:adrixnac,项目名称:RedSocial,代码行数:13,代码来源:admin.php

示例15:

<?php

$error = pathang::GetInstance('basket');
$heading = $error->get('heading');
$message = $error->get('message');
if ($heading) {
    echo '<h1>' . $heading . '</h1>';
}
if ($message) {
    echo '<p>' . $message . '</p>';
}
?>
<a href="<?php 
echo ROOT;
?>
"><button class="btn"> back to homepage</button></a>
开发者ID:gibranda,项目名称:Feedstack,代码行数:16,代码来源:errorpage.php


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