本文整理汇总了PHP中db_value函数的典型用法代码示例。如果您正苦于以下问题:PHP db_value函数的具体用法?PHP db_value怎么用?PHP db_value使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了db_value函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GenStoredMemIPs
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: uploadImage
function uploadImage($sUser, $sPwd, $sAlbum, $binImageData, $iDataLength, $sTitle, $sTags, $sDesc)
{
if (!($iId = BxDolXMLRPCUtil::checkLogin($sUser, $sPwd))) {
return new xmlrpcresp(new xmlrpcval(array('error' => new xmlrpcval(1, "int")), "struct"));
}
if (!BxDolXMLRPCMedia::_isMembershipEnabledFor($iIdProfileViewer, 'BX_PHOTOS_ADD', true)) {
return new xmlrpcval("fail access");
}
// write tmp file
$sTmpFilename = BX_DIRECTORY_PATH_ROOT . "tmp/" . time() . '_' . $iId;
$f = fopen($sTmpFilename, "wb");
if (!$f) {
return new xmlrpcval("fail fopen");
}
if (!fwrite($f, $binImageData, (int) $iDataLength)) {
fclose($f);
return new xmlrpcval("fail write");
}
fclose($f);
// upload
$aFileInfo = array();
$aFileInfo['medTitle'] = process_db_input($sTitle, BX_TAGS_STRIP, BX_SLASHES_NO_ACTION);
$aFileInfo['medDesc'] = process_db_input($sDesc, BX_TAGS_VALIDATE, BX_SLASHES_NO_ACTION);
$aFileInfo['medTags'] = process_db_input($sTags, BX_TAGS_STRIP, BX_SLASHES_NO_ACTION);
$aFileInfo['Categories'] = array(process_db_input($sAlbum, BX_TAGS_STRIP, BX_SLASHES_NO_ACTION));
$aFileInfo['album'] = process_db_input($sAlbum, BX_TAGS_STRIP, BX_SLASHES_NO_ACTION);
$isUpdateThumb = (int) db_value("SELECT `Avatar` FROM `Profiles` WHERE `ID` = '{$iId}' LIMIT 1") ? false : true;
if (BxDolService::call('photos', 'perform_photo_upload', array($sTmpFilename, $aFileInfo, $isUpdateThumb), 'Uploader')) {
return new xmlrpcval("ok");
} else {
return new xmlrpcval("fail upload");
}
}
示例3: getMemberAdsCnt
function getMemberAdsCnt($iMemberID, $sStatus = '', $bTimeCheck = FALSE)
{
$sStatus = $sStatus ? " AND`Status`='" . process_db_input($sStatus, BX_TAGS_STRIP) . "'" : "";
if ($bTimeCheck) {
$this->_oConfig->bAdminMode = FALSE;
}
$sTimeRestriction = $this->_oConfig->bAdminMode == true ? '' : "AND UNIX_TIMESTAMP() - `{$this->_oConfig->sSQLPostsTable}`.`LifeTime`*24*60*60 < `{$this->_oConfig->sSQLPostsTable}`.`DateTime`";
$sMemberAdsSQL = "\n SELECT COUNT(*) FROM `{$this->_oConfig->sSQLPostsTable}` WHERE `IDProfile` = '{$iMemberID}'\n {$sStatus}\n {$sTimeRestriction}\n ";
return (int) db_value($sMemberAdsSQL);
}
示例4: checkEmail
function checkEmail($s)
{
if (!preg_match("/(([A-Za-z]{3,9}:(?:\\/\\/)?)(?:[\\-;:&=\\+\$,\\w]+@)?[A-Za-z0-9\\.\\-]+|(?:www\\.|[\\-;:&=\\+\$,\\w]+@)[A-Za-z0-9\\.\\-]+)((?:\\/[\\+~%\\/\\.\\w\\-_]*)?\\??(?:[\\-\\+=&;%@\\.\\w_]*)#?(?:[\\.\\!\\/\\\\w]*))?/", $s)) {
return false;
}
$iID = (int) db_value("SELECT `ID` FROM `Profiles` WHERE `Email` = '{$s}'");
if (!$iID) {
return _t('_MEMBER_NOT_RECOGNIZED', $site['title']);
}
return true;
}
示例5: setTemplate
/**
* Update existing or create new template ;
*
* @param $sTemplateName (string) - name of template ;
* @param $sTemplateSubj (string) - subject of template ;
* @param $sTemplateBody (string) - text of template ;
* @param $iLangID (integer) - needed language's ID;
* @return HTML presentation data ;
*/
function setTemplate($sTemplateName, $sTemplateSubj, $sTemplateBody, $iLangID)
{
if (!db_value("SELECT `ID` FROM `sys_email_templates` WHERE `Name` = '" . process_db_input($sTemplateName) . "' AND `LangID` = '{$iLangID}'")) {
$sQuery = "\n INSERT INTO\n `sys_email_templates` (`Name`, `Subject`, `Body`, `LangID`)\n VALUES\n (\n '" . process_db_input($sTemplateName) . "',\n '" . process_db_input($sTemplateSubj) . "',\n '" . process_db_input($sTemplateBody) . "',\n '" . (int) $iLangID . "'\n )\n ";
$sMessage = 'Template was created';
} else {
$sQuery = "\n UPDATE\n `sys_email_templates`\n SET\n `Subject` = '" . process_db_input($sTemplateSubj) . "',\n `Body` = '" . process_db_input($sTemplateBody) . "'\n WHERE\n `Name` = '" . process_db_input($sTemplateName) . "'\n AND\n `LangID` = '" . (int) $iLangID . "'\n LIMIT 1\n ";
$sMessage = 'Template was updated';
}
db_res($sQuery);
return $this->genTemplatesForm($sTemplateName, $iLangID, $sMessage);
}
示例6: setTemplate
/**
* Update existing or create new template ;
*
* @param $sTemplateName (string) - name of template ;
* @param $sTemplateSubj (string) - subject of template ;
* @param $sTemplateBody (string) - text of template ;
* @param $iLangID (integer) - needed language's ID;
* @return HTML presentation data ;
*/
function setTemplate($sTemplateName, $sTemplateSubj, $sTemplateBody, $iLangID)
{
if (!db_value("SELECT `ID` FROM `sys_email_templates` WHERE `Name` = '" . process_db_input($sTemplateName) . "' AND `LangID` = '{$iLangID}'")) {
$sQuery = " \r\n\t\t\t\tINSERT INTO \r\n\t\t\t\t\t`sys_email_templates` (`Name`, `Subject`, `Body`, `LangID`) \r\n\t\t\t\tVALUES\r\n\t\t\t\t\t(\r\n\t\t\t\t\t\t'" . process_db_input($sTemplateName) . "', \r\n\t\t\t\t\t\t'" . process_db_input($sTemplateSubj) . "',\r\n\t\t\t\t\t\t'" . process_db_input($sTemplateBody) . "',\r\n\t\t\t\t\t\t'" . (int) $iLangID . "'\r\n\t\t\t\t\t)\r\n\t\t\t";
$sMessage = 'Template was created';
} else {
$sQuery = " \r\n\t\t\t\tUPDATE \r\n\t\t\t\t\t`sys_email_templates` \r\n\t\t\t\tSET \r\n\t\t\t\t\t`Subject` = '" . process_db_input($sTemplateSubj) . "',\r\n\t\t\t\t\t`Body` = '" . process_db_input($sTemplateBody) . "'\r\n\t\t\t\tWHERE \r\n\t\t\t\t\t`Name` = '" . process_db_input($sTemplateName) . "'\r\n\t\t\t\t\t\tAND\r\n\t\t\t\t\t`LangID` = '" . (int) $iLangID . "'\r\n\t\t\t\tLIMIT 1 \r\n\t\t\t";
$sMessage = 'Template was updated';
}
db_res($sQuery);
return $this->genTemplatesForm($sTemplateName, $iLangID, $sMessage);
}
示例7: GenStoredMemIPs
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();
}
示例8: GenStoredMemIPs
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();
}
示例9: getFileIdByUri
function getFileIdByUri($sFileName, $sType = '')
{
$sFileName = process_db_input($sFileName);
switch ($sType) {
case 'photo':
$sqlQuery = "SELECT `medID` FROM `sharePhotoFiles` WHERE `medUri`='{$sFileName}'";
break;
case 'music':
$sqlQuery = "SELECT `ID` FROM `RayMusicFiles` WHERE `Uri`='{$sFileName}'";
break;
case 'video':
$sqlQuery = "SELECT `ID` FROM `RayMovieFiles` WHERE `Uri`='{$sFileName}'";
break;
default:
break;
}
return (int) db_value($sqlQuery);
}
示例10: response
function response($o)
{
$sProfileStatus = null;
$iProfileId = $o->iObject;
if ($iProfileId) {
$sProfileStatus = db_value("\n SELECT\n `Status`\n FROM\n `Profiles`\n WHERE\n `ID` = {$iProfileId}\n ");
}
if ($sProfileStatus == 'Active') {
if ('profile' == $o->sUnit) {
switch ($o->sAction) {
case 'join':
case 'edit':
case 'delete':
// clean cache
$GLOBALS['MySQL']->cleanCache('sys_browse_people');
break;
}
}
}
}
示例11: actionRSS
function actionRSS()
{
$sType = process_db_input($_REQUEST['action'], BX_TAGS_STRIP);
$iLength = (int) $_REQUEST['length'];
if (strncmp($sType, 'sys_', 4) === 0) {
$aRssTitle = '';
$aRssData = array();
switch ($sType) {
case 'sys_stats':
$aRssTitle = getParam('site_title');
$oCache = $GLOBALS['MySQL']->getDbCacheObject();
$aStats = $oCache->getData($GLOBALS['MySQL']->genDbCacheKey('sys_stat_site'));
if (null === $aStats) {
genSiteStatCache();
$aStats = $oCache->getData($GLOBALS['MySQL']->genDbCacheKey('sys_stat_site'));
}
if ($aStats && is_array($aStats)) {
foreach ($aStats as $sKey => $aStat) {
$iNum = strlen($aStat['query']) > 0 ? db_value($aStat['query']) : 0;
$aRssData[] = array('UnitID' => $sKey, 'OwnerID' => '', 'UnitTitle' => $iNum . ' ' . _t('_' . $aStat['capt']), 'UnitLink' => strlen($aStat['link']) > 0 ? BX_DOL_URL_ROOT . $aStat['link'] : '', 'UnitDesc' => '', 'UnitDateTimeUTS' => 0, 'UnitIcon' => '');
}
}
break;
case 'sys_members':
$aRssTitle = getParam('site_title');
$iLength = $iLength != 0 ? $iLength : 33;
$aMembers = $GLOBALS['MySQL']->getAll("SELECT *, UNIX_TIMESTAMP(`DateReg`) AS `DateRegUTS` FROM `Profiles` WHERE 1 AND (`Couple`='0' OR `Couple`>`ID`) AND `Status`='Active' ORDER BY `DateReg` DESC LIMIT " . $iLength);
foreach ($aMembers as $aMember) {
$aRssData[] = array('UnitID' => '', 'OwnerID' => '', 'UnitTitle' => $aMember['NickName'], 'UnitLink' => getProfileLink($aMember['ID']), 'UnitDesc' => $GLOBALS['oFunctions']->getMemberAvatar($aMember['ID']), 'UnitDateTimeUTS' => $aMember['DateRegUTS'], 'UnitIcon' => '');
}
break;
case 'sys_news':
echo BxDolService::call('news', 'news_rss', array($iLength));
return;
}
$oRss = new BxDolRssFactory();
echo $oRss->GenRssByData($aRssData, $aRssTitle, '');
} else {
BxDolService::call($sType, $sType . '_rss', array());
}
}
示例12: putVote
function putVote($iId, $sIp, $iRate)
{
$sPre = $this->_aSystem['row_prefix'];
$sTable = $this->_aSystem['table_rating'];
//'A' prevent voting for own profile
if ($sTable == 'profile_rating' && (int) $_COOKIE['memberID'] == $iId) {
return;
}
//'A' prevent voting for own gallery pics
if ($sTable == 'media_rating' && (int) $_COOKIE['memberID'] == db_value("SELECT `med_prof_id` FROM `media` WHERE `med_id`='{$iId}'")) {
return;
}
if ($this->getOne("SELECT `{$sPre}id` FROM {$sTable} WHERE `{$sPre}id` = '{$iId}' LIMIT 1")) {
$ret = $this->query("UPDATE {$sTable} \tSET `{$sPre}rating_count` = `{$sPre}rating_count` + 1, `{$sPre}rating_sum` = `{$sPre}rating_sum` + '{$iRate}' WHERE `{$sPre}id` = '{$iId}'");
} else {
$ret = $this->query("INSERT INTO {$sTable} SET `{$sPre}id` = '{$iId}', `{$sPre}rating_count` = '1', `{$sPre}rating_sum` = '{$iRate}'");
}
if (!$ret) {
return $ret;
}
$sTable = $this->_aSystem['table_track'];
return $this->query("INSERT INTO {$sTable} SET `{$sPre}id` = '{$iId}', `{$sPre}ip` = '{$sIp}', `{$sPre}date` = NOW()");
}
示例13: getBlockCode_AccountControl
function getBlockCode_AccountControl()
{
global $oTemplConfig, $aPreValues;
//Labels
$sProfileStatusC = _t('_Profile status');
$sPresenceC = _t('_Presence');
$sMembershipC = _t('_Membership2');
$sLastLoginC = _t('_Last login');
$sRegistrationC = _t('_Registration');
$sEmailC = _t('_Email');
$sMembersC = ' ' . _t('_Members');
$sProfileC = _t('_Profile');
$sContentC = _t('_Content');
//--- General Info block ---//
$sProfileStatus = _t("__{$this->aMemberInfo['Status']}");
$sProfileStatusMess = '';
switch ($this->aMemberInfo['Status']) {
case 'Unconfirmed':
$sProfileStatusMess = _t("_ATT_UNCONFIRMED", $oTemplConfig->popUpWindowWidth, $oTemplConfig->popUpWindowHeight);
break;
case 'Approval':
$sProfileStatusMess = _t("_ATT_APPROVAL", $oTemplConfig->popUpWindowWidth, $oTemplConfig->popUpWindowHeight);
break;
case 'Active':
$sProfileStatusMess = _t("_ATT_ACTIVE", $this->aMemberInfo['ID'], $oTemplConfig->popUpWindowWidth, $oTemplConfig->popUpWindowHeight);
break;
case 'Rejected':
$sProfileStatusMess = _t("_ATT_REJECTED", $oTemplConfig->popUpWindowWidth, $oTemplConfig->popUpWindowHeight);
break;
case 'Suspended':
$sProfileStatusMess = _t("_ATT_SUSPENDED", $oTemplConfig->popUpWindowWidth, $oTemplConfig->popUpWindowHeight);
break;
}
$oForm = bx_instance('BxDolFormCheckerHelper');
$sMembStatus = GetMembershipStatus($this->aMemberInfo['ID']);
$sLastLogin = 'never';
if (!empty($this->aMemberInfo['DateLastLogin']) && $this->aMemberInfo['DateLastLogin'] != "0000-00-00 00:00:00") {
$sLastLoginTS = $oForm->_passDateTime($this->aMemberInfo['DateLastLogin']);
$sLastLogin = getLocaleDate($sLastLoginTS, BX_DOL_LOCALE_DATE);
}
$sRegistration = 'never';
if (!empty($this->aMemberInfo['DateReg']) && $this->aMemberInfo['DateReg'] != "0000-00-00 00:00:00") {
$sRegistrationTS = $oForm->_passDateTime($this->aMemberInfo['DateReg']);
$sRegistration = getLocaleDate($sRegistrationTS, BX_DOL_LOCALE_DATE);
}
//--- Presence block ---//
require_once BX_DIRECTORY_PATH_CLASSES . 'BxDolUserStatusView.php';
$oStatusView = new BxDolUserStatusView();
$sUserStatus = $oStatusView->getMemberMenuStatuses();
//--- Content block ---//
$aAccountCustomStatElements = $GLOBALS['MySQL']->fromCache('sys_account_custom_stat_elements', 'getAllWithKey', 'SELECT * FROM `sys_account_custom_stat_elements`', 'ID');
$aPQStatisticsElements = $GLOBALS['MySQL']->fromCache('sys_stat_member', 'getAllWithKey', 'SELECT * FROM `sys_stat_member`', 'Type');
$aCustomElements = array();
foreach ($aAccountCustomStatElements as $iID => $aMemberStats) {
$sUnparsedLabel = $aMemberStats['Label'];
$sUnparsedValue = $aMemberStats['Value'];
$sLabel = _t($sUnparsedLabel);
$sUnparsedValue = str_replace('__site_url__', BX_DOL_URL_ROOT, $sUnparsedValue);
//step 1 - replacements of keys
$sLblTmpl = '__l_';
$sTmpl = '__';
while (($iStartPos = strpos($sUnparsedValue, $sLblTmpl)) !== false) {
$iEndPos = strpos($sUnparsedValue, $sTmpl, $iStartPos + 1);
if ($iEndPos <= $iStartPos) {
break;
}
$sSubstr = substr($sUnparsedValue, $iStartPos + strlen($sLblTmpl), $iEndPos - $iStartPos - strlen($sLblTmpl));
$sKeyValue = mb_strtolower(_t('_' . $sSubstr));
$sUnparsedValue = str_replace($sLblTmpl . $sSubstr . $sTmpl, $sKeyValue, $sUnparsedValue);
}
//step 2 - replacements of Stat keys
while (($iStartPos = strpos($sUnparsedValue, $sTmpl, 0)) !== false) {
$iEndPos = strpos($sUnparsedValue, $sTmpl, $iStartPos + 1);
if ($iEndPos <= $iStartPos) {
break;
}
$iCustomCnt = 0;
$sSubstr = process_db_input(substr($sUnparsedValue, $iStartPos + strlen($sTmpl), $iEndPos - $iStartPos - strlen($sTmpl)), BX_TAGS_STRIP);
if ($sSubstr) {
$sCustomSQL = $aPQStatisticsElements[$sSubstr]['SQL'];
$sCustomSQL = str_replace('__member_id__', $this->aMemberInfo['ID'], $sCustomSQL);
$sCustomSQL = str_replace('__profile_media_define_photo__', _t('_ProfilePhotos'), $sCustomSQL);
$sCustomSQL = str_replace('__profile_media_define_music__', _t('_ProfileMusic'), $sCustomSQL);
$sCustomSQL = str_replace('__profile_media_define_video__', _t('_ProfileVideos'), $sCustomSQL);
$sCustomSQL = str_replace('__member_nick__', process_db_input($this->aMemberInfo['NickName'], BX_TAGS_NO_ACTION, BX_SLASHES_NO_ACTION), $sCustomSQL);
$iCustomCnt = $sCustomSQL != '' ? (int) db_value($sCustomSQL) : '';
}
$sUnparsedValue = str_replace($sTmpl . $sSubstr . $sTmpl, $iCustomCnt, $sUnparsedValue);
}
$sTrimmedLabel = trim($sUnparsedLabel, '_');
$aCustomElements[$sTrimmedLabel] = array('type' => 'custom', 'name' => $sTrimmedLabel, 'content' => '<b>' . $sLabel . ':</b> ' . $sUnparsedValue, 'colspan' => true);
}
$aForm = array('form_attrs' => array('action' => '', 'method' => 'post'), 'params' => array('remove_form' => true), 'inputs' => array('header1' => array('type' => 'block_header', 'caption' => $sProfileC, 'collapsable' => true), 'Info' => array('type' => 'custom', 'name' => 'Info', 'content' => get_member_thumbnail($this->aMemberInfo['ID'], 'none', true), 'colspan' => true), 'Status' => array('type' => 'custom', 'name' => 'Status', 'content' => '<b>' . $sProfileStatusC . ':</b> ' . $sProfileStatus . '<br />' . $sProfileStatusMess, 'colspan' => true), 'Email' => array('type' => 'custom', 'name' => 'Email', 'content' => '<b>' . $sEmailC . ':</b> ' . $this->aMemberInfo['Email'] . '<br />' . _t('_sys_txt_ac_manage_subscriptions'), 'colspan' => true), 'Membership' => array('type' => 'custom', 'name' => 'Membership', 'content' => '<b>' . $sMembershipC . ':</b> ' . $sMembStatus, 'colspan' => true), 'LastLogin' => array('type' => 'custom', 'name' => 'LastLogin', 'content' => '<b>' . $sLastLoginC . ':</b> ' . $sLastLogin, 'colspan' => true), 'Registration' => array('type' => 'custom', 'name' => 'Registration', 'content' => '<b>' . $sRegistrationC . ':</b> ' . $sRegistration, 'colspan' => true), 'header1_end' => array('type' => 'block_end'), 'header2' => array('type' => 'block_header', 'caption' => $sPresenceC, 'collapsable' => true, 'collapsed' => true, 'attrs' => array('id' => 'user_status_ac')), 'UserStatus' => array('type' => 'custom', 'name' => 'Info', 'content' => $sUserStatus, 'colspan' => true), 'header2_end' => array('type' => 'block_end')));
//custom
if (!empty($aCustomElements)) {
$aForm['inputs'] = array_merge($aForm['inputs'], array('header5' => array('type' => 'block_header', 'caption' => $sContentC, 'collapsable' => true, 'collapsed' => true)), $aCustomElements, array('header5_end' => array('type' => 'block_end')));
}
$oForm = new BxTemplFormView($aForm);
$sContent = $GLOBALS['oSysTemplate']->parseHtmlByName('member_account_control.html', array('content' => $oForm->getCode()));
return array($sContent, array(), array(), false);
//.........这里部分代码省略.........
示例14: getUserMedia
function getUserMedia($ID, $sType = '')
{
switch ($sType) {
case 'video':
break;
case 'audio':
$sAct = " AND `Owner`='{$ID}'";
$sPas = " AND `Owner`='{$ID}'";
$sqlAct = "SELECT COUNT(*) as `Num` FROM `RayMp3Files` WHERE 1 {$sAct}";
//$sqlPas = "SELECT COUNT(*) as `Num` FROM `RayMp3Files` WHERE 1 $sPas";
$sqlPas = "SELECT COUNT(*) as `Num` FROM `RayMp3Files` WHERE 0";
$sHrefA = 'post_mod_audio.php?iUser=' . $ID;
$sHrefP = 'post_mod_audio.php?iUser=' . $ID;
break;
case 'photo':
$sAct = " AND `med_status`='active' AND `med_prof_id`='{$ID}'";
$sPas = " AND `med_status`='passive' AND `med_prof_id`='{$ID}'";
$sqlAct = "SELECT COUNT(*) as `Num` FROM `media` WHERE `med_type`='{$sType}' {$sAct}";
$sqlPas = "SELECT COUNT(*) as `Num` FROM `media` WHERE `med_type`='{$sType}' {$sPas}";
$sHrefA = 'post_mod_photos.php?media=photo&status=active&iUser=' . $ID;
$sHrefP = 'post_mod_photos.php?media=photo&status=passive&iUser=' . $ID;
break;
case 'bg':
$sqlAct = "SELECT COUNT(*) as `Num` FROM `ProfilesSettings` WHERE `IDmember`='{$ID}' AND `Status`='Active' AND `BackgroundFilename`<>''";
$sqlPas = "SELECT COUNT(*) as `Num` FROM `ProfilesSettings` WHERE `IDmember`='{$ID}' AND (`Status` IS NULL OR `Status`<>'Active') AND `BackgroundFilename`<>''";
$sHrefA = 'post_mod_profiles.php?iUser=' . $ID . '&status=active';
$sHrefP = 'post_mod_profiles.php?iUser=' . $ID;
break;
}
$sActPart = db_value($sqlAct) > 0 ? '<div class="activeMedia"><a href="' . $sHrefA . '">' . db_value($sqlAct) . '</a></div>' : '';
$sPasPart = strlen($sqlPas) && db_value($sqlPas) > 0 ? '<div class="passiveMedia"><a href="' . $sHrefP . '">' . db_value($sqlPas) . '</a></div>' : '';
return $sActPart . $sPasPart;
}
示例15: isset
break;
case isset($_POST['action_approve']):
$iOldID = (int) $iCrss;
$sRSSSQL = "UPDATE `bx_crss_main` SET `status`='active' WHERE `ID`='{$iOldID}'";
db_res($sRSSSQL);
break;
case isset($_POST['action_disapprove']):
$iOldID = (int) $iCrss;
$sRSSSQL = "UPDATE `bx_crss_main` SET `status`='passive' WHERE `ID`='{$iOldID}'";
db_res($sRSSSQL);
break;
}
}
}
///////////////pagination/////////////////////
$iTotalNum = db_value("SELECT COUNT(*) FROM `bx_crss_main` WHERE `ProfileID`>0");
if (!$iTotalNum) {
$sRSSs .= MsgBox(_t('_Empty'));
}
$iPerPage = (int) bx_get('per_page');
if (!$iPerPage) {
$iPerPage = 10;
}
$iCurPage = (int) bx_get('page');
if ($iCurPage < 1) {
$iCurPage = 1;
}
$sLimitFrom = ($iCurPage - 1) * $iPerPage;
$aSqlQuery = "LIMIT {$sLimitFrom}, {$iPerPage}";
///////////////eof pagination/////////////////////
$aManage = array('medID', 'medProfId', 'medTitle', 'medUri', 'medDate', 'medViews', 'medExt', 'Approved');