예제 #1
0
function viewReply($tid, $page, $replies, $per, $max, $ptable, $order)
{
    global $db, $db_shield;
    $page == 'e' && ($page = 65535);
    (int) $page < 1 && ($page = 1);
    $total = ceil($replies / $per);
    $total == 0 ? $page = 1 : ($page > $total ? $page = $total : '');
    $satrt = ($page - 1) * $per;
    $id = $satrt;
    $limit = pwLimit($satrt, $per);
    $posts = '';
    $pw_posts = GetPtable($ptable);
    $sql = "SELECT p.aid,p.pid,p.subject,p.author,p.authorid,p.content,p.postdate,p.anonymous,p.ifshield,m.groupid \n\t\t\tFROM {$pw_posts} p LEFT JOIN pw_members m ON m.uid = p.authorid\n\t\t\tWHERE tid=" . pwEscape($tid) . " \n\t\t\tAND ifcheck=1 ORDER BY postdate {$limit}";
    if ($order == 2) {
        $sql = "SELECT p.aid,p.pid,p.subject,p.author,p.authorid,p.content,p.postdate,p.anonymous,p.ifshield,m.groupid \n\t\t\t\tFROM {$pw_posts} p LEFT JOIN pw_members m ON m.uid = p.authorid\n\t\t\t\tWHERE tid=" . pwEscape($tid) . " \n\t\t\t\tAND ifcheck=1 ORDER BY postdate desc {$limit}";
    }
    $query = $db->query($sql);
    while ($ct = $db->fetch_array($query)) {
        if ($ct['content']) {
            $id++;
            if ($ct['ifshield'] || $ct['groupid'] == 6 && $db_shield) {
                if ($ct['ifshield'] == 2) {
                    $ct['content'] = shield('shield_del_article');
                    $ct['subject'] = '';
                    $tpc_shield = 1;
                } else {
                    $ct['content'] = shield($ct['ifshield'] ? 'shield_article' : 'ban_article');
                    $ct['subject'] = '';
                    $tpc_shield = 1;
                }
            }
            $ct['subject'] = str_replace('&nbsp;', '', wap_cv($ct['subject']));
            $ct['content'] = replySubject($ct['content']);
            list(, $ct['postdate']) = getLastDate($ct['postdate']);
            $ct['id'] = $id;
            if ($order == 2) {
                $ct['id'] = $replies - $id + 1;
            }
            if ($ct['anonymous'] && $ct['authorid'] != $winduid) {
                $ct['author'] = $db_anonymousname;
                $ct['authorid'] = 0;
            }
            $ct['author'] = wap_cv($ct['author']);
            $postdb[] = $ct;
        }
    }
    return $postdb;
}
예제 #2
0
파일: addfloor.php 프로젝트: jechiy/PHPWind
function viewread($read, $start_limit)
{
    global $db, $_G, $isGM, $pwSystem, $groupid, $attach_url, $winduid, $tablecolor, $tpc_author, $tpc_buy, $tpc_pid, $tpc_tag, $count, $orderby, $pageinverse, $timestamp, $db_onlinetime, $attachdir, $attachpath, $readcolorone, $readcolortwo, $lpic, $ltitle, $imgpath, $db_ipfrom, $db_showonline, $stylepath, $db_windpost, $db_windpic, $db_signwindcode, $fid, $tid, $pid, $db_md_ifopen, $_MEDALDB, $rewardtype, $db_shield, $db_iftag, $db_readtag, $viewpic;
    global $ping_logs;
    if ($read['istop'] == 'topped') {
        $read['lou'] = $read['floor'];
    } else {
        $read['lou'] = $count - $start_limit;
    }
    $read['jupend'] = $start_limit == $count - 1 ? "<a name=a></a><a name={$read['pid']}></a>" : "<a name={$read['pid']}></a>";
    $tpc_buy = $read['buy'];
    $tpc_pid = $read['pid'];
    $tpc_tag = NULL;
    $tpc_shield = 0;
    $read['ifsign'] < 2 && ($read['content'] = str_replace("\n", "<br />", $read['content']));
    if ($read['anonymous']) {
        $anonymous = !$isGM && $winduid != $read['authorid'] && !$pwSystem['anonyhide'];
        $read['anonymousname'] = $GLOBALS['db_anonymousname'];
    } else {
        $anonymous = false;
        $read['anonymousname'] = $read['username'];
    }
    $read['ipfrom'] = $db_ipfrom == 1 && $_G['viewipfrom'] ? $read['ipfrom'] : '';
    $read['ip'] = $isGM || $pwSystem['viewip'] ? 'IP:' . $read['userip'] : '';
    if ($read['groupid'] && !$anonymous) {
        $read['groupid'] == '-1' && ($read['groupid'] = $read['memberid']);
        !array_key_exists($read['groupid'], (array) $lpic) && ($read['groupid'] = 8);
        $read['lpic'] = $lpic[$read['groupid']];
        $read['level'] = $ltitle[$read['groupid']];
        $read['regdate'] = get_date($read['regdate'], "Y-m-d");
        $read['lastlogin'] = get_date($read['lastvisit'], "Y-m-d");
        $read['rvrc'] = floor($read['rvrc'] / 10);
        $read['author'] = $read['username'];
        $tpc_author = $read['author'];
        if (!empty($GLOBALS['showfield'])) {
            $customdata = $read['customdata'] ? (array) unserialize($read['customdata']) : array();
            $read['customdata'] = array();
            foreach ($customdata as $key => $val) {
                if ($val && in_array($key, $GLOBALS['showfield'])) {
                    $read['customdata'][$key] = $val;
                }
            }
        }
        $read['ontime'] = (int) ($read['onlinetime'] / 3600);
        $read['groupid'] == 6 && ($read['honor'] = '');
        if ($read['groupid'] != 6 && ($read['ifsign'] == 1 || $read['ifsign'] == 3)) {
            global $sign;
            if (!$sign[$read['author']]) {
                global $db_signmoney, $db_signgroup, $tdtime, $db_signcurtype;
                if ($db_signmoney && strpos($db_signgroup, ",{$read['groupid']},") !== false && (!getstatus($read['userstatus'], PW_USERSTATUS_SHOWSIGN) || !$read['starttime'] || $read[$db_signcurtype] < ($tdtime - $read['starttime']) / 86400 * $db_signmoney)) {
                    $read['signature'] = '';
                } else {
                    if ($db_signwindcode && getstatus($read['userstatus'], PW_USERSTATUS_SIGNCHANGE)) {
                        if ($GLOBALS['gp_right'][$read['groupid']]['imgwidth'] && $GLOBALS['gp_right'][$read['groupid']]['imgheight']) {
                            $db_windpic['picwidth'] = $GLOBALS['gp_right'][$read['groupid']]['imgwidth'];
                            $db_windpic['picheight'] = $GLOBALS['gp_right'][$read['groupid']]['imgheight'];
                        }
                        if ($GLOBALS['gp_right'][$read['groupid']]['fontsize']) {
                            $db_windpic['size'] = $GLOBALS['gp_right'][$read['groupid']]['fontsize'];
                        }
                        $read['signature'] = convert($read['signature'], $db_windpic, 2);
                    }
                    $read['signature'] = str_replace("\n", "<br />", $read['signature']);
                }
                $sign[$read['author']] = $read['signature'];
            } else {
                $read['signature'] = $sign[$read['author']];
            }
        } else {
            $read['signature'] = '';
        }
    } else {
        $read['lpic'] = $lpic['2'];
        $read['level'] = $read['digests'] = $read['postnum'] = $read['money'] = $read['currency'] = '*';
        $read['rvrc'] = $read['lastlogin'] = $read['credit'] = $read['regdate'] = '*';
        $read['honor'] = $read['signature'] = $read['micon'] = $read['aliww'] = '';
        if ($anonymous) {
            $read['oicq'] = $read['ip'] = $read['medals'] = $read['ipfrom'] = '';
            $read['author'] = $GLOBALS['db_anonymousname'];
            $read['authorid'] = 0;
            foreach ($GLOBALS['customfield'] as $key => $val) {
                $field = "field_" . (int) $val['id'];
                $read[$field] = '*';
            }
        }
    }
    list($read['face'], , $httpWidth, $httpHeight, , , , $read['facesize']) = showfacedesign($read['micon'], true, 'm');
    if ($httpWidth > 120 || $httpHeight > 120 || $read['facesize'] == '') {
        $read['facesize'] = ' width="120" height="120"';
    }
    list($read['posttime'], $read['postdate']) = getLastDate($read['postdate']);
    $read['mark'] = $read['reward'] = $read['tag'] = NULL;
    if ($read['ifmark']) {
        $ping_logs[$read['pid']] = $read['ifmark'];
    }
    if ($rewardtype != null) {
        if ($read['lou'] == 0 || $read['ifreward'] > 0 || $rewardtype == '0' && $winduid == $GLOBALS['authorid'] && $winduid != $read['authorid']) {
            $read['reward'] = Getrewhtml($read['lou'], $read['ifreward'], $read['pid']);
        }
    }
    if ($read['icon']) {
        $read['icon'] = "<img src=\"{$imgpath}/post/emotion/{$read['icon']}.gif\" align=\"left\" border=\"0\" />";
    } else {
        $read['icon'] = '';
    }
    if ($db_md_ifopen && $read['medals']) {
        $medals = $ifMedalNotExist = '';
        $md_a = explode(',', $read['medals']);
        foreach ($md_a as $key => $value) {
            if ($value && $_MEDALDB[$value]) {
                $medals .= "<a href=\"apps.php?q=medal\" target=\"_blank\"><img src=\"{$_MEDALDB[$value][smallimage]}\" width=\"30\" height=\"30\"  title=\"{$_MEDALDB[$value][name]}\" /></a>";
            } else {
                unset($md_a[$key]);
                $ifMedalNotExist = 1;
            }
        }
        if ($ifMedalNotExist == 1) {
            $newMedalInfo = implode(',', $md_a);
            $userService = L::loadClass('UserService', 'user');
            /* @var $userService PW_UserService */
            $userService->update($read['authorid'], array('medals' => $newMedalInfo));
        }
        $read['medals'] = $medals . '<br />';
    } else {
        $read['medals'] = '';
    }
    $read['leaveword'] && ($read['content'] .= leaveword($read['leaveword'], $read['pid']));
    if ($read['ifshield'] || $read['groupid'] == 6 && $db_shield) {
        if ($read['ifshield'] == 2) {
            $read['content'] = shield('shield_del_article');
            $read['subject'] = '';
            $tpc_shield = 1;
        } else {
            if ($groupid == '3') {
                $read['subject'] = shield('shield_title');
            } else {
                $read['content'] = shield($read['ifshield'] ? 'shield_article' : 'ban_article');
                $read['subject'] = '';
                $tpc_shield = 1;
            }
        }
        $read['icon'] = '';
    }
    if (!$tpc_shield) {
        if ($read['ifwordsfb'] != $GLOBALS['db_wordsfb']) {
            $read['content'] = wordsConvert($read['content'], array('id' => $tpc_pid == 'tpc' ? $tid : $tpc_pid, 'type' => $tpc_pid == 'tpc' ? 'topic' : 'posts', 'code' => $read['ifwordsfb']));
        }
        if ($read['ifconvert'] == 2) {
            $read['content'] = convert($read['content'], $db_windpost);
        } else {
            $tpc_tag && ($read['content'] = relatetag($read['content'], $tpc_tag));
            strpos($read['content'], '[s:') !== false && ($read['content'] = showface($read['content']));
        }
        if ($read['aid'] && $GLOBALS['attachShow']->isShow($read['ifhide'], $tid)) {
            $read += $GLOBALS['attachShow']->parseAttachs($read['pid'], $read['content'], $winduid == $read['authorid']);
        }
    }
    /**
     * convert the post content
     */
    $read['alterinfo'] && ($read['content'] .= "<div id=\"alert_{$read['pid']}\" style=\"color:gray;margin-top:30px\">[ {$read['alterinfo']} ]</div>");
    if ($read['remindinfo']) {
        $remind = explode("\t", $read['remindinfo']);
        $remind[0] = str_replace("\n", "<br />", $remind[0]);
        $remind[2] && ($remind[2] = get_date($remind[2]));
        $read['remindinfo'] = $remind;
    }
    if ($_GET['keyword']) {
        $keywords = explode("|", $_GET['keyword']);
        foreach ($keywords as $key => $value) {
            if ($value) {
                $read['content'] = preg_replace("/(?<=[\\s\"\\]>()]|[-�]|^)(" . preg_quote($value, '/') . ")([.,:;-?!()\\s\"<\\[]|[-�]|\$)/siU", "<u><font color=\"red\">\\1</font></u>\\2", $read['content']);
            }
        }
    }
    //$GLOBALS['foruminfo']['copyctrl'] && $read['content'] = preg_replace("/<br \/>/eis","copyctrl()",$read['content']);
    return $read;
}
예제 #3
0
// This is a list of charges or ordinaries awaiting a tincture
$pending_items = array();
// This is our XML generator and top level item for the parse tree
$dom = new DOMDocument('1.0');
// Read in the parsing code
$dir = opendir('parser');
while (($file = readdir($dir)) != false) {
    if (substr($file, -4) == '.inc') {
        require 'parser/' . $file;
    }
}
$parser_messages = $dom->createElement('messages');
fill_words($blazon);
$node = $dom->createElement('blazon');
$node->setAttribute("blazonText", $blazon);
$node->appendChild(shield());
$bad_words = '';
if ($cur_word < count($words)) {
    while ($cur_word < count($words)) {
        $bad_words .= $words[$cur_word++] . ' ';
    }
    parser_message('blazon', 'Not understood - ' . $bad_words);
}
parser_message('Disclaimer:', 'Provided for education and information only. The use of heraldic devices is restricted in many countries, independently of copyright. The granting of a Coat of Arms is solely the right of the appropriate Heraldic Authority for your nationality and country of residence.');
if ($parser_messages->hasChildNodes()) {
    $node->appendChild($parser_messages);
}
$dom->appendChild($node);
// Read in the drawing code
$dir = opendir($format);
while (($file = readdir($dir)) != false) {
예제 #4
0
 function htmread($read, $start_limit)
 {
     global $imgpath, $db_ipfrom, $db_windpost, $db_windpic, $db_signwindcode, $db_shield;
     $lpic = L::config('lpic', 'cache_read');
     $ltitle = L::config('ltitle', 'cache_read');
     $_MEDALDB = L::config('_MEDALDB', 'cache_read');
     $read['lou'] = $start_limit;
     $start_limit == $count - 1 && ($read['jupend'] = '<a name=lastatc></a>');
     $read['ifsign'] < 2 && ($read['content'] = str_replace("\n", "<br>", $read['content']));
     $read['groupid'] == '-1' && ($read['groupid'] = $read['memberid']);
     $anonymous = $read['anonymous'] ? 1 : 0;
     if ($read['groupid'] != '' && $anonymous == 0) {
         !$lpic[$read['groupid']] && ($read['groupid'] = 8);
         $read['lpic'] = $lpic[$read['groupid']];
         $read['level'] = $ltitle[$read['groupid']];
         $read['regdate'] = get_date($read['regdate'], "Y-m-d");
         $read['lastlogin'] = get_date($read['lastvisit'], "Y-m-d");
         $read['aurvrc'] = floor($read['rvrc'] / 10);
         $read['author'] = $read['username'];
         $read['ontime'] = (int) ($read['onlinetime'] / 3600);
         $tpc_author = $read['author'];
         list($read['face'], , $httpWidth, $httpHeight, , , , $read['facesize']) = showfacedesign($read['micon'], true, 'm');
         if ($httpWidth > 120 || $httpHeight > 120 || $read['facesize'] == '') {
             $read['facesize'] = ' width="120" height="120"';
         }
         list($read['posttime']) = getLastDate($read['postdate']);
         if ($db_ipfrom == 1) {
             $read['ipfrom'] = ' From:' . $read['ipfrom'];
         }
         if (L::config('md_ifopen', 'cache_read') && $read['medals']) {
             $medals = '';
             $md_a = explode(',', $read['medals']);
             foreach ($md_a as $key => $value) {
                 if ($value) {
                     $medals .= "<img src=\"{$_MEDALDB[$value][smallimage]}\" title=\"{$_MEDALDB[$value][name]}\" /> ";
                 }
             }
             $read['medals'] = $medals . '<br />';
         } else {
             $read['medals'] = '';
         }
         if ($read['ifsign'] == 1 || $read['ifsign'] == 3) {
             global $sign;
             if (!$sign[$read['author']]) {
                 global $db_signmoney, $db_signgroup, $tdtime;
                 if (strpos($db_signgroup, ",{$read['groupid']},") !== false && $db_signmoney) {
                     $read['signature'] = '';
                 } else {
                     if ($db_signwindcode && getstatus($read['userstatus'], PW_USERSTATUS_SIGNCHANGE)) {
                         $read['signature'] = convert($read['signature'], $db_windpic, 2);
                     }
                     $read['signature'] = str_replace("\n", "<br>", $read['signature']);
                 }
                 $sign[$read['author']] = $read['signature'];
             } else {
                 $read['signature'] = $sign[$read['author']];
             }
         } else {
             $read['signature'] = '';
         }
     } else {
         $read['face'] = "{$imgpath}/face/none.gif";
         $read['lpic'] = '8';
         $read['level'] = $read['digests'] = $read['postnum'] = $read['money'] = $read['regdate'] = $read['lastlogin'] = $read['aurvrc'] = $read['credit'] = '*';
         if ($anonymous) {
             $read['signature'] = $read['honor'] = $read['medals'] = $read['ipfrom'] = '';
             $read['author'] = $GLOBALS['db_anonymousname'];
             $read['authorid'] = 0;
             foreach (L::config('customfield', 'cache_read') as $key => $val) {
                 $field = "field_" . (int) $val['id'];
                 $read[$field] = '*';
             }
         }
     }
     $read['postdate'] = get_date($read['postdate']);
     $read['mark'] = '';
     if ($read['ifmark']) {
         $markdb = explode("\t", $read['ifmark']);
         foreach ($markdb as $key => $value) {
             $read['mark'] .= "<li>{$value}</li>";
         }
     }
     if ($read['icon']) {
         $read['icon'] = "<img src=\"{$imgpath}/post/emotion/{$read['icon']}.gif\" align=left border=0>";
     } else {
         $read['icon'] = '';
     }
     /**
      * 动态判断发帖是否需要转换
      */
     $tpc_shield = 0;
     if ($read['ifshield'] || $read['groupid'] == 6 && $db_shield) {
         $read['subject'] = $read['icon'] = '';
         $read['content'] = shield($read['ifshield'] ? $read['ifshield'] == 1 ? 'shield_article' : 'shield_del_article' : 'ban_article');
         $tpc_shield = 1;
     }
     if (!$tpc_shield) {
         $wordsfb = L::loadClass('FilterUtil', 'filter');
         if (!$wordsfb->equal($read['ifwordsfb'])) {
             $read['content'] = $wordsfb->convert($read['content']);
         }
         if ($read['ifconvert'] == 2) {
             $read['content'] = preg_replace("/\\[sell=(.+?)\\]/is", "", $read['content']);
             $read['content'] = preg_replace("/\\[hide=(.+?)\\]/is", "", $read['content']);
             $read['content'] = str_replace(array('[/hide]', '[/sell]', '[post]', '[/post]'), '', $read['content']);
             $read['content'] = convert($read['content'], $db_windpost);
         } else {
             strpos($read['content'], '[s:') !== false && ($read['content'] = showface($read['content']));
         }
         if ($read['aid'] && $this->attachShow->isShow($read['ifhide'], $tid)) {
             $read += $this->attachShow->parseAttachs($read['pid'], $read['content'], false);
         }
     }
     if ($read['remindinfo']) {
         $remind = explode("\t", $read['remindinfo']);
         $remind[0] = str_replace("\n", "<br />", $remind[0]);
         $remind[2] && ($remind[2] = get_date($remind[2]));
         $read['remindinfo'] = $remind;
     }
     $this->forum->foruminfo['copyctrl'] && ($read['content'] = preg_replace("/<br>/eis", "copyctrl('{$read['colour']}')", $read['content']));
     $read['alterinfo'] && ($read['content'] .= "<br><br><br><font color=gray>[ {$read['alterinfo']} ]</font>");
     return $read;
 }
예제 #5
0
파일: ajax.php 프로젝트: adi00/wumaproject
 if (!$pwpost->isGM && $tpcarray['locked'] % 3 != 0 && !pwRights($pwpost->isBM, 'replylock')) {
     Showmsg('reply_lockatc');
 }
 require_once R_P . 'require/bbscode.php';
 if ($article == '0') {
     $atcarray = $tpcarray;
 } else {
     !is_numeric($pid) && Showmsg('illegal_tid');
     $atcarray = $db->get_one("SELECT p.author,p.subject,p.postdate,p.content,p.ifshield,p.anonymous,m.uid,m.groupid,m.userstatus FROM {$pw_posts} p LEFT JOIN pw_members m ON p.authorid=m.uid WHERE p.pid=" . pwEscape($pid));
 }
 if ($atcarray['ifshield'] == '1') {
     $atcarray['content'] = shield('shield_article');
 } elseif ($atcarray['ifshield'] == '2') {
     $atcarray['content'] = shield('shield_del_article');
 } elseif ($pwforum->forumBan($atcarray)) {
     $atcarray['content'] = shield('ban_article');
 }
 $old_author = $atcarray['anonymous'] ? $db_anonymousname : $atcarray['author'];
 $replytitle = $atcarray['subject'];
 $wtof_oldfile = get_date($atcarray['postdate']);
 $old_content = $atcarray['content'];
 $old_content = preg_replace("/\\[hide=(.+?)\\](.+?)\\[\\/hide\\]/is", getLangInfo('post', 'hide_post'), $old_content);
 $old_content = preg_replace("/\\[post\\](.+?)\\[\\/post\\]/is", getLangInfo('post', 'post_post'), $old_content);
 $old_content = preg_replace("/\\[sell=(.+?)\\](.+?)\\[\\/sell\\]/is", getLangInfo('post', 'sell_post'), $old_content);
 $old_content = preg_replace("/\\[quote\\](.*)\\[\\/quote\\]/is", "", $old_content);
 $bit_content = explode("\n", $old_content);
 if (count($bit_content) > 5) {
     $old_content = "{$bit_content['0']}\n{$bit_content['1']}\n{$bit_content['2']}\n{$bit_content['3']}\n{$bit_content['4']}\n.......";
 }
 if (strpos($old_content, $db_bbsurl) !== false) {
     $old_content = str_replace('p_w_picpath', $db_picpath, $old_content);
예제 #6
0
 $delright = $isGM || pwRights($isBM, 'delatc');
 $pwAnonyHide = 0;
 if (!$isGM) {
     $pwSystem = pwRights($isBM);
     $pwAnonyHide = $pwSystem['anonyhide'];
 }
 forumCheck($fid, 'read');
 InitGP(array('page'));
 (int) $page < 1 && ($page = 1);
 if ($rt['ifshield'] || $rt['groupid'] == 6 && $db_shield) {
     if ($rt['ifshield'] == 2) {
         $rt['content'] = shield('shield_del_article');
         $rt['subject'] = '';
         $tpc_shield = 1;
     } else {
         $rt['content'] = shield($rt['ifshield'] ? 'shield_article' : 'ban_article');
         $rt['subject'] = '';
         $tpc_shield = 1;
     }
 }
 $content = viewContent($rt['content']);
 $forumName = wap_cv(strip_tags($forum[$fid]['name']));
 $db_waplimit = $db_waplimit ? $db_waplimit : '';
 $clen = wap_strlen($content, $db_charset);
 //TODO mbstring
 $maxp = ceil($clen / $db_waplimit);
 $nextp = $page + 1;
 $prep = $page - 1;
 if ($nextp > $maxp) {
     $nextp = $maxp;
 }
예제 #7
0
파일: read.php 프로젝트: adi00/wumaproject
function viewread($read, $start_limit)
{
    global $db, $_G, $isGM, $pwSystem, $groupid, $attach_url, $winduid, $tablecolor, $tpc_author, $tpc_buy, $tpc_pid, $tpc_tag, $count, $orderby, $pageinverse, $timestamp, $db_onlinetime, $attachdir, $attachpath, $readcolorone, $readcolortwo, $lpic, $ltitle, $imgpath, $db_ipfrom, $db_showonline, $stylepath, $db_windpost, $db_windpic, $db_signwindcode, $fid, $tid, $pid, $md_ifopen, $_MEDALDB, $rewardtype, $db_shield, $db_iftag, $db_readtag;
    global $ping_logs;
    if ($read['istop'] == 'topped') {
        $read['lou'] = $read['floor'];
    } else {
        $read['lou'] = $orderby != 'desc' || $start_limit == 0 ? $start_limit : $count - $start_limit;
    }
    $read['jupend'] = $start_limit == $count - 1 ? "<a name=a></a><a name={$read['pid']}></a>" : "<a name={$read['pid']}></a>";
    $tpc_buy = $read['buy'];
    $tpc_pid = $read['pid'];
    $tpc_tag = NULL;
    $tpc_shield = 0;
    $read['ifsign'] < 2 && ($read['content'] = str_replace("\n", "<br />", $read['content']));
    if ($read['anonymous']) {
        $anonymous = !$isGM && $winduid != $read['authorid'] && !$pwSystem['anonyhide'];
        $read['anonymousname'] = $GLOBALS['db_anonymousname'];
    } else {
        $anonymous = false;
        $read['anonymousname'] = $read['username'];
    }
    $read['ipfrom'] = $db_ipfrom == 1 && $_G['viewipfrom'] ? $read['ipfrom'] : '';
    $read['ip'] = $isGM || $pwSystem['viewip'] ? 'IP:' . $read['userip'] : '';
    if ($read['groupid'] && !$anonymous) {
        $read['groupid'] == '-1' && ($read['groupid'] = $read['memberid']);
        !array_key_exists($read['groupid'], (array) $lpic) && ($read['groupid'] = 8);
        $read['lpic'] = $lpic[$read['groupid']];
        $read['level'] = $ltitle[$read['groupid']];
        $read['regdate'] = get_date($read['regdate'], "Y-m-d");
        $read['lastlogin'] = get_date($read['lastvisit'], "Y-m-d");
        $read['rvrc'] = floor($read['rvrc'] / 10);
        $read['author'] = $read['username'];
        $tpc_author = $read['author'];
        if (!empty($GLOBALS['showfield'])) {
            $customdata = $read['customdata'] ? (array) unserialize($read['customdata']) : array();
            $read['customdata'] = array();
            foreach ($customdata as $key => $val) {
                if ($val && in_array($key, $GLOBALS['showfield'])) {
                    $read['customdata'][$key] = $val;
                }
            }
        }
        $read['ontime'] = (int) ($read['onlinetime'] / 3600);
        $read['groupid'] == 6 && ($read['honor'] = '');
        if ($read['groupid'] != 6 && ($read['ifsign'] == 1 || $read['ifsign'] == 3)) {
            global $sign;
            if (!$sign[$read['author']]) {
                global $db_signmoney, $db_signgroup, $tdtime, $db_signcurtype;
                if ($db_signmoney && strpos($db_signgroup, ",{$read['groupid']},") !== false && (!getstatus($read['userstatus'], 10) || !$read['starttime'] || $read[$db_signcurtype] < ($tdtime - $read['starttime']) / 86400 * $db_signmoney)) {
                    $read['signature'] = '';
                } else {
                    if ($db_signwindcode && getstatus($read['userstatus'], 9)) {
                        if ($_G['right'][$read['groupid']]['imgwidth'] && $_G['right'][$read['groupid']]['imgheight']) {
                            $db_windpic['picwidth'] = $_G['right'][$read['groupid']]['imgwidth'];
                            $db_windpic['picheight'] = $_G['right'][$read['groupid']]['imgheight'];
                        }
                        if ($_G['right'][$read['groupid']]['fontsize']) {
                            $db_windpic['size'] = $_G['right'][$read['groupid']]['fontsize'];
                        }
                        $read['signature'] = convert($read['signature'], $db_windpic, 2);
                    }
                    $read['signature'] = str_replace("\n", "<br />", $read['signature']);
                }
                $sign[$read['author']] = $read['signature'];
            } else {
                $read['signature'] = $sign[$read['author']];
            }
        } else {
            $read['signature'] = '';
        }
    } else {
        $read['lpic'] = '8';
        $read['level'] = $read['digests'] = $read['postnum'] = $read['money'] = $read['currency'] = '*';
        $read['rvrc'] = $read['lastlogin'] = $read['credit'] = $read['regdate'] = '*';
        $read['honor'] = $read['signature'] = $read['micon'] = $read['aliww'] = '';
        if ($anonymous) {
            $read['oicq'] = $read['ip'] = $read['medals'] = $read['ipfrom'] = '';
            $read['author'] = $GLOBALS['db_anonymousname'];
            $read['authorid'] = 0;
            foreach ($GLOBALS['customfield'] as $key => $val) {
                $field = "field_" . (int) $val['id'];
                $read[$field] = '*';
            }
        }
    }
    $read['face'] = showfacedesign($read['micon']);
    list($read['posttime'], $read['postdate']) = getLastDate($read['postdate']);
    $read['mark'] = $read['reward'] = $read['tag'] = NULL;
    if ($read['ifmark']) {
        $ping_logs[$read['pid']] = $read['ifmark'];
    }
    if ($rewardtype != null) {
        if ($read['lou'] == 0 || $read['ifreward'] > 0 || $rewardtype == '0' && $winduid == $GLOBALS['authorid'] && $winduid != $read['authorid']) {
            $read['reward'] = Getrewhtml($read['lou'], $read['ifreward'], $read['pid']);
        }
    }
    if ($read['icon']) {
        $read['icon'] = "<img src=\"{$imgpath}/post/emotion/{$read['icon']}.gif\" align=\"left\" border=\"0\" />";
    } else {
        $read['icon'] = '';
    }
    if ($md_ifopen && $read['medals']) {
        $medals = $ifMedalNotExist = '';
        $md_a = explode(',', $read['medals']);
        foreach ($md_a as $key => $value) {
            if ($value && $_MEDALDB[$value]) {
                $medals .= "<img src=\"hack/medal/image/{$_MEDALDB[$value][picurl]}\" title=\"{$_MEDALDB[$value][name]}\" /> ";
            } else {
                unset($md_a[$key]);
                $ifMedalNotExist = 1;
            }
        }
        if ($ifMedalNotExist == 1) {
            $newMedalInfo = implode(',', $md_a);
            $db->update("UPDATE pw_members SET medals=" . pwEscape($newMedalInfo) . " WHERE uid=" . pwEscape($read['authorid']));
        }
        $read['medals'] = $medals . '<br />';
    } else {
        $read['medals'] = '';
    }
    $read['leaveword'] && ($read['content'] .= leaveword($read['leaveword'], $read['pid']));
    if ($db_iftag && $read['tags']) {
        list($tagdb, $tpc_tag) = explode("\t", $read['tags']);
        $tagdb = explode(' ', $tagdb);
        foreach ($tagdb as $key => $tag) {
            $tag && ($read['tag'] .= "<a href=\"job.php?action=tag&tagname=" . rawurlencode($tag) . "\"><span class=\"s3\">{$tag}</span></a> ");
        }
    }
    if ($read['ifshield'] || $read['groupid'] == 6 && $db_shield) {
        if ($read['ifshield'] == 2) {
            $read['content'] = shield('shield_del_article');
            $read['subject'] = '';
            $tpc_shield = 1;
        } else {
            if ($groupid == '3') {
                $read['subject'] = shield('shield_title');
            } else {
                $read['content'] = shield($read['ifshield'] ? 'shield_article' : 'ban_article');
                $read['subject'] = '';
                $tpc_shield = 1;
            }
        }
        $read['icon'] = '';
    }
    if (!$tpc_shield) {
        $aids = array();
        if ($read['aid']) {
            $attachs = $GLOBALS['attachdb'][$read['pid']];
            $read['ifhide'] > 0 && ifpost($tid) >= 1 && ($read['ifhide'] = 0);
            if (is_array($attachs) && !$read['ifhide']) {
                $aids = attachment($read['content']);
            }
        }
        if ($read['ifwordsfb'] != $GLOBALS['db_wordsfb']) {
            $read['content'] = wordsConvert($read['content'], array('id' => $tpc_pid == 'tpc' ? $tid : $tpc_pid, 'type' => $tpc_pid == 'tpc' ? 'topic' : 'posts', 'code' => $read['ifwordsfb']));
        }
        if ($read['ifconvert'] == 2) {
            $read['content'] = convert($read['content'], $db_windpost);
        } else {
            $tpc_tag && $db_readtag && ($read['content'] = relatetag($read['content'], $tpc_tag));
            strpos($read['content'], '[s:') !== false && ($read['content'] = showface($read['content']));
        }
        if ($attachs && is_array($attachs) && !$read['ifhide']) {
            if ($winduid == $read['authorid'] || $isGM || $pwSystem['delattach']) {
                $dfadmin = 1;
            } else {
                $dfadmin = 0;
            }
            foreach ($attachs as $at) {
                $atype = '';
                $rat = array();
                if ($at['type'] == 'img' && $at['needrvrc'] == 0 && (!$GLOBALS['downloadimg'] || !$GLOBALS['downloadmoney'] || $_G['allowdownload'] == 2)) {
                    $a_url = geturl($at['attachurl'], 'show');
                    if (is_array($a_url)) {
                        $atype = 'pic';
                        $dfurl = '<br>' . cvpic($a_url[0], 1, $db_windpost['picwidth'], $db_windpost['picheight'], $at['ifthumb']);
                        $rat = array('aid' => $at['aid'], 'name' => $at['name'], 'img' => $dfurl, 'dfadmin' => $dfadmin, 'desc' => $at['descrip']);
                    } elseif ($a_url == 'imgurl') {
                        $atype = 'picurl';
                        $rat = array('aid' => $at['aid'], 'name' => $at['name'], 'dfadmin' => $dfadmin, 'verify' => md5("showimg{$tid}{$read[pid]}{$fid}{$at[aid]}{$GLOBALS[db_hash]}"));
                    }
                } else {
                    $atype = 'downattach';
                    if ($at['needrvrc'] > 0) {
                        !$at['ctype'] && ($at['ctype'] = $at['special'] == 2 ? 'money' : 'rvrc');
                        $at['special'] == 2 && $GLOBALS['db_sellset']['price'] > 0 && ($at['needrvrc'] = min($at['needrvrc'], $GLOBALS['db_sellset']['price']));
                    }
                    $rat = array('aid' => $at['aid'], 'name' => $at['name'], 'size' => $at['size'], 'hits' => $at['hits'], 'needrvrc' => $at['needrvrc'], 'special' => $at['special'], 'cname' => $GLOBALS['creditnames'][$at['ctype']], 'type' => $at['type'], 'dfadmin' => $dfadmin, 'desc' => $at['descrip'], 'ext' => strtolower(substr(strrchr($at['name'], '.'), 1)));
                }
                if (!$atype) {
                    continue;
                }
                if (in_array($at['aid'], $aids)) {
                    $read['content'] = attcontent($read['content'], $atype, $rat);
                } else {
                    $read[$atype][$at['aid']] = $rat;
                }
            }
        }
    }
    /**
     * convert the post content
     */
    $read['alterinfo'] && ($read['content'] .= "<div id=\"alert_{$read['pid']}\" style=\"color:gray;margin-top:30px\">[ {$read['alterinfo']} ]</div>");
    if ($read['remindinfo']) {
        $remind = explode("\t", $read['remindinfo']);
        $remind[0] = str_replace("\n", "<br />", $remind[0]);
        $remind[2] && ($remind[2] = get_date($remind[2]));
        $read['remindinfo'] = $remind;
    }
    if ($_GET['keyword']) {
        $keywords = explode("|", $_GET['keyword']);
        foreach ($keywords as $key => $value) {
            if ($value) {
                $read['content'] = preg_replace("/(?<=[\\s\"\\]>()]|[-�]|^)(" . preg_quote($value, '/') . ")([.,:;-?!()\\s\"<\\[]|[-�]|\$)/siU", "<u><font color=\"red\">\\1</font></u>\\2", $read['content']);
            }
        }
    }
    $GLOBALS['foruminfo']['copyctrl'] && ($read['content'] = preg_replace("/<br \\/>/eis", "copyctrl()", $read['content']));
    return $read;
}
예제 #8
0
파일: mod_read.php 프로젝트: jechiy/PHPWind
function viewread($read, $start_limit)
{
    global $groupid, $admincheck, $attach_url, $attachper, $winduid, $tablecolor, $tpc_author, $tpc_buy, $count, $timestamp, $db_onlinetime, $attachpath, $_G, $readcolorone, $readcolortwo, $lpic, $ltitle, $imgpath, $db_ipfrom, $db_showonline, $stylepath, $db_windpost, $db_windpic, $db_signwindcode, $fid, $tid, $pid, $pic_a, $db_shield, $db_anonymousname;
    $tpc_buy = $read['buy'];
    $tpc_author = $read['author'];
    $read['ifsign'] < 2 && ($read['content'] = str_replace("\n", "<br>", $read['content']));
    $read['postdate'] = get_date($read['postdate']);
    if ($read['ifshield']) {
        $read['subject'] = $groupid == '3' ? shield($read['ifshield'] == '2' ? 'shield_del_title' : 'shield_title') : '';
        $groupid != '3' && ($read['content'] = shield($read['ifshield'] == '1' ? 'shield_article' : 'shield_del_article'));
    } elseif ($read['groupid'] == 6 && $groupid != 3 && $db_shield) {
        $read['subject'] = '';
        $read['content'] = shield('ban_article');
    } else {
        $wordsfb = L::loadClass('FilterUtil', 'filter');
        if (!$wordsfb->equal($read['ifwordsfb'])) {
            $read['content'] = $wordsfb->convert($read['content']);
        }
        $read['ifconvert'] == 2 && ($read['content'] = convert($read['content'], $db_windpost));
    }
    $GLOBALS['foruminfo']['copyctrl'] && ($read['content'] = preg_replace("/<br>/eis", "copyctrl('#FFFFFF')", $read['content']));
    /**
     * convert the post content
     */
    //$read['content']=stripslashes($read['content']);
    $read['anonymous'] && !$admincheck && $winduid != $read['authorid'] && ($read['author'] = $db_anonymousname);
    return $read;
}
예제 #9
0
파일: template.php 프로젝트: jechiy/PHPWind
function htmread($read, $start_limit)
{
    global $tpc_author, $count, $timestamp, $db_onlinetime, $db_bbsurl, $attachdir, $attachpath, $_G, $tablecolor, $readcolorone, $readcolortwo, $lpic, $ltitle, $imgpath, $db_ipfrom, $db_showonline, $stylepath, $db_windpost, $db_windpic, $fid, $tid, $attachments, $aids, $db_signwindcode, $db_md_ifopen, $_MEDALDB, $db_shield;
    //* include_once pwCache::getPath(D_P.'data/bbscache/level.php');
    extract(pwCache::getData(D_P . 'data/bbscache/level.php', false));
    $read['lou'] = $start_limit;
    $start_limit == $count - 1 && ($read['jupend'] = '<a name=lastatc></a>');
    $read['ifsign'] < 2 && ($read['content'] = str_replace("\n", "<br>", $read['content']));
    $read['groupid'] == '-1' && ($read['groupid'] = $read['memberid']);
    $anonymous = $read['anonymous'] ? 1 : 0;
    if ($read['groupid'] != '' && $anonymous == 0) {
        !$lpic[$read['groupid']] && ($read['groupid'] = 8);
        $read['lpic'] = $lpic[$read['groupid']];
        $read['level'] = $ltitle[$read['groupid']];
        $read['regdate'] = get_date($read['regdate'], "Y-m-d");
        $read['lastlogin'] = get_date($read['lastvisit'], "Y-m-d");
        $read['aurvrc'] = floor($read['rvrc'] / 10);
        $read['author'] = $read['username'];
        $read['ontime'] = (int) ($read['onlinetime'] / 3600);
        $tpc_author = $read['author'];
        $read['face'] = showfacedesign($read['micon']);
        if ($db_ipfrom == 1) {
            $read['ipfrom'] = ' From:' . $read['ipfrom'];
        }
        if ($db_md_ifopen && $read['medals']) {
            $medals = '';
            $md_a = explode(',', $read['medals']);
            foreach ($md_a as $key => $value) {
                if ($value) {
                    $medals .= "<img src=\"{$_MEDALDB[$value][smallimage]}\" title=\"{$_MEDALDB[$value][name]}\" /> ";
                }
            }
            $read['medals'] = $medals . '<br />';
        } else {
            $read['medals'] = '';
        }
        if ($read['ifsign'] == 1 || $read['ifsign'] == 3) {
            global $sign;
            if (!$sign[$read['author']]) {
                global $db_signmoney, $db_signgroup, $tdtime;
                if (strpos($db_signgroup, ",{$read['groupid']},") !== false && $db_signmoney && (!getstatus($read['userstatus'], PW_USERSTATUS_SHOWSIGN) || (!$read['starttime'] || $read['currency'] < ($tdtime - $read['starttime']) / 86400 * $db_signmoney))) {
                    $read['signature'] = '';
                } else {
                    if ($db_signwindcode && getstatus($read['userstatus'], PW_USERSTATUS_SIGNCHANGE)) {
                        $read['signature'] = convert($read['signature'], $db_windpic, 2);
                    }
                    $read['signature'] = str_replace("\n", "<br>", $read['signature']);
                }
                $sign[$read['author']] = $read['signature'];
            } else {
                $read['signature'] = $sign[$read['author']];
            }
        } else {
            $read['signature'] = '';
        }
    } else {
        $read['face'] = "<br>";
        $read['lpic'] = '8';
        $read['level'] = $read['digests'] = $read['postnum'] = $read['money'] = $read['regdate'] = $read['lastlogin'] = $read['aurvrc'] = $read['credit'] = '*';
        if ($anonymous) {
            $read['signature'] = $read['honor'] = $read['medals'] = $read['ipfrom'] = '';
            $read['author'] = $GLOBALS['db_anonymousname'];
            $read['authorid'] = 0;
            foreach ($GLOBALS['customfield'] as $key => $val) {
                $field = "field_" . (int) $val['id'];
                $read[$field] = '*';
            }
        }
    }
    $read['postdate'] = get_date($read['postdate']);
    $read['mark'] = '';
    if ($read['ifmark']) {
        $markdb = explode("\t", $read['ifmark']);
        foreach ($markdb as $key => $value) {
            $read['mark'] .= "<li>{$value}</li>";
        }
    }
    if ($read['icon']) {
        $read['icon'] = "<img src=\"{$imgpath}/post/emotion/{$read['icon']}.gif\" align=left border=0>";
    } else {
        $read['icon'] = '';
    }
    /**
     * 动态判断发帖是否需要转换
     */
    $tpc_shield = 0;
    if ($read['ifshield'] || $read['groupid'] == 6 && $db_shield) {
        $read['subject'] = $read['icon'] = '';
        $read['content'] = shield($read['ifshield'] ? $read['ifshield'] == 1 ? 'shield_article' : 'shield_del_article' : 'ban_article');
        $tpc_shield = 1;
    }
    $creditnames = pwCreditNames();
    if (!$tpc_shield) {
        $attachs = $aids = array();
        if ($read['aid'] && !$read['ifhide']) {
            $attachs = unserialize($read['aid']);
            if (is_array($attachs)) {
                $aids = attachment($read['content']);
            }
        }
        $wordsfb = L::loadClass('FilterUtil', 'filter');
        if (!$wordsfb->equal($read['ifwordsfb'])) {
            $read['content'] = $wordsfb->convert($read['content']);
        }
        if ($read['ifconvert'] == 2) {
            $read['content'] = preg_replace("/\\[sell=(.+?)\\]/is", "", $read['content']);
            $read['content'] = preg_replace("/\\[hide=(.+?)\\]/is", "", $read['content']);
            $read['content'] = str_replace(array('[/hide]', '[/sell]', '[post]', '[/post]'), '', $read['content']);
            $read['content'] = convert($read['content'], $db_windpost);
        } else {
            strpos($read['content'], '[s:') !== false && ($read['content'] = showface($read['content']));
        }
        if ($attachs && is_array($attachs) && !$read['ifhide']) {
            foreach ($attachs as $at) {
                $atype = '';
                $rat = array();
                if ($at['type'] == 'img' && $at['needrvrc'] == 0) {
                    $a_url = geturl($at['attachurl'], 'show');
                    if (is_array($a_url)) {
                        $atype = 'pic';
                        $dfurl = '<br>' . cvpic($a_url[0], 1, $db_windpost['picwidth'], $db_windpost['picheight'], $at['ifthumb']);
                        $rat = array('aid' => $at['aid'], 'img' => $dfurl, 'dfadmin' => 0, 'desc' => $at['desc']);
                    } elseif ($a_url == 'imgurl') {
                        $atype = 'picurl';
                        $rat = array('aid' => $at['aid'], 'name' => $at['name'], 'dfadmin' => 0, 'verify' => md5("showimg{$tid}{$read[pid]}{$fid}{$at[aid]}{$GLOBALS[db_hash]}"));
                    }
                } else {
                    $atype = 'downattach';
                    if ($at['needrvrc'] > 0) {
                        !$at['ctype'] && ($at['ctype'] = $at['special'] == 2 ? 'money' : 'rvrc');
                        $at['special'] == 2 && $GLOBALS['db_sellset']['price'] > 0 && ($at['needrvrc'] = min($at['needrvrc'], $GLOBALS['db_sellset']['price']));
                    }
                    $rat = array('aid' => $at['aid'], 'name' => $at['name'], 'size' => $at['size'], 'hits' => $at['hits'], 'needrvrc' => $at['needrvrc'], 'special' => $at['special'], 'cname' => $creditnames[$at['ctype']], 'type' => $at['type'], 'dfadmin' => 0, 'desc' => $at['desc'], 'ext' => strtolower(substr(strrchr($at['name'], '.'), 1)));
                }
                if (!$atype) {
                    continue;
                }
                if (in_array($at['aid'], $aids)) {
                    $read['content'] = attcontent($read['content'], $atype, $rat);
                } else {
                    $read[$atype][$at['aid']] = $rat;
                }
            }
        }
    }
    $GLOBALS['foruminfo']['copyctrl'] && ($read['content'] = preg_replace("/<br>/eis", "copyctrl('{$read['colour']}')", $read['content']));
    $read['alterinfo'] && ($read['content'] .= "<br><br><br><font color=gray>[ {$read['alterinfo']} ]</font>");
    return $read;
}
예제 #10
0
파일: helper.php 프로젝트: veelasky/foundry
 /**
  * Get list of roles for this user.
  *
  * @return array
  */
 function roles()
 {
     return shield()->roles();
 }
예제 #11
0
 $db_metakeyword = str_replace(array('|', ' - '), ',', $forumtitle) . 'phpwind';
 require_once R_P . 'require/header.php';
 $msg_guide = $pwforum->headguide($guidename);
 $post_reply = '';
 $review_reply = '';
 if ($db_showreplynum > 0) {
     $wordsfb = L::loadClass('FilterUtil', 'filter');
     $pwAnonyHide = $pwpost->isGM || pwRights($pwpost->isBM, 'anonyhide');
     $query = $db->query("SELECT p.pid,p.author,p.authorid,p.subject,p.postdate,p.content,p.anonymous,p.ifconvert,p.ifwordsfb,p.ifshield,m.uid,m.groupid,m.userstatus FROM {$pw_posts} p LEFT JOIN pw_members m ON p.authorid=m.uid WHERE tid=" . S::sqlEscape($tid) . "AND ifcheck='1' ORDER BY postdate DESC LIMIT 0,{$db_showreplynum}");
     while ($rt = $db->fetch_array($query)) {
         $tpc_author = $rt['anonymous'] && !$pwAnonyHide && $windid != $rt['author'] ? $db_anonymousname : $rt['author'];
         $tpc_pid = $rt['pid'];
         if ($rt['ifshield']) {
             $groupid != '3' && ($rt['content'] = shield($rt['ifshield'] == '1' ? 'shield_article' : 'shield_del_article'));
         } elseif ($groupid != 3 && $db_shield && $pwforum->forumBan($rt)) {
             $rt['content'] = shield('ban_article');
         } else {
             if (!$wordsfb->equal($rt['ifwordsfb'])) {
                 $rt['content'] = $wordsfb->convert($rt['content']);
             }
             $rt['ifconvert'] == 2 && ($rt['content'] = convert($rt['content'], $db_windpost));
             if (strpos($rt['content'], '[p:') !== false || strpos($rt['content'], '[s:') !== false) {
                 $rt['content'] = showface($rt['content']);
             }
         }
         $review_content = substrs(stripWindCode($rt['content']), 255);
         $post_reply .= "<table width=\"100%\"><tr><td><div class=\"h b\">{$tpc_author}:{$rt['subject']}</div><div class=\"p10\">{$rt['content']}</div></td></tr></table>";
         $review_reply .= "<table width=\"100%\"><tr><td><div class=\"h b\">{$tpc_author}:{$rt['subject']}</div><div class=\"p10\">{$review_content}</div></td></tr></table>";
     }
 }
 if ($winduid && $tpcarray['special'] == 5) {