本文整理汇总了PHP中getChild函数的典型用法代码示例。如果您正苦于以下问题:PHP getChild函数的具体用法?PHP getChild怎么用?PHP getChild使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getChild函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: index
public function index($fid = 'id', $id = 0, $page = 0)
{
$id = intval($id);
//ID
$page = intval($page);
//页数
if ($page == 0) {
$page = 1;
}
//判断ID
if ($id == 0) {
msg_url(L('dance_09'), Web_Path);
}
//获取数据
$row = $this->CsdjDB->get_row_arr('dance_list', '*', $id);
if (!$row || $row['yid'] > 0) {
msg_url(L('dance_18'), Web_Path);
}
//判断运行模式,生成则跳转至静态页面
$html = config('Html_Uri');
if (config('Web_Mode') == 3 && $html['lists']['check'] == 1) {
//获取静态路径
$Htmllink = LinkUrl('lists', $fid, $id, $page, 'dance');
header("Location: " . $Htmllink);
exit;
}
//获取当前分类下二级分类ID
$ids = getChild($id);
//装载模板并输出
$skins = empty($row['skins']) ? 'list.html' : $row['skins'];
$this->CsdjTpl->plub_list($row, $id, $fid, $page, $ids, false, $skins, 'lists', 'dance', $row['name'], $row['name']);
}
开发者ID:djqhuan,项目名称:CSCMS-v4.0-UTF8,代码行数:32,代码来源:lists.php
示例2: verify
public function verify()
{
$cid = intval($this->uri->segment(4));
//分类ID
$page = intval($this->uri->segment(5));
//分页
//模板
$tpl = 'verify.html';
//URL地址
$url = 'vod/verify/' . $cid;
$sqlstr = "select {field} from " . CS_SqlPrefix . "vod where yid=1 and uid=" . $_SESSION['cscms__id'];
if ($cid > 0) {
$cids = getChild($cid);
$sqlstr .= " and cid in(" . $cids . ")";
}
//当前会员
$row = $this->CsdjDB->get_row_arr('user', '*', $_SESSION['cscms__id']);
if (empty($row['nichen'])) {
$row['nichen'] = $row['name'];
}
//装载模板
$title = '待审视频 - 会员中心';
$ids['uid'] = $_SESSION['cscms__id'];
$ids['uida'] = $_SESSION['cscms__id'];
$Mark_Text = $this->CsdjTpl->user_list($row, $url, $page, $tpl, $title, $cid, $sqlstr, $ids, true, false);
$Mark_Text = str_replace("[vod:cid]", $cid, $Mark_Text);
//会员版块导航
$Mark_Text = $this->skins->cscmsumenu($Mark_Text, $_SESSION['cscms__id']);
$Mark_Text = $this->skins->labelif($Mark_Text);
echo $Mark_Text;
}
开发者ID:djqhuan,项目名称:CSCMS-v4.0-UTF8,代码行数:31,代码来源:vod.php
示例3: index
public function index($fid = 'id', $id = 0, $page = 0)
{
$id = intval($id);
//ID
$page = intval($page);
//页数
if ($page == 0) {
$page = 1;
}
//判断ID
if ($id == 0) {
msg_url('出错了,ID不能为空!', Web_Path);
}
//获取数据
$row = $this->CsdjDB->get_row_arr('vod_list', '*', $id);
if (!$row || $row['yid'] > 0) {
msg_url('出错了,该分类不存在!', Web_Path);
}
//判断运行模式,生成则跳转至静态页面
$html = config('Html_Uri');
if (config('Web_Mode') == 3 && $html['lists']['check'] == 1 && !defined('MOBILE')) {
//获取静态路径
$Htmllink = LinkUrl('lists', $fid, $id, $page, 'vod');
header("Location: " . $Htmllink);
exit;
}
//获取当前分类下二级分类ID
$arr['cid'] = getChild($id);
$arr['fid'] = $row['fid'] == 0 ? $row['id'] : $row['fid'];
$arr['sid'] = $arr['fid'];
//装载模板并输出
$skins = empty($row['skins']) ? 'list.html' : $row['skins'];
$this->CsdjTpl->plub_list($row, $id, $fid, $page, $arr, false, $skins, 'lists', 'vod', $row['name'], $row['name']);
}
开发者ID:djqhuan,项目名称:CSCMS-v4.0-UTF8,代码行数:34,代码来源:lists.php
示例4: getColumn
function getColumn($data)
{
$arr = array();
foreach ($data as $key => $vo) {
if ($vo['pid'] == 0) {
$auth = 0;
$vo['child'] = getChild($data, $vo['id']);
foreach ($vo['child'] as $v) {
$auth = $v['auth'] + $auth;
}
if ($auth > 0) {
$vo['auth'] = 1;
} else {
$vo['auth'] = 0;
}
if (empty($vo['child'])) {
$url = $vo['m'] . "/" . $vo['c'] . "/" . $vo['a'];
$a = checkAuth($url);
$vo['auth'] = $a;
}
$arr['column'][] = $vo;
}
}
$arr['module'] = MODULE_NAME;
return $arr;
}
开发者ID:quguo,项目名称:wxpt,代码行数:26,代码来源:function.php
示例5: edit
/**
* edit data page
* @param int id
* @return view
*/
public function edit($id)
{
$categoryData = Category::get();
$ids = getChild($categoryData, $id);
$ids[] = $id;
$category = getTree($categoryData);
$info = Category::findOrFail($id);
return view('admin.category.edit', compact('ids', 'category', 'info'));
}
开发者ID:Jokeramc,项目名称:amc,代码行数:14,代码来源:CategoryController.php
示例6: index
public function index($fid = 'id', $id = 0, $page = 1)
{
$id = intval($id);
//ID
$page = intval($page);
//ID
if (preg_match("/^\\d*\$/", $fid)) {
$id = intval($fid);
$page = intval($id);
$fid = 'id';
}
$cid = intval($this->input->get_post('cid'));
if ($page == 0) {
$page = 1;
}
//判断ID
if ($id == 0) {
msg_url('出错了,ID不能为空!', Web_Path);
}
//获取数据
$row = $this->CsdjDB->get_row_arr('singer', '*', $id);
if (!$row || $row['yid'] > 0 || $row['hid'] > 0) {
msg_url('出错了,该歌手不存在!', Web_Path);
}
//判断运行模式,生成则跳转至静态页面
$html = config('Html_Uri');
if (config('Web_Mode') == 3 && $html['show']['check'] == 1) {
//获取静态路径
$Htmllink = LinkUrl('pic', $cid, $id, 0, 'singer');
header("Location: " . $Htmllink);
exit;
}
if ($cid > 0) {
$arr['cid'] = getChild($cid);
}
$arr['tags'] = $row['tags'];
$arr['singerid'] = $id;
//摧毁部分需要超级链接字段数组
$rows = $row;
//先保存数组保留下面使用
unset($row['tags']);
//装载模板并输出
$Mark_Text = $this->CsdjTpl->plub_list($row, $id, $fid, $page, $arr, TRUE, 'pic.html', 'pic', 'singer', $row['name'], $row['name']);
//评论
$Mark_Text = str_replace("[singer:pl]", get_pl('singer', $id), $Mark_Text);
//分类地址、名称
$Mark_Text = str_replace("[singer:link]", LinkUrl('show', 'id', $row['id'], 1, 'singer'), $Mark_Text);
$Mark_Text = str_replace("[singer:classlink]", LinkUrl('lists', 'id', $row['cid'], 1, 'singer'), $Mark_Text);
$Mark_Text = str_replace("[singer:classname]", $this->CsdjDB->getzd('singer_list', 'name', $row['cid']), $Mark_Text);
//标签加超级连接
$Mark_Text = str_replace("[singer:tags]", SearchLink($rows['tags']), $Mark_Text);
echo $Mark_Text;
$this->cache->end();
//由于前面不是直接输出,所以这里需要加入写缓存
}
开发者ID:djqhuan,项目名称:CSCMS-v4.0-UTF8,代码行数:55,代码来源:pic.php
示例7: getChild
function getChild($list, $id)
{
static $ids = [];
foreach ($list as $key => $value) {
if ($value['parent_id'] == $id) {
$ids[] = $value['id'];
getChild($list, $value['id']);
}
}
return $ids;
}
开发者ID:Jokeramc,项目名称:amc,代码行数:11,代码来源:helpers.php
示例8: index
public function index()
{
$cid = (int) $this->uri->segment(4);
//CID
$page = (int) $this->uri->segment(5);
//页数
//模板
$tpl = 'dance.html';
//当前会员
$uid = get_home_uid();
$row = $this->CsdjDB->get_row_arr('user', '*', $uid);
if (empty($row['nichen'])) {
$row['nichen'] = $row['name'];
}
//装载模板
$title = $row['nichen'] . '的歌曲';
$ids['uid'] = $row['id'];
$ids['uida'] = $row['id'];
$sql = $cid == 0 ? "" : "SELECT {field} FROM " . CS_SqlPrefix . "dance where cid in (" . getChild($cid) . ")";
$this->CsdjTpl->home_list($row, 'dance', $page, $tpl, $title, $ids, $cid, $sql);
}
开发者ID:djqhuan,项目名称:CSCMS-v4.0-UTF8,代码行数:21,代码来源:dance.php
示例9: test_conf
$result = test_conf();
if ($result !== true) {
echo "4###" . $result;
exit;
}
$file_to_text = file_get_contents($path, false);
$_level_key_name = set_key_name($_level_key_name, $file_to_text);
$new_rule['rule'] = $child['tree'];
//Tree local_rules.xml
$xml_obj = new xml($_level_key_name);
$xml_obj->load_file($path);
$tree_lr = $xml_obj->xml2array();
foreach ($tree_lr as $k => $v) {
if (isset($tree_lr[$k]['group'])) {
$__level_key = $tree_lr[$k]['group']['@attributes']['__level_key'];
$child = getChild($tree_lr, $__level_key);
$keys = array_keys($child['tree']);
if (is_numeric($keys[count($keys) - 1])) {
$aux_key = $keys[count($keys) - 1] + 1;
$new_key = !in_array($aux_key, $keys) ? $aux_key : uniqid(mt_rand("1", mt_getrandmax()));
} else {
$new_key = uniqid(mt_rand("1", mt_getrandmax()));
}
break;
}
}
if (empty($new_key)) {
echo "3###" . _("Failure: Format not allowed in file") . " " . $editable_files[0] . " (2)";
$error = true;
} else {
$branch = '[' . implode("][", $child['parents']) . '][\'' . $new_key . '\']';
开发者ID:jhbsz,项目名称:ossimTest,代码行数:31,代码来源:copy_rule.php
示例10: index
public function index($fid = 'id', $id = 0)
{
$id = intval($fid) > 0 ? intval($fid) : intval($id);
//ID
//判断ID
if ($id == 0) {
msg_url(L('dance_09'), Web_Path);
}
//获取数据
$row = $this->CsdjDB->get_row_arr('dance', '*', $id);
if (!$row || $row['yid'] > 0 || $row['hid'] > 0) {
msg_url(L('dance_10'), Web_Path);
}
//判断运行模式,生成则跳转至静态页面
$html = config('Html_Uri');
if (config('Web_Mode') == 3 && $html['play']['check'] == 1) {
//获取静态路径
$Htmllink = LinkUrl('play', 'id', $id, 0, 'dance');
header("Location: " . $Htmllink);
exit;
}
//摧毁部分需要超级链接字段数组
$rows = $row;
//先保存数组保留下面使用
unset($row['tags']);
//获取当前分类下二级分类ID
$arr['cid'] = getChild($row['cid']);
$arr['uid'] = $row['uid'];
$arr['did'] = $row['id'];
$arr['singerid'] = $row['singerid'];
$arr['tags'] = $rows['tags'];
//装载模板并输出
$skins = empty($row['skins']) ? 'play.html' : $row['skins'];
$Mark_Text = $this->CsdjTpl->plub_show('dance', $row, $arr, TRUE, $skins, $row['name'], $row['name']);
//评论
$Mark_Text = str_replace("[dance:pl]", get_pl('dance', $id), $Mark_Text);
//分类地址、名称
$Mark_Text = str_replace("[dance:link]", LinkUrl('play', 'id', $row['id'], 1, 'news'), $Mark_Text);
$Mark_Text = str_replace("[dance:classlink]", LinkUrl('lists', 'id', $row['cid'], 1, 'dance'), $Mark_Text);
$Mark_Text = str_replace("[dance:classname]", $this->CsdjDB->getzd('dance_list', 'name', $row['cid']), $Mark_Text);
//专辑
if ($row['tid'] == 0) {
$Mark_Text = str_replace("[dance:topiclink]", "###", $Mark_Text);
$Mark_Text = str_replace("[dance:topicname]", L('dance_11'), $Mark_Text);
} else {
$Mark_Text = str_replace("[dance:topiclink]", LinkUrl('topic', 'show', $row['tid'], 1, 'dance'), $Mark_Text);
$Mark_Text = str_replace("[dance:topicname]", $this->CsdjDB->getzd('dance_topic', 'name', $row['tid']), $Mark_Text);
}
//获取上下曲
preg_match_all('/[dance:slink]/', $Mark_Text, $arr);
if (!empty($arr[0]) && !empty($arr[0][0])) {
$rowd = $this->db->query("Select id,cid,name from " . CS_SqlPrefix . "dance where yid=0 and hid=0 and id<" . $id . " order by id desc limit 1")->row();
if ($rowd) {
$Mark_Text = str_replace("[dance:slink]", LinkUrl('play', 'id', $rowd->id, 1, 'dance'), $Mark_Text);
$Mark_Text = str_replace("[dance:sname]", $rowd->name, $Mark_Text);
$Mark_Text = str_replace("[dance:sid]", $rowd->id, $Mark_Text);
} else {
$Mark_Text = str_replace("[dance:slink]", "#", $Mark_Text);
$Mark_Text = str_replace("[dance:sname]", L('dance_20'), $Mark_Text);
$Mark_Text = str_replace("[dance:sid]", 0, $Mark_Text);
}
}
unset($arr);
preg_match_all('/[dance:xlink]/', $Mark_Text, $arr);
if (!empty($arr[0]) && !empty($arr[0][0])) {
$rowd = $this->db->query("Select id,cid,name from " . CS_SqlPrefix . "dance where yid=0 and hid=0 and id>" . $id . " order by id asc limit 1")->row();
if ($rowd) {
$Mark_Text = str_replace("[dance:xlink]", LinkUrl('play', 'id', $rowd->id, 1, 'dance'), $Mark_Text);
$Mark_Text = str_replace("[dance:xname]", $rowd->name, $Mark_Text);
$Mark_Text = str_replace("[dance:xid]", $rowd->id, $Mark_Text);
} else {
$Mark_Text = str_replace("[dance:xlink]", "#", $Mark_Text);
$Mark_Text = str_replace("[dance:xname]", L('dance_20'), $Mark_Text);
$Mark_Text = str_replace("[dance:xid]", 0, $Mark_Text);
}
}
unset($arr);
//标签加超级连接
$Mark_Text = str_replace("[dance:tags]", SearchLink($rows['tags']), $Mark_Text);
//歌曲完整试听地址
preg_match_all('/[dance:qurl]/', $Mark_Text, $arr);
if (!empty($arr[0]) && !empty($arr[0][0])) {
$purl = $row['purl'];
if ($row['fid'] > 0) {
$rowf = $this->db->query("Select purl from " . CS_SqlPrefix . "dance_server where id=" . $row['fid'] . "")->row_array();
if ($rowf) {
$purl = $rowf['purl'] . $row['purl'];
}
}
$purl = annexlink($purl);
$Mark_Text = str_replace("[dance:qurl]", $purl, $Mark_Text);
}
unset($arr);
//cmp音频播放器
$player = "<script type='text/javascript'>\r\n\t\t\tvar mp3_w='" . CS_Play_w . "';\r\n\t\t\tvar mp3_h='" . CS_Play_h . "';\r\n\t\t\tvar mp3_i='" . $id . "';\r\n\t\t\tvar mp3_p='" . hitslink('play', 'dance') . "';\r\n\t\t\tvar mp3_t='" . Web_Path . "';\r\n\t\t\tmp3_play();\r\n\t\t\t</script>";
$Mark_Text = str_replace("[dance:player]", $player, $Mark_Text);
//jp音频播放器
$jplayer = "<script type='text/javascript'>\r\n\t\t\tvar mp3_i='" . $id . "';\r\n\t\t\tvar mp3_p='" . hitslink('play', 'dance') . "';\r\n\t\t\tvar mp3_n='" . str_replace("'", "", $row['name']) . "';\r\n\t\t\tvar mp3_x='" . LinkUrl('down', 'id', $row['id'], 1, 'dance') . "';\r\n\t\t\tvar mp3_l='" . LinkUrl('down', 'lrc', $row['id'], 1, 'dance') . "';\r\n\t\t\tmp3_jplayer();\r\n\t\t\t</script>";
$Mark_Text = str_replace("[dance:jplayer]", $jplayer, $Mark_Text);
//增加人气
//.........这里部分代码省略.........
开发者ID:djqhuan,项目名称:CSCMS-v4.0-UTF8,代码行数:101,代码来源:play.php
示例11: index
public function index($fid = 'id', $id = 0)
{
$id = intval($fid) > 0 ? intval($fid) : intval($id);
//ID
//判断ID
if ($id == 0) {
msg_url('出错了,ID不能为空!', Web_Path);
}
//获取数据
$row = $this->CsdjDB->get_row_arr('news', '*', $id);
if (!$row || $row['yid'] > 0 || $row['hid'] > 0) {
msg_url('出错了,该数据不存在或者没有审核!', Web_Path);
}
//判断运行模式,生成则跳转至静态页面
$html = config('Html_Uri');
if (config('Web_Mode') == 3 && $html['show']['check'] == 1) {
//获取静态路径
$Htmllink = LinkUrl('show', $fid, $id, 0, 'news');
header("Location: " . $Htmllink);
exit;
}
//摧毁部分需要超级链接字段数组
$rows = $row;
//先保存数组保留下面使用
unset($row['tags']);
unset($row['content']);
//获取当前分类下二级分类ID
$arr['cid'] = getChild($row['cid']);
$arr['uid'] = $row['uid'];
$arr['tags'] = $rows['tags'];
//默认模板
$skins = empty($row['skins']) ? 'show.html' : $row['skins'];
//装载模板并输出
$Mark_Text = $this->CsdjTpl->plub_show('news', $row, $arr, TRUE, $skins, $row['name'], $row['name']);
//评论
$Mark_Text = str_replace("[news:pl]", get_pl('news', $id), $Mark_Text);
//分类地址、名称
$Mark_Text = str_replace("[news:link]", LinkUrl('show', 'id', $row['id'], 1, 'news'), $Mark_Text);
$Mark_Text = str_replace("[news:classlink]", LinkUrl('lists', 'id', $row['cid'], 1, 'news'), $Mark_Text);
$Mark_Text = str_replace("[news:classname]", $this->CsdjDB->getzd('news_list', 'name', $row['cid']), $Mark_Text);
//获取上下篇
preg_match_all('/[news:slink]/', $Mark_Text, $arr);
if (!empty($arr[0]) && !empty($arr[0][0])) {
$rowd = $this->db->query("Select id,cid,name from " . CS_SqlPrefix . "news where yid=0 and hid=0 and id<" . $id . " order by id desc limit 1")->row();
if ($rowd) {
$Mark_Text = str_replace("[news:slink]", LinkUrl('show', 'id', $rowd->id, 1, 'news'), $Mark_Text);
$Mark_Text = str_replace("[news:sname]", $rowd->name, $Mark_Text);
$Mark_Text = str_replace("[news:sid]", $rowd->id, $Mark_Text);
} else {
$Mark_Text = str_replace("[news:slink]", "#", $Mark_Text);
$Mark_Text = str_replace("[news:sname]", "没有了", $Mark_Text);
$Mark_Text = str_replace("[news:sid]", 0, $Mark_Text);
}
}
unset($arr);
preg_match_all('/[news:xlink]/', $Mark_Text, $arr);
if (!empty($arr[0]) && !empty($arr[0][0])) {
$rowd = $this->db->query("Select id,cid,name from " . CS_SqlPrefix . "news where yid=0 and hid=0 and id>" . $id . " order by id asc limit 1")->row();
if ($rowd) {
$Mark_Text = str_replace("[news:xlink]", LinkUrl('show', 'id', $rowd->id, 1, 'news'), $Mark_Text);
$Mark_Text = str_replace("[news:xname]", $rowd->name, $Mark_Text);
$Mark_Text = str_replace("[news:xid]", $rowd->id, $Mark_Text);
} else {
$Mark_Text = str_replace("[news:xlink]", "#", $Mark_Text);
$Mark_Text = str_replace("[news:xname]", "没有了", $Mark_Text);
$Mark_Text = str_replace("[news:xid]", 0, $Mark_Text);
}
}
unset($arr);
//标签加超级连接
$Mark_Text = str_replace("[news:tags]", SearchLink($rows['tags']), $Mark_Text);
//文章内容,判断是否是收费文章
if ($row['vip'] > 0 || $row['level'] > 0 || $row['cion'] > 0) {
$content = "<div id='cscms_content'></div>";
if (config('Ym_Mode', 'news') == 1) {
$content .= "<script type='text/javascript' src='http://" . config('Ym_Url', 'news') . Web_Path . "index.php/show/pay/" . $id . "'></script>";
} else {
$content .= "<script type='text/javascript' src='http://" . Web_Url . Web_Path . "index.php/news/show/pay/" . $id . "'></script>";
}
} else {
$content = $rows['content'];
}
$Mark_Text = str_replace("[news:content]", $content, $Mark_Text);
//增加人气
$Mark_Text = hits_js($Mark_Text, hitslink('hits/ids/' . $id, 'news'));
echo $Mark_Text;
$this->cache->end();
//由于前面不是直接输出,所以这里需要加入写缓存
}
开发者ID:djqhuan,项目名称:CSCMS-v4.0-UTF8,代码行数:89,代码来源:show.php
示例12: index
//.........这里部分代码省略.........
$rowd = $this->db->query("SELECT id,addtime FROM " . CS_SqlPrefix . "vod_look where did='" . $did . "' and uid='" . $_SESSION['cscms__id'] . "' and sid=1")->row_array();
if ($rowd) {
$down = 1;
//数据已经存在
$downtime = User_Downtime * 3600 + $rowd['addtime'];
if ($downtime > time()) {
$down = 2;
//在多少时间内不重复扣币
}
}
//判断会员组下载权限
$rowz = $this->db->query("SELECT id,did FROM " . CS_SqlPrefix . "userzu where id='" . $rowu['vip'] . "'")->row_array();
if ($rowz && $rowz['did'] == 1) {
//有免费下载权限
$down = 2;
//该会员下载不收费
}
if ($down < 2) {
//判断扣币
if ($row['dcion'] > $rowu['cion']) {
msg_url('这部视频下载每集需要' . $row['cion'] . '个金币,您的当前金币不够,请先充值!', 'javascript:window.close();');
} else {
//扣币
$edit['cion'] = $rowu['cion'] - $row['dcion'];
$this->CsdjDB->get_update('user', $_SESSION['cscms__id'], $edit);
//写入消费记录
$add2['title'] = '下载视频《' . $row['name'] . '》- 第' . ($ji + 1) . '集';
$add2['uid'] = $_SESSION['cscms__id'];
$add2['dir'] = 'vod';
$add2['nums'] = $row['cion'];
$add2['ip'] = getip();
$add2['addtime'] = time();
$this->CsdjDB->get_insert('spend', $add2);
//判断分成
if (User_DownFun == 1 && $row['uid'] > 0) {
//分成比例
$bi = User_Downcion < 10 ? '0.0' . User_Downcion : '0.' . User_Downcion;
$scion = intval($row['dcion'] * $bi);
if ($scion > 0) {
$this->db->query("update " . CS_SqlPrefix . "user set cion=cion+" . $scion . " where id=" . $row['uid'] . "");
//写入分成记录
$add3['title'] = '视频《' . $row['name'] . '》- 第' . ($ji + 1) . '集 - 下载分成';
$add3['uid'] = $row['uid'];
$add3['dir'] = 'vod';
$add3['nums'] = $scion;
$add3['ip'] = getip();
$add3['addtime'] = time();
$this->CsdjDB->get_insert('income', $add3);
}
}
}
}
//增加下载记录
if ($down == 0) {
$add['name'] = $row['name'];
$add['cid'] = $row['cid'];
$add['sid'] = 1;
$add['did'] = $did;
$add['uid'] = $_SESSION['cscms__id'];
$add['cion'] = $row['dcion'];
$add['addtime'] = time();
$this->CsdjDB->get_insert('vod_look', $add);
}
}
//增加下载人气
$this->db->query("update " . CS_SqlPrefix . "vod set xhits=xhits+1 where id=" . $row['id'] . "");
//相关搜索数组
$arr['cid'] = getChild($row['cid']);
$arr['uid'] = $row['uid'];
$arr['tags'] = $row['tags'];
//装载模板并输出
$Mark_Text = $this->CsdjTpl->plub_show('vod', $row, $arr, TRUE, 'down.html');
//评论
$dance_pl = "<div id='cscms_pl'><img src='" . Web_Path . "packs/images/load.gif'> 加载评论内容,请稍等......</div>\r\n<script type='text/javascript'>var dir='vod';var did=" . $id . ";var cid=0;cscms_pl(1,0,0);</script>";
$Mark_Text = str_replace("[vod:pl]", $dance_pl, $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);
//输出下载地址
$Data_Arr = explode("#cscms#", $row['durl']);
if ($zu >= count($Data_Arr)) {
$zu = 0;
}
$DataList_Arr = explode("\n", $Data_Arr[$zu]);
$Dataurl_Arr = explode('$', $DataList_Arr[$ji]);
$laiyuan = $Dataurl_Arr[2];
//来源
$url = $Dataurl_Arr[1];
//地址
$pname = $Dataurl_Arr[0];
//当前集数
$Mark_Text = str_replace("[down:url]", $url, $Mark_Text);
//当前集下载地址
$Mark_Text = str_replace("[down:laiy]", $laiyuan, $Mark_Text);
//当前集来源
$Mark_Text = str_replace("[down:ji]", $pname, $Mark_Text);
//当前集数
echo $Mark_Text;
}
开发者ID:djqhuan,项目名称:CSCMS-v4.0-UTF8,代码行数:101,代码来源:down.php
示例13: index
public function index($fid = 'id', $id = 0)
{
$id = intval($fid) > 0 ? intval($fid) : intval($id);
//ID
//判断ID
if ($id == 0) {
msg_url('出错了,ID不能为空!', Web_Path);
}
//获取数据
$row = $this->CsdjDB->get_row_arr('pic_type', '*', $id);
if (!$row || $row['yid'] > 0 || $row['hid'] > 0) {
msg_url('出错了,该数据不存在或者没有审核!', Web_Path);
}
//判断运行模式,生成则跳转至静态页面
$html = config('Html_Uri');
if (config('Web_Mode') == 3 && $html['show']['check'] == 1) {
//获取静态路径
$Htmllink = LinkUrl('show', $fid, $id, 0, 'pic');
header("Location: " . $Htmllink);
exit;
}
//摧毁部分需要超级链接字段数组
$rows = $row;
//先保存数组保留下面使用
unset($row['tags']);
//获取当前分类下二级分类ID
$arr['cid'] = getChild($row['cid']);
$arr['uid'] = $row['uid'];
$arr['tags'] = $rows['tags'];
$arr['sid'] = $row['id'];
//默认模板
$skins = empty($row['skins']) ? 'show.html' : $row['skins'];
//装载模板并输出
$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);
//获取当前相册总数
$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'));
echo $Mark_Text;
$this->cache->end();
//由于前面不是直接输出,所以这里需要加入写缓存
}
开发者ID:djqhuan,项目名称:CSCMS-v4.0-UTF8,代码行数:90,代码来源:show.php
示例14: down_save
//.........这里部分代码省略.........
}
//公众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('dance', 2);
echo '<LINK href="' . base_url() . 'packs/admin/css/style.css" type="text/css" rel="stylesheet"><br>';
echo vsprintf(L('plub_49'), array($pagejs, $page));
$sql_string = "select * from " . CS_SqlPrefix . "dance 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', 'dance');
foreach ($query->result_array() as $row) {
ob_end_flush();
//关闭缓存
$id = $row['id'];
//获取静态路径
$Htmllinks = LinkUrl('down', 'id', $row['id'], 0, 'dance', $row['name']);
//转换成生成路径
$Htmllink = adminhtml($Htmllinks, 'dance');
//摧毁部分需要超级链接字段数组
$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['shits']);
unset($row['xhits']);
//获取当前分类下二级分类ID
$arr['cid'] = getChild($row['cid']);
$arr['uid'] = $row['uid'];
$arr['did'] = $row['id'];
$arr['singerid'] = $row['singerid'];
$arr['tags'] = $rows['tags'];
//装载模板并输出
$Mark_Text = $this->CsdjTpl->plub_show('dance', $row, $arr, TRUE, 'down.html', $row['name'], $row['name']);
//评论
$Mark_Text = str_replace("[dance:pl]", get_pl('dance', $id), $Mark_Text);
//分类地址、名称
$Mark_Text = str_replace("[dance:link]", LinkUrl('play', 'id', $row['id'], 1, 'dance'), $Mark_Text);
$Mark_Text = str_replace("[dance:classlink]", LinkUrl('lists', 'id', $row['cid'], 1, 'dance'), $Mark_Text);
$Mark_Text = str_replace("[dance:classname]", $this->CsdjDB->getzd('dance_list', 'name', $row['cid']), $Mark_Text);
//专辑
if ($row['tid'] == 0) {
$Mark_Text = str_replace("[dance:topiclink]", "###", $Mark_Text);
$Mark_Text = str_replace("[dance:topicname]", "未加入", $Mark_Text);
} else {
$Mark_Text = str_replace("[dance:topiclink]", LinkUrl('topic', 'show', $row['tid'], 1, 'dance'), $Mark_Text);
$Mark_Text = str_replace("[dance:topicname]", $this->CsdjDB->getzd('dance_topic', 'name', $row['tid']), $Mark_Text);
}
//获取上下曲
preg_match_all('/[dance:slink]/', $Mark_Text, $arr);
if (!empty($arr[0]) && !empty($arr[0][0])) {
$rowd = $this->db->query("Select id,cid,name from " . CS_SqlPrefix . "dance where yid=0 and hid=0 and id<" . $id . " order by id desc limit 1")->row();
if ($rowd) {
$Mark_Text = str_replace("[dance:slink]", LinkUrl('play', 'id', $rowd->id, 1, 'dance'), $Mark_Text);
$Mark_Text = str_replace("[dance:sname]", $rowd->name, $Mark_Text);
$Mark_Text = str_replace("[dance:sid]", $rowd->id, $Mark_Text);
} else {
$Mark_Text = str_replace("[dance:slink]", "#", $Mark_Text);
$Mark_Text = str_replace("[dance:sname]", L('plub_45'), $Mark_Text);
$Mark_Text = str_replace("[dance:sid]", 0, $Mark_Text);
开发者ID:djqhuan,项目名称:CSCMS-v4.0-UTF8,代码行数:67,代码来源:html.php
示例15: getChild
function getChild($first)
{
if (isset($first['child'])) {
echo '<ul class="treeview-menu">';
foreach ($first['child'] as $second) {
$url = getUrl($second);
echo '<li><a style="cursor: pointer;" ' . $url . '><i class="fa fa-circle-o"></i> ' . $second['name'];
if (isset($second['child'])) {
echo '<i class="fa fa-angle-left pull-right"></i>';
getChild($second);
}
echo '</a></li>';
}
echo '</ul>';
}
}
开发者ID:hisune,项目名称:tinymvc-demo,代码行数:16,代码来源:index.php
示例16: index
public function index($fid = 'id', $id = 0)
{
$id = intval($fid) > 0 ? intval($fid) : intval($id);
//ID
//判断ID
if ($id == 0) {
msg_url(L('dance_09'), Web_Path);
}
//获取数据
$row = $this->CsdjDB->get_row_arr('dance', '*', $id);
if (!$row || $row['yid'] > 0 || $row['hid'] > 0) {
msg_url(L('dance_10'), Web_Path);
}
//判断运行模式,生成则跳转至静态页面
$html = config('Html_Uri');
if (config('Web_Mode') == 3 && $html['down']['check'] == 1) {
//获取静态路径
$Htmllink = LinkUrl('play', 'id', $id, 0, 'dance');
header("Location: " . $Htmllink);
exit;
}
//摧毁部分需要超级链接字段数组
$rows = $row;
//先保存数组保留下面使用
unset($row['tags']);
//获取当前分类下二级分类ID
$arr['cid'] = getChild($row['cid']);
$arr['uid'] = $row['uid'];
$arr['singerid'] = $row['singerid'];
$arr['tags'] = $rows['tags'];
//装载模板并输出
$Mark_Text = $this->CsdjTpl->plub_show('dance', $row, $arr, TRUE, 'down.html', $row['name'], $row['name']);
//评论
$Mark_Text = str_replace("[dance:pl]", get_pl('dance', $id), $Mark_Text);
//分类地址、名称
$Mark_Text = str_replace("[dance:link]", LinkUrl('play', 'id', $row['id'], 1, 'news'), $Mark_Text);
$Mark_Text = str_replace("[dance:classlink]", LinkUrl('lists', 'id', $row['cid'], 1, 'dance'), $Mark_Text);
$Mark_Text = str_replace("[dance:classname]", $this->CsdjDB->getzd('dance_list', 'name', $row['cid']), $Mark_Text);
//专辑
if ($row['tid'] == 0) {
$Mark_Text = str_replace("[dance:topiclink]", "###", $Mark_Text);
$Mark_Text = str_replace("[dance:topicname]", L('dance_11'), $Mark_Text);
} else {
$Mark_Text = str_replace("[dance:topiclink]", LinkUrl('topic', 'show', $row['tid'], 1, 'dance'), $Mark_Text);
$Mark_Text = str_replace("[dance:topicname]", $this->CsdjDB->getzd('dance_topic', 'name', $row['tid']), $Mark_Text);
}
//标签加超级连接
$Mark_Text = str_replace("[dance:tags]", SearchLink($rows['tags']), $Mark_Text);
//歌曲完整试听、下载地址
preg_match_all('/[dance:qurl]/', $Mark_Text, $arr);
if (!empty($arr[0]) && !empty($arr[0][0])) {
$purl = $row['purl'];
$durl = $row['durl'];
if ($row['fid'] > 0) {
$rowf = $this->db->query("Select purl,durl from " . CS_SqlPrefix . "dance_server where id=" . $row['fid'] . "")->row_array();
if ($rowf) {
$purl = $rowf['purl'] . $row['purl'];
$durl = $rowf['durl'] . $row['durl'];
}
}
$purl = annexlink($purl);
$durl = annexlink($durl);
$Mark_Text = str_replace("[dance:qurl]", $purl, $Mark_Text);
$Mark_Text = str_replace("[dance:qxurl]", $durl, $Mark_Text);
}
unset($arr);
echo $Mark_Text;
$this->cache->end();
//由于前面不是直接输出,所以这里需要加入写缓存
}
开发者ID:djqhuan,项目名称:CSCMS-v4.0-UTF8,代码行数:70,代码来源:down.php
示例17: type_save
public function type_save()
{
if ($this->huri['lists']['check'] == 0) {
admin_msg('新闻分类未开启生成~!', 'javascript:history.back();', 'no');
}
$ac = $this->input->get_post('ac', true);
//方式
$cid = $this->input->get_post('cid', true);
//需要生成的分类ID
$fid = $this->input->get_post('fid', true);
//需要生成的排序方式
$nums = intval($this->input->get('nums'));
//分类已完成数量
$numx = intval($this->input->get('numx'));
//排序方式已完成数量
$start = intval($this->input->get('start'));
//当前页生成编号
$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 ($start == 0) {
$start = 1;
}
if (empty($fid)) {
$fid = $ac == 'all' ? 'id,news,reco,hits,yhits,zhits,rhits,xhits,shits,dhits,chits,phits' : 'id';
}
//生成全部分类获取全部分类ID
if ($ac == 'all' && $nums == 0) {
$cid = array();
$query = $this->db->query("SELECT id FROM " . CS_SqlPrefix . "news_list where yid=0 order by xid asc");
foreach ($query->result() as $rowc) {
$cid[] = $rowc->id;
}
}
//将数组转换成字符
if (is_array($cid)) {
$cid = implode(',', $cid);
}
if (is_array($fid)) {
$fid = implode(',', $fid);
}
//没有选择分类
if (empty($cid)) {
admin_msg('请选择要生成的分类~!', site_url('news/admin/html/type'));
}
//公众URI
$uri = '?ac=' . $ac . '&cid=' . $cid . '&
|
请发表评论