function list_tad_gallery($csn = "", $show_function = 1) { global $xoopsDB, $xoopsModule, $xoopsModuleConfig, $xoopsTpl; $tadgallery = new tadgallery(); $xoopsTpl->assign("jquery", get_jquery(true)); $xoopsTpl->assign("csn", $csn); if (isset($_SESSION['gallery_list_mode']) and $_SESSION['gallery_list_mode'] == "good") { $mode_select = "<a href='main.php?op=chg_mode&mode=normal#gallery_top' class='btn btn-warning'>" . _MA_TADGAL_LIST_NORMAL . "</a>"; $tadgallery->set_view_good(true); $cate_options = $cate_option = $link_to_cate = ""; } else { $mode_select = "<a href='main.php?op=chg_mode&mode=good#gallery_top' class='btn btn-warning'>" . _MA_TADGAL_LIST_GOOD . "</a>"; $tadgallery->set_view_good(false); $tadgallery->set_view_csn($csn); list_tad_gallery_cate_tree($csn); $cate = tadgallery::get_tad_gallery_cate($csn); $link_to_cate = !empty($csn) ? "<a href='../index.php?csn={$csn}' class='btn btn-info'>" . sprintf(_MA_TADGAL_LINK_TO_CATE, $cate['title']) . "</a>" : ""; } $tag_select = tag_select("", "add_tag"); $xoopsTpl->assign("cate_option", $cate_option); $xoopsTpl->assign("mode_select", $mode_select); $xoopsTpl->assign("link_to_cate", $link_to_cate); $xoopsTpl->assign("option", $cate_options); $xoopsTpl->assign("tag_select", $tag_select); $tadgallery->set_admin_mode(true); $tadgallery->get_photos(); }
function tad_cal_full_calendar($options) { global $xoopsUser, $xoopsTpl; $modhandler = xoops_gethandler('module'); $xoopsModule =& $modhandler->getByDirname("tad_cal"); $config_handler = xoops_gethandler('config'); $module_id = $xoopsModule->getVar('mid'); $xoopsModuleConfig =& $config_handler->getConfigsByCat(0, $module_id); if ($xoopsUser) { $isAdmin = $xoopsUser->isAdmin($module_id); } else { $isAdmin = false; } //引入TadTools的函式庫 if (!file_exists(XOOPS_ROOT_PATH . "/modules/tadtools/tad_function.php")) { redirect_header("http://www.tad0616.net/modules/tad_uploader/index.php?of_cat_sn=50", 3, _TAD_NEED_TADTOOLS); } include_once XOOPS_ROOT_PATH . "/modules/tadtools/tad_function.php"; include_once XOOPS_ROOT_PATH . "/modules/tad_cal/function_block.php"; $jquery_path = get_jquery(true); //一般只要此行即可 $block['jquery_path'] = $jquery_path; if (empty($xoopsModuleConfig['eventShowMode'])) { $xoopsModuleConfig['eventShowMode'] = 'eventClick'; } if (empty($xoopsModuleConfig['eventTheme'])) { $xoopsModuleConfig['eventTheme'] = 'ui-tooltip-blue'; } $style = make_style(); if (empty($cate_sn)) { $cate_sn = 0; } $eventDrop = $del_js = ""; if ($xoopsUser) { //先抓分類下拉選單 $get_tad_cal_cate_menu_options = get_tad_cal_cate_menu_options($cate_sn); if ($isAdmin) { if (empty($get_tad_cal_cate_menu_options)) { $cate = _MB_TADCAL_NEW_CATE . _TAD_FOR . "<input name='new_cate_title' id='new_cate_title' value='" . _MB_TADCAL_NEW_CALENDAR . "'>"; } else { $cate = _MB_TADCAL_CATE_SN . _TAD_FOR . "<select name='cate_sn' id='cate_sn' size=1 >{$get_tad_cal_cate_menu_options}</select>"; } //快速新增功能 $eventAdd = "selectable: true,\n selectHelper: true,\n select: function(start, end, allDay) {\n var promptBox = \"" . _MB_TADCAL_TITLE . _TAD_FOR . "<input type='text' id='eventTitle' name='eventTitle' value='' /><br>{$cate}\";\n\n function mycallbackform(v,m,f){\n if(v != undefined){\n calendar.fullCalendar('renderEvent',\n {\n title: f.eventTitle,\n start: start,\n end: end,\n allDay: allDay\n },\n false // make the event 'stick'\n );\n \$.post('" . XOOPS_URL . "/modules/tad_cal/event.php', {op: 'insert_tad_cal_event', fc_start: start.getTime(), fc_end: end.getTime(), title: f.eventTitle, cate_sn: f.cate_sn, new_cate_title: f.new_cate_title},function(){\n calendar.fullCalendar('refetchEvents');\n });\n }\n }\n\n function mysubmitfunc(v,m,f){\n an = m.children('#eventTitle');\n\n if(f.eventTitle == ''){\n an.css('border','solid #ff0000 1px');\n return false;\n }\n return true;\n }\n\n \$.prompt(promptBox,{\n callback: mycallbackform,\n submit: mysubmitfunc,\n zIndex: 99999,\n buttons: { Ok:true }\n });\n \$('#eventTitle').focus();\n\n \$('#eventTitle').keypress(function(event) {\n if (event.keyCode == '13') {\n \$('#jqi_state0_buttonOk').click();\n }\n });\n calendar.fullCalendar('unselect');\n },\n "; //拖曳搬移功能 $eventDrop = "editable:true,\n eventDrop: function(event,dayDelta,minuteDelta,allDay,revertFunc) {\n var startTime=event.start.getTime();\n \$.post('event.php', {op: 'ajax_update_date', dayDelta: dayDelta , minuteDelta: minuteDelta , sn: event.id },function(data){\n alert(data);\n });\n },\n "; } } $block['eventDrop'] = $eventDrop; $block['eventAdd'] = $eventAdd; $block['style_css'] = $style['css']; $block['cate_sn'] = $cate_sn; $block['eventShowMode'] = $xoopsModuleConfig['eventShowMode']; $block['eventTheme'] = $xoopsModuleConfig['eventTheme']; $block['style_mark'] = $style['mark']; $block['my_counter'] = my_counter(); $block['firstDay'] = $xoopsModuleConfig['cal_start']; return $block; }
function tadgallery_scroller_show($options) { global $xoopsDB, $xoTheme; // $default_val="12||1|photo_sort||m|0|100%|240|jscroller2_up|40"; $order_array = array('post_date', 'counter', 'rand', 'photo_sort'); $limit = empty($options[0]) ? 12 : intval($options[0]); $view_csn = empty($options[1]) ? '' : intval($options[1]); $include_sub = empty($options[2]) ? "0" : "1"; $order_by = in_array($options[3], $order_array) ? $options[3] : "post_date"; $desc = empty($options[4]) ? "" : "desc"; $size = (!empty($options[5]) and $options[5] == "s") ? "s" : "m"; $only_good = $options[6] != '1' ? "0" : "1"; $options[7] = intval($options[7]); $width = empty($options[7]) ? '100%' : $options[7]; $options[8] = intval($options[8]); $height = empty($options[8]) ? 240 : $options[8]; $direction = $options[9] == 'jscroller2_down' ? "jscroller2_down" : "jscroller2_up"; $options[10] = isset($options[10]) ? intval($options[10]) : 40; $speed = empty($options[10]) ? 40 : $options[10]; $tadgallery = new tadgallery(); $tadgallery->set_limit($limit); if ($view_csn) { $tadgallery->set_view_csn($view_csn); } $tadgallery->set_orderby($order_by); $tadgallery->set_order_desc($desc); $tadgallery->set_view_good($only_good); $photos = $tadgallery->get_photos('return', $include_sub); $pics = ""; $i = 0; foreach ($photos as $photo) { $pp = 'photo_' . $size; $pic_url = $photo[$pp]; $title = empty($photo['title']) ? $photo['filename'] : $photo['title']; $pics[$i]['pic_url'] = $pic_url; $pics[$i]['photo_sn'] = $photo['sn']; $pics[$i]['photo_title'] = $title; $pics[$i]['description'] = empty($photo['description']) ? "" : "<div style='padding:4px;background-color:#F0FFA0;font-size:11px;text-align:left;'>{$photo['description']}</div>"; $i++; } $block['height'] = $height; $block['direction'] = $direction; $block['speed'] = $speed; $block['pics'] = $pics; get_jquery(); $xoTheme->addScript('modules/tadgallery/class/jscroller.js'); $xoTheme->addScript('', null, "\n (function(\$){\n \$(document).ready(function(){\n var width=\$('#scroller_container{$view_csn}_w').width();\n \$('#scroller_container{$view_csn}').css('width',width+'px');\n });\n })(jQuery);\n "); return $block; }
function tadgallery_shuffle_show($options) { global $xoopsDB, $xoTheme; // $default_val="12||1|photo_sort||m|0|200|160"; $order_array = array('post_date', 'counter', 'rand', 'photo_sort'); $limit = empty($options[0]) ? 12 : intval($options[0]); $view_csn = empty($options[1]) ? '' : intval($options[1]); $include_sub = empty($options[2]) ? "0" : "1"; $order_by = in_array($options[3], $order_array) ? $options[3] : "post_date"; $desc = empty($options[4]) ? "" : "desc"; $size = (!empty($options[5]) and $options[5] == "s") ? "s" : "m"; $only_good = $options[6] != '1' ? "0" : "1"; $options[7] = intval($options[7]); $width = empty($options[7]) ? 200 : $options[7]; $options[8] = intval($options[8]); $height = empty($options[8]) ? 160 : $options[8]; $tadgallery = new tadgallery(); $tadgallery->set_limit($limit); if ($view_csn) { $tadgallery->set_view_csn($view_csn); } $tadgallery->set_orderby($order_by); $tadgallery->set_order_desc($desc); $tadgallery->set_view_good($only_good); $photos = $tadgallery->get_photos('return', $include_sub); $pics = ""; $i = 0; foreach ($photos as $photo) { $pp = 'photo_' . $size; $pic_url = $photo[$pp]; $pics[$i]['width'] = $width; $pics[$i]['height'] = $height; $pics[$i]['pic_url'] = $pic_url; $pics[$i]['photo_sn'] = $photo['sn']; $pics[$i]['photo_title'] = $photo['title']; $i++; } $block['view_csn'] = $view_csn; $block['width'] = $width; $block['height'] = $height; $block['pics'] = $pics; get_jquery(); $xoTheme->addScript('modules/tadgallery/class/jqshuffle.js'); $xoTheme->addScript('', null, "\n (function(\$){\n \$(document).ready(function(){\n \$('.imageBox{$view_csn}').jqShuffle();\n });\n })(jQuery);\n "); return $block; }
function tadgallery_marquee_show($options) { global $xoopsDB; // $default_val="12|0|1|post_date||m|0|100%|150|80"; $order_array = array('post_date', 'counter', 'rand', 'photo_sort'); $limit = empty($options[0]) ? 12 : intval($options[0]); $view_csn = empty($options[1]) ? '' : intval($options[1]); $include_sub = empty($options[2]) ? "0" : "1"; $order_by = in_array($options[3], $order_array) ? $options[3] : "post_date"; $desc = empty($options[4]) ? "" : "desc"; $size = (!empty($options[5]) and $options[5] == "s") ? "s" : "m"; $only_good = $options[6] != '1' ? "0" : "1"; $options[7] = intval($options[7]); $width = empty($options[7]) ? '100%' : $options[7]; $options[8] = intval($options[8]); $height = (empty($options[8]) or $options[8] <= 30) ? 240 : $options[8]; $options[9] = intval($options[9]); $speed = empty($options[9]) ? 30 : $options[9]; $tadgallery = new tadgallery(); $tadgallery->set_limit($limit); if ($view_csn) { $tadgallery->set_view_csn($view_csn); } $tadgallery->set_orderby($order_by); $tadgallery->set_order_desc($desc); $tadgallery->set_view_good($only_good); $photos = $tadgallery->get_photos('return', $include_sub); $pics = ""; $i = 0; foreach ($photos as $photo) { $pp = 'photo_' . $size; $pic_url = $photo[$pp]; $title = empty($photo['title']) ? $photo['filename'] : $photo['title']; $pics[$i]['pic_url'] = $pic_url; $pics[$i]['photo_sn'] = $photo['sn']; $pics[$i]['photo_title'] = $title; //$pics[$i]['description']=(empty($photo['description']))?"":"<div style='padding:4px;background-color:#F0FFA0;font-size:11px;text-align:left;'>{$photo['description']}</div>"; $i++; } $block['width'] = $width; $block['height'] = $height; $block['speed'] = $speed; $block['pics'] = $pics; get_jquery(); return $block; }
function tad_cal_calendar($options) { //引入TadTools的函式庫 if (!file_exists(XOOPS_ROOT_PATH . "/modules/tadtools/tad_function.php")) { redirect_header("http://www.tad0616.net/modules/tad_uploader/index.php?of_cat_sn=50", 3, _TAD_NEED_TADTOOLS); } include_once XOOPS_ROOT_PATH . "/modules/tadtools/tad_function.php"; $modhandler = xoops_gethandler('module'); $xoopsModule =& $modhandler->getByDirname("tad_cal"); $config_handler = xoops_gethandler('config'); $module_id = $xoopsModule->getVar('mid'); $xoopsModuleConfig =& $config_handler->getConfigsByCat(0, $module_id); $jquery_path = get_jquery(true); //一般只要此行即可 $block['jquery_path'] = $jquery_path; $block['firstDay'] = $xoopsModuleConfig['cal_start']; return $block; }
function tadgallery_show($options) { global $xoopsDB, $xoTheme; // $default_val="12||1|photo_sort||m|0|100%|240"; $order_array = array('post_date', 'counter', 'rand', 'photo_sort'); $limit = empty($options[0]) ? 12 : intval($options[0]); $view_csn = empty($options[1]) ? '' : intval($options[1]); $include_sub = empty($options[2]) ? "0" : "1"; $order_by = in_array($options[3], $order_array) ? $options[3] : "post_date"; $desc = empty($options[4]) ? "" : "desc"; $size = (!empty($options[5]) and $options[5] == "s") ? "s" : "m"; $only_good = $options[6] != '1' ? "0" : "1"; $options[7] = intval($options[7]); $width = empty($options[7]) ? '100%' : $options[7]; $options[8] = intval($options[8]); $block_height = empty($options[8]) ? 240 : $options[8]; $tadgallery = new tadgallery(); $tadgallery->set_limit($limit); if ($view_csn) { $tadgallery->set_view_csn($view_csn); } $tadgallery->set_orderby($order_by); $tadgallery->set_order_desc($desc); $tadgallery->set_view_good($only_good); $photos = $tadgallery->get_photos('return', $include_sub); $pics = ""; $i = 0; foreach ($photos as $photo) { $pp = 'photo_' . $size; $pic_url = $photo[$pp]; $pics[$i]['width'] = $width; $pics[$i]['height'] = $height; $pics[$i]['pic_url'] = $pic_url; $pics[$i]['photo_sn'] = $photo['sn']; $pics[$i]['photo_title'] = $photo['title']; $i++; } $block['view_csn'] = $view_csn; $block['pics'] = $pics; get_jquery(); $xoTheme->addScript('modules/tadgallery/class/jquery.animated.innerfade/js/jquery.animated.innerfade.js'); $xoTheme->addScript('', null, "\n (function(\$){\n \$(document).ready(function(){\n \$('ul#animated-portfolio-block{$view_csn}').animatedinnerfade({\n speed: 1000,\n timeout: 5000,\n type: 'random',\n containerwidth: '100%',\n containerheight: '{$block_height}px',\n animationSpeed: 5000,\n animationtype: 'fade',\n bgFrame: 'none',\n controlBox: 'auto',\n controlBoxClass: 'none',\n controlButtonsPath: '" . XOOPS_URL . "/modules/tadgallery/class/jquery.animated.innerfade/img',\n displayTitle: 'none'\n });\n });\n })(jQuery);\n "); return $block; }
function uploads_tabs() { global $xoopsTpl, $xoopsModuleConfig; get_jquery(true); $now = time(); $to_batch_upload = ""; if (isset($_REQUEST['op']) and $_REQUEST['op'] == 'to_batch_upload') { $to_batch_upload = '{ active: 3 }'; } $jquery_ui = ' <script type="text/javascript"> $(document).ready(function() { $("#jquery_tabs_tg_' . $now . '").tabs(' . $to_batch_upload . '); }); </script>'; $csn = isset($_SESSION['tad_gallery_csn']) ? intval($_SESSION['tad_gallery_csn']) : ""; $xoopsTpl->assign("xoops_module_header", $jquery_ui); $xoopsTpl->assign('now', $now); $xoopsTpl->assign('tad_gallery_form', tad_gallery_form()); }
function list_all_web($defCateID = '') { global $xoopsDB, $xoopsTpl; if (!is_dir(XOOPS_ROOT_PATH . "/themes/for_tad_web_theme")) { $xoopsTpl->assign('op', 'need_tad_web_theme'); return; } $and_cate = empty($defCateID) ? "" : "and CateID='{$defCateID}'"; $sql = "select * from " . $xoopsDB->prefix("tad_web") . " where 1 {$and_cate} order by WebSort"; $result = $xoopsDB->query($sql) or redirect_header($_SERVER['PHP_SELF'], 3, mysql_error()); $data = ""; $i = 1; include_once XOOPS_ROOT_PATH . "/modules/tadtools/jeditable.php"; $file = "save.php"; //$jeditable = new jeditable(false); while ($all = $xoopsDB->fetchArray($result)) { //以下會產生這些變數: $WebID , $WebName , $WebSort , $WebEnable , $WebCounter foreach ($all as $k => $v) { ${$k} = $v; $data[$i][$k] = $v; } $data[$i]['memAmount'] = memAmount($WebID); $data[$i]['uname'] = XoopsUser::getUnameFromId($WebOwnerUid, 0); //$jeditable->setSelectCol(".Class{$WebID}",$file,"{{$teacher_option}, 'selected':'{$WebOwnerUid}'}","{'WebID' : $WebID , 'op' : 'save_teacher'}",_MA_TCW_CLICK_TO_EDIT); $i++; } if (empty($data)) { $xoopsTpl->assign('op', 'create_web'); } else { //$jeditable_set=$jeditable->render(); $jquery = get_jquery(true); //$xoopsTpl->assign('jeditable_set',$jeditable_set); $xoopsTpl->assign('WebYear', $WebYear); $xoopsTpl->assign('data', $data); $xoopsTpl->assign('jquery', $jquery); $xoopsTpl->assign('CateID', $defCateID); $web_cate = new web_cate("", "", "web_cate"); $cate = $web_cate->get_tad_web_cate_arr(); $xoopsTpl->assign('cate', $cate); } }
global $xoopsDB, $xoopsTpl; $tadgallery = new tadgallery(); $cate_count = $tadgallery->get_tad_gallery_cate_count(); $path = get_tadgallery_cate_path($def_csn); $path_arr = array_keys($path); $sql = "select csn,of_csn,title from " . $xoopsDB->prefix("tad_gallery_cate") . " order by sort"; $result = $xoopsDB->query($sql) or redirect_header($_SERVER['PHP_SELF'], 3, mysql_error()); while (list($csn, $of_csn, $title) = $xoopsDB->fetchRow($result)) { $font_style = $def_csn == $csn ? ", font:{'background-color':'yellow', 'color':'black'}" : ''; $open = in_array($csn, $path_arr) ? 'true' : 'false'; $display_counter = empty($cate_count[$csn]['file']) ? "" : " ({$cate_count[$csn]['file']})"; $data[] = "{ id:{$csn}, pId:{$of_csn}, name:'{$title}{$display_counter}', url:'cooliris.php?csn={$csn}', open: {$open} ,target:'_self' {$font_style}}"; } $json = implode(",\n", $data); if (!file_exists(XOOPS_ROOT_PATH . "/modules/tadtools/ztree.php")) { redirect_header("index.php", 3, _MA_NEED_TADTOOLS); } include_once XOOPS_ROOT_PATH . "/modules/tadtools/ztree.php"; $ztree = new ztree("album_tree", $json, '', '', "of_csn", "csn"); $ztree_code = $ztree->render(); $xoopsTpl->assign('ztree_code', $ztree_code); return $data; } /*-----------秀出結果區--------------*/ $xoopsTpl->assign("toolbar", toolbar_bootstrap($interface_menu)); get_jquery(true); //路徑選單 // $arr = get_tadgallery_cate_path($csn); // $jBreadCrumbPath = breadcrumb($csn, $arr); // $xoopsTpl->assign("path", $jBreadCrumbPath); include_once XOOPS_ROOT_PATH . '/footer.php';
function tad_web_config($WebID) { global $xoopsDB, $xoopsTpl, $MyWebs, $op, $TadUpFiles; $bg_path = XOOPS_ROOT_PATH . "/modules/tad_web/images/bg"; $bg_user_path = XOOPS_ROOT_PATH . "/uploads/tad_web/{$WebID}/bg"; mk_dir($bg_user_path); mk_dir("{$bg_user_path}/thumbs"); import_img($bg_path, "bg", $WebID); $TadUpFilesBg = TadUpFilesBg(); $xoopsTpl->assign('upform_bg', $TadUpFilesBg->upform(false, "bg", null, false)); $TadUpFilesBg->set_col("bg", $WebID); $xoopsTpl->assign('all_bg', $TadUpFilesBg->get_file_for_smarty()); $head_path = XOOPS_ROOT_PATH . "/modules/tad_web/images/head"; $head_user_path = XOOPS_ROOT_PATH . "/uploads/tad_web/{$WebID}/head"; mk_dir($head_user_path); mk_dir("{$head_user_path}/thumbs"); import_img($head_path, "head", $WebID); $TadUpFilesHead = TadUpFilesHead(); $xoopsTpl->assign('upform_head', $TadUpFilesHead->upform(false, "head", null, false)); $TadUpFilesHead->set_col("head", $WebID); $xoopsTpl->assign('all_head', $TadUpFilesHead->get_file_for_smarty()); $logo_path = XOOPS_ROOT_PATH . "/modules/tad_web/images/logo"; $logo_user_path = XOOPS_ROOT_PATH . "/uploads/tad_web/{$WebID}/logo"; mk_dir($logo_user_path); mk_dir("{$logo_user_path}/thumbs"); import_img($logo_path, "logo", $WebID); $TadUpFilesLogo = TadUpFilesLogo(); $xoopsTpl->assign('upform_logo', $TadUpFilesLogo->upform(false, "logo", null, false)); $TadUpFilesLogo->set_col("logo", $WebID); $xoopsTpl->assign('all_logo', $TadUpFilesLogo->get_file_for_smarty()); $xoopsTpl->assign('config', true); get_jquery(true); $TadUpFiles->set_col("WebOwner", $WebID, 1); $teacher_pic = $TadUpFiles->get_pic_file('thumb'); $xoopsTpl->assign('teacher_thumb_pic', $teacher_pic); $upform = $TadUpFiles->upform(true, 'upfile', '1', false); $xoopsTpl->assign('upform', $upform); $ConfigValue = get_web_config("hide_function", $WebID); $hide_function = explode(';', $ConfigValue); $mod_name['aboutus'] = _MD_TCW_ABOUTUS; $mod_name['news'] = _MD_TCW_NEWS; $mod_name['works'] = _MD_TCW_WORKS; $mod_name['homework'] = _MD_TCW_HOMEWORK; $mod_name['files'] = _MD_TCW_FILES; $mod_name['action'] = _MD_TCW_ACTION; $mod_name['video'] = _MD_TCW_VIDEO; $mod_name['link'] = _MD_TCW_LINK; $mod_name['discuss'] = _MD_TCW_DISCUSS; $mod_name['calendar'] = _MD_TCW_CALENDAR; $all_functions = ""; $inline = $_SESSION['bootstrap'] == '3' ? '-inline' : ' inline'; foreach ($mod_name as $function_name => $function_text) { $checked = in_array($function_name, $hide_function) ? "checked" : ""; $all_functions .= "\n <label class='checkbox{$inline}'>\n <input name='ConfigValue[]' type='checkbox' value='{$function_name}' {$checked}>{$function_text}\n </label>"; } $Web = get_tad_web($WebID); $xoopsTpl->assign('all_functions', $all_functions); $xoopsTpl->assign('op', 'tad_web_config'); $xoopsTpl->assign('isMine', isMine()); $xoopsTpl->assign('WebName', $Web['WebName']); $TadUpFiles->set_col("WebOwner", $WebID); $list_del_file = $TadUpFiles->list_del_file(); $xoopsTpl->assign('list_del_file', $list_del_file); if (!file_exists(XOOPS_ROOT_PATH . "/modules/tadtools/mColorPicker.php")) { redirect_header("index.php", 3, _MA_NEED_TADTOOLS); } include_once XOOPS_ROOT_PATH . "/modules/tadtools/mColorPicker.php"; $mColorPicker = new mColorPicker('.color'); $mColorPicker_code = $mColorPicker->render(); $xoopsTpl->assign('mColorPicker_code', $mColorPicker_code); //區塊設定 $display_blocks = get_web_config("display_blocks", $WebID); if (!empty($display_blocks)) { $display_blocks_arr = explode(',', $display_blocks); } else { $display_blocks_arr = ""; } $sql = "select bid,name,title from " . $xoopsDB->prefix("newblocks") . " where dirname='tad_web' order by weight"; $result = $xoopsDB->query($sql) or redirect_header($_SERVER['PHP_SELF'], 3, mysql_error()); $myts = MyTextSanitizer::getInstance(); $block_ok = $block_yet = $block_name = ""; while ($all = $xoopsDB->fetchArray($result)) { foreach ($all as $k => $v) { ${$k} = $v; } $name = $myts->htmlSpecialChars($name); $title = $myts->htmlSpecialChars($title); if (!empty($display_blocks)) { if (!in_array($bid, $display_blocks_arr)) { $block_yet .= "<option value=\"{$bid}\">{$name}</option>"; } $block_name[$bid] = $name; } else { $block_ok .= "<option value=\"{$bid}\">{$name}</option>"; $blocks[] = $bid; } } if (empty($display_blocks_arr)) { $display_blocks = implode(',', $blocks); } else { foreach ($display_blocks_arr as $bid) { $block_ok .= "<option value=\"{$bid}\">{$block_name[$bid]}</option>"; } } $block_content = "\n <script type=\"text/javascript\" src=\"" . XOOPS_URL . "/modules/tad_web/class/tmt_core.js\"></script>\n <script type=\"text/javascript\" src=\"" . XOOPS_URL . "/modules/tad_web/class/tmt_spry_linkedselect.js\"></script>\n <script type=\"text/javascript\">\n function getOptions()\n {\n\n var values = [];\n var sel = document.getElementById('destination');\n for (var i=0, n=sel.options.length;i<n;i++) {\n if (sel.options[i].value) values.push(sel.options[i].value);\n }\n document.getElementById('display_blocks').value=values.join(',');\n }\n </script>\n\n <table style='width:auto'>\n\n <tr>\n <td style='vertical-align:top;'>\n <h3>" . _MD_TCW_BLOCKS_LIST . "</h3>\n <select name=\"repository\" id=\"repository\" size=\"12\" multiple=\"multiple\" tmt:linkedselect=\"true\" style='width: 300px;'>\n {$block_yet}\n </select>\n </td>\n <td style='vertical-align:middle'>\n <img src=\"" . XOOPS_URL . "/modules/tad_web/images/right.png\" onclick=\"tmt.spry.linkedselect.util.moveOptions('repository', 'destination');getOptions();\"><br>\n <img src=\"" . XOOPS_URL . "/modules/tad_web/images/left.png\" onclick=\"tmt.spry.linkedselect.util.moveOptions('destination' , 'repository');getOptions();\"><br><br>\n\n <img src=\"" . XOOPS_URL . "/modules/tad_web/images/up.png\" onclick=\"tmt.spry.linkedselect.util.moveOptionUp('destination');getOptions();\"><br>\n <img src=\"" . XOOPS_URL . "/modules/tad_web/images/down.png\" onclick=\"tmt.spry.linkedselect.util.moveOptionDown('destination');getOptions();\">\n </td>\n <td style='vertical-align:top;'>\n <h3>" . _MD_TCW_BLOCKS_SELECTED . "</h3>\n <select id=\"destination\" size=\"12\" multiple=\"multiple\" tmt:linkedselect=\"true\" style='width: 300px;'>\n {$block_ok}\n </select>\n </td>\n </tr>\n <tr>\n <td colspan=4>\n <input type='hidden' name='display_blocks' id='display_blocks' value='{$display_blocks}'>\n </td>\n </tr>\n </table>\n "; $xoopsTpl->assign('block_content', $block_content); }
bloginfo('pingback_url'); ?> " /> <link rel="shortcut icon" href="<?php the_recource_url('/favicon.ico'); ?> " /> <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?> " /> <?php wp_head(); ?> <script type="text/javascript" src="<?php echo get_jquery(); ?> "></script> <script type="text/javascript"> function scrollToElement(ele){$body=(window.opera)?(document.compatMode=="CSS1Compat"?$('html'):$('body')):$('html,body');var targetY=$(ele).offset().top;var current=$body.scrollTop();var pgHeight=getPageHeight();var direction=targetY>current?1:-1;if(Math.abs(current-targetY)>pgHeight){current=targetY-direction*pgHeight;$body.scrollTop(current);}$body.animate({scrollTop:targetY}, 1000);} function getPageHeight(){if($.browser.msie){return document.compatMode=="CSS1Compat"?document.documentElement.clientHeight:document.body.clientHeight;}else{return self.innerHeight;}} function setHoverCursor(ele,cursor){$(ele).hover(function(){$(this).css('cursor',cursor);},function(){$(this).css('cursor','auto');});} function postComments(){scrollToElement("#respond");if($("input.input_0").length>0){var hasName=$("input.input_0").val().length>0;var hasEmail=$("input.input_1").val().length>0;if(!hasName){$("input.input_0").focus();}else if(!hasEmail){$("input.input_1").focus();}else{$("textarea.comm_input").focus();}}else{$("textarea.comm_input").focus();}} function loadJS(js_url){var s=document.createElement('script');s.type='text/javascript';s.async=true;s.src=js_url;var se=document.getElementsByTagName('script')[0]; se.parentNode.insertBefore(s,se);} $(document).ready(function($){var cur=document.createElement("center");cur.appendChild(document.createElement("div"));$("ul#menu li#current").prepend(cur);$("ul#menu li.current_page_item").prepend(cur);var bqe=document.createElement("div");bqe.setAttribute("class","bqe");var b=$("div.entry blockquote");b.append(bqe);var bqs=document.createElement("div");bqs.setAttribute("class","bqs");b.prepend(bqs);$("div.entry blockquote .bqe").css("left",$("div.entry blockquote p:last").width()+35);setHoverCursor("#searchsubmitBtn", "pointer");$("#searchsubmitBtn").click(function(e){$("#searchform").submit()});}); </script> <?php if (is_need_lazy_load_effect()) { ?> <script type="text/javascript" src="<?php the_recource_url('/jquery.lazyload.mini.js');
function view_pic($sn = "") { global $xoopsDB, $xoopsUser, $xoopsModule, $xoopsModuleConfig, $xoopsTpl, $xoTheme; $tadgallery = new tadgallery(); //判斷是否對該模組有管理權限, 若空白 if ($xoopsUser) { $nowuid = $xoopsUser->getVar('uid'); $module_id = $xoopsModule->getVar('mid'); $isAdmin = $xoopsUser->isAdmin($module_id); } else { $isAdmin = false; $nowuid = ""; } $sql = "select * from " . $xoopsDB->prefix("tad_gallery") . " where sn='{$sn}'"; $result = $xoopsDB->query($sql) or redirect_header($_SERVER['PHP_SELF'], 3, mysql_error()); $all = $xoopsDB->fetchArray($result); //$csn,$title,$description,$filename,$size,$type,$width,$height,$dir,$uid,$post_date,$counter,$exif,$good,$tag,$photo_sort foreach ($all as $k => $v) { ${$k} = $v; $xoopsTpl->assign($k, $v); } $photo_s = $tadgallery->get_pic_url($dir, $sn, $filename, "s"); $photo_m = $tadgallery->get_pic_url($dir, $sn, $filename, "m"); $photo_l = $tadgallery->get_pic_url($dir, $sn, $filename); $xoopsTpl->assign("photo_s", $photo_s); $xoopsTpl->assign("photo_m", $photo_m); $xoopsTpl->assign("photo_l", $photo_l); if (!empty($csn)) { $ok_cat = $tadgallery->chk_cate_power(); $cate = $tadgallery->get_tad_gallery_cate($csn); if (!in_array($csn, $ok_cat)) { redirect_header("index.php?csn={$csn}&op=passwd_form", 3, sprintf(_TADGAL_NO_PASSWD_CONTENT, $cate['title'])); exit; } $sql = "select * from " . $xoopsDB->prefix("tad_gallery") . " where csn='{$csn}' order by photo_sort , post_date"; $result = $xoopsDB->query($sql) or redirect_header($_SERVER['PHP_SELF'], 3, mysql_error()); $slides1 = $slides2 = ""; $i = 0; $start = false; while ($all = $xoopsDB->fetchArray($result)) { if ($sn == $all['sn']) { $start = true; $i = 0; } if ($start) { $slides1[$i]['sn'] = $all['sn']; $slides1[$i]['photo'] = $tadgallery->get_pic_url($all['dir'], $all['sn'], $all['filename']); $slides1[$i]['description'] = strip_tags($all['description']); $slides1[$i]['thumb'] = $tadgallery->get_pic_url($all['dir'], $all['sn'], $all['filename'], 's'); } else { $slides2[$i]['sn'] = $all['sn']; $slides2[$i]['photo'] = $tadgallery->get_pic_url($all['dir'], $all['sn'], $all['filename']); $slides2[$i]['description'] = strip_tags($all['description']); $slides2[$i]['thumb'] = $tadgallery->get_pic_url($all['dir'], $all['sn'], $all['filename'], 's'); } $i++; } } $xoopsTpl->assign("slides1", $slides1); $xoopsTpl->assign("slides2", $slides2); //找出上一張或下一張 $pnp = get_pre_next($csn, $sn); $xoopsTpl->assign("next", $pnp['next']); $xoopsTpl->assign("back", $pnp['pre']); $arr = get_tadgallery_cate_path($csn); $jBreadCrumbPath = breadcrumb($csn, $arr); $xoopsTpl->assign("path", $jBreadCrumbPath); if (!file_exists(XOOPS_ROOT_PATH . "/modules/tadtools/fancybox.php")) { redirect_header("index.php", 3, _MA_NEED_TADTOOLS); } include_once XOOPS_ROOT_PATH . "/modules/tadtools/fancybox.php"; $fancybox = new fancybox('.fancybox'); $fancybox_code = $fancybox->render(false); $xoopsTpl->assign('fancybox_code', $fancybox_code); $title = empty($title) ? $filename : $title; $div_width = $xoopsModuleConfig['thumbnail_m_width'] + 30; $size_txt = sizef($size); if ($uid == $nowuid or $isAdmin) { $xoopsTpl->assign('show_del', 1); //$del_btn="<a src='javascript:delete_tad_gallery_func($sn)' title='"._TADGAL_DEL_PIC."' class='btn btn-danger'>"._TAD_DEL."</a>"; $xoopsTpl->assign('good', $good); $del_js = "\n <script>\n function delete_tad_gallery_func(sn){\n var sure = window.confirm('" . _TAD_DEL_CONFIRM . "');\n if (!sure) return;\n location.href=\"{$_SERVER['PHP_SELF']}?op=delete_tad_gallery&sn=\" + sn;\n }\n </script>"; } else { $del_btn = $admin_tool = $del_js = ""; } $xoopsTpl->assign('del_btn', $del_btn); //秀出各種尺寸圖示 if ($xoopsModuleConfig['show_copy_pic']) { $xoopsTpl->assign("photo_s", $photo_s); $xoopsTpl->assign("photo_m", $photo_m); $xoopsTpl->assign("photo_l", $photo_l); $xoopsTpl->assign("description", $description); $xoopsTpl->assign("sel_size", 1); } else { $xoopsTpl->assign("sel_size", 0); } //推文工具 $push = push_url($xoopsModuleConfig['use_social_tools']); $xoopsTpl->assign("push", $push); $xoopsTpl->assign("pic_toolbar", $xoopsModuleConfig['pic_toolbar']); $xoopsTpl->assign("thumb_slider", $xoopsModuleConfig['thumb_slider']); //計數器 add_tad_gallery_counter($sn); //地圖部份 $info = explode("||", $exif); foreach ($info as $v) { $exif_arr = explode("=", $v); $exif_arr[1] = str_replace("�", "", $exif_arr[1]); $bb = "\$photoexif{$exif_arr[0]}=\"{$exif_arr[1]}\";"; if (empty($exif_arr[0])) { continue; } @eval($bb); } $latitude = $photoexif['GPS']['latitude']; $longitude = $photoexif['GPS']['longitude']; $xoopsTpl->assign("latitude", $latitude); $xoopsTpl->assign("longitude", $longitude); $jquery_path = get_jquery(true); $xoopsTpl->assign("jquery", $jquery_path); $xoopsTpl->assign("path", $jBreadCrumbPath); $xoopsTpl->assign("del_js", $del_js); $xoopsTpl->assign("div_width", $div_width); $facebook_comments = facebook_comments($xoopsModuleConfig['facebook_comments_width'], 'tadgallery', 'view.php', 'sn', $sn); $xoopsTpl->assign("facebook_comments", $facebook_comments); $fb_tag = "\n <meta property=\"og:title\" content=\"{$title}\" />\n <meta property=\"og:description\" content=\"{$description}\" />\n <meta property=\"og:image\" content=\"" . $tadgallery->get_pic_url($dir, $sn, $filename, "m") . "\" />\n "; $xoopsTpl->assign("xoops_module_header", $fb_tag); $xoopsTpl->assign("xoops_pagetitle", $title); if (is_object($xoTheme)) { $xoTheme->addMeta('meta', 'keywords', $title); $xoTheme->addMeta('meta', 'description', $description); } else { $xoopsTpl->assign('xoops_meta_keywords', 'keywords', $title); $xoopsTpl->assign('xoops_meta_description', $description); } }
<?php // ------------------------------------------------------------------------ // // 本模組由 prolin 製作 // 製作日期:2014-05-01 // $Id:$ // ------------------------------------------------------------------------- // /*-----------引入檔案區--------------*/ include_once "header.php"; $xoopsOption['template_main'] = set_bootstrap("espanel_index_tpl.html"); include_once XOOPS_ROOT_PATH . "/header.php"; /*-----------function區--------------*/ /*-----------執行動作判斷區----------*/ //$op=empty($_REQUEST['op'])?"":$_REQUEST['op']; $keyword = $xoopsModuleConfig['es_panel_keyword']; $data['memo'] = $xoopsModuleConfig['es_panel_memo']; $data['width'] = $xoopsModuleConfig['es_panel_width']; $data['item'] = get_tad_themes_menu($keyword); /*-----------秀出結果區--------------*/ $xoopsTpl->assign("toolbar", toolbar_bootstrap($interface_menu)); $xoopsTpl->assign("bootstrap", get_bootstrap()); $xoopsTpl->assign("jquery", get_jquery(true)); $xoopsTpl->assign("data", $data); include_once XOOPS_ROOT_PATH . '/footer.php';
function tad_web_list_cate() { global $xoopsDB, $xoopsTpl, $isAdmin; $myts = MyTextSanitizer::getInstance(); $sql = "select * from `" . $xoopsDB->prefix("tad_web_cate") . "` where `WebID`='0' and `ColName`='web_cate' and `ColSN`='0' order by `CateSort`"; $result = $xoopsDB->query($sql) or redirect_header($_SERVER['PHP_SELF'], 3, mysql_error()); $all_content = ''; $i = 0; $web_cate = get_web_cate_arr(); while ($all = $xoopsDB->fetchArray($result)) { //以下會產生這些變數: $CateID, $WebID, $CateName, $ColName, $ColSN, $CateSort, $CateEnable, $CateCounter foreach ($all as $k => $v) { ${$k} = $v; } //將是/否選項轉換為圖示 $CateEnable = $CateEnable == 1 ? '<img src="' . XOOPS_URL . '/modules/tad_web/images/yes.gif" alt="' . _YES . '" title="' . _YES . '">' : '<img src="' . XOOPS_URL . '/modules/tad_web/images/no.gif" alt="' . _NO . '" title="' . _NO . '">'; //過濾讀出的變數值 $CateName = $myts->htmlSpecialChars($CateName); $ColName = $myts->htmlSpecialChars($ColName); $ColSN = $myts->htmlSpecialChars($ColSN); $all_content[$i]['CateID'] = $CateID; $all_content[$i]['WebID'] = ${$WebID}; $all_content[$i]['CateName'] = $CateName; $all_content[$i]['ColName'] = $ColName; $all_content[$i]['ColSN'] = $ColSN; $all_content[$i]['CateSort'] = $CateSort; $all_content[$i]['CateEnable'] = $CateEnable; $all_content[$i]['CateCounter'] = $CateCounter; //die(var_export($web_cate[0])); $all_content[$i]['repository'] = $web_cate[0]; $all_content[$i]['destination'] = $web_cate[$CateID]; $all_content[$i]['web_cate_arr_str'] = implode(",", $web_cate[$CateID]['WebID']); $all_content[$i]['web_cate_blank_arr'] = implode(",", $web_cate[0]['WebID']); $i++; } //刪除確認的JS if (!file_exists(XOOPS_ROOT_PATH . "/modules/tadtools/sweet_alert.php")) { redirect_header("index.php", 3, _MA_NEED_TADTOOLS); } include_once XOOPS_ROOT_PATH . "/modules/tadtools/sweet_alert.php"; $sweet_alert_obj = new sweet_alert(); $delete_tad_web_cate_func = $sweet_alert_obj->render('delete_tad_web_cate_func', "{$_SERVER['PHP_SELF']}?op=delete_tad_web_cate&CateID=", "CateID"); $xoopsTpl->assign('delete_tad_web_cate_func', $delete_tad_web_cate_func); $xoopsTpl->assign('tad_web_cate_jquery_ui', get_jquery(true)); $xoopsTpl->assign('bar', $bar); $xoopsTpl->assign('action', $_SERVER['PHP_SELF']); $xoopsTpl->assign('isAdmin', $isAdmin); $xoopsTpl->assign('all_content', $all_content); }
function list_jill_booking_time($jbi_sn = "") { global $xoopsDB, $xoopsTpl, $isAdmin; if (empty($jbi_sn)) { return; } $item = get_jill_booking_item($jbi_sn); include_once XOOPS_ROOT_PATH . "/modules/tadtools/jeditable.php"; $jeditable = new jeditable(); $myts =& MyTextSanitizer::getInstance(); $sql = "select * from `" . $xoopsDB->prefix("jill_booking_time") . "`\n where `jbi_sn`='{$jbi_sn}' order by `jbt_sort`"; $result = $xoopsDB->query($sql) or redirect_header($_SERVER['PHP_SELF'], 3, mysql_error()); $total = $xoopsDB->getRowsNum($result); $all_content = ""; $i = 0; while ($all = $xoopsDB->fetchArray($result)) { //以下會產生這些變數: $jbt_sn , $jbi_sn , $jbt_title , $jbt_sort foreach ($all as $k => $v) { ${$k} = $v; } //過濾讀出的變數值 $jbt_title = $myts->htmlSpecialChars($jbt_title); $jeditable->setTextCol("#jbt_title_{$jbt_sn}", 'time.php', '100%', '11pt', "{'jbt_sn':{$jbt_sn},'op' : 'save_jbt_title'}", _TAD_EDIT . _MA_JILLBOOKIN_JBT_TITLE); $all_content[$i]['jbi_sn'] = $jbi_sn; $all_content[$i]['jbt_sn'] = $jbt_sn; $all_content[$i]['jbt_title_link'] = "<a href='{$_SERVER['PHP_SELF']}?jbt_sn={$jbt_sn}'>{$jbt_title}</a>"; $all_content[$i]['jbt_title'] = $jbt_title; $all_content[$i]['jbt_sort'] = $jbt_sort; $all_content[$i]['jbt_week'] = strval($jbt_week); $booking_times = get_booking_times($jbt_sn); $all_content[$i]['booking_times'] = empty($booking_times) ? "" : sprintf(_MA_JILLBOOKIN_BOOKING_TIME, $booking_times); $w_arr = explode(',', $jbt_week); for ($j = 0; $j <= 7; $j++) { $name = "w{$j}"; $pic = in_array($j, $w_arr) ? "yes.gif" : "no.gif"; $all_content[$i][$name] = "<img src='../images/{$pic}' id='{$jbt_sn}_{$j}' onClick=\"change_enable({$jbt_sn},{$j});\" style='cursor: pointer;'>"; } ++$i; } //die(var_export($all_content)); //刪除確認的JS $xoopsTpl->assign('item', $item); $xoopsTpl->assign('bar', $bar); $xoopsTpl->assign('action', $_SERVER['PHP_SELF']); $xoopsTpl->assign('isAdmin', $isAdmin); $xoopsTpl->assign('all_content', $all_content); $xoopsTpl->assign('now_op', 'list_jill_booking_time'); $xoopsTpl->assign('jbi_sn', $jbi_sn); if (!file_exists(XOOPS_ROOT_PATH . "/modules/tadtools/sweet_alert.php")) { redirect_header("index.php", 3, _MA_NEED_TADTOOLS); } include_once XOOPS_ROOT_PATH . "/modules/tadtools/sweet_alert.php"; $sweet_alert = new sweet_alert(); $delete_jill_booking_time_func = $sweet_alert->render('delete_jill_booking_time_func', "{$_SERVER['PHP_SELF']}?op=delete_jill_booking_time&jbi_sn={$jbi_sn}&jbt_sn=", "jbt_sn"); $xoopsTpl->assign('delete_jill_booking_time_func', $delete_jill_booking_time_func); //套用formValidator驗證機制 if (!file_exists(TADTOOLS_PATH . "/formValidator.php")) { redirect_header("index.php", 3, _TAD_NEED_TADTOOLS); } include_once TADTOOLS_PATH . "/formValidator.php"; $formValidator = new formValidator("#myForm", true); $formValidator_code = $formValidator->render(); $xoopsTpl->assign('formValidator_code', $formValidator_code); $jeditable_set = $jeditable->render(); $xoopsTpl->assign('jeditable_set', $jeditable_set); //找出現有場地 $i = 0; $place_time = ""; $sql = "select a.* , count(b.jbt_sn) as counter from `" . $xoopsDB->prefix("jill_booking_item") . "` as a join `" . $xoopsDB->prefix("jill_booking_time") . "` as b on a.jbi_sn=b.jbi_sn where a.jbi_enable='1' group by b.jbi_sn"; $result = $xoopsDB->query($sql) or redirect_header($_SERVER['PHP_SELF'], 3, mysql_error()); while ($data = $xoopsDB->fetchArray($result)) { $data['jbi_link'] = sprintf(_MA_JILLBOOKIN_IMPORT_PLACE, $data['jbi_title'], $data['counter']); $place_time[$i] = $data; $i++; } $xoopsTpl->assign('place_time', $place_time); $xoopsTpl->assign('jquery', get_jquery(true)); }
function tadgallery_carousel_show($options) { global $xoopsDB, $xoTheme; $order_array = array('post_date', 'counter', 'rand', 'photo_sort'); $limit = empty($options[0]) ? 12 : intval($options[0]); $view_csn = empty($options[1]) ? '' : intval($options[1]); $include_sub = empty($options[2]) ? "0" : "1"; $order_by = in_array($options[3], $order_array) ? $options[3] : "post_date"; $desc = empty($options[4]) ? "" : "desc"; $size = (!empty($options[5]) and $options[5] == "s") ? "s" : "m"; $only_good = $options[6] != '1' ? "0" : "1"; $options[7] = intval($options[7]); $width = empty($options[7]) ? 140 : $options[7]; $options[8] = intval($options[8]); $height = empty($options[8]) ? 105 : $options[8]; $direction = empty($options[9]) ? "0" : "1"; $options[10] = intval($options[10]); $speed = (empty($options[10]) or $options[10] < 10) ? 1000 : $options[10]; $options[11] = intval($options[11]); $scroll = (empty($options[11]) or $options[11] > 20) ? 3 : $options[11]; $move = (empty($options[12]) or $options[12] > 20) ? 0 : intval($options[12]); $options[13] = intval($options[13]); $staytime = empty($options[13]) ? 5000 : $options[13]; $tadgallery = new tadgallery(); $tadgallery->set_limit($limit); if ($view_csn) { $tadgallery->set_view_csn($view_csn); } $tadgallery->set_orderby($order_by); $tadgallery->set_order_desc($desc); $tadgallery->set_view_good($only_good); $photos = $tadgallery->get_photos('return', $include_sub); $pics = ""; $i = 0; foreach ($photos as $photo) { $pp = 'photo_' . $size; $pic_url = $photo[$pp]; $pics[$i]['width'] = $width; $pics[$i]['height'] = $height; $pics[$i]['direction'] = $direction; $pics[$i]['pic_url'] = $pic_url; $pics[$i]['photo_sn'] = $photo['sn']; $pics[$i]['photo_title'] = $photo['title']; $i++; } if ($direction == '1') { $vertical_height = $height * $scroll + 50; $css_txt = "width:{$width}px;"; $vertical = "direction : 'up',"; } else { $vertical_height = "'auto'"; $css_txt = "height:{$height}px;"; $vertical = ""; } //引入TadTools的jquery if (!file_exists(XOOPS_ROOT_PATH . "/modules/tadtools/jquery.php")) { redirect_header("http://www.tad0616.net/modules/tad_uploader/index.php?of_cat_sn=50", 3, _TAD_NEED_TADTOOLS); } include_once XOOPS_ROOT_PATH . "/modules/tadtools/jquery.php"; $block['view_csn'] = $view_csn; $block['vertical'] = $vertical; $block['vertical_height'] = $vertical_height; $block['scroll'] = intval($scroll) == 0 ? "" : "scroll: {$scroll},"; $block['pics'] = $pics; get_jquery(); $xoTheme->addScript('modules/tadgallery/class/carouFredSel/jquery.carouFredSel-6.2.1-packed.js'); $xoTheme->addScript('modules/tadgallery/class/carouFredSel/helper-plugins/jquery.mousewheel.min.js'); $xoTheme->addScript('modules/tadgallery/class/carouFredSel/helper-plugins/jquery.touchSwipe.min.js'); $xoTheme->addScript('modules/tadgallery/class/carouFredSel/helper-plugins/jquery.transit.min.js'); $xoTheme->addScript('modules/tadgallery/class/carouFredSel/helper-plugins/jquery.ba-throttle-debounce.min.js'); return $block; }
function show_cate($csn, $passwd) { global $xoopsDB, $xoopsUser, $xoopsModule, $xoopsModuleConfig, $xoopsTpl, $xoopsOption; $jquery = get_jquery(); //以流水號取得某筆tad_gallery_cate資料 $cate = tadgallery::get_tad_gallery_cate($csn); //可觀看相簿 $ok_cat = tadgallery::chk_cate_power(); //密碼檢查 if (!empty($csn)) { if (empty($passwd) and !empty($_SESSION['tadgallery'][$csn])) { $passwd = $_SESSION['tadgallery'][$csn]; } $sql = "select csn,passwd from " . $xoopsDB->prefix("tad_gallery_cate") . " where csn='{$csn}'"; $result = $xoopsDB->query($sql) or redirect_header($_SERVER['PHP_SELF'], 3, mysql_error()); list($ok_csn, $ok_passwd) = $xoopsDB->fetchRow($result); if (!empty($ok_csn) and $ok_passwd != $passwd) { redirect_header($_SERVER['PHP_SELF'], 3, sprintf(_TADGAL_NO_PASSWD_CONTENT, $cate['title'])); } if (!empty($ok_passwd) and empty($_SESSION['tadgallery'][$csn])) { $_SESSION['tadgallery'][$csn] = $passwd; } //檢查相簿觀看權限 if (!in_array($csn, $ok_cat)) { redirect_header($_SERVER['PHP_SELF'], 3, _TADGAL_NO_POWER_TITLE, sprintf(_TADGAL_NO_POWER_CONTENT, $cate['title'], $select)); } } //呈現資料預設值 $data = ""; //畫面並不只秀出縮圖,要秀出分類的話。 if ($xoopsModuleConfig['only_thumb'] != '1') { //撈出底下子分類 $sql = "select csn,title,passwd,show_mode,cover from " . $xoopsDB->prefix("tad_gallery_cate") . " where of_csn='{$csn}' order by sort"; //getPageBar_cate $PageBar_cate = getPageBar_mobile($sql, $xoopsModuleConfig['thumbnail_number'], 10); $bar_cate = $PageBar_cate['bar']; $sql = $PageBar_cate['sql']; $total_cate = $PageBar_cate['total']; $result = $xoopsDB->query($sql) or redirect_header($_SERVER['PHP_SELF'], 3, mysql_error()); while (list($fcsn, $title, $passwd, $show_mode, $cover) = $xoopsDB->fetchRow($result)) { //無觀看權限則略過 if (!in_array($fcsn, $ok_cat)) { continue; } $url = "pda.php"; $rel = "rel='external'"; $cover_pic = empty($cover) ? "images/folder_picture.png" : XOOPS_URL . "/uploads/tadgallery/{$cover}"; if (empty($passwd) or $passwd == $_SESSION['tadgallery'][$fcsn]) { //不需密碼的分類 $data .= mk_gallery_border_m($rel, "{$url}?csn={$fcsn}", $cover_pic, $title); } else { //有密碼的分類 $data .= mk_gallery_border_m("", "#", $cover_pic, $title, true, $fcsn); } } } //找出分類下所有相片 $sql = "select * from " . $xoopsDB->prefix("tad_gallery") . " where csn='{$csn}' order by photo_sort , post_date"; //getPageBar($原sql語法, 每頁顯示幾筆資料, 最多顯示幾個頁數選項); $PageBar = getPageBar_mobile($sql, $xoopsModuleConfig['thumbnail_number'], 10); $bar = $PageBar['bar']; $sql = $PageBar['sql']; $total = $PageBar['total']; $result = $xoopsDB->query($sql) or redirect_header($_SERVER['PHP_SELF'], 3, mysql_error()); while (list($sn, $db_csn, $title, $description, $filename, $size, $type, $width, $height, $dir, $uid, $post_date, $counter, $exif) = $xoopsDB->fetchRow($result)) { $data .= "<li class='nofolder'><a href='" . tadgallery::get_pic_url($dir, $sn, $filename, "m") . "' rel='external'><img src='" . tadgallery::get_pic_url($dir, $sn, $filename, "s") . "' alt='{$title}' title='{$title}'></a></li>\n\t"; } $main = "\n <ul class='gallery' style='margin-top:10px;'>\n {$data}\n </ul>\n <p style='clear:both;'></p>"; if ($total > $total_cate) { $main .= "\n <div style='clear:both;text-align:center;padding:8px;' class='navigation'><div data-role='controlgroup' data-type='horizontal'>{$bar}</div></div>"; } else { $main .= "\n <div style='clear:both;text-align:center;padding:8px;' class='navigation'><div data-role='controlgroup' data-type='horizontal'>{$bar_cate}</div></div>"; } return $main; }
function theme_settings() { global $GOOGLE_ANALYTICS_ID_PARA, $GOOGLE_CSE_ID_PARA, $ENABLE_LAZY_LOAD_PARA, $ENABLE_FACEBOX_PARA, $PERSONAL_INFO_PARA, $JQUERY_SOURCE, $ENABLE_COMMENTS_MAIL_NOTIFY, $COMMENTS_EMAIL_FROM, $ENABLE_ADMIN_COMMENTS_MAIL_NOTIFY, $ENABLE_MAKEITUP_COMMENT; $select_tf = array(array("value" => "true", "label" => "启用(默认) "), array("value" => "false", "label" => "禁用")); $select_jquery_source = array(array("value" => "Microsoft CDN", "label" => "Microsoft CDN(默认)"), array("value" => "Google Ajax API CDN", "label" => "Google Ajax API CDN "), array("value" => "jQuery CDN", "label" => "jQuery CDN"), array("value" => "Local", "label" => "Local")); ?> <div class="wrap" style="width:680px;"> <div id="icon-options-general" class="icon32"></div> <h2>MyMinyxLITE 主题设置</h2> <div id="message" class="updated fade"> <p>本主题由 <a href="http://hackerzhou.me">hackerzhou</a> 根据 www.storelicious.com(www.spiga.com.mx) 的 MinyxLITE 2.0 主题扩展而成,修改UI以及添加一些自定义的功能,详见 <a href="http://wiki.hackerzhou.me/My_Minyx_LITE">Wiki Page</a>,如有问题,可以在 <a href="http://twitter.com/hackerzhou">Twitter</a> 以及 <a href="http://weibo.com/hackerzhou">新浪微博</a> 上@hackerzhou 询问。</p> <p>本作品采用 <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">知识共享署名-非商业性使用-相同方式共享 3.0</a>许可协议进行许可。</p> </div> <?php echo "<script type=\"text/javascript\" src=\"" . get_jquery() . "\"></script>"; if (isset($_GET['event'])) { if ("saveComplete" == $_GET["event"]) { echo "<div class=\"updated\" id=\"eventMsg\" style=\"opacity:0;text-align:center;\"><p>设置已保存</p></div>"; } else { if ("resetComplete" == $_GET["event"]) { echo "<div class=\"updated fade\" id=\"eventMsg\" style=\"opacity:0;text-align:center;\"><p>已恢复MyMinyxLITE的默认设置</p></div>"; } } echo "<script type=\"text/javascript\">\$('#eventMsg').animate({opacity:1}, 2000);</script>"; } ?> <form action="" method="post"> <table class="form-table"> <tr><th scope="row">Google Analytics ID:</th><td><?php print_input_component($GOOGLE_ANALYTICS_ID_PARA); ?> (留空禁用)</td></tr> <tr><th scope="row">Custom Search Engine ID:</th><td><?php print_input_component(GOOGLE_CSE_ID_PARA); ?> (留空禁用)</td></tr> <tr><th scope="row">图片jQuery Lazy Load效果:</th><td><?php print_select_component($ENABLE_LAZY_LOAD_PARA, $select_tf); ?> </td></tr> <tr><th scope="row">图片启用Facebox效果:</th><td><?php print_select_component($ENABLE_FACEBOX_PARA, $select_tf); ?> </td></tr> <tr><th scope="row">评论启用MakeItUp:</th><td><?php print_select_component($ENABLE_MAKEITUP_COMMENT, $select_tf); ?> </td></tr> <tr><th scope="row">评论邮件通知功能:</th><td><?php print_select_component($ENABLE_COMMENTS_MAIL_NOTIFY, $select_tf); ?> </td></tr> <tr class="comment_email_from_tr" style="display:none;"><th scope="row">评论邮件From地址:</th><td><?php print_input_component($COMMENTS_EMAIL_FROM); ?> (留空使用默认邮箱)</td></tr> <tr class="comment_email_from_tr" style="display:none;"><th scope="row">管理员回复启用邮件通知:</th><td><?php print_select_component($ENABLE_ADMIN_COMMENTS_MAIL_NOTIFY, $select_tf); ?> </td></tr> <tr><th scope="row">jQuery源:</th><td><?php print_select_component($JQUERY_SOURCE, $select_jquery_source); ?> </td></tr> <tr><th scope="row">侧栏个人说明:</th><td><textarea id="<?php echo $PERSONAL_INFO_PARA; ?> " name="<?php echo $PERSONAL_INFO_PARA; ?> " style="height:180px;width:430px;"><?php echo get_theme_option($PERSONAL_INFO_PARA, ""); ?> </textarea><br/>(留空不显示,支持HTML)</td></tr> <tr><td colspan="2"><center><input id="save" name="save" type="submit" class="button-primary" value="保存设置" style="margin:0 20px;"/><input id="reset" name="reset" type="submit" class="button-primary" style="margin:0 20px;" value="恢复默认"/></center></td></tr> </table> </form> <script type="text/javascript"> mail_notify_sub_item(); function mail_notify_sub_item(){if($("#enable_mail_notify").val()=="true"){$(".comment_email_from_tr").show();}else{$(".comment_email_from_tr").hide();}} $("#enable_mail_notify").change(function(){mail_notify_sub_item()}); </script> </div> <?php }
function list_tad_cal_cate($show_function = 1) { global $xoopsDB, $xoopsModule, $xoopsTpl; //取得資料數 $sql = "select count(*),cate_sn,max(`last_update`) from " . $xoopsDB->prefix("tad_cal_event") . " group by cate_sn"; $result = $xoopsDB->query($sql) or web_error($sql); while (list($count, $cate_sn, $last_update) = $xoopsDB->fetchRow($result)) { $counter[$cate_sn] = $count; $last[$cate_sn] = $last_update; } $sql = "select * from " . $xoopsDB->prefix("tad_cal_cate") . " order by cate_sort"; $result = $xoopsDB->query($sql) or web_error($sql); $function_title = $show_function ? "<th>" . _TAD_FUNCTION . "</th>" : ""; $all_content = ""; $i = 0; $last = ""; while ($all = $xoopsDB->fetchArray($result)) { //以下會產生這些變數: $cate_sn , $cate_title , $cate_sort , $cate_enable , $cate_handle , $enable_group , $enable_upload_group , $google_id , $google_pass, $cate_bgcolor, $cate_color foreach ($all as $k => $v) { ${$k} = $v; } $g_txt = txt_to_group_name($enable_group, _MA_TADCAL_ALL_OK); $gu_txt = txt_to_group_name($enable_upload_group, _MA_TADCAL_ALL_OK); $enable = $cate_enable == '1' ? _YES : _NO; if (empty($counter[$cate_sn])) { $counter[$cate_sn] = 0; } //if($last[$cate_sn]=='0000-00-00 00:00:00'){ // $last[$cate_sn]=''; //} $all_content[$i]['cate_sn'] = $cate_sn; //$all_content[$i]['goo_tool']=$goo_tool; //$all_content[$i]['last']=$last[$cate_sn]; $all_content[$i]['gu_txt'] = $gu_txt; $all_content[$i]['g_txt'] = $g_txt; $all_content[$i]['enable'] = $enable; $all_content[$i]['counter'] = $counter[$cate_sn]; $all_content[$i]['cate_title'] = $cate_title; //$all_content[$i]['google']=$google; $all_content[$i]['cate_color'] = $cate_color; $all_content[$i]['cate_bgcolor'] = $cate_bgcolor; $all_content[$i]['cate_handle'] = $cate_handle; $i++; } $xoopsTpl->assign('all_content', $all_content); $xoopsTpl->assign('jquery', get_jquery(true)); }