コード例 #1
0
 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 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
0
ファイル: BxAdsDb.php プロジェクト: toxalot/dolphin.pro
 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
0
ファイル: forgot.php プロジェクト: Gotgot59/dolphin.pro
 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
0
ファイル: forgot.php プロジェクト: dalinhuang/shopexts
 function checkEmail($s)
 {
     if (!preg_match('/^[a-z0-9_\\-]+(\\.[_a-z0-9\\-]+)*@([_a-z0-9\\-]+\\.)+([a-z]{2}|aero|arpa|asia|biz|cat|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|net|org|pro|tel|travel)$/i', $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;
 }
コード例 #6
0
 /**
  * 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);
 }
コード例 #7
0
 /**
  * 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);
 }
コード例 #8
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();
    }
コード例 #9
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();
    }
コード例 #10
0
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);
}
コード例 #11
0
 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;
             }
         }
     }
 }
コード例 #12
0
ファイル: rss_factory.php プロジェクト: boonex/dolphin.pro
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());
    }
}
コード例 #13
0
 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()");
 }
コード例 #14
0
 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 = '******';
     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);
 }
コード例 #15
0
function getUserMedia($ID, $sType = '')
{
    switch ($sType) {
        case 'video':
            break;
        case 'audio':
            $sAct = " AND `Owner`='{$ID}'";
            $sPas = "******";
            $sqlAct = "SELECT COUNT(*) as `Num` FROM `RayMp3Files` WHERE 1 {$sAct}";
            //$sqlPas  = "******";
            $sqlPas = "******";
            $sHrefA = 'post_mod_audio.php?iUser='******'post_mod_audio.php?iUser='******'photo':
            $sAct = " AND `med_status`='active' AND `med_prof_id`='{$ID}'";
            $sPas = "******";
            $sqlAct = "SELECT COUNT(*) as `Num` FROM `media` WHERE `med_type`='{$sType}' {$sAct}";
            $sqlPas = "******";
            $sHrefA = 'post_mod_photos.php?media=photo&status=active&iUser='******'post_mod_photos.php?media=photo&status=passive&iUser='******'bg':
            $sqlAct = "SELECT COUNT(*) as `Num` FROM `ProfilesSettings` WHERE `IDmember`='{$ID}' AND `Status`='Active' AND `BackgroundFilename`<>''";
            $sqlPas = "******";
            $sHrefA = 'post_mod_profiles.php?iUser='******'&status=active';
            $sHrefP = 'post_mod_profiles.php?iUser='******'<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;
}
コード例 #16
0
                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');
コード例 #17
0
 function getLatestFile()
 {
     $aWhere[] = "1";
     foreach ($this->aCurrent['restriction'] as $sKey => $aValue) {
         if (isset($aValue['value'])) {
             switch ($sKey) {
                 case 'featured':
                 case 'owner':
                     if ((int) $aValue['value'] != 0) {
                         $aWhere[] = "`{$this->aCurrent['table']}`.`{$aValue['field']}` = '" . (int) $aValue['value'] . "'";
                     }
                     break;
                 case 'category':
                 case 'tag':
                     if (strlen($aValue['value']) > 0) {
                         $aWhere[] = "MATCH(`{$this->aCurrent['table']}`.`{$aValue['field']}`) AGAINST ('" . trim(process_db_input($aValue['value'], BX_TAGS_STRIP)) . "')";
                     }
                     break;
                 case 'allow_view':
                     if (is_array($aValue['value'])) {
                         $sqlJoin = "LEFT JOIN `sys_albums_objects` ON `sys_albums_objects`.`id_object`=`{$this->aCurrent['table']}`.`{$this->aCurrent['ident']}`\n                                        LEFT JOIN `sys_albums` ON `sys_albums_objects`.`id_album`=`sys_albums`.`ID`\n                            ";
                         $sqlCode = "`AllowAlbumView` IN(";
                         foreach ($aValue['value'] as $sValue) {
                             $sqlCode .= "{$sValue}, ";
                         }
                         $aWhere[] = rtrim($sqlCode, ", ") . ')';
                     }
                     break;
             }
         }
     }
     $sqlWhere = "WHERE " . implode(' AND ', $aWhere) . " AND `{$this->aCurrent['table']}`.`Status`= 'approved'";
     $sqlQuery = "SELECT `{$this->aCurrent['table']}`.`{$this->aCurrent['ident']}` as `{$this->aCurrent['ident']}` FROM `{$this->aCurrent['table']}` {$sqlJoin} {$sqlWhere} ORDER BY `{$this->aCurrent['ident']}` DESC LIMIT 1";
     $iFileId = db_value($sqlQuery);
     $sCode = '';
     if ($iFileId != 0) {
         $this->oTemplate->addCss('view.css');
         $oRate = new BxTemplVotingView($this->aCurrent['name'], $aInfo['medID']);
         $aInfo = $this->oModule->_oDb->getFileInfo(array('fileId' => $iFileId));
         $aDraw = array('file' => $this->oTemplate->getFileConcept($aInfo['medID'], array('ext' => $aInfo['medExt'], 'source' => $aInfo['medSource'])), 'file_url' => $this->getCurrentUrl('file', $aInfo['medID'], $aInfo['medUri']), 'title' => $aInfo['medTitle'], 'rate' => $oRate->getSmallVoting(0), 'date' => defineTimeInterval($aInfo['medDate']), 'owner_url' => getProfileLink($aInfo['medProfId']), 'owner_nick' => getNickName($aInfo['medProfId']));
         $sCode = $this->oTemplate->parseHtmlByName('latest_file.html', $aDraw);
     }
     return $sCode;
 }
コード例 #18
0
<?php

require_once './inc/header.inc.php';
require_once './inc/db.inc.php';
require_once './inc/profiles.inc.php';
$sQuery = "SELECT `Content` FROM `PageCompose` WHERE `ID` = " . (int) $_GET['ID'];
$sCont = db_value($sQuery);
if (!$sCont) {
    exit;
}
list($sUrl) = explode('#', $sCont);
$sUrl = str_replace('{SiteUrl}', $site['url'], $sUrl);
$iMemID = (int) $_GET['member'];
if ($iMemID) {
    $aMember = getProfileInfo($iMemID);
    $sUrl = str_replace('{NickName}', $aMember['NickName'], $sUrl);
}
header('Content-Type: text/xml');
readfile($sUrl);
コード例 #19
0
ファイル: utils.inc.php プロジェクト: blas-dmx/dolphin.pro
function bx_member_ip_get_last($iMemberId)
{
    $sLongIP = db_value("SELECT `From` FROM `sys_ip_members_visits` WHERE `MemberID` = " . (int) $iMemberId . " ORDER BY `DateTime` DESC");
    return long2ip($sLongIP);
}
コード例 #20
0
ファイル: BxDolPFM.php プロジェクト: Arvindvi/dolphin
 function updateLangString($sKey, $sString)
 {
     if ($sKey == '') {
         return false;
     }
     $sKey_db = addslashes($sKey);
     $sString_db = addslashes($sString);
     $sQuery = "SELECT `ID` FROM `sys_localization_keys` WHERE `Key` = '{$sKey_db}'";
     $iKeyID = (int) db_value($sQuery);
     if (!$iKeyID) {
         //create key
         $sQuery = "INSERT INTO `sys_localization_keys` (`IDCategory`,`Key`) VALUES (32,'{$sKey_db}')";
         db_res($sQuery);
         $iKeyID = db_last_id();
     }
     $sQuery = "\n            SELECT COUNT( * ) FROM `sys_localization_strings`\n            WHERE `IDKey` = {$iKeyID} AND `IDLanguage` = {$this->sLangID}";
     $iCount = (int) db_value($sQuery);
     if ($iCount) {
         $sQuery = "\n                UPDATE `sys_localization_strings`\n                SET `String` = '{$sString_db}'\n                WHERE `IDKey` = {$iKeyID} AND `IDLanguage` = {$this->sLangID}";
         db_res($sQuery);
     } else {
         $sQuery = "INSERT INTO `sys_localization_strings` VALUES ( {$iKeyID}, {$this->sLangID}, '{$sString_db}' )";
         db_res($sQuery);
     }
     compileLanguage($this->sLangID);
 }
コード例 #21
0
ファイル: BxAvaModule.php プロジェクト: noormcs/studoro
 /**
  * After join redirection
  * This serice automatically log in joined user and redirects him to avatar copping page
  * @param $iMemID - joined profile ID
  * @param $sStatusText - status text to display at the top of page, like 'join success'
  * @return false on error,  'EXIT' string on success
  */
 function serviceJoin($iMemID, $sStatusText)
 {
     $sPwd = db_value("SELECT `Password` FROM `Profiles` WHERE `ID` = '" . (int) $iMemID . "' LIMIT 1");
     if ($sPwd) {
         bx_login((int) $iMemID);
         // autologin here
         bx_import('BxDolPermalinks');
         $o = new BxDolPermalinks();
         header('Location: ' . BX_DOL_URL_ROOT . $o->permalink('modules/?r=avatar/') . '&join_text=' . $sStatusText);
         // redirect to upload avatar page
         return 'EXIT';
     }
     return false;
 }
コード例 #22
0
 function genUniqueValue($sFieldName, $sValue, $bRandMore = false)
 {
     if ($bRandMore) {
         $sRand = '(' . rand(1000, 9999) . ')';
     } else {
         $sRand = '(2)';
     }
     $sNewValue = $sValue . $sRand;
     $iCount = (int) db_value("SELECT COUNT(*) FROM `Profiles` WHERE `{$sFieldName}` = {$GLOBALS['MySQL']->escape($sNewValue)}");
     if ($iCount) {
         return genUniqueValue($sFieldName, $sValue, true);
     } else {
         return $sNewValue;
     }
 }
コード例 #23
0
 function checkPostValueForUnique($aItem, $mValue, $iHuman, $iProfileID)
 {
     global $logged;
     if (!$aItem['Unique']) {
         return true;
     }
     $iProfileID = (int) $iProfileID;
     if ($iProfileID) {
         $sAdd = "AND `ID` != {$iProfileID}";
     } else {
         $sAdd = '';
     }
     $mValue_db = $GLOBALS['MySQL']->escape($mValue);
     $sQuery = "SELECT COUNT(*) FROM `Profiles` WHERE `{$aItem['Name']}` = '{$mValue_db}' {$sAdd}";
     if ((int) db_value($sQuery)) {
         return false;
     }
     return true;
 }
コード例 #24
0
ファイル: get_rss_feed.php プロジェクト: dalinhuang/shopexts
<?php

require_once '../../../inc/header.inc.php';
require_once BX_DIRECTORY_PATH_INC . 'db.inc.php';
$sMemberRSSSQL = "SELECT `RSSUrl` FROM `bx_crss_main` WHERE `ID`='" . (int) bx_get('ID') . "' AND `Status`='active'";
$sCont = db_value($sMemberRSSSQL);
if (!$sCont) {
    exit;
}
$sUrl = $sCont;
header('Content-Type: text/xml');
readfile($sUrl);
コード例 #25
0
function getSiteStat($sMode = '')
{
    global $site;
    $iMin = getParam("member_online_time");
    $aStat = array('all' => array('capt' => _t("_Members"), 'query' => "SELECT COUNT(`ID`) FROM `Profiles` WHERE `Status` = 'Active'", 'link' => 'browse.php', 'adm_query' => "", 'adm_link' => "profiles.php"), 'pph' => array('capt' => _t("_Photos"), 'query' => "SELECT COUNT(`medID`) FROM `sharePhotoFiles` WHERE `Approved`='true'", 'link' => 'browsePhoto.php', 'adm_query' => "", 'adm_link' => ""), 'evs' => array('capt' => _t("_Events"), 'query' => "SELECT COUNT(`ID`) FROM `SDatingEvents` WHERE `Status`='Active'", 'link' => 'events.php?show_events=all&action=show', 'adm_query' => "", 'adm_link' => ""), 'onl' => array('capt' => _t("_Online"), 'query' => "SELECT COUNT(`ID`) AS `count_onl` FROM `Profiles`  WHERE `LastNavTime` > SUBDATE(NOW(), INTERVAL {$iMin} MINUTE)", 'link' => 'search_result.php?online_only=1', 'adm_query' => "", 'adm_link' => ""), 'pvi' => array('capt' => _t("_Videos"), 'query' => "SELECT COUNT(`ID`) FROM `RayMovieFiles` WHERE `Approved`='true'", 'link' => 'browseVideo.php', 'adm_query' => "", 'adm_link' => ""), 'pls' => array('capt' => _t("_Polls"), 'query' => "SELECT COUNT(`id_poll`) FROM `ProfilesPolls` WHERE `poll_approval`='1'", 'link' => 'polls.php', 'adm_query' => "", 'adm_link' => ""), 'ntd' => array('capt' => _t("_New Today"), 'query' => "SELECT COUNT(`ID`) FROM `Profiles` WHERE `Status` = 'Active' AND (TO_DAYS(NOW()) - TO_DAYS(`LastReg`)) <= 1", 'link' => '', 'adm_query' => "", 'adm_link' => ""), 'pmu' => array('capt' => _t("_Music"), 'query' => "SELECT COUNT(`ID`) FROM `RayMusicFiles` WHERE `Approved`='true'", 'link' => 'browseMusic.php', 'adm_query' => "", 'adm_link' => ""), 'tps' => array('capt' => _t("_Topics"), 'query' => "SELECT IF( NOT ISNULL( SUM(`forum_topics`)), SUM(`forum_posts`), 0) AS `Num` FROM `pre_forum`", 'link' => 'orca', 'adm_query' => "", 'adm_link' => ""), 'nwk' => array('capt' => _t("_This Week"), 'query' => "SELECT COUNT(`ID`) FROM `Profiles` WHERE `Status` = 'Active' AND (TO_DAYS(NOW()) - TO_DAYS(`LastReg`)) <= 7", 'link' => '', 'adm_query' => "", 'adm_link' => ""), 'pvd' => array('capt' => _t("_Profile Videos"), 'query' => "SELECT `Approved` FROM `RayVideoStats`", 'link' => '', 'adm_query' => "", 'adm_link' => "", 'hide' => false), 'pts' => array('capt' => _t("_Posts"), 'query' => "SELECT IF( NOT ISNULL( SUM(`forum_posts`)), SUM(`forum_posts`), 0) AS `Num` FROM `pre_forum` ", 'link' => 'orca', 'adm_query' => "", 'adm_link' => ""), 'nmh' => array('capt' => _t("_This Month"), 'query' => "SELECT COUNT(`ID`) FROM `Profiles` WHERE `Status` = 'Active' AND (TO_DAYS(NOW()) - TO_DAYS(`LastReg`)) <= 30", 'link' => '', 'adm_query' => "", 'adm_link' => ""), 'tgs' => array('capt' => _t("_Tags"), 'query' => "SELECT COUNT( DISTINCT `Tag` ) FROM `Tags`", 'link' => '', 'adm_query' => "", 'adm_link' => ""), 'ars' => array('capt' => _t("_Articles"), 'query' => "SELECT COUNT(`ArticlesID`) FROM `Articles`", 'link' => 'articles.php', 'adm_query' => "", 'adm_link' => ""), 'nyr' => array('capt' => _t("_This Year"), 'query' => "SELECT COUNT(`ID`) FROM `Profiles` WHERE `Status` = 'Active' AND (TO_DAYS(NOW()) - TO_DAYS(`LastReg`)) <= 365", 'link' => '', 'adm_query' => "", 'adm_link' => ""), 'grs' => array('capt' => _t("_Groups"), 'query' => "SELECT COUNT(`ID`) FROM `Groups` WHERE `status`='Active'", 'link' => 'groups_home.php', 'adm_query' => "", 'adm_link' => ""), 'cls' => array('capt' => _t("_Classifieds"), 'query' => "SELECT COUNT(`ID`) FROM `ClassifiedsAdvertisements` WHERE `Status`='active'", 'link' => 'classifieds.php?Browse=1', 'adm_query' => "", 'adm_link' => ""), 'frs' => array('capt' => _t("_Friends"), 'query' => "SELECT COUNT(`ID`) FROM `FriendList` WHERE `Check`='1'", 'link' => '', 'adm_query' => "", 'adm_link' => ""));
    if ($sMode == 'admin') {
        $aAdmin = array('all' => array('adm_query' => "SELECT COUNT(`ID`) FROM `Profiles` WHERE `Status`!='Active'", 'adm_link' => 'profiles.php?profiles=Approval'), 'pph' => array('adm_query' => "SELECT COUNT(`medID`) FROM `sharePhotoFiles` WHERE `Approved`='false'", 'adm_link' => 'browsePhoto.php'), 'evs' => array('adm_query' => "SELECT COUNT(`ID`) FROM `SDatingEvents` WHERE `Status`!='Active'", 'adm_link' => 'sdating_admin.php'), 'onl' => array('adm_query' => "", 'adm_link' => ''), 'pvi' => array('adm_query' => "SELECT COUNT(`ID`) FROM `RayMovieFiles` WHERE `Approved`!='true'", 'adm_link' => 'browseVideo.php'), 'pls' => array('adm_query' => "SELECT COUNT(`id_poll`) FROM `ProfilesPolls` WHERE `poll_approval`!='1'", 'adm_link' => 'post_mod_ppolls.php'), 'ntd' => array('adm_query' => "", 'adm_link' => ''), 'pmu' => array('adm_query' => "SELECT COUNT(`ID`) FROM `RayMusicFiles` WHERE `Approved`!='true'", 'adm_link' => 'browseMusic.php'), 'tps' => array('adm_query' => "", 'adm_link' => ''), 'nwk' => array('adm_query' => "", 'adm_link' => ''), 'tgs' => array('adm_query' => "", 'adm_link' => ''), 'pts' => array('adm_query' => "", 'adm_link' => ''), 'nmh' => array('adm_query' => "", 'adm_link' => ''), 'frs' => array('adm_query' => "", 'adm_link' => ''), 'ars' => array('adm_query' => "", 'adm_link' => 'articles.php'), 'nyr' => array('adm_query' => "", 'adm_link' => ''), 'grs' => array('adm_query' => "SELECT COUNT(`ID`) FROM `Groups` WHERE `status`!='Active'", 'adm_link' => 'groups.php'), 'cls' => array('adm_query' => "SELECT COUNT(`ID`) FROM `ClassifiedsAdvertisements` WHERE `Status` != 'active'", 'adm_link' => 'manage_classifieds.php'), 'pvd' => array('adm_query' => "", 'adm_link' => 'javascript: openRayWidget(\'video\',\'admin\',\'{adminLogin}\',\'{adminPass}\');'));
        $sAdd = '_a';
        $sProfVideo = getApplicationContent('video', 'stat', array(), true);
    } else {
        $aAdmin = '';
        $sProfVideo = '';
    }
    $sCode = $sProfVideo . '<div>';
    foreach ($aStat as $sKey => $sVal) {
        $sLink = strlen($sVal['link']) > 0 ? '<a href="' . $site['url'] . $sVal['link'] . '">' . $sVal['capt'] . '</a>' : $sVal['capt'];
        if ($sVal['hide'] === true && $sMode != 'admin') {
            continue;
        }
        if (!is_array($aAdmin)) {
            $iNum = strlen($sVal['query']) > 0 ? db_value($sVal['query']) : 0;
            if ($sKey == 'pls') {
                $iNum = $iNum + db_value("SELECT COUNT(`ID`) FROM `polls_q` WHERE `Active`='on'");
            }
        } else {
            $iNum = strlen($aAdmin[$sKey]['adm_query']) > 0 ? db_value($aAdmin[$sKey]['adm_query']) : 0;
            if (strlen($aAdmin[$sKey]['adm_link']) > 0) {
                if (substr($aAdmin[$sKey]['adm_link'], 0, strlen('javascript:')) == 'javascript:') {
                    $sHref = 'javascript:void(0);';
                    $sOnclick = 'onclick="' . $aAdmin[$sKey]['adm_link'] . '"';
                    $aAdmin = db_arr("SELECT * FROM `Admins` LIMIT 1");
                    $sOnclick = str_replace('{adminLogin}', $aAdmin['Name'], $sOnclick);
                    $sOnclick = str_replace('{adminPass}', $aAdmin['Password'], $sOnclick);
                } else {
                    $sHref = $aAdmin[$sKey]['adm_link'];
                    $sOnclick = '';
                }
                $sLink = '<a href="' . $sHref . '" ' . $sOnclick . '>' . $sVal['capt'] . '</a>';
            } else {
                $sLink = $sVal['capt'];
            }
            if ($sKey == 'pls') {
                $iNum = $iNum + db_value("SELECT COUNT(`ID`) FROM `polls_q` WHERE `Active`<>'on'");
            }
        }
        switch ($sKey) {
            case 'all':
            case 'onl':
            case 'ntd':
            case 'nwk':
            case 'nmh':
            case 'nyr':
                $sIcon = 'mbs.gif';
                break;
            case 'all':
                $sIcon = 'us.gif';
                break;
            case 'pvi':
            case 'pvd':
                $sIcon = 'pvi.gif';
                break;
            default:
                $sIcon = $sKey . '.gif';
        }
        $sCode .= '<div class="siteStatUnit" id="' . $sKey . $sAdd . '"><img src="' . getTemplateIcon($sIcon) . '" /> ' . $iNum . ' ' . $sLink . '</div>';
    }
    $sCode .= '</div><div class="clear_both"></div>';
    return $sCode;
}
コード例 #26
0
 function getSiteStatBody($aVal, $sMode = '')
 {
     $sLink = strlen($aVal['link']) > 0 ? '<a href="' . BX_DOL_URL_ROOT . $aVal['link'] . '">{iNum} ' . _t('_' . $aVal['capt']) . '</a>' : '{iNum} ' . _t('_' . $aVal['capt']);
     if ($sMode != 'admin') {
         $sBlockId = '';
         $iNum = strlen($aVal['query']) > 0 ? db_value($aVal['query']) : 0;
     } else {
         $sBlockId = "id='{$aVal['name']}'";
         $iNum = strlen($aVal['adm_query']) > 0 ? db_value($aVal['adm_query']) : 0;
         if (strlen($aVal['adm_link']) > 0) {
             if (substr($aVal['adm_link'], 0, strlen('javascript:')) == 'javascript:') {
                 $sHref = 'javascript:void(0);';
                 $sOnclick = 'onclick="' . $aVal['adm_link'] . '"';
             } else {
                 $sHref = $aVal['adm_link'];
                 $sOnclick = '';
             }
             $sLink = '<a href="' . $sHref . '" ' . $sOnclick . '>{iNum} ' . _t('_' . $aVal['capt']) . '</a>';
         } else {
             $sLink = '{iNum} ' . _t('_' . $aVal['capt']);
         }
     }
     $sLink = str_replace('{iNum}', $iNum, $sLink);
     $sImg = false === strpos($aVal['icon'], '.') ? '<i class="sys-icon ' . $aVal['icon'] . '"></i>' : '<img src="' . getTemplateIcon($aVal['icon']) . '" alt="" />';
     $sCode = '
         <div class="siteStatUnit" ' . $sBlockId . '>
             ' . $sImg . $sLink . '
         </div>
     ';
     return $sCode;
 }
コード例 #27
0
 function getArticleCatUrl($iCategoryId)
 {
     global $sUrl;
     $iArticleId = (int) $iArticleId;
     if ($this->isPermalinkEnabled() && $this->bAdminMode == false) {
         $sCategoryUri = db_value("SELECT `CategoryUri` FROM `ArticlesCategory` WHERE `CategoryID`='{$iCategoryId}'");
         $sLinkUrl = $sUrl . 'articles/category/' . $sCategoryUri;
     } else {
         $sLinkUrl = $sUrl . 'articles.php?action=viewcategory&catID=' . $iCategoryId;
     }
     return $sLinkUrl;
 }
コード例 #28
0
/**
 * Generating Main page code
 *
 * @return ALL presentation of data
 */
function PageCompPageMainCode()
{
    $sRetHtml = '';
    global $oClassifieds;
    $oAPV = new BxDolAdPageView($oClassifieds);
    $oClassifieds->sCurrBrowsedFile = $_SERVER['PHP_SELF'];
    $sRetHtml .= $oClassifieds->PrintCommandForms();
    if ($_REQUEST) {
        //print functions
        if (isset($_REQUEST['action'])) {
            if ((int) $_REQUEST['action'] == 3) {
                $sRetHtml .= $oClassifieds->PrintFilterForm();
                $sRetHtml .= $oClassifieds->PrintFilteredAllAdvertisements();
            } elseif ((int) $_REQUEST['action'] == 2) {
                $iClassifiedSubID = (int) $_REQUEST['FilterSubCat'];
                //$iClassifiedSubID = ($oClassifieds->bUseFriendlyLinks) ? (int)db_value("SELECT `ID` FROM `ClassifiedsSubs` WHERE `ÑEntryUri`='" . $oClassifieds->process_html_db_input($_REQUEST['FilterCat']) . "' LIMIT 1") : (int)$_REQUEST['FilterSubCat'];
                $sRetHtml .= $oClassifieds->PrintSubRecords($iClassifiedSubID, TRUE);
            } elseif ((int) $_REQUEST['action'] == 1) {
                $iClassifiedID = (int) $_REQUEST['FilterCat'];
                //$iClassifiedID = ($oClassifieds->bUseFriendlyLinks) ? (int)db_value("SELECT `ID` FROM `Classifieds` WHERE `SEntryUri`='" . $oClassifieds->process_html_db_input($_REQUEST['SEntryUri']) . "' LIMIT 1") : (int)$_REQUEST['FilterCat'];
                $sRetHtml .= $oClassifieds->PrintAllSubRecords($iClassifiedID);
            } elseif ($_REQUEST['action'] == 'report') {
                $iCommentID = (int) $_REQUEST['commentID'];
                print $oClassifieds->GenReportSubmitForm($iCommentID);
                exit;
            } elseif ($_REQUEST['action'] == 'post_report') {
                print $oClassifieds->ActionReportSubmit();
                exit;
            }
        } elseif (isset($_GET['bClassifiedID']) and (int) $_GET['bClassifiedID'] > 0 or isset($_GET['catUri']) && $_GET['catUri'] != '') {
            //$iClassifiedID = (int)$_GET['bClassifiedID'];
            $iClassifiedID = $oClassifieds->bUseFriendlyLinks ? (int) db_value("SELECT `ID` FROM `Classifieds` WHERE `CEntryUri`='" . $oClassifieds->process_html_db_input($_REQUEST['catUri']) . "' LIMIT 1") : (int) $_REQUEST['bClassifiedID'];
            if ($iClassifiedID > 0) {
                $sRetHtml .= $oClassifieds->PrintFilterForm($iClassifiedID);
                $sRetHtml .= $oClassifieds->PrintAllSubRecords($iClassifiedID);
            }
        } elseif (isset($_GET['bSubClassifiedID']) and (int) $_GET['bSubClassifiedID'] > 0 or isset($_GET['scatUri']) && $_GET['scatUri'] != '') {
            //$iSubClassifiedID = (int)$_GET['bSubClassifiedID'];
            $iSubClassifiedID = $oClassifieds->bUseFriendlyLinks ? (int) db_value("SELECT `ID` FROM `ClassifiedsSubs` WHERE `SEntryUri`='" . $oClassifieds->process_html_db_input($_REQUEST['scatUri']) . "' LIMIT 1") : (int) $_REQUEST['bSubClassifiedID'];
            if ($iSubClassifiedID > 0) {
                $sRetHtml .= $oClassifieds->PrintFilterForm(0, $iSubClassifiedID);
                $sRetHtml .= $oClassifieds->PrintSubRecords($iSubClassifiedID, TRUE);
            }
        } elseif (isset($_REQUEST['ShowAdvertisementID']) && (int) $_REQUEST['ShowAdvertisementID'] > 0 or isset($_GET['entryUri']) && $_GET['entryUri'] != '') {
            //$id = (int)$_REQUEST['ShowAdvertisementID'];
            $id = $oClassifieds->bUseFriendlyLinks ? (int) db_value("SELECT `ID` FROM `ClassifiedsAdvertisements` WHERE `EntryUri`='" . $oClassifieds->process_html_db_input($_REQUEST['entryUri']) . "' LIMIT 1") : (int) $_REQUEST['ShowAdvertisementID'];
            /*$sRetHtml .=*/
            $oClassifieds->ActionPrintAdvertisement($id);
            $sRetHtml .= $oAPV->getCode();
        } elseif (isset($_GET['SearchForm'])) {
            if ((int) $_GET['SearchForm'] == 1) {
                $sRetHtml .= $oClassifieds->PrintFilterForm();
            }
        } elseif (isset($_REQUEST['UsersOtherListing'])) {
            $iProfileID = (int) $_REQUEST['IDProfile'];
            if ($iProfileID > -1) {
                $sRetHtml .= $oClassifieds->PrintMyAds($iProfileID);
            }
        } elseif (isset($_REQUEST['DeleteAdvertisementID'])) {
            $id = (int) $_REQUEST['DeleteAdvertisementID'];
            if ($id > 0) {
                $sRetHtml .= $oClassifieds->ActionDeleteAdvertisement($id);
            }
        } elseif (isset($_REQUEST['BuyNow'])) {
            $advId = (int) $_REQUEST['IDAdv'];
            if ($advId > 0) {
                $sRetHtml .= $oClassifieds->ActionBuyAdvertisement($advId);
            }
        } elseif (isset($_REQUEST['BuySendNow'])) {
            $advId = (int) $_REQUEST['IDAdv'];
            if ($advId > 0) {
                $sRetHtml .= $oClassifieds->ActionBuySendMailAdvertisement($advId);
            }
        } else {
            $sRetHtml .= $oClassifieds->PrintClassifieds();
        }
    } else {
        $sRetHtml .= $oClassifieds->PrintClassifieds();
    }
    return $sRetHtml;
}
コード例 #29
0
                break;
        }
    }
}
$aWhere = array();
$aWhere[] = '1';
if (isset($_GET['userID'])) {
    $iUser = (int) $_GET['userID'];
    $aWhere[] = "`a`.`medProfId`={$iUser}";
}
if (isset($_GET['tag'])) {
    $sTag = htmlspecialchars_adv($_GET['tag']);
    $aWhere[] = "`a`.`medTags` like '%{$sTag}%'";
}
$sqlWhere = "WHERE " . implode(', ', $aWhere);
$iTotalNum = db_value("SELECT COUNT( * ) FROM `Ray" . $sType . "Files` AS `a` {$sqlWhere}");
if (!$iTotalNum) {
    $sCode .= '<div>There is no files</div>';
}
$iPerPage = 10;
$iTotalPages = ceil($iTotalNum / $iPerPage);
$iCurPage = (int) $_GET['page'];
if ($iCurPage > $iTotalPages) {
    $iCurPage = $iTotalPages;
}
if ($iCurPage < 1) {
    $iCurPage = 1;
}
$sLimitFrom = ($iCurPage - 1) * $iPerPage;
$sqlOrder = " ORDER BY `medDate` DESC ";
$sqlLimit = "LIMIT {$sLimitFrom}, {$iPerPage}";
コード例 #30
0
        $sUnit = process_db_input($_GET["sUnit"]);
        $iIDcat = process_db_input($_GET["iIDcat"]);
        if (!empty($iIDcat)) {
            $query = "\r\n\t\t\t\tUPDATE `Classifieds` SET `Unit` = '\$' WHERE `Classifieds`.`ID` = {$iIDcat} LIMIT 1 ;\r\n\t\t\t";
            if (!empty($query)) {
                $resData = db_res($query);
            }
            exit;
        }
        break;
    case "login":
        $sUsername = process_db_input($_GET["u"]);
        $sPass = process_db_input($_GET["p"]);
        if (!empty($sUsername)) {
            $query = "\r\n\t\t\t\tSELECT `ID` FROM `Profiles` WHERE `NickName`='{$sUsername}' AND `Password`=MD5('{$sPass}') LIMIT 1 ;\r\n\t\t\t";
            db_value($query);
            if (mysql_affected_rows() == 0) {
                print 'failed';
            } else {
                print 'success';
            }
            exit;
        }
        break;
}
$resultNode = new XmlNode();
$resultNode->name = 'data';
if (!empty($AddItems) and $_GET["noadd"] != 1) {
    foreach ($AddItems as $key => $val) {
        $AddNode = new XmlNode();
        $AddNode->name = $dataType;