Example #1
0
<?php

require_once '../_includes/connection.php';
require_once '_includes/header_footer_blog.php';
require_once '../_includes/functions.php';
require_once '_includes/blog_functions.php';
require_once '_includes/session.php';
confirm_logged_in(4);
if (!$_GET['page']) {
    redirect_to("index.php?error=4");
}
$clean_id = mysql_prep($_GET['page']);
if ($page = get_page_by_id($clean_id)) {
    $query = "DELETE FROM pages WHERE id ={$clean_id} LIMIT 1";
    $result = mysql_query($query, $connection);
    if (mysql_affected_rows() == 1) {
        $message = "A single post was deleted.<br />";
        if (get_comments($clean_id, ALL) > 0) {
            $query_comments = "DELETE FROM comments WHERE page_id={$clean_id}";
            mysql_affected_rows();
            if (mysql_affected_rows() == 1) {
                $message .= "And a single comment was deleted.";
            } else {
                $message .= "And " . mysql_affected_rows() . " comments were deleted.";
            }
        }
    } else {
        $message = '<p>Subject Deletion Failed</p>';
    }
}
?>
Example #2
0
echo $header_blog2;
?>

<body>
<header>
<a href ="../index.php" title="Home Page";>
  <img src="../_assets/Big_R.png" width="151" height="200" border=0 alt="Return Home"></a>
&nbsp;
<h1>Post a Comment</h1>
</header>

<section>
<aside>
<?php 
//Here I will post the original post and then have the comment form below that...
$blogs = get_page_by_id($_GET['id'], $_COOKIE['friendly']);
//heading
echo "<div class=\"content\"><h2>" . $blogs['page_name'] . "</h2>";
//author and date
echo author_date($blogs['date'], $blogs['author']);
//content
echo $blogs['content'];
//tag area: the fucntion will get all of the individual strings from the tag field
echo '<p><span class="small">Tags: ';
echo explode_tags($blogs['tags']);
echo '</span></p>';
//comments
echo post_comments($blogs['id']);
?>

<form id= "add_blog" method= "post">
Example #3
0
<?php

require '../includes/connection.php';
require '../includes/functions.php';
require 'includes/admin_functions.php';
// make sure the id sent is an integer
/*if (intval($_GET['page']) == 0 || intval($_GET['product']) == 0) {
		redirect_to('index.php');
	}*/
// delete from pages page !
if (isset($_GET['page'])) {
    $id = mysql_prep($_GET['page']);
    if ($page = get_page_by_id($id)) {
        $query = "DELETE FROM page_data WHERE id = {$page['id']} LIMIT 1";
        $result = mysql_query($query);
        if (mysql_affected_rows() == true) {
            $query_pro = "DELETE FROM products WHERE page_id = {$page['id']}";
            $run = mysql_query($query_pro);
            if (mysql_affected_rows() == true) {
                // Successfully deleted
                redirect_to("page_index.php?deleted=2");
            }
            redirect_to("page_index.php?deleted=1");
        } else {
            // Deletion failed
            echo "<p>Page deletion failed.</p>";
            echo "<p>" . mysql_error() . "</p>";
            echo "<a href=\"index.php\">Return to Admin</a>";
        }
    } else {
        redirect_to('index.php');
Example #4
0
function find_selected_page()
{
    global $sel_subject;
    global $sel_page;
    if (isset($_GET['subj'])) {
        $sel_subject = get_subject_by_id($_GET['subj']);
        $sel_page = get_default_page($sel_subject['id']);
    } elseif (isset($_GET['page'])) {
        $sel_subject = NULL;
        $sel_page = get_page_by_id($_GET['page']);
    } else {
        $sel_subject = NULL;
        $sel_page = NULL;
    }
}
<?php

$sel_page = get_page_by_id($product['page_id']);
?>

					<div class="col-sm-6 col-lg-4 product ">
					  <div class="thumbnail pro-border ">
						<div class="container-item">
							
							<div class="item">
								<a href="<?php 
echo site_options('link') . 'content.php?page=' . $product['page_id'];
?>
"><img src="<?php 
echo $product['picture'];
?>
" height="100%" width="100%"></a>
								<div class="item-overlay"> 
								<a class="item-button play" <?php 
if (logged_in()) {
    ?>
 href="#" onclick="addtocart(<?php 
    echo $product['id'];
    ?>
)"</a> <?php 
} else {
    echo 'href="' . site_options('link') . '/login.php"';
}
?>
>
								<i class="play"></i>
Example #6
0
if (intval($_GET['page']) == 0) {
    redirect_to("content.php");
}
include_once "includes/form_functions.php";
if (isset($_POST['submit'])) {
    $errors = array();
    $obavezna_polja = array('menu_name', 'position', 'visible', 'content');
    $errors = array_merge($errors, check_required_fields($obavezna_polja));
    $polje_sa_duzinom = array('menu_name' => 30);
    $errors = array_merge($errors, check_max_fields_length($polje_sa_duzinom));
    $id = mysql_prep($_GET['page']);
    $menu = mysql_prep($_POST['menu_name']);
    $position = mysql_prep($_POST['position']);
    $visible = mysql_prep($_POST['visible']);
    $content = mysql_prep($_POST['content']);
    $page_get = get_page_by_id($id);
    $pages_all = get_all_pages_for_subject($page_get['subject_id']);
    $page_fetch = mysql_fetch_array($pages_all);
    $count_pages = mysql_num_rows($pages_all);
    $position_old = $page_get['position'];
    if (empty($errors)) {
        if ($position_old != $position) {
            if ($position_old < $position) {
                for ($i = $position_old; $i < $position; $i++) {
                    $new = $i + 1;
                    $qry = "UPDATE pages SET";
                    $qry .= " position={$i}";
                    $qry .= "\tWHERE position={$new} AND subject_id={$page_get['subject_id']}";
                    mysql_query($qry, $conn);
                }
            } else {
Example #7
0
//decided if someone is friendly
is_friendly($_GET['friendly'], $_SESSION['user_name'], $_COOKIE['friendly'], $url);
$subject_set = get_all_subjects();
//if the get index isn't set I gave it a value of 2 in order to return the
//defaul content for example...
if (!isset($_GET['index'])) {
    $sel_index = 2;
} else {
    $sel_index = $_GET['index'];
}
//this function will obtain the page info if a sub page is selected
//use the array function $sel_page to pull out specific info
if (!isset($_GET['page']) || $_GET['page'] == 3 || $_GET['page'] == 5) {
    $sel_page = NULL;
} elseif (isset($_GET['page'])) {
    $sel_page = get_page_by_id($_GET['page']);
}
//this will get all of the subject info use $sel_subject['value'] to pull out the nessary info
$sel_subject = subject_by_id($sel_index);
if ($sel_page == NULL) {
    $sel_content = $sel_subject['default_content'];
} else {
    $sel_content = $sel_page['content'];
}
?>

<?php 
echo $fep_header1;
?>
  <title>RCM Portfolio <?php 
if ($sel_page != NULL) {
Example #8
0
File: ap.php Project: adenzil/blog
                }
            } else {
                if (!isset($_GET["page"]) || empty($_GET["page"])) {
                    $a = 1;
                } else {
                    $a = $_GET["page"];
                }
                if (!isset($_GET["per_page"]) || empty($_GET["per_page"])) {
                    $b = 10;
                } else {
                    $b = $_GET["per_page"];
                }
                if (isset($_GET["query"]) or isset($_GET["tag"])) {
                    if (isset($_GET["tag"]) and empty($_GET["query"])) {
                        $value = get_page_by_id($a, $b, flase, $val);
                    } elseif (isset($_GET["query"]) and empty($_GET["tag"])) {
                        $value = get_page_by_id($a, $b, $_GET["query"], false);
                    } elseif (isset($_GET["query"]) and isset($_GET["tag"])) {
                        $value = get_page_by_id($a, $b, $_GET["query"], $val);
                    }
                } else {
                    $value = get_page_by_id($a, $b, false, false);
                }
            }
            break;
        default:
            echo "database empty";
    }
}
header('Content-Type: application/json');
exit(json_encode(array("data" => $value)));
Example #9
0
<?php

require_once '../_includes/connection.php';
require_once '_includes/header_footer_blog.php';
require_once '../_includes/functions.php';
require_once '_includes/blog_functions.php';
require_once '_includes/session.php';
$url = 'ind_blog.php';
if (isset($_GET['page'])) {
    $url .= '?page=' . $_GET['page'];
}
//decided if someone is friendly
is_friendly($_GET['friendly'], $_SESSION['user_name'], $_COOKIE['friendly'], $url);
if (isset($_GET['page'])) {
    $blogs = get_page_by_id($_GET['page']);
} else {
    redirect_to('index.php?error=2');
}
if ($blogs['visible'] == 0 && !isset($_COOKIE['friendly'])) {
    redirect_to('index.php');
}
//this will get all of the subject info use $sel_subject['value'] to pull out the nessary info
$sel_subject = subject_by_id(4);
echo $header_blog1;
?>
<link href='http://fonts.googleapis.com/css?family=Rock+Salt' rel='stylesheet' type='text/css'>
<title>RCM: <?php 
echo $sel_subject['title'];
?>
 </title>
<?php 
Example #10
0
 <?php 
include 'includes/mysqli_connect.php';
include 'includes/functions.php';
if ($pid = validate_id($_GET['pid'])) {
    // neu ton tai bien pid thi tiep tuc truy van csdl
    $set = get_page_by_id($pid);
    $posts = array();
    if (mysqli_num_rows($set) > 0) {
        $pages = mysqli_fetch_array($set, MYSQLI_ASSOC);
        $title = $pages['page_name'];
        $posts[] = array('page_name' => $pages['page_name'], 'content' => $pages['content'], 'author' => $pages['name'], 'post-on' => $pages['date'], 'aid' => $pages['user_id']);
    }
} else {
    redirest_to();
}
include 'includes/header.php';
include 'includes/sidebar-a.php';
?>
  <div id="content">

 <?php 
foreach ($posts as $post) {
    echo "\n        <div class='post'>\n            <h2>" . $post['page_name'] . "</h2>\n            <p>" . the_content($post['content']) . "</p>\n            <p class='meta'><strong>Posted by: </strong><a href='author.php?aid={$post['aid']}'>" . $post['author'] . "</a> | <strong>On: </strong>" . $post['post-on'] . "</p>\n\n        </div>\n    ";
}
?>
 <?php 
include 'includes/comment_form.php';
?>
       </div><!--end content-->
<?php 
include 'includes/sidebar-b.php';
Example #11
0
<?php

$default_content = get_page_by_id($_GET['page']);
$cleaned_content = html_entity_decode($default_content['content']);
$cleaned_tags = html_entity_decode($default_content['tags']);
echo "<h2>" . $default_content['page_name'] . "</h2>";
echo author_date($default_content['date'], $default_content['author']);
echo $cleaned_content;
echo "<br/><p>Tags: " . $default_content['tags'] . "</p>";
?>

<h3>Edit this post...</h3>
<form id= "edit_blog" method= "post">
  <fieldset>
  <label for= "page_name" type= "text" style= "margin-right: 1em;"><strong>Blog Post Title: </strong></label>
  <input type= "text" name="page_name" tabindex= "10" style= "width: 350px; margin-bottom: 1.5em;" value= "<?php 
echo $default_content['page_name'];
?>
"/>
  <br />
  <label for= "content" type= "text"><strong>Content: </strong></label>
  <textarea name="content" class="text" tabindex= "20"  style= "resize: none; width: 490px; height: 480px; margin-top: 7px;"><?php 
echo $cleaned_content;
?>
</textarea>
  <br />
  <br />

  <label for= "tags" type= "text" style= "margin-right: 1em;"><strong>Tags: </strong></label><br>
  <textarea name= "tags" tabindex= "30" style= "resize: none; width: 490px; height:50px;"><?php 
echo $default_content['tags'];