Example #1
0
<?php

$cid = isset($_POST['cid']) ? $_POST['cid'] : 0;
print select_course('cid', $cid);
print '<div id="admin_post_section">';
print list_posts($cid, 10, 1);
print '</div>';
?>
<script type="text/javascript">
$("select#cid").change(function(){
	$("#admin_post_section").load("triggers/admin_post.php",{cid:$(this).val(),count:10,page:1});
});
</script>
Example #2
0
// turn off error reporting for production environments
error_reporting(0);
include 'config.php';
include 'inc/functions.php';
// prepare menu
if (!isset($_GET['page'])) {
    $_GET['page'] = 'home';
}
if (count($cfg['pages']) > 0) {
    $pages = 1;
} else {
    $pages = 0;
}
// pagination
$posts = list_posts($cfg);
$start = isset($_GET['start']) && !empty($_GET['start']) ? $_GET['start'] : 0;
// Where do we start?
$length = isset($_GET['length']) && !empty($_GET['length']) ? $_GET['length'] : $cfg['per_page'];
// How many per page?
$max = $posts->get_item_quantity();
// Where do we end?
$next = (int) $start + (int) $length;
$prev = (int) $start - (int) $length;
// Create the NEXT link
$nextlink = '<a href="?start=' . $next . '&length=' . $length . '">Next &raquo;</a>';
if ($next > $max) {
    $nextlink = 'Next &raquo;';
}
// Create the PREVIOUS link
$prevlink = '<a href="?start=' . $prev . '&length=' . $length . '">&laquo; Previous</a>';
Example #3
0
<?php

//List posts by courses
require_once '../includes/functions.inc.php';
require_once '../includes/admin.inc.php';
$cid = isset($_POST['cid']) ? $_POST['cid'] : 0;
$count = isset($_POST['count']) ? $_POST['count'] : 10;
$page = isset($_POST['page']) ? $_POST['page'] : 1;
print list_posts($cid, $count, $page);
?>
<script type="text/javascript">
$("a.button.disabled").click(function(){
	openLogin();
});
$('#admin_post_section [title]').qtip({
	style: {
		padding: 7,
		background: '#404041',
		color: 'white',
		fontSize: '10px',
		textAlign: 'center',
		border: {
			width: 2,
			color: 'white'
		},
		tip: 'topLeft',
		name: 'dark' // Inherit the rest of the attributes from the preset dark style
	},
	position: {
		corner: {
		target: 'bottomMiddle',
// Load the header content
if(cache_start('header')){

} else {
	include('template/header.php');
	cache_stop();
}
// Get requested blog post, or if none specified get homepage (post_id===0)
$post_id = intval($_GET['post_id']);
$cat_id = intval($_GET['cat_id']);
$cache_id = ($post_id? 'page'. $post_id: ($cat_id? 'category'.$cat_id:'homepage'));

if(!cache_start($cache_id))
{
	if($post_id) {
		load_post($post_id);
	} 
	else {
		list_posts(intval($_GET['cat_id']));
	}
	cache_stop();
}
else {
//	echo "CACHED";
}
if(!cache_start('footer')){
	// Load the footer content 
	include('template/footer.php');
	cache_stop();
}
?>
Example #5
0
<?php

// allposts.php
require_once "lib/errormanagement.php";
require_once "lib/postdisplay.php";
// TODO: add meta information
require_once "header.php";
printHeader("Add post", "Keywords", "Description", "allposts");
?>

<h2>All Posts</h2>

<?php 
list_posts();
require_once "footer.php";
function new_homepage()
{
    global $featured;
    ?>
    <div id="content" class="home-content">

        <h2><?php 
    echo bloginfo('title');
    ?>
</h2>
        <p class="tagline"><?php 
    echo bloginfo('description');
    ?>
</p>
        <?php 
    echo show_categories();
    ?>

        <?php 
    echo featured_series(smarter_slug($featured), $featured->slug);
    ?>

        <h2>Read more posts</h2>
        <?php 
    echo list_posts('latest');
    ?>

        <?php 
    if (function_exists('wpp_get_mostpopular')) {
        wpp_get_mostpopular("range=monthly&limit=10&post_type=post");
    }
    ?>

    </div>
<?php 
}
          
        </div>
      
        <div id="homepage-sidebar" class="span3">
            <div class="sidebar-wrapper">
      
          <div class="row-fluid email-sign-up">
            <div class="span12">
             <img src="<?php 
echo get_template_directory_uri();
?>
/images/vv-signup-header_07.png" alt="Sign Up for Email Alerts" />
              <form id="email-signup">
                <input id="email" name="email" class="span8" type="text" placeholder="">
                <button class="btn span3" type="submit">Submit</button>
             </form>
            </div>
          </div>
      
          <h2><a href="http://thevotingnews.com/">The Voting News</a></h2>
      <?php 
list_posts('the_voting_news', 3);
?>
 
          <h2><a href="http://thevotingnews.com/">Verified Voting Blog</a></h2>
      <?php 
list_posts('verified_voting_blog', 3);
?>
      </div>
<?php 
get_footer();