您当前的位置:首页 > 网站建设笔记 >

discuz helper_notification类的get_categorynum()方法代码注释

0
<?php
//array('follower'=>1,'friend'=>1,'post'=>1,)
public function get_categorynum($newprompt_data) {
	global $_G;
	$categorynum = array();
	if (empty($newprompt_data) || !is_array($newprompt_data)) {
		return array();
	}
	foreach($newprompt_data as $key => $val) {
		//有谁知道follow、follower代表什么?
		if (in_array($key, array('follow','follower'))) {
			continue;
		}
		if (in_array($key, $_G['notice_structure']['mypost'])) {
			$categorynum['mypost'] += $val;
		} elseif(in_array($key, $_G['notice_structure']['interactive'])) {
			$categorynum['interactive'] += $val;
		} else {
			$categorynum[$key] = $val;
		}
	}
	return $categorynum;
}

//以下打印$_G["notice_structure"]
$_G["notice_structure"] = array(
  'mypost'=>array (
    0=>'post',
    1=>'pcomment',
    2=>'activity',
    3=>'reward',
    4=>'goods',
    5=>'at',
  ),
  'interactive'=>array (
    0=>'poke',
    1=>'friend',
    2=>'wall',
    3=>'comment',
    4=>'click',
    5=>'sharenotice',
  ),
  'system'=>array (
    0=>'system',
    1=>'myapp',
    2=>'credit',
    3=>'group',
    4=>'verify',
    5=>'magic',
    6=>'task',
    7=>'show',
    8=>'group',
    9=>'pusearticle',
    10=>'mod_member',
    11=>'blog',
    12=>'article',
  ),
  'manage'=>array (
    0=>'mod_member',
    1=>'report',
    2=>'pmreport',
  ),
  'app'=>array (),
);
?>

建站咨询

在线咨询真诚为您提供专业解答服务

咨询热线

137 1731 25507×24小时服务热线

微信交流

二维码终于等到你,还好我没放弃
返回顶部