Changeset 9199
- Timestamp:
- Feb 17, 2009, 8:37:12 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/member.php ¶
r9176 r9199 114 114 $sSiteUrl = $GLOBALS['site']['url']; 115 115 116 $free_mode = getParam("free_mode") == "on" ? 1 : 0;116 //$bFreeMode = getParam("free_mode") == "on" ? 1 : 0; 117 117 118 118 $iChMemberID = 0; … … 185 185 global $oTemplConfig; 186 186 187 $ free_mode = getParam("free_mode") == "on" ? 1 : 0;187 $iFreeMode = getParam("free_mode") == "on" ? 1 : 0; 188 188 $en_aff = getParam("enable_aff") == 'on' ? 1 : 0; 189 189 … … 217 217 <!-- Membership --> 218 218 219 <?php if ( !$ free_mode ) { ?>219 <?php if ( !$iFreeMode ) { ?> 220 220 221 221 <tr class=table> … … 246 246 <? 247 247 248 if ( 0 == $ free_mode && 1 == $en_aff )248 if ( 0 == $iFreeMode && 1 == $en_aff ) 249 249 { 250 250 echo "<tr class=table> … … 329 329 330 330 define('BX_DOL_ACCOUNTCUSTOMSTATELEMENTS_CACHE', 'AccountCustomStatElements.inc'); 331 define('BX_DOL_PQStATISTICSEMENTS_CACHE', 'PQStatistics.inc'); 331 332 332 333 //--- Load cache ---// … … 346 347 } 347 348 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; 350 366 351 367 //Labels … … 384 400 385 401 $sMembership = ''; 386 if ( !$ free_mode ) {402 if ( !$iFreeMode ) { 387 403 $sMembStatus = GetMembershipStatus($this->aMemberInfo['ID']); 388 404 $sMembership = <<<EOF … … 407 423 408 424 //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']; 410 427 $sMMNSQL = str_replace('__member_id__', $this->aMemberInfo['ID'], $sMMNSQL); 411 428 $iNewEmailsCnt = (int)db_value($sMMNSQL); 412 429 413 430 //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']; 415 433 $sMMASQL = str_replace('__member_id__', $this->aMemberInfo['ID'], $sMMASQL); 416 434 $iAllEmailsCnt = (int)db_value($sMMASQL); 417 435 418 436 //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']; 420 439 $sMFLSQL = str_replace('__member_id__', $this->aMemberInfo['ID'], $sMFLSQL); 421 440 $iFavedContactsCnt = (int)db_value($sMFLSQL); 422 441 423 442 //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']; 425 445 $sMFRSQL = str_replace('__member_id__', $this->aMemberInfo['ID'], $sMFRSQL); 426 446 $iFriendRequestsCnt = (int)db_value($sMFRSQL); 427 447 428 448 //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']; 430 451 $sMFASQL = str_replace('__member_id__', $this->aMemberInfo['ID'], $sMFASQL); 431 452 $iFriendsCnt = (int)db_value($sMFASQL); 432 453 433 454 //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']; 435 457 $sMGCSQL = str_replace('__member_id__', $this->aMemberInfo['ID'], $sMGCSQL); 436 458 $iGreetedContactsCnt = (int)db_value($sMGCSQL); 437 459 438 460 //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']; 440 463 $sMBCSQL = str_replace('__member_id__', $this->aMemberInfo['ID'], $sMBCSQL); 441 464 $iBlockedContactsCnt = (int)db_value($sMBCSQL); 442 465 443 466 //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']; 445 469 $sMVCSQL = str_replace('__member_id__', $this->aMemberInfo['ID'], $sMVCSQL); 446 470 $iViewedContactsCnt = (int)db_value($sMVCSQL); … … 475 499 $sSubstr = process_db_input( substr($sUnparsedValue, $iStartPos + strlen($sTmpl), $iEndPos-$iStartPos - strlen($sTmpl))); 476 500 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]; 478 503 $sCustomSQL = str_replace('__member_id__', $this->aMemberInfo['ID'], $sCustomSQL); 479 504 $sCustomSQL = str_replace('__profile_media_define_photo__', 'Profile photos', $sCustomSQL);
Note: See TracChangeset
for help on using the changeset viewer.