- Timestamp:
- 12/08/11 00:02:57 (6 months ago)
- Location:
- trunk/inc
- Files:
-
- 14 edited
-
classes/BxDolCmts.php (modified) (1 diff)
-
classes/BxDolCmtsQuery.php (modified) (1 diff)
-
classes/BxDolForm.php (modified) (2 diffs)
-
classes/BxDolProfile.php (modified) (1 diff)
-
classes/BxDolProfileFields.php (modified) (1 diff)
-
classes/BxDolSubscription.php (modified) (1 diff)
-
classes/BxDolTemplate.php (modified) (1 diff)
-
classes/BxDolTwigModule.php (modified) (14 diffs)
-
classes/BxDolTwigModuleDb.php (modified) (2 diffs)
-
classes/BxDolTwigPageView.php (modified) (5 diffs)
-
classes/BxDolTwigSearchResult.php (modified) (1 diff)
-
classes/BxDolTwigTemplate.php (modified) (1 diff)
-
classes/BxDolVoting.php (modified) (1 diff)
-
membership_levels.inc.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/inc/classes/BxDolCmts.php
r15590 r15733 162 162 if (!isset($GLOBALS['bx_dol_cmts_systems'])) 163 163 { 164 $GLOBALS['bx_dol_cmts_systems'] = $GLOBALS['MySQL']->fromCache('sys_objects_cmts', 'getAllWithKey', '164 $GLOBALS['bx_dol_cmts_systems'] = BxDolDb::getInstance()->fromCache('sys_objects_cmts', 'getAllWithKey', ' 165 165 SELECT 166 166 `ID` as `system_id`, -
trunk/inc/classes/BxDolCmtsQuery.php
r15262 r15733 53 53 `c`.`cmt_replies`, 54 54 (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(`c`.`cmt_time`)) AS `cmt_secs_ago`, 55 `p`.` NickName` AS `cmt_author_name`55 `p`.`id` AS `cmt_author_name` 56 56 FROM {$this->_sTable} AS `c` 57 LEFT JOIN ` Profiles` AS `p` ON (`p`.`ID` = `c`.`cmt_author_id`)57 LEFT JOIN `sys_profiles` AS `p` ON (`p`.`id` = `c`.`cmt_author_id`) 58 58 $sJoin 59 59 WHERE `c`.`cmt_object_id` = ? AND `c`.`cmt_parent_id` = ? -
trunk/inc/classes/BxDolForm.php
r15722 r15733 474 474 foreach ($aInputs as $k => $a) { 475 475 if (!isset($aValues[$k])) continue; 476 $sMethod = 'display' .ucfirst($a['db']['pass']);476 $sMethod = 'display' . (isset($a['db']['pass']) ? ucfirst($a['db']['pass']) : 'Undefined'); 477 477 if (method_exists($this->_oChecker, $sMethod)) 478 478 $aInputs[$k]['value'] = call_user_func_array (array($this->_oChecker, $sMethod), $a['db']['params'] ? array_merge(array($aValues[$k]), $a['db']['params']) : array ($aValues[$k])); … … 652 652 } 653 653 function _passTags ($s) { 654 require_once(BX_DIRECTORY_PATH_INC . 'tags.inc.php'); 654 655 $sTags = $this->passXss ($s); 655 656 $aTags = explodeTags($sTags); -
trunk/inc/classes/BxDolProfile.php
r15698 r15733 63 63 64 64 /** 65 * Check if profile status is active 66 */ 67 public function isActive($iProfileId) { 68 $aInfo = $this->getStatus((int)$iProfileId ? $iProfileId : $this->_iProfileID); 69 return 'active' == $aInfo['status']; 70 } 71 72 /** 73 * Get profile status 74 */ 75 public function getStatus($iProfileId) { 76 $aInfo = $this->_oQuery->getInfoById((int)$iProfileId ? $iProfileId : $this->_iProfileID); 77 return $aInfo['status']; 78 } 79 80 /** 65 81 * Get profile info 66 82 */ 67 83 public function getInfo($iProfileId) { 68 return $this->_oQuery->getInfoById((int)$iProfileId ? $i AccountId : $this->_iProfileID);84 return $this->_oQuery->getInfoById((int)$iProfileId ? $iProfileId : $this->_iProfileID); 69 85 } 70 86 -
trunk/inc/classes/BxDolProfileFields.php
r15588 r15733 48 48 } 49 49 50 $this -> aArea = $this -> aCache[ $this -> iAreaID ];50 $this -> aArea = isset($this -> aCache[ $this -> iAreaID ]) ? $this -> aCache[ $this -> iAreaID ] : false; 51 51 52 52 //load blocks -
trunk/inc/classes/BxDolSubscription.php
r15334 r15733 244 244 ) 245 245 ); 246 bx_import('BxTemplFormView'); 246 247 $oForm = new BxTemplFormView($aForm); 247 248 $sContent .= PopupBox($this->_sVisitorPopup, _t('_sys_bcpt_subscribe'), $oForm->getCode(), array(), true); -
trunk/inc/classes/BxDolTemplate.php
r15698 r15733 602 602 $mixedKeywords[$iKey] = trim($sValue); 603 603 604 $this->aPage['keywords'] = array_merge($this->aPage['keywords'], $mixedKeywords);604 $this->aPage['keywords'] = isset($this->aPage['keywords']) && is_array($this->aPage['keywords']) ? array_merge($this->aPage['keywords'], $mixedKeywords) : $mixedKeywords; 605 605 } 606 606 /** -
trunk/inc/classes/BxDolTwigModule.php
r15731 r15733 30 30 class BxDolTwigModule extends BxDolModule { 31 31 32 var $_iAccountId; 33 var $_oAccount; 34 32 35 var $_iProfileId; 36 var $_oProfile; 37 33 38 var $_sPrefix; 34 39 var $_sFilterName; … … 36 41 function BxDolTwigModule(&$aModule) { 37 42 parent::BxDolModule($aModule); 38 $this->_iProfileId = !empty($GLOBALS['logged']['member']) || !empty($GLOBALS['logged']['admin']) ? $_COOKIE['memberID'] : 0; 43 $this->_iAccountId = !empty($GLOBALS['logged']['member']) || !empty($GLOBALS['logged']['admin']) ? $_COOKIE['memberID'] : 0; 44 bx_import('BxDolAccount'); 45 $this->_oAccount = BxDolAccount::getInstance($this->_iAccountId); 39 46 } 40 47 … … 264 271 265 272 if ($oForm->isSubmittedAndValid ()) { 266 267 $oForm->processMedia($iEntryId, $this->_iProfileId);268 273 269 274 $this->$sIsAllowedFuncName($aDataEntry, true); // perform action … … 468 473 bx_import ('SearchResult', $this->_aModule); 469 474 $sClass = $this->_aModule['class_prefix'] . 'SearchResult'; 470 $o = new $sClass( process_db_input($sMode, BX_TAGS_STRIP), process_db_input($sValue, BX_TAGS_STRIP), process_db_input($sValue2, BX_TAGS_STRIP), process_db_input($sValue3, BX_TAGS_STRIP));475 $o = new $sClass(bx_process_input($sMode), bx_process_input($sValue), bx_process_input($sValue2), bx_process_input($sValue3)); 471 476 472 477 if ($o->isError) { … … 581 586 return; 582 587 } 583 588 /* 584 589 $GLOBALS['oTopMenu']->setCustomSubHeader($aDataEntry[$this->_oDb->_sFieldTitle]); 585 590 $GLOBALS['oTopMenu']->setCustomVar($this->_sPrefix.'_view_uri', $aDataEntry[$this->_oDb->_sFieldUri]); … … 589 594 $sTitle => '', 590 595 )); 591 596 */ 592 597 if (!$this->isAllowedEdit($aDataEntry)) { 593 598 $this->_oTemplate->displayAccessDenied (); … … 610 615 $aValsAdd = array ($this->_oDb->_sFieldStatus => $sStatus); 611 616 if ($oForm->update ($iEntryId, $aValsAdd)) { 612 613 $oForm->processMedia($iEntryId, $this->_iProfileId);614 617 615 618 $this->isAllowedEdit($aDataEntry, true); // perform action … … 873 876 // ================================== external actions 874 877 875 function serviceGetForumPermission($iMemberId, $iForumId) {876 877 $iMemberId = (int)$iMemberId;878 $iForumId = (int)$iForumId;879 880 $aFalse = array (881 'admin' => 0,882 'read' => 0,883 'post' => 0,884 );885 886 if (!($aForum = $this->_oDb->getForumById ($iForumId)))887 return $aFalse;888 889 if (!($aDataEntry = $this->_oDb->getEntryById ($aForum['entry_id'])))890 return $aFalse;891 892 $aTrue = array (893 'admin' => $aDataEntry[$this->_oDb->_sFieldAuthorId] == $iMemberId || $this->isAdmin() ? 1 : 0, // author is admin894 'read' => $this->isAllowedPostInForum ($aDataEntry, $iMemberId) ? 1 : 0,895 'post' => $this->isAllowedPostInForum ($aDataEntry, $iMemberId) ? 1 : 0,896 );897 898 return $aTrue;899 }900 878 901 879 function serviceDeleteProfileData ($iProfileId) { … … 1194 1172 $this->reparseCategories ($iEntryId); 1195 1173 } 1196 $this->_oDb->createForum ($aDataEntry, $this->_oDb->getProfileNickNameById($this->_iProfileId));1197 1174 $oAlert = new BxDolAlerts($this->_sPrefix, 'add', $iEntryId, $this->_iProfileId, array('Status' => $sStatus)); 1198 1175 $oAlert->alert(); … … 1230 1207 $oViews->onObjectDelete(); 1231 1208 1232 // delete forum1233 $this->_oDb->deleteForum ($iEntryId);1234 1235 1209 // arise alert 1236 1210 $oAlert = new BxDolAlerts($this->_sPrefix, 'delete', $iEntryId, $this->_iProfileId); … … 1294 1268 1295 1269 function isAdmin () { 1296 return $GLOBALS['logged']['admin'] && isProfileActive($this->_iProfileId); 1270 bx_import('BxDolProfile'); 1271 return $GLOBALS['logged']['admin']; // TODO: && $this->_oProfile->isActive(); 1297 1272 } 1298 1273 … … 1319 1294 1320 1295 $this->isAllowedAdd(true); // perform action 1321 1322 $oForm->processMedia($iEntryId, $this->_iProfileId);1323 1296 1324 1297 $aDataEntry = $this->_oDb->getEntryByIdAndOwner($iEntryId, $this->_iProfileId, $this->isAdmin()); … … 1395 1368 return false; 1396 1369 } 1397 1370 /* 1398 1371 $GLOBALS['oTopMenu']->setCustomSubHeader($aDataEntry[$this->_oDb->_sFieldTitle]); 1399 1372 $GLOBALS['oTopMenu']->setCustomVar($this->_sPrefix.'_view_uri', $aDataEntry[$this->_oDb->_sFieldUri]); … … 1403 1376 $sSubTab => '', 1404 1377 )); 1405 1378 */ 1406 1379 if ((!$this->_iProfileId || $aDataEntry[$this->_oDb->_sFieldAuthorId] != $this->_iProfileId) && !$this->isAllowedView($aDataEntry, true)) { 1407 1380 $this->_oTemplate->displayAccessDenied (); -
trunk/inc/classes/BxDolTwigModuleDb.php
r15731 r15733 101 101 if (!($iRet = $this->query ("DELETE FROM `" . $this->_sPrefix . $this->_sTableMain . "` WHERE `{$this->_sFieldId}` = $iId $sWhere LIMIT 1"))) 102 102 return false; 103 $this->query ("DELETE FROM `" . $this->_sPrefix . $this->_sTableMediaPrefix . "files` WHERE `entry_id` = $iId");104 103 $this->query ("DELETE FROM `" . $this->_sPrefix . $this->_sTableMediaPrefix . "images` WHERE `entry_id` = $iId"); 105 $this->query ("DELETE FROM `" . $this->_sPrefix . $this->_sTableMediaPrefix . "videos` WHERE `entry_id` = $iId");106 104 return true; 107 105 } … … 175 173 } 176 174 177 // forum functions178 179 function getForumById ($iForumId) {180 return $this->getRow ("SELECT * FROM `" . $this->_sPrefix . "forum` WHERE `forum_id` = '{$iForumId}' LIMIT 1");181 }182 183 function createForum ($aDataEntry, $sUsername) {184 $sForumTitle = process_db_input($aDataEntry[$this->_sFieldTitle], BX_TAGS_NO_ACTION, BX_SLASHES_NO_ACTION);185 $sUsername = process_db_input($sUsername, BX_TAGS_NO_ACTION, BX_SLASHES_NO_ACTION);186 return $this->query ("INSERT INTO `" . $this->_sPrefix . "forum` SET `forum_uri` = '{$aDataEntry[$this->_sFieldUri]}', `cat_id` = 1, `forum_title` = '{$sForumTitle}', `forum_desc` = '$sUsername', `forum_last` = UNIX_TIMESTAMP(), `forum_type` = 'public', `entry_id` = '{$aDataEntry[$this->_sFieldId]}'");187 }188 189 function deleteForum ($iEntryId) {190 191 global $gConf;192 $gConf['db']['host'] = DATABASE_HOST;193 $gConf['db']['db'] = DATABASE_NAME;194 $gConf['db']['user'] = DATABASE_USER;195 $gConf['db']['pwd'] = DATABASE_PASS;196 $gConf['db']['port'] = DATABASE_PORT;197 $gConf['db']['sock'] = DATABASE_SOCK;198 $gConf['db']['prefix'] = $this->_sPrefix;199 200 require_once (BX_DIRECTORY_PATH_CLASSES . 'Thing.php');201 require_once (BX_DIRECTORY_PATH_MODULES . 'boonex/forum/classes/ThingPage.php');202 require_once (BX_DIRECTORY_PATH_MODULES . 'boonex/forum/classes/Mistake.php');203 require_once (BX_DIRECTORY_PATH_MODULES . 'boonex/forum/classes/BxDb.php');204 require_once (BX_DIRECTORY_PATH_MODULES . 'boonex/forum/classes/DbAdmin.php');205 206 $db = new DbAdmin ();207 $iForumId = $this->getOne ("SELECT `forum_id` FROM `" . $this->_sPrefix . "forum` WHERE `entry_id` = '{$iEntryId}'");208 return $db->deleteForumAll($iForumId);209 }210 211 175 // profile functions 212 176 213 177 function getProfileNickNameById ($iId) { 214 $a = getProfileInfo($iId); 215 return $a['NickName']; 178 return 'Undefined'; // TODO: 216 179 } 217 180 -
trunk/inc/classes/BxDolTwigPageView.php
r15211 r15733 47 47 function _blockInfo ($aData, $sFields = '') { 48 48 49 $aAuthor = getProfileInfo($aData['author_id']); 50 51 $aVars = array ( 52 'author_thumb' => get_member_thumbnail($aAuthor['ID'], 'none'), 49 $aVars = array ( 50 'author_thumb' => '', // TODO: get_member_thumbnail($aAuthor['ID'], 'none'), 53 51 'date' => getLocaleDate($aData['created'], BX_DOL_LOCALE_DATE_SHORT), 54 52 'date_ago' => defineTimeInterval($aData['created']), … … 56 54 'tags' => $this->_oTemplate->parseTags($aData['tags']), 57 55 'fields' => $sFields, 58 'author_username' => $a Author['NickName'],59 'author_url' => $aAuthor ? getProfileLink($aAuthor['ID']) : 'javascript:void(0)',56 'author_username' => $aData['author_id'], // TODO: $aAuthor['NickName'], 57 'author_url' => '', // TODO: $aAuthor ? getProfileLink($aAuthor['ID']) : 'javascript:void(0)', 60 58 ); 61 59 return $this->_oTemplate->parseHtmlByName('entry_view_block_info', $aVars); … … 221 219 function _blockFans($iPerPage, $sFuncIsAllowed = 'isAllowedViewFans', $sFuncGetFans = 'getFans') { 222 220 221 return 'TODO: fans here'; 222 /* 223 223 if (!$this->_oMain->$sFuncIsAllowed($this->aDataEntry)) 224 224 return ''; … … 258 258 259 259 return array($ret, array(), $aDBBottomMenu); 260 */ 260 261 } 261 262 262 263 function _blockFansUnconfirmed($iFansLimit = 1000) { 263 264 265 return 'TODO: unconfirmed fans here'; 266 /* 264 267 if (!$this->_oMain->isEntryAdmin($this->aDataEntry)) 265 268 return ''; … … 293 296 ); 294 297 return $this->_oMain->_oTemplate->parseHtmlByName('manage_items_form', $aVars); 298 */ 295 299 } 296 300 } -
trunk/inc/classes/BxDolTwigSearchResult.php
r15731 r15733 61 61 $sUrlStart .= (false === strpos($sUrlStart, '?') ? '?' : '&'); 62 62 63 $oPaginate = new BxDolPaginate(array( 63 bx_import('BxTemplPaginate'); 64 $oPaginate = new BxTemplPaginate(array( 64 65 'page_url' => $sUrlStart . 'page={page}&per_page={per_page}' . (false !== bx_get($this->sFilterName) ? '&' . $this->sFilterName . '=' . bx_get($this->sFilterName) : ''), 65 66 'count' => $this->aCurrent['paginate']['totalNum'], 66 67 'per_page' => $this->aCurrent['paginate']['perPage'], 67 68 'page' => $this->aCurrent['paginate']['page'], 68 'per_page_changer' => true,69 'page_reloader' => true,70 'on_change_page' => '',71 'on_change_per_page' => "document.location='" . $sUrlStart . "page=1&per_page=' + this.value + '" . (false !== bx_get($this->sFilterName) ? '&' . $this->sFilterName . '=' . bx_get($this->sFilterName) ."';": "';"),72 69 )); 73 70 -
trunk/inc/classes/BxDolTwigTemplate.php
r15731 r15733 38 38 39 39 function parseHtmlByName ($sName, &$aVars) { 40 return parent::parseHtmlByName (str pos($sName, '.html', strlen($sName) - 5) ? $sName : $sName.'.html', $aVars);40 return parent::parseHtmlByName (strlen($sName) > 5 && strpos($sName, '.html', strlen($sName) - 5) ? $sName : $sName.'.html', $aVars); 41 41 } 42 42 -
trunk/inc/classes/BxDolVoting.php
r15262 r15733 242 242 function checkAction () 243 243 { 244 require_once(BX_DIRECTORY_PATH_INC . 'membership_levels.inc.php'); 244 245 if (isset($this->_checkActionResult)) 245 246 return $this->_checkActionResult; -
trunk/inc/membership_levels.inc.php
r15705 r15733 286 286 $aLangFileParams[CHECK_ACTION_LANG_FILE_SITE_EMAIL] = $oDb->getParam('site_email'); 287 287 288 if ($aMembership['ID'] != MEMBERSHIP_ID_NON_MEMBER || $logged['admin']) {288 if ($aMembership['ID'] != MEMBERSHIP_ID_NON_MEMBER || $logged['admin']) { 289 289 $iDestID = $iProfileId; 290 290 if (isAdmin() && $iForcedProfID > 0) { … … 294 294 295 295 if ($isCheckMemberStatus) { 296 $aActive = getProfileInfo( $iDestID ); 297 if ($aActive['Status'] != 'Active') { 296 bx_import('BxDolProfile'); 297 $oProfile = BxDolProfile::getInstance($iDestID); 298 if (!$oProfile || !$oProfile->isActive()) { 298 299 $aResult[CHECK_ACTION_RESULT] = CHECK_ACTION_RESULT_NOT_ACTIVE; 299 300 $aResult[CHECK_ACTION_MESSAGE] = _t_ext(CHECK_ACTION_MESSAGE_NOT_ACTIVE, $aLangFileParams);
Note: See TracChangeset
for help on using the changeset viewer.