Changeset 15386
- Timestamp:
- 07/27/11 00:08:18 (10 months ago)
- Location:
- trunk
- Files:
-
- 8 added
- 20 edited
-
inc/classes/BxDolMobileTemplate.php (added)
-
inc/classes/BxDolModuleTemplate.php (modified) (2 diffs)
-
inc/classes/BxDolTwigTemplate.php (modified) (2 diffs)
-
inc/profiles.inc.php (modified) (1 diff)
-
install/langs/lang-en.php (modified) (1 diff)
-
install/sql/v70.sql (modified) (2 diffs)
-
modules/boonex/map_profiles/install/langs/en.php (modified) (1 diff)
-
modules/boonex/map_profiles/install/sql/install.sql (modified) (1 diff)
-
modules/boonex/map_profiles/install/sql/uninstall.sql (modified) (1 diff)
-
modules/boonex/news/classes/BxNewsModule.php (modified) (1 diff)
-
modules/boonex/news/install/sql/install.sql (modified) (1 diff)
-
modules/boonex/news/install/sql/uninstall.sql (modified) (1 diff)
-
modules/boonex/news/templates/base/images/icons/mobile_icon.png (added)
-
modules/boonex/photos/install/sql/install.sql (modified) (1 diff)
-
modules/boonex/photos/install/sql/uninstall.sql (modified) (1 diff)
-
modules/boonex/sounds/install/sql/install.sql (modified) (1 diff)
-
modules/boonex/sounds/install/sql/uninstall.sql (modified) (1 diff)
-
modules/boonex/videos/install/sql/install.sql (modified) (1 diff)
-
modules/boonex/videos/install/sql/uninstall.sql (modified) (1 diff)
-
templates/base/css/mobile.css (added)
-
templates/base/images/icons/mobile_next.png (added)
-
templates/base/mobile_box.html (added)
-
templates/base/mobile_page_padding.html (added)
-
templates/base/mobile_row.html (added)
-
templates/base/page_11.html (added)
-
xmlrpc/BxDolXMLRPCUser.php (modified) (2 diffs)
-
xmlrpc/BxDolXMLRPCUtil.php (modified) (7 diffs)
-
xmlrpc/index.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/inc/classes/BxDolModuleTemplate.php
r15211 r15386 12 12 var $_oDb; 13 13 var $_oConfig; 14 var $_bObStarted = 0; 14 15 15 16 /* … … 47 48 return $mixedResult; 48 49 } 50 function pageStart () { 51 if (0 == $this->_bObStarted) { 52 ob_start (); 53 $this->_bObStarted = 1; 54 } 55 } 56 function pageEnd ($isGetContent = true) { 57 if (1 == $this->_bObStarted) { 58 $sRet = ''; 59 if ($isGetContent) 60 $sRet = ob_get_clean(); 61 else 62 ob_end_clean(); 63 $this->_bObStarted = 0; 64 return $sRet; 65 } 66 } 49 67 } 50 68 -
trunk/inc/classes/BxDolTwigTemplate.php
r15338 r15386 14 14 class BxDolTwigTemplate extends BxDolModuleTemplate { 15 15 var $_iPageIndex = 0; 16 var $_oMain = null; 17 var $_bObStarted = 0; 16 var $_oMain = null; 18 17 19 18 function BxDolTwigTemplate(&$oConfig, &$oDb, $sRootPath = BX_DIRECTORY_PATH_ROOT, $sRootUrl = BX_DOL_URL_ROOT) { … … 78 77 } 79 78 80 function pageStart () {81 if (0 == $this->_bObStarted) {82 ob_start ();83 $this->_bObStarted = 1;84 }85 }86 87 function pageEnd ($isGetContent = true) {88 if (1 == $this->_bObStarted) {89 $sRet = '';90 if ($isGetContent)91 $sRet = ob_get_clean();92 else93 ob_end_clean();94 $this->_bObStarted = 0;95 return $sRet;96 }97 }98 99 79 // ======================= tags/cat parsing functions 100 80 -
trunk/inc/profiles.inc.php
r15338 r15386 331 331 } 332 332 333 /** 334 * Get number of friend requests sent to the specified profile. 335 * It doesn't count pending friend requests which was sent by specified profile. 336 * @param $iID specified profile 337 * @return number of friend requests 338 */ 339 function getFriendRequests($iID) { 340 $iID = (int)$iID; 341 $sqlQuery = "SELECT count(*) FROM `sys_friend_list` WHERE `Profile` = {$iID} AND `Check` = '0'"; 342 return (int)db_value($sqlQuery); 343 } 344 333 345 function getMyFriendsEx($iID, $sWhereParam = '', $sSortParam = '', $sqlLimit = '') { 334 346 $sJoin = $sOrderBy = ''; -
trunk/install/langs/lang-en.php
r15347 r15386 2782 2782 '_sys_profile_private_text' => 'Information availability is limited by privacy settings.', 2783 2783 '_sys_profile_private_text_title' => 'Limited Visibility', 2784 '_sys_mobile_status' => 'Status', 2785 '_sys_mobile_mail' => 'Messages', 2786 '_sys_mobile_friends' => 'Friends', 2787 '_sys_mobile_info' => 'Info', 2788 '_sys_mobile_search' => 'Search', 2789 '_sys_mobile_profile_info' => 'Profile Info', 2790 '_sys_mobile_profile_contact' => 'Contact', 2791 '_sys_mobile_profile_friends' => 'Friends', 2784 2792 ); 2785 2793 ?> -
trunk/install/sql/v70.sql
r15347 r15386 6 6 7 7 SET NAMES 'utf8'; 8 DROP TABLE IF EXISTS `sys_account_custom_stat_elements`, `sys_admin_ban_list`, `sys_admin_dashboard`, `sys_menu_admin`, `sys_menu_admin_top`, `sys_menu_bottom`, `sys_albums`, `sys_albums_objects`,`sys_banners`, `sys_banners_clicks`, `sys_banners_shows`, `sys_block_list`, `sys_categories`, `sys_objects_categories`, `sys_objects_cmts`, `sys_cmts_profile`, `sys_cmts_track`, `sys_color_base`, `sys_countries`, `sys_email_templates`, `sys_menu_member`, `sys_friend_list`, `sys_options`, `sys_options_cats`, `sys_fave_list`, `sys_ip_list`, `sys_ip_members_visits`, `sys_localization_categories`, `sys_localization_keys`, `sys_localization_languages`, `sys_localization_string_params`, `sys_localization_strings`, `sys_acl_actions`, `sys_acl_actions_track`, `sys_acl_matrix`, `sys_acl_level_prices`, `sys_acl_levels`, `sys_messages`, `sys_page_compose`, `sys_page_compose_pages`, `sys_page_compose_privacy`, `sys_sessions`, `sys_stat_member`, `sys_pre_values`, `sys_profile_fields`, `sys_acl_levels_members`, `Profiles`, `sys_profile_views_track`, `sys_profiles_match`, `sys_profile_rating`, `sys_profile_voting_track`, `RayBoardCurrentUsers`, `RayBoardBoards`, `RayBoardUsers`, `RayChatCurrentUsers`, `RayChatMessages`, `RayChatProfiles`, `RayChatRooms`, `RayChatRoomsUsers`, `RayChatMembershipsSettings`, `RayChatMemberships`, `RayImContacts`, `RayImMessages`, `RayImPendings`, `RayImProfiles`, `RayMp3Files`, `RayMp3Tokens`, `RayShoutboxMessages`, `RayVideoFiles`, `RayVideoTokens`, `RayVideo_commentsFiles`, `RayVideo_commentsTokens`, `sys_objects_search`, `sys_shared_sites`, `sys_stat_site`, `sys_alerts`, `sys_alerts_handlers`, `sys_injections`, `sys_injections_admin`, `sys_modules`, `sys_modules_file_tracks`, `sys_permalinks`, `sys_privacy_actions`, `sys_privacy_defaults`, `sys_privacy_groups`, `sys_privacy_members`, `sys_tags`, `sys_objects_tag`, `sys_menu_top`, `sys_transactions`, `sys_objects_actions`, `sys_objects_auths`, `sys_greetings`, `sys_zip_codes`, `sys_objects_vote`, `sys_objects_views`, `sys_box_download`, `sys_cron_jobs`, `sys_sbs_users`, `sys_sbs_entries`, `sys_sbs_types`, `sys_sbs_queue`, `sys_sbs_messages`, `sys_profiles_match_mails`, `sys_dnsbl_rules`, `sys_dnsbl_block_log`, `sys_dnsbluri_zones` ;8 DROP TABLE IF EXISTS `sys_account_custom_stat_elements`, `sys_admin_ban_list`, `sys_admin_dashboard`, `sys_menu_admin`, `sys_menu_admin_top`, `sys_menu_bottom`, `sys_albums`, `sys_albums_objects`,`sys_banners`, `sys_banners_clicks`, `sys_banners_shows`, `sys_block_list`, `sys_categories`, `sys_objects_categories`, `sys_objects_cmts`, `sys_cmts_profile`, `sys_cmts_track`, `sys_color_base`, `sys_countries`, `sys_email_templates`, `sys_menu_member`, `sys_friend_list`, `sys_options`, `sys_options_cats`, `sys_fave_list`, `sys_ip_list`, `sys_ip_members_visits`, `sys_localization_categories`, `sys_localization_keys`, `sys_localization_languages`, `sys_localization_string_params`, `sys_localization_strings`, `sys_acl_actions`, `sys_acl_actions_track`, `sys_acl_matrix`, `sys_acl_level_prices`, `sys_acl_levels`, `sys_messages`, `sys_page_compose`, `sys_page_compose_pages`, `sys_page_compose_privacy`, `sys_sessions`, `sys_stat_member`, `sys_pre_values`, `sys_profile_fields`, `sys_acl_levels_members`, `Profiles`, `sys_profile_views_track`, `sys_profiles_match`, `sys_profile_rating`, `sys_profile_voting_track`, `RayBoardCurrentUsers`, `RayBoardBoards`, `RayBoardUsers`, `RayChatCurrentUsers`, `RayChatMessages`, `RayChatProfiles`, `RayChatRooms`, `RayChatRoomsUsers`, `RayChatMembershipsSettings`, `RayChatMemberships`, `RayImContacts`, `RayImMessages`, `RayImPendings`, `RayImProfiles`, `RayMp3Files`, `RayMp3Tokens`, `RayShoutboxMessages`, `RayVideoFiles`, `RayVideoTokens`, `RayVideo_commentsFiles`, `RayVideo_commentsTokens`, `sys_objects_search`, `sys_shared_sites`, `sys_stat_site`, `sys_alerts`, `sys_alerts_handlers`, `sys_injections`, `sys_injections_admin`, `sys_modules`, `sys_modules_file_tracks`, `sys_permalinks`, `sys_privacy_actions`, `sys_privacy_defaults`, `sys_privacy_groups`, `sys_privacy_members`, `sys_tags`, `sys_objects_tag`, `sys_menu_top`, `sys_transactions`, `sys_objects_actions`, `sys_objects_auths`, `sys_greetings`, `sys_zip_codes`, `sys_objects_vote`, `sys_objects_views`, `sys_box_download`, `sys_cron_jobs`, `sys_sbs_users`, `sys_sbs_entries`, `sys_sbs_types`, `sys_sbs_queue`, `sys_sbs_messages`, `sys_profiles_match_mails`, `sys_dnsbl_rules`, `sys_dnsbl_block_log`, `sys_dnsbluri_zones`, `sys_menu_mobile`; 9 9 ALTER DATABASE DEFAULT CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci'; 10 10 … … 3508 3508 3509 3509 3510 -- -------------------------------------------------------- 3511 3512 CREATE TABLE IF NOT EXISTS `sys_menu_mobile` ( 3513 `id` int(11) NOT NULL AUTO_INCREMENT, 3514 `type` varchar(32) NOT NULL, 3515 `menu` varchar(32) NOT NULL, 3516 `title` varchar(255) NOT NULL, 3517 `icon` varchar(255) NOT NULL, 3518 `action` int(11) NOT NULL, 3519 `action_data` varchar(255) NOT NULL, 3520 `eval_bubble` text NOT NULL, 3521 `eval_hidden` text NOT NULL, 3522 `order` int(11) NOT NULL, 3523 `active` int(11) NOT NULL, 3524 PRIMARY KEY (`id`) 3525 ) ENGINE=MyISAM DEFAULT CHARSET=utf8; 3526 3527 INSERT INTO `sys_menu_mobile` (`type`, `menu`, `title`, `icon`, `action`, `action_data`, `eval_bubble`, `eval_hidden`, `order`, `active`) VALUES 3528 ('system', 'homepage', '_sys_mobile_status', 'home_status.png', 1, '', '', '', 1, 1), 3529 ('system', 'homepage', '_sys_mobile_mail', 'home_messages.png', 3, '', 'return getNewLettersNum({member_id});', '', 2, 1), 3530 ('system', 'homepage', '_sys_mobile_friends', 'home_friends.png', 4, '', 'return getFriendRequests({member_id});', '', 3, 1), 3531 ('system', 'homepage', '_sys_mobile_info', 'home_info.png', 5, '', '', '', 4, 1), 3532 ('system', 'homepage', '_sys_mobile_search', 'home_search.png', 6, '', '', '', 5, 1), 3533 ('system', 'profile', '_sys_mobile_profile_info', '', 8, '', '', '', 1, 1), 3534 ('system', 'profile', '_sys_mobile_profile_contact', '', 3, '', '', '', 2, 1), 3535 ('system', 'profile', '_sys_mobile_profile_friends', '', 4, '', 'return getFriendNumber(''{profile_id}'');', '', 3, 1); 3536 -
trunk/modules/boonex/map_profiles/install/langs/en.php
r15211 r15386 59 59 '_bx_map_%d_members' => '%d members', 60 60 '_bx_map_unknown_city' => 'Unknown', 61 '_bx_map_location' => 'Location', 61 62 ); 62 63 -
trunk/modules/boonex/map_profiles/install/sql/install.sql
r14515 r15386 190 190 ('map_profiles', 'view_location', '_bx_map_privacy_view_location', '3'); 191 191 192 -- mobile 193 194 SET @iMaxOrderHomepage = (SELECT MAX(`order`)+1 FROM `sys_menu_mobile` WHERE `menu` = 'homepage'); 195 SET @iMaxOrderProfile = (SELECT MAX(`order`)+1 FROM `sys_menu_mobile` WHERE `menu` = 'profile'); 196 INSERT INTO `sys_menu_mobile` (`type`, `menu`, `title`, `icon`, `action`, `action_data`, `eval_bubble`, `eval_hidden`, `order`, `active`) VALUES 197 ('bx_map', 'homepage', '_bx_map_location', 'home_location.png', 2, '', '', '', @iMaxOrderHomepage, 1), 198 ('bx_map', 'profile', '_bx_map_location', '', 2, '', '', '', @iMaxOrderProfile, 1); 199 -
trunk/modules/boonex/map_profiles/install/sql/uninstall.sql
r11776 r15386 38 38 -- privacy 39 39 DELETE FROM `sys_privacy_actions` WHERE `module_uri` = 'map_profiles'; 40 41 -- mobile 42 43 DELETE FROM `sys_menu_mobile` WHERE `type` = 'bx_map'; 44 -
trunk/modules/boonex/news/classes/BxNewsModule.php
r15211 r15386 162 162 163 163 /** 164 * View list of latest news from mobile app 165 */ 166 function actionMobileLatestNews() { 167 168 bx_import('BxDolMobileTemplate'); 169 $oMobileTemplate = new BxDolMobileTemplate($this->_oConfig, $this->_oDb); 170 $oMobileTemplate->pageStart(); 171 172 $sCaption = _t('_news_bcaption_latest'); 173 174 $aEntries = $this->_oDb->getEntries(array( 175 'sample_type' => 'all', 176 'sample_params' => '', 177 'viewer_type' => $this->_oTextData->getViewerType(), 178 'start' => 0, 179 'count' => 10, 180 'filter_value' => '', 181 )); 182 183 if (empty($aEntries)) { 184 $oMobileTemplate->displayNoData($sCaption); 185 return; 186 } 187 188 foreach ($aEntries as $aEntry) { 189 $aVars = array ( 190 'content' => '<h2>' . $aEntry['caption'] . '</h2>' . getLocaleDate($aEntry['when_uts'], BX_DOL_LOCALE_DATE), 191 'url' => bx_js_string(BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'mobile_entry/' . $aEntry['id']), 192 ); 193 echo $oMobileTemplate->parseHtmlByName('mobile_row.html', $aVars); 194 } 195 196 $oMobileTemplate->pageCode($sCaption, false); 197 } 198 199 /** 200 * News entry view from mobile app 201 */ 202 function actionMobileEntry($iId) { 203 204 bx_import('BxDolMobileTemplate'); 205 $oMobileTemplate = new BxDolMobileTemplate($this->_oConfig, $this->_oDb); 206 $oMobileTemplate->pageStart(); 207 208 $aParams = array( 209 'sample_type' => 'id', 210 'id' => (int)$iId, 211 ); 212 $aEntry = $this->_oDb->getEntries($aParams); 213 214 if (empty($aEntry)) { 215 $oMobileTemplate->displayPageNotFound(); 216 return; 217 } 218 219 echo '<h1>' . $aEntry['caption'] . '</h1>'; 220 echo getLocaleDate($aEntry['when_uts'], BX_DOL_LOCALE_DATE); 221 echo $aEntry['content']; 222 223 $oMobileTemplate->pageCode($aEntry['caption']); 224 } 225 226 /** 164 227 * Private methods. 165 228 */ -
trunk/modules/boonex/news/install/sql/install.sql
r14107 r15386 201 201 INSERT INTO `sys_cron_jobs` (`name`, `time`, `class`, `file`, `eval`) VALUES 202 202 ('bx_news', '*/5 * * * *', 'BxNewsCron', 'modules/boonex/news/classes/BxNewsCron.php', ''); 203 204 -- mobile 205 206 SET @iMaxOrderHomepage = (SELECT MAX(`order`)+1 FROM `sys_menu_mobile` WHERE `menu` = 'homepage'); 207 INSERT INTO `sys_menu_mobile` (`type`, `menu`, `title`, `icon`, `action`, `action_data`, `eval_bubble`, `eval_hidden`, `order`, `active`) VALUES 208 ('bx_news', 'homepage', '_news_bcaption_view_main', '{site_url}modules/boonex/news/templates/base/images/icons/mobile_icon.png', 100, '{site_url}modules/?r=news/mobile_latest_news/', '', '', @iMaxOrderHomepage, 0); 209 -
trunk/modules/boonex/news/install/sql/uninstall.sql
r14001 r15386 38 38 39 39 DELETE FROM `sys_cron_jobs` WHERE `name`='bx_news'; 40 41 -- mobile 42 43 DELETE FROM `sys_menu_mobile` WHERE `type` = 'bx_news'; 44 -
trunk/modules/boonex/photos/install/sql/install.sql
r14991 r15386 284 284 SET @iHandler := LAST_INSERT_ID(); 285 285 INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES ('profile', 'delete', @iHandler); 286 287 -- mobile 288 289 SET @iMaxOrderHomepage = (SELECT MAX(`order`)+1 FROM `sys_menu_mobile` WHERE `menu` = 'homepage'); 290 SET @iMaxOrderProfile = (SELECT MAX(`order`)+1 FROM `sys_menu_mobile` WHERE `menu` = 'profile'); 291 INSERT INTO `sys_menu_mobile` (`type`, `menu`, `title`, `icon`, `action`, `action_data`, `eval_bubble`, `eval_hidden`, `order`, `active`) VALUES 292 ('[db_prefix]', 'homepage', '_bx_photos', 'home_images.png', 7, '', '', '', @iMaxOrderHomepage, 1), 293 ('[db_prefix]', 'profile', '_bx_photos', '', 7, '', 'return BxDolXMLRPCMedia::_getMediaCount(''photo'', ''{profile_id}'', ''{member_id}'');', '', @iMaxOrderProfile, 1); 294 -
trunk/modules/boonex/photos/install/sql/uninstall.sql
r12381 r15386 62 62 DELETE FROM `sys_alerts` WHERE `handler_id` = @iHandler; 63 63 DELETE FROM `sys_alerts_handlers` WHERE `id` = @iHandler; 64 65 -- mobile 66 67 DELETE FROM `sys_menu_mobile` WHERE `type` = '[db_prefix]'; 68 -
trunk/modules/boonex/sounds/install/sql/install.sql
r14991 r15386 248 248 SET @iHandler := LAST_INSERT_ID(); 249 249 INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES ('profile', 'delete', @iHandler); 250 251 -- mobile 252 253 SET @iMaxOrderHomepage = (SELECT MAX(`order`)+1 FROM `sys_menu_mobile` WHERE `menu` = 'homepage'); 254 SET @iMaxOrderProfile = (SELECT MAX(`order`)+1 FROM `sys_menu_mobile` WHERE `menu` = 'profile'); 255 INSERT INTO `sys_menu_mobile` (`type`, `menu`, `title`, `icon`, `action`, `action_data`, `eval_bubble`, `eval_hidden`, `order`, `active`) VALUES 256 ('[db_prefix]', 'homepage', '_bx_sounds', 'home_sounds.png', 9, '', '', '', @iMaxOrderHomepage, 1), 257 ('[db_prefix]', 'profile', '_bx_sounds', '', 9, '', 'return BxDolXMLRPCMedia::_getMediaCount(''music'', ''{profile_id}'', ''{member_id}'')', '', @iMaxOrderProfile, 1); 258 -
trunk/modules/boonex/sounds/install/sql/uninstall.sql
r12381 r15386 63 63 DELETE FROM `sys_alerts` WHERE `handler_id` = @iHandler; 64 64 DELETE FROM `sys_alerts_handlers` WHERE `id` = @iHandler; 65 66 -- mobile 67 68 DELETE FROM `sys_menu_mobile` WHERE `type` = '[db_prefix]'; 69 -
trunk/modules/boonex/videos/install/sql/install.sql
r14991 r15386 251 251 SET @iHandler := LAST_INSERT_ID(); 252 252 INSERT INTO `sys_alerts` (`unit`, `action`, `handler_id`) VALUES ('profile', 'delete', @iHandler); 253 254 -- mobile 255 256 SET @iMaxOrderHomepage = (SELECT MAX(`order`)+1 FROM `sys_menu_mobile` WHERE `menu` = 'homepage'); 257 SET @iMaxOrderProfile = (SELECT MAX(`order`)+1 FROM `sys_menu_mobile` WHERE `menu` = 'profile'); 258 INSERT INTO `sys_menu_mobile` (`type`, `menu`, `title`, `icon`, `action`, `action_data`, `eval_bubble`, `eval_hidden`, `order`, `active`) VALUES 259 ('[db_prefix]', 'homepage', '_bx_videos', 'home_videos.png', 8, '', '', '', @iMaxOrderHomepage, 1), 260 ('[db_prefix]', 'profile', '_bx_videos', '', 8, '', 'return BxDolXMLRPCMedia::_getMediaCount(''video'', ''{profile_id}'', ''{member_id}'')', '', @iMaxOrderProfile, 1); 261 -
trunk/modules/boonex/videos/install/sql/uninstall.sql
r12381 r15386 63 63 DELETE FROM `sys_alerts` WHERE `handler_id` = @iHandler; 64 64 DELETE FROM `sys_alerts_handlers` WHERE `id` = @iHandler; 65 66 67 -- mobile 68 69 DELETE FROM `sys_menu_mobile` WHERE `type` = '[db_prefix]'; 70 -
trunk/xmlrpc/BxDolXMLRPCUser.php
r15211 r15386 7 7 $iId = BxDolXMLRPCUtil::checkLogin ($sUser, $sPwd); 8 8 return new xmlrpcresp(new xmlrpcval($iId, "int")); 9 } 10 11 function login2($sUser, $sPwd) 12 { 13 $iId = BxDolXMLRPCUtil::checkLogin ($sUser, $sPwd); 14 return new xmlrpcresp(new xmlrpcval(array( 15 'member_id' => new xmlrpcval($iId, "int"), 16 'protocol_ver' => new xmlrpcval(BX_XMLRPC_PROTOCOL_VER, "int"), 17 ), "struct")); 9 18 } 10 19 … … 55 64 } 56 65 57 function get UserInfo($sUser, $sPwd, $sNick, $sLang)66 function getHomepageInfo2($sUser, $sPwd, $sLang) 58 67 { 68 if (!($iId = BxDolXMLRPCUtil::checkLogin ($sUser, $sPwd))) 69 return new xmlrpcresp(new xmlrpcval(array('error' => new xmlrpcval(1,"int")), "struct")); 70 71 BxDolXMLRPCUtil::setLanguage ($sLang); 72 73 $aRet = BxDolXMLRPCUtil::getUserInfo($iId); 74 75 $aMarkersReplace = array ( 76 'member_id' => $iId, 77 'member_username' => $sUser, 78 'member_password' => $sPwd, 79 ); 80 $aRet['menu'] = new xmlrpcval(BxDolXMLRPCUtil::getMenu('homepage', $aMarkersReplace), 'array'); 81 82 return new xmlrpcval ($aRet, "struct"); 83 } 84 85 function getUserInfo2($sUser, $sPwd, $sNick, $sLang) { 59 86 $iIdProfile = BxDolXMLRPCUtil::getIdByNickname ($sNick); 60 87 if (!$iIdProfile || !($iId = BxDolXMLRPCUtil::checkLogin ($sUser, $sPwd))) 61 88 return new xmlrpcresp(new xmlrpcval(array('error' => new xmlrpcval(1,"int")), "struct")); 62 89 63 BxDolXMLRPCUtil::setLanguage ($sLang); 90 BxDolXMLRPCUtil::setLanguage ($sLang); 64 91 65 if ($iIdProfile != $iId) 66 { 67 // privacy 68 bx_import('BxDolPrivacy'); 69 $oPrivacy = new BxDolPrivacy('Profiles', 'ID', 'ID'); 70 if ($iIdProfile != $iId && !$oPrivacy->check('view', $iIdProfile, $iId)) 71 return new xmlrpcval ('-1'); 92 $mixedRet = BxDolXMLRPCUser::_checkUserPrivacy ($iId, $iIdProfile); 93 if (true !== $mixedRet) 94 return $mixedRet; 72 95 73 // membership 74 $aCheckRes = checkAction($iId, ACTION_ID_VIEW_PROFILES, true, $iIdProfile); 75 if ($aCheckRes[CHECK_ACTION_RESULT] != CHECK_ACTION_RESULT_ALLOWED) 76 return new xmlrpcval ($aCheckRes[CHECK_ACTION_MESSAGE]); 77 } 96 $aRet['info'] = new xmlrpcval (BxDolXMLRPCUtil::getUserInfo($iIdProfile, 0, false), "struct"); 78 97 79 $aRet = BxDolXMLRPCUtil::getUserInfo($iIdProfile); 98 $aMarkersReplace = array ( 99 'member_id' => $iId, 100 'member_username' => $sUser, 101 'member_password' => $sPwd, 102 'profile_id' => $iIdProfile, 103 'profile_username' => $sNick, 104 ); 105 $aRet['menu'] = new xmlrpcval(BxDolXMLRPCUtil::getMenu('profile', $aMarkersReplace), 'array'); 106 80 107 return new xmlrpcval ($aRet, "struct"); 81 108 } 82 109 110 function getUserInfo($sUser, $sPwd, $sNick, $sLang) { 111 $iIdProfile = BxDolXMLRPCUtil::getIdByNickname ($sNick); 112 if (!$iIdProfile || !($iId = BxDolXMLRPCUtil::checkLogin ($sUser, $sPwd))) 113 return new xmlrpcresp(new xmlrpcval(array('error' => new xmlrpcval(1,"int")), "struct")); 114 115 BxDolXMLRPCUtil::setLanguage ($sLang); 116 117 $mixedRet = BxDolXMLRPCUser::_checkUserPrivacy ($iId, $iIdProfile); 118 if (true !== $mixedRet) 119 return $mixedRet; 120 121 $aRet = BxDolXMLRPCUtil::getUserInfo($iIdProfile, 0, true); 122 return new xmlrpcval ($aRet, "struct"); 123 } 124 125 function _checkUserPrivacy($iId, $iIdProfile) 126 { 127 $mixedAccessDenied = false; 128 129 if ($iIdProfile != $iId) 130 { 131 // privacy 132 bx_import('BxDolPrivacy'); 133 $oPrivacy = new BxDolPrivacy('Profiles', 'ID', 'ID'); 134 if ($iIdProfile != $iId && !$oPrivacy->check('view', $iIdProfile, $iId)) 135 $mixedAccessDenied = '-1'; 136 137 // membership 138 if (false === $mixedAccessDenied) { 139 $aCheckRes = checkAction($iId, ACTION_ID_VIEW_PROFILES, true, $iIdProfile); 140 if ($aCheckRes[CHECK_ACTION_RESULT] != CHECK_ACTION_RESULT_ALLOWED) 141 $mixedAccessDenied = $aCheckRes[CHECK_ACTION_MESSAGE]; 142 } 143 } 144 145 $oZ = new BxDolAlerts('mobile', 'view_profile', $iIdProfile, $iId, array('access_denied' => &$mixedAccessDenied)); 146 $oZ->alert(); 147 148 if (false !== $mixedAccessDenied) 149 return new xmlrpcval ($mixedAccessDenied); 150 151 return true; 152 } 153 83 154 function getUserInfoExtra($sUser, $sPwd, $sNick, $sLang) 84 155 { -
trunk/xmlrpc/BxDolXMLRPCUtil.php
r15211 r15386 47 47 $aAll[$aRow['ID']] = $aRow; 48 48 49 $oZ = new BxDolAlerts('mobile', 'contacts', $iId, 0, array('contacts_data' => $aAll)); 50 $oZ->alert(); 49 51 50 52 foreach ($aAll as $aRow) … … 86 88 } 87 89 88 function getUserInfo($iId, $iIdViewer = 0 )90 function getUserInfo($iId, $iIdViewer = 0, $isCountData = true) 89 91 { 90 92 if (!$iIdViewer) … … 100 102 $aRet['city'] = new xmlrpcval($aSexSql['City']); 101 103 $aRet['status'] = new xmlrpcval($aSexSql['UserStatusMessage']); 102 $aRet['countFriends'] = new xmlrpcval(getFriendNumber($iId)); 103 104 $aRet['countPhotos'] = new xmlrpcval(BxDolXMLRPCMedia::_getMediaCount('photo', $iId, $iIdViewer)); 105 $aRet['countVideos'] = new xmlrpcval(BxDolXMLRPCMedia::_getMediaCount('video', $iId, $iIdViewer)); 106 $aRet['countSounds'] = new xmlrpcval(BxDolXMLRPCMedia::_getMediaCount('music', $iId, $iIdViewer)); 107 104 105 if ($isCountData) { 106 $aRet['countFriends'] = new xmlrpcval(getFriendNumber($iId)); 107 $aRet['countPhotos'] = new xmlrpcval(BxDolXMLRPCMedia::_getMediaCount('photo', $iId, $iIdViewer)); 108 $aRet['countVideos'] = new xmlrpcval(BxDolXMLRPCMedia::_getMediaCount('video', $iId, $iIdViewer)); 109 $aRet['countSounds'] = new xmlrpcval(BxDolXMLRPCMedia::_getMediaCount('music', $iId, $iIdViewer)); 110 } 111 112 bx_import('BxDolAlerts'); 113 $oZ = new BxDolAlerts('mobile', 'user_info', $iId, $iIdViewer, array('profile' => &$aSexSql, 'return_data' => &$aRet)); 114 $oZ->alert(); 115 108 116 return $aRet; 109 117 } … … 119 127 bx_import('BxDolAlbums'); 120 128 121 returnarray (129 $aRet = array ( 122 130 'ID' => new xmlrpcval($a['ID']), 123 131 'Title' => new xmlrpcval($a['Headline']), … … 133 141 $sImageKey => new xmlrpcval($sImage), 134 142 ); 135 } 143 144 $oZ = new BxDolAlerts('mobile', 'user_info2', $a['ID'], $iIdViewer, array('profile' => &$a, 'return_data' => &$aRet)); 145 $oZ->alert(); 146 147 return $aRet; 148 } 149 150 function getMenu ($sMenu, $aMarkersReplace = array ()) { 151 152 $aDefaultMarkers = array ( 153 'site_url' => BX_DOL_URL_ROOT, 154 ); 155 $aMarkersReplace = array_merge($aDefaultMarkers, $aMarkersReplace); 156 $aKeys = array_keys($aMarkersReplace); 157 $aValues = array_values($aMarkersReplace); 158 foreach ($aKeys as $k => $v) 159 $aKeys[$k] = '{' . $v . '}'; 160 161 $aMenu = array (); 162 $aRecords = $GLOBALS['MySQL']->getAll("SELECT * FROM `sys_menu_mobile` WHERE `menu` = '$sMenu' AND `active` = 1 ORDER BY `order`"); 163 164 $oZ = new BxDolAlerts('mobile', 'menu', 0, 0, array('menu' => $sMenu, 'data' => &$aRecords, 'markers_replace' => &$aMarkersReplace)); 165 $oZ->alert(); 166 167 foreach ($aRecords as $r) { 168 $a = array (); 169 if ($r['eval_hidden']) { 170 if ($aMarkersReplace) 171 $sVal = str_replace($aKeys, $aValues, $r['eval_hidden']); 172 if (@eval($sVal)) 173 continue; 174 } 175 foreach ($r as $sName => $sVal) { 176 switch ($sName) { 177 case 'eval_hidden': 178 break; 179 case 'eval_bubble': 180 if ($sVal && $aMarkersReplace) 181 $sVal = str_replace($aKeys, $aValues, $sVal); 182 $a['bubble'] = new xmlrpcval($sVal ? @eval($sVal) : ''); 183 break; 184 case 'icon': 185 case 'action_data': 186 if ($sVal && $aMarkersReplace) 187 $sVal = str_replace($aKeys, $aValues, $sVal); 188 $a[$sName] = new xmlrpcval($sVal); 189 break; 190 case 'title': 191 $a[$sName] = new xmlrpcval(_t($sVal)); 192 break; 193 default: 194 $a[$sName] = new xmlrpcval($sVal); 195 } 196 } 197 $aMenu[] = new xmlrpcval($a, 'struct'); 198 } 199 return $aMenu; 200 } 136 201 137 202 function getIdByNickname ($sUser) … … 143 208 function checkLogin ($sUser, $sPwd) 144 209 { 145 //sleep(1);146 210 $iId = (int)BxDolXMLRPCUtil::getIdByNickname ($sUser); 147 211 $aProfile = getProfileInfo((int)$iId); … … 150 214 $_COOKIE["memberID" ] = $iId; 151 215 $_COOKIE["memberPassword"] = sha1($sPwd . $aProfile['Salt']); 152 return ($GLOBALS['logged']['member'] = member_auth(0, false)) ? $iId : 0; 216 $iRet = ($GLOBALS['logged']['member'] = member_auth(0, false)) ? $iId : 0; 217 218 $oZ = new BxDolAlerts('mobile', 'check_login', $iId, 0, array('password' => $sPwd, 'return_data' => &$iRet)); 219 $oZ->alert(); 220 221 return $iRet; 153 222 } 154 223 -
trunk/xmlrpc/index.php
r15211 r15386 20 20 require_once(BX_DIRECTORY_PATH_ROOT . 'xmlrpc/lib/xmlrpc_wrappers.inc'); 21 21 22 define('BX_XMLRPC_PROTOCOL_VER', 2); 23 22 24 $s = new xmlrpc_server( 23 25 array( … … 50 52 "docstring" => "returns user id on success or 0 if login failed", 51 53 ), 54 "dolphin.login2" => array( 55 "function" => "BxDolXMLRPCUser::login2", 56 "signature" => array (array ($xmlrpcInt, $xmlrpcString, $xmlrpcString)), 57 "docstring" => "returns user id on success or 0 if login failed (v.2)", 58 ), 52 59 "dolphin.getHomepageInfo" => array( 53 60 "function" => "BxDolXMLRPCUser::getHomepageInfo", … … 55 62 "docstring" => "return logged in user information to dispay on homepage", 56 63 ), 64 "dolphin.getHomepageInfo2" => array( 65 "function" => "BxDolXMLRPCUser::getHomepageInfo2", 66 "signature" => array (array ($xmlrpcStruct, $xmlrpcString, $xmlrpcString, $xmlrpcString)), 67 "docstring" => "return logged in user information to dispay on homepage (v.2)", 68 ), 57 69 "dolphin.getUserInfo" => array( 58 70 "function" => "BxDolXMLRPCUser::getUserInfo", … … 60 72 "docstring" => "return user information", 61 73 ), 74 "dolphin.getUserInfo2" => array( 75 "function" => "BxDolXMLRPCUser::getUserInfo2", 76 "signature" => array (array ($xmlrpcStruct, $xmlrpcString, $xmlrpcString, $xmlrpcString, $xmlrpcString)), 77 "docstring" => "return user information (v.2)", 78 ), 62 79 "dolphin.getUserInfoExtra" => array( 63 80 "function" => "BxDolXMLRPCUser::getUserInfoExtra",
Note: See TracChangeset
for help on using the changeset viewer.