Beispiel #1
0
include_once 'includes/auth.php';
include_once 'includes/header.php';
include_once './posts/showPosts.php';
include_once './users/myInfoBlock.php';
?>

<?php 
echo viewInfoBlock();
?>


<div class="addPost">
    <h3>Add Post:</h3>
    <form role="form" method="POST" action="posts/addShowPosts.php" class="formPost">
        <div class="form-group">
            <textarea class="form-control" rows="5" id="about" name="userPostText">
            </textarea>
        </div>
        <button type="button" class="btn btn-default" id="postSend">Send Post</button>
        <img src="img/ajax-loader.gif" alt="loading..." class="loading" id="loader"/>
    </form>
</div>

<div class="postContainer">
    <h3>My Posts:</h3>
    <?php 
echo showPosts($dbCon);
?>
</div>
<?php 
include_once './includes/footer.php';
Beispiel #2
0
        saveEdited(0);
        break;
    case 'saveedit':
    case 'publishedit':
        saveEdited(1);
        break;
    case 'delete':
        deletePost();
        break;
    case 'trackbacks':
        include 'trackbacks.php';
        break;
    case 'waiting':
        showPosts(0);
        break;
    case 'approved':
        showPosts(1);
        break;
    case 'status-waiting':
        set_posts_status('waiting');
        break;
    case 'status-draft':
        set_posts_status('draft');
        break;
    case 'status-published':
        set_posts_status('publish');
        break;
    default:
        showPosts();
        break;
}
            $users = !empty($_POST['users']) ? getArrayFromList($_POST['users']) : array();
            # Get the period
            $period = !empty($_POST['period']) ? trim($_POST['period']) : '';
            # Order by most popular
            $popular = !empty($_POST['popular']) ? true : false;
            $post_status = !empty($_POST['post_status']) ? 2 : 1;
            # On recupere les informtions sur les membres
            $sql = generate_SQL($num_start, $nb_items, $users, $tags, $search_value, $period, $popular, null, $post_status);
            //print $sql;
            //exit;
            $rs = $core->con->select($sql);
            $tpl = new Hyla_Tpl(dirname(__FILE__) . '/../themes/' . $blog_settings->get('planet_theme') . '/');
            $tpl->importFile('index', 'index.tpl');
            $tpl->render('menu.filter');
            # Liste des articles
            $tpl = showPosts($rs, $tpl, $search_value, true, $popular);
            $result = array("posts" => $tpl->render('content.posts'), "nb_items" => $nb_items, "page" => $page, "users" => $users, "tags" => $tags, "search" => $search_value);
            #		print json_encode($result);
            print $result['posts'];
            break;
            ##########################################################
            # DEFAULT RETURN
            ##########################################################
        ##########################################################
        # DEFAULT RETURN
        ##########################################################
        default:
            print '<div class="flash_error">' . T_('User bad call') . '</div>';
            break;
    }
} else {