function GenStoredMemIPs()
 {
     $sCntSQL = "SELECT COUNT(*) FROM `sys_ip_members_visits`";
     ////////////////////////////
     $iTotalNum = db_value($sCntSQL);
     if (!$iTotalNum) {
         return MsgBox(_t('_Empty'));
     }
     $iPerPage = (int) $_GET['per_page'];
     if (!$iPerPage) {
         $iPerPage = 10;
     }
     $iCurPage = (int) $_GET['page'];
     if ($iCurPage < 1) {
         $iCurPage = 1;
     }
     $sLimitFrom = ($iCurPage - 1) * $iPerPage;
     $sqlLimit = "LIMIT {$sLimitFrom}, {$iPerPage}";
     ////////////////////////////
     $sSQL = "SELECT *, UNIX_TIMESTAMP(`DateTime`) AS `DateTimeTS` FROM `sys_ip_members_visits` ORDER BY `DateTime` DESC {$sqlLimit}";
     $rIPList = db_res($sSQL);
     $aTmplVarsItems = array();
     while ($aIPList = mysql_fetch_assoc($rIPList)) {
         $iID = (int) $aIPList['ID'];
         $sFrom = long2ip($aIPList['From']);
         $sLastDT = getLocaleDate($aIPList['DateTimeTS'], BX_DOL_LOCALE_DATE);
         $sMember = $aIPList['MemberID'] ? '<a href="' . getProfileLink($aIPList['MemberID']) . '">' . getNickname($aIPList['MemberID']) . '</a>' : '';
         $aTmplVarsItems[] = array('from' => $sFrom, 'bx_if:show_profile_link' => array('condition' => !empty($aIPList['MemberID']), 'content' => array('href' => getProfileLink($aIPList['MemberID']), 'caption' => getNickname($aIPList['MemberID']))), 'date' => $sLastDT);
     }
     $oPaginate = new BxDolPaginate(array('page_url' => $GLOBALS['site']['url_admin'] . 'ip_blacklist.php?mode=list&page={page}&per_page={per_page}', 'count' => $iTotalNum, 'per_page' => $iPerPage, 'page' => $iCurPage));
     return $GLOBALS['oAdmTemplate']->parseHtmlByName('ip_blacklist_list_ips.html', array('bx_repeat:items' => $aTmplVarsItems, 'paginate' => $oPaginate->getPaginate()));
 }
예제 #2
0
    function GenStoredMemIPs()
    {
        $sFromC = _t('_From');
        $sMemberC = _t('_Member');
        $sDatatimeC = _t('_Date');
        $sCaptionC = _t('_adm_ipbl_Stored_members_caption');
        $sRes = '<br /><h2>' . $sCaptionC . '</h2>';
        $sTableRes .= <<<EOF
<table style="width:99%;" border="1" cellpadding="2" cellspacing="1" style="border-collapse: collapse">
\t<tr>
\t\t<td>{$sFromC}</td>
        <td>{$sMemberC}</td>
\t\t<td>{$sDatatimeC}</td>
\t</tr>
EOF;
        $sCntSQL = "SELECT COUNT(*) FROM `sys_ip_members_visits`";
        ////////////////////////////
        $iTotalNum = db_value($sCntSQL);
        if (!$iTotalNum) {
            return $sRes . MsgBox(_t('_Empty'));
        }
        $iPerPage = (int) $_GET['per_page'];
        if (!$iPerPage) {
            $iPerPage = 10;
        }
        $iCurPage = (int) $_GET['page'];
        if ($iCurPage < 1) {
            $iCurPage = 1;
        }
        $sLimitFrom = ($iCurPage - 1) * $iPerPage;
        $sqlLimit = "LIMIT {$sLimitFrom}, {$iPerPage}";
        ////////////////////////////
        $sSQL = "SELECT * FROM `sys_ip_members_visits` ORDER BY `DateTime` ASC {$sqlLimit}";
        $rIPList = db_res($sSQL);
        while ($aIPList = mysql_fetch_assoc($rIPList)) {
            $iID = (int) $aIPList['ID'];
            $sFrom = long2ip($aIPList['From']);
            $sLastDT = $aIPList['DateTime'];
            $sMember = $aIPList['MemberID'] ? '<a href="' . getProfileLink($aIPList['MemberID']) . '">' . getNickname($aIPList['MemberID']) . '</a>' : '';
            $sTableRes .= "<tr><td>{$sFrom}</td><td>{$sMember}</td><td>{$sLastDT}</td></tr>";
        }
        $sTableRes .= <<<EOF
</table>
<div class="clear_both"></div>
<br />
EOF;
        $sRequest = $GLOBALS['site']['url_admin'] . 'ip_blacklist.php?page={page}&per_page={per_page}';
        $oPaginate = new BxDolPaginate(array('page_url' => $sRequest, 'count' => $iTotalNum, 'per_page' => $iPerPage, 'page' => $iCurPage, 'per_page_changer' => true, 'page_reloader' => true, 'on_change_page' => null, 'on_change_per_page' => null));
        return $sRes . $sTableRes . $oPaginate->getPaginate();
    }
예제 #3
0
    function GenStoredMemIPs()
    {
        $sRes = '';
        $sFromC = _t('_From');
        $sMemberC = _t('_Member');
        $sDatatimeC = _t('_Date');
        $sTableRes .= <<<EOF
<table style="width:99%; border-collapse:collapse;" cellpadding="4" style="border-collapse: collapse">
    <tr>
        <td class="bx-def-border">{$sFromC}</td>
        <td class="bx-def-border">{$sMemberC}</td>
        <td class="bx-def-border">{$sDatatimeC}</td>
    </tr>
EOF;
        $sCntSQL = "SELECT COUNT(*) FROM `sys_ip_members_visits`";
        ////////////////////////////
        $iTotalNum = db_value($sCntSQL);
        if (!$iTotalNum) {
            return $sRes . MsgBox(_t('_Empty'));
        }
        $iPerPage = (int) $_GET['per_page'];
        if (!$iPerPage) {
            $iPerPage = 10;
        }
        $iCurPage = (int) $_GET['page'];
        if ($iCurPage < 1) {
            $iCurPage = 1;
        }
        $sLimitFrom = ($iCurPage - 1) * $iPerPage;
        $sqlLimit = "LIMIT {$sLimitFrom}, {$iPerPage}";
        ////////////////////////////
        $sSQL = "SELECT *, UNIX_TIMESTAMP(`DateTime`) AS `DateTimeTS` FROM `sys_ip_members_visits` ORDER BY `DateTime` DESC {$sqlLimit}";
        $rIPList = db_res($sSQL);
        while ($aIPList = mysql_fetch_assoc($rIPList)) {
            $iID = (int) $aIPList['ID'];
            $sFrom = long2ip($aIPList['From']);
            $sLastDT = getLocaleDate($aIPList['DateTimeTS'], BX_DOL_LOCALE_DATE);
            $sMember = $aIPList['MemberID'] ? '<a href="' . getProfileLink($aIPList['MemberID']) . '">' . getNickname($aIPList['MemberID']) . '</a>' : '';
            $sTableRes .= "<tr><td class='bx-def-border'>{$sFrom}</td><td class='bx-def-border'>{$sMember}</td><td class='bx-def-border'>{$sLastDT}</td></tr>";
        }
        $sTableRes .= <<<EOF
</table>
<div class="clear_both"></div>
EOF;
        $sRequest = $GLOBALS['site']['url_admin'] . 'ip_blacklist.php?mode=list&page={page}&per_page={per_page}';
        $oPaginate = new BxDolPaginate(array('page_url' => $sRequest, 'count' => $iTotalNum, 'per_page' => $iPerPage, 'page' => $iCurPage, 'per_page_changer' => true, 'page_reloader' => true, 'on_change_page' => null, 'on_change_per_page' => null));
        $sContent = $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => $sRes . $sTableRes));
        return $sContent . $oPaginate->getPaginate();
    }
예제 #4
0
 function displaySearchUnit($aApplInfo)
 {
     global $oFunctions;
     $iAppID = (int) $aApplInfo['id'];
     $iOwnerID = (int) $aApplInfo['ownerId'];
     $sOwnerName = getNickname($iOwnerID);
     $sOwnerLink = getProfileLink($iOwnerID);
     $sAppUrl = process_text_output($aApplInfo['url']);
     $sAppDate = defineTimeInterval($aApplInfo['date']);
     $sAppTitle = process_text_output($aApplInfo['title']);
     $sStatusColor = $aApplInfo['status'] == 'active' ? '#00CC00' : '#CC0000';
     $aUnitReplace = array();
     $aUnitReplace['status_color'] = $sStatusColor;
     $aUnitReplace['appl_id'] = $iAppID;
     $aUnitReplace['appl_url'] = $sAppUrl;
     $aUnitReplace['appl_title'] = $sAppTitle;
     $aUnitReplace['owner_url'] = $sOwnerLink;
     $aUnitReplace['owner_name'] = $sOwnerName;
     $aUnitReplace['appl_date'] = $sAppDate;
     return $this->oOsiTemplate->parseHtmlByTemplateName('unit_application', $aUnitReplace);
 }
예제 #5
0
 public function checkLogin()
 {
     $is_bind = I("post.is_bind", 0, 'int');
     $pwd = I('post.pwd');
     $username = I('post.username');
     if (checkEmail($username) == 'true') {
         $info = M("user")->field("id,nickname")->where("email = '" . $username . "'  AND pwd = '" . md5($pwd) . "'")->find();
     } else {
         $info = M("user")->field("id,nickname")->where("name = '" . $username . "'  AND pwd = '" . md5($pwd) . "'")->find();
     }
     if (empty($info)) {
         echo json_encode(array("error" => "您输入的用户名/邮箱/密码无效。"));
         exit;
     } else {
         $userid = $info['id'];
     }
     $nickname = $info['nickname'];
     $tip = "登录成功!";
     if ($is_bind == 1) {
         //若是绑定
         $openid = getSessionCookie("openid");
         if ($openid) {
             $field = getSessionCookie("field");
             $userinfo = M("user")->field('id,name')->where("" . $field . "= '" . $openid . "'")->find();
             if (!$userinfo) {
                 //没有的话绑定账号,送积分和发广告,有绑定的话直接登录
                 // 绑定账号
                 M('user')->where("id = " . $userid . "")->save(array($field => $openid));
                 emptySessionCookie('type');
                 emptySessionCookie('openid');
             }
         }
     }
     setSessionCookie("userid", $userid);
     setSessionCookie("username", getNickname($username, $nickname));
     echo json_encode(array("username" => $username, "userid" => $userid, "avatar" => getUserAvatar($userid), "tip" => $tip, "error" => ""));
 }
<?php

// deal request for fetching the fresh comments which have been pushed onto the wall (ok)
session_start();
$activityid = isset($_SESSION["activityid"]) ? $_SESSION["activityid"] : null;
$response = array();
if ($activityid != null) {
    include_once "../model/connect.php";
    include_once "../model/usermodel.php";
    include_once "../model/commentmodel.php";
    include_once "../model/wallmodel.php";
    $conn = getConnection();
    $list = freshComments($conn, $activityid);
    $N = count($list);
    for ($i = 0; $i < $N; $i++) {
        $pair = searchComment($conn, $list[$i][0]);
        $data = array();
        $data["nickname"] = getNickname($conn, $pair[0]);
        $data["istop"] = $list[$i][1];
        $data["content"] = $pair[1];
        $response[] = $data;
    }
    mysql_close($conn);
}
header("Content-Type:application/json;charset=utf-8");
echo json_encode($response);
예제 #7
0
파일: util.php 프로젝트: caowenSarah/eSwap
function getItemsArrayForIdx($sql_result, $con, $array_len = 3)
{
    // initialize items array
    for ($i = 0; $i < $array_len; $i++) {
        $strs[$i] = "";
    }
    $idx = 0;
    while ($row = mysql_fetch_array($sql_result)) {
        $nickname = getNickname($row['Email'], $con);
        $strs[$idx % $array_len] = $strs[$idx % $array_len] . "<div class='item'>" . "<div class='item_image'><img src='" . $row['Image'] . "' /></div>" . "<div class='item_detail'>" . "<div class='item_name'>" . $row['ItemName'] . "</div>" . "<div class='item_category'>Category: <span>" . $row['Category'] . "</span></div>" . "<div class='item_desc'>Description: <span>" . $row['Description'] . "</span></div>" . "<div class='item_want'>Exchange: <span>" . $row['Wantfor'] . "</span></div>" . "<div class='item_want'>Poster: <span>" . $nickname . "</span></div>" . "<div class='item_date'>Post date: <span>" . $row['UpdateDate'] . "</span></div>" . "</div>" . "<hr />" . "</div>";
        $idx += 1;
    }
    return $strs;
}
예제 #8
0
    function displaySearchUnit($aResSQL)
    {
        global $oFunctions;
        $sFromC = _t('_Added by');
        $oMain = $this->getAdsMain();
        $iAdID = (int) $aResSQL['id'];
        $bPossibleToView = $oMain->oPrivacy->check('view', $iAdID, $oMain->_iVisitorID);
        if (!$bPossibleToView) {
            return $oMain->_oTemplate->parseHtmlByName('browse_unit_private.html', array('extra_css_class' => ''));
        }
        $iOwnerID = (int) $aResSQL['ownerId'];
        $sOwnerName = getNickname($iOwnerID);
        $sOwnerLink = getProfileLink($iOwnerID);
        $sTimeAgo = defineTimeInterval($aResSQL['date']);
        $sVotePostRating = '';
        if (!is_null($this->oRate) && $this->oRate->isEnabled()) {
            $sVotePostRating = $this->oRate->getJustVotingElement(0, 0, $aResSQL['Rate']);
        }
        $iCatID = (int) $aResSQL['categoryId'];
        $iSubCatID = (int) $aResSQL['subcategoryId'];
        $sAdTitle = process_text_output($aResSQL['title']);
        $sEntryUri = process_text_output($aResSQL['uri']);
        $sAdUrl = $this->genUrlX($iAdID, $sEntryUri);
        $sCustomVal1 = process_text_output($aResSQL['CustomFieldValue1']);
        $sCustomVal2 = process_text_output($aResSQL['CustomFieldValue2']);
        $sCustomName1 = process_text_output($aResSQL['CustomFieldName1']);
        $sCustomName2 = process_text_output($aResSQL['CustomFieldName2']);
        $sUnit1 = process_text_output($aResSQL['Unit1']);
        $sUnit2 = process_text_output($aResSQL['Unit2']);
        $sCustomStyle1 = $sCustomStyle2 = '';
        $sCustomStyle1 = $sCustomVal1 != '' ? '' : 'display:none;';
        $sCustomStyle2 = $sCustomVal2 != '' ? '' : 'display:none;';
        $sCategUri = process_text_output($aResSQL['categoryUri']);
        $sSubCategUri = process_text_output($aResSQL['subcategoryUri']);
        $sCategName = process_text_output($aResSQL['categoryName']);
        $sSubCategName = process_text_output($aResSQL['subcategoryName']);
        $sCEntryUri = htmlspecialchars($aResSQL['categoryUri']);
        $sSEntryUri = htmlspecialchars($aResSQL['subcategoryUri']);
        $oMain = $this->getAdsMain();
        $sCategUrl = $oMain->_oConfig->bUseFriendlyLinks ? BX_DOL_URL_ROOT . 'ads/cat/' . $sCEntryUri : "{$oMain->_oConfig->sCurrBrowsedFile}?bClassifiedID={$iCatID}";
        $sSubCategUrl = $oMain->_oConfig->bUseFriendlyLinks ? BX_DOL_URL_ROOT . 'ads/subcat/' . $sSEntryUri : "{$oMain->_oConfig->sCurrBrowsedFile}?bSubClassifiedID={$iSubCatID}";
        $sAdCover = $oMain->getAdCover($aResSQL['media']);
        $sAdBigCover = $oMain->getAdCover($aResSQL['media'], 'big_thumb');
        $sAdminCheck = '';
        if ($this->bShowCheckboxes) {
            $sAdminCheck = <<<EOF
<div class="browseCheckbox">
    <input id="ad{$iAdID}" type="checkbox" name="ads[]" value="{$iAdID}" />
</div>
EOF;
            $sPostStatus = '<div class="ads_From">' . _t('_Status') . ': ' . process_line_output($aResSQL['Status']) . '</div>';
        }
        $aUnitReplace = array('ad_cover_img' => $sAdCover, 'ad_link' => $sAdUrl, 'rating' => $sVotePostRating, 'ad_title' => $sAdTitle, 'ad_status' => $sPostStatus, 'ad_date' => mb_strtolower($sTimeAgo), 'from_label' => mb_strtolower($sFromC), 'ad_owner_link' => $sOwnerLink, 'ad_owner_name' => $sOwnerName, 'cats' => $oMain->_oTemplate->parseHtmlByTemplateName('category', array('cat_link' => $sCategUrl, 'sub_cat_link' => $sSubCategUrl, 'cat_name' => $sCategName, 'sub_cat_name' => $sSubCategName)), 'admin_check' => $sAdminCheck, 'ad_big_cover_img' => $sAdBigCover, 'bx_if:using_c1' => array('condition' => $sCustomName1 && $sCustomVal1, 'content' => array('cust_style1' => $sCustomStyle1, 'custom_name1' => $sCustomName1, 'custom1' => $sCustomVal1, 'unit' => $sUnit1)), 'bx_if:using_c2' => array('condition' => $sCustomName2 && $sCustomVal2, 'content' => array('cust_style2' => $sCustomStyle2, 'custom_name2' => $sCustomName2, 'custom2' => $sCustomVal2, 'unit2' => $sUnit2)), 'bx_if:expired' => array('condition' => time() - $aResSQL['date'] > 24 * 60 * 60 * $aResSQL['LifeTime'], 'content' => array(1 => 1)));
        return $oMain->_oTemplate->parseHtmlByTemplateName($this->sSelectedUnit, $aUnitReplace);
    }
<?php

// choose an audience for award randomly (ok)
session_start();
$mode = intval($_POST["mode"]);
$activityid = isset($_SESSION["activityid"]) ? $_SESSION["activityid"] : null;
$response = array();
$response["result"] = false;
if (($mode == 1 || $mode == 2) && $activityid != null) {
    include_once "../model/connect.php";
    include_once "../model/usermodel.php";
    include_once "../model/audiencemodel.php";
    include_once "../model/commentmodel.php";
    $conn = getConnection();
    $luckdog = null;
    if ($mode == 1) {
        $luckdog = randAudienceOnJoined($conn, $activityid);
    } else {
        $luckdog = randAudienceOnSend($conn, $activityid);
    }
    if ($luckdog != null) {
        $response["result"] = true;
        $response["nickname"] = getNickname($conn, $luckdog);
    }
    mysql_close($conn);
}
header("Content-Type:application/json;charset=utf-8");
echo json_encode($response);
예제 #10
0
파일: home.php 프로젝트: caowenSarah/eSwap
<?php

session_start();
if (isset($_SESSION["user"])) {
    $user = $_SESSION["user"];
} else {
    $user = "";
}
include "include/util.php";
$con = connect_db();
mysql_select_db("eswap", $con);
$cat_result = mysql_query("SELECT DISTINCT Category FROM items", $con);
$sql_result = mysql_query("SELECT * FROM items WHERE Swaped='no' ORDER BY _id DESC LIMIT 0,6", $con);
$nickname = getNickname($user, $con);
$items_array = getItemsArray($sql_result, $con);
?>
<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8" />
	<title>eSwap</title>
	<link rel="stylesheet" href="/eSwap/css/footer.css" type="text/css" />
	<link rel="stylesheet" href="/eSwap/css/banner.css" type="text/css" />
	<link rel="stylesheet" href="/eSwap/css/home.css" type="text/css" />
  <script src="js/simpleajax.js" type="text/javascript"></script>	
  <script src="js/load_more.js" type="text/javascript"></script>
  <script src="js/nav_display.js" type="text/javascript"></script>
</head>
<body>
	<?php 
include "include/banner.php";
<?php

// administrator get the list of audience of one activity (ok)
session_start();
$activityid = isset($_SESSION["activityid"]) ? $_SESSION["activityid"] : null;
$response = array();
if ($activityid != null) {
    include_once "../model/connect.php";
    include_once "../model/usermodel.php";
    include_once "../model/audiencemodel.php";
    $conn = getConnection();
    $list = audiencelist($conn, $activityid);
    $N = count($list);
    for ($i = 0; $i < $N; $i++) {
        $data = array();
        $data["audienceid"] = $list[$i][0];
        $data["nickname"] = getNickname($conn, $data["audienceid"]);
        $data["msgdisabled"] = $list[$i][1];
        $response[] = $data;
    }
    mysql_close($conn);
}
header("Content-Type:application/json;charset=utf-8");
echo json_encode($response);
<?php

// deal request for searching infomation about an activity (ok)
$activityid = intval($_POST["activityid"]);
$key = "activity-" . strval($activityid);
$response = array();
$response["result"] = false;
include_once "../model/cache.php";
$cacheConn = getCacheConnection();
$data = getCache($cacheConn, $key);
if ($data == null) {
    include_once "../model/connect.php";
    include_once "../model/usermodel.php";
    include_once "../model/activitymodel.php";
    $conn = getConnection();
    $data = searchActivity($conn, $activityid);
    if ($data != null) {
        $data["creator"] = getNickname($conn, $data["creator"]);
        setCache($cacheConn, $key, $data);
        $response["result"] = true;
        $response["data"] = $data;
    }
    mysql_close($conn);
} else {
    $response["result"] = true;
    $response["data"] = $data;
}
$cacheConn->close();
header("Content-Type:application/json;charset=utf-8");
echo json_encode($response);
<?php

// administrator search comments by page (ok)
session_start();
$pageid = intval($_POST["pageid"]);
$recordnum = intval($_POST["recordnum"]);
$activityid = isset($_SESSION["activityid"]) ? $_SESSION["activityid"] : null;
$response = array();
if ($recordnum > 0 && $activityid != null) {
    include_once "../model/connect.php";
    include_once "../model/usermodel.php";
    include_once "../model/commentmodel.php";
    $conn = getConnection();
    $list = listByPage($conn, $activityid, $pageid, $recordnum);
    $N = count($list);
    for ($i = 0; $i < $N; $i++) {
        $data = array();
        $data["commentid"] = $list[$i][0];
        $data["nickname"] = getNickname($conn, $list[$i][1]);
        $data["commenttime"] = date("H:i:s", $list[$i][2]);
        $data["content"] = $list[$i][3];
        $response[] = $data;
    }
    mysql_close($conn);
}
header("Content-Type:application/json;charset=utf-8");
echo json_encode($response);
예제 #14
0
    function genLeaderPack($aMTypes, $sSex = 'male')
    {
        $sSLeaders = '';
        if (is_array($aMTypes) and count($aMTypes) > 0) {
            $sVacantC = _t('_Vacant');
            $sOfflineC = _t('_Offline');
            $sMaleIcon = getTemplateIcon('male.png');
            $sFemaleIcon = getTemplateIcon('female.png');
            $sSpacerIcon = getTemplateImage('spacer.gif');
            $sOfflineIcon = getTemplateIcon('sys_status_offline.png');
            $sSexIcon = $sThumbType = '';
            switch ($sSex) {
                case 'male':
                    $sSexIcon = $sMaleIcon;
                    $sThumbType = 'man';
                    break;
                case 'female':
                    $sSexIcon = $sFemaleIcon;
                    $sThumbType = 'woman';
                    break;
            }
            $sSexThumbIcon = getTemplateIcon($sThumbType . '_medium.gif');
            foreach ($aMTypes as $sTopType => $iMembID) {
                $sTypeName = $sTopType;
                $sTypeNameUcf = ucfirst($sTopType);
                $sLabel = _t('_' . $sTypeNameUcf);
                $oMembVoting = new BxTemplVotingView('profile', $iMembID);
                $sVotingVal = '<div class="rate_block_position">' . $oMembVoting->getJustVotingElement(0) . '</div>';
                $iVotesCnt = $oMembVoting->getVoteCount();
                $sMembThumb = $sProfileLink = '';
                if ($iMembID > 0) {
                    $sMembThumb = get_member_thumbnail($iMembID, 'none', false);
                    $sMemberName = getNickname($iMembID);
                    $sMemberLink = getProfileLink($iMembID);
                    $sProfileLink = <<<EOF
<a href="{$sMemberLink}">{$sMemberName}</a>
EOF;
                } else {
                    $sMembThumb = <<<EOF
<div class="thumbnail_image" style="width: 68px; height: 68px;">
    <a href="javascript:void(0)">
        <img title="{$sVacantC}" alt="{$sVacantC}" style="background-image: url({$sSexThumbIcon}); width: 64px; height: 64px;" src="{$sSpacerIcon}" />
        <img class="sys-online-offline" title="{$sOfflineC}" alt="{$sOfflineC}" src="{$sOfflineIcon}" />
    </a>
</div>
EOF;
                    $sProfileLink = <<<EOF
<a class="vacant" href="javascript: void(0);">{$sVacantC}</a>
EOF;
                }
                $sVotes = _t('_{0} votes', $iVotesCnt);
                $sSLeaders .= <<<EOF
<div id="prof_of_{$sTypeName}" class="featured_block_1">
\t<div class="top_rated_head">
\t\t<div class="sex_icon" style="background:url({$sSexIcon}) center 2px no-repeat;">&nbsp;</div>
\t\t<div class="type_vote">
\t\t\t{$sLabel}<br />
\t\t\t<font style="font-size:9px;color:#999;">{$sVotes}</font>
\t\t</div>
\t\t<div class="clear_both"></div>
\t</div>
\t{$sMembThumb}
\t{$sVotingVal}
\t<div class="thumb_username">{$sProfileLink}</div>
\t<div class="clear_both"></div>
</div>
EOF;
            }
            return $sSLeaders;
        }
    }
예제 #15
0
 function getMemberThumbnail($iId, $sFloat = 'none', $bGenProfLink = false, $sForceSex = 'visitor', $isAutoCouple = true, $sType = 'medium', $aOnline = array())
 {
     $aProfile = getProfileInfo($iId);
     if (!$aProfile) {
         return '';
     }
     $bCouple = (int) $aProfile['Couple'] > 0 && $isAutoCouple ? true : false;
     $bOnline = 0;
     if (!@(include_once BX_DIRECTORY_PATH_MODULES . 'boonex/avatar/include.php')) {
         return '';
     }
     $sLink = '';
     $sNick = '';
     $oUserStatusView = bx_instance('BxDolUserStatusView');
     //need singlton here
     $sStatusIcon = $oUserStatusView->getStatusIcon($iId, 'icon8');
     if ($iId > 0) {
         $sLink = getProfileLink($iId);
         $sNick = getNickname($iId);
         if (!empty($aOnline) && (int) $aOnline['is_online'] == 0) {
         } else {
             $bOnline = 1;
         }
     }
     if (!$bGenProfLink) {
         if ($sForceSex != 'visitor') {
             $sNick = _t('_Vacant');
             $sLink = 'javascript:void(0)';
         }
     }
     $w = $sType == 'medium' ? BX_AVA_W : BX_AVA_ICON_W;
     $h = $sType == 'medium' ? BX_AVA_H : BX_AVA_ICON_H;
     if ($bCouple) {
         $sType = 'small';
     }
     $aVariables = array('iProfId' => $iId, 'sys_thb_float' => $sFloat, 'sys_thb_width' => $w + 6, 'sys_thb_height' => $h + 6, 'sys_img_width' => $w, 'sys_img_height' => $h, 'sys_img_width1' => $w + 4, 'sys_img_height1' => $h + 4, 'sys_cpl_img_width' => BX_AVA_ICON_W, 'sys_cpl_img_height' => BX_AVA_ICON_H, 'sys_status_url' => getTemplateIcon($sStatusIcon), 'sys_status_title' => $oUserStatusView->getStatus($iId), 'usr_profile_url' => $sLink, 'usr_thumb_url0' => $aProfile['Avatar'] ? BX_AVA_URL_USER_AVATARS . $aProfile['Avatar'] . ($sType == 'small' ? 'i' : '') . BX_AVA_EXT : $this->getSexPic($aProfile['Sex'], $sType), 'usr_thumb_title0' => $sNick, 'bx_if:profileLink' => array('condition' => $bGenProfLink, 'content' => array('picWidth' => $w + 6, 'nickName' => $sNick, 'usr_profile_url' => $sLink)), 'sys_status_img_width' => 12, 'sys_status_img_height' => 12);
     if ($bCouple) {
         $aProfileCouple = getProfileInfo($aProfile['Couple']);
         $sNickCouple = getNickname($aProfile['Couple']);
         $aVariables['usr_thumb_url1'] = $aProfileCouple['Avatar'] ? BX_AVA_URL_USER_AVATARS . $aProfileCouple['Avatar'] . 'i' . BX_AVA_EXT : $this->getSexPic($aProfileCouple['Sex'], 'small');
         $aVariables['usr_thumb_title1'] = $sNickCouple;
     }
     return $GLOBALS['oSysTemplate']->parseHtmlByName($bCouple ? "thumbnail_couple.html" : "thumbnail_single.html", $aVariables);
 }