Changeset 7387
- Timestamp:
- 10/31/08 11:35:27 (3 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
-
inc/classes/BxDolAlerts.php (modified) (9 diffs)
-
inc/classes/BxDolArticles.php (modified) (1 diff)
-
inc/classes/BxDolCmts.php (modified) (1 diff)
-
inc/classes/BxDolSharedMedia.php (modified) (6 diffs)
-
inc/classes/BxDolSharedMediaView.php (modified) (2 diffs)
-
inc/classes/BxDolVoting.php (modified) (4 diffs)
-
install/sql/v61.sql (modified) (1 diff)
-
periodic/cmd.php (modified) (3 diffs)
-
templates/base/scripts/BxBaseUserAlertsView.php (modified) (5 diffs)
-
viewMusic.php (modified) (1 diff)
-
viewPhoto.php (modified) (1 diff)
-
viewVideo.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/inc/classes/BxDolAlerts.php
r7345 r7387 14 14 var $aUnit; 15 15 var $aSupportModules = array( 16 'alertUser' => array( 'class' => 'BxDolAlertsResponseUser', 'file' => ''),16 'alertUser' => array('class' => 'BxDolAlertsResponseUser', 'file' => '') 17 17 ); 18 18 19 var $aSupportUnits = array( 20 21 'profile' => array( 22 'picFile' => 'mbs.gif', 23 'caption' => '_My Profile', 24 'viewLink' => '', 25 'actions' => array( 26 'post'=>array('message'=>"\$sArg = '<a href=\"'.getProfileLink(__iSender__).'\">'.getNickName(__iSender__).'</a>'; return _t('_user_posted_profile_comment', \$sArg);"), 27 'rate'=>array('message'=>"return _t('_your profile has been rated');") 28 ) 29 ), 30 31 'sharedPhoto' => array( 32 'picFile' => 'pph.gif', 33 'caption' => '_Shared Photos', 34 'viewLink' => '', 35 'actions' => array( 36 'post'=>array('message'=>"\$sArg = '<a href=\"'.getProfileLink(__iSender__).'\">'.getNickName(__iSender__).'</a>'; return _t('_user_posted_sharedPhoto_comment', \$sArg);"), 37 'rate'=>array('message'=>"return _t('_your sharedPhoto has been rated');") 38 ) 39 ), 40 41 'sharedMusic' => array( 42 'picFile' => 'pmu.gif', 43 'caption' => '_Shared Music Files', 44 'viewLink' => '', 45 'actions' => array( 46 'post'=>array('message'=>"\$sArg = '<a href=\"'.getProfileLink(__iSender__).'\">'.getNickName(__iSender__).'</a>'; return _t('_user_posted_sharedMusic_comment', \$sArg);"), 47 'rate'=>array('message'=>"return _t('_your sharedMusic has been rated');") 48 ) 49 ), 50 51 'sharedVideo' => array( 52 'picFile' => 'pvi.gif', 53 'caption' => '_Shared Videos', 54 'viewLink' => '', 55 'actions' => array( 56 'post'=>array('message'=>"\$sArg = '<a href=\"'.getProfileLink(__iSender__).'\">'.getNickName(__iSender__).'</a>'; return _t('_user_posted_sharedVideo_comment', \$sArg);"), 57 'rate'=>array('message'=>"return _t('_your sharedVideo has been rated');") 58 ) 59 ), 60 61 'friend' => array( 62 'picFile' => 'frs.gif', 63 'caption' => '_Friends', 64 'viewLink' => '', 65 'actions' => array( 66 'request'=>array('message'=>"\$sArg = '<a href=\"'.getProfileLink(__iSender__).'\">'.getNickName(__iSender__).'</a>'; return _t('_user_invited_friend', \$sArg);"), 67 'accept' =>array('message'=>"\$sArg = '<a href=\"'.getProfileLink(__iSender__).'\">'.getNickName(__iSender__).'</a>'; return _t('_user_added_friend', \$sArg);") 68 ) 69 ), 70 71 'blogposts' => array( 72 'picFile' => 'pts.gif', 73 'caption' => '_Blogs', 74 'viewLink' => '', 75 'actions' => array( 76 'post'=>array('message'=>"\$sArg = '<a href=\"'.getProfileLink(__iSender__).'\">'.getNickName(__iSender__).'</a>'; return _t('_user_made_blog_post', \$sArg);") 77 ) 78 ), 79 80 'guestbook' => array( 81 'picFile' => 'ars.gif', 82 'caption' => '_Guestbook', 83 'viewLink' => '', 84 'actions' => array( 85 'post'=>array('message'=>"\$sArg = '<a href=\"'.getProfileLink(__iSender__).'\">'.getNickName(__iSender__).'</a>'; return _t('_user_posted_guestbook_comment', \$sArg);") 86 ) 87 ), 88 'classifieds' => array( 89 'picFile' => 'cls.gif', 90 'caption' => '_Classifieds', 91 'viewLink' => '', 92 'actions' => array( 93 'post'=>array('message'=>"\$sArg = '<a href=\"'.getProfileLink(__iSender__).'\">'.getNickName(__iSender__).'</a>'; return _t('_user_posted_classified_comment', \$sArg);"), 94 'buy' =>array('message'=>"\$sArg = '<a href=\"'.getProfileLink(__iSender__).'\">'.getNickName(__iSender__).'</a>'; return _t('_user_bought_classified', \$sArg);"), 95 ) 96 ) 19 var $aUnits = array( 20 'profile' => array('commentPost', 'rate'), 21 'sharedPhoto' => array('commentPost', 'rate'), 22 'sharedMusic' => array('commentPost', 'rate'), 23 'sharedVideo' => array('commentPost', 'rate'), 24 'friend' => array('request', 'accept'), 25 'blogposts' => array('commentPost'), 26 'classified' => array('commentPost', 'buy') 97 27 ); 98 28 … … 107 37 'actionUrl' => 'actionUrl', 108 38 'actionText'=> 'actionText', 109 'actionDate'=> 'actionDate' ,39 'actionDate'=> 'actionDate' 110 40 ); 111 41 … … 122 52 $this->sUnit = process_db_input(clear_xss($sUnit)); 123 53 124 if (isset($this->a SupportUnits[$this->sUnit]))125 $this->aUnit = $this->aSupportUnits[$this->sUnit];54 if (isset($this->aUnits[$this->sUnit])) 55 $this->aUnit[$sType] = $this->aUnits[$this->sUnit]; 126 56 else 127 57 return; … … 137 67 foreach ($this->aSupportModules as $a) { 138 68 $sClass = $a['class']; 139 if ($a['file'] && !class_exists($sClass)) 140 include_once(BX_DIRECTORY_PATH_ROOT . $a['file']); 69 if ($a['file'] && !class_exists($sClass) && file_exists(BX_DIRECTORY_PATH_ROOT . $a['file'])) 70 include_once(BX_DIRECTORY_PATH_ROOT . $a['file']); 71 141 72 $o = new $sClass(); 142 73 $o->response($this); … … 156 87 157 88 class BxDolAlertsResponseUser extends BxDolAlertsResponse { 158 89 var $aSupportUnits = array( 90 'profile' => array( 91 'picFile' => 'mbs.gif', 92 'caption' => '_My Profile', 93 'viewLink' => '', 94 'actions' => array( 95 'commentPost'=>array('message'=>"\$sArg = '<a href=\"'.getProfileLink(__iSender__).'\">'.getNickName(__iSender__).'</a>'; return _t('_user_posted_profile_comment', \$sArg);"), 96 'rate'=>array('message'=>"return _t('_your profile has been rated');") 97 ) 98 ), 99 100 'sharedPhoto' => array( 101 'picFile' => 'pph.gif', 102 'caption' => '_Shared Photos', 103 'viewLink' => '', 104 'actions' => array( 105 'commentPost'=>array('message'=>"\$sArg = '<a href=\"'.getProfileLink(__iSender__).'\">'.getNickName(__iSender__).'</a>'; return _t('_user_posted_sharedPhoto_comment', \$sArg);"), 106 'rate'=>array('message'=>"return _t('_your sharedPhoto has been rated');") 107 ) 108 ), 109 110 'sharedMusic' => array( 111 'picFile' => 'pmu.gif', 112 'caption' => '_Shared Music Files', 113 'viewLink' => '', 114 'actions' => array( 115 'commentPost'=>array('message'=>"\$sArg = '<a href=\"'.getProfileLink(__iSender__).'\">'.getNickName(__iSender__).'</a>'; return _t('_user_posted_sharedMusic_comment', \$sArg);"), 116 'rate'=>array('message'=>"return _t('_your sharedMusic has been rated');") 117 ) 118 ), 119 120 'sharedVideo' => array( 121 'picFile' => 'pvi.gif', 122 'caption' => '_Shared Videos', 123 'viewLink' => '', 124 'actions' => array( 125 'commentPost'=>array('message'=>"\$sArg = '<a href=\"'.getProfileLink(__iSender__).'\">'.getNickName(__iSender__).'</a>'; return _t('_user_posted_sharedVideo_comment', \$sArg);"), 126 'rate'=>array('message'=>"return _t('_your sharedVideo has been rated');") 127 ) 128 ), 129 130 'friend' => array( 131 'picFile' => 'frs.gif', 132 'caption' => '_Friends', 133 'viewLink' => '', 134 'actions' => array( 135 'request'=>array('message'=>"\$sArg = '<a href=\"'.getProfileLink(__iSender__).'\">'.getNickName(__iSender__).'</a>'; return _t('_user_invited_friend', \$sArg);"), 136 'accept' =>array('message'=>"\$sArg = '<a href=\"'.getProfileLink(__iSender__).'\">'.getNickName(__iSender__).'</a>'; return _t('_user_added_friend', \$sArg);") 137 ) 138 ), 139 140 'blogposts' => array( 141 'picFile' => 'pts.gif', 142 'caption' => '_Blogs', 143 'viewLink' => '', 144 'actions' => array( 145 'commentPost'=>array('message'=>"\$sArg = '<a href=\"'.getProfileLink(__iSender__).'\">'.getNickName(__iSender__).'</a>'; return _t('_user_made_blog_post', \$sArg);") 146 ) 147 ), 148 149 'classifieds' => array( 150 'picFile' => 'cls.gif', 151 'caption' => '_Classifieds', 152 'viewLink' => '', 153 'actions' => array( 154 'commentPost'=>array('message'=>"\$sArg = '<a href=\"'.getProfileLink(__iSender__).'\">'.getNickName(__iSender__).'</a>'; return _t('_user_posted_classified_comment', \$sArg);"), 155 'buy' =>array('message'=>"\$sArg = '<a href=\"'.getProfileLink(__iSender__).'\">'.getNickName(__iSender__).'</a>'; return _t('_user_bought_classified', \$sArg);"), 156 ) 157 ) 158 ); 159 159 160 160 var $aInfo = array( 161 162 161 'profile' => array( 163 162 'infoTable' => '', … … 190 189 ), 191 190 192 'blog posts' => array(191 'blog' => array( 193 192 'customQuery'=>'SELECT `BlogCategories`.`OwnerID` FROM `BlogCategories` 194 193 INNER JOIN `BlogPosts` ON `BlogCategories`.`CategoryID` = `BlogPosts`.`CategoryID` … … 196 195 ), 197 196 198 'guestbook' => array( 199 'infoTable' => '', 200 'infoObjId' => '', 201 'infoOwner' => '' 202 ), 203 204 'classifieds'=> array( 197 'classified'=> array( 205 198 'infoTable' => 'ClassifiedsAdvertisements', 206 199 'infoObjId' => 'ID', … … 208 201 ) 209 202 ); 203 204 var $aCurrent; 210 205 211 206 function response($o) { 212 $sLink = $o->aUnit['actions']['viewLink']; 213 $sText = addslashes($o->aUnit['actions'][$o->sAction]['message']); 207 if (isset($this->aSupportUnits[$o->sUnit])) { 208 $this->aCurrent = $this->aSupportUnits[$o->sUnit]; 209 210 $sLink = $this->aCurrent['actions']['viewLink']; 211 $sText = addslashes($this->aCurrent['actions'][$o->sAction]['message']); 214 212 $sText = str_replace('__iSender__', $o->iSender, $sText); 215 213 $a = $this->aInfo[$o->sUnit]; … … 235 233 `{$o->aAlrFields['actionDate']}` = UNIX_TIMESTAMP() 236 234 "; 237 238 db_res($sqlQuery); 239 } 235 236 db_res($sqlQuery); 237 } 238 } 240 239 } 241 240 -
trunk/inc/classes/BxDolArticles.php
r7336 r7387 198 198 199 199 200 //$sOtherSQLWhere îòìåíÿåò ðàáîòó ïî $iCategoryID200 //$sOtherSQLWhere 201 201 function getArticlesList( $iCategoryID, $sOtherSQLWhere = '' ) { 202 202 -
trunk/inc/classes/BxDolCmts.php
r7282 r7387 375 375 $iCmtNewId = $this->_oQuery->addComment ($this->getId(), $iCmtParentId, $this->_getAuthorId(), $sText); 376 376 require_once(BX_DIRECTORY_PATH_CLASSES . 'BxDolAlerts.php'); 377 $oZ = new BxDolAlerts($this->_sSystem, ' post', $this->getId(), $this->_getAuthorId());377 $oZ = new BxDolAlerts($this->_sSystem, 'commentPost', $this->getId(), $this->_getAuthorId()); 378 378 $oZ->alert(); 379 379 if(false === $iCmtNewId) -
trunk/inc/classes/BxDolSharedMedia.php
r7372 r7387 11 11 // can be music, photo, video 12 12 var $sType; 13 14 // can be music, photo, video 15 var $sPseud; 13 16 14 17 // name of css file … … 78 81 $sMediaType = process_db_input($sMediaType); 79 82 $sName = ucfirst($sMediaType); 83 $this->sPseud = 'shared'.$sName; 80 84 81 85 $this->aConfigSite = $aSite; … … 318 322 319 323 if (!$bAdmin) { 320 $oVotingView = new BxTemplVotingView ( 'g'.$this->sType, $aData['medID']);324 $oVotingView = new BxTemplVotingView ($this->sPseud, $aData['medID']); 321 325 if( $oVotingView->isEnabled()) { 322 326 $sRate = $oVotingView->getSmallVoting (0); … … 485 489 case 'top': 486 490 if( $mode == $myMode ) { 487 $oVotingView = new BxTemplVotingView ( 'g'.$this->sType, 0, 0);491 $oVotingView = new BxTemplVotingView ($this->sPseud, 0, 0); 488 492 $aSql = $oVotingView->getSqlParts('`'.$this->sMainTable.'`', '`'.$this->aTableFields['medID'].'`'); 489 493 $sHow = "DESC"; … … 530 534 $sHref = $this->getFileUrl($aData['medID'], $aData['medUri']); 531 535 532 $oVotingView = new BxTemplVotingView ( 'g'.$this->sType, $aData['medID']);536 $oVotingView = new BxTemplVotingView ($this->sPseud, $aData['medID']); 533 537 if( $oVotingView->isEnabled()) { 534 538 $sRate = $oVotingView->getSmallVoting (0); … … 950 954 951 955 if (isset($_GET['rate'])) { 952 $oVotingView = new BxTemplVotingView ( 'g'.$this->sType, 0, 0);956 $oVotingView = new BxTemplVotingView ($this->sPseud, 0, 0); 953 957 954 958 $aSql = $oVotingView->getSqlParts('`'.$this->sMainTable.'`', '`'.$this->aTableFields['medID'].'`'); -
trunk/inc/classes/BxDolSharedMediaView.php
r7372 r7387 30 30 $this->oShared = new BxDolSharedMedia($sMediaType, $aSite, $aDir, $aMember); 31 31 $this->aInfo = $this->getFileInfo(); 32 switch ($this->sType) { 33 case 'photo': 34 $sComms = 'sharedPhoto'; 35 break; 36 case 'music': 37 $sComms = 'sharedMusic'; 38 break; 39 case 'video': 40 $sComms = 'sharedVideo'; 41 break; 42 } 43 $this->oCmtsView = new BxTemplCmtsView ($sComms, (int)$this->iFile); 32 $this->oCmtsView = new BxTemplCmtsView ($this->oShared->sPseud, (int)$this->iFile); 44 33 45 34 parent::BxDolPageView($sMediaType); … … 379 368 $sCode = '<center>' . _t('_Gallery video rating is not enabled') . '</center>'; 380 369 381 $oVotingView = new BxTemplVotingView ( 'g'.$this->sType, $this->iFile);370 $oVotingView = new BxTemplVotingView ($this->oShared->sPseud, $this->iFile); 382 371 if( $oVotingView->isEnabled()) 383 372 $sCode = $oVotingView->getBigVoting (); -
trunk/inc/classes/BxDolVoting.php
r7227 r7387 37 37 ), 38 38 39 ' gphoto' => array (39 'sharedPhoto' => array ( 40 40 'table_rating' => 'gphoto_rating', 41 41 'table_track' => 'gphoto_voting_track', … … 47 47 ), 48 48 49 ' gmusic' => array (49 'sharedMusic' => array ( 50 50 'table_rating' => 'gmusic_rating', 51 51 'table_track' => 'gmusic_voting_track', … … 57 57 ), 58 58 59 ' gvideo' => array (59 'sharedVideo' => array ( 60 60 'table_rating' => 'gvideo_rating', 61 61 'table_track' => 'gvideo_voting_track', … … 134 134 135 135 require_once(BX_DIRECTORY_PATH_CLASSES . 'BxDolAlerts.php'); 136 switch ($this->_sSystem) { 137 case 'gphoto': $sUnit = 'sharedPhoto'; break; 138 case 'gmusic': $sUnit = 'sharedMusic'; break; 139 case 'gvideo': $sUnit = 'sharedVideo'; break; 140 default: $sUnit = $this->_sSystem; break; 141 } 142 $oZ = new BxDolAlerts($sUnit, 'rate', $this->getId()); 136 $oZ = new BxDolAlerts($this->_sSystem, 'rate', $this->getId()); 143 137 $oZ->alert(); 144 138 return $this->_oQuery->putVote ($this->getId(), $_SERVER['REMOTE_ADDR'], $iVote); -
trunk/install/sql/v61.sql
r7378 r7387 1623 1623 INSERT INTO `GlParams` VALUES('enable_global_couple', 'on', 3, 'Global Enabling of Couples', 'checkbox', '', '', NULL); 1624 1624 INSERT INTO `GlParams` VALUES('enable_new_dhtml_popups', 'on', 3, 'Enable new DHTML notifications rather than popup', 'checkbox', '', '', NULL); 1625 INSERT INTO `GlParams` VALUES(' alertUserNumber', '10', 3, 'Number of user alerts', 'digit', '', '', 15);1625 INSERT INTO `GlParams` VALUES('dbCleanAlert', '2', 3, 'Clean old user alerts', 'digit', '', '', 5); 1626 1626 INSERT INTO `GlParams` VALUES('galleryFiles_user', '2', 23, 'Number of gallery files relate to user', 'digit', '', '', 21); 1627 1627 INSERT INTO `GlParams` VALUES('galleryFiles_keyword', '2', 23, 'Number of related gallery files', 'digit', '', '', 22); -
trunk/periodic/cmd.php
r7312 r7387 51 51 $db_clean_msg = getParam("db_clean_msg"); 52 52 $db_clean_views = getParam("db_clean_views"); 53 $iDbCleanAlert = getParam('dbCleanAlert'); 53 54 54 55 // profile_delete … … 87 88 $db_clean_views_num = mysql_affected_rows(); 88 89 } 89 90 91 if ($iDbCleanAlert > 0) { 92 $iNow = time(); 93 // number of seconds from now to clean date 94 $iThen = time() - $iDbCleanAlert*24*60*60; 95 $sqlQuery = "DELETE FROM `alerts` WHERE `actionDate` NOT BETWEEN $iNow AND $iThen"; 96 $rRes = db_res($sqlQuery); 97 if ($rRes) 98 $iDbCleanAlertNum = mysql_affected_rows(); 99 } 90 100 echo "\n- Database cleaning -\n"; 91 101 … … 94 104 echo "Deleted messages: $db_clean_msg_num\n"; 95 105 echo "Deleted profile views: $db_clean_views_num\n"; 106 echo "Deleted user alerts: $iDbCleanAlertNum\n"; 96 107 } 97 108 -
trunk/templates/base/scripts/BxBaseUserAlertsView.php
r7227 r7387 1 1 <?php 2 2 3 require_once('inc/header.inc.php'); 4 require_once(BX_DIRECTORY_PATH_INC . 'db.inc.php'); 5 require_once(BX_DIRECTORY_PATH_INC . 'languages.inc.php'); 6 require_once(BX_DIRECTORY_PATH_INC . 'profiles.inc.php'); 3 require_once(BX_DIRECTORY_PATH_INC . 'header.inc.php'); 7 4 require_once(BX_DIRECTORY_PATH_CLASSES . 'BxDolAlerts.php'); 8 5 … … 24 21 $this->oConf = new BxDolAlerts('', '', 0, 0); 25 22 26 if (is_array($aInActive) ) {23 if (is_array($aInActive) && !empty($aInActive)) { 27 24 foreach ($aInActive as $iKey => $sValue) 28 25 $sAdd .= " AND `{$this->oConf->aAlrFields['actionUnit']}` <> '$sValue'"; … … 41 38 $sqlQuery = str_replace('__mainFields__', trim($sMainFields, ', '), $sqlTempl); 42 39 $rData = db_res($sqlQuery); 43 40 44 41 if (mysql_num_rows($rData) > 0) { 45 42 while ($aMess = mysql_fetch_assoc($rData)) { 46 43 $this->aList[$aMess['alertId']] = $aMess; 47 $sqlDelCond .= $aMess['alertId'] . ",";48 44 } 49 $sqlQuery = "DELETE FROM `{$this->oConf->sAlrTable}`50 WHERE `{$this->oConf->aAlrFields['alertId']}` NOT IN (".trim($sqlDelCond,",").")51 AND `{$this->oConf->aAlrFields['alertRcpId']}`='{$this->iOwner}'";52 db_res($sqlQuery);53 45 } 54 46 } … … 85 77 WHERE `{$this->oConf->aAlrFields['alertRcpId']}`='$this->iOwner' AND `{$this->oConf->aAlrFields['alertNew']}`=1 86 78 GROUP BY `{$this->oConf->aAlrFields['actionUnit']}`"; 87 79 88 80 $rData = db_res($sqlQuery); 89 81 while ($aUnit = mysql_fetch_assoc($rData)) … … 96 88 $sCode = '<div id="alertsMenu">'; 97 89 if (is_array($aUnits)) { 90 $oUnits = new BxDolAlertsResponseUser(); 98 91 foreach ($aUnits as $iKey => $sValue) 99 92 $sCode .= ' 100 93 <input type="checkbox" name="' . $sValue . '" id="' . $sValue . '"> 101 <label for="' . $sValue . '"><img src="'.getTemplateIcon($ this->oConf->aSupportUnits[$sValue]['picFile']).'" alt="'._t($this->oConf->aSupportUnits[$sValue]['caption']).'"></label>94 <label for="' . $sValue . '"><img src="'.getTemplateIcon($oUnits->aSupportUnits[$sValue]['picFile']).'" alt="'._t($oUnits->aSupportUnits[$sValue]['caption']).'"></label> 102 95 '; 103 96 } -
trunk/viewMusic.php
r7336 r7387 36 36 $oNew = new BxDolSharedMediaView($iFile, 'music', $site, $dir, $member); 37 37 38 $oVotingView = new BxTemplVotingView(' gmusic', 0, 0);38 $oVotingView = new BxTemplVotingView('sharedMusic', 0, 0); 39 39 $_page['extra_js'] = $oVotingView->getExtraJs(); 40 40 -
trunk/viewPhoto.php
r7336 r7387 35 35 $oNew = new BxDolSharedMediaView($iFile, 'photo', $site, $dir, $member); 36 36 37 $oVotingView = new BxTemplVotingView(' gphoto', 0, 0);37 $oVotingView = new BxTemplVotingView('sharedPhoto', 0, 0); 38 38 $_page['extra_js'] = $oVotingView->getExtraJs(); 39 39 -
trunk/viewVideo.php
r7336 r7387 35 35 $oNew = new BxDolSharedMediaView($iFile, 'video', $site, $dir, $member); 36 36 37 $oVotingView = new BxTemplVotingView(' gvideo', 0, 0);37 $oVotingView = new BxTemplVotingView('sharedVideo', 0, 0); 38 38 $_page['extra_js'] = $oVotingView->getExtraJs(); 39 39
Note: See TracChangeset
for help on using the changeset viewer.