本文整理汇总了PHP中BxTemplVotingView类的典型用法代码示例。如果您正苦于以下问题:PHP BxTemplVotingView类的具体用法?PHP BxTemplVotingView怎么用?PHP BxTemplVotingView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BxTemplVotingView类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getBlockCode_ViewImage
function getBlockCode_ViewImage()
{
$sSiteUrl = $this->_aSite['url'];
$aFile = BxDolService::call('photos', 'get_photo_array', array($this->_aSite['photo'], 'file'), 'Search');
$sImage = $aFile['no_image'] ? '' : $aFile['file'];
// BEGIN STW INTEGRATION
if (getParam('bx_sites_account_type') != 'No Automated Screenshots') {
if ($sImage == '') {
$aSTWOptions = array();
bx_sites_import('STW');
$sThumbHTML = getThumbnailHTML($sSiteUrl, $aSTWOptions, false, false);
}
}
// END STW INTEGRATION
$sVote = '';
if (strncasecmp($sSiteUrl, 'http://', 7) != 0 && strncasecmp($sSiteUrl, 'https://', 8) != 0) {
$sSiteUrl = 'http://' . $sSiteUrl;
}
if ($this->_oConfig->isVotesAllowed() && $this->_oSites->oPrivacy->check('rate', $this->_aSite['id'], $this->_oSites->iOwnerId)) {
bx_import('BxTemplVotingView');
$oVotingView = new BxTemplVotingView('bx_sites', $this->_aSite['id']);
if ($oVotingView->isEnabled()) {
$sVote = $oVotingView->getBigVoting();
}
}
$sContent = $this->_oTemplate->parseHtmlByName('view_image.html', array('title' => $this->_aSite['title'], 'site_url' => $sSiteUrl, 'site_url_view' => $this->_aSite['url'], 'bx_if:is_image' => array('condition' => $sThumbHTML == false, 'content' => array('image' => $sImage ? $sImage : $this->_oTemplate->getImageUrl('no-image-thumb.png'))), 'bx_if:is_thumbhtml' => array('condition' => $sThumbHTML != '', 'content' => array('thumbhtml' => $sThumbHTML)), 'vote' => $sVote, 'view_count' => $this->_aSite['views']));
return array($sContent, array(), array(), false);
}
开发者ID:Arvindvi,项目名称:dolphin,代码行数:28,代码来源:BxSitesPageView.php
示例2: blockHon
function blockHon($aData)
{
$oVoting = new BxTemplVotingView('bx_sites', $aData['id']);
$aResult = $this->_getUnit($aData, 'file');
$aResult['rate'] = $oVoting->getBigVoting();
$aResult['next_url'] = $_SERVER['REQUEST_URI'];
return $this->parseHtmlByName('block_hon.html', $aResult);
}
开发者ID:boonex,项目名称:dolphin.pro,代码行数:8,代码来源:BxSitesTemplate.php
示例3: getViewFile
function getViewFile(&$aInfo)
{
$oVotingView = new BxTemplVotingView('bx_' . $this->_oConfig->getUri(), $aInfo['medID']);
$iWidth = (int) $this->_oConfig->getGlParam('file_width');
if ($aInfo['prevItem'] > 0) {
$aPrev = $this->_oDb->getFileInfo(array('fileId' => $aInfo['prevItem']), true, array('medUri', 'medTitle'));
}
if ($aInfo['nextItem'] > 0) {
$aNext = $this->_oDb->getFileInfo(array('fileId' => $aInfo['nextItem']), true, array('medUri', 'medTitle'));
}
$aUnit = array('file' => $this->getFileConcept($aInfo['medID'], array('ext' => $aInfo['medExt'], 'source' => $aInfo['medSource'])), 'width_ext' => $iWidth + 2, 'width' => $iWidth, 'fileUrl' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $aInfo['medUri'], 'fileTitle' => $aInfo['medTitle'], 'rate' => $oVotingView->isEnabled() ? $oVotingView->getBigVoting(1, $aInfo['Rate']) : '', 'favInfo' => isset($aInfo['favCount']) ? $aInfo['favCount'] : '', 'viewInfo' => $aInfo['medViews'], 'albumUri' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'browse/album/' . $aInfo['albumUri'] . '/owner/' . $aInfo['NickName'], 'albumCaption' => $aInfo['albumCaption'], 'bx_if:prev' => array('condition' => $aInfo['prevItem'] > 0, 'content' => array('linkPrev' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $aPrev['medUri'], 'titlePrev' => $aPrev['medTitle'], 'percent' => $aInfo['nextItem'] > 0 ? 50 : 100)), 'bx_if:next' => array('condition' => $aInfo['nextItem'] > 0, 'content' => array('linkNext' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $aNext['medUri'], 'titleNext' => $aNext['medTitle'], 'percent' => $aInfo['prevItem'] > 0 ? 50 : 100)));
return $this->parseHtmlByName('view_unit.html', $aUnit);
}
开发者ID:dalinhuang,项目名称:shopexts,代码行数:13,代码来源:BxVideosTemplate.php
示例4: getBlockCode_RateObject
function getBlockCode_RateObject()
{
$sMainPrefix = $this->oConfig->getMainPrefix();
$this->oMedia->oModule->_defineActions();
$aCheck = checkAction($this->iViewer, $this->oMedia->oModule->_defineActionName('view'));
if ($aCheck[CHECK_ACTION_RESULT] != CHECK_ACTION_RESULT_ALLOWED) {
$sCode = MsgBox(_t('_' . $sMainPrefix . '_forbidden'));
} else {
$aData = $this->getRateObject();
if (count($aData) > 0) {
$oVotingView = new BxTemplVotingView($this->sType, $aData[0]['id']);
$aUnit = array('url' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'rate', 'fileBody' => $this->getRateFile($aData), 'ratePart' => $oVotingView->isEnabled() ? $oVotingView->getBigVoting() : '', 'fileTitle' => $aData[0]['title'], 'fileUri' => $this->oMedia->getCurrentUrl('file', $aData[0]['id'], $aData[0]['uri']), 'fileWhen' => defineTimeInterval($aData[0]['date']), 'fileFrom' => getNickName($aData[0]['ownerId']), 'fileFromLink' => getProfileLink($aData[0]['ownerId']));
$sCode = $this->oMedia->oTemplate->parseHtmlByName('rate_object.html', $aUnit);
checkAction($this->iViewer, $this->oMedia->oModule->_defineActionName('view'), true);
} else {
$sCode = MsgBox(_t('_' . $sMainPrefix . '_no_file_for_rate'));
}
}
return array($sCode, array(), array(), false);
}
开发者ID:Prashank25,项目名称:dolphin.pro,代码行数:20,代码来源:BxDolFilesRate.php
示例5: getBlockCode_RateObject
function getBlockCode_RateObject()
{
$this->oMedia->oModule->_defineActions();
$aCheck = checkAction($this->iViewer, $this->oMedia->oModule->_defineActionName('view'));
if ($aCheck[CHECK_ACTION_RESULT] != CHECK_ACTION_RESULT_ALLOWED) {
$sCode = MsgBox(_t('_' . $this->sType . '_forbidden'));
} else {
$aData = $this->getRateObject();
if (count($aData) > 0) {
$oFile =& $this->oMedia->oModule;
$oFile->_oTemplate->addCss('rate_object.css');
$iInfoWidth = (int) getParam($this->sType . '_file_width');
$oVotingView = new BxTemplVotingView($this->sType, $aData[0]['id']);
$aUnit = array('url' => BX_DOL_URL_ROOT . $oFile->_oConfig->getBaseUri() . 'rate', 'fileBody' => $this->oMedia->oTemplate->getFileConcept($aData[0]['id']), 'ratePart' => $oVotingView->isEnabled() ? $oVotingView->getBigVoting() : '', 'fileTitle' => $aData[0]['title'], 'fileUri' => $this->oMedia->getCurrentUrl('file', $aData[0]['id'], $aData[0]['uri']), 'fileWhen' => defineTimeInterval($aData[0]['date']), 'fileFrom' => $aData[0]['ownerName'], 'fileFromLink' => getProfileLink($aData[0]['ownerId']), 'infoWidth' => $iInfoWidth > 0 ? $iInfoWidth + 2 : '');
$sCode = $this->oMedia->oTemplate->parseHtmlByName('rate_object.html', $aUnit);
checkAction($this->iViewer, $this->oMedia->oModule->_defineActionName('view'), true);
} else {
$sCode = MsgBox(_t('_bx_sounds_no_file_for_rate'));
}
}
return $sCode;
}
开发者ID:dalinhuang,项目名称:shopexts,代码行数:22,代码来源:BxSoundsRate.php
示例6: getBlockCode_ViewImage
function getBlockCode_ViewImage()
{
$aFile = BxDolService::call('photos', 'get_photo_array', array($this->_aSite['photo'], 'file'), 'Search');
$sImage = $aFile['no_image'] ? '' : $aFile['file'];
$sVote = '';
$sSiteUrl = $this->_aSite['url'];
if (strncasecmp($sSiteUrl, 'http://', 7) != 0) {
$sSiteUrl = 'http://' . $sSiteUrl;
}
if ($this->_oConfig->isVotesAllowed() && $this->_oSites->oPrivacy->check('rate', $this->_aSite['id'], $this->_oSites->iOwnerId)) {
bx_import('BxTemplVotingView');
$oVotingView = new BxTemplVotingView('bx_sites', $this->_aSite['id']);
if ($oVotingView->isEnabled()) {
$sVote = $oVotingView->getBigVoting();
}
}
return $this->_oTemplate->parseHtmlByName('view_image.html', array('title' => $this->_aSite['title'], 'site_url' => $sSiteUrl, 'site_url_view' => $this->_aSite['url'], 'image' => $sImage ? $sImage : $this->_oTemplate->getIconUrl('no-photo-110.png'), 'image_fave' => $this->_oTemplate->getIconUrl('action_fave.png'), 'image_view' => $this->_oTemplate->getIconUrl('eye.png'), 'vote' => $sVote, 'view_count' => $this->_aSite['views']));
}
开发者ID:dalinhuang,项目名称:shopexts,代码行数:18,代码来源:BxSitesPageView.php
示例7: getBlockCode_ViewFile
function getBlockCode_ViewFile()
{
$oVotingView = new BxTemplVotingView('bx_files', $this->aFileInfo['medID']);
if ($this->aFileInfo['prevItem'] > 0) {
$aPrev = $this->oDb->getFileInfo(array('fileId' => $this->aFileInfo['prevItem']), true, array('medUri', 'medTitle'));
}
if ($this->aFileInfo['nextItem'] > 0) {
$aNext = $this->oDb->getFileInfo(array('fileId' => $this->aFileInfo['nextItem']), true, array('medUri', 'medTitle'));
}
//icon
$sIcon = $this->oDb->getTypeIcon($this->aFileInfo['Type']);
if (!$sIcon) {
$sIcon = 'default.png';
}
$aUnit = array('pic' => $this->oTemplate->getIconUrl($sIcon), 'fileTitle' => $this->aFileInfo['medTitle'], 'fileSize' => (int) $this->aFileInfo['medSize'] > 0 ? _t_format_size((int) $this->aFileInfo['medSize']) : 0, 'fileExt' => $this->aFileInfo['medExt'], 'fileDescription' => $this->aFileInfo['medDesc'], 'rate' => $oVotingView->isEnabled() ? $oVotingView->getBigVoting(1, $this->aFileInfo['Rate']) : '', 'favInfo' => $this->oDb->getFavoritesCount($this->aFileInfo['medID']), 'viewInfo' => $this->aFileInfo['medViews'], 'albumUri' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'browse/album/' . $this->aFileInfo['albumUri'] . '/owner/' . $this->aFileInfo['NickName'], 'albumCaption' => $this->aFileInfo['albumCaption'], 'bx_if:prev' => array('condition' => $this->aFileInfo['prevItem'] > 0, 'content' => array('linkPrev' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'view/' . $aPrev['medUri'], 'titlePrev' => $aPrev['medTitle'], 'percent' => $this->aFileInfo['nextItem'] > 0 ? 50 : 100)), 'bx_if:next' => array('condition' => $this->aFileInfo['nextItem'] > 0, 'content' => array('linkNext' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'view/' . $aNext['medUri'], 'titleNext' => $aNext['medTitle'], 'percent' => $this->aFileInfo['prevItem'] > 0 ? 50 : 100)));
$sCode = $this->oTemplate->parseHtmlByName('view_unit.html', $aUnit);
return array($sCode, array(), array(), false);
}
开发者ID:noormcs,项目名称:studoro,代码行数:18,代码来源:BxFilesPageView.php
示例8: getBlockCode_Members
function getBlockCode_Members()
{
global $tmpl;
// number of profiles
$max_num = (int) getParam("top_members_max_num");
// Get Sex from GET data
if ($_GET['Sex'] && $_GET['Sex'] != "all") {
$sex = process_db_input($_GET['Sex']);
$query_add = " AND `Sex` = '{$sex}'";
} else {
$sex = "all";
$query_add = "";
}
$query_add .= ' AND (`Couple`=0 OR `Couple`>`ID`)';
$query = "\r\n\t\t\tSELECT\r\n\t\t\t\t`Profiles`.*\r\n\t\t\t";
if ($_GET['members_mode'] == 'online' or $_GET['members_mode'] == 'rand' or $_GET['members_mode'] == 'last' or $_GET['members_mode'] == 'top') {
$mode = $_GET['members_mode'];
} else {
$mode = 'last';
}
$aDBTopMenu = array();
//$menu = '<div class="dbTopMenu">';
foreach (array('last', 'top', 'online', 'rand') as $myMode) {
switch ($myMode) {
case 'online':
if ($mode == $myMode) {
$filter = " FROM `Profiles` WHERE `DateLastNav` > SUBDATE(NOW(), INTERVAL " . (int) getParam("member_online_time") . " MINUTE) AND `Status` = 'Active' AND `PrimPhoto` != 0 {$query_add} ORDER BY `Couple` ASC";
}
$modeTitle = _t('_Online');
break;
case 'rand':
if ($mode == $myMode) {
$filter = " FROM `Profiles` WHERE `Status` = 'Active' AND `PrimPhoto` != 0 {$query_add} ORDER BY `Couple` ASC, RAND()";
}
$modeTitle = _t('_Random');
break;
case 'last':
if ($mode == $myMode) {
$filter = " FROM `Profiles` WHERE `Status` = 'Active' {$query_add} ORDER BY `Couple` ASC, `DateReg` DESC";
}
$modeTitle = _t('_Latest');
break;
case 'top':
if ($mode == $myMode) {
$oVotingView = new BxTemplVotingView('profile', 0, 0);
$aSql = $oVotingView->getSqlParts('`Profiles`', '`ID`');
$sqlOrderBy = $oVotingView->isEnabled() ? " ORDER BY `Couple` ASC, (`pr_rating_sum`/`pr_rating_count`) DESC, `pr_rating_count` DESC, `DateReg` DESC" : $sqlOrderBy;
$sqlFields = $aSql['fields'];
$sqlLJoin = $aSql['join'];
$filter = "{$sqlFields} FROM `Profiles` {$sqlLJoin} WHERE `Status` = 'Active' AND `pr_rating_count` > 2 {$query_add} {$sqlOrderBy}";
$filter2 = " FROM `Profiles` {$sqlLJoin} WHERE `Status` = 'Active' AND `pr_rating_count` > 2 {$query_add} {$sqlOrderBy}";
}
$modeTitle = _t('_Top');
break;
}
$aDBTopMenu[$modeTitle] = array('href' => "{$_SERVER['PHP_SELF']}?members_mode={$myMode}", 'dynamic' => true, 'active' => $myMode == $mode);
/*if( $myMode == $mode )
$menu .= "<div class=\"active\">$modeTitle</a></div>";
else
$menu .= "<div class=\"notActive\"><a href=\"{$_SERVER['PHP_SELF']}?members_mode=$myMode&Sex=$sex\" class=\"top_members_menu\" onclick=\"getHtmlData( 'show_members', this.href+'&show_only=members'); return false;\">$modeTitle</a></div>";*/
}
/*$menu .= '<div class="clear_both"></div>';
$menu .= '</div>';*/
$ret = '';
$aNum = db_arr("SELECT COUNT(`Profiles`.`ID`) " . (isset($filter2) ? $filter2 : $filter));
$num = (int) $aNum[0];
if ($num) {
$pages = ceil($num / $max_num);
$page = (int) $_GET['page'];
if ($page < 1 or $mode == 'rand') {
$page = 1;
}
if ($page > $pages) {
$page = $pages;
}
$sqlFrom = ($page - 1) * $max_num;
$limit = " LIMIT {$sqlFrom}, {$max_num}";
$templ_search = file_get_contents("{$dir['root']}templates/tmpl_{$tmpl}/topmebers_index.html");
$result = db_res($query . $filter . $limit);
$iCounter = 1;
$ret .= '<div class="clear_both"></div>';
while ($p_arr = mysql_fetch_array($result)) {
$ret .= PrintSearhResult($p_arr, $templ_search, 3);
/*if( ($iCounter % 3) != 0 )
$ret .= PrintSearhResult( $p_arr, $templ_search, 1 );
else
$ret .= PrintSearhResult( $p_arr, $templ_search, 2 );
$iCounter++;*/
}
$ret .= '<div class="clear_both"></div>';
$aDBBottomMenu = array();
if ($pages > 1) {
//$ret .= '<div class="dbBottomMenu">';
if ($page > 1) {
$prevPage = $page - 1;
$aDBBottomMenu[_t('_Back')] = array('href' => "{$_SERVER['PHP_SELF']}?members_mode={$mode}&page={$prevPage}", 'dynamic' => true, 'class' => 'backMembers');
/*$ret .= "
<a href=\"{$_SERVER['PHP_SELF']}?members_mode=$mode&page=$prevPage\"
class=\"backMembers\"
onclick=\"getHtmlData( 'show_members', this.href+'&show_only=members'); return false;\">"._t('_Back')."</a>
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:101,代码来源:BxBaseIndex.php
示例9: showPreviousRated
function showPreviousRated($iPhotoID)
{
global $site;
global $oTemplConfig;
global $max_thumb_width;
global $max_thumb_height;
$iBarWidth = $oTemplConfig->iRateSmallRatingBar;
$iBarNum = $oTemplConfig->iRateSmallRatingBarNum;
$query = "\r\n\t\tSELECT\r\n\t\t\t`media`.`med_id`,\r\n\t\t\t`med_prof_id`,\r\n\t\t\t`med_file`,\r\n\t\t\t`med_title`,\r\n\t\t\t`med_rating_count`,\r\n\t\t\t`med_rating_sum`,\r\n\t\t\t`Profiles`.`NickName`\r\n\t\tFROM `media`\r\n\t\tLEFT JOIN `media_rating` USING (`med_id`)\r\n\t\tLEFT JOIN `Profiles` ON\r\n\t\t\t(`Profiles`.`ID`=`media`.`med_prof_id`)\r\n\t\tWHERE\r\n\t\t\t`med_status` = 'active'\r\n\t\t\tAND `media`.`med_id` = {$iPhotoID}\r\n\t\t";
$ph_arr = db_arr($query);
if (!$ph_arr) {
return '';
}
$urlImg = "{$site['profileImage']}{$ph_arr['med_prof_id']}/thumb_{$ph_arr['med_file']}";
$urlSpacer = getTemplateIcon('spacer.gif');
$sProfLink = getProfileLink($ph_arr['med_prof_id']);
$sRatingBar = '';
$oVotingView = new BxTemplVotingView('media', (int) $iPhotoID);
if ($oVotingView->isEnabled()) {
$sRatingBar = $oVotingView->getSmallVoting(false);
}
$ret .= <<<EOJ
\t<div class="rate_prev_photo_block">
\t\t<div class="thumbnail_block" style="float:none;">
\t\t\t<a href="{$site['url']}photos_gallery.php?ID={$ph_arr['med_prof_id']}&photoID={$ph_arr['med_id']}" title="{$ph_arr['med_title']}">
\t\t\t\t<img style="width:{$max_thumb_width}px;height:{$max_thumb_height}px;background-image:url({$urlImg});" src="{$urlSpacer}" />
\t\t\t</a>
\t\t</div>
\t\t<div class="rate_prev_photo_nickname">
\t\t\t<a href="{$sProfLink}">{$ph_arr['NickName']}</a>
\t\t</div>
\t\t<div style="position:relative; width:50%; height:30px; overflow:visible; margin-top:10px;">
\t\t\t<div style="position:absolute; right:-94px; width:400px; height:30px;">
\t\t\t\t{$sRatingBar}
\t\t\t</div>\t\t\t
\t\t</div>
\t</div>
EOJ;
return DesignBoxContent(_t('_Previous rated'), $ret, 1);
}
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:41,代码来源:rate.php
示例10: getBlockCode_ViewFile
function getBlockCode_ViewFile()
{
$oVotingView = new BxTemplVotingView($this->oConfig->getMainPrefix(), $this->aFileInfo['medID']);
$iWidth = (int) $this->oConfig->getGlParam('file_width');
if ($this->aFileInfo['prevItem'] > 0) {
$aPrev = $this->oDb->getFileInfo(array('fileId' => $this->aFileInfo['prevItem']), true, array('medUri', 'medTitle'));
}
if ($this->aFileInfo['nextItem'] > 0) {
$aNext = $this->oDb->getFileInfo(array('fileId' => $this->aFileInfo['nextItem']), true, array('medUri', 'medTitle'));
}
$aUnit = array('pic' => $this->oSearch->getImgUrl($this->aFileInfo['Hash'], 'file'), 'width' => $iWidth, 'fileTitle' => $this->aFileInfo['medTitle'], 'fileDescription' => $this->aFileInfo['medDesc'], 'rate' => $oVotingView->isEnabled() ? $oVotingView->getBigVoting(1, $this->aFileInfo['Rate']) : '', 'favInfo' => $this->oDb->getFavoritesCount($this->aFileInfo['medID']), 'viewInfo' => $this->aFileInfo['medViews'], 'albumUri' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'browse/album/' . $this->aFileInfo['albumUri'] . '/owner/' . $this->aFileInfo['NickName'], 'albumCaption' => $this->aFileInfo['albumCaption'], 'bx_if:prev' => array('condition' => $this->aFileInfo['prevItem'] > 0, 'content' => array('linkPrev' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'view/' . $aPrev['medUri'], 'titlePrev' => $aPrev['medTitle'], 'percent' => $this->aFileInfo['nextItem'] > 0 ? 50 : 100)), 'bx_if:next' => array('condition' => $this->aFileInfo['nextItem'] > 0, 'content' => array('linkNext' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'view/' . $aNext['medUri'], 'titleNext' => $aNext['medTitle'], 'percent' => $this->aFileInfo['prevItem'] > 0 ? 50 : 100)));
$sCode = $this->oTemplate->parseHtmlByName('view_unit.html', $aUnit);
return array($sCode, array(), array(), false);
}
开发者ID:Gotgot59,项目名称:dolphin.pro,代码行数:14,代码来源:BxPhotosPageView.php
示例11: PageCompLastFiles
function PageCompLastFiles()
{
global $site;
global $aFile;
$iLimit = 2;
$sQuery = "SELECT `ID` as `medID`,\r\n\t\t\t\t\t `Title` as `medTitle`,\r\n\t\t\t\t\t `Date` as `medDate`,\r\n\t\t\t\t\t `Views` as `medViews`\r\n\t\t\t\t\t FROM `RayMovieFiles` \r\n\t\t\t\t\t WHERE `Owner`='{$aFile['medProfId']}' \r\n\t\t\t\t\t AND `ID`<>'{$aFile['medID']}' AND `Approved`='true' ORDER BY `Date` DESC LIMIT {$iLimit}";
$rLast = db_res($sQuery);
$sLinkMore = '';
if ($aFile['medCount'] - 1 > $iLimit) {
$sLinkMore = '<a href="browseVideo.php?userID=' . $aFile['medProfId'] . '">' . _t("_See all videos of this user") . '</a>';
}
$sCode = '<div id="lastFiles">';
while ($aLast = mysql_fetch_array($rLast)) {
$sTitle = strlen($aLast['medTitle']) > 0 ? $aLast['medTitle'] : _t("_Untitled");
$oVotingView = new BxTemplVotingView('gvideo', $aLast['medID']);
if ($oVotingView->isEnabled()) {
$sRate = $oVotingView->getSmallVoting(0);
$sShowRate = '<div class="galleryRate">' . $sRate . '</div>';
}
$sCode .= '<div class="lastFileUnit">';
$sCode .= '<div class="lastFilesPic">';
$sCode .= '<a href="' . $site['url'] . 'viewVideo.php?fileID=' . $aLast['medID'] . '">';
$sCode .= '<img src="' . $site['url'] . 'ray/modules/movie/files/' . $aLast['medID'] . '_small.jpg">';
$sCode .= '</a>';
$sCode .= '</div>';
$sCode .= '<div><a href="' . $site['url'] . 'viewVideo.php?fileID=' . $aLast['medID'] . '"><b>' . $sTitle . '</b></a></div>';
$sCode .= '<div>' . _t("_Added") . ': <b>' . defineTimeInterval($aLast['medDate']) . '</b></div>';
$sCode .= '<div>' . _t("_Views") . ': <b>' . $aLast['medViews'] . '</b></div>';
$sCode .= $sShowRate;
$sCode .= '</div>';
$sCode .= '<div class="clear_both"></div>';
}
$sCode .= '<div class="lastFilesLink">' . $sLinkMore . '</div>';
$sCode .= '</div>';
return $sCode;
}
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:36,代码来源:viewVideo.php
示例12: PageCompLastFiles
function PageCompLastFiles()
{
global $site;
global $aFile;
$iLimit = 2;
$sQuery = "SELECT `medID`,\r\n\t\t\t\t\t `medTitle`,\r\n\t\t\t\t\t UNIX_TIMESTAMP(`medDate`) as `medDate`,\r\n\t\t\t\t\t `medExt`,\r\n\t\t\t\t\t `medViews`\r\n\t\t\t\t\t FROM `sharePhotoFiles` \r\n\t\t\t\t\t WHERE `medProfId`='{$aFile['medProfId']}' \r\n\t\t\t\t\t AND `medID`<>'{$aFile['medID']}' AND `Approved`='true' ORDER BY `medDate` DESC LIMIT {$iLimit}";
$rLast = db_res($sQuery);
$sLinkMore = '';
if ($aFile['medCount'] - 1 > $iLimit) {
$sLinkMore = '<a href="browsePhoto.php?userID=' . $aFile['medProfId'] . '">' . _t("_See all photos of this user") . '</a>';
}
$sCode = '<div id="lastFiles">';
while ($aLast = mysql_fetch_array($rLast)) {
$sImage = $site['sharingImages'] . $aLast['medID'] . '_t.' . $aLast['medExt'];
$sTitle = strlen($aLast['medTitle']) > 0 ? $aLast['medTitle'] : _t("_Untitled");
$oVotingView = new BxTemplVotingView('gphoto', $aLast['medID']);
if ($oVotingView->isEnabled()) {
$sRate = $oVotingView->getSmallVoting(0);
$sShowRate = '<div class="galleryRate">' . $sRate . '</div>';
}
$sCode .= '<div class="lastFileUnit">';
$sCode .= '<a href="' . $site['url'] . 'viewPhoto.php?fileID=' . $aLast['medID'] . '">';
$sCode .= '<img class="lastFilesPic" style="background-image: url(\'' . $sImage . '\');" src="' . getTemplateIcon('spacer.gif') . '" />';
$sCode .= '</a>';
$sCode .= '<div><a href="' . $site['url'] . 'viewPhoto.php?fileID=' . $aLast['medID'] . '"><b>' . $sTitle . '</b></a></div>';
$sCode .= '<div>' . _t("_Added") . ': <b>' . defineTimeInterval($aLast['medDate']) . '</b></div>';
$sCode .= '<div>' . _t("_Views") . ': <b>' . $aLast['medViews'] . '</b></div>';
$sCode .= $sShowRate;
$sCode .= '</div>';
$sCode .= '<div class="clear_both"></div>';
}
$sCode .= '<div class="lastFilesLink">' . $sLinkMore . '</div>';
$sCode .= '</div>';
return $sCode;
}
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:35,代码来源:viewPhoto.php
示例13: getRate
function getRate($iFile)
{
$iFile = (int) $iFile;
$sCode = '<center>' . _t('_rating not enabled') . '</center>';
$oVotingView = new BxTemplVotingView($this->_oConfig->getMainPrefix(), $iFile);
if ($oVotingView->isEnabled()) {
$sCode = $oVotingView->getBigVoting();
}
return $sCode;
}
开发者ID:dalinhuang,项目名称:shopexts,代码行数:10,代码来源:BxDolFilesTemplate.php
示例14: BxWallVoting
function BxWallVoting($sSystem, $iId, $iInit = 1)
{
parent::BxTemplVotingView($sSystem, $iId, $iInit);
$this->_oModule = BxDolModule::getInstance('BxWallModule');
}
开发者ID:Gotgot59,项目名称:dolphin.pro,代码行数:5,代码来源:BxWallVoting.php
示例15: getFileIdByUri
* You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin,
* see license.txt file; if not, write to [email protected]
***************************************************************************/
require_once 'inc/header.inc.php';
require_once BX_DIRECTORY_PATH_INC . 'sharing.inc.php';
require_once BX_DIRECTORY_PATH_CLASSES . 'BxDolSharedMediaView.php';
$iFile = 0;
if (isset($_GET['fileUri'])) {
$iFile = getFileIdByUri($_GET['fileUri'], 'photo');
} elseif (isset($_GET['fileID'])) {
$iFile = (int) $_GET['fileID'];
}
$member['ID'] = (int) $_COOKIE['memberID'];
check_logged();
$oNew = new BxDolSharedMediaView($iFile, 'photo', $site, $dir, $member);
$oVotingView = new BxTemplVotingView('gphoto', 0, 0);
$_page['extra_js'] = $oVotingView->getExtraJs();
$_page['name_index'] = 81;
$_ni = $_page['name_index'];
$_page['css_name'] = $oNew->oShared->sCssName;
$_page['extra_css'] = $oNew->oCmtsView->getExtraCss();
$_page['extra_js'] .= $oNew->oCmtsView->getExtraJs();
$_page['header'] = _t("_view Photo");
$_ni = $_page['name_index'];
$check_res = checkAction($member['ID'], $oNew->oShared->sViewActionName);
if ($check_res[CHECK_ACTION_RESULT] != CHECK_ACTION_RESULT_ALLOWED && !$logged['admin'] && !$logged['moderator']) {
$sCode = "\r\n \t<table width=100% height=100% cellpadding=0 cellspacing=0 class=text2>\r\n \t\t<td align=center bgcolor={$boxbg2}>\r\n \t\t\t" . $check_res[CHECK_ACTION_MESSAGE] . "<br />\r\n \t\t</td>\r\n \t</table>\n";
$_page['name_index'] = 0;
$_page_cont[0]['page_main_code'] = $sCode;
PageCode();
exit;
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:31,代码来源:viewPhoto.php
示例16: PageCompShareMusicContent
function PageCompShareMusicContent($sCaption, $iID = 0)
{
global $site;
$max_num = (int) getParam("top_photos_max_num");
$mode = process_db_input(getParam("top_photos_mode"));
$mode = $_GET['shMusicMode'];
if ($mode != 'rand' && $mode != 'top' && $mode != 'last') {
$mode = 'last';
}
$sqlSelect = "SELECT `ID` as `medID`,\r\n\t\t\t\t\t\t `Title` as `medTitle`,\r\n\t\t\t\t\t\t `Date` as `medDate`\r\n\t\t\t\t\t\t ";
$sqlFrom = " FROM `RayMusicFiles`";
if ($iID != 0) {
$sqlWhere = " WHERE `Approved`='true' AND `Owner`='{$iID}'";
}
$menu = '<div class="dbTopMenu">';
foreach (array('last', 'top', 'rand') as $myMode) {
switch ($myMode) {
case 'last':
if ($mode == $myMode) {
$sqlOrder = "\r\n\t \t\tORDER BY `medDate` DESC";
}
$modeTitle = _t('_Latest');
break;
case 'rand':
if ($mode == $myMode) {
$sqlOrder = "\r\n\t \t\tORDER BY RAND()";
}
$modeTitle = _t('_Random');
break;
case 'top':
if ($mode == $myMode) {
$oVotingView = new BxTemplVotingView('gmusic', 0, 0);
$aSql = $oVotingView->getSqlParts('`RayMusicFiles`', '`ID`');
$sHow = "DESC";
$sqlOrderBy = $oVotingView->isEnabled() ? "ORDER BY `voting_rate` {$sHow}, `voting_count` {$sHow}, `medDate` {$sHow}" : $sqlOrderBy;
$sqlFields = $aSql['fields'];
$sqlLJoin = $aSql['join'];
$sqlSelect .= $sqlFields;
$sqlFrom .= $sqlLJoin;
$sqlOrder = $sqlOrderBy;
}
$modeTitle = _t('_Top');
break;
}
//if( $_SERVER['PHP_SELF'] == 'rewrite_name.php' )
if ($myMode == $mode) {
$menu .= "<div class=\"active\">{$modeTitle}</div>";
} else {
if (basename($_SERVER['PHP_SELF']) == 'rewrite_name.php' || basename($_SERVER['PHP_SELF']) == 'profile.php') {
$menu .= "<div class=\"notActive\"><a href=\"profile.php?ID={$iID}&shMusicMode={$myMode}\" class=\"top_members_menu\" onclick=\"getHtmlData( 'show_shareMusic', this.href+'&show_only=shareMusic'); return false;\">{$modeTitle}</a></div>";
} else {
$menu .= "<div class=\"notActive\"><a href=\"{$_SERVER['PHP_SELF']}?shMusicMode={$myMode}\" class=\"top_members_menu\" onclick=\"getHtmlData( 'show_shareMusic', this.href+'&show_only=shareMusic'); return false;\">{$modeTitle}</a></div>";
}
}
}
$menu .= '</div>';
$aNum = db_arr("SELECT COUNT(`RayMusicFiles`.`ID`) {$sqlFrom} {$sqlWhere}");
$num = (int) $aNum[0];
$ret = '';
if ($num) {
$pages = ceil($num / $max_num);
$page = (int) $_GET['page_p'];
if ($page < 1 or $mode == 'rand') {
$page = 1;
}
if ($page > $pages) {
$page = $pages;
}
$sqlLimitFrom = ($page - 1) * $max_num;
$sqlLimit = "\r\n\t\tLIMIT {$sqlLimitFrom}, {$max_num}";
$rData = db_res($sqlSelect . $sqlFrom . $sqlWhere . $sqlOrder . $sqlLimit);
$sAddon = '';
$iCounter = 1;
$ret .= '<div class="clear_both"></div>';
while ($aData = mysql_fetch_array($rData)) {
$sHref = $site['url'] . 'viewMusic.php?fileID=' . $aData['medID'];
$sVidTitle = strlen($aData['medTitle']) > 0 ? $aData['medTitle'] : _t("_Untitled");
$sImg = '<a href="' . $sHref . '"><img src="' . $site['images'] . 'music.png"></a>';
$oVotingView = new BxTemplVotingView('gmusic', $aData['medID']);
if ($oVotingView->isEnabled()) {
$sRate = $oVotingView->getSmallVoting(0);
$sShowRate = '<div class="galleryRate">' . $sRate . '</div>';
}
if ($iCounter % 3 != 0) {
$ret .= '<div class="shareMusicContent_1">';
} else {
$ret .= '<div class="shareMusicContent_2">';
$sAddon = '<div class="clear_both"></div>';
}
$ret .= '<div class="lastMusicPic">' . $sImg . '</div>';
$ret .= '<div><a href="' . $sHref . '">' . $sVidTitle . '</a></div>';
$ret .= $sShowRate . '</div>';
$ret .= $sAddon;
$sAddon = '';
$iCounter++;
}
$ret .= '<div class="clear_both"></div>';
$ret = DesignBoxContent(_t($sCaption), $ret, 1, $menu);
}
return $ret;
//.........这里部分代码省略.........
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:101,代码来源:sharing.inc.php
示例17: getConditionArray
function getConditionArray($logged)
{
$aWhere = array();
$aWhere[] = '1';
$iUser = 0;
if (isset($_GET['ownerName'])) {
$sName = process_db_input($_GET['ownerName']);
$iUser = (int) db_value("SELECT `ID` FROM `Profiles` WHERE `NickName`='{$sName}'");
} elseif (isset($_GET['userID'])) {
$iUser = (int) $_GET['userID'];
}
if ($iUser) {
$aWhere[] = "`{$this->sMainTable}`.`{$this->aTableFields['medProfId']}`={$iUser}";
}
if (isset($_GET['tag'])) {
$sTag = htmlspecialchars_adv($_GET['tag']);
$aWhere[] = "`{$this->sMainTable}`.`{$this->aTableFields['medTags']}` like '%{$sTag}%'";
}
if (isset($_GET['action'])) {
$sAct = htmlspecialchars_adv($_GET['action']);
switch ($sAct) {
case 'fav':
$sAddon = $this->getFavoriteCondition($this->iViewer);
break;
case 'del':
$sAddon = '';
if (isset($_GET['fileID'])) {
$this->deleteMedia($_GET['fileID'], $logged);
}
break;
}
}
$aSqlQuery['sqlWhere'] = "WHERE " . implode(' AND ', $aWhere) . $sAddon . " AND `Approved`= 'true'";
$iTotalNum = db_value("SELECT COUNT( * ) FROM `{$this->sMainTable}` {$aSqlQuery['sqlWhere']}");
if (!$iTotalNum) {
return false;
}
$iPerPage = (int) $_GET['per_page'];
if (!$iPerPage) {
$iPerPage = 10;
}
$iTotalPages = ceil($iTotalNum / $iPerPage);
$iCurPage = (int) $_GET['page'];
if ($iCurPage > $iTotalPages) {
$iCurPage = $iTotalPages;
}
if ($iCurPage < 1) {
$iCurPage = 1;
}
$sLimitFrom = ($iCurPage - 1) * $iPerPage;
$aSqlQuery['sqlLimit'] = "LIMIT {$sLimitFrom}, {$iPerPage}";
$aSqlQuery['sqlOrder'] = 'ORDER BY `medDate` DESC';
if (isset($_GET['rate'])) {
$oVotingView = new BxTemplVotingView('g' . $this->sType, 0, 0);
$aSql = $oVotingView->getSqlParts('`' . $this->sMainTable . '`', '`' . $this->aTableFields['medID'] . '`');
$sHow = $_GET['rate'] == 'top' ? "DESC" : "ASC";
$aSqlQuery['sqlOrder'] = $oVotingView->isEnabled() ? "ORDER BY `voting_rate` {$sHow}, `voting_count` {$sHow}, `medDate` {$sHow}" : $aSqlQuery['sqlOrder'];
$aSqlQuery['rateFields'] = $aSql['fields'];
$aSqlQuery['rateJoin'] = $aSql['join'];
}
return array('query' => $aSqlQuery, 'total' => $iTotalPages, 'per_page' => $iPerPage, 'cur_page' => $iCurPage);
}
开发者ID:BackupTheBerlios,项目名称:dolphin-dwbn-svn,代码行数:62,代码来源:BxDolSharedMedia.php
示例18: getMediaBlock
function getMediaBlock($iMediaID = 0)
{
global $site;
global $votes_pic;
$ret = '';
if ($this->iMediaCount > 0) {
$iMediaID = $iMediaID > 0 ? $iMediaID : $this->aMedia['0']['PrimPhoto'];
$aCurPhoto = $this->getElementArrayByID($iMediaID);
if (empty($aCurPhoto)) {
$sPhotoUrl = getTemplateIcon($this->sSexPic);
} else {
$iPhotoID = $aCurPhoto['med_id'];
$sPhotoUrl = $this->sMediaUrl . 'photo_' . $aCurPhoto['med_file'];
}
} else {
$sPhotoUrl = getTemplateIcon($this->sSexPic);
}
$ret .= $this->getJSCode($aCurPhoto);
$ret .= '<div class="photoBlock" id="photoKeeper">';
$style = 'width:' . $this->aMediaConfig['size']['photoWidth'] . 'px;' . 'height:' . $this->aMediaConfig['size']['photoHeight'] . 'px;' . 'background-image:url(' . $sPhotoUrl . ');';
$ret .= '<a href="' . $site['url'] . 'photos_gallery.php?ID=' . $this->iProfileID . '" id="temThumbLink">';
$ret .= '<img src="' . getTemplateIcon('spacer.gif') . '" style="' . $style . '" class="photo" alt="" id="temThumbID" />';
//$ret .= '<img src="' . getTemplateIcon('spacer.gif') . '" style="' . $style . '" class="photo" alt="" onload="return setThumb();" id="temThumbID" />';
$ret .= '</a>';
$ret .= '</div>';
$ret .= '<div id="temPhotoTitle" class="photo_title">' . stripslashes($aCurPhoto['med_title']) . '</div>';
$sJsIconsArray = '';
$iCountPhotos = 0;
$sIcons = $this->_getIconsList2($sJsIconsArray, $iCountPhotos);
$oVotingView = new BxTemplVotingView('media', (int) $aCurPhoto['med_id']);
if ($iCountPhotos && $votes_pic && $oVotingView->isEnabled()) {
$ret .= $oVotingView->getSmallVoting();
}
$ret .= '<div class="clear_both"></div>';
if (strlen($sIcons)) {
$ret .= '<div class="scrollIconContainer">';
$ret .= '<div class="scrollCont" id="scrollCont">';
$ret .= '<div class="scrollLeft" onmouseover="moveScrollLeftAuto( \'iconBlock\', 1 );" onmouseout="moveScrollLeftAuto( \'iconBlock\', 0 );"><img src="' . getTemplateIcon('left_arrow.gif') . '"/></div>';
$ret .= '<div class="scrollRight" onmouseover="moveScrollRightAuto( \'iconBlock\', 1 );" onmouseout="moveScrollRightAuto( \'iconBlock\', 0 );"><img src="' . getTemplateIcon('right_arrow.gif') . '"/></div>';
$ret .= '<div class="clear_both"></div>';
$ret .= '</div>';
$ret .= '<div class="iconBlockCont">';
$ret .= '<div id="iconBlock" class="iconBlock">';
$ret .= $sIcons;
$ret .= '</div>';
$ret .= '</div>';
$ret .= '</div>';
}
$ret .= '<script type="text/javascript">' . $sJsIconsArray . '</s
|
请发表评论