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); }
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(); }
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(); }
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; }
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); }
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(); } } }
<?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">
<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; ?>
<?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>
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; } }
" 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>
<?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';
<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">
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'; } }
<?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>
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'); }
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; }
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
<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>
<!-- 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;
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}(); } }
<?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--) {
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"
<?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; ?>