示例#1
0
/**
 * A unique identifier is defined to store the options in the database and reference them from the theme.
 * By default it uses the theme name, in lowercase and without spaces, but this can be changed if needed.
 * If the identifier changes, it'll appear as if the options have been reset.
 */
function optionsframework_option_name()
{
    global $shortname;
    global $themename;
    // This gets the theme name from the stylesheet
    $themename = get_option('stylesheet');
    $themename = preg_replace("/\\W/", "_", strtolower($themename));
    $optionsframework_settings = get_option('optionsframework');
    $optionsframework_settings['id'] = $themename;
    update_option('optionsframework', $optionsframework_settings);
    //setting contact us page
    if (sketch_get_option($shortname . '_contact_page')) {
        select_template(sketch_get_option($shortname . '_contact_page'));
    }
}
示例#2
0
     $moduledb[] = $rs;
 }
 $mid = intval($mid);
 $moduledb_color[$mid] = 'red';
 $group_allowdown = group_box("postdb[allowdown]", explode(",", $rsdb[allowdown]));
 $group_allowview = group_box("postdb[allowview]", explode(",", $rsdb[allowview]));
 $tpl_list = @unserialize($fidDB[template]);
 $tpl_show = @unserialize($rsdb[template]);
 $value_tpl_head = $tpl_show[head] ? $tpl_show[head] : $tpl_list[head];
 $value_tpl_foot = $tpl_show[foot] ? $tpl_show[foot] : $tpl_list[foot];
 $value_tpl_show = $tpl_show[bencandy] ? $tpl_show[bencandy] : $tpl_list[bencandy];
 $tpl_head = select_template("", 7, $value_tpl_head);
 $tpl_head = str_replace("<select", "<select onChange='get_obj(\"head_tpl\").value=this.options[this.selectedIndex].value;'", $tpl_head);
 $tpl_foot = select_template("", 8, $value_tpl_foot);
 $tpl_foot = str_replace("<select", "<select onChange='get_obj(\"foot_tpl\").value=this.options[this.selectedIndex].value;'", $tpl_foot);
 $tpl_show = select_template("", 3, $value_tpl_show);
 $tpl_show = str_replace("<select", "<select onChange='get_obj(\"main_tpl\").value=this.options[this.selectedIndex].value;'", $tpl_show);
 $rsdb[posttime] && ($rsdb[posttime] = date("Y-m-d H:i:s", $rsdb[posttime]));
 $rsdb[begintime] && ($rsdb[begintime] = date("Y-m-d H:i:s", $rsdb[begintime]));
 $rsdb[endtime] && ($rsdb[endtime] = date("Y-m-d H:i:s", $rsdb[endtime]));
 //地址还原
 $rsdb[content] = En_TruePath($rsdb[content], 0);
 $rsdb[content] = editor_replace($rsdb[content]);
 //修改文章时,需要读取自定义模块的数据
 if ($mid && $job != 'postnew' && $job != 'post_more') {
     $_rsdb = $db->get_one("SELECT * FROM `{$pre}article_content_{$mid}` WHERE rid='{$rsdb['rid']}'");
     if ($_rsdb) {
         $rsdb += $_rsdb;
     }
     $i_id = $_rsdb[id];
     set_module_table_value($mid, 1);
示例#3
0
 public static function templates($m, $value = '', $str = '', $fix = '')
 {
     $tems = select_template($m);
     $string = '';
     $string .= '<select ' . $str . '>';
     $string .= '<option value="">默认</option>';
     foreach ($tems as $project => $tpls) {
         if (!is_array($tpls)) {
             continue;
         }
         foreach ($tpls as $tpl) {
             $selected = '';
             $v = $project . ':' . substr($tpl, 0, -5);
             if ($value == $v) {
                 $selected = 'selected';
             }
             $string .= '<option ' . $selected . ' value="' . $v . '">' . $project . ':' . $tpl . "</option>";
         }
     }
     $string .= '</select>';
     return $string;
 }
示例#4
0
 /**
  * 模块设置
  *
  * @author tuzwu
  */
 public function set()
 {
     if (isset($GLOBALS['dosubmit'])) {
         $cache_in_db = cache_in_db($GLOBALS['setting'], V, M);
         set_cache(M, $GLOBALS['setting']);
         MSG(L('operation_success'), HTTP_REFERER, 3000);
     } else {
         $show_dialog = 1;
         load_class('form');
         load_function('template');
         $templates = select_template(M);
         $setting =& $this->_cache;
         if (empty($setting)) {
             $setting = cache_in_db('', V, M);
         }
         $linkage = $this->db->get_list('linkage', '', 'name,linkageid', 0, 100, '', "linkageid ASC", '', 'linkageid');
         foreach ($linkage as $k => $v) {
             $linkage[$k] = $v['name'];
         }
         include $this->template('set', M);
     }
 }
示例#5
0
    $group_viewcontent = group_box("postdb[allowviewcontent]", explode(",", $rsdb[allowviewcontent]));
    $group_download = group_box("postdb[allowdownload]", explode(",", $rsdb[allowdownload]));
    $typedb[$rsdb[type]] = " checked ";
    $forbidshow[intval($rsdb[forbidshow])] = " checked ";
    $tpl = unserialize($rsdb[template]);
    //$tpl_head=select_template("postdb[tpl][head]",7,$tpl[head]);
    //$tpl_foot=select_template("postdb[tpl][foot]",8,$tpl[foot]);
    //$tpl_list=select_template("postdb[tpl][list]",2,$tpl['list']);
    //$tpl_bencandy=select_template("postdb[tpl][bencandy]",3,$tpl[bencandy]);
    $tpl_head = select_template("", 7, $tpl[head]);
    $tpl_head = str_replace("<select", "<select onChange='get_obj(\"tpl_head\").value=this.options[this.selectedIndex].value;'", $tpl_head);
    $tpl_foot = select_template("", 8, $tpl[foot]);
    $tpl_foot = str_replace("<select", "<select onChange='get_obj(\"tpl_foot\").value=this.options[this.selectedIndex].value;'", $tpl_foot);
    $tpl_list = select_template("", 2, $tpl['list']);
    $tpl_list = str_replace("<select", "<select onChange='get_obj(\"tpl_list\").value=this.options[this.selectedIndex].value;'", $tpl_list);
    $tpl_bencandy = select_template("", 3, $tpl[bencandy]);
    $tpl_bencandy = str_replace("<select", "<select onChange='get_obj(\"tpl_bencandy\").value=this.options[this.selectedIndex].value;'", $tpl_bencandy);
    $listorder[$rsdb[listorder]] = " selected ";
    $module_id = "<select name='postdb[fmid]'><option value='0'>文章模型</option>";
    $query = $db->query("SELECT * FROM {$pre}article_module  WHERE ifclose=0 ORDER BY list DESC");
    while ($rs = $db->fetch_array($query)) {
        $ckk = $rsdb[fmid] == $rs[id] ? ' selected ' : '';
        $module_id .= "<option value='{$rs['id']}' {$ckk}>{$rs['name']}</option>";
    }
    $module_id .= " </select>";
    require dirname(__FILE__) . "/" . "head.php";
    require dirname(__FILE__) . "/" . "template/fu_sort/menu.htm";
    require dirname(__FILE__) . "/" . "template/fu_sort/batch_edit.htm";
    require dirname(__FILE__) . "/" . "foot.php";
} elseif ($action == 'batch_edit' && $Apower[fu_sort_power]) {
    if (!$ifchang && !$db_index_showtitle && !$db_sonTitleRow && !$db_sonTitleLeng && !$db_cachetime) {
示例#6
0
    $fid_str = "'" . implode("','", $fiddb) . "'";
    $query = $db->query("SELECT * FROM {$pre}sort WHERE fid IN ({$fid_str})");
    while ($rs = $db->fetch_array($query)) {
        $fid_name_db[$rs[fid]] = "【<A HREF='{$webdb['www_url']}{$webdb['path']}/list.php?fid={$rs['fid']}' target=_blank>{$rs['name']}</A>】,";
    }
    foreach ($fiddb as $key => $value) {
        $fid_name .= $fid_name_db[$value];
    }
    //$tpl_head=select_template("postdb[head_tpl]",7,$rsdb[head_tpl]);
    //$tpl_main=select_template("postdb[main_tpl]",1,$rsdb[main_tpl]);
    //$tpl_foot=select_template("postdb[foot_tpl]",8,$rsdb[foot_tpl]);
    $tpl_head = select_template("", 7, $rsdb[head_tpl]);
    $tpl_head = str_replace("<select", "<select onChange='get_obj(\"head_tpl\").value=this.options[this.selectedIndex].value;'", $tpl_head);
    $tpl_foot = select_template("", 8, $rsdb[foot_tpl]);
    $tpl_foot = str_replace("<select", "<select onChange='get_obj(\"foot_tpl\").value=this.options[this.selectedIndex].value;'", $tpl_foot);
    $tpl_main = select_template("", 1, $rsdb[main_tpl]);
    $tpl_main = str_replace("<select", "<select onChange='get_obj(\"main_tpl\").value=this.options[this.selectedIndex].value;'", $tpl_main);
    require dirname(__FILE__) . "/" . "head.php";
    require dirname(__FILE__) . "/" . "template/channel/menu.htm";
    require dirname(__FILE__) . "/" . "template/channel/edit.htm";
    require dirname(__FILE__) . "/" . "foot.php";
} elseif ($action == "add" && $Apower[channel_list]) {
    foreach ($fids as $key => $fid) {
        if (!$fid) {
            unset($fids[$key]);
        }
    }
    $postdb[fids] = implode(",", $fids);
    unset($con);
    $con[line] = $atc_line;
    $con[rows] = $atc_rows;
示例#7
0
 /**
  * 添加栏目
  */
 public function add()
 {
     $type = isset($GLOBALS['type']) ? intval($GLOBALS['type']) : 0;
     $siteid = get_cookie('siteid');
     if (isset($GLOBALS['submit'])) {
         if (!is_array($GLOBALS['catname'])) {
             MSG(L('catname error'));
         }
         $pinyin = load_class('pinyin');
         foreach ($GLOBALS['catname'] as $key => $value) {
             if (trim($value) == '') {
                 continue;
             }
             $formdata = array();
             $formdata = $GLOBALS['form'];
             $formdata['siteid'] = $siteid;
             $formdata['keyid'] = 'content';
             $formdata['pid'] = intval($GLOBALS['form']['pid']);
             $formdata['name'] = trim($value);
             $formdata['type'] = $type;
             if ($GLOBALS['catdir'][$key]) {
                 $formdata['catdir'] = sql_replace($GLOBALS['catdir'][$key]);
             } else {
                 $py = $pinyin->return_py($formdata['name']);
                 $formdata['catdir'] = $py['pinyin'];
             }
             $formdata['parentdir'] = $this->get_parentdir($formdata['pid']);
             $cid = $this->db->insert('category', $formdata);
             if ($type == 2) {
                 $urls['url'] = $GLOBALS['url'];
             } else {
                 //生成url
                 $urlclass = load_class('url', 'content', $formdata);
                 $this->categorys[$cid] = $formdata;
                 $urlclass->set_categorys($this->categorys);
                 $urls = $urlclass->listurl(array('cid' => $cid, 'page' => 1));
             }
             if ($formdata['pid']) {
                 $this->db->update('category', array('child' => 1), array('cid' => $formdata['pid']));
             }
             $this->db->update('category', array('url' => $urls['url']), array('cid' => $cid));
         }
         //更新缓存
         $category_cache = load_class('category_cache', 'content');
         $category_cache->cache_all();
         MSG(L('operation success'), HTTP_REFERER);
     } else {
         $pid = isset($GLOBALS['pid']) ? intval($GLOBALS['pid']) : 0;
         $modelid = 0;
         if ($pid) {
             $r = $this->db->get_one('category', array('cid' => $pid));
             $modelid = $r['modelid'];
             if ($r['siteid'] != $siteid) {
                 MSG('请重新选择上级栏目', '?m=content&f=category&v=add' . $this->su());
             }
         }
         $form = load_class('form');
         $models = $this->db->get_list('model', array('m' => 'content'), '*', 0, 200, 0, '', '', 'modelid');
         $workflow = $this->db->get_list('workflow', array('keyid' => 'content'), '*', 0, 10);
         $where = array('keyid' => M, 'siteid' => $siteid);
         $categorys = $this->db->get_list('category', $where, '*', 0, 2000, 0, '', '', 'cid');
         if (empty($categorys)) {
             $categorys = array();
         }
         load_function('template');
         $templates = select_template('content');
         if ($type == 2) {
             include $this->template('category_add_2');
         } else {
             include $this->template('category_add');
         }
     }
 }
示例#8
0
    //$tpl_main=select_template("postdb[tpl_main]",9,"$rsdb[tpl_main]");
    $tpl_head = select_template("", 7, $rsdb[tpl_head]);
    $tpl_head = str_replace("<select", "<select onChange='get_obj(\"head_tpl\").value=this.options[this.selectedIndex].value;'", $tpl_head);
    $tpl_foot = select_template("", 8, $rsdb[tpl_foot]);
    $tpl_foot = str_replace("<select", "<select onChange='get_obj(\"foot_tpl\").value=this.options[this.selectedIndex].value;'", $tpl_foot);
    $tpl_main = select_template("", 9, $rsdb[tpl_main]);
    $tpl_main = str_replace("<select", "<select onChange='get_obj(\"main_tpl\").value=this.options[this.selectedIndex].value;'", $tpl_main);
    require dirname(__FILE__) . "/" . "head.php";
    require dirname(__FILE__) . "/" . "template/alonepage/menu.htm";
    require dirname(__FILE__) . "/" . "template/alonepage/edit.htm";
    require dirname(__FILE__) . "/" . "foot.php";
} elseif ($job == "add" && $Apower[alonepage_list]) {
    $style_select = select_style('postdb[style]', $rsdb[style]);
    $tpl_head = select_template('', 7, "{$rsdb['tpl_head']}");
    $tpl_foot = select_template('', 8, "{$rsdb['tpl_foot']}");
    $tpl_main = select_template('', 9, "{$rsdb['tpl_main']}");
    $rsdb[filename] = $timestamp . '.htm';
    require dirname(__FILE__) . "/" . "head.php";
    require dirname(__FILE__) . "/" . "template/alonepage/menu.htm";
    require dirname(__FILE__) . "/" . "template/alonepage/edit.htm";
    require dirname(__FILE__) . "/" . "foot.php";
} elseif ($action == "add" && $Apower[alonepage_list]) {
    if ($postdb[filename] && !eregi("(\\.html|\\.htm)\$", $postdb[filename])) {
        showmsg("静态网页名只能是.html或者是.htm文件");
    }
    //对地址做处理
    $postdb[content] = En_TruePath($postdb[content]);
    $db->query("INSERT INTO `{$pre}alonepage` ( `fid` , `name` ,`title` , `posttime` , `uid` , `username` , `style` , `tpl_head` , `tpl_foot` , `tpl_main` , `filename` , `filepath` , `keywords` , `content` ,`descrip`) VALUES ('{$postdb['fid']}','{$postdb['name']}','{$postdb['title']}','{$timestamp}','{$postdb['uid']}','{$postdb['username']}','{$postdb['style']}','{$postdb['tpl_head']}','{$postdb['tpl_foot']}','{$postdb['tpl_main']}','{$postdb['filename']}','{$postdb['filepath']}','{$postdb['keywords']}','{$postdb['content']}','{$postdb['descrip']}')");
    jump("添加成功", "index.php?lfj=alonepage&job=list", 1);
} elseif ($action == "list" && $Apower[alonepage_list]) {
    if (!$iddb[0]) {