Esempio n. 1
0
     if ($n > 0 && ($old_order != $item['order'] || $item['order'] > 0 && $n % $item['order'] == 0)) {
         $items[] = '</ul><ul>';
         $old_order = $item['order'];
         $n = 0;
     }
     $replace = array();
     $replace[] = $item['id'];
     $replace[] = $item['name'];
     $replace[] = $item['position'];
     $replace[] = $item['detail'];
     $replace[] = $item['address'];
     $replace[] = $item['phone'];
     $replace[] = $item['email'];
     $replace[] = $item['order'];
     $replace[] = $item['picture'] != '' && is_file(DATA_PATH . "personnel/{$item['picture']}") ? DATA_URL . "personnel/{$item['picture']}" : WEB_URL . '/modules/personnel/img/noicon.jpg';
     $replace[] = gcms::getUrl($index['module'], 0, 0, '', "id={$item['id']}");
     $items[] = preg_replace($patt, $replace, $skin);
     $n++;
 }
 // แสดงผล list รายการ
 $patt = array('/{BREADCRUMS}/', '/{LIST}/', '/{TOPIC}/', '/{DETAIL}/', '/{CATEGORY}/');
 $replace = array();
 $replace[] = implode("\n", $breadcrumbs);
 $replace[] = sizeof($items) == 0 ? '<div class=error>{LNG_LIST_EMPTY}</div>' : '<article>' . implode("\n", $items) . '</ul></article>';
 $replace[] = $index['topic'];
 $replace[] = $index['detail'];
 $replace[] = gcms::getVars($categories, $id, '');
 $content = preg_replace($patt, $replace, gcms::loadtemplate($index['module'], 'personnel', 'main'));
 // title,keywords,description
 $title = $index['topic'];
 $keywords = $index['keywords'];
Esempio n. 2
0
     $data .= '<td class="ex"><span class="d">' . ($days_of_last_month - $weekday + $start) . '</span></td>';
     $start++;
 }
 $weekday++;
 while ($day <= $endday) {
     if ($today == $day && $month == $c_month && $year == $c_year) {
         $c = ' class="current"';
     } elseif ($weekday == 1) {
         $c = ' class="su"';
     } else {
         $c = '';
     }
     $data .= '<td' . $c . '><a class="d">' . $day . '</a><p>';
     if (isset($events[$day])) {
         foreach ($events[$day] as $item) {
             $data .= '<a href="' . gcms::getUrl($item['module'], '', 0, 0, "d={$c_year}-{$c_month}-{$day}") . '" class=cuttext style="background-color:' . $item['color'] . '" title="' . $item['topic'] . '">' . $item['topic'] . '</a>';
         }
     }
     $data .= '</p></td>';
     if ($weekday == 7 && $day != $endday) {
         $calendar[] = $data . '</td>';
         $data = '<tr class="date row">';
         $weekday = 0;
     }
     $day++;
     $weekday++;
 }
 $n = 1;
 while ($weekday <= 7) {
     $data .= '<td class="ex"><span class="d">' . $n . '</span></td>';
     $weekday++;
Esempio n. 3
0
 $widget[] = '<div id=widget_personnel class=widget_personnel>';
 $sql = "SELECT * FROM `" . DB_PERSONNEL . "` WHERE `category_id`='{$match['1']}' AND `module_id`='{$module['id']}' ORDER BY `order`,`id`";
 $saved = $cache->get($sql);
 if (!$saved) {
     $saved = $db->customQuery($sql);
     $cache->save($sql, $saved);
 }
 if (sizeof($saved) > 0) {
     foreach ($saved as $i => $item) {
         $url = gcms::getUrl($module['module'], '', 0, 0, "id={$item['id']}");
         $picture = $item['picture'] != '' && is_file(DATA_PATH . "personnel/{$item['picture']}") ? DATA_URL . "personnel/{$item['picture']}" : WEB_URL . '/modules/personnel/img/noicon.jpg';
         $widget[] = '<div class=' . ($i == 0 ? 'currItem' : 'item') . '>';
         $widget[] = '<a class=thumbnail href="' . $url . '"><img src=' . $picture . ' alt=personnel class=nozoom></a>';
         $widget[] = '<p class=detail>';
         $widget[] = '<a class=name href="' . $url . '">' . $item['name'] . '</a>';
         $widget[] = '<a class=position href="' . gcms::getUrl($module['module'], '', 0, 0, "cat={$item['category_id']}") . '">' . $item['position'] . '</a>';
         $widget[] = '</p>';
         $widget[] = '</div>';
     }
 }
 $widget[] = '</div>';
 // group
 if ($match[3] == 'menu') {
     $widget[] = '<nav class=sidemenu><ul>';
     $sql = "SELECT `category_id`,`topic` FROM `" . DB_CATEGORY . "` WHERE `module_id`='{$module['id']}' ORDER BY `category_id`";
     $saved = $cache->get($sql);
     if (!$saved) {
         $saved = $db->customQuery($sql);
         $cache->save($sql, $saved);
     }
     foreach ($saved as $item) {