ソースを参照

Merge branch 'master' of https://github.com/unaio/una

AntonLV 8 年 前
親
コミット
c4cb09de24

+ 2 - 2
modules/boonex/dolphin_migration/classes/BxDolMData.php

@@ -132,7 +132,7 @@ class BxDolMData
 	protected function getContentId($iId){
 		$sQuery = $this -> _oDb -> prepare("SELECT `p`.`content_id` FROM  `sys_accounts` AS  `a` 
 											LEFT JOIN  `sys_profiles` AS  `p` ON `a`.`id` =  `p`.`account_id` 
-											WHERE  `mig_id` = ? AND  `p`.`type` =  'bx_persons' LIMIT 1", $iId);
+											WHERE  `{$this -> _sTransferFieldIdent}` = ? AND  `p`.`type` =  'bx_persons' LIMIT 1", $iId);
 											
 		return $this -> _oDb -> getOne($sQuery);
 	}
@@ -146,7 +146,7 @@ class BxDolMData
 	{
 		$sQuery = $this -> _oDb -> prepare("SELECT `p`.`id` FROM  `sys_accounts` AS  `a` 
 											LEFT JOIN  `sys_profiles` AS  `p` ON `a`.`id` =  `p`.`account_id` 
-											WHERE  `mig_id` = ? AND  `p`.`type` =  'bx_persons' LIMIT 1", $iId);
+											WHERE  `{$this -> _sTransferFieldIdent}` = ? AND  `p`.`type` =  'bx_persons' LIMIT 1", $iId);
 											
 		return $this -> _oDb -> getOne($sQuery);
 	}

+ 6 - 2
modules/boonex/dolphin_migration/classes/BxDolMProfiles.php

@@ -196,7 +196,7 @@ class BxDolMProfiles extends BxDolMData
 							$sFullName,
 							isset($aValue['DateOfBirth']) ? $aValue['DateOfBirth'] : 'NULL',
 							isset($aValue['Sex']) && $aValue['Sex'] ? $aSex[$aValue['Sex']] : 1,
-							isset($aValue['allow_view_to']) ? $aValue['allow_view_to'] : 3,
+                            $this -> getPrivacy($aValue),
 							isset($aValue['Featured']) ? (int)$aValue['Featured'] : 0,
 							isset($aValue['Views']) ? (int)$aValue['Views'] : 0,
 							isset($aValue['DescriptionMe']) ? $aValue['DescriptionMe'] : ''
@@ -249,7 +249,7 @@ class BxDolMProfiles extends BxDolMData
 					LEFT JOIN `sys_albums_objects` ON `sys_albums_objects`.`id_object`=`bx_photos_main`.`ID` 
 					LEFT JOIN `sys_albums` ON `sys_albums`.`ID`=`sys_albums_objects`.`id_album` 
 					WHERE `bx_photos_main`.`Status` ='approved' AND `bx_photos_main`.`Owner` =:id AND `sys_albums`.`Status` ='active' AND `sys_albums`.`Type` ='bx_photos' AND `sys_albums`.`Uri` = :uri 
-					ORDER BY `obj_order` ASC, `id_object`
+					ORDER BY `obj_order` ASC, `id_object` DESC
 					LIMIT 1", array('uri' => $sAlbumName, 'id' => $aProfileInfo['ID']));
 			
 			if (!empty($aInfo) && isset($aInfo['ID']))
@@ -454,6 +454,10 @@ class BxDolMProfiles extends BxDolMData
 
 		return $this -> transferPreValues($sName, $sName, $aValues, true);	
 	}
+
+	private function getPrivacy($aProfile){
+	    return $aProfile['allow_to_view'] > 1 && $aProfile['allow_to_view'] <= 5 ? $aProfile['allow_to_view'] : $aProfile['PrivacyDefaultGroup'];
+    }
 }
 
 	

+ 1 - 1
modules/boonex/timeline/install/sql/enable.sql

@@ -71,7 +71,7 @@ INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
 ('bx_timeline_menu_item_share', 'bx_timeline', '_bx_timeline_menu_set_title_item_share', 0);
 
 INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES
-('bx_timeline_menu_item_share', 'bx_timeline', 'item-repost', '_bx_timeline_menu_item_title_system_item_repost', '_bx_timeline_menu_item_title_item_repost', 'javascript:void(0)', 'javascript:{js_onclick_repost}', '_self', 'repeat', '', 2147483647, 1, 0, 1),
+('bx_timeline_menu_item_share', 'bx_timeline', 'item-repost', '_bx_timeline_menu_item_title_system_item_repost', '_bx_timeline_menu_item_title_item_repost', 'javascript:void(0)', 'javascript:{js_onclick_repost}', '_self', 'redo', '', 2147483647, 1, 0, 1),
 ('bx_timeline_menu_item_share', 'bx_timeline', 'item-send', '_bx_timeline_menu_item_title_system_item_send', '_bx_timeline_menu_item_title_item_send', 'page.php?i=start-convo&et={et_send}', '', '_self', 'envelope', '', 2147483647, 1, 0, 2);
 
 -- MENU: Item Manage (Pin, Delete, etc)