Пример #1
0
 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);
 }
Пример #2
0
 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();
 }
Пример #3
0
 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();
 }
Пример #4
0
 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;
 }
Пример #5
0
 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);
 }
Пример #6
0
 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();
         }
     }
 }
Пример #7
0
<?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">
Пример #8
0
<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;
        ?>
Пример #9
0
<?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>
Пример #10
0
 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;
     }
 }
Пример #11
0
" 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>
Пример #12
0
<?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';
Пример #13
0
      <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">
Пример #14
0
 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';
     }
 }
Пример #15
0
<?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>
Пример #16
0
 public function comment()
 {
     $request = pathang::getInstance('request');
     $uid = $request->get('uid');
     $feed_id = $request->get('feed_id');
     $comment = $request->get('comment');
     //check for validity of access token
     pathang::getHelper('userlog')->ajaxAuthentication();
     $comment_id = pathang::getModel('feed')->addFeedComment($uid, $feed_id, $comment);
     $liveuser = pathang::GetInstance('session')->get('liveuser');
     $basket = pathang::getInstance('basket');
     $basket->set('comment', $comment);
     $basket->set('comment_id', $comment_id);
     $basket->set('user', $liveuser);
     pathang::render('feed', 'comment_entry');
 }
Пример #17
0
 public function globalFollow($id)
 {
     $time_stamp = date("Y-m-d H:i:s");
     $users = pathang::GetInstance('pathang')->FEEDSTACK->DEFAULT_FOLLOW;
     $u = explode(',', $users);
     //pdo object and table
     $pdo = pathang::getInstance('pdo');
     $table = 'followers';
     $uid = $id;
     foreach ($u as $a => $b) {
         $follow_id = $this->getUserId(trim($b));
         // sql insert statement
         $sql = "INSERT INTO {$table} \n\t\t\t\t\t\t(uid,follow_id,time_stamp) \n\t\t\t\t VALUES ({$uid},{$follow_id},'{$time_stamp}')";
         $result = $pdo->exec($sql);
     }
     return true;
 }
Пример #18
0
	padding:4px;
	border-radius: 10px;
}
.table{
	width:100%;
}
</style>
<link href="<?php 
echo ROOT;
?>
lib/expresscss/style.css" rel="stylesheet">
<?php 
$notify = pathang::GetInstance('packet')->get('notify');
$unread = pathang::GetInstance('packet')->get('count');
if (isset(pathang::GetInstance('session')->get('liveuser')->username)) {
    $username = pathang::GetInstance('session')->get('liveuser')->username;
}
$count = null;
$i = 0;
if (isset($notify->{$i})) {
    $count = 1;
}
?>
<div class="notify-block">
<div>
<?php 
if ($count && $unread > 0) {
    ?>
<table class="table" id="hor-minimalist-b" >
	<tr>
		<th><div class="notify-title"><a href="<?php 
Пример #19
0
<style>
#hor-minimalist-b th{
	border-bottom: 2px solid silver;
	color:#2c3e50;
}
#hor-minimalist-b tbody tr:hover td{
	color:#2c3e50;
}
#hor-minimalist-b td {
	color:#7f8c8d;
}
</style>

<?php 
$pathang = pathang::GetInstance('pathang');
$count = pathang::GetInstance('basket')->Get('count');
?>
<div class="head-dashboard">
	<div >
		<div class="heading-admin"><i class="fa fa-dashboard"></i> Dashboard</div>
	</div>
</div>
<div class="dashboard">

	<div class="stats">
		<div class="bcol-25">
			<div class="stat-item">
				<div class="stat-item-number"><?php 
echo $count['users'];
?>
</div>
Пример #20
0
<!--
	
	Register Activation Page
	_________________________________________
	-Display the success message of user activation
	-Username and Email are also displayed
	-resend activation and back to login buttons are given

-->
<?php 
//basket object
$basket = pathang::GetInstance('basket');
//get username and email
$username = $basket->Get('username');
$email = $basket->Get('email');
?>
<div class="box-userlog">
<div class="box">
	<h1>Success !</h1>
<p><b>User(<span class="ash"><?php 
echo $username;
?>
</span>) Successfully registered</b></p>
<p>An activation mail has been sent to your email <i class="ash"><?php 
echo $email;
?>
</i>. Follow the instructions
	in the mail to activate your account. Please check spam box if in case you dont 
	recieve the mail.<p>
<a href="<?php 
echo ROOT;
Пример #21
0
 public function admin()
 {
     $n2 = strtoupper(pathang::getInstance('node')->get('n2'));
     $liveuser_id = null;
     $liveuser = pathang::GetInstance('session')->get('liveuser');
     if ($liveuser) {
         $liveuser_id = $liveuser->id;
     }
     $isadmin = pathang::getModel('userlog')->isAdmin($liveuser_id);
     if (!$isadmin) {
         pathang::GetInstance('pathang')->SITE->PAGE = 'login';
         $basket = pathang::GetInstance('basket');
         $basket->set('heading', 'Restricted Access !');
         $basket->set('message', 'You dont have enough privilege to acces this page. Sorry for the inconvenience. ');
         pathang::render('general', 'errorpage');
         exit;
     } else {
         if ($n2 == null) {
             $n2 = 'main';
         }
         pathang::getController('admin')->{$n2}();
     }
 }
Пример #22
0
	<?php 
$basket = pathang::getInstance('basket');
$feed_id = $basket->get('feed_id');
$comments = $basket->Get('comments');
$lastid = $basket->Get('lastid');
$liveuser = pathang::GetInstance('session')->get('liveuser');
if (isset(pathang::getInstance('session')->get('liveuser')->id)) {
    $liveuser_id = pathang::getInstance('session')->get('liveuser')->id;
} else {
    $liveuser_id = null;
}
$first = 0;
for ($i = 0; $i < 5; $i++) {
    if (isset($comments->{$i}->id)) {
        $first = $comments->{$i}->id;
    }
}
$allowed_delete = $basket->get('allowed_delete');
?>
		<div class="load-more-check-<?php 
echo $feed_id;
?>
-<?php 
echo $lastid;
?>
" last-comment-id="<?php 
echo $first;
?>
"></div> 
		<?php 
for ($k = 4; $k > -1; $k--) {
Пример #23
0
echo ROOT;
?>
lib/jform/jform.js"></script> 
<script src="<?php 
echo ROOT;
?>
lib/upload/script.js"></script> 
<script src="<?php 
echo ROOT;
?>
lib/upload/drop.js"></script> 
<div class="root" root="<?php 
echo ROOT;
?>
" access-token='<?php 
echo pathang::GetInstance('session')->get('token');
?>
'></div>

<div class="image_container">
	<div class="load_pad">
<div class="load">
	<div class="drop" u="<?php 
echo ROOT . 'editor';
?>
">
	Drop the Image Here
<form action="<?php 
echo ROOT . $username;
?>
/image_upload" method="post" id="myForm" class="form well"
Пример #24
0
<?php

$basket = pathang::GetInstance('basket');
$feeds = $basket->get('feeds');
$wall = $basket->get('wall');
$feed_type = strtoupper(pathang::GetInstance('request')->get('feed-type'));
$liveuser_id = pathang::GetInstance('request')->get('liveuser-id');
$limit_counter = $basket->get('limit_counter');
$uid = $basket->get('uid');
if (!$limit_counter) {
    $limit_counter = 5;
}
$allowed_delete = $basket->get('allowed_delete');
if ($feeds) {
    foreach ($feeds as $a => $feed) {
        ?>
<div class="feed feed-<?php 
        echo $feed->id;
        ?>
" liveuser-id="<?php 
        echo $liveuser_id;
        ?>
" feed-id='<?php 
        echo $feed->id;
        ?>
'>
		<div class="bcol-15">
			<div class="feed-user mobile-hidden">
				<a href="<?php 
        echo $feed->profile_link;
        ?>