当前位置: 首页>>代码示例>>PHP>>正文


PHP get_linkage函数代码示例

本文整理汇总了PHP中get_linkage函数的典型用法代码示例。如果您正苦于以下问题:PHP get_linkage函数的具体用法?PHP get_linkage怎么用?PHP get_linkage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_linkage函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: linkage

 function linkage($field, $value)
 {
     $setting = string2array($this->fields[$field]['setting']);
     $datas = getcache($setting['linkageid'], 'linkage');
     $infos = $datas['data'];
     if ($setting['showtype'] == 1 || $setting['showtype'] == 3) {
         $result = get_linkage($value, $setting['linkageid'], $setting['space'], $setting['showtype']);
     } elseif ($setting['showtype'] == 2) {
         $result = $value;
     } else {
         $result = get_linkage($value, $setting['linkageid'], $setting['space'], 2);
     }
     return $result;
 }
开发者ID:cfhb,项目名称:MIS,代码行数:14,代码来源:content_output.class.php

示例2: get_linkage

/**
 * 通过id获取显示联动菜单
 * @param  $linkageid 联动菜单ID
 * @param  $keyid 菜单keyid
 * @param  $space 菜单间隔符
 * @param  $tyoe 1 返回间隔符链接,完整路径名称 3 返回完整路径数组,2返回当前联动菜单名称,4 直接返回ID
 * @param  $result 递归使用字段1
 * @param  $infos 递归使用字段2
 */
function get_linkage($linkageid, $keyid, $space = '>', $type = 1, $result = array(), $infos = array())
{
    if ($space == '' || !isset($space)) {
        $space = '>';
    }
    if (!$infos) {
        $datas = getcache($keyid, 'linkage');
        $infos = $datas['data'];
    }
    if ($type == 1 || $type == 3 || $type == 4) {
        if (array_key_exists($linkageid, $infos)) {
            $result[] = $type == 1 ? $infos[$linkageid]['name'] : ($type == 4 ? $linkageid : $infos[$linkageid]);
            return get_linkage($infos[$linkageid]['parentid'], $keyid, $space, $type, $result, $infos);
        } else {
            if (count($result) > 0) {
                krsort($result);
                if ($type == 1 || $type == 4) {
                    $result = implode($space, $result);
                }
                return $result;
            } else {
                return $result;
            }
        }
    } else {
        return $infos[$linkageid]['name'];
    }
}
开发者ID:hw18708118867,项目名称:htmlmoban,代码行数:37,代码来源:global.func.php

示例3: info_publish


//.........这里部分代码省略.........
             if ($model['siteid'] == $siteid) {
                 $datas = array();
                 $this->content_db->set_model($modelid);
                 $datas = $this->content_db->select(array('username' => $memberinfo['username'], 'sysadd' => 0), 'id,catid,title,url,username,sysadd,inputtime,status', 100, 'id DESC');
             }
         }
         setcache('member_' . $memberinfo['userid'] . '_' . $siteid, $infos, 'content');
         //缓存结果 END
         if ($info['status'] == 99) {
             showmessage(L('contributors_success'), APP_PATH . 'index.php?m=member&c=content&a=info_top&id=' . $id . '&catid=' . $catid . '&msg=1');
         } else {
             showmessage(L('contributors_checked'), APP_PATH . 'index.php?m=member&c=content&a=info_top&id=' . $id . '&catid=' . $catid . '&msg=1');
         }
     } else {
         $show_header = $show_dialog = $show_validator = '';
         $step = $step_1 = $step_2 = $step_3 = $step_4;
         $temp_language = L('news', '', 'content');
         $sitelist = getcache('sitelist', 'commons');
         /*
         if(!isset($_GET['siteid']) && count($sitelist)>1) {
         	include template('member', 'content_publish_select_model');
         	exit;
         }
         */
         //设置cookie 在附件添加处调用
         param::set_cookie('module', 'content');
         $siteid = intval($_GET['siteid']);
         //获取信息模型类别、区域、城市信息
         $info_linkageid = getinfocache('info_linkageid');
         $cityid = getcity(trim($_GET['city']), 'linkageid');
         $cityname = getcity(trim($_GET['city']), 'name');
         $citypinyin = getcity(trim($_GET['city']), 'pinyin');
         $zone = intval($_GET['zone']);
         $zone_name = get_linkage($zone, $info_linkageid, '', 0);
         if (!$siteid) {
             $siteid = 1;
         }
         $CATEGORYS = getcache('category_content_' . $siteid, 'commons');
         $priv_db = pc_base::load_model('category_priv_model');
         //加载栏目权限表数据模型
         foreach ($CATEGORYS as $catid => $cat) {
             if ($cat['siteid'] == $siteid && $cat['child'] == 0 && $cat['type'] == 0 && $priv_db->get_one(array('catid' => $catid, 'roleid' => $memberinfo['groupid'], 'is_admin' => 0, 'action' => 'add'))) {
                 break;
             }
         }
         $catid = $_GET['catid'] ? intval($_GET['catid']) : $catid;
         if (!$catid) {
             showmessage(L('category') . L('publish_deny'), APP_PATH . 'index.php?m=member');
         }
         //判断本栏目是否允许投稿
         if (!$priv_db->get_one(array('catid' => $catid, 'roleid' => $memberinfo['groupid'], 'is_admin' => 0, 'action' => 'add'))) {
             showmessage(L('category') . L('publish_deny'), APP_PATH . 'index.php?m=member');
         }
         $category = $CATEGORYS[$catid];
         if ($category['siteid'] != $siteid) {
             showmessage(L('site_no_category'), '?m=member&c=content&a=info_publish');
         }
         $setting = string2array($category['setting']);
         if ($zone == 0 && !isset($_GET['catid'])) {
             $step = 1;
             include template('member', 'info_content_publish_select');
             exit;
         } elseif ($zone == 0 && $category['child']) {
             $step = 2;
             $step_1 = '<a href="' . APP_PATH . 'index.php?m=member&c=content&a=info_publish&siteid=' . $siteid . '&city=' . $citypinyin . '">' . $category['catname'] . '</a>';
             include template('member', 'info_content_publish_select');
开发者ID:boylzj,项目名称:omguitar,代码行数:67,代码来源:content.php


注:本文中的get_linkage函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。