Esempio n. 1
0
function getList($list, $keyword)
{
    global $cfg_cmsurl;
    $key = urlencode($keyword);
    $str = "<h3>您可能感兴趣的内容<span><a href=\"{$cfg_cmsurl}/cloudsearch_{$key}_0_1.html\" target=\"_blank\">+更多&raquo;</a></span></h3>";
    $out = '';
    for ($i = 0; isset($list[$i]); $i++) {
        $row = $list[$i];
        $channelname = getChannelName($row['tablename']);
        $title = setColor($keyword, cn_substr($row['title'], 36));
        $litpic = getLitpic($row['imgurl'], $row['webid'], $row);
        $url = getUrl($row['aid'], $row['webid'], $row['tablename'], $row['tag']);
        if (!empty($row['title'])) {
            $out .= "<li><span class=\"fl\">[{$channelname}]</span><a href=\"{$url}\" target=\"_blank\" title=\"{$row['title']}\">{$title}</a></li>";
        }
    }
    if (!empty($out)) {
        $out = $str . "<ul>" . $out . "</ul>";
    }
    return $out;
}
Esempio n. 2
0
/**
 * 云搜索调用标签(废弃)
 *
 * @version        $Id: cloudsearch.lib.php netman
 * @package        Stourweb.Taglib
 * @copyright      Copyright (c) 2007 - 2011, Stourweb, Inc.
 * @link           http://www.stourweb.com
 */
function lib_cloudsearch(&$ctag, &$refObj)
{
    global $dsql;
    $attlist = "row|20,";
    FillAttsDefault($ctag->CAttribute->Items, $attlist);
    extract($ctag->CAttribute->Items, EXTR_SKIP);
    $innertext = trim($ctag->GetInnertext());
    $ResultList = isset($refObj->Fields['ResultList']) ? $refObj->Fields['ResultList'] : '';
    $keyword = $refObj->Fields['keyword'];
    //print_r($ResultList);
    $ctp = new STTagParse();
    $ctp->SetNameSpace("field", "[", "]");
    $ctp->LoadSource($innertext);
    $GLOBALS['autoindex'] = 0;
    for ($i = 0; isset($ResultList[$i]); $i++) {
        $GLOBALS['autoindex']++;
        $row = $ResultList[$i];
        $row['description'] = setColor($keyword, cutstr_html($row['content'], 90));
        $row['channelname'] = getChannelName($row['tablename']);
        $row['title'] = setColor($keyword, $row['title']);
        $row['litpic'] = getLitpic($row['imgurl'], $row['webid'], $row);
        $row['website'] = GetWebURLByWebid($row['webid']);
        $row['weburl'] = $row['website'];
        $row['url'] = getUrl($row['aid'], $row['webid'], $row['tablename'], $row['tag']);
        foreach ($ctp->CTags as $tagid => $ctag) {
            if ($ctag->GetName() == 'array') {
                $ctp->Assign($tagid, $row);
            } else {
                if (!empty($row[$ctag->GetName()])) {
                    $ctp->Assign($tagid, $row[$ctag->GetName()]);
                } else {
                    $ctp->Assign($tagid, '');
                }
            }
        }
        $revalue .= $ctp->GetResult();
    }
    return $revalue;
}
             $uArray[$k] = $innerArray;
             $j = 0;
             $k = $k + 1;
         } else {
             $j++;
         }
     }
     fclose($fp);
 }
 $debug = false;
 for ($i = 1; $i < count($uArray); $i++) {
     $innerArray = $uArray[$i];
     $p = setUserStatus($innerArray[12]) . "&nbsp;<span style=\"font-weight:bold;\">" . removeChar($innerArray[14]) . "</span>\r\n           &nbsp;(" . setPPriv($innerArray[11]) . "" . setCPriv($innerArray[10]) . ")";
     $class = $color % 2 ? "bg2" : "bg1";
     $color++;
     $userstats .= show("/userstats", array("player" => $p, "channel" => getChannelName($innerArray[1], $uip, $port, $tPort), "misc1" => $innerArray[6], "class" => $class, "misc2" => $innerArray[7], "misc3" => time_convert($innerArray[8]), "misc4" => time_convert($innerArray[9])));
 }
 $uArr = getTSChannelUsers($uip, $port, $tPort);
 $pcArr = array();
 $ccArr = array();
 $thisArr = array();
 $listArr = array();
 $usedArr = array();
 $cArr = getChannels($uip, $port, $tPort);
 $z = 0;
 $x = 0;
 for ($i = 0; $i < count($cArr); $i++) {
     $innerArr = $cArr[$i];
     $listArr[$i] = $innerArr[3];
 }
 sort($listArr);
Esempio n. 4
0
function newReport()
{
    $ids = getArrayOfChannelIds();
    echo "<table><tr><th>Channels</th><th>News for Channel</th><th>Threads for Channel</th><th>News for shows on Channel</th></tr>";
    for ($i = 0; $i < count($ids); $i++) {
        echo "<tr><td>" . getChannelName($ids[$i]) . "</td>";
        /* content with channel name present -- does not look at posts to thread and posts page */
        //News found For this channel
        if (checkForChannelNews($ids[$i])) {
            echo "<td class='green'>YES</td>";
        } else {
            echo "<td class='red'>NO</td>";
        }
        //Thread found for this channel
        $showsForThisChannel = getShowIdsByChannel($ids[$i]);
        if (checkForChannelThreads($showsForThisChannel)) {
            echo "<td class='green'>YES</td>";
        } else {
            echo "<td class='red'>NO</td>";
        }
        //News Found for a show on this channel
        $showsForThisChannel = getShowIdsByChannel($ids[$i]);
        if (checkForShowNews($showsForThisChannel)) {
            echo "<td class='green'>YES</td>";
        } else {
            echo "<td class='red'>NO</td>";
        }
        echo "</tr>";
    }
    echo "</table>";
    return true;
}
Esempio n. 5
0
function setTSUsers($uArray, $ip, $port, $tPort)
{
    $array = array();
    for ($i = 1; $i < count($uArray); $i++) {
        $innerArray = $uArray[$i];
        $subarray = array();
        $subarray['icon'] = setUserStatus($innerArray[12]);
        $subarray['name'] = "<strong>" . removeChar($innerArray[14]) . "</strong>&nbsp;(" . setPPriv($innerArray[11]) . "" . setCPriv($innerArray[10]) . ")";
        $subarray['channel'] = getChannelName($innerArray[1], $ip, $port, $tPort);
        $subarray['ping'] = format_nr($innerArray[7], 0);
        $subarray['loggedin'] = goodtime((int) $innerArray[8], (int) $innerArray[8] > 86400 ? 1 : 3);
        $subarray['idle'] = goodtime((int) $innerArray[9]);
        $array[] = $subarray;
    }
    return $array;
}