“Api.class.php”的版本间的差异

来自通约智库
跳转至: 导航搜索
(清空页面)
第1行: 第1行:
<?php
 
/**
 
* Created by PhpStorm.
 
* User: yzg
 
* Date: 2016/1/26
 
* Time: 15:15
 
*/
 
if (!defined('IN_DISCUZ'))
 
{
 
    exit('Access Denied');
 
}
 
class xigua_re
 
{
 
   
 
    public function viewthread_variables(& $params)
 
    {
 
        include_once DISCUZ_ROOT.'./source/plugin/xigua_re/common.php';
 
        include_once DISCUZ_ROOT.'./source/plugin/xigua_re/hook.class.php';
 
        global $_G;
 
        $config = $_G['cache']['plugin']['xigua_re'];
 
        $color = $config['linkcolor'] ? $config['linkcolor'] : '#D75847';
 
        $ren = lang('plugin/xigua_re', 'ren');
 
//如果(没有创建数组($_G[id],序列化($config[关闭fid])
 
        if(in_array($_G['fid'], unserialize($config['closefids']))){
 
//回来
 
            return;
 
        }
 
//循环执行($params[放入列表])向$index 传入 $itme)
 
        foreach ($params['postlist'] as $index => $item)
 
            {
 
  
//如果没有创建数值($项目[名单],序列化的($配置[打开组]))
 
            if(!in_array($item['groupid'], unserialize($config['opengroups'])))
 
            {
 
//持续
 
                continue;
 
            }
 
//如果($config[第一]  !$item[第一])是一样的
 
            if($config['first'] && !$item['first'])
 
            {
 
//持续执行
 
                continue;
 
            }
 
 
//$user = 合并作用域t(#xigua_re#xgre_user)指向 取来_使用者($item[作者])
 
            $user = C::t('#xigua_re#xgre_user')->fetch_user($item['authorid']);
 
//如果(!$user[打开id])
 
            if(!$user['openid']){
 
//如果($config[需要开放id])
 
                if($config['needopenid']) {
 
//持续执行
 
                    continue;
 
                }
 
            }
 
//如果$user[信息]
 
            if(!$user['word']){
 
//$user[信息] = $config[之前信息]
 
                $user['word'] = $config['preword'];
 
            }
 
//$subject = $params[线][主题]?网址编码($params[线][主题]):网址编码($item[最近的注释])
 
            $subject = $params['thread']['subject'] ? urlencode($params['thread']['subject']) : urlencode($item['recentnote']);
 
//$subjest = 字符串_替换(创建数组(
 
            $subject = str_replace(array(
 
// \ 回车 空格 跳格(移至下一列)
 
                '\'', "\n", "\r", "\t", "&nbsp;", "&amp;nbsp;"
 
            ), '', $subject);
 
 
            $postid = 'pid_'.$item['pid'];
 
            $tid  = $item['tid'];
 
 
            $imgs = $reilist = '';
 
//                                                取来_使用者计数_通过_放入用户
 
            $count = C::t('#xigua_re#xgre_order')->fetch_usercount_by_postid($postid);
 
 
            if($count){
 
//                                                  取来_使用者_通过_放入id
 
                $list = C::t('#xigua_re#xgre_order')->fetch_user_by_postid($postid);
 
                foreach ($list as $itm) {
 
//                                风格 = 陈列:排成行-立方体;边缘:            竖的-排列:顶部          风格  宽度      高度        显示  立方体 边缘                                                              站点    来源
 
                    $imgs .= "<li style='display:inline-block;margin:0 6px 6px 0;vertical-align:top'><img style='width:28px;height:28px;display:block;margin:0' src=\"$itm\" onerror='this.error=null;this.src=\"{$_G['siteurl']}source/plugin/xigua_re/static/noavatar.gif\"' /> </li>";
 
                }
 
 
                $count = "<a style='color:#627C97;font-size:16px' href=\"{$_G['siteurl']}plugin.php?id=xigua_re:list&uid={$item['authorid']}&tid=$tid&postid=$postid\">$count</a>";
 
                $reilist = "
 
<p style='font-size:16px;text-align:center;color:#909090'>{$count}$ren$config[linkword]</p><ul style='width:272px;margin:10px auto;text-align:center' class=\"cl\">$imgs</ul>
 
";
 
            }
 
 
            $params['postlist'][ $index ]['message'] = $params['postlist'][ $index ]['message'].
 
           
 
//风格 = 字体大小                                                  灰色
 
//风格 = 宽度:100%;填充:8px 0 25px;:水平_对齐:居中               
 
                <<<HTML
 
<div style="font-size:16px;text-align:center;padding-top:10px;color:#909090;clear:both;width:100%;">$user[word]
 
<div style="width:100%;padding:8px 0 25px;text-align:center"><a style="display:inline-block;height:32px;line-height:32px;padding:0 25px;font-size:16px;text-align: center;margin:0 auto;vertical-align: middle;color: #fff;border-radius: 4px;background:$color" href='{$_G['siteurl']}plugin.php?id=xigua_re:index&uid={$item['authorid']}&subject=$subject&tid=$tid&postid=$postid'>$config[linkword]</a>
 
$reilist
 
HTML;
 
        }
 
    }
 
    function profile_extraInfo()
 
    {
 
        global $_G;
 
        $config = $_G['cache']['plugin']['xigua_
 

2022年11月20日 (日) 10:52的版本