示例#1
0
 if (isset($_POST['phconc'])) {
     if ($_POST['phconc'] == true) {
         if (is_array($_POST['concurs']) && count($_POST['concurs']) > 0) {
             $concurs = serialize($_POST['concurs']);
             $i = 0;
             foreach ($_POST['concurs'] as $con) {
                 if (count($con['img']) < 3) {
                     for ($a = 0; $a < count($con['img']); $a++) {
                         if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/img/uploads/news/fb/" . date('Y-m') . "/" . get_ext($con['img'][$a], '/'))) {
                             resizeCopy($_SERVER['DOCUMENT_ROOT'] . str_replace('http://funtime.ge:80', '', generate_unknown($con['img'][$a])), get_ext($con['img'][$a], '/'), 485, $_SERVER['DOCUMENT_ROOT'] . "/img/uploads/news/fb/" . date('Y-m'), false);
                         }
                     }
                 } else {
                     for ($a = 0; $a < count($con['img']); $a++) {
                         if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/img/uploads/news/fb/" . date('Y-m') . "/" . get_ext($con['img'][$a], '/'))) {
                             resizeCopy($_SERVER['DOCUMENT_ROOT'] . str_replace('http://funtime.ge:80', '', generate_unknown($con['img'][$a])), get_ext($con['img'][$a], '/'), 285, $_SERVER['DOCUMENT_ROOT'] . "/img/uploads/news/fb/" . date('Y-m'), 3);
                         }
                     }
                 }
                 $i++;
             }
             $check_concurs = $DB->getOne("SELECT id FROM #__news_gallery_com WHERE news_id=" . intval($_GET['edit']));
             if ($check_concurs > 0) {
                 $DB->execute("UPDATE #__news_gallery_com SET gallery='{$concurs}',updated_at='" . date('Y-m-d H:i:s') . "' WHERE news_id=" . intval($_GET['edit']));
             } else {
                 $DB->execute("INSERT INTO #__news_gallery_com (news_id,gallery,date,updated_at) VALUES ('" . intval($_GET['edit']) . "','" . $concurs . "','" . date('Y-m-d H:i:s') . "','" . date('Y-m-d H:i:s') . "')");
             }
         } else {
             $concurs = "";
             $check_concurs = $DB->getOne("SELECT id FROM #__news_gallery_com WHERE news_id=" . intval($_GET['edit']));
             if ($check_concurs > 0) {
示例#2
0
            }
            ?>
                <li <?php 
            echo $style;
            ?>
>
                    <?php 
            if ($_GET['new_slider'] > 0 or $registry['post'][0]['slide_type'] == '0') {
                if (!file_exists($_SERVER['DOCUMENT_ROOT'] . "/img/uploads/news/fb/" . date('Y-m', strtotime($registry['post'][0]['time'])) . "/" . $registry['post'][0]['id'] . '_' . get_ext($registry['slider']['img'][$i], '/'))) {
                    $image_info = getimagesize($_SERVER['DOCUMENT_ROOT'] . str_replace('http://funtime.ge:80', '', generate_unknown($registry['slider']['img'][$i])));
                    if ($image_info[0] > $image_info[1]) {
                        $iwidth = 485;
                    } else {
                        $iwidth = 285;
                    }
                    resizeCopy($_SERVER['DOCUMENT_ROOT'] . str_replace('http://funtime.ge:80', '', generate_unknown($registry['slider']['img'][$i])), $registry['post'][0]['id'] . '_' . get_ext($registry['slider']['img'][$i], '/'), $iwidth, $_SERVER['DOCUMENT_ROOT'] . "/img/uploads/news/fb/" . date('Y-m', strtotime($registry['post'][0]['time'])), false);
                }
                //print_r();
                ?>
                        <span><?php 
                echo $registry['slider']['name'][$i];
                ?>
</span>

                    <?php 
            }
            ?>
                    <div style="position:relative; margin-top:10px;">
                        <?php 
            if ($_GET['new_slider'] > 0 or $registry['post'][0]['slide_type'] == '0') {
                ?>