Beispiel #1
0
 private static function detail()
 {
     $rsnum = CRUD::dataFetch('gallery', array('id' => self::$id));
     if (!empty($rsnum)) {
         list($row) = CRUD::$data;
         foreach ($row as $field => $var) {
             switch ($field) {
                 case "dirpath":
                     #$images = self::dirLoad($var);
                     #continue;
                     break;
             }
             $output["VALUE_" . strtoupper($field)] = $var;
         }
         IMAGES::load('gallery', $row['id']);
         if (is_array(IMAGES::$data)) {
             foreach (IMAGES::$data as $images) {
                 VIEW::newBlock('TAG_GALLERY_LIST');
                 foreach ($images as $field => $var) {
                     $imgOutput['IMAGE_' . strtoupper($field)] = $var;
                 }
                 VIEW::assign($imgOutput);
             }
         }
         $output['VALUE_BACK_LINK'] = self::dataLink(self::$cate);
         VIEW::assignGlobal($output);
         SEO::load($row["seo_id"]);
         if (empty(SEO::$data["h1"])) {
             SEO::$data["h1"] = $row["subject"];
         }
         SEO::output();
         CRUMBS::fetch('gallery', $row);
         self::other($row['id']);
         MESSAGE::$func = 'gallery';
         MESSAGE::$dataID = $row['id'];
         new MESSAGE();
         VIEW::assignGlobal("TAG_MESSAGE_BLOCK", MESSAGE::$output);
         GALLERY::related($row['related']);
     } else {
         header('location: ' . CORE::$root . 'gallery/');
     }
 }
Beispiel #2
0
 private static function seek($id = false)
 {
     if (empty($_POST['call'])) {
         echo 'NONE';
     }
     $seekStr = $_POST['call'];
     if (!empty($id)) {
         $rsnum = CRUD::dataFetch('gallery', array('id' => $id), array('related'));
         if (!empty($rsnum)) {
             list($nowRow) = CRUD::$data;
             if (!empty($nowRow['related'])) {
                 $relatedArray = json_decode($nowRow['related'], true);
                 $seekFilter = "id NOT IN('" . implode("','", $relatedArray) . "','" . $id . "')";
                 $sk = array('status' => '1', 'langtag' => CORE::$langtag, 'subject' => '%' . $seekStr . '%', 'custom' => $seekFilter);
             } else {
                 $sk = array('status' => '1', 'langtag' => CORE::$langtag, 'subject' => '%' . $seekStr . '%', 'id' => "!{$id}");
             }
         }
     }
     if (empty($sk) || !is_array($sk)) {
         $sk = array('status' => '1', 'langtag' => CORE::$langtag, 'subject' => '%' . $seekStr . '%');
     }
     $rsnum = CRUD::dataFetch('gallery', $sk);
     if (!empty($rsnum)) {
         $dataRow = CRUD::$data;
         foreach ($dataRow as $key => $row) {
             foreach ($row as $field => $var) {
                 $output[$key][$field] = rawurlencode($var);
             }
             IMAGES::load('gallery', $row["id"]);
             list($image) = IMAGES::$data;
             $output[$key]['image'] = '<img src="' . $image['path'] . '" style="width: 100px;">';
             $output[$key]['link'] = GALLERY::dataLink($row['parent'], $row);
         }
         if (is_array($output)) {
             echo json_encode($output);
         }
     } else {
         echo 'NONE';
     }
 }
Beispiel #3
0
 public static function related($related = false)
 {
     if (empty($related)) {
         return false;
     }
     $relatedArray = json_decode($related, true);
     $rsnum = CRUD::dataFetch('gallery', array('id' => $relatedArray, 'status' => '1', 'langtag' => CORE::$langtag));
     if (!empty($rsnum)) {
         VIEW::newBlock("TAG_RELATED_BLOCK");
         $dataRow = CRUD::$data;
         foreach ($dataRow as $key => $row) {
             VIEW::newBlock("TAG_RELATED_LIST");
             IMAGES::load('gallery', $row["id"]);
             list($image) = IMAGES::$data;
             VIEW::assign(array("VALUE_ID" => $row['id'], "VALUE_SUBJECT" => $row['subject'], "VALUE_IMAGE" => $image['path'], "VALUE_ALT" => $image['alt'], "VALUE_TITLE" => $image['title'], "VALUE_LINK" => GALLERY::dataLink($row['parent'], $row)));
         }
     }
 }