private function sender_email() { $post = new posts(); $getEmail = $post->get_single_post_by('sender_email'); if ($getEmail != NULL) { return $getEmail->post_content; } return '*****@*****.**'; }
public function new_post() { if (!isset($_SESSION['uid'])) { echo 1; return; } $forum_id = $_POST['forum_id']; $author_id = $_SESSION['uid']; $title = $_POST['title']; $content = $_POST['content']; $post = new posts(); $id = $post->insert($forum_id, $author_id, $title, $content); if (!$id) { echo 1; return; } $comment = new comments(); $suc = $comment->insert($id, $author_id, $content); echo $suc ? 0 : 1; return; }
<?php ob_start(); session_save_path('sessions/'); session_start(); include_once 'classes/Users.class.php'; $usr = new user(); $usr->check_if_logged(); include_once 'classes/Posts.class.php'; $posty = new posts(); if (isset($_POST['name'])) { $filename = $_FILES['file']['name']; $type = $_FILES['file']['type']; $tmp_name = $_FILES['file']['tmp_name']; $error = $_FILES['file']['error']; $posty->upload_img($filename, $type, $error, $tmp_name); } header("Location : admin.php"); ob_end_flush(); ?>
<?php /** * Home top slider */ $post = new posts(); $top_slide = $post->get_post_by_status('slide', 'top'); ?> <div id="home-slide" class="owl-carousel owl-theme"> <?php if ($top_slide != NULL) { foreach ($top_slide as $slide) { ?> <div class="item"><img src="<?php echo upload_dir() . $slide->post_content; ?> " alt="The Last of us"></div> <?php } } else { ?> <div class="item"><img src="<?php echo get_stylesheet_uri('img'); ?> slid_1.png" alt="Empty Slide"></div> <?php } ?> </div>
function ajax_modal() { if (!isset($_POST['url'])) { echo json_encode(array('title' => __('Request Fail'), 'content' => __('No post url'))); die; } $post_id = url_to_postid($_POST['url']); echo json_encode(posts::getPost($post_id)); die; }
/** save a new comment from submit * * @global record $USER * @global object $DB * @return array, result array. */ public function save_likes_from_submit() { global $USER, $DB; if (empty($this->course->enablelikes)) { print_error('likesaredisabled', 'format_socialwall'); } // Ensure that post exists and get the right courseid. $postid = required_param('postid', PARAM_INT); if (!($post = $DB->get_record('format_socialwall_posts', array('id' => $postid)))) { print_error('invalidpostid', 'format_socialwall'); } $userlike = optional_param('userlike', '0', PARAM_INT); // ... check capability. $coursecontext = \context_course::instance($post->courseid); if (!has_capability('format/socialwall:like', $coursecontext)) { print_error('missingcaplikepost', 'format_socialwall'); } $refresh = false; if (empty($userlike)) { if ($like = $DB->get_records('format_socialwall_likes', array('postid' => $postid, 'fromuserid' => $USER->id))) { $DB->delete_records_select('format_socialwall_likes', 'fromuserid = ? AND postid = ?', array($USER->id, $postid)); $refresh = true; // We use a instant enqueueing, if needed you might use events here. notification::enqueue_like_deleted($post); } } else { if (!($like = $DB->get_records('format_socialwall_likes', array('postid' => $postid, 'fromuserid' => $USER->id)))) { $newlike = new \stdClass(); $newlike->courseid = $this->course->id; $newlike->postid = $postid; $newlike->fromuserid = $USER->id; $newlike->timecreated = time(); $DB->insert_record('format_socialwall_likes', $newlike); $refresh = true; notification::enqueue_like_created($post); } } $result = array('error' => '0', 'message' => 'likesaved', 'postid' => $postid, 'userlike' => $userlike, 'countcomments' => $post->countcomments, 'countlikes' => $post->countlikes); if ($refresh) { $posts = posts::instance($this->course->id); $result['countlikes'] = $posts->refresh_likes_count($postid); } return $result; }
<?php include 'header.php'; include 'sidebar.php'; global $session; $post = new posts(); ?> <!-- Page content --> <div id="page-content-wrapper"> <!-- Keep all page content within the page-content inset div! --> <div class="page-content inset"> <div class="row"> <div class="col-md-12"> <h3 class="title gray"> <i class="fa fa-home fa-1x"></i> Setup Your Home Page </h3> <p class="message message-success"> <?php echo $session->message(); ?> </p> <div class="display_tables"> <div class="row all_settings_metarial"> <div class="col-md-12"> <h3 class="title">Setup your home page </h3> <div class="fb-section home-setting"> <h3 class="title"> Upload Website Logo <small> ( Upload new logo first delete it )</small></h3> <?php $logo = $post->get_single_post_by('logo'); if ($logo == NULL) { ?>
<?php /** * Advance template */ $post = new posts(); $advances = $post->get_post_by('advance'); if ($advances != NULL) { ?> <div class="col-md-3 advantage"> <p> <i class="fa fa-plus fa-1x"></i> <?php echo isset($advances[0]) ? strtoupper($advances[0]->post_title) : 'Post Empty'; ?> </p> </div> <div class="col-md-9 printbox"> <p> <span class="txt"> <?php echo isset($advances[1]) ? strtoupper($advances[1]->post_title) : ''; ?> </span> <i class="fa fa-caret-down fa-2x"></i></p> </div> <div class="col-md-12 advantage-content"> <div class="col-md-8 content-advantage-left"> <div class="content"> <?php echo isset($advances[0]) ? $advances[0]->post_content : ''; ?> </div> </div> <div class="col-md-4 content-advantage-right"> <div class="content">
/** * Update the specified resource in storage. * * @param int $id * @return Response */ public function update() { $post = posts::find(Input::get('id')); $post->idpengguna = Auth::user()->id; $post->judul = Input::get('judul'); $post->isi = Input::get('isi'); $post->tag = Input::get('tag'); $post->slug = str_slug(input::get('judul')); if (Input::hasfile('sampul')) { $sampul = date("YmdHis") . uniqid() . "." . Input::file('sampul')->getClientOriginalExtension(); Input::file('sampul')->move(storage_path(), $sampul); $post->sampul = $sampul; } $post->save(); return redirect(url('artikel')); }
<?php include 'header.php'; include 'sidebar.php'; $post = new posts(); $admin_email = $post->get_single_post_by('sender_email'); $location = $post->get_single_post_by('location'); $contact = $post->get_single_post_by('contact'); ?> <!-- Page content --> <div id="page-content-wrapper"> <!-- Keep all page content within the page-content inset div! --> <div class="page-content inset"> <div class="row"> <div class="col-md-12"> <h1 class="title gray"> Welcome To Admin Page</h1> <div class="col-md-4"> <div class="main_panel"> <div class="panel-header"> <div class="controls"> <a href="#" class="control-btn control-btn-info"> <i class="fa fa-plus"></i></a> </div> <!-- /.control --> <h3 class="panel-title"> <i class="fa fa-envelope"></i> Email Setting </h3> </div> <div class="panel-body"> <p class="message-success color-success hide text-center"> </p> <div class="panel-form"> <div class="input-group"> <input type="email" class="form-control" placeholder="Email ID" value="<?php echo isset($admin_email->post_content) ? $admin_email->post_content : '';
<div id="left"> <div id="leftnav"> <h3>Categories</h3> <ul> <?php include_once '/model/posts.php'; $posts = new posts(); $categories = $posts->categories_array(); foreach ($categories as $id => $name) { echo "<li><a href='?page=categories/" . $id . "'>" . $name . "</a></li>"; } ?> </ul> </div> <div id="leftnews"> <h3>Popular news</h3> <ul> <?php // $sql=select("news", array("id","name","category_id"), NULL,array("views","DESC"), 5); $sql = $posts->view_news(array("id", "name", "category_id"), false, array("views", "DESC"), 5); while ($rows_news = mysqli_fetch_array($sql)) { echo "<li><a href='showpost.php?news=" . $rows_news['id'] . "'><img src='images/slide-2-86x86.jpg'></a>\n <div class='cont_2'><a href='showpost.php?news=" . $rows_news['id'] . "'><h5>" . $rows_news['name'] . "</h5><br></a>" . $categories[$rows_news['category_id']] . "</div></li>"; } ?> </ul> <a href="Registry.php">See all</a> </div> </div>
<?php include_once '/model/posts.php'; $posts = new posts(); $posts_id = array(); @($topic = $_GET['topic']); @($news = $_GET['news']); $post_type = ""; $post_id = 0; $categories = array(); $categories = $posts->categories_array(); if (!$topic == "") { $post_type = "topics"; $post_id = $topic; } elseif (!$news == "") { $post_type = "news"; $post_id = $news; } $post_views = $posts->add_views($post_type, $post_id); // $sql=select($post_type, array("id")); $sql = $posts->view_post($post_type, array("id")); while ($rows_posts_id = mysqli_fetch_array($sql)) { $posts_id[] = $rows_posts_id['id']; } // $sql =select($post_type,array("id","name","date","views","body","writer"),array("id",$post_id)); $sql = $posts->view_post($post_type, array("id", "name", "date", "views", "body", "writer"), $post_id); while ($rows_posts = mysqli_fetch_array($sql)) { $post_id = $rows_posts['id']; $post_name = $rows_posts['name']; $post_writer = $rows_posts['writer']; $created = $rows_posts['date'];
<?php /* * Main index page * ALl of the site feature shows from here. * */ //Include Header file include 'header.php'; global $session; $post = new posts(); ?> <div class="container-fluid bg-gray"> <div class="row"> <?php /* * Top slider * */ include 'templates/top-slide.php'; ?> </div> </div> <!-- Welcom section --> <section class="container-fluid section bg-gray bg-gray-img"> <div class="container" id="about"> <div class="row"> <?php /*
/** * Delete comment and refresh the number of comments in post table * * @param int $cid, id of comment. * @return array result */ public function delete_comment($cid) { global $DB, $USER; // ... get post for refreshing counts after delete. if (!($comment = $DB->get_record('format_socialwall_comments', array('id' => $cid)))) { print_error('commentidinvalid', 'format_socialwall'); } // ...check capability. $coursecontext = \context_course::instance($comment->courseid); $candeletecomment = ($comment->fromuserid == $USER->id and has_capability('format/socialwall:deleteowncomment', $coursecontext)); $candeletecomment = ($candeletecomment or has_capability('format/socialwall:deleteanycomment', $coursecontext)); if (!$candeletecomment) { print_error('missingcapdeletecomment', 'format_socialwall'); } // ... delete comment. $DB->delete_records('format_socialwall_comments', array('id' => $cid)); // ... delete all the enqueued notifications. $DB->delete_records_select('format_socialwall_nfqueue', "module = 'comment' and details = ?", array($cid)); $result = array('error' => '0', 'message' => 'commentdeleted', 'commentid' => $cid, 'postid' => $comment->postid, 'countlikes' => 0, 'countcomments' => 0); $posts = posts::instance($comment->courseid); if ($post = $posts->refresh_comments_count($comment->postid)) { $result['countlikes'] = $post->countlikes; $result['countcomments'] = $post->countcomments; } // If this new comment is a reply update the countreplies attribute. if ($comment->replycommentid > 0) { $result['countreplies'] = $this->refresh_replies_count($comment->replycommentid); } return $result; }
function custom_slide_update() { $post = new posts(); if (isset($_POST['action'])) { $post_id = $_POST['post_id']; $fields = $_POST['slide_fields']; foreach ($fields as $field) { $post_data[] = $field['name'] . '::' . $field['value'] . '#'; } $data['comment'] = implode('', $post_data); if ($post->update_post($data, array('id' => $post_id))) { echo 'update'; } else { echo 'error'; } } }
<?php include 'header.php'; include 'sidebar.php'; global $session; $post = new posts(); ?> <!-- Page content --> <div id="page-content-wrapper"> <!-- Keep all page content within the page-content inset div! --> <div class="page-content inset"> <div class="row"> <div class="col-md-12"> <h3 class="title gray"> <i class="fa fa-home fa-1x"></i> Slide Setting Page </h3> <?php if (!empty($session->message)) { ?> <div class="alert alert-success"> <?php echo $session->message(); ?> </div> <?php } ?> <div class="content special"> <div class="fb-section "> <h3 class="title"> Upload Image For Top Slide</h3> <div class="upload_main"> <div class="upload-container"> <p class="file_uploadmsg color-red"></p> <div id="dragandrophandler" class="dragandrophandler">
js/prettify.js"></script> <script type="text/javascript" src="<?php echo admin_stylesheet(); ?> js/drawonmaps_markers.js"></script> <script type="text/javascript" src="<?php echo admin_stylesheet(); ?> js/drawonmaps.js"></script> <script type="text/javascript" src="<?php echo admin_stylesheet(); ?> js/drawonmaps_map_display.js"></script> <?php $post = new posts(); $footer_map = $post->get_single_post_by('contact'); $lat = '44.5403'; $lang = '-78.5463'; if ($footer_map != NULL) { $footer_map = explode('&', $footer_map->post_content); if (is_array($footer_map)) { $lat = $footer_map[1]; $lang = $footer_map[0]; } } /* * Get all map location * */ $map_obj = new SiteMaps(); $map_objects = $map_obj->getMapsObjects();
"><div class="logo"></div></a> </div> <!-- ################### BODYROX ####--> <div class="centerbox"> <?php include_once 'classes/Posts.class.php'; if (isset($_GET['page'])) { $page = $_GET['page']; } else { $page = 1; } $base = $cfg['pages_base']; $posty = new posts(); $result = $posty->get_imgs($base, $page); //pobranie postow z bazy danych $allposts = $posty->img_number(); $sum = $allposts[0]['COUNT(*)']; foreach ($result as $instance) { //generuje posty $link = $instance['link']; $id = $instance['id']; echo "<div class='box'><div class='movie'><BR /><center><a href='page.php?id=" . $id . "' ><img src='uploads/" . $link . "' /></a></center><BR />\r\n\t\t\t\t\t\r\n\t\t\t\t<div style='margin-left:auto;margin-right:auto;padding:5px 5px 5px 0;'><BR />\r\n\t\t\t\t<center>\r\n\t\t\t\t<a expr:share_url='href='' href='http://www.facebook.com/sharer.php' name='fb_share' share_url='" . $cfg['page_url'] . $id . "' href='http://www.facebook.com/sharer.php' type='button_count' align='center'>Share</a><script src='http://static.ak.fbcdn.net/connect.php/js/FB.Share' type='text/javascript'></script>\r\n\t\t\t\t</center>\r\n\t\t\t\t</div>\r\n\t\t\t\t\r\n\t\t\t\t<BR />\r\n\r\n\t\t\t\t\t\r\n\t\t\t\t\t</div></div>"; } ?> </div> <!-- #################### FOOTER #####-->
<?php $post = new posts(); $logo = $post->get_single_post_by('footer_logo'); $socials = social_urls(); ?> <!-- Footer section --> <footer class="container-fluid bg-red"> <div class="container footer-padding"> <div class="col-md-4 copyright"> <p class="text-left"> <a href="<?php echo get_home_url(); ?> "> <?php if (isset($logo->post_content)) { ?> <img src="<?php echo upload_dir() . $logo->post_content; ?> " alt=""> <?php } else { ?> <img src="<?php echo get_stylesheet_uri('img'); ?> footer-logo.png" alt=""> <?php
<?php // $sql= select("news",array("id","name")); // while($rows= mysqli_fetch_array($sql)){ // $news[$rows['id']]=$rows['name']; // } // $categories=array(); // $sql= select("categories",array("id","name")); // while($rows= mysqli_fetch_array($sql)){ // $categories[$rows['id']]=$rows['name']; // } include_once '/model/posts.php'; $posts = new posts(); $categories = $posts->categories_array(); $sql = $posts->view_post("news", array("id", "name")); while ($news_array = mysqli_fetch_array($sql)) { $news[$news_array['id']] = $news_array['name']; } ?> <div id="topics"> <div id="sub"> <font color="black"><h2>Latest Topics</h2></font></div> <ul> <?php $sql = $posts->view_post("topics", false, false, array("date", "DESC"), 5); while ($rows_topics = mysqli_fetch_array($sql)) { $topic_id = $rows_topics['id']; $topic_name = $rows_topics['name']; $topic_body = nl2br(htmlentities($rows_topics['body'])); $topic_writer = $rows_topics['writer']; $topic_date = $rows_topics['date']; $topic_category = $categories[$rows_topics['category_id']];
public static function lock_post($course) { $posts = posts::instance($course->id); // Suitable capability checks are made in save_posts_locked_from_submit! return $posts->save_posts_locked_from_submit(); }
<td align="right"> <input type="submit" name="Submit" value="Dojeb!" /></td></table> <!--APC hidden field--> <input type="hidden" name="APC_UPLOAD_PROGRESS" id="progress_key" value="<?php echo $up_id; ?> "/> <!----> <iframe id="upload_frame" name="upload_frame" frameborder="0" border="0" src="" scrolling="no" scrollbar="no" > </iframe> </form> <?php include_once 'classes/Posts.class.php'; $posty = new posts(); if (isset($_POST['name'])) { $filename = $_FILES['file']['name']; $type = $_FILES['file']['type']; $tmp_name = $_FILES['file']['tmp_name']; $error = $_FILES['file']['error']; $posty->upload_img($filename, $type, $error, $tmp_name); } if (isset($_GET['succes'])) { echo "<font color='red'>DOJEBANO!</font> <BR /><BR />"; } if (isset($_POST['link'])) { $usr->upload_movie($_POST['link'], $_SESSION['user_id'], $_POST['name']); unset($_POST['link']); echo "<font color='red'>DOJEBANO!</font> <BR /><BR />"; }
<?php $post = new posts(); global $session, $main_db; if (isset($_POST['submit'])) { $data['post_title'] = $_POST['contact_title']; $data['post_content'] = $_POST['address_content']; $data['post_type'] = 'tab'; $data['post_position'] = $_POST['tab_position']; if (isset($_GET['id'])) { if ($post->update_post($data, array('id' => $_GET['id']))) { $session->message("Your tab update successful! "); safe_redirect(admin_url('new-post') . '?post=tab&id=' . $_GET['id']); } else { var_dump($main_db->last_query); exit; } } else { if ($post->insert_posts($data)) { $session->message("Your tab has been created!"); safe_redirect(admin_url('new-post') . '?post=tab&id=' . $main_db->insert_id); } else { var_dump($main_db->last_query); exit; } } } $current_post = NULL; if (isset($_GET['id'])) { $current_post = $post->get_post_by_id($_GET['id']); }
<!-- /.option-group --> </div> </div> <!-- /.content --> </div> <!-- /#slideSetting --> <div id="tabSettings" class="tabcontent"> <h3 class="title"> <i class="fa fa-toggle-on"> </i> Welcome Tab Settings </h3> <!-- /.title --> <div class="section"> <?php global $main_db; $posts = new posts(); $allTab = $posts->get_post_by('tab'); if (NULL != $allTab) { $i = 0; foreach ($allTab as $tab) { $i++; ?> <div class="fb-section update" id="update_<?php echo $tab->id; ?> "> <div class="siteTabs"> <div class="form-group"> <div class="control"> <span class="trash-panel" data-ID="<?php echo $tab->id;
/** * вернет поcледние $limit постов * * результат в $this->_actions_data['posts'] */ public function action_list($limit = null) { if ($limit === null) { $limit = !empty($_REQUEST['posts_list_limit']) && is_numeric($_REQUEST['posts_list_limit']) ? $_REQUEST['posts_list_limit'] : 10; } $sql = 'SELECT a.id,a.uid,a.text,a.create_on,b.email,b.name as username,b.public_email FROM posts a, users b WHERE b.uid = a.uid AND a.status = \'active\' ORDER BY id DESC LIMIT ' . $limit; foreach (posts::find_by_sql($sql) as $post) { $attr = $post->attributes(); if (is_object($attr['create_on'])) { $attr['create_on'] = $attr['create_on']->format('d M Y H:i:s'); } $attr['like_already'] = $this->is_already_like($attr['id']) ? 1 : 0; // $this->action_like_members_count($attr['id']); $attr['like_members_count'] = $this->_actions_data['like_members_count']; unset($this->_actions_data['like_members_count']); // $this->action_like_members($attr['id']); $attr['like_members'] =& $this->_actions_data['like_members']; unset($this->_actions_data['like_members']); // $this->action_attachments($attr['id']); $attr['attachments'] =& $this->_actions_data['attachments']; unset($this->_actions_data['attachments']); $this->_actions_data['posts'][] = $attr; } }
/** * delete comment by ronak */ public function dlt($id) { $comment = comments::find($id); $postid = $comment->on_post; $slug = posts::find($postid); $slugcontent = $slug->slug; $comment->delete(); return redirect('/posts' . $slugcontent); }
<?php global $session, $main_db; $user = new User(); $post = new posts(); $p_user = new PublicUser(); $hotline = $post->get_single_post_by('hotline'); $logo = $post->get_single_post_by('logo'); ?> <!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> <title> Ink City </title> <!-- Twitter bootstrap --> <link rel="stylesheet" href="<?php echo get_stylesheet_files('bootstrap'); ?> "> <link rel="stylesheet" href="<?php echo get_stylesheet_files('bootstrap-theme'); ?> "> <!-- Font Awesome --> <link rel="stylesheet" href="<?php echo get_stylesheet_files('font-awesome'); ?> ">
<a href="<?php echo $youtube_href; ?> " class="youtube btn btn-square"> </a> </div> </div> </div> </div> </div> <?php } ?> <?php $testimonials_cat_id = 8; $testimonials = posts::getPosts($testimonials_cat_id, 1); if ($testimonials) { ?> <div class="container-fluid testimonials-wrap"> <div class="container"> <h2><?php echo get_the_category_by_ID($testimonials_cat_id); ?> </h2> <?php foreach ($testimonials as $post) { ?> <?php setup_postdata($post); the_content(); ?>
function social_urls() { $post = new posts(); $socials = $post->get_post_by('social'); $icons = $post->social_icons; for ($i = 0; $i < count($icons); $i++) { $data[$icons[$i]] = isset($socials[$i]) ? $icons[$i] == $socials[$i]->post_title ? $socials[$i]->post_content : '#' : '#'; } return $data; }
<?php require "includes/conf.inc.php"; require "includes/functions.inc.php"; if (isset($_POST['prNum'])) { $userId = $_SESSION['userId']; $startPr = intval($_POST['prNum']); $interval = 1; $endPr = $startPr + $interval; $seeMorePrObj = new posts(); $seeMorePr = $seeMorePrObj->getPostReviews($userId, 3, 3); if ($seeMorePr == false) { echo false; } else { foreach ($seeMorePr as $pr) { $dateTime = getdate(strtotime($pr['postDate'])); echo ' <div class="postReview" id="' . $pr['postId'] . '"> <h5>' . $pr['postTitle'] . '</h5> <span>Added at: ' . $dateTime['mday'] . ' ' . $dateTime['month'] . ', ' . $dateTime['year'] . '</span> <span>Category: ' . $pr['postTyp'] . '</span> <span>' . $pr['class'] . ' > ' . $pr['facultyName'] . ' > ' . $pr['subjectName'] . ' > ' . $pr['chapterName'] . '</span> <div class="review">' . truncate($pr['postText'], 500) . '</div> <a href="' . generate_link($pr['postTitle'], $pr['postId']) . '" class="anchor-btn" target="_blank">See More</a> </div>'; } } }