Esempio n. 1
0
 public function init()
 {
     $this->load->library('csapp');
     //判断安装
     if (file_exists(FCPATH . 'packs/install/plub_install.lock')) {
         admin_msg(L('plub_opt_04'), site_url('opt/main'), 'no', 'red');
     }
     // 搜索本地模块
     $this->load->helper('directory');
     $local = directory_map(FCPATH . 'plugins/', 1);
     $module = array();
     if ($local) {
         foreach ($local as $dir) {
             if (is_dir(FCPATH . 'plugins/' . $dir)) {
                 $api_file = FCPATH . 'plugins/' . $dir . '/config/setting.php';
                 if (is_file($api_file)) {
                     $API = (require_once $api_file);
                     if ($API['mid']) {
                         $module[$dir] = $API['name'];
                         $modules[] = $API['mid'];
                     }
                 }
             }
         }
         unset($local);
     }
     $data['plub'] = $module;
     $data['mids'] = $modules;
     $this->load->view('init.html', $data);
 }
Esempio n. 2
0
 public function del()
 {
     $fid = intval($this->input->get('fid', TRUE));
     $id = intval($this->input->get('id', TRUE));
     if ($fid > 0) {
         $this->db->query("delete from " . CS_SqlPrefix . "tags where fid=" . $id . "");
     }
     $this->CsdjDB->get_del('tags', $id);
     admin_msg(L('plub_02'), site_url('tags'), 'ok');
     //操作成功
 }
Esempio n. 3
0
 public function del()
 {
     $id = $this->input->get_post('id', true);
     if (empty($id)) {
         admin_msg(L('plub_01'), 'javascript:history.back();', 'no');
     }
     //数据不完成
     $this->CsdjDB->get_del('pl', $id);
     admin_msg(L('plub_02'), site_url('pl'), 'ok');
     //操作成功
 }
Esempio n. 4
0
 public function del()
 {
     $ids = $this->input->get_post('id');
     if (empty($ids)) {
         admin_msg(L('plub_73'), 'javascript:history.back();', 'no');
     }
     if (is_array($ids)) {
         $idss = implode(',', $ids);
     } else {
         $idss = $ids;
     }
     $this->CsdjDB->get_del('dance_server', $ids);
     admin_msg(L('plub_74'), 'javascript:history.back();', 'ok');
     //操作成功
 }
Esempio n. 5
0
 public function get_url($url)
 {
     $arr = htmlall($url);
     if (empty($arr)) {
         admin_msg(L('curl_err'), @$_SERVER['HTTP_REFERER'], 'no');
         //获取远程失败
     } else {
         $arr = json_decode($arr, true);
         $arr = get_bm($arr);
         if ($arr['status'] == 0) {
             admin_msg($arr['msg'], @$_SERVER['HTTP_REFERER'], 'no');
             //错误状态
         } else {
             return $arr['msg'];
         }
     }
 }
Esempio n. 6
0
 public function index()
 {
     if (Web_Mode != 2) {
         admin_msg(L('plub_01'), site_url('opt/main'), 'no');
         //动态模式不用生成
     }
     $this->load->get_templates();
     //转换视图为前台
     $html = $this->CsdjTpl->home(TRUE);
     $file = FCPATH . Html_Index;
     if (write_file($file, $html)) {
         admin_msg(L('plub_02'), site_url('opt/main'), 'ok');
         //生成成功
     } else {
         admin_msg(L('plub_03'), site_url('opt/main'), 'no');
         //根目录没有写入权限
     }
 }
Esempio n. 7
0
 public function show_save()
 {
     if ($this->huri['show']['check'] == 0) {
         admin_msg('相册内容页未开启生成~!', 'javascript:history.back();', 'no');
     }
     $day = intval($this->input->get_post('day', true));
     //最近几天
     $ids = $this->input->get_post('ids', true);
     //需要生成的数据ID
     $cid = $this->input->get_post('cid', true);
     //需要生成的分类ID
     $newid = intval($this->input->get_post('newid'));
     //最新个数
     $ksid = intval($this->input->get_post('ksid'));
     //开始ID
     $jsid = intval($this->input->get_post('jsid'));
     //结束ID
     $kstime = $this->input->get_post('kstime', true);
     //开始日期
     $jstime = $this->input->get_post('jstime', true);
     //结束日期
     $pagesize = intval($this->input->get('pagesize'));
     //每页多少条
     $pagejs = intval($this->input->get('pagejs'));
     //总页数
     $datacount = intval($this->input->get('datacount'));
     //数据总数
     $page = intval($this->input->get('page'));
     //当前页
     if ($page == 0) {
         $page = 1;
     }
     $str = '';
     //将数组转换成字符
     if (is_array($cid)) {
         $cid = implode(',', $cid);
     }
     if (is_array($ids)) {
         $ids = implode(',', $ids);
     }
     if ($day > 0) {
         $times = time() - 86400 * $day;
         $str .= ' and addtime>' . $times . '';
     }
     if (!empty($cid)) {
         $str .= ' and cid in (' . $cid . ')';
     }
     if (!empty($ids)) {
         $str .= ' and id in (' . $ids . ')';
     }
     if ($ksid > 0 && $jsid > 0) {
         $str .= ' and id>' . ($ksid - 1) . ' and id<' . ($jsid + 1) . '';
     }
     if (!empty($kstime) && !empty($jstime)) {
         $ktime = strtotime($kstime) - 86400;
         $jtime = strtotime($jstime) + 86400;
         $str .= ' and addtime>' . $ktime . ' and addtime<' . $jtime . '';
     }
     $limit = '';
     if ($newid > 0) {
         $limit = ' order by id desc limit ' . $newid;
     }
     if ($datacount == 0) {
         $sqlstr = "select id from " . CS_SqlPrefix . "pic_type where yid=0 and hid=0 " . $str . $limit;
         $datacount = $this->db->query($sqlstr)->num_rows();
         //总数量
         $pagejs = ceil($datacount / Html_PageNum);
     }
     if ($datacount == 0) {
         $pagejs = 1;
     }
     $pagesize = Html_PageNum;
     if ($datacount < $pagesize) {
         $pagesize = $datacount;
     }
     //全部生成完毕
     if ($page > $pagejs) {
         admin_msg('所有内容页全部生成完毕~!', site_url('pic/admin/html/show'));
     }
     //公众URI
     $uri = '?day=' . $day . '&cid=' . $cid . '&ids=' . $ids . '&newid=' . $newid . '&ksid=' . $ksid . '&jsid=' . $jsid . '&kstime=' . $kstime . '&jstime=' . $jstime . '&pagesize=' . $pagesize . '&pagejs=' . $pagejs . '&datacount=' . $datacount;
     //重新定义模板路径
     $this->load->get_templates('pic', 2);
     echo '<LINK href="' . base_url() . 'packs/admin/css/style.css" type="text/css" rel="stylesheet"><br>';
     echo '&nbsp;&nbsp;<b>正在开始生成相册内容,分<font color=red>' . $pagejs . '</font>次生成,当前第<font color=red>' . $page . '</font>次</b><br/>';
     $sql_string = "select * from " . CS_SqlPrefix . "pic_type where yid=0 and hid=0 " . $str . " order by id desc";
     $sql_string .= ' limit ' . $pagesize * ($page - 1) . ',' . $pagesize;
     $query = $this->db->query($sql_string);
     //获取内容页是否需要生成
     $html = config('Html_Uri', 'pic');
     foreach ($query->result_array() as $row) {
         ob_end_flush();
         //关闭缓存
         $id = $row['id'];
         //获取静态路径
         $Htmllinks = LinkUrl('show', 'id', $row['id'], 0, 'pic');
         //转换成生成路径
         $Htmllink = adminhtml($Htmllinks, 'pic');
         //摧毁部分需要超级链接字段数组
         $rows = $row;
         //先保存数组保留下面使用
         unset($row['tags']);
         unset($row['hits']);
         unset($row['yhits']);
         unset($row['zhits']);
         unset($row['rhits']);
         unset($row['dhits']);
         unset($row['chits']);
         unset($row['content']);
         //默认模板
         $skins = empty($row['skins']) ? 'show.html' : $row['skins'];
         $arr['cid'] = getChild($row['cid']);
         $arr['uid'] = $row['uid'];
         $arr['tags'] = $rows['tags'];
         $arr['sid'] = $row['id'];
         //装载模板并输出
         $Mark_Text = $this->CsdjTpl->plub_show('pic', $row, $arr, TRUE, $skins, $row['name'], $row['name']);
         //评论
         $Mark_Text = str_replace("[pic:pl]", get_pl('pic', $id), $Mark_Text);
         //分类地址、名称
         $Mark_Text = str_replace("[pic:link]", LinkUrl('show', 'id', $row['id'], 1, 'pic'), $Mark_Text);
         $Mark_Text = str_replace("[pic:classlink]", LinkUrl('lists', 'id', $row['cid'], 1, 'pic'), $Mark_Text);
         $Mark_Text = str_replace("[pic:classname]", $this->CsdjDB->getzd('pic_list', 'name', $row['cid']), $Mark_Text);
         //获取上下篇
         preg_match_all('/[pic:slink]/', $Mark_Text, $arr);
         if (!empty($arr[0]) && !empty($arr[0][0])) {
             $rowd = $this->db->query("Select id,cid,pic,name from " . CS_SqlPrefix . "pic_type where yid=0 and hid=0 and id<" . $id . " order by id desc limit 1")->row();
             if ($rowd) {
                 $Mark_Text = str_replace("[pic:slink]", LinkUrl('show', 'id', $rowd->id, 1, 'pic'), $Mark_Text);
                 $Mark_Text = str_replace("[pic:sname]", $rowd->name, $Mark_Text);
                 $Mark_Text = str_replace("[pic:sid]", $rowd->id, $Mark_Text);
                 $Mark_Text = str_replace("[pic:spic]", piclink('pic', $rowd->pic), $Mark_Text);
             } else {
                 $Mark_Text = str_replace("[pic:slink]", "#", $Mark_Text);
                 $Mark_Text = str_replace("[pic:sname]", "没有了", $Mark_Text);
                 $Mark_Text = str_replace("[pic:sid]", 0, $Mark_Text);
                 $Mark_Text = str_replace("[pic:spic]", piclink('pic', ''), $Mark_Text);
             }
         }
         unset($arr);
         preg_match_all('/[pic:xlink]/', $Mark_Text, $arr);
         if (!empty($arr[0]) && !empty($arr[0][0])) {
             $rowd = $this->db->query("Select id,cid,pic,name from " . CS_SqlPrefix . "pic_type where yid=0 and hid=0 and id>" . $id . " order by id asc limit 1")->row();
             if ($rowd) {
                 $Mark_Text = str_replace("[pic:xlink]", LinkUrl('show', 'id', $rowd->id, 1, 'pic'), $Mark_Text);
                 $Mark_Text = str_replace("[pic:xname]", $rowd->name, $Mark_Text);
                 $Mark_Text = str_replace("[pic:xid]", $rowd->id, $Mark_Text);
                 $Mark_Text = str_replace("[pic:xpic]", piclink('pic', $rowd->pic), $Mark_Text);
             } else {
                 $Mark_Text = str_replace("[pic:xlink]", "#", $Mark_Text);
                 $Mark_Text = str_replace("[pic:xname]", "没有了", $Mark_Text);
                 $Mark_Text = str_replace("[pic:xid]", 0, $Mark_Text);
                 $Mark_Text = str_replace("[pic:xpic]", piclink('pic', ''), $Mark_Text);
             }
         }
         unset($arr);
         //标签加超级连接
         $Mark_Text = str_replace("[pic:tags]", SearchLink($rows['tags']), $Mark_Text);
         //动态人气
         $Mark_Text = str_replace("[pic:hits]", "<script src='" . hitslink('hits/dt/hits/' . $id, 'pic') . "'></script>", $Mark_Text);
         $Mark_Text = str_replace("[pic:yhits]", "<script src='" . hitslink('hits/dt/yhits/' . $id, 'pic') . "'></script>", $Mark_Text);
         $Mark_Text = str_replace("[pic:zhits]", "<script src='" . hitslink('hits/dt/zhits/' . $id, 'pic') . "'></script>", $Mark_Text);
         $Mark_Text = str_replace("[pic:rhits]", "<script src='" . hitslink('hits/dt/rhits/' . $id, 'pic') . "'></script>", $Mark_Text);
         $Mark_Text = str_replace("[pic:dhits]", "<script src='" . hitslink('hits/dt/dhits/' . $id, 'pic') . "'></script>", $Mark_Text);
         $Mark_Text = str_replace("[pic:chits]", "<script src='" . hitslink('hits/dt/chits/' . $id, 'pic') . "'></script>", $Mark_Text);
         //获取当前相册总数
         $pcount = $this->db->query("Select id from " . CS_SqlPrefix . "pic where sid=" . $id . " and hid=0 and yid=0")->num_rows();
         $Mark_Text = str_replace("[pic:count]", $pcount, $Mark_Text);
         //第一张图片
         $rowp = $this->db->query("Select pic,content from " . CS_SqlPrefix . "pic where sid=" . $id . " and hid=0 and yid=0 order by id desc limit 1")->row();
         $pics = $rowp ? $rowp->pic : '';
         $content = $rowp ? $rowp->content : '';
         $Mark_Text = str_replace("[pic:url]", piclink('pic', $pics), $Mark_Text);
         $Mark_Text = str_replace("[pic:content]", $content, $Mark_Text);
         //增加人气
         $Mark_Text = hits_js($Mark_Text, hitslink('hits/ids/' . $id, 'pic'));
         //生成
         write_file(FCPATH . $Htmllink, $Mark_Text);
         echo "&nbsp;<font style=font-size:10pt;>生成相册:<font color=red>" . $row['name'] . "</font>成功:<a href=" . $Htmllinks . " target=_blank>" . $Htmllinks . "</a></font><br/>";
         ob_flush();
         flush();
     }
     if (!empty($ids)) {
         $url = 'javascript:history.back();';
         $str = "&nbsp;&nbsp;<b>全部生成完毕&nbsp;>>>>&nbsp;&nbsp;<a href='" . $url . "'>如果您的 浏览器没有跳转,请点击继续...</a></b>";
     } else {
         $url = site_url('pic/admin/html/show_save') . $uri . '&page=' . ($page + 1);
         $str = "&nbsp;&nbsp;<b>暂停" . Html_StopTime . "秒后继续&nbsp;>>>>&nbsp;&nbsp;<a href='" . $url . "'>如果您的 浏览器没有跳转,请点击继续...</a></b>";
     }
     echo "</br>" . $str . "<script>setTimeout('updatenext();'," . Html_StopTime . "000);function updatenext(){location.href='" . $url . "';}</script>";
 }
Esempio n. 8
0
 public function downpic()
 {
     $page = intval($this->input->get('page'));
     $pagejs = intval($this->input->get('pagejs'));
     $sql_string = "SELECT id,pic FROM " . CS_SqlPrefix . "vod where hid=0 and yid=0 and Lower(Left(pic,7))='http://' order by addtime desc";
     $query = $this->db->query($sql_string);
     $total = $query->num_rows();
     if ($page > $pagejs || $total == 0) {
         admin_msg('恭喜您,所有远程图片全部同步完成~!', site_url('vod/admin/vod'), 'ok');
         //操作完成
     }
     if ($page == 0) {
         $page = 1;
     }
     $per_page = 20;
     $totalPages = ceil($total / $per_page);
     // 总页数
     if ($total < $per_page) {
         $per_page = $total;
     }
     if ($pagejs == 0) {
         $pagejs = $totalPages;
     }
     $sql_string .= ' limit 20';
     $query = $this->db->query($sql_string);
     //保存目录
     if (UP_Mode == 1 && UP_Pan != '') {
         $pathpic = UP_Pan . '/attachment/vod/' . date('Ym') . '/' . date('d') . '/';
         $pathpic = str_replace("//", "/", $pathpic);
     } else {
         $pathpic = FCPATH . 'attachment/vod/' . date('Ym') . '/' . date('d') . '/';
     }
     if (!is_dir($pathpic)) {
         mkdirss($pathpic);
     }
     $this->load->library('watermark');
     $this->load->library('csup');
     echo '<LINK href="' . Web_Path . 'packs/admin/css/style.css" type="text/css" rel="stylesheet"><br>';
     echo "<div style='font-size:14px;'>&nbsp;&nbsp;&nbsp;<b>正在开始同步第<font style='color:red; font-size:12px; font-style:italic'>" . $page . "</font>页,共<font style='color:red; font-size:12px; font-style:italic'>" . $pagejs . "</font>页,剩<font style='color:red; font-size:12px; font-style:italic'>" . $totalPages . "</font>页</b><br><br>";
     foreach ($query->result() as $row) {
         $up = 'no';
         if (!empty($row->pic)) {
             $picdata = htmlall($row->pic);
             $file_ext = strtolower(trim(substr(strrchr($row->pic, '.'), 1)));
             if ($file_ext != 'jpg' && $file_ext != 'png' && $file_ext != 'gif') {
                 $file_ext = 'jpg';
             }
             //新文件名
             $file_name = date("YmdHis") . rand(10000, 99999) . '.' . $file_ext;
             $file_path = $pathpic . $file_name;
             if (!empty($picdata)) {
                 //保存图片
                 if (write_file($file_path, $picdata)) {
                     $up = 'ok';
                     //判断水印
                     if (CS_WaterMark == 1) {
                         $this->watermark->imagewatermark($file_path);
                     }
                     //判断上传方式
                     $res = $this->csup->up($file_path, $file_name);
                     if (!$res) {
                         $up = 'no';
                     }
                 }
             }
         }
         //成功
         if ($up == 'ok') {
             //修改数据库
             $this->db->query("update " . CS_SqlPrefix . "vod set pic='/" . date('Ym') . "/" . date('d') . "/" . $file_name . "' where id=" . $row->id . "");
             echo "&nbsp;&nbsp;&nbsp;&nbsp;同步<font color=red>" . $row->pic . "</font>&nbsp;图片成功!&nbsp;&nbsp;新图片名:<a href=\"" . piclink('vod', '/' . date('Ym') . '/' . date('d') . '/' . $file_name) . "\" target=_blank>" . $file_name . "</a></br>";
         } else {
             //修改数据库
             $this->db->query("update " . CS_SqlPrefix . "vod set pic='' where id=" . $row->id . "");
             echo "&nbsp;&nbsp;&nbsp;&nbsp;<font color=red>" . $row->pic . "</font>远程图片不存在!</br>";
         }
         ob_flush();
         flush();
     }
     echo "&nbsp;&nbsp;&nbsp;&nbsp;第" . $page . "页图片同步完毕,暂停3秒后继续同步......<script language='javascript'>setTimeout('ReadGo();'," . 3000 . ");function ReadGo(){location.href='" . site_url('vod/admin/opt/downpic') . "?page=" . ($page + 1) . "&pagejs=" . $pagejs . "';}</script></div>";
 }
Esempio n. 9
0
            $admin_script = 'setting_manage';
        } else {
            exit("admin.php error");
        }
    }
    if ($admin_script) {
        if (file_exists(CYASK_ROOT . './admin/' . $admin_script . '.php')) {
            require CYASK_ROOT . './admin/' . $admin_script . '.php';
        } else {
            admin_header();
            admin_msg('admin_file_not_exists');
            admin_footer();
        }
    } else {
        admin_header();
        admin_msg('noaccess');
        admin_footer();
    }
}
function admin_header()
{
    extract($GLOBALS, EXTR_SKIP);
    global $charset;
    echo '<html><head><meta http-equiv="Content-Type" content="text/html; charset=' . $charset . '">
	<style type="text/css">
<!--
a			{ text-decoration: none; color: #003366 }
a:hover			{ text-decoration: underline }
body			{ scrollbar-base-color: #F8F8F8; scrollbar-arrow-color: #698CC3; font-size: 12px; background-color: #9EB6D8 }
table			{ font: 12px Tahoma, Verdana; color: #000000 }
input,select,textarea	{ font: 11px Tahoma, Verdana; color: #000000; font-weight: normal; background-color: #F8F8F8 }
Esempio n. 10
0
 public function checkfile()
 {
     if (!empty($_GET['ok'])) {
         $data['diff'] = array();
         $data['lostfile'] = array();
         $data['unknowfile'] = array();
         $this->filemd5('.');
         //读取cscms接口
         $cscms_md5 = htmlall($this->_upgrade . 'ajax/filemd5?charset=' . CS_Charset . '&update=' . CS_Uptime);
         $cscms_md5_arr = json_decode($cscms_md5, 1);
         if (!empty($cscms_md5_arr)) {
             //计算数组差集
             $diff = array_diff($cscms_md5_arr, $this->md5_arr);
             //丢失文件列表
             $lostfile = array();
             foreach ($cscms_md5_arr as $k => $v) {
                 if (!in_array($k, array_keys($this->md5_arr))) {
                     $lostfile[] = $k;
                     unset($diff[$k]);
                 }
             }
             $data['diff'] = $diff;
             $data['lostfile'] = $lostfile;
             //未知文件列表
             $data['unknowfile'] = array_diff(array_keys($this->md5_arr), array_keys($cscms_md5_arr));
         }
         $this->load->view('upgrade_md5.html', $data);
     } else {
         admin_msg(L('plub_15'), site_url('upgrade/checkfile') . '?ok=1', 'ok');
         //操作成功
     }
 }
Esempio n. 11
0
 public function hy()
 {
     $ids = $this->input->get_post('id');
     if (empty($ids)) {
         admin_msg('请选择要还原的数据~!', 'javascript:history.back();', 'no');
     }
     if (is_array($ids)) {
         $idss = implode(',', $ids);
     } else {
         $idss = $ids;
     }
     $data['hid'] = 0;
     $this->CsdjDB->get_update('pic', $ids, $data);
     admin_msg('恭喜您,数据还原成功~!', 'javascript:history.back();', 'ok');
     //操作成功
 }
Esempio n. 12
0
 public function add_save()
 {
     $sid = intval($this->input->post('sid', TRUE));
     $tel = $this->input->post('tel', TRUE);
     $tel2 = nl2br($this->input->post('tel2'));
     $neir = $this->input->post('neir');
     if (empty($neir)) {
         admin_msg(L('plub_04'), 'javascript:history.back();', 'no');
     }
     if ($sid == 1) {
         $arr = $tel;
     } elseif ($sid == 2) {
         $arr = str_replace("<br />", ",", $tel2);
         $arr = str_replace("\r\n", "", $arr);
     }
     if (empty($arr)) {
         admin_msg(L('plub_05'), 'javascript:history.back();', 'no');
     }
     $res = $this->smstel->add($arr, $neir);
     if (intval($res) > 0) {
         admin_msg(vsprintf(L('plub_06'), array($res)), 'javascript:history.back();', 'ok');
     } else {
         admin_msg(L('plub_07'), 'javascript:history.back();', 'no');
     }
 }
Esempio n. 13
0
 public function add_save()
 {
     $sid = intval($this->input->post('sid', TRUE));
     $email = $this->input->post('email', TRUE);
     $email2 = nl2br($this->input->post('email2'));
     $zu = $this->input->post('zu', TRUE);
     $title = $this->input->post('title', TRUE);
     $neir = $this->input->post('neir');
     if (empty($title) || empty($neir)) {
         admin_msg(L('plub_04'), 'javascript:history.back();', 'no');
     }
     if ($sid == 1) {
         $arr[] = $email;
     } elseif ($sid == 2) {
         $arr = explode("<br />", $email2);
     } else {
         $arr = array();
         if (intval($zu) > 0) {
             $result = $this->db->query("select email from " . CS_SqlPrefix . "user where vip=" . $zu . "");
         } elseif ($zu == 0) {
             $result = $this->db->query("select email from " . CS_SqlPrefix . "user where vip=0");
         } else {
             $result = $this->db->query("select email from " . CS_SqlPrefix . "user");
         }
         foreach ($result->result() as $row) {
             if (!empty($row->email)) {
                 $arr[] = $row->email;
             }
         }
     }
     if (empty($arr)) {
         admin_msg(L('plub_05'), 'javascript:history.back();', 'no');
     }
     $this->load->model('CsdjEmail');
     foreach ($arr as $email) {
         $this->CsdjEmail->send($email, $title, $neir);
     }
     admin_msg(L('plub_06'), 'javascript:history.back();', 'ok');
 }
Esempio n. 14
0
 public function del()
 {
     $ids = $this->input->get_post('id');
     if (empty($ids)) {
         admin_msg('请选择要删除的数据~!', 'javascript:history.back();', 'no');
     }
     if (is_array($ids)) {
         $idss = implode(',', $ids);
     } else {
         $idss = $ids;
     }
     $this->CsdjDB->get_del('vod_list', $ids, 'fid');
     $this->CsdjDB->get_del('vod_list', $ids);
     admin_msg('恭喜您,删除成功~!', 'javascript:history.back();', 'ok');
     //操作成功
 }
Esempio n. 15
0
    if (!empty($id)) {
        $result = $db->GetRow("SELECT * FROM mycms_picture_list WHERE id={$id}");
        if ($result) {
            if (is_file('../uploads/' . $result['smallimage'] . '')) {
                //删除小图片
                @unlink('../uploads/' . $result['smallimage'] . '');
            }
            if (is_file('../uploads/' . $result['bigimage'] . '')) {
                //删除大图片
                @unlink('../uploads/' . $result['bigimage'] . '');
            }
        }
        $db->Execute("DELETE FROM mycms_picture_list WHERE id={$id}");
        admin_msg($_SERVER['HTTP_REFERER'], '恭喜删除图片成功!');
    } else {
        admin_msg($_SERVER['HTTP_REFERER'], '参数不正确,不能删除该产品!');
    }
} else {
    $result = $db->GetAll('SELECT * FROM mycms_picture_class');
    foreach ($result as $key => $v) {
        $img = $db->GetRow('SELECT smallimage FROM mycms_picture_list WHERE cid=' . $v['cid'] . ' LIMIT 0,1');
        if ($img) {
            $result[$key]['smallimage'] = $img['smallimage'];
        } else {
            $result[$key]['smallimage'] = '';
        }
    }
    $smarty->assign('piclist', $result);
    $smarty->display('admin/picture.html');
}
$db->close();
Esempio n. 16
0
    $rs['address'] = $_POST['address'];
    //$rs['salary'] = $_POST['salary'];
    $rs["email"] = $_POST["email"];
    $rs["responsibilities"] = $_POST["responsibilities"];
    $rs['content'] = $_POST['content'];
    $rs['time'] = date('Y-m-d h:i:s');
    $updateSql = $db->GetUpdateSQL($result, $rs);
    $db->Execute($updateSql);
    admin_msg('job.php', '恭喜:招聘信息编辑成功!');
} elseif ($_GET['action'] == 'del') {
    $id = $_GET['id'];
    if (!empty($id)) {
        $db->Execute("DELETE FROM mycms_job_list WHERE id={$id}");
        admin_msg($_SERVER['HTTP_REFERER'], '恭喜:删除招聘信息成功!');
    } else {
        admin_msg($_SERVER['HTTP_REFERER'], '错误信息:参数不正确,不能删除该招聘信息!');
    }
} else {
    $table = 'mycms_job_list';
    $where = '1';
    $sql = "SELECT * FROM {$table} WHERE {$where} ORDER BY id DESC";
    $pagesize = 10;
    $currentPage = @$_REQUEST['page'] + 0;
    if (!is_numeric($currentPage) || $currentPage < 1 || empty($currentPage)) {
        $currentPage = 1;
    }
    $result = $db->SelectLimit($sql, $pagesize, ($currentPage - 1) * $pagesize);
    $result = $result->GetArray();
    $smarty->assign('joblist', $result);
    page($table, $pagesize, 3, $where, true, false, 'pagelink');
    $smarty->display('admin/pages/job.tpl.html');
Esempio n. 17
0
<?php

require 'global.php';
session_start();
if (isset($_POST['submit'])) {
    $name = $_POST['name'];
    $email = $_POST['email'];
    $url = $_POST['url'];
    $content = $_POST['content'];
    $code = $_POST['code'];
    if (@$_SESSION['authcode'] != md5($code)) {
        admin_msg('message.php', '错误提示:您输入的验证码不正确!');
    }
    if (empty($name) || empty($email) || empty($content)) {
        admin_msg('message.php', '错误提示:请将还*号的内容填写完整!');
    }
    $result = $db->Execute('SELECT * FROM mycms_message WHERE id=-1');
    $rs = array();
    $rs['name'] = $name;
    $rs['email'] = $email;
    $rs['url'] = $url;
    $rs['content'] = $content;
    $rs['time'] = date('Y-m-d h:i:s');
    $rs['isshow'] = 0;
    $insertSQL = $db->GetInsertSQL($result, $rs);
    $db->Execute($insertSQL);
    admin_msg('message.php', '恭喜:在线留言成功,我们会尽快给你答复!');
} else {
    $smarty->display(TEMP . 'cn/message.html');
}
Esempio n. 18
0
    public function pl_save()
    {
        $xid = intval($this->input->post('xid'));
        $csid = $this->input->post('csid');
        $id = $this->input->post('id', true);
        $cids = intval($this->input->post('cids'));
        $cid = intval($this->input->post('cid'));
        $hid = intval($this->input->post('hid'));
        $tid = intval($this->input->post('tid'));
        $yid = intval($this->input->post('yid'));
        $user = $this->input->post('user', true);
        $reco = intval($this->input->post('reco'));
        $cion = intval($this->input->post('cion'));
        $vip = intval($this->input->post('vip'));
        $hits = intval($this->input->post('hits'));
        $yhits = intval($this->input->post('yhits'));
        $zhits = intval($this->input->post('zhits'));
        $rhits = intval($this->input->post('rhits'));
        if (empty($csid)) {
            admin_msg('请选择要操作的数据~!', 'javascript:history.back();', 'no');
        }
        if ($xid == 1) {
            //按ID操作
            if (empty($id)) {
                admin_msg('请选择要操作的新闻ID~!', 'javascript:history.back();', 'no');
            }
            foreach ($csid as $v) {
                if ($v == "cid") {
                    $this->db->query("update " . CS_SqlPrefix . "news set cid=" . $cid . " where id in (" . $id . ")");
                } elseif ($v == "yid") {
                    if ($yid == 0) {
                        $this->dt($id);
                    }
                    $this->db->query("update " . CS_SqlPrefix . "news set yid=" . $yid . " where id in (" . $id . ")");
                } elseif ($v == "tid") {
                    $this->db->query("update " . CS_SqlPrefix . "news set tid=" . $tid . " where id in (" . $id . ")");
                } elseif ($v == "reco") {
                    $this->db->query("update " . CS_SqlPrefix . "news set reco=" . $reco . " where id in (" . $id . ")");
                } elseif ($v == "cion") {
                    $this->db->query("update " . CS_SqlPrefix . "news set ciond=" . $cion . " where id in (" . $id . ")");
                } elseif ($v == "vip") {
                    $this->db->query("update " . CS_SqlPrefix . "news set vip=" . $vip . " where id in (" . $id . ")");
                } elseif ($v == "hits") {
                    $this->db->query("update " . CS_SqlPrefix . "news set hits=" . $hits . " where id in (" . $id . ")");
                } elseif ($v == "yhits") {
                    $this->db->query("update " . CS_SqlPrefix . "news set yhits=" . $yhits . " where id in (" . $id . ")");
                } elseif ($v == "zhits") {
                    $this->db->query("update " . CS_SqlPrefix . "news set zhits=" . $zhits . " where id in (" . $id . ")");
                } elseif ($v == "rhits") {
                    $this->db->query("update " . CS_SqlPrefix . "news set rhits=" . $rhits . " where id in (" . $id . ")");
                } elseif ($v == "user") {
                    $uid = intval(getzd('user', 'id', $user, 'name'));
                    $this->db->query("update " . CS_SqlPrefix . "news set uid=" . $uid . " where id in (" . $id . ")");
                } elseif ($v == "hid") {
                    if ($hid == 2) {
                        $this->CsdjDB->get_del('news', $id);
                    } else {
                        $this->db->query("update " . CS_SqlPrefix . "news set hid=" . $hid . " where id in (" . $id . ")");
                    }
                }
            }
        } else {
            //按分类操作
            if (empty($cids)) {
                admin_msg('请选择要操作的新闻分类~!', 'javascript:history.back();', 'no');
            }
            foreach ($csid as $v) {
                if ($v == "cid") {
                    $this->db->query("update " . CS_SqlPrefix . "news set cid=" . $cid . " where cid in (" . $cids . ")");
                } elseif ($v == "yid") {
                    if ($yid == 0) {
                        $this->dt($id);
                    }
                    $this->db->query("update " . CS_SqlPrefix . "news set yid=" . $yid . " where cid in (" . $cids . ")");
                } elseif ($v == "tid") {
                    $this->db->query("update " . CS_SqlPrefix . "news set tid=" . $tid . " where cid in (" . $cids . ")");
                } elseif ($v == "reco") {
                    $this->db->query("update " . CS_SqlPrefix . "news set reco=" . $reco . " where cid in (" . $cids . ")");
                } elseif ($v == "cion") {
                    $this->db->query("update " . CS_SqlPrefix . "news set cion=" . $cion . " where cid in (" . $cids . ")");
                } elseif ($v == "vip") {
                    $this->db->query("update " . CS_SqlPrefix . "news set vip=" . $vip . " where cid in (" . $cids . ")");
                } elseif ($v == "hits") {
                    $this->db->query("update " . CS_SqlPrefix . "news set hits=" . $hits . " where cid in (" . $cids . ")");
                } elseif ($v == "yhits") {
                    $this->db->query("update " . CS_SqlPrefix . "news set yhits=" . $yhits . " where cid in (" . $cids . ")");
                } elseif ($v == "zhits") {
                    $this->db->query("update " . CS_SqlPrefix . "news set zhits=" . $zhits . " where cid in (" . $cids . ")");
                } elseif ($v == "rhits") {
                    $this->db->query("update " . CS_SqlPrefix . "news set rhits=" . $rhits . " where cid in (" . $cids . ")");
                } elseif ($v == "user") {
                    $uid = intval(getzd('user', 'id', $user, 'name'));
                    $this->db->query("update " . CS_SqlPrefix . "news set uid=" . $uid . " where cid in (" . $cids . ")");
                } elseif ($v == "hid") {
                    if ($hid == 2) {
                        $this->CsdjDB->get_del('news', $cids);
                    } else {
                        $this->db->query("update " . CS_SqlPrefix . "news set hid=" . $hid . " where cid in (" . $cids . ")");
                    }
                }
            }
        }
        exit('<script type="text/javascript">
			parent.location.href=parent.location.href;
			parent.tip_cokes();
			</script>');
        //操作成功
    }
Esempio n. 19
0
 public function show_save()
 {
     if ($this->huri['show']['check'] == 0) {
         admin_msg('视频内容页未开启生成~!', 'javascript:history.back();', 'no');
     }
     $day = intval($this->input->get_post('day', true));
     //最近几天
     $ids = $this->input->get_post('ids', true);
     //需要生成的数据ID
     $cid = $this->input->get_post('cid', true);
     //需要生成的分类ID
     $newid = intval($this->input->get_post('newid'));
     //最新个数
     $ksid = intval($this->input->get_post('ksid'));
     //开始ID
     $jsid = intval($this->input->get_post('jsid'));
     //结束ID
     $kstime = $this->input->get_post('kstime', true);
     //开始日期
     $jstime = $this->input->get_post('jstime', true);
     //结束日期
     $pagesize = intval($this->input->get('pagesize'));
     //每页多少条
     $pagejs = intval($this->input->get('pagejs'));
     //总页数
     $datacount = intval($this->input->get('datacount'));
     //数据总数
     $page = intval($this->input->get('page'));
     //当前页
     if ($page == 0) {
         $page = 1;
     }
     $str = '';
     //将数组转换成字符
     if (is_array($cid)) {
         $cid = implode(',', $cid);
     }
     if (is_array($ids)) {
         $ids = implode(',', $ids);
     }
     if ($day > 0) {
         $times = time() - 86400 * $day;
         $str .= ' and addtime>' . $times . '';
     }
     if (!empty($cid)) {
         $str .= ' and cid in (' . $cid . ')';
     }
     if (!empty($ids)) {
         $str .= ' and id in (' . $ids . ')';
     }
     if ($ksid > 0 && $jsid > 0) {
         $str .= ' and id>' . ($ksid - 1) . ' and id<' . ($jsid + 1) . '';
     }
     if (!empty($kstime) && !empty($jstime)) {
         $ktime = strtotime($kstime) - 86400;
         $jtime = strtotime($jstime) + 86400;
         $str .= ' and addtime>' . $ktime . ' and addtime<' . $jtime . '';
     }
     $limit = '';
     if ($newid > 0) {
         $limit = ' order by id desc limit ' . $newid;
     }
     if ($datacount == 0) {
         $sqlstr = "select id from " . CS_SqlPrefix . "vod where yid=0 and hid=0 " . $str . $limit;
         $datacount = $this->db->query($sqlstr)->num_rows();
         //总数量
         $pagejs = ceil($datacount / Html_PageNum);
     }
     if ($datacount == 0) {
         $pagejs = 1;
     }
     $pagesize = Html_PageNum;
     if ($datacount < $pagesize) {
         $pagesize = $datacount;
     }
     //全部生成完毕
     if ($page > $pagejs) {
         admin_msg('所有内容页全部生成完毕~!', site_url('vod/admin/html/show'));
     }
     //公众URI
     $uri = '?day=' . $day . '&cid=' . $cid . '&ids=' . $ids . '&newid=' . $newid . '&ksid=' . $ksid . '&jsid=' . $jsid . '&kstime=' . $kstime . '&jstime=' . $jstime . '&pagesize=' . $pagesize . '&pagejs=' . $pagejs . '&datacount=' . $datacount;
     //重新定义模板路径
     $this->load->get_templates('vod', 2);
     echo '<LINK href="' . base_url() . 'packs/admin/css/style.css" type="text/css" rel="stylesheet"><br>';
     echo '&nbsp;&nbsp;<b>正在开始生成视频内容,分<font color=red>' . $pagejs . '</font>次生成,当前第<font color=red>' . $page . '</font>次</b><br/>';
     $sql_string = "select * from " . CS_SqlPrefix . "vod where yid=0 and hid=0 " . $str . " order by id desc";
     $sql_string .= ' limit ' . $pagesize * ($page - 1) . ',' . $pagesize;
     $query = $this->db->query($sql_string);
     //获取播放页是否需要生成
     $html = config('Html_Uri', 'vod');
     foreach ($query->result_array() as $row) {
         ob_end_flush();
         //关闭缓存
         $id = $row['id'];
         //获取静态路径
         $Htmllinks = LinkUrl('show', 'id', $row['id'], 0, 'vod');
         //转换成生成路径
         $Htmllink = adminhtml($Htmllinks, 'vod');
         //摧毁部分需要超级链接字段数组
         $rows = $row;
         //先保存数组保留下面使用
         unset($row['zhuyan']);
         unset($row['daoyan']);
         unset($row['yuyan']);
         unset($row['diqu']);
         unset($row['tags']);
         unset($row['year']);
         //静态模式动态人气
         unset($row['hits']);
         unset($row['yhits']);
         unset($row['zhits']);
         unset($row['rhits']);
         unset($row['shits']);
         unset($row['xhits']);
         unset($row['dhits']);
         unset($row['chits']);
         unset($row['pfen']);
         $arr['cid'] = getChild($row['cid']);
         $arr['uid'] = $row['uid'];
         $arr['singerid'] = $row['singerid'];
         $arr['tags'] = $rows['tags'];
         $skins = getzd('vod_list', 'skins2', $row['cid']);
         if (empty($skins)) {
             $skins = 'show.html';
         }
         //装载模板并输出
         $Mark_Text = $this->CsdjTpl->plub_show('vod', $row, $arr, TRUE, $skins, $row['name'], $row['name']);
         //评论
         $Mark_Text = str_replace("[vod:pl]", get_pl('vod', $id), $Mark_Text);
         //分类地址、名称
         $Mark_Text = str_replace("[vod:link]", LinkUrl('show', 'id', $row['id'], 1, 'vod'), $Mark_Text);
         $Mark_Text = str_replace("[vod:classlink]", LinkUrl('lists', 'id', $row['cid'], 1, 'vod'), $Mark_Text);
         $Mark_Text = str_replace("[vod:classname]", $this->CsdjDB->getzd('vod_list', 'name', $row['cid']), $Mark_Text);
         //主演、导演、标签、年份、地区、语言加超级连接
         $Mark_Text = str_replace("[vod:zhuyan]", SearchLink($rows['zhuyan'], 'zhuyan'), $Mark_Text);
         $Mark_Text = str_replace("[vod:daoyan]", SearchLink($rows['daoyan'], 'daoyan'), $Mark_Text);
         $Mark_Text = str_replace("[vod:yuyan]", SearchLink($rows['yuyan'], 'yuyan'), $Mark_Text);
         $Mark_Text = str_replace("[vod:diqu]", SearchLink($rows['diqu'], 'diqu'), $Mark_Text);
         $Mark_Text = str_replace("[vod:tags]", SearchLink($rows['tags']), $Mark_Text);
         $Mark_Text = str_replace("[vod:year]", SearchLink($rows['year'], 'year'), $Mark_Text);
         //解析动态人气标签
         $Mark_Text = str_replace("[vod:hits]", "<script src='" . hitslink('hits/dt/hits/' . $id, 'vod') . "'></script>", $Mark_Text);
         $Mark_Text = str_replace("[vod:yhits]", "<script src='" . hitslink('hits/dt/yhits/' . $id, 'vod') . "'></script>", $Mark_Text);
         $Mark_Text = str_replace("[vod:zhits]", "<script src='" . hitslink('hits/dt/zhits/' . $id, 'vod') . "'></script>", $Mark_Text);
         $Mark_Text = str_replace("[vod:rhits]", "<script src='" . hitslink('hits/dt/rhits/' . $id, 'vod') . "'></script>", $Mark_Text);
         $Mark_Text = str_replace("[vod:shits]", "<script src='" . hitslink('hits/dt/shits/' . $id, 'vod') . "'></script>", $Mark_Text);
         $Mark_Text = str_replace("[vod:xhits]", "<script src='" . hitslink('hits/dt/xhits/' . $id, 'vod') . "'></script>", $Mark_Text);
         $Mark_Text = str_replace("[vod:dhits]", "<script src='" . hitslink('hits/dt/dhits/' . $id, 'vod') . "'></script>", $Mark_Text);
         $Mark_Text = str_replace("[vod:chits]", "<script src='" . hitslink('hits/dt/chits/' . $id, 'vod') . "'></script>", $Mark_Text);
         $Mark_Text = str_replace("[vod:pfen]", "<script src='" . hitslink('hits/dt/pfen/' . $id, 'vod') . "'></script>", $Mark_Text);
         $Mark_Text = str_replace("[vod:pfenbi]", "<script src='" . hitslink('hits/dt/pfenbi/' . $id, 'vod') . "'></script>", $Mark_Text);
         //解析播放下载地址
         $Mark_Text = Vod_Playlist($Mark_Text, 'play', $id, $row['purl']);
         $Mark_Text = Vod_Playlist($Mark_Text, 'down', $id, $row['durl']);
         //生成
         write_file(FCPATH . $Htmllink, $Mark_Text);
         echo "&nbsp;<font style=font-size:10pt;>生成影片:<font color=red>" . $row['name'] . "</font>成功:<a href=" . $Htmllinks . " target=_blank>" . $Htmllinks . "</a></font><br/>";
         //判断是否生成播放页
         if ($html['play']['check'] == 1) {
             $this->getplay($rows);
         }
         ob_flush();
         flush();
     }
     if (!empty($ids)) {
         $url = $_SERVER['HTTP_REFERER'];
         $str = "&nbsp;&nbsp;<b>全部生成完毕&nbsp;>>>>&nbsp;&nbsp;<a href='" . $url . "'>如果您的 浏览器没有跳转,请点击继续...</a></b>";
     } else {
         $url = site_url('vod/admin/html/show_save') . $uri . '&page=' . ($page + 1);
         $str = "&nbsp;&nbsp;<b>暂停" . Html_StopTime . "秒后继续&nbsp;>>>>&nbsp;&nbsp;<a href='" . $url . "'>如果您的 浏览器没有跳转,请点击继续...</a></b>";
     }
     echo "</br>" . $str . "<script>setTimeout('updatenext();'," . Html_StopTime . "000);function updatenext(){location.href='" . $url . "';}</script>";
 }
Esempio n. 20
0
    $code = $_POST['code'];
    if (@$_SESSION['authcode'] != md5($code)) {
        admin_msg($_SERVER['HTTP_REFERER'], '错误提示:您输入的验证码不正确!');
    }
    if (empty($content)) {
        admin_msg($_SERVER['HTTP_REFERER'], '错误提示:请填写内容!');
    }
    $result = $db->Execute('SELECT * FROM mycms_comments WHERE id=-1');
    $rs = array();
    $rs['aid'] = $aid;
    $rs['content'] = $content;
    $rs['time'] = date('Y-m-d h:i:s');
    $rs['isshow'] = 0;
    $insertSQL = $db->GetInsertSQL($result, $rs);
    $db->Execute($insertSQL);
    admin_msg($_SERVER['HTTP_REFERER'], '恭喜:在线评论成功!');
} else {
    if (isset($_GET['id']) && !empty($_GET['id'])) {
        $db->Execute('UPDATE mycms_article_list SET hit=hit+1 WHERE id=' . $_GET['id']);
        $result = $db->GetRow('SELECT * FROM mycms_article_list WHERE id=' . $_GET['id']);
        $smarty->assign($result);
        /*
        $table = 'mycms_comments';
        $where = 'aid='.$_GET['id'];
        $sql = "SELECT * FROM $table WHERE $where ORDER BY id DESC";
        $pagesize = 5;
        $currentPage = @$_REQUEST['page']+0;
        if(!is_numeric($currentPage) || $currentPage < 1 || empty($currentPage)){
        	$currentPage=1;
        }
        $result = $db->SelectLimit($sql, $pagesize, ($currentPage-1)*$pagesize);
Esempio n. 21
0
 public function update()
 {
     $mold = $this->input->get_post('mold');
     $dir = $this->input->get_post('dir');
     $mid = (int) $this->input->get_post('mid');
     $key = $this->input->get_post('key');
     $sid = intval($this->input->get_post('sid'));
     $fid = intval($this->input->get_post('fid'));
     if ($fid == 1) {
         //板块模板
         if ($sid == 4) {
             //手机模板
             $skins_path = FCPATH . 'plugins/' . $mold . '/tpl/mobile/';
         } elseif ($sid == 3) {
             //会员中心模板
             $skins_path = FCPATH . 'plugins/' . $mold . '/tpl/user/';
         } elseif ($sid == 2) {
             //会员主页模板
             $skins_path = FCPATH . 'plugins/' . $mold . '/tpl/home/';
         } else {
             //单主页模板
             $skins_path = FCPATH . 'plugins/' . $mold . '/tpl/skins/';
         }
     } else {
         if ($sid == 4) {
             //手机模板
             $skins_path = CSCMS . 'tpl/mobile/';
         } elseif ($sid == 3) {
             //会员中心模板
             $skins_path = CSCMS . 'tpl/user/';
         } elseif ($sid == 2) {
             //会员主页模板
             $skins_path = CSCMS . 'tpl/home/';
         } else {
             //单主页模板
             $skins_path = CSCMS . 'tpl/skins/';
         }
     }
     if (empty($key) || empty($dir)) {
         $data['mid'] = $mid;
         header("Location: " . $this->csapp->url('skins/update', $data) . "");
     } else {
         //下载
         $data['key'] = $key;
         $zip = $this->csapp->url('skins/update/' . $mid, $data);
         $zippath = FCPATH . "attachment/other/skins_" . $dir . "_update.zip";
         $files_file = $this->csapp->down($zip, $zippath);
         if ($files_file == '-1') {
             admin_msg(L('plub_28'), site_url('skin/yun'), 'no');
         }
         if ($files_file == '-2') {
             admin_msg(L('plub_29'), site_url('skin/yun'), 'no');
         }
         if ($files_file == '-3') {
             admin_msg(L('plub_30'), site_url('skin/yun'), 'no');
         }
         if ($files_file == '10001') {
             admin_msg(L('plub_36'), site_url('skin/yun'), 'no');
         }
         if ($files_file == '10002') {
             admin_msg(L('plub_37'), site_url('skin/yun'), 'no');
         }
         if ($files_file == '10003') {
             admin_msg(L('plub_38'), site_url('skin/yun'), 'no');
         }
         if (filesize($zippath) == 0) {
             admin_msg(L('plub_39'), site_url('skin/yun'), 'no');
         }
         //先备份原始板块
         $this->load->library('cszip');
         $zip_path = FCPATH . "attachment/other/skins_" . $dir . "_backup_" . date('Ymd') . ".zip";
         $plub_path = $skins_path . $dir;
         $this->cszip->PclZip($zip_path);
         //创建压缩包
         $this->cszip->create($plub_path);
         //增加目录
         //解压缩
         $this->cszip->PclZip($zippath);
         //尝试解压覆盖
         if ($this->cszip->extract(PCLZIP_OPT_PATH, $plub_path, PCLZIP_OPT_REPLACE_NEWER) == 0) {
             die(vsprintf(L('plub_40'), array($plub_path)) . $zippath);
         } else {
             @unlink($zippath);
             admin_msg(L('plub_41'), site_url('skin'));
         }
     }
 }
Esempio n. 22
0
 public function deldata_save()
 {
     $dir = $this->input->post('dir', true);
     $table = $this->input->post('table_' . $dir, true);
     $ids = $this->input->post('ids', true);
     if (empty($table)) {
         admin_msg(L('plub_14'), 'javascript:history.back();', 'no');
     }
     $this->db->query("delete from " . CS_SqlPrefix . $table . " ");
     //修复主键ID
     if ($ids == 'ok') {
         $this->db->query("TRUNCATE TABLE " . CS_SqlPrefix . $table . " ");
     }
     admin_msg(L('plub_04'), 'javascript:history.back();', 'ok');
     //操作成功
 }
Esempio n. 23
0
    } else {
        admin_msg($_SERVER['HTTP_REFERER'], '参数不正确,不能删除!');
    }
} else {
    if ($_GET["action"] == "toPwd") {
        $smarty->display("admin/pages/UserPwd.tpl.html");
    } else {
        if ($_GET["action"] == "pwdNew") {
            $userinfo = unserialize(base64_decode($_SESSION["userInfo"]));
            //print_r($userinfo);
            $rs = array();
            $rs["password"] = md5($_POST["newPasswords"]);
            $result = $db->Execute("SELECT * FROM mycms_admin_user WHERE uid=" . $userinfo["uid"] . " and password='******'");
            $updateSql = $db->GetUpdateSQL($result, $rs);
            //print $updateSql;return;
            $do = $db->Execute($updateSql);
            if ($do) {
                if ($db->Affected_Rows()) {
                    admin_msg($_SERVER['HTTP_REFERER'], '修改成功!');
                } else {
                    admin_msg($_SERVER['HTTP_REFERER'], '原密码不正确,操作出错!');
                }
            }
        } else {
            $result = $db->GetAll("SELECT * FROM mycms_admin_user where state is null or state > -2 ORDER BY username");
            $smarty->assign("list", $result);
            $smarty->display('admin/pages/UserList.html');
        }
    }
}
$db->close();
Esempio n. 24
0
<?php

require_once 'global.php';
//加载系统配置
session_start();
if (isset($_POST['submit'])) {
    $user = $_POST['user'];
    $pwd = $_POST['pwd'];
    //echo (md5($pwd));
    //$rememberme = $_POST['rememberme'] == '1' ? '1':'0';
    if ($user == '' || $pwd == '') {
        admin_msg('login.php', '错误提示:请填写用户名或密码!');
    }
    $result = $db->GetRow("SELECT * FROM mycms_admin_user WHERE (state is null or state !=-2) and username = '******' AND password = '******'");
    if (!$result) {
        admin_msg('login.php', '错误提示:用户名或密码填写错误!');
    } else {
        //session_register("userInfo");
        $_SESSION['userInfo'] = null;
        $_SESSION["userInfo"] = base64_encode(serialize($result));
        //unserialize(base64_decode())
        $db->Execute('UPDATE mycms_admin_user SET lognum=lognum+1 WHERE uid=' . $result['uid']);
        //header('location:index.php');
        $db->Execute("INSERT INTO mycms_admin_log(uid,uname,ltime,lip) VALUES(" . $result['uid'] . ",'" . $result['username'] . "','" . date('Y-m-d h:i:s') . "','" . get_real_ip() . "')");
        header('location:index.php');
    }
} elseif (isset($_GET['action']) && $_GET['action'] == 'out') {
    session_destroy();
    header('location:login.php');
} else {
    if (isset($_GET["img"]) || isset($_GET["type"])) {
Esempio n. 25
0
     $security_token = randomcode();
     $_SESSION['security_token'] = $security_token;
     die_with_msg($message);
 } else {
     list($width, $height) = getimagesize($new_file_path);
     if ($width > $config['member_pic_maxwidth'] || $width < $config['member_pic_minwidth'] || $height > $config['member_pic_maxheight'] || $height < $config['member_pic_minheight']) {
         $proceed = false;
         $color = '#DD0000';
         $show_notification = 1;
         $message = $config['file_dimensions_error'];
         unset($_SESSION['security_token']);
         $security_token = randomcode();
         $_SESSION['security_token'] = $security_token;
         ////////////////////////////////////////////////////////////////
         $capture = true;
         admin_msg($_SESSION['user_id']);
         $file_contents = 'Avatar upload error - width or height error - check 5' . "\n" . 'USER_ID ' . $_SESSION['user_id'] . "\n" . $use_date . "\n" . '=================================================================' . "\n";
         write_debug_log($file_contents);
         ////////////////////////////////////////////////////////////////
         // keep image to look at
         //@unlink($new_file_path);
         die_with_msg($message);
     }
 }
 $sql = "SELECT * FROM pictures WHERE user_id = {$user_id}";
 $result = @mysql_query($sql);
 // delete member avatar if they have one already
 if (@mysql_num_rows($result) != 0) {
     $result = @mysql_fetch_array($result);
     $existing_file = $result['file_name'];
     $filepath = installation_paths();
Esempio n. 26
0
    //$rs['cid']=$_POST['cid'];
    //$rs['tj']=$_POST['tj']!='1'?0:1;
    //if(isset($_POST['new'])){
    //$rs['new']=$_POST['new']!='1'?0:1;
    //}
    //$rs['keywords']=$_POST['keywords'];
    $rs['description'] = $_POST['description'];
    //$rs['outlink']=$_POST['outlink'];
    //$rs['filename']=$_POST['filename'];
    //$rs['author']=$_POST['author'];
    $rs['content'] = $_POST['p_info'];
    $id = $_POST['id'];
    $result = $db->Execute('SELECT * FROM mycms_article_list WHERE id=' . $id . '');
    $updateSql = $db->GetUpdateSQL($result, $rs);
    $db->Execute($updateSql);
    admin_msg($url, '操作成功!');
} else {
    //===================================================================================显示文章
    $table = 'mycms_article_list,mycms_article_class';
    $where = 'mycms_article_list.cid=mycms_article_class.cid';
    $where .= " and mycms_article_class.type='__service'";
    if (isset($_POST["name"]) && !empty($_POST["name"])) {
        $where .= " and title like '%" . $_POST["name"] . "%'";
    }
    if (isset($_POST["keywords"]) && !empty($_POST["keywords"])) {
        $where .= " and keywords like '%" . $_POST["keywords"] . "%'";
    }
    if (isset($_GET["cid"])) {
        $where .= " and mycms_article_class.cid=" . $_GET["cid"];
    }
    $sql = "SELECT id,title,time,tj,new,cname,hit FROM {$table} WHERE {$where} ORDER BY id DESC";
Esempio n. 27
0
 public function ruku_del()
 {
     $ac = $this->input->get_post('ac', true);
     $id = $this->input->get_post('id', true);
     if ($ac == 'all') {
         //全部
         $this->db->query("delete from " . CS_SqlPrefix . "cjdata");
     } elseif ($ac == 'yes') {
         //已经入库
         $this->CsdjDB->get_del('cjdata', 1, 'zid');
     } else {
         $this->CsdjDB->get_del('cjdata', $id);
     }
     admin_msg(L('plub_26'), site_url('collect/ruku'), 'ok');
     //操作成功
 }
Esempio n. 28
0
        if (isset($_POST['keywords'])) {
            $rs['keywords'] = $_POST['keywords'];
        }
        if (isset($_POST['is_show'])) {
            $rs['is_show'] = $_POST['is_show'];
        }
        if (isset($_POST['is_showtime'])) {
            $rs['is_showtime'] = $_POST['is_showtime'];
        }
        $result = $db->Execute('SELECT * FROM mycms_article_class WHERE cid=' . $cid);
        $updateSql = $db->GetUpdateSQL($result, $rs);
        $db->Execute($updateSql);
        //$db->Execute("UPDATE mycms_article_class SET cname='$cname' WHERE cid=$cid");
        admin_msg('scheme.php?action=class', '文章分类修改成功!');
    } else {
        admin_msg('scheme.php?action=class', '参数不正确,不能修改分类!');
    }
} else {
    //===================================================================================显示文章
    $table = 'mycms_article_list,mycms_article_class';
    $where = 'mycms_article_list.cid=mycms_article_class.cid';
    $where .= " and mycms_article_class.type='__scheme'";
    if (isset($_POST["name"]) && !empty($_POST["name"])) {
        $where .= " and title like '%" . $_POST["name"] . "%'";
    }
    if (isset($_POST["keywords"]) && !empty($_POST["keywords"])) {
        $where .= " and keywords like '%" . $_POST["keywords"] . "%'";
    }
    if (isset($_GET["cid"])) {
        $where .= " and mycms_article_class.cid=" . $_GET["cid"];
    }
Esempio n. 29
0
 public function del()
 {
     $ids = $this->input->get_post('id');
     if (empty($ids)) {
         admin_msg(L('plub_73'), 'javascript:history.back();', 'no');
     }
     if (is_array($ids)) {
         $idss = implode(',', $ids);
     } else {
         $idss = $ids;
     }
     $result = $this->db->query("SELECT pic FROM " . CS_SqlPrefix . "dance_topic where id in(" . $idss . ")")->result();
     $this->load->library('csup');
     foreach ($result as $row) {
         if (!empty($row->pic)) {
             $this->csup->del($row->pic, 'dancetopic');
             //删除图片
         }
     }
     $this->CsdjDB->get_del('dance_topic', $ids);
     admin_msg(L('plub_74'), 'javascript:history.back();', 'ok');
     //操作成功
 }
Esempio n. 30
0
        $currentPage = 1;
    }
    $result = $db->SelectLimit($sql, $pagesize, ($currentPage - 1) * $pagesize);
    $result = $result->GetArray();
    $smarty->assign('loglist', $result);
    page($table, $pagesize, 3, $where, true, false, 'pagelink');
    $smarty->display('admin/admin-log.html');
} elseif ($_GET['action'] == 'del') {
    if (isset($_GET['lid'])) {
        $db->Execute('DELETE FROM mycms_admin_log WHERE lid= ' . $_GET['lid'] . '');
    }
    header('location:' . $_SERVER['HTTP_REFERER']);
} elseif (isset($_POST['submit'])) {
    if (empty($_POST['pwd']) || empty($_POST['newpwd']) || empty($_POST['repwd'])) {
        admin_msg('admin.php', '错误提示:请填写密码');
    }
    if ($_POST['newpwd'] != $_POST['repwd']) {
        admin_msg('admin.php', '错误提示:要修改的密码,不一致!');
    }
    $result = $db->Execute("SELECT * FROM mycms_admin_user WHERE username = '******'username'] . "' AND password = '******'pwd']) . "'");
    if (!$result || $result->EOF) {
        admin_msg('admin.php', '错误提示:您输入的密码不正确!');
    } else {
        $db->Execute("UPDATE mycms_admin_user SET password = '******'newpwd']) . "' WHERE username = '******'username'] . "'");
    }
    admin_msg('admin.php', '恭喜:密码修改成功!');
} else {
    $smarty->assign('username', $userInfo['username']);
    $smarty->display('admin/admin.html');
}
$db->close();