示例#1
0
" pubdate>Enviada em: <?php 
echo date('d/m/Y H:i', strtotime($post_date));
?>
Hs</time>
                </hgroup>
            </header>


            <!--CONTEUDO-->
            <div class="htmlchars">
                <?php 
echo $post_content;
?>
                <!--GALERIA-->
                <?php 
$ReadGb = new WsPostsGallery();
$ReadGb->setPost_id($post_id);
$ReadGb->Execute()->Query("#post_id# ORDER BY gallery_date DESC");
if ($ReadGb->Execute()->getResult()) {
    ?>
                    <section class="gallery">
                        <hgroup>
                            <h3>
                                GALERIA:
                                <p> <small>Veja fotos em:</small> <?php 
    echo $post_title;
    ?>
</p>
                            </h3>
                        </hgroup>
 private function setGallery($result, $gbFiles)
 {
     $ImageName = $result->post_name;
     $gbSend = new Upload();
     $i = 0;
     $u = 0;
     foreach ($gbFiles as $gbUploads) {
         $ImgName = "{$ImageName}-gb-{$this->Post}-" . substr(md5(time() + $i), 0, 5);
         $gbSend->Image($gbUploads, $ImgName);
         if ($gbSend->getResult()) {
             $gbImage = $gbSend->getResult();
             $gbCreate = new WsPostsGallery();
             $gbCreate->setPost_id($this->Post);
             $gbCreate->setGallery_image($gbImage);
             $gbCreate->setGallery_date(date("Y/m/d H:i:s"));
             $gbCreate->Execute()->insert();
             $u++;
         }
         $i++;
     }
     $this->GalleryMessage($u);
 }
$Read = new WsPosts();
$Read->setPost_category($cat);
$Read->Execute()->Query("post_status = 1 AND (post_category = :cat OR post_cat_parent = :cat) ORDER BY post_date LIMIT 3", "cat={$cat}", true);
if (!$Read->Execute()->getResult()) {
    WSErro("Opps! Não temos artigos em destaques!", WS_INFOR);
} else {
    ?>
    <div class="row">
        <div class="col-md-8">
            <div id="carousel" data-interval="4000" class="carousel slide well" data-ride="carousel">
                <div class="carousel-inner" >
                    <?php 
    $View = new View();
    $siderbar = $View->Load("carousel_full");
    foreach ($Read->Execute()->getResult() as $bar) {
        $gallery = new WsPostsGallery();
        $gallery->setPost_id($bar->post_id);
        $gallery->Execute()->Query("#post_id#");
        foreach ($gallery->Execute()->getResult() as $gal) {
            $gal->post_title = $bar->post_title;
            $gal->datetime = date('Y-m-d', strtotime($bar->post_date));
            $gal->pubdate = date("d/m/Y H:i", strtotime($bar->post_date));
            $gal->post_content = Check::Words($bar->post_content, 30);
            $gal->class = $c == 0 ? "item active" : "item";
            if (!$bar->post_url) {
                $gal->post_url = "#HOME#/artigo/{$bar->post_name}";
            } else {
                $gal->post_url = $bar->post_url;
            }
            $View->Show((array) $gal, $siderbar);
            $c++;
示例#4
0
                    <input type="file" multiple name="gallery_covers[]" />
                </label>

                <?php 
$delGb = filter_input(INPUT_GET, 'gbdel', FILTER_VALIDATE_INT);
if ($delGb) {
    require_once '_models/AdminPost.class.php';
    $DellGallery = new AdminPost();
    $DellGallery->gbRemove($delGb);
    WSErro($DellGallery->getError()[0], $DellGallery->getError()[1]);
}
?>
                <ul class="gallery">
                    <?php 
$gbi = 0;
$Gallery = new WsPostsGallery();
$Gallery->setPost_id($postid);
$Gallery->Execute()->Query("#post_id#");
if ($Gallery->Execute()->getResult()) {
    foreach ($Gallery->Execute()->getResult() as $gb) {
        $gbi++;
        ?>
                            <li<?php 
        if ($gbi % 5 == 0) {
            echo ' class="right"';
        }
        ?>
>
                                <div class="img thumb_small">
                                    <?php 
        echo Check::Image('../uploads/' . $gb->gallery_image, $gbi, 146, 100);
                    <input type="file" multiple name="gallery_covers[]" />
                </label>

                <?php 
$delGb = filter_input(INPUT_GET, 'gbdel', FILTER_VALIDATE_INT);
if ($delGb) {
    require_once '_models/AdminPost.class.php';
    $DellGallery = new AdminPost();
    $DellGallery->gbRemove($delGb);
    WSErro($DellGallery->getError()[0], $DellGallery->getError()[1]);
}
?>
                <ul class="gallery">
                    <?php 
$gbi = 0;
$Gallery = new WsPostsGallery();
$Gallery->setPost_id($postid);
$Gallery->Query("WHERE #post_id#");
if ($Gallery->getResult()) {
    foreach ($Gallery->getResult() as $gb) {
        $gbi++;
        ?>
                            <li<?php 
        if ($gbi % 5 == 0) {
            echo ' class="right"';
        }
        ?>
>
                                <div class="img thumb_small">
                                    <?php 
        echo Check::Image('../uploads/' . $gb->gallery_image, $gbi, 146, 100);