function fetch_status() { $db = new Database(); $db->connect(); $user_id = 1; $content = $_GET['content']; $time = date("Y/m/d"); $query = "insert into status(user_id , content , time) values('{$user_id}','{$content}','{$time}')"; $result = $db->run_query($query); post_status(); }
function fetch_status() { session_start("login"); $db = new Database(); $db->connect(); //$user_id = $_SESSION['user_id']; $content = $_GET['content']; $time = date("Y/m/d"); $query = "insert into status(user_id , content , time) values('" . $_SESSION['user_id'] . "','{$content}','{$time}')"; $result = $db->run_query($query); post_status(); }
$header = "From: do-not-reply@" . $_SERVER['HTTP_HOST']; $content = tpl('verifymail', array('hash' => $hash)); mail($email, LANG('Identity Verify'), $content, $header); echo tpl('header'); echo tpl('info', array('icon' => 'send', 'title' => LANG('Verification sent'), 'content' => LANG('Use the link sent to you to finish the verification'))); echo tpl('footer'); die; } elseif ($_GET['action'] == 'verify') { if (in_array($_GET['hash'], user_verify_hash())) { $message = LANG('Verify complete. You now have more permissions'); global $_USER; $_USER['verified'] = true; $_USER['title'] = '-'; $user = $_USER; unset($user['avatar']); unset($user['id']); $uid = user('id'); data_save("user/{$uid}/info", json_encode($user)); import('model/status.php'); post_status(LANG('Verified identity')); } else { $message = LANG('Verification key is invalid or out of date'); } echo tpl('header'); echo tpl('info', array('icon' => 'send', 'title' => LANG('Identity Verify'), 'content' => $message)); echo tpl('footer'); die; } } } die(tpl('settings', array('errormsg' => $errormsg)));
<?php include_once 'includes/header.php'; ?> <form action="" method="post"> <textarea name="status_body" id="status_body" placeholder="What's going on?"></textarea> <input name="submit" type="submit" value="Post"/> </form> <?php if (@isset($_POST['submit'])) { post_status($_SESSION['user_id'], $_POST['status_body']); } news_feed($_SESSION['user_id'], 'yes'); include_once 'includes/footer.php';
<!-- user deatils here--> </div> <!--center><button class="btn btn-primary" onclick="logout()">Log Out  <span class="glyphicon glyphicon-off"></span></button></center--> </div> </div> </div> </div> <!--div class="col-md-5"></div--> <div class="col-md-5"> <div class="container-fluid" id="posts"> </br> <?php include_once 'post_status.php'; post_status(); ?> </div> </div> <div class="col-md-3"> <!--intensionalyy left blank--> </div> <!--div class="panel panel-default"> <div class="panel-body"></div> </div--> <div class="panel panel-default" id="live_chat_mode" style="position:fixed; margin-top : 210px ; margin-left:110px ; width:220px;"> <div class="panel-body"> <p style="text-align:center; padding:10px;font-family:verdana;font-weight:300">Messenger allows you to have real time chat with your friends.</p>
} else { $o = array(); } $c = iescape($_POST['content']); $lines = explode("\n", $c); $t = $lines[0]; unset($lines[0]); $c = implode('</br>', $lines); $o[] = array('title' => $t, 'content' => $c, 'user' => user('id')); data_save($dataitem, json_encode($o)); post_status(LANG('modify the calendar at %%', $_POST['date'])); } } elseif ($_GET['action'] == 'delete') { if (user() && user('verified') && posted('date', 'key')) { $dataitem = 'calendar/' . $_POST['date']; if (data_exists($dataitem)) { $o = json_decode(data_read($dataitem), true); } else { $o = array(); } if (isset($o[$_POST['key']])) { unset($o[$_POST['key']]); } if (count($o) <= 0) { data_remove($dataitem); } else { data_save($dataitem, json_encode($o)); } post_status(LANG('modify the calendar at %%', $_POST['date'])); } }
<?php if (!isset($_GET['action'])) { die; } import('model/status.php'); if ($_GET['action'] == 'delete') { remove_status($_POST['id'] * 1, true); } elseif ($_GET['action'] == 'post') { if (user() && posted('content')) { if (trim($_POST['content'])) { post_status($_POST['content'], 'say'); } } } elseif ($_GET['action'] == 'fetch') { die(json_encode(list_status($_GET['start'] * 1, $_GET['limit'] * 1))); } elseif ($_GET['action'] == 'querynew') { $id = $_GET['id'] * 1; if ($id < last_post_id()) { die('new'); } die('none'); }
} $query = implode('/', $qpath); $pquery = implode('/', $path); } else { $path = array(''); $query = ''; $pquery = ''; } /***************** * Save wiki page *****************/ if (isset($_GET['save']) && user('verified')) { data_save("wiki/{$query}/content", $_POST['content']); $stat = LANG('updated wiki page') . ' : '; $stat .= '<a href="' . BASE . 'wiki?p=' . urlencode($pquery) . '">' . $pquery . '</a>'; post_status($stat, 'did', false); die; } /******************* * Delete wiki page *******************/ if (isset($_GET['delete']) && user('verified')) { data_remove("wiki/{$query}/content"); data_remove("wiki/{$query}/attachments"); foreach (scandir("data/wiki/{$query}") as $f) { if (substr($f, 0, 4) == 'att_') { $f = "data/wiki/{$query}/{$f}"; if (!is_dir($f)) { unlink($f); } }