예제 #1
0
function recent_tags($number_to_get, $cookie)
{
    $tags_blog = recent_blog_posts($number_to_get, $cookie);
    //this while loop will go through each item in the array...
    while ($array = mysql_fetch_array($tags_blog)) {
        $temp_array = ", " . $array['tags'];
        $new_array = explode(", ", $temp_array);
        $tags_array = array_merge((array) $tags_array, (array) $new_array);
    }
    //the loop finishes here...$tags_array will be used from here on out...
    $counted_array = array_count_values($tags_array);
    arsort($counted_array, SORT_NUMERIC);
    $count_blogs = count($counted_array);
    $number_blogs = 1;
    //begin building the $output to be echoed to the browser
    $output = "<p class = \"popular\">\n";
    foreach ($counted_array as $key => $val) {
        if ($number_blogs != 1) {
            //this will create the link and the text and the frequency
            //we'll test the string lenth to determine if it should break or not
            if (strlen($key) < 15) {
                $output .= "<span class= \"recent_tags\">";
            } else {
                $output .= "<span>";
            }
            $output .= "&bull;&nbsp;<a href = \"blog_search.php?tag=" . urlencode($key) . "\">" . $key . "-" . $val . "</a></span>\n";
            //this if function can add something between the tags...
            if ($count_blogs != $number_blogs) {
                $output .= "&nbsp; ";
            }
        }
        $number_blogs++;
    }
    $output .= "</p>\n";
    $output .= "<hr />\n";
    return $output;
}
예제 #2
0
    echo "<br /><br />\n<a href= \"logout.php\">&bull;&nbsp;&nbsp;Logout</a>\n";
}
?>
  </div>

<?php 
//this loop will go through and pick out each array the subjects
while ($subject = mysql_fetch_array($subject_set)) {
    //if subject['id'] DOES NOT EQUAL 4 then it will just echo an <h2> tag w/ link to that default page...
    if ($subject['id'] != 4) {
        echo "<div>\n<h2><a href = \"../" . $subject['link'] . "?index=" . $subject['id'] . "\" title= \"" . $subject['title'] . "\">" . $subject['title'] . "</a></h2>\n<hr />\n</div>\n\n";
    } else {
        echo "<div class= \"strong\">\n<h2><a  href = \"index.php\" title= \"blog\" > Blog </a></h2>\n";
        echo $msg;
        echo "</div>\n\n";
        echo "<h3>Recent Posts</h3>\n";
        echo "<div class=\"side\">\n";
        $archive_blogs = recent_blog_posts(10, $_COOKIE['friendly']);
        while ($archive = mysql_fetch_array($archive_blogs)) {
            echo '<p><a href="ind_blog.php?page=' . $archive['id'] . '">' . $archive['page_name'] . "</a></p>\n";
            echo author_date($archive['date'], $archive['author']);
        }
        echo "</div>\n<hr />\n\n";
        echo "<p><strong>Recent Blog Tags: </strong></p>\n";
        echo recent_tags(20, $_COOKIE['friendly']);
    }
}
?>
  <br /><a href= "archive.php">ARCHIVE</a><br /><br />
</nav>
예제 #3
0
}
?>
 </h1>
</div>

<div class="section">

<ul id="MenuBar1" class="MenuBarHorizontal">
<?php 
//this loop will go through and pick out each array the subjects
while ($subject = mysql_fetch_array($subject_set)) {
    echo "<li><a class=\"MenuBarItemSubmenu\" href=\"" . $subject['link'] . "?index=" . $subject['id'] . "\">" . $subject["title"] . "</a>\n";
    if ($subject['id'] != 4) {
        $page_set = get_all_pages($subject_set['id']);
    } else {
        $page_set = recent_blog_posts(3, $_COOKIE['friendly']);
    }
    //this second loop will get all of the corresponding sub-pages...
    echo "<ul>\n";
    while ($page = mysql_fetch_array($page_set)) {
        if ($page['subject_id'] == $subject['id'] && $page['has_link'] == 1) {
            echo "<li><a href =\"" . $subject['link'] . "?index=" . $subject['id'] . "&page=" . $page['id'] . "\">" . $page['page_name'] . "</a></li>\n";
        }
    }
    echo "</ul>\n</li>\n";
}
?>
</ul>

<div> <?php 
echo $sel_content;
예제 #4
0
require_once '../_includes/functions.php';
require_once '_includes/blog_functions.php';
require_once '_includes/session.php';
$url = 'index.php';
if (isset($_GET['page'])) {
    $url .= '?page=' . $_GET['page'];
}
//decided if someone is friendly
is_friendly($_GET['friendly'], $_SESSION['user_name'], $_COOKIE['friendly'], $url);
//this function will obtain the page info if  a sub page is selected
//use the array function $blogs to pull out specific info
if (isset($_GET['page'])) {
    redirect_to('ind_blog.php?page=' . $_GET['page']);
} else {
    $blogs = NULL;
    $sel_blog = recent_blog_posts(3, $_COOKIE['friendly']);
}
$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 
echo $header_blog2;
?>

<body>
<header>
예제 #5
0
</header>

<section>
<aside>
<?php 
if (isset($_GET['page'])) {
    include '_includes/edit_form.php';
}
?>

<h3>Choose a post to edit:</h3>
<form name= "edit" method="post">
<select name = "id" style= "margin-left: 10px;">
  <?php 
//this php block will add in the drop down selection for other posts to be edited...
$selection = recent_blog_posts(12, $_COOKIE['friendly'], 1);
while ($option = mysql_fetch_array($selection)) {
    echo '<option type= "int" value = ' . $option['id'] . '>';
    echo $option['page_name'];
    if ($option['draft'] == 1) {
        echo " - draft";
    }
    echo "</option>";
}
?>
</select>

<br />
<input type="submit" name= "edit_selection" value= "Edit Selected Post" style= "width: 250px; display: block; margin-left: 10px; margin-top:10px ; font-weight: bold;"/>
</form>
<br />