Changeset 9199


Ignore:
Timestamp:
Feb 17, 2009, 8:37:12 AM (16 years ago)
Author:
Andrey Prikaznov
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/member.php

    r9176 r9199  
    114114        $sSiteUrl = $GLOBALS['site']['url']; 
    115115     
    116         $free_mode = getParam("free_mode") == "on" ? 1 : 0; 
     116        //$bFreeMode = getParam("free_mode") == "on" ? 1 : 0; 
    117117 
    118118        $iChMemberID = 0; 
     
    185185        global $oTemplConfig; 
    186186     
    187         $free_mode = getParam("free_mode")  == "on" ? 1 : 0; 
     187        $iFreeMode = getParam("free_mode")  == "on" ? 1 : 0; 
    188188        $en_aff    = getParam("enable_aff") == 'on' ? 1 : 0; 
    189189     
     
    217217    <!-- Membership --> 
    218218     
    219     <?php if ( !$free_mode ) { ?> 
     219    <?php if ( !$iFreeMode ) { ?> 
    220220     
    221221    <tr class=table> 
     
    246246    <? 
    247247     
    248         if ( 0 == $free_mode && 1 == $en_aff ) 
     248        if ( 0 == $iFreeMode && 1 == $en_aff ) 
    249249        { 
    250250            echo "<tr class=table> 
     
    329329 
    330330        define('BX_DOL_ACCOUNTCUSTOMSTATELEMENTS_CACHE', 'AccountCustomStatElements.inc'); 
     331        define('BX_DOL_PQStATISTICSEMENTS_CACHE', 'PQStatistics.inc'); 
    331332 
    332333        //--- Load cache ---// 
     
    346347        } 
    347348 
    348         $free_mode = getParam("free_mode")  == "on" ? 1 : 0; 
    349         //$en_aff    = getParam("enable_aff") == 'on' ? 1 : 0; 
     349        //--- Load cache of PQStatistics ---// 
     350        $aPQStatisticsElements = array(); 
     351        $sCacheFile = BX_DIRECTORY_PATH_DBCACHE . BX_DOL_PQStATISTICSEMENTS_CACHE; 
     352        if(file_exists($sCacheFile) && filesize($sCacheFile)) { 
     353            $aPQStatisticsElements = unserialize(file_get_contents($sCacheFile)); 
     354        } else { 
     355            $vPQStatisticsElements = db_res("SELECT * FROM `PQStatistics` ORDER BY `Type` ASC"); 
     356 
     357            while($aACSElement = mysql_fetch_assoc($vPQStatisticsElements)) 
     358                $aPQStatisticsElements[$aACSElement['Type']] = $aACSElement['SQL']; 
     359 
     360            $rHandle = fopen($sCacheFile, 'w'); 
     361            fwrite($rHandle, serialize($aPQStatisticsElements)); 
     362            fclose($rHandle); 
     363        } 
     364 
     365        $iFreeMode = getParam("free_mode")  == "on" ? 1 : 0; 
    350366 
    351367        //Labels 
     
    384400 
    385401        $sMembership = ''; 
    386         if ( !$free_mode ) { 
     402        if ( !$iFreeMode ) { 
    387403            $sMembStatus = GetMembershipStatus($this->aMemberInfo['ID']); 
    388404            $sMembership = <<<EOF 
     
    407423 
    408424        //my mail new 
    409         $sMMNSQL = db_value("SELECT `SQL` FROM `PQStatistics` WHERE `Type`='mmn'"); //need cache all such SQLs 
     425        //$sMMNSQL = db_value("SELECT `SQL` FROM `PQStatistics` WHERE `Type`='mmn'"); //need cache all such SQLs 
     426        $sMMNSQL = $aPQStatisticsElements['mmn']; 
    410427        $sMMNSQL = str_replace('__member_id__', $this->aMemberInfo['ID'], $sMMNSQL); 
    411428        $iNewEmailsCnt = (int)db_value($sMMNSQL); 
    412429 
    413430        //my mail all 
    414         $sMMASQL = db_value("SELECT `SQL` FROM `PQStatistics` WHERE `Type`='mma'"); 
     431        //$sMMASQL = db_value("SELECT `SQL` FROM `PQStatistics` WHERE `Type`='mma'"); 
     432        $sMMASQL = $aPQStatisticsElements['mma']; 
    415433        $sMMASQL = str_replace('__member_id__', $this->aMemberInfo['ID'], $sMMASQL); 
    416434        $iAllEmailsCnt = (int)db_value($sMMASQL); 
    417435 
    418436        //my faved list 
    419         $sMFLSQL = db_value("SELECT `SQL` FROM `PQStatistics` WHERE `Type`='mfl'"); 
     437        //$sMFLSQL = db_value("SELECT `SQL` FROM `PQStatistics` WHERE `Type`='mfl'"); 
     438        $sMFLSQL = $aPQStatisticsElements['mfl']; 
    420439        $sMFLSQL = str_replace('__member_id__', $this->aMemberInfo['ID'], $sMFLSQL); 
    421440        $iFavedContactsCnt = (int)db_value($sMFLSQL); 
    422441 
    423442        //my friend requests 
    424         $sMFRSQL = db_value("SELECT `SQL` FROM `PQStatistics` WHERE `Type`='mfr'"); 
     443        //$sMFRSQL = db_value("SELECT `SQL` FROM `PQStatistics` WHERE `Type`='mfr'"); 
     444        $sMFRSQL = $aPQStatisticsElements['mfr']; 
    425445        $sMFRSQL = str_replace('__member_id__', $this->aMemberInfo['ID'], $sMFRSQL); 
    426446        $iFriendRequestsCnt = (int)db_value($sMFRSQL); 
    427447 
    428448        //my friends all 
    429         $sMFASQL = db_value("SELECT `SQL` FROM `PQStatistics` WHERE `Type`='mfa'"); 
     449        //$sMFASQL = db_value("SELECT `SQL` FROM `PQStatistics` WHERE `Type`='mfa'"); 
     450        $sMFASQL = $aPQStatisticsElements['mfa']; 
    430451        $sMFASQL = str_replace('__member_id__', $this->aMemberInfo['ID'], $sMFASQL); 
    431452        $iFriendsCnt = (int)db_value($sMFASQL); 
    432453 
    433454        //my greeted contacts 
    434         $sMGCSQL = db_value("SELECT `SQL` FROM `PQStatistics` WHERE `Type`='mgc'"); 
     455        //$sMGCSQL = db_value("SELECT `SQL` FROM `PQStatistics` WHERE `Type`='mgc'"); 
     456        $sMGCSQL = $aPQStatisticsElements['mgc']; 
    435457        $sMGCSQL = str_replace('__member_id__', $this->aMemberInfo['ID'], $sMGCSQL); 
    436458        $iGreetedContactsCnt = (int)db_value($sMGCSQL); 
    437459 
    438460        //my blocked contacts 
    439         $sMBCSQL = db_value("SELECT `SQL` FROM `PQStatistics` WHERE `Type`='mbc'"); 
     461        //$sMBCSQL = db_value("SELECT `SQL` FROM `PQStatistics` WHERE `Type`='mbc'"); 
     462        $sMBCSQL = $aPQStatisticsElements['mbc']; 
    440463        $sMBCSQL = str_replace('__member_id__', $this->aMemberInfo['ID'], $sMBCSQL); 
    441464        $iBlockedContactsCnt = (int)db_value($sMBCSQL); 
    442465 
    443466        //my viewed contacts 
    444         $sMVCSQL = db_value("SELECT `SQL` FROM `PQStatistics` WHERE `Type`='mvc'"); 
     467        //$sMVCSQL = db_value("SELECT `SQL` FROM `PQStatistics` WHERE `Type`='mvc'"); 
     468        $sMVCSQL = $aPQStatisticsElements['mvc']; 
    445469        $sMVCSQL = str_replace('__member_id__', $this->aMemberInfo['ID'], $sMVCSQL); 
    446470        $iViewedContactsCnt = (int)db_value($sMVCSQL); 
     
    475499                    $sSubstr = process_db_input( substr($sUnparsedValue, $iStartPos + strlen($sTmpl), $iEndPos-$iStartPos - strlen($sTmpl))); 
    476500                    if ($sSubstr) { 
    477                         $sCustomSQL = db_value("SELECT `SQL` FROM `PQStatistics` WHERE `Type`='{$sSubstr}'"); 
     501                        //$sCustomSQL = db_value("SELECT `SQL` FROM `PQStatistics` WHERE `Type`='{$sSubstr}'"); 
     502                        $sCustomSQL = $aPQStatisticsElements[$sSubstr]; 
    478503                        $sCustomSQL = str_replace('__member_id__', $this->aMemberInfo['ID'], $sCustomSQL); 
    479504                        $sCustomSQL = str_replace('__profile_media_define_photo__', 'Profile photos', $sCustomSQL); 
Note: See TracChangeset for help on using the changeset viewer.
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.
Fork me on GitHub