Jelajahi Sumber

Merge branch 'master' of https://github.com/boonex/dolphin

AntonLV 13 tahun lalu
induk
melakukan
ba4c6bd9ed
100 mengubah file dengan 29 tambahan dan 9195 penghapusan
  1. 7 12
      inc/classes/BxDolAccount.php
  2. 17 2
      inc/classes/BxDolProfile.php
  3. 0 27
      inc/utils.inc.php
  4. 1 41
      install/sql/v70.sql
  5. 0 13
      modules/boonex/data_migration/classes/BxCheckerMigration.php
  6. 0 234
      modules/boonex/data_migration/classes/BxDataMigrationAds.php
  7. 0 150
      modules/boonex/data_migration/classes/BxDataMigrationArticles.php
  8. 0 241
      modules/boonex/data_migration/classes/BxDataMigrationBlogs.php
  9. 0 34
      modules/boonex/data_migration/classes/BxDataMigrationConfig.php
  10. 0 47
      modules/boonex/data_migration/classes/BxDataMigrationCron.php
  11. 0 114
      modules/boonex/data_migration/classes/BxDataMigrationData.php
  12. 0 234
      modules/boonex/data_migration/classes/BxDataMigrationDb.php
  13. 0 239
      modules/boonex/data_migration/classes/BxDataMigrationEvents.php
  14. 0 87
      modules/boonex/data_migration/classes/BxDataMigrationFeedback.php
  15. 0 122
      modules/boonex/data_migration/classes/BxDataMigrationForum.php
  16. 0 218
      modules/boonex/data_migration/classes/BxDataMigrationGroups.php
  17. 0 184
      modules/boonex/data_migration/classes/BxDataMigrationMembership.php
  18. 0 506
      modules/boonex/data_migration/classes/BxDataMigrationModule.php
  19. 0 95
      modules/boonex/data_migration/classes/BxDataMigrationNews.php
  20. 0 521
      modules/boonex/data_migration/classes/BxDataMigrationOrcaForum.php
  21. 0 36
      modules/boonex/data_migration/classes/BxDataMigrationPhotos.php
  22. 0 193
      modules/boonex/data_migration/classes/BxDataMigrationPoll.php
  23. 0 311
      modules/boonex/data_migration/classes/BxDataMigrationProfilePhotos.php
  24. 0 290
      modules/boonex/data_migration/classes/BxDataMigrationProfiles.php
  25. 0 310
      modules/boonex/data_migration/classes/BxDataMigrationProfilesCustomFields.php
  26. 0 385
      modules/boonex/data_migration/classes/BxDataMigrationSharedPhotos.php
  27. 0 363
      modules/boonex/data_migration/classes/BxDataMigrationSounds.php
  28. 0 221
      modules/boonex/data_migration/classes/BxDataMigrationTemplate.php
  29. 0 380
      modules/boonex/data_migration/classes/BxDataMigrationVideos.php
  30. 0 44
      modules/boonex/data_migration/index.php
  31. 0 124
      modules/boonex/data_migration/install/config.php
  32. 0 1
      modules/boonex/data_migration/install/info/inst_concl.html
  33. 0 1
      modules/boonex/data_migration/install/info/inst_intro.html
  34. 0 1
      modules/boonex/data_migration/install/info/uninst_concl.html
  35. 0 0
      modules/boonex/data_migration/install/info/uninst_intro.html
  36. 0 31
      modules/boonex/data_migration/install/installer.php
  37. 0 48
      modules/boonex/data_migration/install/langs/en.php
  38. 0 64
      modules/boonex/data_migration/install/sql/install.sql
  39. 0 29
      modules/boonex/data_migration/install/sql/uninstall.sql
  40. 0 27
      modules/boonex/data_migration/js/data_migration.js
  41. 0 32
      modules/boonex/data_migration/request.php
  42. 0 9
      modules/boonex/data_migration/templates/base/css/data_migration.css
  43. TEMPAT SAMPAH
      modules/boonex/data_migration/templates/base/images/icons/data_migration.gif
  44. TEMPAT SAMPAH
      modules/boonex/data_migration/templates/base/images/icons/loading.gif
  45. 0 52
      modules/boonex/facebook_connect/classes/BxFaceBookConnectAlerts.php
  46. 0 71
      modules/boonex/facebook_connect/classes/BxFaceBookConnectConfig.php
  47. 0 245
      modules/boonex/facebook_connect/classes/BxFaceBookConnectDb.php
  48. 0 590
      modules/boonex/facebook_connect/classes/BxFaceBookConnectModule.php
  49. 0 99
      modules/boonex/facebook_connect/classes/BxFaceBookConnectTemplate.php
  50. 0 775
      modules/boonex/facebook_connect/inc/facebook.php
  51. 0 125
      modules/boonex/facebook_connect/install/config.php
  52. 0 1
      modules/boonex/facebook_connect/install/info/inst_concl.html
  53. 0 1
      modules/boonex/facebook_connect/install/info/inst_intro.html
  54. 0 1
      modules/boonex/facebook_connect/install/info/uninst_concl.html
  55. 0 0
      modules/boonex/facebook_connect/install/info/uninst_intro.html
  56. 0 48
      modules/boonex/facebook_connect/install/installer.php
  57. 0 35
      modules/boonex/facebook_connect/install/langs/en.php
  58. 0 160
      modules/boonex/facebook_connect/install/sql/install.sql
  59. 0 84
      modules/boonex/facebook_connect/install/sql/uninstall.sql
  60. 0 32
      modules/boonex/facebook_connect/request.php
  61. TEMPAT SAMPAH
      modules/boonex/facebook_connect/templates/base/images/icons/facebook-icon_little.png
  62. TEMPAT SAMPAH
      modules/boonex/facebook_connect/templates/base/images/icons/facebook-small-logo.png
  63. TEMPAT SAMPAH
      modules/boonex/facebook_connect/templates/base/images/icons/wi-std.png
  64. 0 1
      modules/boonex/facebook_connect/templates/base/login_form.html
  65. 0 3
      modules/boonex/facebook_connect/templates/base/page_55.html
  66. 0 34
      modules/boonex/google_search/classes/BxGSearchConfig.php
  67. 0 42
      modules/boonex/google_search/classes/BxGSearchDb.php
  68. 0 158
      modules/boonex/google_search/classes/BxGSearchModule.php
  69. 0 58
      modules/boonex/google_search/classes/BxGSearchPageMain.php
  70. 0 38
      modules/boonex/google_search/classes/BxGSearchTemplate.php
  71. 0 119
      modules/boonex/google_search/install/config.php
  72. 0 30
      modules/boonex/google_search/install/installer.php
  73. 0 34
      modules/boonex/google_search/install/langs/en.php
  74. 0 35
      modules/boonex/google_search/install/sql/install.sql
  75. 0 17
      modules/boonex/google_search/install/sql/uninstall.sql
  76. 0 29
      modules/boonex/google_search/request.php
  77. 0 8
      modules/boonex/google_search/templates/base/admin.html
  78. 0 12
      modules/boonex/google_search/templates/base/css/main.css
  79. TEMPAT SAMPAH
      modules/boonex/google_search/templates/base/images/icons/google.png
  80. 0 3
      modules/boonex/google_search/templates/base/page_401.html
  81. 0 42
      modules/boonex/google_search/templates/base/search.html
  82. 0 6
      modules/boonex/google_search/templates/base/search_form.html
  83. 4 0
      upgrade/files/.gitignore
  84. 0 10
      upgrade/files/7.0.0-7.0.1/check.php
  85. 0 31
      upgrade/files/7.0.0-7.0.1/conclusion.html
  86. 0 32
      upgrade/files/7.0.0-7.0.1/lang_en.php
  87. 0 9
      upgrade/files/7.0.0-7.0.1/modules/ads/lang_en.php
  88. 0 7
      upgrade/files/7.0.0-7.0.1/modules/ads/sql.sql
  89. 0 13
      upgrade/files/7.0.0-7.0.1/modules/articles/lang_en.php
  90. 0 11
      upgrade/files/7.0.0-7.0.1/modules/articles/sql.sql
  91. 0 3
      upgrade/files/7.0.0-7.0.1/modules/avatar/sql.sql
  92. 0 7
      upgrade/files/7.0.0-7.0.1/modules/blogs/lang_en.php
  93. 0 18
      upgrade/files/7.0.0-7.0.1/modules/blogs/sql.sql
  94. 0 3
      upgrade/files/7.0.0-7.0.1/modules/board/sql.sql
  95. 0 3
      upgrade/files/7.0.0-7.0.1/modules/chat/sql.sql
  96. 0 3
      upgrade/files/7.0.0-7.0.1/modules/custom_rss/sql.sql
  97. 0 3
      upgrade/files/7.0.0-7.0.1/modules/data_migration/sql.sql
  98. 0 3
      upgrade/files/7.0.0-7.0.1/modules/desktop/sql.sql
  99. 0 11
      upgrade/files/7.0.0-7.0.1/modules/events/lang_en.php
  100. 0 19
      upgrade/files/7.0.0-7.0.1/modules/events/sql.sql

+ 7 - 12
inc/classes/BxDolAccount.php

@@ -104,12 +104,12 @@ class BxDolAccount extends BxDol {
         if ($ret !== null)
             return $ret;
 
-        if ($this->_oQuery->updateCurrentProfile($iId, $iSwitchToProfileId)) {
-            bx_alert('account', 'switch_context', $iId, $iSwitchToProfileId, array('profile_id_old' => $aInfo['profile_id']));
-            return true;
-        }
+        if (!$this->_oQuery->updateCurrentProfile($iId, $iSwitchToProfileId))
+            return false;
 
-        return false;
+        bx_alert('account', 'switch_context', $iId, $iSwitchToProfileId, array('profile_id_old' => $aInfo['profile_id']));
+
+        return true;
     }
 
     /**
@@ -211,19 +211,14 @@ class BxDolAccount extends BxDol {
         bx_import('BxDolAccountQuery');
         $oAccountQuery = BxDolAccountQuery::getInstance();
 
-        // delete associated content 
-        // TODO: remake deletion of associated content
-        //$oAccountQuery->res("DELETE FROM `sys_admin_ban_list` WHERE `ProfID`='". $ID . "' LIMIT 1");
-        //$oAccountQuery->res("DELETE FROM `sys_block_list` WHERE `ID` = '{$ID}' OR `Profile` = '{$ID}'" );
-
         bx_import('BxDolProfile');
         $oProfileQuery = BxDolProfileQuery::getInstance();
         $aProfiles = $oProfileQuery->getProfilesByAccount($ID);
         foreach ($aProfiles as $iProfileId => $aRow) {
             $oProfile = BxDolProfile::getInstance($iProfileId);
             if (!$oProfile)
-                continue;
-            $oProfile->delete();
+                continue;            
+            $oProfile->delete(false, true);
         }
 
         // delete profile

+ 17 - 2
inc/classes/BxDolProfile.php

@@ -171,8 +171,11 @@ class BxDolProfile extends BxDol {
 
     /**
      * Delete profile.
+     * @param $ID - optional profile id to delete
+     * @param $bForceDelete - force deletetion is case of account profile deletion
+     * @return false on error, or true on success
      */
-    function delete($ID = false) {
+    function delete($ID = false, $bForceDelete = false) {
 
         $ID = (int)$ID;
         if (!$ID)
@@ -182,6 +185,19 @@ class BxDolProfile extends BxDol {
         if (!$aProfileInfo)
             return false;
 
+        // delete system profiles (accounts) is not allowed, instead - delete whole account
+        if (!$bForceDelete && 'system' == $aProfileInfo['type'])
+            return false;
+    
+        // switch profile context if deleted profile is active profile context
+        bx_import('BxDolAccount');
+        $oAccount = BxDolAccount::getInstance ($aProfileInfo['account_id']);
+        $aAccountInfo = $oAccount->getInfo();
+        if (!$bForceDelete && $ID == $aAccountInfo['profile_id']) {
+            $oProfileAccount = BxDolProfile::getInstanceAccountProfile($aProfileInfo['account_id']);
+            $oAccount->updateProfileContext($oProfileAccount->id());
+        }
+
         // create system event before deletion
         $isStopDeletion = false;
         bx_alert('profile', 'before_delete', $ID, 0, array('stop_deletion' => &$isStopDeletion));
@@ -190,7 +206,6 @@ class BxDolProfile extends BxDol {
 
         // delete associated content 
         // TODO: remake deletion of associated content
-        $this->_oQuery->res("DELETE FROM `sys_friend_list` WHERE ID = {$ID} OR Profile = {$ID}");
         $this->_oQuery->res("DELETE FROM `sys_acl_levels_members` WHERE `IDMember` = {$ID}");
         $this->_oQuery->res("DELETE FROM `sys_tags` WHERE `ObjID` = {$ID} AND `Type` = 'profile'");
 

+ 0 - 27
inc/utils.inc.php

@@ -104,33 +104,6 @@ function getLocaleFormat($iCode = BX_DOL_LOCALE_DATE_SHORT, $iType = BX_DOL_LOCA
     return $sResult;
 }
 
-/**
- * Function will check on blocked status;
- *
- * @param  : $iFirstProfile (integer) - first profile's id;
- * @param  : $iSecondProfile (integer) - second profile's id;
- * @return : (boolean) - true if pair will blocked;
- */
-function isBlocked($iFirstProfile, $iSecondProfile)
-{
-    $iFirstProfile = (int)$iFirstProfile;
-    $iSecondProfile = (int)$iSecondProfile;
-    $sQuery = "SELECT COUNT(*) FROM `sys_block_list` WHERE `ID` = {$iFirstProfile} AND `Profile` = {$iSecondProfile}";
-    return db_value( $sQuery) ? true : false;
-}
-
-/*
- * function for work with profile
- */
-function is_friends($id1, $id2) {
-    $id1 = (int)$id1;
-    $id2 = (int)$id2;
-    if ($id1 == 0 || $id2 == 0)
-       return;
-    $cnt = db_arr("SELECT SUM(`Check`) AS 'cnt' FROM `sys_friend_list` WHERE `ID`='{$id1}' AND `Profile`='{$id2}' OR `ID`='{$id2}' AND `Profile`='{$id1}'");
-    return ($cnt['cnt'] > 0 ? true : false);
-}
-
 /*
  * functions for limiting maximal word length
  */

+ 1 - 41
install/sql/v70.sql

@@ -5,37 +5,13 @@
 -- --------------------------------------------------------
 
 SET NAMES 'utf8';
-DROP TABLE IF EXISTS `sys_admin_ban_list`, `sys_block_list`, `sys_categories`, `sys_keys`, `sys_objects_editor`, `sys_objects_captcha`, `sys_objects_social_sharing`, `sys_objects_categories`, `sys_objects_cmts`, `sys_email_templates`, `sys_friend_list`, `sys_options`, `sys_options_cats`, `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_sessions`, `sys_acl_levels_members`, `sys_objects_search`, `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_transactions`, `sys_objects_auths`, `sys_objects_vote`, `sys_objects_views`, `sys_cron_jobs`, `sys_dnsbl_rules`, `sys_dnsbl_block_log`, `sys_dnsbluri_zones`, `sys_menu_mobile`, `sys_menu_mobile_pages`, `sys_objects_storage`, `sys_objects_uploader`, `sys_storage_user_quotas`, `sys_storage_tokens`, `sys_storage_ghosts`, `sys_storage_mime_types`, `sys_objects_transcoder_images`, `sys_transcoder_images_files`, `sys_transcoder_images_filters`,`sys_accounts`,`sys_profiles`;
+DROP TABLE IF EXISTS `sys_categories`, `sys_keys`, `sys_objects_editor`, `sys_objects_captcha`, `sys_objects_social_sharing`, `sys_objects_categories`, `sys_objects_cmts`, `sys_email_templates`, `sys_options`, `sys_options_cats`, `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_sessions`, `sys_acl_levels_members`, `sys_objects_search`, `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_transactions`, `sys_objects_auths`, `sys_objects_vote`, `sys_objects_views`, `sys_cron_jobs`, `sys_dnsbl_rules`, `sys_dnsbl_block_log`, `sys_dnsbluri_zones`, `sys_menu_mobile`, `sys_menu_mobile_pages`, `sys_objects_storage`, `sys_objects_uploader`, `sys_storage_user_quotas`, `sys_storage_tokens`, `sys_storage_ghosts`, `sys_storage_mime_types`, `sys_objects_transcoder_images`, `sys_transcoder_images_files`, `sys_transcoder_images_filters`,`sys_accounts`,`sys_profiles`;
 ALTER DATABASE DEFAULT CHARACTER SET 'utf8' COLLATE 'utf8_unicode_ci';
 
 
 -- --------------------------------------------------------
 
 
-CREATE TABLE `sys_admin_ban_list` (
-  `ProfID` int(10) unsigned NOT NULL default '0',
-  `Time` int(10) unsigned NOT NULL default '0',
-  `DateTime` datetime NOT NULL default '0000-00-00 00:00:00',
-  PRIMARY KEY (`ProfID`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
-
--- --------------------------------------------------------
-
-
-CREATE TABLE `sys_block_list` (
-  `ID` int(10) unsigned NOT NULL default '0',
-  `Profile` int(10) unsigned NOT NULL default '0',
-  `When` timestamp NOT NULL default CURRENT_TIMESTAMP,
-  UNIQUE KEY `BlockPair` (`ID`,`Profile`),
-  KEY `ID` (`ID`),
-  KEY `Profile` (`Profile`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
-
--- --------------------------------------------------------
-
-
 CREATE TABLE `sys_categories` (
   `Category` varchar(32) NOT NULL default '',
   `ID` int(10) unsigned NOT NULL default '0',
@@ -198,22 +174,6 @@ INSERT INTO `sys_email_templates` (`Module`, `NameSystem`, `Name`, `Subject`, `B
 ('system', '_sys_et_txt_name_system_mem_expiration', 't_MemExpiration', '_sys_et_txt_subject_mem_expiration', '_sys_et_txt_body_mem_expiration'),
 ('system', '_sys_et_txt_name_system_mem_changed', 't_MemChanged', '_sys_et_txt_subject_mem_changed', '_sys_et_txt_body_mem_changed');
 
-
--- --------------------------------------------------------
-
---
--- Table structure for table `sys_friend_list`
---
-
-CREATE TABLE `sys_friend_list` (
-  `ID` int(10) unsigned NOT NULL default '0',
-  `Profile` int(10) unsigned NOT NULL default '0',
-  `Check` tinyint(2) NOT NULL default '0',
-  `When` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
-  UNIQUE KEY `FriendPair` (`ID`,`Profile`),
-  KEY `Profile` (`Profile`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
 -- --------------------------------------------------------
 
 --

+ 0 - 13
modules/boonex/data_migration/classes/BxCheckerMigration.php

@@ -1,13 +0,0 @@
-<?php
-
-    class BxCheckerMigration extends BxDolFormCheckerHelper
-    {
-        function checkDolpinDirectory($sPath)
-        {
-            if ( substr( $sPath, strlen($sPath) - 1 ) != DIRECTORY_SEPARATOR ) {
-                $sPath .= DIRECTORY_SEPARATOR;
-            }
-
-            return is_dir($sPath) && is_file($sPath . 'inc/header.inc.php') ? true : false;
-        }
-    }

+ 0 - 234
modules/boonex/data_migration/classes/BxDataMigrationAds.php

@@ -1,234 +0,0 @@
-<?php
-
-require_once 'BxDataMigrationData.php';
-
-class BxDataMigrationAds extends BxDataMigrationData {
-    var $iTransffered = 0;
-
-    /**
-     * Class constructor;
-     *
-     * @param  : $oMigrationModule (object) - object instance of migration class;
-     * @param  : $rOldDb (resourse) - connect to old dolphin's database;
-     * @param  : $oDolModule (object);
-     * @return : void;
-     */
-    function BxDataMigrationAds(&$oMigrationModule, &$rOldDb, $oDolModule = '') {
-         parent::BxDataMigrationData($oMigrationModule, $rOldDb, $oDolModule);
-    }
-
-    /**
-     * Function will migrate data;
-     *
-     * @return : (integer) operation result;
-     */
-    function getMigration() {
-        if(!$this -> oDolModule) {
-             $this -> setResultStatus('System error: object instance of Ads is not received');
-             return MIGRATION_FAILED;
-        }
-
-        // set new status;
-        $this -> setResultStatus('Ads transfer now');
-
-         mysql_query('SET NAMES utf8', $this->rOldDb);
-
-        // transfer all profiles ads and categories;
-        $sError = $this -> transferProfileAds();
-        if($sError) {
-            $this -> setResultStatus($sError);
-            return MIGRATION_FAILED;
-        }
-
-        // set as finished;
-        $this -> setResultStatus('All Ads were transferred (' .  $this -> iTransffered . ' items)');
-
-        return MIGRATION_SUCCESSFUL;
-    }
-
-    /**
-     * Function will transfer all profile's ads and categories;
-     *
-     * @return : void;
-     */
-    function transferProfileAds() {
-        $sTruncateSQL1 = "TRUNCATE TABLE `bx_ads_main`";
-        $this -> oMigrationModule -> _oDb -> query($sTruncateSQL1);
-        $sTruncateSQL2 = "TRUNCATE TABLE `bx_ads_cmts`";
-        $this -> oMigrationModule -> _oDb -> query($sTruncateSQL2);
-        $sTruncateSQL3 = "TRUNCATE TABLE `bx_ads_main_media`";
-        $this -> oMigrationModule -> _oDb -> query($sTruncateSQL3);
-        $sTruncateSQL4 = "TRUNCATE TABLE `bx_ads_category`";
-        $this -> oMigrationModule -> _oDb -> query($sTruncateSQL4);
-        $sTruncateSQL5 = "TRUNCATE TABLE `bx_ads_category_subs`";
-        $this -> oMigrationModule -> _oDb -> query($sTruncateSQL5);
-
-        // categories
-        $sQuery  = "SELECT * FROM `Classifieds`";
-        $rResult = mysql_query($sQuery, $this -> rOldDb);
-        while($aRow = mysql_fetch_assoc($rResult)) {
-            $iCatID = (int)$aRow['ID'];
-            $sCatName = $this -> oMigrationModule -> _oDb  -> escape($aRow['Name']);
-            $sCatUri = $this -> oMigrationModule -> _oDb  -> escape($aRow['CEntryUri']);
-            $sCatDescription = $this -> oMigrationModule -> _oDb  -> escape($aRow['Description']);
-            $sCatCustomFieldName1 = $this -> oMigrationModule -> _oDb  -> escape($aRow['CustomFieldName1']);
-            $sCatCustomFieldName2 = $this -> oMigrationModule -> _oDb  -> escape($aRow['CustomFieldName2']);
-            $sCatUnit = $this -> oMigrationModule -> _oDb  -> escape($aRow['Unit']);
-
-            $sAddCatQuery =
-            "
-                INSERT INTO
-                    `bx_ads_category`
-                SET
-                    `ID` = '{$iCatID}',
-                    `Name` = '{$sCatName}',
-                    `CEntryUri` = '{$sCatUri}',
-                    `Description` = '{$sCatDescription}',
-                    `CustomFieldName1` = '{$sCatCustomFieldName1}',
-                    `CustomFieldName2` = '{$sCatCustomFieldName2}',
-                    `Unit1` = '{$sCatUnit}',
-                    `Unit2` = '{$sCatUnit}',
-                    `Picture` = 'bx_ads.png'
-           ";
-           $this -> oMigrationModule -> _oDb -> query($sAddCatQuery);
-        }
-
-        // subcategories
-        $sSubQuery  = "SELECT * FROM `ClassifiedsSubs`";
-        $rSubResult = mysql_query($sSubQuery, $this -> rOldDb);
-        while($aSubRow = mysql_fetch_assoc($rSubResult)) {
-            $iSubCatID = (int)$aSubRow['ID'];
-            $iSubCatParentID = (int)$aSubRow['IDClassified'];
-            $sSubCatName = $this -> oMigrationModule -> _oDb  -> escape($aSubRow['NameSub']);
-            $sSubCatUri = $this -> oMigrationModule -> _oDb  -> escape($aSubRow['SEntryUri']);
-            $sSubCatDescription = $this -> oMigrationModule -> _oDb  -> escape($aSubRow['Description']);
-
-            $sAddSubCatQuery =
-            "
-                INSERT INTO
-                    `bx_ads_category_subs`
-                SET
-                    `ID` = '{$iSubCatID}',
-                    `IDClassified` = '{$iSubCatParentID}',
-                    `NameSub` = '{$sSubCatName}',
-                    `SEntryUri` = '{$sSubCatUri}',
-                    `Description` = '{$sSubCatDescription}'
-           ";
-           $this -> oMigrationModule -> _oDb -> query($sAddSubCatQuery);
-        }
-
-        // ads
-        $sAdsQuery  = "SELECT *, UNIX_TIMESTAMP(`DateTime`) AS 'Date_UTS' FROM `ClassifiedsAdvertisements`";
-        $rAdsResult = mysql_query($sAdsQuery, $this -> rOldDb);
-        while($aAdsRow = mysql_fetch_assoc($rAdsResult)) {
-            $iAdID = (int)$aAdsRow['ID'];
-            $iAdOwnerID = (int)$aAdsRow['IDProfile'];
-            $iAdCatID = (int)$aAdsRow['IDClassifiedsSubs'];
-            $sAdDateTime = (int)$aAdsRow['Date_UTS'];
-            $sAdSubject = $this -> oMigrationModule -> _oDb  -> escape($aAdsRow['Subject']);
-            $sAdUri = $this -> oMigrationModule -> _oDb  -> escape($aAdsRow['EntryUri']);
-            $sAdMessage = $this -> oMigrationModule -> _oDb  -> escape($aAdsRow['Message']);
-            $sAdStatus = $this -> oMigrationModule -> _oDb  -> escape($aAdsRow['Status']);
-            $iAdCustomVal1 = (int)$aAdsRow['CustomFieldValue1'];
-            $iAdCustomVal2 = (int)$aAdsRow['CustomFieldValue2'];
-            $iAdLifeTime = (int)$aAdsRow['LifeTime'];
-            $sAdMedia = $aAdsRow['Media'];
-            $sAdTags = $this -> oMigrationModule -> _oDb  -> escape($aAdsRow['Tags']);
-
-            $sCommentsCntSQL  = "SELECT COUNT(*) FROM `CmtsClassifieds` WHERE `cmt_object_id`='{$iAdID}'";
-            $rCommentsCntRes = mysql_query($sCommentsCntSQL, $this -> rOldDb);
-            $aCommentsCnt = mysql_fetch_array($rCommentsCntRes);
-            $iCommentsCnt = (int)$aCommentsCnt[0];
-
-            $sPostQuery =
-            "
-                INSERT INTO
-                    `bx_ads_main`
-                SET
-                    `ID` = '{$iAdID}',
-                    `IDProfile` = '{$iAdOwnerID}',
-                    `IDClassifiedsSubs` = '{$iAdCatID}',
-                    `DateTime` = '{$sAdDateTime}',
-                    `Subject` = '{$sAdSubject}',
-                    `EntryUri` = '{$sAdUri}',
-                    `Message` = '{$sAdMessage}',
-                    `Status` = '{$sAdStatus}',
-                    `CustomFieldValue1` = '{$iAdCustomVal1}',
-                    `CustomFieldValue2` = '{$iAdCustomVal2}',
-                    `LifeTime` = '{$iAdLifeTime}',
-                    `Media` = '{$sAdMedia}',
-                    `Tags` = '{$sAdTags}',
-                    `Country` = '',
-                    `City` = '',
-                    `Featured` = 0,
-                    `Views` = 0,
-                    `Rate` = 0,
-                    `RateCount` = 0,
-                    `CommentsCount` = {$iCommentsCnt},
-                    `AllowView` = '3',
-                    `AllowRate` = '3',
-                    `AllowComment` = '3'
-           ";
-           $this -> oMigrationModule -> _oDb -> query($sPostQuery);
-           $this -> iTransffered++;
-        }
-
-        // config_mediaImages
-        $sSrcPath = $this -> oMigrationModule -> _oDb -> getExtraParam('config_mediaImages') . 'classifieds/';
-        $sDstPath = BX_DIRECTORY_PATH_ROOT . $this -> oDolModule->sUploadDir;
-
-        // ads media
-        $sAdMediaQuery  = "SELECT *, UNIX_TIMESTAMP(`MediaDate`) AS 'Date_UTS' FROM `ClassifiedsAdvertisementsMedia`";
-        $rAdMediaResult = mysql_query($sAdMediaQuery, $this -> rOldDb);
-        while($aAdMediaRow = mysql_fetch_assoc($rAdMediaResult)) {
-            $iAdMediaID = (int)$aAdMediaRow['MediaID'];
-            $iAdMediaOwnerID = (int)$aAdMediaRow['MediaProfileID'];
-            $sAdMediaFile = $this -> oMigrationModule -> _oDb  -> escape($aAdMediaRow['MediaFile']);
-            $sAdMediaDate = (int)$aAdMediaRow['Date_UTS'];
-
-            $sAddSubCatQuery =
-            "
-                INSERT INTO
-                    `bx_ads_main_media`
-                SET
-                    `MediaID` = '{$iAdMediaID}',
-                    `MediaProfileID` = '{$iAdMediaOwnerID}',
-                    `MediaType` = 'photo',
-                    `MediaFile` = '{$sAdMediaFile}',
-                    `MediaDate` = '{$sAdMediaDate}'
-           ";
-           $this -> oMigrationModule -> _oDb -> query($sAddSubCatQuery);
-
-           @copy($sSrcPath . 'img_' . $sAdMediaFile, $sDstPath . '_img_' . $sAdMediaFile);
-
-           $vResizeRes = imageResize( $sDstPath . '_img_' . $sAdMediaFile, $sDstPath . "img_{$sAdMediaFile}", $this -> oDolModule->iImgSize, $this -> oDolModule->iImgSize );
-           $vThumbResizeRes = imageResize( $sDstPath . '_img_' . $sAdMediaFile, $sDstPath . "thumb_{$sAdMediaFile}", $this -> oDolModule->iThumbSize, $this -> oDolModule->iThumbSize );
-           $vBigThumbResizeRes = imageResize( $sDstPath . '_img_' . $sAdMediaFile, $sDstPath . "big_thumb_{$sAdMediaFile}", $this -> oDolModule->iBigThumbSize, $this -> oDolModule->iBigThumbSize );
-           $vIconResizeRes = imageResize( $sDstPath . '_img_' . $sAdMediaFile, $sDstPath . "icon_{$sAdMediaFile}", $this -> oDolModule->iIconSize, $this -> oDolModule->iIconSize );
-
-           @unlink ($sDstPath . '_img_' . $sAdMediaFile);
-        }
-
-        // moving comments
-        $sCommQuery = "SELECT * FROM `CmtsClassifieds`";
-        $rCommResult = mysql_query($sCommQuery, $this -> rOldDb);
-        while($aCommRow = mysql_fetch_assoc($rCommResult)) {
-            $iCmtID = (int)$aCommRow['cmt_id'];
-            $iCmtParentID = (int)$aCommRow['cmt_parent_id'];
-            $iCmtObjectID = (int)$aCommRow['cmt_object_id'];
-            $iCmtAuthorID = (int)$aCommRow['cmt_author_id'];
-            $sCmtText = $this -> oMigrationModule -> _oDb -> escape($aCommRow['cmt_text']);
-            $iCmtRate = (int)$aCommRow['cmt_rate'];
-            $iCmtRateCnt = (int)$aCommRow['cmt_rate_count'];
-            $sCmtTime = $aCommRow['cmt_time'];
-            $sCmtReplies = (int)$aCommRow['cmt_replies'];
-
-            $sCommSQL = "
-                INSERT INTO `bx_ads_cmts` (`cmt_id`, `cmt_parent_id`, `cmt_object_id`, `cmt_author_id`, `cmt_text`, `cmt_mood`, `cmt_rate`, `cmt_rate_count`, `cmt_time`, `cmt_replies`) VALUES ({$iCmtID}, {$iCmtParentID}, {$iCmtObjectID}, {$iCmtAuthorID}, '{$sCmtText}', 0, {$iCmtRate}, {$iCmtRateCnt}, '{$sCmtTime}', {$sCmtReplies});
-            ";
-            $this -> oMigrationModule -> _oDb -> query($sCommSQL);
-        }
-    }
-}
-
-?>

+ 0 - 150
modules/boonex/data_migration/classes/BxDataMigrationArticles.php

@@ -1,150 +0,0 @@
-<?php
-    /***************************************************************************
-    *                            Dolphin Smart Community Builder
-    *                              -------------------
-    *     begin                : Mon Mar 23 2006
-    *     copyright            : (C) 2007 BoonEx Group
-    *     website              : http://www.boonex.com
-    * This file is part of Dolphin - Smart Community Builder
-    *
-    * Dolphin is free software; you can redistribute it and/or modify it under
-    * the terms of the GNU General Public License as published by the
-    * Free Software Foundation; either version 2 of the
-    * License, or  any later version.
-    *
-    * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-    * without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-    * See the GNU General Public License for more details.
-    * You should have received a copy of the GNU General Public License along with Dolphin,
-    * see license.txt file; if not, write to marketing@boonex.com
-    ***************************************************************************/
-
-    bx_import('BxDolCategories');
-    require_once 'BxDataMigrationData.php';
-
-    class BxDataMigrationArticles extends BxDataMigrationData {
-        var $_sType;
-
-        function BxDataMigrationArticles(&$oMigrationModule, &$rOldDb, $oDolModule = '') {
-             parent::BxDataMigrationData($oMigrationModule, $rOldDb, $oDolModule);
-
-             $this->_sType = 'bx_' . $this->oDolModule->_oConfig->getUri();
-        }
-
-        function getMigration() {
-            $this->setResultStatus('The transfer was started.');
-
-                mysql_query('SET NAMES utf8', $this->rOldDb);
-
-            //--- Transfer Categories ---//
-            if($this->transferCategories() == MIGRATION_FAILED)
-                return MIGRATION_FAILED;
-
-            //--- Transfer Main Content ---//
-            return $this->transferContent();
-        }
-
-        function transferCategories() {
-
-            $sSql = "SELECT
-                    `CategoryID` AS `id`,
-                    `CategoryName` AS `name`
-                FROM `ArticlesCategory`";
-            $rResult = mysql_query($sSql, $this -> rOldDb);
-            $iCount = mysql_num_rows($rResult);
-
-            while($aCategory = mysql_fetch_assoc($rResult)) {
-
-                if (get_mb_len($aCategory['name']) > 32)
-                    $aCategory['name'] = get_mb_substr ($aCategory['name'], 0, 32);
-
-                if($this->existsCategory($aCategory['name'], 0, $this->_sType))
-                    continue;
-
-                //escape all values
-                $aCategory['name']=    $this -> oMigrationModule -> _oDb  -> escape($aCategory['name']);
-
-                $sSql = "INSERT INTO `sys_categories`(`Category`, `ID`, `Type`, `Owner`, `Status`, `Date`)
-                     VALUES('" . $aCategory['name'] . "', '0', '" . $this->_sType . "', '0', 'active', NOW())";
-
-                $iResult = (int)$this->oDolModule->_oDb->query($sSql);
-                if($iResult <= 0) {
-                    $this->setResultStatus('Database error. Cannot insert category in the database.');
-                    return MIGRATION_FAILED;
-                }
-            }
-
-            return MIGRATION_SUCCESSFUL;
-        }
-
-        function transferContent() {
-        $sSql = "SELECT
-                    `ta`.`ArticlesID` AS `id`,
-                    `ta`.`ownerID` AS `author_id`,
-                    `ta`.`Title` AS `caption`,
-                    `ta`.`Text` AS `content`,
-                    `ta`.`ArticleUri` AS `uri`,
-                    '' AS `tags`,
-                    `tac`.`CategoryName` AS `categories`,
-                    '0' AS `comment`,
-                    '0' AS `vote`,
-                    UNIX_TIMESTAMP(`Date`) AS `date`,
-                    '0' AS `status`,
-                    '0' AS `featured`,
-                    '0' AS `rate`,
-                    '0' AS `rate_count`,
-                    '0' AS `view_count`,
-                    '0' AS `cmts_count`
-                FROM `Articles` AS `ta`
-                LEFT JOIN `ArticlesCategory` AS `tac` ON `ta`.`CategoryID`=`tac`.`CategoryID`
-                ORDER BY `Date` ASC";
-            $rResult = mysql_query($sSql, $this -> rOldDb);
-            $iCount = mysql_num_rows($rResult);
-
-            $oCategories = new BxDolCategories();
-            while($aItem = mysql_fetch_assoc($rResult)) {
-                $aItem['uri'] = uriGenerate ($aItem['caption']
-                    , $this->oDolModule->_oDb->getPrefix() . 'entries', 'uri');
-
-                if($this->existsItem($aItem['id'], $aItem['uri'])) {
-                    $this->setResultStatus('Duplicate data. Article with similar info already exists.');
-                    return MIGRATION_FAILED;
-                }
-
-                $sSql = "INSERT INTO `" . $this->oDolModule->_oDb->getPrefix() . "entries` SET";
-                foreach($aItem as $sKey => $sValue)
-                    $sSql .= " `" . $sKey . "`='" . $this -> oMigrationModule -> _oDb  -> escape($sValue) . "',";
-
-                $iResult = (int)$this->oDolModule->_oDb->query(substr($sSql, 0, -1));
-                if($iResult <= 0) {
-                    $this->setResultStatus('Database error. Cannot insert item in the database.');
-                    return MIGRATION_FAILED;
-                }
-
-                $oCategories->reparseObjTags($this->_sType, $this->oDolModule->_oDb->lastId());
-            }
-
-            $this->setResultStatus('The transfer was successfully completed. (' .  $iCount . ' items)');
-            return MIGRATION_SUCCESSFUL;
-        }
-
-        function existsCategory($sCategoryName, $iItemId, $sItemType) {
-            $iItemId = (int) $iItemId;
-
-            //-- escape all values --//
-            $sCategoryName = $this -> oMigrationModule -> _oDb  -> escape($sCategoryName);
-            $sItemType = $this -> oMigrationModule -> _oDb  -> escape($sItemType);
-            //--
-
-            $sSql = "SELECT `Category` FROM `sys_categories` WHERE `Category`='" . $sCategoryName . "' AND `ID`='" . $iItemId . "' AND `Type`='" . $sItemType . "' LIMIT 1";
-            return (string)$this->oDolModule->_oDb->getOne($sSql) != '';
-        }
-
-        function existsItem($iId, $sUri) {
-            $iId = (int) $iId;
-            $sUri = $this -> oMigrationModule -> _oDb  -> escape($sUri);
-
-            $sSql = "SELECT `id` FROM `" . $this->oDolModule->_oDb->getPrefix() . "entries` WHERE `id`='" . $iId . "' OR `uri`='" . $sUri . "' LIMIT 1";
-            return (int)$this->oDolModule->_oDb->getOne($sSql) != 0;
-        }
-    }

+ 0 - 241
modules/boonex/data_migration/classes/BxDataMigrationBlogs.php

@@ -1,241 +0,0 @@
-<?php
-
-require_once 'BxDataMigrationData.php';
-
-class BxDataMigrationBlogs extends BxDataMigrationData {
-    var $iTransffered = 0;
-    var $iPostsTransffered = 0;
-
-    /**
-     * Class constructor;
-     *
-     * @param  : $oMigrationModule (object) - object instance of migration class;
-     * @param  : $rOldDb (resourse) - connect to old dolphin's database;
-     * @param  : $oDolModule (object);
-     * @return : void;
-     */
-    function BxDataMigrationBlogs(&$oMigrationModule, &$rOldDb, $oDolModule = '') {
-        parent::BxDataMigrationData($oMigrationModule, $rOldDb, $oDolModule);
-    }
-
-    /**
-     * Function migrate blogs data;
-     *
-     * @return : (integer) operation result;
-     */
-    function getMigration() {
-        // set new status;
-        $this -> setResultStatus('All blogs transfer now');
-
-         mysql_query('SET NAMES utf8', $this->rOldDb);
-
-        // transfer all profiles blogs, categories and posts;
-        $this -> transferProfileBlogs();
-
-         // set as finished;
-         $this -> setResultStatus('All blogs were transferred (' .  $this -> iTransffered . ' blogs, ' .  $this -> iPostsTransffered . ' posts)');
-
-        return MIGRATION_SUCCESSFUL;
-    }
-
-    /**
-     * Function will transfer all profile's blogs, categories and posts;
-     *
-     * @return : void;
-     */
-    function transferProfileBlogs() {
-        $sTruncateSQL1 = "TRUNCATE TABLE `bx_blogs_cmts`";
-        $this -> oMigrationModule -> _oDb -> query($sTruncateSQL1);
-        $sTruncateSQL2 = "TRUNCATE TABLE `bx_blogs_main`";
-        $this -> oMigrationModule -> _oDb -> query($sTruncateSQL2);
-        $sTruncateSQL3 = "TRUNCATE TABLE `bx_blogs_posts`";
-        $this -> oMigrationModule -> _oDb -> query($sTruncateSQL3);
-        $sTruncateSQL4 = "DELETE FROM `sys_categories` WHERE `Type` = 'bx_blogs' AND `Owner` > 0";
-        $this -> oMigrationModule -> _oDb -> query($sTruncateSQL4);
-
-        $sSrcPath = $this -> oMigrationModule -> _oDb -> getExtraParam('config_mediaImages') . 'blog/';
-        $sDstPath = BX_DIRECTORY_PATH_ROOT . "media/images/blog/";
-
-        $aPosts = array();
-        $aCategories = array();
-
-        $sQuery  = "SELECT * FROM `Blogs` ORDER BY `OwnerID` ASC";
-        $rResult = mysql_query($sQuery, $this -> rOldDb);
-        while($aRow = mysql_fetch_assoc($rResult)) {
-            $iBlogID = (int)$aRow['ID'];
-            $iBlogOwnerID = (int)$aRow['OwnerID'];
-            $sBlogDescription = $this -> oMigrationModule -> _oDb  -> escape($aRow['Description']);
-
-            $sCatSQL  = "SELECT * FROM `BlogCategories` WHERE `OwnerID`='{$iBlogOwnerID}' ORDER BY `BlogCategories`.`CategoryID` ASC";
-
-            $rCatRes = mysql_query($sCatSQL, $this -> rOldDb);
-            while($aCatRow = mysql_fetch_assoc($rCatRes)) {
-                $iCatID = (int)$aCatRow['CategoryID'];
-
-                if (! array_key_exists($iCatID, $aCategories)) {
-                    $aCategories[$iCatID] = $iCatID;
-                    $sCatName = $aCatRow['CategoryName'];
-
-                    //-- eSASe modification --//
-                    if($sCatName == 'Uncategorized') {
-                        $sCatName = '';
-                    }
-
-                    if($sCatName && $this -> isCategoryExist('bx_blogs', $sCatName) ) {
-                            $sCatName = '';
-                    }
-                    //--
-
-                    $sCatName = $this -> oMigrationModule -> _oDb  -> escape($sCatName);
-
-                    $sPostsSQL = "SELECT *, UNIX_TIMESTAMP(`PostDate`) AS 'Date_UTS' FROM `BlogPosts` WHERE `CategoryID`='{$iCatID}' ORDER BY `BlogPosts`.`CategoryID` ASC";
-                    $rPostsRes = mysql_query($sPostsSQL, $this -> rOldDb);
-
-                    if (mysql_num_rows($rPostsRes)) {
-                        while($aPostsRow = mysql_fetch_assoc($rPostsRes)) {
-                            $iPostID = (int)$aPostsRow['PostID'];
-
-                            if (! array_key_exists($iPostID, $aPosts)) {
-                                $aPosts[$iPostID] = $iPostID;
-
-                                $iPostDateUTS = (int)$aPostsRow['Date_UTS'];
-                                $sPostCaption = $this -> oMigrationModule -> _oDb -> escape($aPostsRow['PostCaption']);
-                                $sPostUri = $this -> oMigrationModule -> _oDb -> escape($aPostsRow['PostUri']);
-                                $sPostText = $this -> oMigrationModule -> _oDb -> escape($aPostsRow['PostText']);
-                                $sPostStatus = $this -> oMigrationModule -> _oDb -> escape($aPostsRow['PostStatus']);
-                                $sPostPhoto = $this -> oMigrationModule -> _oDb -> escape($aPostsRow['PostPhoto']);
-                                $sPostTags = $this -> oMigrationModule -> _oDb -> escape($aPostsRow['Tags']);
-                                $iPostDateUTS = (int)$aPostsRow['Date_UTS'];
-                                $iAllowView = ($aPostsRow['PostReadPermission'] == 'public') ? 3 : 5;
-                                $iAllowComment = ($aPostsRow['PostCommentPermission'] == 'public') ? 3 : 5;
-
-                                $sPostCommentsCntSQL  = "SELECT COUNT(*) FROM `CmtsBlogPosts` WHERE `cmt_object_id`='{$iPostID}'";
-                                $rPostCommentsCntRes = mysql_query($sPostCommentsCntSQL, $this -> rOldDb);
-                                $aPostCommentsCnt = mysql_fetch_array($rPostCommentsCntRes);
-                                $iPostCommentsCnt = (int)$aPostCommentsCnt[0];
-
-                                // adding posts
-                                $sPostQuery =
-                                "
-                                    INSERT INTO
-                                        `bx_blogs_posts`
-                                    SET
-                                        `PostID` = '{$iPostID}',
-                                        `PostCaption` = '{$sPostCaption}',
-                                        `PostUri` = '{$sPostUri}',
-                                        `PostText` = '{$sPostText}',
-                                        `PostDate` = '{$iPostDateUTS}',
-                                        `PostStatus` = '{$sPostStatus}',
-                                        `PostPhoto` = '{$sPostPhoto}',
-                                        `Tags` = '{$sPostTags}',
-                                        `Featured` = 0,
-                                        `Views` = 0,
-                                        `Rate` = 0,
-                                        `RateCount` = 0,
-                                        `CommentsCount` = {$iPostCommentsCnt},
-                                        `OwnerID` = '{$iBlogOwnerID}',
-                                        `Categories` = '{$sCatName}',
-                                        `allowView` = {$iAllowView},
-                                        `allowRate` = 3,
-                                        `allowComment` = {$iAllowComment}
-                               ";
-                               $this -> oMigrationModule -> _oDb -> query($sPostQuery);
-                               $this -> iPostsTransffered++;
-
-                                // TODO images
-                                @copy($sSrcPath . 'big_' . $sPostPhoto, $sDstPath . '_big_' . $sPostPhoto);
-
-                                imageResize($sDstPath . '_big_' . $sPostPhoto, $sDstPath . 'small_' . $sPostPhoto, $this -> oDolModule->iIconSize, $this -> oDolModule->iIconSize);
-                                imageResize($sDstPath . '_big_' . $sPostPhoto, $sDstPath . 'big_' . $sPostPhoto, $this -> oDolModule->iThumbSize, $this -> oDolModule->iThumbSize);
-                                imageResize($sDstPath . '_big_' . $sPostPhoto, $sDstPath . 'orig_' . $sPostPhoto, $this -> oDolModule->iImgSize, $this -> oDolModule->iImgSize);
-
-                                @unlink ($sDstPath . '_big_' . $sPostPhoto);
-
-                                // adding custom categories (with >0 posts inside)
-                                if($sCatName) {
-                                    $sCatQuery =
-                                    "
-                                        INSERT INTO
-                                            `sys_categories`
-                                        SET
-                                            `Type` = 'bx_blogs',
-                                            `Category` = '{$sCatName}',
-                                            `Owner` = '{$iBlogOwnerID}',
-                                            `ID` = '{$iPostID}'
-                                   ";
-
-                                   $this -> oMigrationModule -> _oDb -> query($sCatQuery);
-                                }
-                            }
-                        }
-                    } else {
-                        // adding custom categories (with 0 posts inside)
-                        if($sCatName) {
-                            $sCatQuery =
-                            "
-                                INSERT INTO
-                                    `sys_categories`
-                                SET
-                                    `Type` = 'bx_blogs',
-                                    `Category` = '{$sCatName}',
-                                    `Owner` = '{$iBlogOwnerID}'
-                           ";
-
-                            $this -> oMigrationModule -> _oDb -> query($sCatQuery);
-                        }
-                    }
-                }
-            }
-
-            // adding blogs
-            $sBlogQuery =
-            "
-                INSERT INTO
-                    `bx_blogs_main`
-                SET
-                    `ID` = {$iBlogID},
-                    `OwnerID` = '{$iBlogOwnerID}',
-                    `Description` = '{$sBlogDescription}'
-           ";
-           $this -> oMigrationModule -> _oDb -> query($sBlogQuery);
-           $this -> iTransffered++;
-        }
-
-        // moving comments
-        $sCommQuery = "SELECT * FROM `CmtsBlogPosts`";
-        $rCommResult = mysql_query($sCommQuery, $this -> rOldDb);
-        while($aCommRow = mysql_fetch_assoc($rCommResult)) {
-            $iCmtID = (int)$aCommRow['cmt_id'];
-            $iCmtParentID = (int)$aCommRow['cmt_parent_id'];
-            $iCmtObjectID = (int)$aCommRow['cmt_object_id'];
-            $iCmtAuthorID = (int)$aCommRow['cmt_author_id'];
-            $sCmtText = $this -> oMigrationModule -> _oDb -> escape($aCommRow['cmt_text']);
-            $iCmtRate = (int)$aCommRow['cmt_rate'];
-            $iCmtRateCnt = (int)$aCommRow['cmt_rate_count'];
-            $sCmtTime = $aCommRow['cmt_time'];
-            $sCmtReplies = (int)$aCommRow['cmt_replies'];
-
-            $sCommSQL = "
-                INSERT INTO `bx_blogs_cmts` (`cmt_id`, `cmt_parent_id`, `cmt_object_id`, `cmt_author_id`, `cmt_text`, `cmt_mood`, `cmt_rate`, `cmt_rate_count`, `cmt_time`, `cmt_replies`) VALUES ({$iCmtID}, {$iCmtParentID}, {$iCmtObjectID}, {$iCmtAuthorID}, '{$sCmtText}', 0, {$iCmtRate}, {$iCmtRateCnt}, '{$sCmtTime}', {$sCmtReplies});
-            ";
-            $this -> oMigrationModule -> _oDb -> query($sCommSQL);
-
-        }
-    }
-
-    /**
-     * Check category;
-     *
-     * @return booelan - true if exist;
-     */
-    function isCategoryExist($sType, $sCategory)
-    {
-        $sCategory = $this -> oMigrationModule -> _oDb  -> escape($sCategory);
-        $sType = $this -> oMigrationModule -> _oDb  -> escape($sType);
-
-        $sQuery = "SELECT COUNT(*) FROM `sys_categories` WHERE `Type` = '{$sType}' AND `Category` = '{$sCategory}'";
-        return $this -> oMigrationModule -> _oDb -> getOne($sQuery) ? true : false;
-    }
-}
-
-?>

+ 0 - 34
modules/boonex/data_migration/classes/BxDataMigrationConfig.php

@@ -1,34 +0,0 @@
-<?php
-
-    /***************************************************************************
-    *                            Dolphin Smart Community Builder
-    *                              -------------------
-    *     begin                : Mon Mar 23 2006
-    *     copyright            : (C) 2007 BoonEx Group
-    *     website              : http://www.boonex.com
-    * This file is part of Dolphin - Smart Community Builder
-    *
-    * Dolphin is free software; you can redistribute it and/or modify it under
-    * the terms of the GNU General Public License as published by the
-    * Free Software Foundation; either version 2 of the
-    * License, or  any later version.
-    *
-    * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-    * without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-    * See the GNU General Public License for more details.
-    * You should have received a copy of the GNU General Public License along with Dolphin,
-    * see license.txt file; if not, write to marketing@boonex.com
-    ***************************************************************************/
-
-    require_once(BX_DIRECTORY_PATH_CLASSES . 'BxDolConfig.php');
-
-    class BxDataMigrationConfig extends BxDolConfig
-    {
-        /**
-         * Class constructor;
-         */
-        function BxDataMigrationConfig($aModule)
-        {
-            parent::BxDolConfig($aModule);
-        }
-    }

+ 0 - 47
modules/boonex/data_migration/classes/BxDataMigrationCron.php

@@ -1,47 +0,0 @@
-<?php
-
-    /***************************************************************************
-    *                            Dolphin Smart Community Builder
-    *                              -------------------
-    *     begin                : Mon Mar 23 2006
-    *     copyright            : (C) 2007 BoonEx Group
-    *     website              : http://www.boonex.com
-    * This file is part of Dolphin - Smart Community Builder
-    *
-    * Dolphin is free software; you can redistribute it and/or modify it under
-    * the terms of the GNU General Public License as published by the
-    * Free Software Foundation; either version 2 of the
-    * License, or  any later version.
-    *
-    * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-    * without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-    * See the GNU General Public License for more details.
-    * You should have received a copy of the GNU General Public License along with Dolphin,
-    * see license.txt file; if not, write to marketing@boonex.com
-    ***************************************************************************/
-
-    bx_import('BxDolCron');
-
-    require_once('BxDataMigrationModule.php');
-
-    class BxDataMigrationCron extends BxDolCron
-    {
-        var $oMigration;
-
-        /**
-         * Class constructor;
-         */
-        function BxDataMigrationCron()
-        {
-            $this -> oMigration = BxDolModule::getInstance('bx_data_migration');
-        }
-
-        /**
-         * To do something;
-         */
-        function processing()
-        {
-           //to do;
-           $this -> oMigration -> transferData();
-        }
-    }

+ 0 - 114
modules/boonex/data_migration/classes/BxDataMigrationData.php

@@ -1,114 +0,0 @@
-<?php
-
-    /***************************************************************************
-    *                            Dolphin Smart Community Builder
-    *                              -------------------
-    *     begin                : Mon Mar 23 2006
-    *     copyright            : (C) 2007 BoonEx Group
-    *     website              : http://www.boonex.com
-    * This file is part of Dolphin - Smart Community Builder
-    *
-    * Dolphin is free software; you can redistribute it and/or modify it under
-    * the terms of the GNU General Public License as published by the
-    * Free Software Foundation; either version 2 of the
-    * License, or  any later version.
-    *
-    * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-    * without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-    * See the GNU General Public License for more details.
-    * You should have received a copy of the GNU General Public License along with Dolphin,
-    * see license.txt file; if not, write to marketing@boonex.com
-    ***************************************************************************/
-
-    class BxDataMigrationData
-    {
-        var $oMigrationModule;
-        var $rOldDb;
-        var $oDolModule;
-
-        /**
-         * Class constructor;
-         *
-         * @param  : $oMigrationModule (object) - object instance of migration class;
-         * @param  : $rOldDb (resourse) - connect to old dolphin's database;
-         * @param  : $oDolModule (object);
-         * @return : void;
-         */
-        function BxDataMigrationData(&$oMigrationModule, &$rOldDb, $oDolModule = '')
-        {
-             $this -> oMigrationModule = $oMigrationModule;
-             $this -> rOldDb  = $rOldDb;
-             $this -> oDolModule = $oDolModule ? $oDolModule : '';
-        }
-
-        /**
-         * Function will migrate data;
-         *
-         * @return : (integer) operation result;
-         */
-        function getMigration()
-        {
-            $this -> setResultStatus('System error: method getMigration is not redefined');
-            return MIGRATION_FAILED;
-        }
-
-        /**
-         * Function set operation status;
-         *
-         * @return : void;
-         */
-        function setResultStatus($sStatus)
-        {
-            $sStatus = $this -> oMigrationModule -> _oDb -> escape($sStatus);
-            $sQuery =
-            "
-                UPDATE
-                    `{$this -> oMigrationModule -> _oDb -> sTablePrefix}transfers`
-                SET
-                    `status_text` = '{$sStatus}'
-                WHERE
-                    `module` = '{$this -> oMigrationModule -> sProcessedModule}'
-             ";
-
-            $this -> oMigrationModule -> _oDb -> query($sQuery);
-        }
-
-        // shortcut to escape
-        function escape($sText) {
-            return $this->oMigrationModule->_oDb->escape($sText);
-        }
-
-        /**
-         * Escape all strings values;
-         *
-         * @param $aRow array;
-         * @return array - escaped data;
-         */
-        function escapeData($aRow)
-        {
-            foreach($aRow as $sKey => $mValue)
-            {
-                $aRow[$sKey] = !is_numeric($mValue)
-                    ? $this->escape($mValue)
-                    : $mValue;
-            }
-
-            return $aRow;
-        }
-
-        // shortcut to query
-        function query($sQuery) {
-            //echoDbg($sQuery); return;
-            return $this->oMigrationModule->_oDb->query($sQuery);
-        }
-
-        // shortcut to getOne
-        function getOne($sQuery) {
-            return $this->oMigrationModule->_oDb->getOne($sQuery);
-        }
-
-        // shortcut to lastId
-        function lastId() {
-            return $this->oMigrationModule->_oDb->lastId();
-        }
-    }

+ 0 - 234
modules/boonex/data_migration/classes/BxDataMigrationDb.php

@@ -1,234 +0,0 @@
-<?php
-
-    /***************************************************************************
-    *                            Dolphin Smart Community Builder
-    *                              -------------------
-    *     begin                : Mon Mar 23 2006
-    *     copyright            : (C) 2007 BoonEx Group
-    *     website              : http://www.boonex.com
-    * This file is part of Dolphin - Smart Community Builder
-    *
-    * Dolphin is free software; you can redistribute it and/or modify it under
-    * the terms of the GNU General Public License as published by the
-    * Free Software Foundation; either version 2 of the
-    * License, or  any later version.
-    *
-    * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-    * without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-    * See the GNU General Public License for more details.
-    * You should have received a copy of the GNU General Public License along with Dolphin,
-    * see license.txt file; if not, write to marketing@boonex.com
-    ***************************************************************************/
-
-    require_once( BX_DIRECTORY_PATH_CLASSES . 'BxDolModuleDb.php' );
-
-    class BxDataMigrationDb extends BxDolModuleDb
-    {
-        var $_oConfig;
-        var $sTablePrefix;
-
-        /**
-         * Constructor.
-         */
-        function BxDataMigrationDb(&$oConfig)
-        {
-            parent::BxDolModuleDb();
-
-            $this -> _oConfig = $oConfig;
-            $this -> sTablePrefix = $oConfig -> getDbPrefix();
-        }
-
-        /**
-         * Function will create some config;
-         *
-         * @param  : $aConfig (array) - array with some of settings;
-         * @return : void;
-         */
-        function createConfig($aConfig)
-        {
-            if( is_array($aConfig) ) {
-                foreach($aConfig as $sName => $mValue)
-                {
-                    $mValue = $this -> escape($mValue);
-                    $sName  = $this -> escape($sName);
-
-                    // create new;
-                    if( !$this -> getExtraParam($sName) ) {
-                        $sQuery = "INSERT INTO `{$this -> sTablePrefix}config` SET `name` = '{$sName}', `value` = '{$mValue}'";
-                        $this -> query($sQuery);
-                    }
-                    else {
-                        // update exsisting;
-                        $sQuery = "UPDATE `{$this -> sTablePrefix}config` SET  `value` = '{$mValue}' WHERE `name` = '{$sName}'";
-                        $this -> query($sQuery);
-                    }
-                }
-            }
-        }
-
-        /**
-         * Function get transfer's status text;
-         *
-         * @param  : $sModule (string) - module's name;
-         * @param  : $sStatus (string) - transfer's status;
-         * @return : void;
-         */
-        function getTransferStatusText($sModule)
-        {
-            $sModule = $this -> escape($sModule);
-            $sQuery = "SELECT `status_text` FROM `{$this->sTablePrefix}transfers` WHERE `module` = '{$sModule}' LIMIT 1";
-            return $this -> getOne($sQuery);
-        }
-
-        /**
-         * Function get transfer's status;
-         *
-         * @param  : $sModule (string) - module's name;
-         * @param  : $sStatus (string) - transfer's status;
-         * @return : void;
-         */
-        function getTransferStatus($sModule)
-        {
-            $sModule = $this -> escape($sModule);
-            $sQuery = "SELECT `status` FROM `{$this->sTablePrefix}transfers` WHERE `module` = '{$sModule}' LIMIT 1";
-            return $this -> getOne($sQuery);
-        }
-
-        /**
-         * Function update transfer's status;
-         *
-         * @param  : $sModule (string) - module's name;
-         * @param  : $sStatus (string) - transfer's status;
-         * @return : void;
-         */
-        function updateTransferStatus($sModule, $sStatus)
-        {
-            $sModule = $this -> escape($sModule);
-            $sStatus = $this -> escape($sStatus);
-            $sQuery = "UPDATE `{$this->sTablePrefix}transfers` SET `status` = '{$sStatus}' WHERE `module` = '{$sModule}'";
-            $this -> query($sQuery);
-        }
-
-        /**
-         * Function will crete new transfer;
-         *
-         * @param  : $sModule (string) - module's name;
-         * @return : void;
-         */
-        function createTransfer($sModule)
-        {
-            $sModule = $this -> escape($sModule);
-            $sQuery = "INSERT INTO `{$this->sTablePrefix}transfers` SET `module` = '{$sModule}', `status` = 'not_started'";
-            $this -> query($sQuery);
-        }
-
-        /**
-         * Function will get the first transfer;
-         *
-         * @return : (string) - module's name;
-         */
-        function getFirstTransfer()
-        {
-            $sQuery = "SELECT `module` FROM `{$this->sTablePrefix}transfers` WHERE `status` = 'not_started' ORDER BY `id` LIMIT 1";
-            return $this -> getOne($sQuery);
-        }
-
-        /**
-         * Function will delete transfer from queue;
-         *
-         * @param  : $sModule (string) - module name;
-         * @return : void;
-         */
-        function deleteTransfer($sModule)
-        {
-            $sModule = $this -> escape($sModule);
-            $sQuery  = "DELETE FROM `{$this->sTablePrefix}transfers` WHERE `module` = '{$sModule}'";
-            $this -> query($sQuery);
-        }
-
-        /**
-         * Function will check transfer exsiting;
-         *
-         * @param  : $sModule (string) - module's name;
-         * @return : (boolean) true if isset;
-         */
-        function checkTransfer($sModule)
-        {
-            $sModule = $this -> escape($sModule);
-            $sQuery = "SELECT COUNT(*) FROM `{$this->sTablePrefix}transfers` WHERE `module` = '{$sModule}'";
-            return $this -> getOne($sQuery) ? true : false;
-        }
-
-        /**
-         * Function will get some config value;
-         *
-         * @param  : $sConfigName (sting) - config name;
-         * @return : (mixed) - config value;
-         */
-        function getExtraParam($sConfigName)
-        {
-            $sConfigName = $this -> escape($sConfigName);
-            return $this -> getOne("SELECT `value` FROM `{$this->sTablePrefix}config` WHERE `name` = '{$sConfigName}'");
-        }
-
-         /**
-         * Function will set some config value;
-         *
-         * @param  : $sConfigName  (sting) - config name;
-         * @param  : $mConfigValue (mixed) - config value;
-         * @return : void;
-         */
-        function setExtraParam($sConfigName, $sConfigValue)
-        {
-            $sConfigName  = $this -> escape($sConfigName);
-            $sConfigValue = $this -> escape($sConfigValue);
-
-            if( !$this -> getOne("SELECT `value` FROM `{$this->sTablePrefix}config` WHERE `name` = '{$sConfigName}'") ) {
-                // create new;
-                $sQuery = "INSERT INTO `{$this->sTablePrefix}config` SET `name` = '{$sConfigName}', `value` = '{$sConfigValue}'";
-            }
-            else {
-                 // update;
-                $sQuery = "UPDATE `{$this->sTablePrefix}config` SET `value` = '{$sConfigValue}' WHERE `name` = '{$sConfigName}'";
-            }
-
-            $this -> query($sQuery);
-        }
-
-        /**
-         * Function will connect to old dolphin Db base;
-         *
-         * @return : void;
-         */
-        function oldDbConnect()
-        {
-           $aConfig = array(
-                'host'    => $this -> getExtraParam('config_host'),
-                'user'      => $this -> getExtraParam('config_user'),
-                'pass'    => $this -> getExtraParam('config_passwd'),
-                'db_name' => $this -> getExtraParam('config_db'),
-            );
-
-            $rLink = mysql_connect($aConfig['host'], $aConfig['user'], $aConfig['pass'], true);
-            mysql_select_db ($aConfig['db_name'], $rLink);
-
-            return $rLink;
-        }
-
-        /**
-         * Function will get nickname from old Db;
-         *
-         * @param  : $iProfileid (integer);
-         * @return : (strng) - profile's nickname;
-         */
-        function getOldNickName($iProfileId)
-        {
-            $sQuery = "SELECT `NickName` FROM `Profiles` WHERE `ID` = $iProfileId";
-            $rResult = mysql_query( $sQuery, $this -> oldDbConnect() );
-
-             while( $aRow = mysql_fetch_assoc($rResult) )
-             {
-                 return $aRow['NickName'];
-             }
-        }
-    }

+ 0 - 239
modules/boonex/data_migration/classes/BxDataMigrationEvents.php

@@ -1,239 +0,0 @@
-<?php
-
-    require_once 'BxDataMigrationData.php';
-
-    class BxDataMigrationEvents extends BxDataMigrationData
-    {
-        var $sTablePrefix = 'bx_events_';
-        var $iTransffered = 0;
-
-        // default values for the fields which are not match with old ones
-        var $aDefValues = array (
-            'EventMembershipFilter' => '',
-            'allow_view_event_to' => '3', // 3 - public (all)
-            'allow_view_participants_to' => '3', // 3 - public (all)
-            'allow_comment_to' => '3', // 3 - public (all)
-            'allow_rate_to' => '3', // 3 - public (all)
-            'allow_join_to' => '3', // 3 - public (all)
-            'allow_post_in_forum_to' => 'p', //  p - event participants only
-            'JoinConfirmation' => '0', // 0 - disabled
-            'allow_upload_photos_to' => 'a', // a - event admin anly
-            'allow_upload_videos_to' => 'a', // a - event admin anly
-            'allow_upload_sounds_to' => 'a', // a - event admin anly
-            'allow_upload_files_to' => 'a', // a - event admin anly
-        );
-
-        /**
-         * Class constructor;
-         *
-         * @param  : $oMigrationModule (object) - object instance of migration class;
-         * @param  : $rOldDb (resourse) - connect to old dolphin's database;
-         * @param  : $oDolModule (object);
-         * @return : void;
-         */
-        function BxDataMigrationEvents(&$oMigrationModule, &$rOldDb, $oDolModule = '')
-        {
-            parent::BxDataMigrationData($oMigrationModule, $rOldDb, $oDolModule);
-        }
-
-        /**
-         * Function migrate all events;
-         *
-         * @return : (integer) operation result;
-         */
-        function getMigration()
-        {
-            if(!$this -> oDolModule) {
-                 $this -> setResultStatus('System error: object instance is not received');
-                 return MIGRATION_FAILED;
-            }
-
-            // set new status;
-            $this -> setResultStatus('Events are transfering now');
-
-            mysql_query('SET NAMES utf8', $this->rOldDb);
-
-            // transfer all profiles polls;
-            $sError = $this -> process();
-            if($sError) {
-                $this -> setResultStatus($sError);
-                return MIGRATION_FAILED;
-            }
-
-            // set as finished;
-            $this -> setResultStatus('Events were successfully transferred (' .  $this -> iTransffered . ' items)');
-
-            return MIGRATION_SUCCESSFUL;
-        }
-
-        /**
-         * Function will transfer all profile's polls;
-         *
-         * @return : (string) - error message or empty;
-         */
-        function process()
-        {
-            $sTableMainNew = $this -> sTablePrefix . $this->oDolModule->_oDb->_sTableMain;
-            if ($this->oMigrationModule->_oDb->getOne("SELECT COUNT(*) FROM `{$sTableMainNew}`") > 0)
-               return 'Error: it is possible to transfaer data to clean install only, in your case some existing data was found.';
-
-
-            $sQuery = "SELECT * FROM `SDatingEvents`";
-            $rResult = mysql_query($sQuery, $this -> rOldDb);
-
-            while($r = mysql_fetch_assoc($rResult))
-            {
-                $r = $this -> escapeData($r);
-
-                //count participants
-                $iParticipants = $this -> getParticipantsCount($r['ID']);
-
-                $sStatus = $r['Status'] == 'Active' ? 'approved' : 'pending';
-
-                // execute query;
-                $sQuery =
-                "
-                    INSERT INTO
-                        `$sTableMainNew`
-                    SET
-                        `ID` = {$r['ID']},
-                        `Title` = '{$r['Title']}',
-                        `EntryUri` = '{$r['EntryUri']}',
-                        `Description` = '{$r['Description']}',
-                        `Status` = '{$sStatus}',
-                        `Country` = '{$r['Country']}',
-                        `City` = '{$r['City']}',
-                        `Place` = '{$r['Place']}',
-                        `PrimPhoto` = '',
-                        `Date` = UNIX_TIMESTAMP('{$r['EventStart']}'),
-                        `EventStart` = UNIX_TIMESTAMP('{$r['EventStart']}'),
-                        `EventEnd` = UNIX_TIMESTAMP('{$r['EventStart']}'),
-                        `ResponsibleID` = '{$r['ResponsibleID']}',
-                        `EventMembershipFilter` = '{$this->aDefValues['EventMembershipFilter']}',
-                        `Tags` = '{$r['Tags']}',
-                        `Categories` = '',
-                        `Views` = '0',
-                        `Rate` = '0',
-                        `RateCount` = '0',
-                        `CommentsCount` = '0',
-                        `FansCount` = '{$iParticipants}',
-                        `Featured` = '0',
-                        `allow_view_event_to` = '{$this->aDefValues['allow_view_event_to']}',
-                        `allow_view_participants_to` = '{$this->aDefValues['allow_view_participants_to']}',
-                        `allow_comment_to` = '{$this->aDefValues['allow_comment_to']}',
-                        `allow_rate_to` = '{$this->aDefValues['allow_rate_to']}',
-                        `allow_join_to` = '{$this->aDefValues['allow_join_to']}',
-                        `allow_post_in_forum_to` = '{$this->aDefValues['allow_post_in_forum_to']}',
-                        `JoinConfirmation` = '{$this->aDefValues['JoinConfirmation']}',
-                        `allow_upload_photos_to` = '{$this->aDefValues['allow_upload_photos_to']}',
-                        `allow_upload_videos_to` = '{$this->aDefValues['allow_upload_videos_to']}',
-                        `allow_upload_sounds_to` = '{$this->aDefValues['allow_upload_sounds_to']}',
-                        `allow_upload_files_to` = '{$this->aDefValues['allow_upload_files_to']}'
-               ";
-
-               $iResult = (int) $this->oMigrationModule->_oDb->query($sQuery);
-               if($iResult <= 0) {
-                    return 'Database error: can not insert new event into the table.';
-               }
-
-               //reparse tags
-               $oTag = new BxDolTags();
-               $oTag->reparseObjTags('bx_events', $r['ID']);
-
-                // transfer partocipants
-                $this -> _transferParticipants($r['ID']);
-
-                // transfer photo;
-                $this -> _transferEventPhoto($r);
-
-                $this -> iTransffered++;
-            }
-        }
-
-        /**
-         * Transfer event's video;
-         *
-         * @param $aEventInfo array- event's info;
-         * @return void;
-         */
-        function _transferEventPhoto($aEventInfo)
-        {
-           $sOldFilePath  = $this -> oMigrationModule -> _oDb -> getExtraParam('config_sdatingImage') . $aEventInfo['PhotoFilename'];
-
-           if( file_exists($sOldFilePath) ) {
-
-              $aFileInfo = array (
-                'medTitle'    => stripslashes($aEventInfo['Title']),
-                'medDesc'     => stripslashes($aEventInfo['Title']),
-                'medTags'     => 'events',
-                'Categories'  => array('Events'),
-             );
-
-             $aPathInfo = pathinfo ($sOldFilePath);
-             $sTmpFile = BX_DIRECTORY_PATH_ROOT . 'tmp/bx_migration_events_image.' . $aPathInfo['extension'];
-             @copy ($sOldFilePath, $sTmpFile);
-
-             $iImgId = BxDolService::call('photos', 'perform_photo_upload', array($sTmpFile, $aFileInfo, false, $aEventInfo['ResponsibleID']), 'Uploader');
-
-             @unlink ($sTmpFile);
-
-             if($iImgId) {
-                 // update event's table;
-                 $sQuery = "INSERT `{$this -> sTablePrefix}images` SET `entry_id` = '{$aEventInfo['ID']}', `media_id` = '{$iImgId}'";
-                 $this -> oMigrationModule -> _oDb -> query($sQuery);
-
-                 $sQuery = "UPDATE `{$this -> sTablePrefix}main` SET `PrimPhoto` = '{$iImgId}' WHERE `ID` = '{$aEventInfo['ID']}'";
-                 $this -> oMigrationModule -> _oDb -> query($sQuery);
-             }
-           }
-        }
-
-        /**
-         * Transfer Participants;
-         *
-         * @param $iIventId integer;
-         * @return void;
-         */
-        function _transferParticipants($iIventId)
-        {
-            $iIventId = (int) $iIventId;
-            $sQuery   = "SELECT * FROM `SDatingParticipants` WHERE `IDEvent` = {$iIventId}";
-            $rResult  = mysql_query($sQuery, $this -> rOldDb);
-
-            while( $aRow = mysql_fetch_assoc($rResult) )
-            {
-                $sQuery =
-                "
-                    INSERT INTO
-                        `{$this -> sTablePrefix}participants`
-                    SET
-                        `id_entry`     = {$iIventId},
-                        `id_profile` = {$aRow['IDMember']},
-                        `confirmed`  = 1,
-                        `when`         = UNIX_TIMESTAMP()
-                ";
-
-               $iResult = (int) $this -> oMigrationModule -> _oDb->query($sQuery);
-               if($iResult <= 0) {
-                    return 'Database error: can not insert new participant into the table.';
-               }
-            }
-        }
-
-        /**
-         * Get count of event's Participants;
-         *
-         * @param $iIventId integer;
-         * @return integer;
-         */
-        function getParticipantsCount($iIventId)
-        {
-            $iIventId = (int) $iIventId;
-            $sQuery = "SELECT COUNT(*) as `iCount` FROM `SDatingParticipants` WHERE `IDEvent` = {$iIventId}";
-            $rResult = mysql_query($sQuery, $this -> rOldDb);
-            $aRow = mysql_fetch_assoc($rResult);
-            return (int) $aRow['iCount'];
-        }
-    }
-
-?>

+ 0 - 87
modules/boonex/data_migration/classes/BxDataMigrationFeedback.php

@@ -1,87 +0,0 @@
-<?php
-    /***************************************************************************
-    *                            Dolphin Smart Community Builder
-    *                              -------------------
-    *     begin                : Mon Mar 23 2006
-    *     copyright            : (C) 2007 BoonEx Group
-    *     website              : http://www.boonex.com
-    * This file is part of Dolphin - Smart Community Builder
-    *
-    * Dolphin is free software; you can redistribute it and/or modify it under
-    * the terms of the GNU General Public License as published by the
-    * Free Software Foundation; either version 2 of the
-    * License, or  any later version.
-    *
-    * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-    * without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-    * See the GNU General Public License for more details.
-    * You should have received a copy of the GNU General Public License along with Dolphin,
-    * see license.txt file; if not, write to marketing@boonex.com
-    ***************************************************************************/
-
-    require_once 'BxDataMigrationData.php';
-
-    class BxDataMigrationFeedback extends BxDataMigrationData {
-
-        function BxDataMigrationFeedback(&$oMigrationModule, &$rOldDb, $oDolModule = '') {
-             parent::BxDataMigrationData($oMigrationModule, $rOldDb, $oDolModule);
-        }
-
-        function getMigration() {
-
-            $this->setResultStatus('The transfer was started.');
-
-               mysql_query('SET NAMES utf8', $this->rOldDb);
-
-            $sSql = "SELECT
-                    `ID` AS `id`,
-                    `Sender` AS `author_id`,
-                    `Header` AS `caption`,
-                    `Text` AS `content`,
-                    '' AS `uri`,
-                    '' AS `tags`,
-                    '3' AS `allow_comment_to`,
-                    '3' AS `allow_vote_to`,
-                    `Date` AS `date`,
-                    `Active` AS `status`,
-                    '0' AS `rate`,
-                    '0' AS `rate_count`,
-                    '0' AS `cmts_count`
-                FROM `Stories`";
-            $rResult = mysql_query($sSql, $this -> rOldDb);
-            $iCount = mysql_num_rows($rResult);
-
-            while($aFeedback = mysql_fetch_assoc($rResult)) {
-                $aFeedback['uri'] = uriGenerate ($aFeedback['caption']
-                    , $this->oDolModule->_oDb->getPrefix() . 'entries', 'uri');
-
-                $aFeedback['status'] = $aFeedback['status'] == 'on' ? 0 : 1;
-
-                if($this->exists($aFeedback['id'], $aFeedback['uri'])) {
-                    $this->setResultStatus('Duplicate data. Feedback with similar info already exists.');
-                    return MIGRATION_FAILED;
-                }
-
-                $sSql = "INSERT INTO `" . $this->oDolModule->_oDb->getPrefix() . "entries` SET";
-                foreach($aFeedback as $sKey => $sValue)
-                    $sSql .= " `" . $sKey . "`='" . $this -> oMigrationModule -> _oDb  -> escape($sValue) . "',";
-
-                $iResult = (int)$this->oDolModule->_oDb->query(substr($sSql, 0, -1));
-                if($iResult <= 0) {
-                    $this->setResultStatus('Database error. Cannot insert data in the database.');
-                    return MIGRATION_FAILED;
-                }
-            }
-
-            $this->setResultStatus('The transfer was successfully completed. (' .  $iCount . ' items)');
-            return MIGRATION_SUCCESSFUL;
-        }
-
-        function exists($iId, $sUri) {
-            $iId = (int) $iId;
-            $sUri = $this -> oMigrationModule -> _oDb  -> escape($sUri);
-
-            $sSql = "SELECT `id` FROM `" . $this->oDolModule->_oDb->getPrefix() . "entries` WHERE `id`='" . $iId . "' OR `uri`='" . $sUri . "' LIMIT 1";
-            return (int)$this->oDolModule->_oDb->getOne($sSql) != 0;
-        }
-    }

+ 0 - 122
modules/boonex/data_migration/classes/BxDataMigrationForum.php

@@ -1,122 +0,0 @@
-<?php
-
-    require_once 'BxDataMigrationOrcaForum.php';
-
-    class BxDataMigrationForum extends BxDataMigrationOrcaForum
-    {
-        /**
-         * Class constructor;
-         *
-         * @param  : $oMigrationModule (object) - object instance of migration class;
-         * @param  : $rOldDb (resourse) - connect to old dolphin's database;
-         * @param  : $oDolModule (object);
-         * @return : void;
-         */
-        function BxDataMigrationForum(&$oMigrationModule, &$rOldDb, $oDolModule = '')
-        {
-            parent::BxDataMigrationOrcaForum($oMigrationModule, $rOldDb, $oDolModule);
-        }
-
-        /**
-         * Function migrate polls data;
-         *
-         * @return : (integer) operation result;
-         */
-        function getMigration()
-        {
-            mysql_query('SET NAMES utf8', $this->rOldDb);
-
-            // sample cat and forum is created in clean instllation, detele it before migration
-            $this->emptyDatabase ();
-
-            // transfer categories;
-           $this -> setResultStatus('transfer categories');
-           $sError =  $this -> _transferCategories();
-           if($sError) {
-                $this -> setResultStatus($sError);
-                return MIGRATION_FAILED;
-            }
-
-            //transfer forums;
-            $this -> setResultStatus('transfer forums');
-            $sError =  $this -> _transferForums();
-            if($sError) {
-                $this -> setResultStatus($sError);
-                return MIGRATION_FAILED;
-            }
-
-            //transfer flags;
-            $this -> setResultStatus('transfer forum\'s flags');
-            $sError =  $this -> _transferFlags();
-            if($sError) {
-                $this -> setResultStatus($sError);
-                return MIGRATION_FAILED;
-            }
-
-            //transfer forum's posts;
-            $this -> setResultStatus('transfer forum\'s posts');
-            $sError =  $this -> _transferPosts();
-            if($sError) {
-                $this -> setResultStatus($sError);
-                return MIGRATION_FAILED;
-            }
-
-            //transfer forum's topics;
-            $this -> setResultStatus('transfer forum\'s topics');
-            $sError =  $this -> _transferTopics();
-            if($sError) {
-                $this -> setResultStatus($sError);
-                return MIGRATION_FAILED;
-            }
-
-            //transfer forum's users;
-            $this -> setResultStatus('transfer forum\'s users');
-            $sError =  $this -> _transferUsers();
-            if($sError) {
-                $this -> setResultStatus($sError);
-                return MIGRATION_FAILED;
-            }
-
-            //transfer forum's users activity;
-            $this -> setResultStatus('transfer forum\'s users activity');
-            $sError =  $this -> _transferUsersActivity();
-            if($sError) {
-                $this -> setResultStatus($sError);
-                return MIGRATION_FAILED;
-            }
-
-            //transfer forum's users stat;
-            $this -> setResultStatus('transfer forum\'s users stat');
-            $sError =  $this -> _transferUsersStat();
-            if($sError) {
-                $this -> setResultStatus($sError);
-                return MIGRATION_FAILED;
-            }
-
-            //transfer forum's users vote;
-            $this -> setResultStatus('transfer forum\'s users vote');
-            $sError =  $this -> _transferUsersVote();
-            if($sError) {
-                $this -> setResultStatus($sError);
-                return MIGRATION_FAILED;
-            }
-
-            // set as finished;
-            $this -> setResultStatus('Forums were transferred');
-
-            return MIGRATION_SUCCESSFUL;
-        }
-
-        /**
-         * sample cat and forum is created in clean instllation, detele it before migration
-         */
-        function emptyDatabase () {
-
-            $sQuery = "DELETE FROM `{$this -> sNewTablePrefix}forum_cat` WHERE `cat_uri` = 'General'";
-            $this -> oMigrationModule -> _oDb -> query($sQuery);
-
-            $sQuery = "DELETE FROM `{$this -> sNewTablePrefix}forum` WHERE `forum_uri` = 'General-discussions'";
-            $this -> oMigrationModule -> _oDb -> query($sQuery);
-        }
-
-    }

+ 0 - 218
modules/boonex/data_migration/classes/BxDataMigrationGroups.php

@@ -1,218 +0,0 @@
-<?php
-
-    require_once 'BxDataMigrationOrcaForum.php';
-
-    class BxDataMigrationGroups extends BxDataMigrationOrcaForum
-    {
-        /**
-         * Class constructor;
-         *
-         * @param  : $oMigrationModule (object) - object instance of migration class;
-         * @param  : $rOldDb (resourse) - connect to old dolphin's database;
-         * @param  : $oDolModule (object);
-         * @return : void;
-         */
-        function BxDataMigrationGroups(&$oMigrationModule, &$rOldDb, $oDolModule = '')
-        {
-            parent::BxDataMigrationOrcaForum($oMigrationModule, $rOldDb, $oDolModule, true);
-        }
-
-        /**
-         * Function migrate groups and groups forum data;
-         *
-         * @return : (integer) operation result;
-         */
-        function getMigration()
-        {
-            mysql_query('SET NAMES utf8', $this->rOldDb);
-
-            // transfer categories;
-           $this -> setResultStatus('transfer forum categories');
-           $sError =  $this -> _transferCategories();
-           if($sError) {
-                $this -> setResultStatus($sError);
-                return MIGRATION_FAILED;
-            }
-
-            //transfer forums;
-            $this -> setResultStatus('transfer forums');
-            $sError =  $this -> _transferForums();
-            if($sError) {
-                $this -> setResultStatus($sError);
-                return MIGRATION_FAILED;
-            }
-
-            //transfer flags;
-            $this -> setResultStatus('transfer forum\'s flags');
-            $sError =  $this -> _transferFlags();
-            if($sError) {
-                $this -> setResultStatus($sError);
-                return MIGRATION_FAILED;
-            }
-
-            //transfer forum's posts;
-            $this -> setResultStatus('transfer forum\'s posts');
-            $sError =  $this -> _transferPosts();
-            if($sError) {
-                $this -> setResultStatus($sError);
-                return MIGRATION_FAILED;
-            }
-
-            //transfer forum's topics;
-            $this -> setResultStatus('transfer forum\'s topics');
-            $sError =  $this -> _transferTopics();
-            if($sError) {
-                $this -> setResultStatus($sError);
-                return MIGRATION_FAILED;
-            }
-
-            //transfer forum's users;
-            $this -> setResultStatus('transfer forum\'s users');
-            $sError =  $this -> _transferUsers();
-            if($sError) {
-                $this -> setResultStatus($sError);
-                return MIGRATION_FAILED;
-            }
-
-            //transfer forum's users activity;
-            $this -> setResultStatus('transfer forum\'s users activity');
-            $sError =  $this -> _transferUsersActivity();
-            if($sError) {
-                $this -> setResultStatus($sError);
-                return MIGRATION_FAILED;
-            }
-
-            //transfer forum's users stat;
-            $this -> setResultStatus('transfer forum\'s users stat');
-            $sError =  $this -> _transferUsersStat();
-            if($sError) {
-                $this -> setResultStatus($sError);
-                return MIGRATION_FAILED;
-            }
-
-            //transfer forum's users vote;
-            $this -> setResultStatus('transfer forum\'s users vote');
-            $sError =  $this -> _transferUsersVote();
-            if($sError) {
-                $this -> setResultStatus($sError);
-                return MIGRATION_FAILED;
-            }
-
-            // set as finished;
-            $this -> setResultStatus('Forums were transferred');
-
-            $sError = $this->_transferGroups();
-            if($sError) {
-                $this -> setResultStatus($sError);
-                return MIGRATION_FAILED;
-            }
-
-            // set as finished;
-            $this -> setResultStatus('Groups were transferred');
-
-            return MIGRATION_SUCCESSFUL;
-        }
-
-        function _transferGroups() {
-
-            // transfer categories
-            $rCategs = mysql_query("select * from `GroupsCateg`", $this->rOldDb);
-            while ($aCateg = mysql_fetch_assoc($rCategs)) {
-                $sCategNameDB = $this->escape($aCateg['Name']);
-
-                $sCategName = $this->getOne("select `Category` from `sys_categories` where `Type` = 'bx_groups' and `Category` = '$sCategNameDB'");
-                if ($sCategName) {
-                    // if category already exists
-                    // TODO: ...do nothing
-                } else {
-                    // if category doesn't exist, create it
-                    $this->query("
-                        insert into `sys_categories`
-                            (`Category`, `Type`)
-                        values
-                            ('$sCategNameDB', 'bx_groups')
-                    ");
-                }
-
-                // transfer groups
-                $rGroups = mysql_query("select * from `Groups` where `categID` = {$aCateg['ID']}", $this->rOldDb);
-                while ($aGroup = mysql_fetch_assoc($rGroups)) {
-                    $sGroupNameDB = $this->escape($aGroup['Name']);
-
-                    $iGroupID = (int)$this->getOne("select `id` from `bx_groups_main` where `title` = '$sGroupNameDB'");
-                    if ($iGroupID) {
-                        // if group already exists
-                        // TODO: ...do nothing
-                    } else {
-                        // if group doesn't exist, create it
-                        $g = $this->escapeData($aGroup);
-                        $g['status'] = ($aGroup['status'] == 'Active') ? 'approved' : 'pending';
-                        $g['created'] = $this->getTSFromDate($aGroup['created']);
-
-                        $iFansCount = 0;
-                        $rFans = mysql_query("select count(*) as `count` from `GroupsMembers` where `groupID` = {$aGroup['ID']}", $this->rOldDb);
-                        if ($rFans && ($aFans = mysql_fetch_assoc($rFans))) {
-                            $iFansCount = $aFans['count'];
-                            mysql_free_result($rFans);
-                        }
-
-                        $this->query("
-                            insert into `bx_groups_main`
-                                (     `id`,         `title`,        `uri`,         `desc`,         `country`,         `city`,         `status`,         `created`,         `author_id`,    `categories`,   `fans_count`,   `allow_view_group_to`, `allow_view_fans_to`, `allow_comment_to`, `allow_rate_to`, `allow_post_in_forum_to`, `allow_join_to`, `join_confirmation`, `allow_upload_photos_to`, `allow_upload_videos_to`, `allow_upload_sounds_to`, `allow_upload_files_to`) values
-                                ('{$g['ID']}', '{$g['Name']}', '{$g['Uri']}', '{$g['Desc']}', '{$g['Country']}', '{$g['City']}', '{$g['status']}', '{$g['created']}', '{$g['creatorID']}', '$sCategNameDB', '$iFansCount', '3',                   '3',                  'f',                'f',            'f',                       '3',             '0',                 'a',                      'a',                      'a',                      'a')
-                        ");
-
-                        $iGroupID = $this->lastId();
-                    }
-
-                    // transfer profiles
-                    $rProfiles = mysql_query("select * from `GroupsMembers` where `groupID` = {$aGroup['ID']}", $this->rOldDb);
-                    while ($p = mysql_fetch_assoc($rProfiles)) {
-                        $p['Date'] = $this->getTSFromDate($p['Date']);
-                        $p['confirmed'] = ($p['status'] == 'Active') ? 1 : 0;
-
-                        $this->query("
-                            insert into `bx_groups_fans`
-                            (    `id_entry`,      `id_profile`,     `when`,       `confirmed`) values
-                            ({$p['groupID']}, {$p['memberID']}, {$p['Date']}, {$p['confirmed']})
-                        ");
-                    }
-
-                    // transfer gallery
-                    $rImages = mysql_query("select * from `GroupsGallery` where `groupID` = {$aGroup['ID']}", $this->rOldDb);
-                    while ($i = mysql_fetch_assoc($rImages)) {
-                        $aFileInfo = array(
-                            'medTitle' => $aGroup['Name'],
-                            'medDesc' => $aGroup['Name'],
-                            'medTags' => 'groups',
-                            'Categories' => array('Groups'),
-                        );
-                        $sOrigFile = $this->oMigrationModule->_oDb->getExtraParam('config_root') . 'groups/gallery/' . "{$aGroup['ID']}_{$i['ID']}_{$i['seed']}.{$i['ext']}";
-                        $aPathInfo = pathinfo ($sOrigFile);
-                        $sTmpFile = BX_DIRECTORY_PATH_ROOT . 'tmp/bx_migration_groups_image.' . $aPathInfo['extension'];
-                        @copy ($sOrigFile, $sTmpFile);
-                        $iPhotoId = BxDolService::call('photos', 'perform_photo_upload', array($sTmpFile, $aFileInfo, false, $i['by']), 'Uploader');
-                        @unlink($sTmpFile);
-                        if ($iPhotoId) {
-                            if ($this->query("INSERT INTO `bx_groups_images` VALUES ($iGroupID, $iPhotoId)")) {
-                                $this->query("UPDATE `bx_groups_main` SET `thumb` = '$iPhotoId' WHERE `id` = '$iGroupID' AND `thumb` = 0");
-                            }
-                        }
-                    }
-
-                    // transfer forum
-                    //TODO: ...
-                }
-            }
-        }
-
-        function getTSFromDate($sDateTime) {
-            list($sDate, $sTime) = explode(' ', $sDateTime);
-            $sTime = strlen($sTime) ? $sTime : '0:0:0';
-
-            $aDate = explode('-', $sDate);
-            $aTime = explode(':', $sTime);
-
-            return mktime((int)$aTime[0], (int)$aTime[1], (int)$aTime[2], (int)$aDate[1], (int)$aDate[2], (int)$aDate[0]);
-        }
-    }

+ 0 - 184
modules/boonex/data_migration/classes/BxDataMigrationMembership.php

@@ -1,184 +0,0 @@
-<?php
-
-    require_once 'BxDataMigrationData.php';
-
-    class BxDataMigrationMembership extends BxDataMigrationData
-    {
-        var $iTransffered = 0;
-
-        /**
-         * Class constructor;
-         *
-         * @param  : $oMigrationModule (object) - object instance of migration class;
-         * @param  : $rOldDb (resourse) - connect to old dolphin's database;
-         * @param  : $oDolModule (object);
-         * @return : void;
-         */
-        function BxDataMigrationSounds(&$oMigrationModule, &$rOldDb, $oDolModule = '')
-        {
-            parent::BxDataMigrationData($oMigrationModule, $rOldDb, $oDolModule);
-        }
-
-        /**
-         * Function migrate all membership;
-         *
-         * @return : (string) - error message or empty;
-         */
-        function getMigration()
-        {
-            // set new status;
-            $this -> setResultStatus('All membership levels transfer now');
-
-            mysql_query('SET NAMES utf8', $this->rOldDb);
-
-            $sError = $this -> _exportMemLevels();
-            if($sError) {
-                $this -> setResultStatus($sError);
-                return MIGRATION_FAILED;
-            }
-
-            $sError = $this -> _exportPofileMemLevels();
-            if($sError) {
-                $this -> setResultStatus($sError);
-                return MIGRATION_FAILED;
-            }
-
-            // set as finished;
-            $this -> setResultStatus('All membership levels were transferred (' .  $this -> iTransffered . ' items)');
-
-            return MIGRATION_SUCCESSFUL;
-        }
-
-        /**
-         * export all MemLevels;
-         *
-         * @return : (string) - error message or empty;
-         */
-        function _exportMemLevels()
-        {
-            $sQuery = "SELECT * FROM `MemLevels`";
-            $rResult = mysql_query($sQuery, $this -> rOldDb);
-
-            while( true == ($aRow = mysql_fetch_assoc($rResult)) )
-            {
-                if( !$this -> isLevelExisting($aRow['Name']) ) {
-                    // escape all data;
-                    $aRow = $this -> escapeData($aRow);
-
-                    $sQuery =
-                    "
-                        INSERT INTO
-                            `sys_acl_levels`
-                        SET
-                            `Name`            = '{$aRow['Name']}',
-                            `Active`       = '{$aRow['Active']}',
-                            `Purchasable` = '{$aRow['Purchasable']}',
-                            `Removable`   = '{$aRow['Removable']}'
-                    ";
-
-                    $iResult = (int) $this -> oMigrationModule -> _oDb -> query($sQuery);
-                    if($iResult <= 0) {
-                        $this -> setResultStatus('Database error. Cannot insert new acl level in the database.');
-                        return MIGRATION_FAILED;
-                    }
-
-                    $this -> iTransffered++;
-                }
-            }
-        }
-
-        /**
-         * export all ProfileMemLevels;
-         *
-         * @return : (string) - error message or empty;
-         */
-        function _exportPofileMemLevels()
-        {
-           $sQuery = "SELECT * FROM `ProfileMemLevels`";
-           $rResult = mysql_query($sQuery, $this -> rOldDb);
-
-           while( true == ($aRow = mysql_fetch_assoc($rResult)) )
-           {
-               if( !$this -> isProfileLevelExisting($aRow['IDMember'], $aRow['IDLevel']) ) {
-                    // escape all data;
-                    $aRow     = $this -> escapeData($aRow);
-                    $iLevelId = $this -> getNewMemLevelId($aRow['IDLevel']);
-
-                    //-- define extra query --//
-
-                    $sExtraSQL = '';
-                    if($aRow['DateExpires']) {
-                        $sExtraSQL .= " `DateExpires`   = '{$aRow['DateExpires']}',";
-                    }
-
-                    if($aRow['TransactionID']) {
-                        $sExtraSQL .= " `TransactionID`   = '{$aRow['TransactionID']}',";
-                    }
-                    //--
-
-                    $sQuery   =
-                    "
-                        INSERT INTO
-                            `sys_acl_levels_members`
-                        SET
-                            `IDMember`      = '{$aRow['IDMember']}',
-                            `IDLevel`         = '{$iLevelId}',
-                            `DateStarts`    = '{$aRow['DateStarts']}',{$sExtraSQL}";
-
-                   $iResult = (int) $this -> oMigrationModule -> _oDb -> query( trim($sQuery,','));
-                   if($iResult <= 0) {
-                        $this -> setResultStatus('Database error. Cannot insert new profile mem level in the database.');
-                        return MIGRATION_FAILED;
-                   }
-               }
-           }
-        }
-
-        /**
-         * Define new level id;
-         *
-         * @return integer;
-         */
-        function getNewMemLevelId($iOldLevelId)
-        {
-            $iOldLevelId = (int) $iOldLevelId;
-
-            $sQuery  = "SELECT `Name` FROM `MemLevels` WHERE `ID` = {$iOldLevelId}";
-            $rResult = mysql_query($sQuery, $this -> rOldDb);
-            $aRow    = mysql_fetch_assoc($rResult);
-            $aRow    = $this -> escapeData($aRow);
-
-            // get new level id;
-            $sQuery = "SELECT `ID` FROM `sys_acl_levels` WHERE `Name` = '{$aRow['Name']}' LIMIT 1";
-            return (int) $this -> oMigrationModule -> _oDb -> getOne($sQuery);
-        }
-
-       /**
-        * Check existing membership level;
-        *
-        * @param $sLevelName string;
-        * @return  true if exist;
-        */
-       function isLevelExisting($sLevelName)
-       {
-           $sLevelName = $this -> oMigrationModule -> _oDb  -> escape($sLevelName);
-           $sQuery = "SELECT COUNT(*) FROM `sys_acl_levels` WHERE `Name` = '{$sLevelName}'";
-           return $this -> oMigrationModule -> _oDb -> getOne($sQuery) ? true : false;
-       }
-
-       /**
-        * Check existing profile membership level;
-        *
-        * @param $iProfileId integer;
-        * @param $iLevelId integer;
-        * @return  true if exist;
-        */
-       function isProfileLevelExisting($iProfileId, $iLevelId)
-       {
-           $iProfileId = (int) $iProfileId;
-           $iLevelId   = (int) $iLevelId;
-
-           $sQuery = "SELECT COUNT(*) FROM `sys_acl_levels_members` WHERE `IDMember` = {$iProfileId} AND `IDLevel` = {$iLevelId}";
-           return $this -> oMigrationModule -> _oDb -> getOne($sQuery) ? true : false;
-       }
-    }

+ 0 - 506
modules/boonex/data_migration/classes/BxDataMigrationModule.php

@@ -1,506 +0,0 @@
-<?php
-
-    /***************************************************************************
-    *                            Dolphin Smart Community Builder
-    *                              -------------------
-    *     begin                : Mon Mar 23 2006
-    *     copyright            : (C) 2007 BoonEx Group
-    *     website              : http://www.boonex.com
-    * This file is part of Dolphin - Smart Community Builder
-    *
-    * Dolphin is free software; you can redistribute it and/or modify it under
-    * the terms of the GNU General Public License as published by the
-    * Free Software Foundation; either version 2 of the
-    * License, or  any later version.
-    *
-    * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-    * without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-    * See the GNU General Public License for more details.
-    * You should have received a copy of the GNU General Public License along with Dolphin,
-    * see license.txt file; if not, write to marketing@boonex.com
-    ***************************************************************************/
-
-    bx_import('BxDolModuleDb');
-    bx_import('BxDolModule');
-
-    require_once 'BxCheckerMigration.php';
-
-    if ( function_exists('ini_set')) {
-        ini_set('max_execution_time', 0);
-    }
-
-    define('MIGRATION_SUCCESSFUL', 1);
-    define('MIGRATION_FAILED', 0);
-
-    class BxDataMigrationModule extends BxDolModule
-    {
-        // contain some module information ;
-        var $aModuleInfo;
-
-        // contain path for current module;
-        var $sPathToModule;
-
-        var $aMigrationModules;
-
-        var $sProcessedModule;
-
-        /**
-         * Class constructor ;
-         *
-         * @param   : $aModule (array) - contain some information about this module;
-         *                  [ id ]           - (integer) module's  id ;
-         *                  [ title ]        - (string)  module's  title ;
-         *                  [ vendor ]       - (string)  module's  vendor ;
-         *                  [ path ]         - (string)  path to this module ;
-         *                  [ uri ]          - (string)  this module's URI ;
-         *                  [ class_prefix ] - (string)  this module's php classes file prefix ;
-         *                  [ db_prefix ]    - (string)  this module's Db tables prefix ;
-         *                  [ date ]         - (string)  this module's date installation ;
-         */
-        function BxDataMigrationModule(&$aModule)
-        {
-            parent::BxDolModule($aModule);
-
-            // prepare the location link ;
-            $this -> sPathToModule  = BX_DOL_URL_ROOT . $this -> _oConfig -> getBaseUri();
-            $this -> aModuleInfo    = $aModule;
-
-            $this -> aMigrationModules = array(
-               'profiles' => array(
-                    'is_module'       => false,
-                    'module_name'     => 'profiles',
-                    'module_class'    => '',
-                    'migration_class' => 'BxDataMigrationProfiles',
-                    'dependencies' => array(
-                    ),
-                ),
-
-                'poll' => array(
-                    'is_module' => true,
-                    'module_name'     => 'poll',
-                    'module_class'    => 'BxPollModule',
-                    'migration_class' => 'BxDataMigrationPoll',
-                    'dependencies' => array(
-                         'profiles',
-                     ),
-                ),
-
-                'events' => array(
-                    'is_module' => true,
-                    'module_name'     => 'events',
-                    'module_class'    => 'BxEventsModule',
-                    'migration_class' => 'BxDataMigrationEvents',
-                    'dependencies' => array(
-                        'profiles',
-                        'photos',
-                     ),
-                 ),
-
-                'blogs' => array(
-                    'is_module' => true,
-                    'module_name'     => 'blogs',
-                    'module_class'    => 'BxBlogsModule',
-                    'migration_class' => 'BxDataMigrationBlogs',
-                    'dependencies' => array(
-                         'profiles',
-                    ),
-                ),
-
-                'ads' => array(
-                    'is_module' => true,
-                    'module_name'     => 'ads',
-                    'module_class'    => 'BxAdsModule',
-                    'migration_class' => 'BxDataMigrationAds',
-                    'dependencies' => array(
-                         'profiles',
-                    ),
-                ),
-
-                'news' => array(
-                    'is_module' => true,
-                    'module_name'     => 'news',
-                    'module_class'    => 'BxNewsModule',
-                    'migration_class' => 'BxDataMigrationNews',
-                    'dependencies' => array(
-                         'profiles',
-                    ),
-                ),
-
-                'articles' => array(
-                    'is_module' => true,
-                    'module_name'     => 'articles',
-                    'module_class'    => 'BxArlModule',
-                    'migration_class' => 'BxDataMigrationArticles',
-                    'dependencies' => array(
-                        'profiles',
-                     ),
-                ),
-
-                'feedback' => array(
-                    'is_module' => true,
-                    'module_name'     => 'feedback',
-                    'module_class'    => 'BxFdbModule',
-                    'migration_class' => 'BxDataMigrationFeedback',
-                    'dependencies' => array(
-                        'profiles',
-                     ),
-                ),
-
-                'sounds' => array(
-                    'is_module' => true,
-                    'module_name'     => 'sounds',
-                    'module_class'    => 'BxSoundsModule',
-                    'migration_class' => 'BxDataMigrationSounds',
-                    'dependencies' => array(
-                        'profiles',
-                     ),
-                ),
-
-                'photos' => array(
-                    'is_module' => true,
-                    'module_name'     => 'photos',
-                    'module_class'    => 'BxPhotosModule',
-                    'migration_class' => 'BxDataMigrationPhotos',
-                    'dependencies' => array(
-                        'profiles',
-                     ),
-                ),
-
-                'videos' => array(
-                    'is_module' => true,
-                    'module_name'     => 'videos',
-                    'module_class'    => 'BxVideosModule',
-                    'migration_class' => 'BxDataMigrationVideos',
-                    'dependencies' => array(
-                        'profiles',
-                     ),
-                ),
-
-                'forum' => array(
-                    'is_module' => true,
-                    'module_name'     => 'forum',
-                    'module_class'    => 'Orca Forum',
-                    'migration_class' => 'BxDataMigrationForum',
-                    'dependencies' => array(
-                        'profiles',
-                     ),
-                ),
-
-                'acl_levels' => array(
-                    'is_module' => false,
-                    'module_name'     => 'acl_levels',
-                    'module_class'    => '',
-                    'migration_class' => 'BxDataMigrationMembership',
-                    'dependencies' => array(
-                        'profiles',
-                     ),
-                ),
-
-                'custom_profile_fields' => array(
-                    'is_module' => false,
-                    'module_name'     => 'custom_profile_fields',
-                    'module_class'    => '',
-                    'migration_class' => 'BxDataMigrationProfilesCustomFields',
-                    'dependencies' => array(
-                        'profiles',
-                    ),
-                ),
-
-                'groups' => array(
-                    'is_module' => true,
-                    'module_name'     => 'groups',
-                    'module_class'    => 'BxGroupsModule',
-                    'migration_class' => 'BxDataMigrationGroups',
-                    'dependencies' => array(
-                           'profiles',
-                        'photos',
-                    ),
-                ),
-             );
-        }
-
-        /**
-         * Function will get migration from recived modules;
-         * @return unknown_type
-         */
-        function actionMigration($sModule = '')
-        {
-            // define the module;
-            if( isset($this -> aMigrationModules[$sModule]) && $this -> _oDb -> getExtraParam('is_configured') ) {
-                // trasnfer status;
-                $sTransferred = $this -> _oDb -> getTransferStatus($sModule);
-                if( $sTransferred == 'finished' || $sTransferred == 'not_started' ) {
-                    echo MsgBox( _t('_bx_data_migration_already_transfer', $sModule) );
-                    exit;
-                }
-                else {
-                    // check module dependencies;
-                    if( isset($this -> aMigrationModules[$sModule]['dependencies'])
-                        && $this -> aMigrationModules[$sModule]['dependencies']) {
-
-                        foreach($this -> aMigrationModules[$sModule]['dependencies'] as $iKey => $sDependenciesModule)
-                        {
-                            $sTransferred = $this -> _oDb -> getTransferStatus($sDependenciesModule);
-                            if( $sTransferred != 'finished') {
-                                echo MsgBox( _t('_bx_data_migration_install_before', $sDependenciesModule) );
-                                exit;
-                            }
-                        }
-                    }
-
-                    // create new transfer;
-                    $sTransferResult = $this -> _oDb -> checkTransfer($sModule);
-                    if( !$sTransferResult || $sTransferResult == 'error' ) {
-                        if($sTransferResult == 'error') {
-                             $this -> _oDb -> deleteTransfer($sModule);
-                        }
-                        $this -> _oDb -> createTransfer($sModule);
-                        echo MsgBox( _t('_bx_data_migration_start_transfer') );
-                    }
-                    else {
-                        echo MsgBox( _t('_bx_data_migration_install_started', $sModule) );
-                    }
-                }
-            }
-            else {
-                echo MsgBox( _t('_bx_data_migration_module_not_defined') );
-            }
-        }
-
-        /**
-         * Function will transfer data;
-         *
-         * @return : void;
-         */
-        function transferData()
-        {
-            $sModule = $this -> _oDb -> getFirstTransfer();
-
-             // define the module;
-            if( $sModule && isset($this -> aMigrationModules[$sModule])
-                    && $this -> _oDb -> getExtraParam('is_configured') ) {
-
-                // create new module's instance;
-                require_once($this -> aMigrationModules[$sModule]['migration_class'] . '.php');
-
-                $oDolModule = '';
-                // create module instance;
-                if($this -> aMigrationModules[$sModule]['module_class']) {
-                    $oDolModule = BxDolModule::getInstance($this -> aMigrationModules[$sModule]['name']);
-                }
-
-                $this -> sProcessedModule = $sModule;
-
-                // set as started;
-                $this -> _oDb -> updateTransferStatus($sModule, 'started');
-
-                 // create new migration instance;
-                $oModule = & new $this -> aMigrationModules[$sModule]['migration_class']( $this
-                    , $this -> _oDb -> oldDbConnect(), $oDolModule);
-
-                // get migration;
-                $iOperation = $oModule -> getMigration();
-
-                if( $iOperation == MIGRATION_SUCCESSFUL) {
-                    //set as finished;
-                    //$this -> _oDb -> updateTransferStatus($sModule, 'not_started');
-                    $this -> _oDb -> updateTransferStatus($sModule, 'finished');
-                }
-                else {
-                    // set as error;
-                    $this -> _oDb -> updateTransferStatus($sModule, 'error');
-                }
-            }
-        }
-
-         /**
-         * Function will generate the poll's admin page ;
-         *
-         * @return : (text) - Html presentation data ;
-         */
-        function actionAdministration($sAction = '')
-        {
-            $GLOBALS['iAdminPage'] = 1;
-
-            if( !isAdmin() ) {
-                header('location: ' . BX_DOL_URL_ROOT);
-            }
-
-            // get all needed css files;
-            $this -> _oTemplate-> pageCodeAdminStart();
-            echo $this -> _oTemplate -> addCss('forms_adv.css', true);
-
-            $aMenu = array(
-                'data_migration' => array('title' => _t('_bx_data_migration'), 'href' => $this -> sPathToModule . 'administration'),
-                'set_config'     => array('title' => _t('_bx_data_migration_set_config'), 'href' => $this -> sPathToModule . 'administration/settings'),
-            );
-
-            $sPageContent = '';
-            $sPageTitle   = '';
-
-            switch ($sAction) {
-                case 'settings':
-                    $aMenu['set_config']['active'] = 1;
-                    $sPageTitle   = _t('_bx_data_migration_configure');
-                    $sPageContent = $this -> _oTemplate -> getConfigForm($this);
-                    break;
-
-                default :
-                    if( !$this  -> _oDb -> getExtraParam('is_configured') ) {
-                        $aMenu['set_config']['active'] = 1;
-                        $sPageTitle   = _t('_bx_data_migration_configure');
-                        $sPageContent = $this -> _oTemplate -> getConfigForm($this);
-                    }
-                    else {
-                        $aMenu['data_migration']['active'] = 1;
-                         // get modules page;
-                        $sPageTitle = _t('_bx_data_migration_choose_data');
-                        $sPageContent = $this -> getModulesList();
-                    }
-                    break;
-            }
-
-            echo $this -> _oTemplate -> adminBlock ($sPageContent, $sPageTitle, $aMenu);
-            $this -> _oTemplate->pageCodeAdmin( _t('_bx_data_migration_module') );
-        }
-
-        /**
-         * Function will generate list of allowed modules;
-         *
-         * @return : (text) - html presentation data;
-         */
-        function getModulesList()
-        {
-            $aProccessed  = array();
-            $aStatusTexts = array();
-
-            $aLanguageKeys = array(
-                'in_procces'      => _t('_bx_data_migration_in_process'),
-                'transferred'     => _t('_bx_data_migration_transferred'),
-                'error_transfer'  => _t('_bx_data_migration_error_transferred'),
-                'queued'          => _t('_bx_data_migration_not_started'),
-            );
-
-            // check all modules;
-            foreach($this -> aMigrationModules as $sModule => $aItems)
-            {
-               // define the transfer status;
-               $sTransferStatus     = $this -> _oDb -> getTransferStatus($aItems['module_name']);
-               $sTransferStatusText = $this -> _oDb -> getTransferStatusText($aItems['module_name']);
-
-               if($sTransferStatusText) {
-                   $aStatusTexts[$aItems['module_name']] = $sTransferStatusText;
-               }
-               else if($sTransferStatus){
-                   $aStatusTexts[$aItems['module_name']] = $aLanguageKeys['in_procces'];
-               }
-
-               switch($sTransferStatus) {
-                   case 'not_started' :
-                        $sModuleTransferred = ' (' . $aLanguageKeys['queued'] . ') ';
-                        break;
-
-                   case 'finished' :
-                        $sModuleTransferred = ' (' . $aLanguageKeys['transferred'] . ') ';
-                        break;
-
-                  case 'started' :
-                        $sModuleTransferred = ' (' . $aLanguageKeys['in_procces'] . ') ';
-                        break;
-
-                   case 'error' :
-                        $sModuleTransferred = ' (' . $aLanguageKeys['error_transfer'] . ') ';
-                        break;
-
-                   default :
-                        $sModuleTransferred = '';
-               }
-
-               if($aItems['is_module'] && $aItems['module_name']) {
-                   // check allowed module;
-                   if( $this -> _oDb -> isModule($aItems['module_name']) ){
-                      $aProccessed[ $aItems['module_name'] ] = $aItems['module_name'] . $sModuleTransferred;
-                   }
-               }
-
-               if( !$aItems['is_module'] ) {
-                   $aProccessed[ $sModule ] = $sModule . $sModuleTransferred;;
-               }
-            }
-
-            return $this -> _oTemplate -> getModulesList($aProccessed, $aStatusTexts, $this);
-        }
-
-        /**
-         * Function will create new config;
-         *
-         * @param  : $sPath (string) - path to old dolphin;
-         * @return : (string) - call back message;
-         */
-        function createConfig($sPath)
-        {
-            $isDbDefined = false;
-            $isDirDefined = false;
-
-            $sPath = stripslashes($sPath);
-
-            if ( substr($sPath, strlen($sPath) - 1 ) != DIRECTORY_SEPARATOR ) {
-                $sPath .= DIRECTORY_SEPARATOR;
-            }
-
-            // get all seeting from file;
-            $sDataFile = file_get_contents($sPath . 'inc' . DIRECTORY_SEPARATOR . 'header.inc.php');
-            $aConfig   = array();
-
-            // get db values;
-            $aDbValues = array();
-            preg_match_all("/db\[\'([a-z]+)\'\].+=.+\'(.*)\'/Ui", $sDataFile, $aDbValues);
-            if( is_array($aDbValues) ) {
-                foreach($aDbValues[1] as $iKey => $sParamName)
-                {
-                   $aConfig[$sParamName] = $aDbValues[2][$iKey];
-                   $isDbDefined = true;
-                }
-            }
-
-            // get Dir values;
-            $aDirValues = array();
-            preg_match_all("/dir\[\'([a-z]+)\'\].+=.+\"(.*)\"/Ui", $sDataFile, $aDirValues);
-
-            $sRootDir     = '';
-            $sRootDirInc  = '';
-
-            if( is_array($aDirValues) ) {
-                foreach($aDirValues[1] as $iKey => $sParamName)
-                {
-                   $aConfig[$sParamName] = $aDirValues[2][$iKey];
-                   if($sParamName == 'root') {
-                       $sRootDir = $aDirValues[2][$iKey];
-                   }
-
-                   if($sParamName == 'classes') {
-                       $sRootDirInc = $aDirValues[2][$iKey];
-                   }
-
-                   $isDirDefined = true;
-                }
-            }
-
-            // replace with value;
-            if($isDirDefined && $isDbDefined) {
-                foreach($aConfig as $sKey => $sParamName)
-                {
-                    $aConfig[$sKey] = str_replace('{$dir[\'root\']}', $sRootDir, $aConfig[$sKey]);
-                    $aConfig[$sKey] = str_replace('{$dir[\'inc\']}',  $sRootDir . 'inc/', $aConfig[$sKey]);
-                    $this -> _oDb -> createConfig( array('config_' . $sKey => $aConfig[$sKey]) );
-                }
-
-                $this -> _oDb -> createConfig( array('is_configured' => 'yes') );
-            }
-            else {
-                return MsgBox( _t('_bx_data_migration_was_not_defined') );
-            }
-
-            return MsgBox( _t('_bx_data_migration_was_defined') );
-        }
-    }

+ 0 - 95
modules/boonex/data_migration/classes/BxDataMigrationNews.php

@@ -1,95 +0,0 @@
-<?php
-
-    require_once 'BxDataMigrationData.php';
-
-    class BxDataMigrationNews extends BxDataMigrationData
-    {
-        var $iTransffered = 0;
-
-        /**
-         * Class constructor;
-         *
-         * @param  : $oMigrationModule (object) - object instance of migration class;
-         * @param  : $rOldDb (resourse) - connect to old dolphin's database;
-         * @param  : $oDolModule (object);
-         * @return : void;
-         */
-        function BxDataMigrationNews(&$oMigrationModule, &$rOldDb, $oDolModule = '')
-        {
-            parent::BxDataMigrationData($oMigrationModule, $rOldDb, $oDolModule);
-        }
-
-        /**
-         * Function migrate polls data;
-         *
-         * @return : (integer) operation result;
-         */
-        function getMigration()
-        {
-            if(!$this -> oDolModule) {
-                 $this -> setResultStatus('System error: object  instance is not received');
-                 return MIGRATION_FAILED;
-            }
-
-             mysql_query('SET NAMES utf8', $this->rOldDb);
-
-            // set new status;
-            $this -> setResultStatus('News transfer now');
-
-            $sQuery = "SELECT * FROM `News`";
-            $rResult = mysql_query($sQuery, $this -> rOldDb);
-            while( $aRow = mysql_fetch_assoc($rResult) )
-            {
-                if( !$this -> isNewsExisting($aRow['NewsUri'], $aRow['ID']) ) {
-                    // escape all data;
-                    $aRow = $this -> escapeData($aRow);
-
-                    $sNewsContent = $aRow['Snippet'] . ' ' . $aRow['Text'];
-                    $sQuery =
-                    "
-                        INSERT INTO
-                            `{$this -> oDolModule -> _oDb -> _sPrefix}entries`
-                        SET
-                            `id` =  {$aRow['ID']},
-                            `date` = UNIX_TIMESTAMP('{$aRow['Date']}'),
-                            `caption` = '{$aRow['Header']}',
-                            `content` = '{$sNewsContent}',
-                            `uri` = '{$aRow['NewsUri']}',
-                            `categories` = 'news'
-                    ";
-
-                    $iResult = (int) $this -> oMigrationModule -> _oDb -> query($sQuery);
-                    if($iResult <= 0) {
-                        $this -> setResultStatus('Database error. Cannot insert new news in the database.');
-                        return MIGRATION_FAILED;
-                    }
-
-                    $this -> iTransffered++;
-                }
-                else {
-                    $this -> setResultStatus('Duplicate data. News with similar info already exists (remove all news and start again)');
-                    return MIGRATION_FAILED;
-                }
-            }
-
-            // set as finished;
-            $this -> setResultStatus('All news were transferred (' .  $this -> iTransffered . ' items)');
-
-            return MIGRATION_SUCCESSFUL;
-        }
-
-        /**
-         * Function check existing news in module;
-         *
-         * @param  : $sNewsHeader (string) - news header text;
-         * @param  : $iNewsId (integer) - news id;
-         * @return : true if exist;
-         */
-        function isNewsExisting($sNewsUri, $iNewsId)
-        {
-            $iNewsId = (int) $iNewsId;
-            $sNewsUri = $this -> oMigrationModule -> _oDb  -> escape($sNewsUri);
-            $sQuery  = "SELECT COUNT(*) FROM `{$this -> oDolModule -> _oDb -> _sPrefix}entries` WHERE `uri` = '{$sNewsUri}' OR `id` = {$iNewsId}";
-            return $this -> oMigrationModule -> _oDb -> getOne($sQuery) ? true : false;
-        }
-    }

+ 0 - 521
modules/boonex/data_migration/classes/BxDataMigrationOrcaForum.php

@@ -1,521 +0,0 @@
-<?php
-
-    require_once 'BxDataMigrationData.php';
-    //-- this is abstract class, need to inherit --//
-    class BxDataMigrationOrcaForum extends BxDataMigrationData
-    {
-        var $isGroupForum;
-        var $sOldTablePrefix;
-        var $sNewTablePrefix;
-
-        /**
-         * Class constructor;
-         *
-         * @param  : $oMigrationModule (object) - object instance of migration class;
-         * @param  : $rOldDb (resourse) - connect to old dolphin's database;
-         * @param  : $oDolModule (object);
-         * @return : void;
-         */
-        function BxDataMigrationOrcaForum(&$oMigrationModule, &$rOldDb, $oDolModule = '', $isGroupForum = false)
-        {
-            parent::BxDataMigrationData($oMigrationModule, $rOldDb, $oDolModule);
-            $this -> isGroupForum = $isGroupForum;
-
-            $this -> sOldTablePrefix  = !$this -> isGroupForum ? 'pre_' : 'grp_' ;
-            $this -> sNewTablePrefix  = !$this -> isGroupForum ? 'bx_' : 'bx_groups_' ;
-        }
-
-        //-- private methods --//
-
-        /**
-         * Transfer all forum's categories;
-         *
-         * @return : (string) - error message or empty;
-         */
-        function _transferCategories()
-        {
-            if($this -> isGroupForum) {
-                // clear all data;
-                $sQuery = "TRUNCATE TABLE `{$this -> sNewTablePrefix}forum_cat`";
-                $this -> oMigrationModule -> _oDb -> query($sQuery);
-            }
-
-            // get all categories;
-            $sQuery = "SELECT * FROM `{$this -> sOldTablePrefix}forum_cat`";
-            $rResult = mysql_query($sQuery, $this -> rOldDb);
-
-            while( $aRow = mysql_fetch_assoc($rResult) )
-            {
-                if( !$this -> isCategoryExisting($aRow['cat_id']) ) {
-                    // escape all data;
-                    $aRow = $this -> escapeData($aRow);
-
-                    // insert new;
-                    $sQuery =
-                    "
-                        INSERT INTO
-                            `{$this -> sNewTablePrefix}forum_cat`
-                        SET
-                            `cat_id`    = '{$aRow['cat_id']}',
-                            `cat_uri`   = '{$aRow['cat_uri']}',
-                            `cat_name`  = '{$aRow['cat_name']}',
-                            `cat_icon`  = '{$aRow['cat_icon']}',
-                            `cat_order` = '{$aRow['cat_order']}'
-                    ";
-
-                    $iResult = (int) $this -> oMigrationModule -> _oDb -> query($sQuery);
-                    if($iResult <= 0) {
-                        return 'Database error. Cannot insert new forum\'s category in the database.';
-                    }
-                }
-                else {
-                    return 'Duplicate data (in forum categories).
-                            Remove all data from forum and start again';
-                }
-            }
-        }
-
-         /**
-         * Transfer all forums;
-         *
-         * @return : (string) - error message or empty;
-         */
-        function _transferForums()
-        {
-            // get all forums;
-            $sQuery = "SELECT * FROM `{$this -> sOldTablePrefix}forum`";
-            $rResult = mysql_query($sQuery, $this -> rOldDb);
-
-            $sExtraSql = '';
-            while( $aRow = mysql_fetch_assoc($rResult) )
-            {
-                if( !$this -> isForumExisting($aRow['forum_id']) ) {
-                    // escape all data;
-                    $aRow = $this -> escapeData($aRow);
-
-                    if ($this -> isGroupForum) {
-                        $sExtraSql = ", `entry_id` = '{$aRow['forum_id']}'";
-                    }
-
-                    // insert new;
-                    $sQuery =
-                    "
-                        INSERT INTO
-                            `{$this -> sNewTablePrefix}forum`
-                        SET
-                            `forum_id`     = '{$aRow['forum_id']}',
-                            `forum_uri`    = '{$aRow['forum_uri']}',
-                            `cat_id`       = '{$aRow['cat_id']}',
-                            `forum_title`  = '{$aRow['forum_title']}',
-                            `forum_desc`   = '{$aRow['forum_desc']}',
-                            `forum_posts`  = '{$aRow['forum_posts']}',
-                            `forum_topics` = '{$aRow['forum_topics']}',
-                            `forum_last`   = '{$aRow['forum_last']}',
-                            `forum_type`   = '{$aRow['forum_type']}'
-                            {$sExtraSql}
-                    ";
-
-                    $iResult = (int) $this -> oMigrationModule -> _oDb -> query($sQuery);
-                    if($iResult <= 0) {
-                        return 'Database error. Cannot insert new forum in the database.';
-                    }
-                }
-                else {
-                    return 'Duplicate data (in forum).
-                            Remove all data from forum and start again';
-                }
-            }
-        }
-
-         /**
-         * Transfer all forum's flags;
-         *
-         * @return : (string) - error message or empty;
-         */
-        function _transferFlags()
-        {
-            // get all flags;
-            $sQuery = "SELECT * FROM `{$this -> sOldTablePrefix}forum_flag`";
-            $rResult = mysql_query($sQuery, $this -> rOldDb);
-
-            while( $aRow = mysql_fetch_assoc($rResult) )
-            {
-                if( !$this -> isFlagExisting($aRow['user'], $aRow['topic_id']) ) {
-                    // escape all data;
-                    $aRow = $this -> escapeData($aRow);
-
-                    // insert new;
-                    $sQuery =
-                    "
-                        INSERT INTO
-                            `{$this -> sNewTablePrefix}forum_flag`
-                        SET
-                            `user`     = '{$aRow['user']}',
-                            `topic_id` = '{$aRow['topic_id']}',
-                            `when`     = '{$aRow['when']}'
-                    ";
-
-                    $iResult = (int) $this -> oMigrationModule -> _oDb -> query($sQuery);
-                    if($iResult <= 0) {
-                        return 'Database error. Cannot insert new forum\'s flag in the database.';
-                    }
-                }
-                else {
-                    return 'Duplicate data (in forum flags).
-                            Remove all data from forum and start again';
-                }
-            }
-        }
-
-        /**
-         * Transfer all forum's posts;
-         *
-         * @return : (string) - error message or empty;
-         */
-        function _transferPosts()
-        {
-            // get all posts;
-            $sQuery = "SELECT * FROM `{$this -> sOldTablePrefix}forum_post`";
-            $rResult = mysql_query($sQuery, $this -> rOldDb);
-
-            while( $aRow = mysql_fetch_assoc($rResult) )
-            {
-                if( !$this -> isPostExisting($aRow['post_id']) ) {
-                    // escape all data;
-                    $aRow = $this -> escapeData($aRow);
-
-                    // insert new;
-                    $sQuery =
-                    "
-                        INSERT INTO
-                            `{$this -> sNewTablePrefix}forum_post`
-                        SET
-                            `post_id`   = '{$aRow['post_id']}',
-                            `topic_id`  = '{$aRow['topic_id']}',
-                            `forum_id`  = '{$aRow['forum_id']}',
-                            `user`      = '{$aRow['user']}',
-                            `post_text` = '{$aRow['post_text']}',
-                            `when`          = '{$aRow['when']}',
-                            `votes`     = '{$aRow['votes']}',
-                            `reports`   = '{$aRow['reports']}'
-                    ";
-
-                    $iResult = (int) $this -> oMigrationModule -> _oDb -> query($sQuery);
-                    if($iResult <= 0) {
-                        return 'Database error. Cannot insert new forum\'s post in the database.';
-                    }
-                }
-                else {
-                    return 'Duplicate data (in forum posts).
-                            Remove all data from forum and start again';
-                }
-            }
-        }
-
-         /**
-         * Transfer all forum's topics;
-         *
-         * @return : (string) - error message or empty;
-         */
-        function _transferTopics()
-        {
-            // get all topics;
-            $sQuery = "SELECT * FROM `{$this -> sOldTablePrefix}forum_topic`";
-            $rResult = mysql_query($sQuery, $this -> rOldDb);
-
-            while( $aRow = mysql_fetch_assoc($rResult) )
-            {
-                if( !$this -> isTopicExisting($aRow['topic_id']) ) {
-                    // escape all data;
-                    $aRow = $this -> escapeData($aRow);
-
-                    // insert new;
-                    $sQuery =
-                    "
-                        INSERT INTO
-                            `{$this -> sNewTablePrefix}forum_topic`
-                        SET
-                            `topic_id`          = '{$aRow['topic_id']}',
-                            `topic_uri`         = '{$aRow['topic_uri']}',
-                            `forum_id`          = '{$aRow['forum_id']}',
-                            `topic_title`       = '{$aRow['topic_title']}',
-                            `when`              = '{$aRow['when']}',
-                            `topic_posts`        = '{$aRow['topic_posts']}',
-                            `first_post_user` = '{$aRow['first_post_user']}',
-                            `first_post_when` = '{$aRow['first_post_when']}',
-                            `last_post_user`  = '{$aRow['last_post_user']}',
-                            `last_post_when`  = '{$aRow['last_post_when']}',
-                            `topic_sticky`    = '{$aRow['topic_sticky']}',
-                            `topic_locked`       = '{$aRow['topic_locked']}'
-                    ";
-
-                    $iResult = (int) $this -> oMigrationModule -> _oDb -> query($sQuery);
-                    if($iResult <= 0) {
-                        return 'Database error. Cannot insert new forum\'s topic in the database.';
-                    }
-                }
-                else {
-                    return 'Duplicate data (in forum topics).
-                            Remove all data from forum and start again';
-                }
-            }
-        }
-
-        /**
-         * Transfer all forum's users;
-         *
-         * @return : (string) - error message or empty;
-         */
-        function _transferUsers()
-        {
-            // get all users;
-            $sQuery = "SELECT * FROM `{$this -> sOldTablePrefix}forum_user`";
-            $rResult = mysql_query($sQuery, $this -> rOldDb);
-
-            while( $aRow = mysql_fetch_assoc($rResult) )
-            {
-                if( !$this -> isUserExisting($aRow['user_name']) ) {
-                    // escape all data;
-                    $aRow = $this -> escapeData($aRow);
-
-                    // insert new;
-                    $sQuery =
-                    "
-                        INSERT INTO
-                            `{$this -> sNewTablePrefix}forum_user`
-                        SET
-                            `user_name`          = '{$aRow['user_name']}',
-                            `user_pwd`         = '{$aRow['user_pwd']}',
-                            `user_email`      = '{$aRow['user_email']}',
-                            `user_join_date`  = '{$aRow['user_join_date']}'
-                    ";
-
-                    $iResult = (int) $this -> oMigrationModule -> _oDb -> query($sQuery);
-                    if($iResult <= 0) {
-                        return 'Database error. Cannot insert new user in the database.';
-                    }
-                }
-                else {
-                    return 'Duplicate data (in forum users).
-                            Remove all data from forum and start again';
-                }
-            }
-        }
-
-        /**
-         * Transfer all forum's users activity;
-         *
-         * @return : (string) - error message or empty;
-         */
-        function _transferUsersActivity()
-        {
-            // clear all data;
-            $sQuery = "TRUNCATE TABLE `{$this -> sNewTablePrefix}forum_user_activity`";
-            $this -> oMigrationModule -> _oDb -> query($sQuery);
-
-            // get all users activity;
-            $sQuery = "SELECT * FROM `{$this -> sOldTablePrefix}forum_user_activity`";
-            $rResult = mysql_query($sQuery, $this -> rOldDb);
-
-            while( $aRow = mysql_fetch_assoc($rResult) )
-            {
-                // escape all data;
-                $aRow = $this -> escapeData($aRow);
-
-                // insert new;
-                $sQuery =
-                "
-                    INSERT INTO
-                        `{$this -> sNewTablePrefix}forum_user_activity`
-                    SET
-                        `user`           = '{$aRow['user']}',
-                        `act_current`  = '{$aRow['act_current']}',
-                        `act_last`     = '{$aRow['act_last']}'
-                ";
-
-                $iResult = (int) $this -> oMigrationModule -> _oDb -> query($sQuery);
-                if($iResult <= 0) {
-                    return 'Database error. Cannot insert new user activity in the database.';
-                }
-            }
-        }
-
-        /**
-         * Transfer all forum's users stat;
-         *
-         * @return : (string) - error message or empty;
-         */
-        function _transferUsersStat()
-        {
-            // clear all data;
-            $sQuery = "TRUNCATE TABLE `{$this -> sNewTablePrefix}forum_user_stat`";
-            $this -> oMigrationModule -> _oDb -> query($sQuery);
-
-            // get all users stat;
-            $sQuery = "SELECT * FROM `{$this -> sOldTablePrefix}forum_user_stat`";
-            $rResult = mysql_query($sQuery, $this -> rOldDb);
-
-            while( $aRow = mysql_fetch_assoc($rResult) )
-            {
-                // escape all data;
-                $aRow = $this -> escapeData($aRow);
-
-                // insert new;
-                $sQuery =
-                "
-                    INSERT INTO
-                        `{$this -> sNewTablePrefix}forum_user_stat`
-                    SET
-                        `user`             = '{$aRow['user']}',
-                        `posts`           = '{$aRow['posts']}',
-                        `user_last_post` = '{$aRow['user_last_post']}'
-                ";
-
-                $iResult = (int) $this -> oMigrationModule -> _oDb -> query($sQuery);
-                if($iResult <= 0) {
-                    return 'Database error. Cannot insert new user stat in the database.';
-                }
-            }
-        }
-
-        /**
-         * Transfer all forum's users vote;
-         *
-         * @return : (string) - error message or empty;
-         */
-        function _transferUsersVote()
-        {
-            // get all users vote;
-            $sQuery = "SELECT * FROM `{$this -> sOldTablePrefix}forum_vote`";
-            $rResult = mysql_query($sQuery, $this -> rOldDb);
-
-            while( $aRow = mysql_fetch_assoc($rResult) )
-            {
-               if( !$this -> isUserVoteExisting($aRow['user']) ) {
-                       // escape all data;
-                    $aRow = $this -> escapeData($aRow);
-
-                    // insert new;
-                    $sQuery =
-                    "
-                        INSERT INTO
-                            `{$this -> sNewTablePrefix}forum_vote`
-                        SET
-                            `user_name`     = '{$aRow['user_name']}',
-                            `post_id`          = '{$aRow['post_id']}',
-                            `vote_when`     = '{$aRow['vote_when']}',
-                            `vote_point`     = '{$aRow['vote_point']}'
-                    ";
-
-                    $iResult = (int) $this -> oMigrationModule -> _oDb -> query($sQuery);
-                    if($iResult <= 0) {
-                        return 'Database error. Cannot insert new user vote in the database.';
-                    }
-                }
-                else {
-                    return 'Duplicate data (in forum users vote).
-                            Remove all data from forum and start again';
-                }
-            }
-        }
-
-        //-- public methods --//
-
-        /**
-         * Check category existing;
-         *
-         * @param  : $iCatId integer - category id;
-         * @return : boolean true if exist;
-         */
-        function isCategoryExisting($iCatId)
-        {
-            $iCatId = (int) $iCatId;
-            $sQuery  = "SELECT COUNT(*) FROM `{$this -> sNewTablePrefix}forum_cat` WHERE `cat_id` = {$iCatId}";
-            return $this -> oMigrationModule -> _oDb -> getOne($sQuery) ? true : false;
-        }
-
-        /**
-         * Check forum existing;
-         *
-         * @param  : $iForumId integer - forum id;
-         * @return : boolean true if exist;
-         */
-        function isForumExisting($iForumId)
-        {
-            $iForumId = (int) $iForumId;
-            $sQuery  = "SELECT COUNT(*) FROM `{$this -> sNewTablePrefix}forum` WHERE `forum_id` = {$iForumId}";
-            return $this -> oMigrationModule -> _oDb -> getOne($sQuery) ? true : false;
-        }
-
-        /**
-         * Check flags existing;
-         *
-         * @param  : $iUserId string - user nickname;
-         * @param  : $iTopicId integer - topic id;
-         * @return : boolean true if exist;
-         */
-        function isFlagExisting($sUserName, $iTopicId)
-        {
-            $sUserName = $this -> oMigrationModule -> _oDb  -> escape($sUserName);
-            $iTopicId = (int) $iTopicId;
-
-            $sQuery  = "SELECT COUNT(*) FROM `{$this -> sNewTablePrefix}forum_flag` WHERE `user` = '{$sUserName}' AND `topic_id` = {$iTopicId}";
-            return $this -> oMigrationModule -> _oDb -> getOne($sQuery) ? true : false;
-        }
-
-        /**
-         * Check post existing;
-         *
-         * @param  : $iPostId integer - post id;
-         * @return : boolean true if exist;
-         */
-        function isPostExisting($iPostId)
-        {
-            $iPostId = (int) $iPostId;
-
-            $sQuery  = "SELECT COUNT(*) FROM `{$this -> sNewTablePrefix}forum_post` WHERE `post_id` = {$iPostId}";
-            return $this -> oMigrationModule -> _oDb -> getOne($sQuery) ? true : false;
-        }
-
-        /**
-         * Check topic existing;
-         *
-         * @param  : $iTopicId integer - topic id;
-         * @return : boolean true if exist;
-         */
-        function isTopicExisting($iTopicId)
-        {
-            $iTopicId = (int) $iTopicId;
-
-            $sQuery  = "SELECT COUNT(*) FROM `{$this -> sNewTablePrefix}forum_topic` WHERE `topic_id` = {$iTopicId}";
-            return $this -> oMigrationModule -> _oDb -> getOne($sQuery) ? true : false;
-        }
-
-        /**
-         * Check user existing;
-         *
-         * @param  : $sUserName string;
-         * @return : boolean true if exist;
-         */
-        function isUserExisting($sUserName)
-        {
-            $sUserName = $this -> oMigrationModule -> _oDb  -> escape($sUserName);
-
-            $sQuery  = "SELECT COUNT(*) FROM `{$this -> sNewTablePrefix}forum_user` WHERE `user_name` = '{$sUserName}'";
-            return $this -> oMigrationModule -> _oDb -> getOne($sQuery) ? true : false;
-        }
-
-        /**
-         * Check user vote;
-         *
-         * @param  : $sUserName string;
-         * @return : boolean true if exist;
-         */
-        function isUserVoteExisting($sUserName)
-        {
-            $sUserName = $this -> oMigrationModule -> _oDb  -> escape($sUserName);
-
-            $sQuery  = "SELECT COUNT(*) FROM `{$this -> sNewTablePrefix}forum_vote` WHERE `user_name` = '{$sUserName}'";
-            return $this -> oMigrationModule -> _oDb -> getOne($sQuery) ? true : false;
-        }
-    }

+ 0 - 36
modules/boonex/data_migration/classes/BxDataMigrationPhotos.php

@@ -1,36 +0,0 @@
-<?php
-
-require_once('BxDataMigrationData.php');
-
-class BxDataMigrationPhotos extends BxDataMigrationData {
-    var $aPhotoObjects;
-    function BxDataMigrationPhotos (&$oMigrationModule, &$rOldDb, $oDolModule = '') {
-        parent::BxDataMigrationData($oMigrationModule, $rOldDb, $oDolModule);
-        $this->aPhotoObjects = array(
-            'profile_photos' => array(
-                'class' => 'BxDataMigrationProfilePhotos',
-                'file'  => 'BxDataMigrationProfilePhotos.php'
-            ),
-            'shared_photos' => array(
-                'class' => 'BxDataMigrationSharedPhotos',
-                'file'  => 'BxDataMigrationSharedPhotos.php'
-            )
-        );
-    }
-
-    function getMigration () {
-        $sResult = '';
-        foreach ($this->aPhotoObjects as $aValue) {
-            require_once($aValue['file']);
-            $oClass = new $aValue['class']($this->oMigrationModule, $this->rOldDb, $this->oDolModule);
-            $sResult =  $oClass->getMigration();
-            if($sResult != MIGRATION_SUCCESSFUL) {
-                return $sResult;
-            }
-        }
-
-        return $sResult;
-    }
-}
-
-?>

+ 0 - 193
modules/boonex/data_migration/classes/BxDataMigrationPoll.php

@@ -1,193 +0,0 @@
-<?php
-
-    require_once 'BxDataMigrationData.php';
-
-    class BxDataMigrationPoll extends BxDataMigrationData
-    {
-        var $iTransffered = 0;
-
-        /**
-         * Class constructor;
-         *
-         * @param  : $oMigrationModule (object) - object instance of migration class;
-         * @param  : $rOldDb (resourse) - connect to old dolphin's database;
-         * @param  : $oDolModule (object);
-         * @return : void;
-         */
-        function BxDataMigrationPoll(&$oMigrationModule, &$rOldDb, $oDolModule = '')
-        {
-            parent::BxDataMigrationData($oMigrationModule, $rOldDb, $oDolModule);
-        }
-
-        /**
-         * Function migrate polls data;
-         *
-         * @return : (integer) operation result;
-         */
-        function getMigration()
-        {
-            if(!$this -> oDolModule) {
-                 $this -> setResultStatus('System error: object  instance is not received');
-                 return MIGRATION_FAILED;
-            }
-
-            // set new status;
-            $this -> setResultStatus('Polls transfer now');
-
-            mysql_query('SET NAMES utf8', $this->rOldDb);
-
-            // transfer all profiles polls;
-            $sError = $this -> transferredProfilePolls();
-            if(!$sError) {
-                // transfer all admins polls;
-                $sError = $this -> transferredAdminPolls();
-                if($sError) {
-                    $this -> setResultStatus($sError);
-                    return MIGRATION_FAILED;
-                }
-            }
-            else {
-                $this -> setResultStatus($sError);
-                return MIGRATION_FAILED;
-            }
-
-            // set as finished;
-            $this -> setResultStatus('All polls were transferred (' .  $this -> iTransffered . ' items)');
-
-            return MIGRATION_SUCCESSFUL;
-        }
-
-        /**
-         * Function will trasnfer all admin's polls;
-         *
-         * @return : (string) - error message or empty;
-         */
-        function transferredAdminPolls()
-        {
-            // set charset;
-            /*$sQuery = "ALTER TABLE `polls_q` CHANGE `Question` `Question` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL";
-            mysql_query($sQuery, $this->rOldDb);
-
-            // set charset;
-            $sQuery = "ALTER TABLE `polls_a` CHANGE `Answer` `Answer` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL";
-            mysql_query($sQuery, $this->rOldDb);
-*/
-            $sQuery = "SELECT * FROM `polls_q`";
-            $rResult = mysql_query($sQuery, $this -> rOldDb);
-
-             while( $aRow = mysql_fetch_assoc($rResult) )
-             {
-                     $sPollQuestion    = $this -> oMigrationModule -> _oDb  -> escape($aRow['Question']);
-                     $sPollResult      = $sPollAnswers   = '';
-                     $iPollTotalresult = 0;
-                     $sPollStatus      = $aRow['Active'] == 'on' ? 'active' : '';
-
-                     // get poll's answer list;
-                     $sQuery  = "SELECT * FROM `polls_a` WHERE `ID` = {$aRow['ID']}";
-                     $rResult2 = mysql_query($sQuery, $this -> rOldDb);
-
-                     // get answer list;
-                     while( $aRow2 = mysql_fetch_assoc($rResult2) )
-                     {
-                         $sPollAnswers     .= $aRow2['Answer'] . '<delim>';
-                         $sPollResult      .= $aRow2['Votes']  . ';';
-                         $iPollTotalresult += $aRow2['Votes'];
-                     }
-
-                     $sPollAnswers = $this -> oMigrationModule -> _oDb  -> escape($sPollAnswers);
-
-                     $sQuery =
-                      "
-                            INSERT INTO
-                                `{$this -> oDolModule -> _oDb -> sTablePrefix}data`
-                            SET
-                                `poll_question` = '{$sPollQuestion}',
-                                   `poll_answers`  = '{$sPollAnswers}',
-                                   `poll_results`  = '{$sPollResult}',
-                                   `poll_status`    = '{$sPollStatus }',
-                                   `poll_approval` = '1',
-                                   `poll_date` = UNIX_TIMESTAMP(),
-                                   `poll_total_votes` = '{$iPollTotalresult}',
-                                   `id_profile`       = 0
-                      ";
-
-                      $this -> oMigrationModule -> _oDb -> query($sQuery);
-                      $iResult = (int) $this -> oMigrationModule -> _oDb -> query($sQuery);
-                      if($iResult <= 0) {
-                          return 'Database error. Cannot insert new admin poll in the database.';
-                      }
-
-                      $this -> iTransffered++;
-            }
-        }
-
-        /**
-         * Function will transfer all profile's polls;
-         *
-         * @return : (string) - error message or empty;
-         */
-        function transferredProfilePolls()
-        {
-             // set charset;
-           /* $sQuery = "ALTER TABLE `ProfilesPolls` CHANGE `poll_question` `poll_question` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL";
-            mysql_query($sQuery, $this->rOldDb);
-
-            // set charset;
-            $sQuery = "ALTER TABLE `ProfilesPolls` CHANGE `poll_answers` `poll_answers` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL";
-            mysql_query($sQuery, $this->rOldDb);
-*/
-            $sQuery  = "SELECT * FROM `ProfilesPolls`";
-            $rResult = mysql_query($sQuery, $this -> rOldDb);
-
-            while($aRow = mysql_fetch_assoc($rResult))
-            {
-                if( !$this -> isPollExisting($aRow['id_poll']) ) {
-                    $sPollQuestion = $this -> oMigrationModule -> _oDb  -> escape($aRow['poll_question']);
-                    $sPollAnswers  = $this -> oMigrationModule -> _oDb  -> escape($aRow['poll_answers']);
-
-                    // execute query;
-                    $sQuery =
-                    "
-                        INSERT INTO
-                            `{$this -> oDolModule -> _oDb -> sTablePrefix}data`
-                        SET
-                            `id_poll`        = {$aRow['id_poll']},
-                            `poll_question` = '{$sPollQuestion}',
-                               `poll_answers`  = '{$sPollAnswers}',
-                               `poll_results`  = '{$aRow['poll_results']}',
-                               `poll_status`    = '{$aRow['poll_status']}',
-                               `poll_approval` = '{$aRow['poll_approval']}',
-                               `poll_date` = UNIX_TIMESTAMP(),
-                               `poll_total_votes` = '{$aRow['poll_total_votes']}',
-                               `id_profile`       = {$aRow['id_profile']}
-                   ";
-
-                   $iResult = (int) $this -> oMigrationModule -> _oDb -> query($sQuery);
-                   if($iResult <= 0) {
-                        return 'Database error. Cannot insert new profile poll in the database.';
-                   }
-
-                   $this -> iTransffered++;
-                }
-                else {
-                    return 'Duplicate data (in profiles poll).
-                        Polls with
-                        similar info already exists
-                        (remove all polls and start again)';
-                }
-            }
-        }
-
-         /**
-         * Function will check existing poll in module;
-         *
-         * @param  : $iPollId (integer) - poll's Id;
-         * @return : true if exist;
-         */
-        function isPollExisting($iPollId)
-        {
-            $iPollId = (int) $iPollId;
-            $sQuery  = "SELECT COUNT(*) FROM `{$this -> oDolModule -> _oDb -> sTablePrefix}data` WHERE `id_poll` = '{$iPollId}'";
-            return $this -> oMigrationModule -> _oDb -> getOne($sQuery) ? true : false;
-        }
-    }

+ 0 - 311
modules/boonex/data_migration/classes/BxDataMigrationProfilePhotos.php

@@ -1,311 +0,0 @@
-<?php
-
-require_once('BxDataMigrationData.php');
-
-class BxDataMigrationProfilePhotos extends BxDataMigrationData {
-    var $sType;
-    var $sOldFilesPath;
-    var $aOldTables;
-
-    var $sNewAlbumName;
-    var $sNewFilesPath;
-    var $aNewSizes;
-    /**
-     * Class constructor;
-     *
-     * @param  : $oMigrationModule (object) - object instance of migration class;
-     * @param  : $rOldDb (resourse) - connect to old dolphin's database;
-     * @param  : $oDolModule (object);
-     * @return : void;
-     */
-    function BxDataMigrationProfilePhotos (&$oMigrationModule, &$rOldDb, $oDolModule = '') {
-        parent::BxDataMigrationData($oMigrationModule, $rOldDb, $oDolModule);
-        $this->sType = 'bx_photos';
-        $this->sOldFilesPath = 'media/images/profile/';
-
-        $this->aOldTables = array(
-            'main' => 'media',
-            'rate' => 'media_rating',
-            'rate_track' => 'media_voting_track'
-        );
-
-        $this->sNewAlbumName = $oDolModule->_oConfig->getGlParam('profile_album_name');
-        $this->sNewFilesPath  = 'modules/boonex/photos/data/files/';
-        $this->aNewSizes = array(
-            'icon'   => array('width' => $oDolModule->_oConfig->getGlParam('icon_width'), 'height' => $oDolModule->_oConfig->getGlParam('icon_height'), 'postfix' => '_ri'),
-            'thumb'  => array('width' => $oDolModule->_oConfig->getGlParam('thumb_width'), 'height' => $oDolModule->_oConfig->getGlParam('thumb_height'), 'postfix' => '_rt'),
-            'browse' => array('width' => $oDolModule->_oConfig->getGlParam('browse_width'), 'height' => $oDolModule->_oConfig->getGlParam('browse_height'), 'postfix' => '_t'),
-            'file'   => array('width' => $oDolModule->_oConfig->getGlParam('file_width'), 'height' => $oDolModule->_oConfig->getGlParam('file_height'), 'postfix' => '_m')
-        );
-    }
-
-    /**
-     * Function migrate profile photos data;
-     *
-     * @return : (integer) operation result;
-     */
-    function getMigration () {
-        if (!$this->oDolModule) {
-             $this->setResultStatus('System error: object  instance is not received');
-             return MIGRATION_FAILED;
-        }
-
-        // set new status;
-        $this->setResultStatus('Profile Photos are transfered now');
-
-         mysql_query('SET NAMES utf8', $this->rOldDb);
-
-        $sqlQuery = "SELECT `med_id` as `medID`,
-                            `med_prof_id` as `medProfId`,
-                            `med_file` as `medFile`,
-                            `med_title` as `medTitle`,
-                            if(`med_status`='active', 'approved', 'disapproved') as `medStatus`,
-                            UNIX_TIMESTAMP(`med_date`) as `medDate`
-                            FROM `{$this->aOldTables['main']}` WHERE `med_type`='photo' GROUP BY `med_id`";
-        $rResult = mysql_query($sqlQuery, $this->rOldDb);
-
-        if ($rResult) {
-            while ($aRow = mysql_fetch_assoc($rResult)) {
-                if (!$this->isEntryExisting($aRow['medID'])) {
-                    // escape all data;
-                    $aRow = $this -> escapeData($aRow);
-
-                    $aRow['medExt'] = substr($aRow['medFile'], strpos($aRow['medFile'], '.') + 1);
-                    $aSizeInfo = $this->getSizeInfo('photo_' . $aRow['medFile'], $aRow['medProfId']);
-                    $sUri  = uriGenerate($aRow['medTitle'], $this->sType . '_main', 'Uri');
-                    $sSize = $aSizeInfo['width'] . 'x' . $aSizeInfo['height'];
-                    $sHash = md5(microtime());
-
-                       //transform the file
-                    if( !$this->_exportFile(array('medID' => $aRow['medID'], 'medFile'=>$aRow['medFile'], 'medProfId'=>$aRow['medProfId'], 'medExt'=>$aRow['medExt']))) {
-                        continue;
-                    }
-
-                    $sqlQuery =
-                    "
-                        INSERT INTO
-                            `{$this->sType}_main`
-                        SET
-                          `ID`    =  {$aRow['medID']},
-                          `Owner` = '{$aRow['medProfId']}',
-                          `Ext`   = '{$aRow['medExt']}',
-                          `Size`  = '$sSize',
-                          `Title` = '{$aRow['medTitle']}',
-                          `Uri`   = '$sUri',
-                          `Desc`  = '{$aRow['medDesc']}',
-                          `Tags`  = '{$aRow['medTags']}',
-                          `Date`  = '{$aRow['medDate']}',
-                          `Views` = '{$aRow['medViews']}',
-                          `Hash`  = '$sHash',
-                          `Status` = '{$aRow['medStatus']}'
-                    ";
-
-                    $iResult = (int)$this->oMigrationModule->_oDb->query($sqlQuery);
-                    if ($iResult <= 0) {
-                        $this->setResultStatus('Database error. Cannot insert new photo to the database.');
-                        return MIGRATION_FAILED;
-                    }
-
-                    // define album
-                    $sError = $this->_defineAlbum($aRow['medID'], $aRow['medProfId'], $aRow['medTitle']);
-                    if ($sError) {
-                        $this->setResultStatus($sError);
-                        return MIGRATION_FAILED;
-                    }
-
-                    $sError = $this->_exportVotings($aRow['medID']);
-                    if ($sError) {
-                        $this->setResultStatus($sError);
-                        return MIGRATION_FAILED;
-                    }
-                }
-                else {
-                    $this->setResultStatus('Duplicate data. Photo with similar info already exists (remove all photos and start again)');
-                    return MIGRATION_FAILED;
-                }
-            }
-        }
-
-        // set as finished;
-        $this->setResultStatus('All photos were transferred');
-        return MIGRATION_SUCCESSFUL;
-    }
-
-    /**
-     * Function will check existing entry in module;
-     *
-     * @param  : $iEntryId (integer) - entry's id;
-     * @return : true if exist;
-     */
-    function isEntryExisting($iEntryId)
-    {
-        $iEntryId = (int) $iEntryId;
-        $sqlQuery  = "SELECT COUNT(*) FROM `{$this->sType}_main` WHERE `ID` = {$iEntryId} LIMIT 1";
-        return $this -> oMigrationModule -> _oDb -> getOne($sqlQuery) ? true : false;
-    }
-
-    /**
-     * Function returns sizes array of photo;
-     *
-     * @param  : $sFile (string) - file name;
-     * @param  : $iOwnerId (int) - file's owner;
-     * @return : array with 'width' and 'height' elements;
-     */
-    function getSizeInfo ($sFile, $iOwnerId) {
-        $sFile = strip_tags($sFile);
-        $iOwnerId = (int)$iOwnerId;
-        $sFilePath = $this->oMigrationModule->_oDb->getExtraParam('config_root') . $this->sOldFilesPath . $iOwnerId . '/' . $sFile;
-        if (file_exists($sFilePath)) {
-            $aInfo = getimagesize($sFilePath);
-            return array('width' => $aInfo[0], 'height' => $aInfo[1]);
-        }
-        else
-            return $this->aNewSizes['file'];
-    }
-
-    /**
-     * Function creates album and add new object there;
-     *
-     * @param  : $iFileId (int) - file id;
-     * @param  : $iOwnerId (int) - file's owner id;
-     * @param  : $sFileName (string) - file name;
-     * @return : nothing;
-     */
-
-    function _defineAlbum($iFileId, $iOwnerId, $sFileName) {
-        $sNickName = getNickName($iOwnerId);
-        $sAlbum    = str_replace('{nickname}', $sNickName, $this->sNewAlbumName);
-
-       $iFileId = (int) $iFileId;
-       $iOwnerId = (int) $iOwnerId;
-
-       $oAlbums   = &new BxDolAlbums($this->sType, $iOwnerId);
-       $aData     = array(
-           'caption'         => $this->oMigrationModule->_oDb->escape($sAlbum),
-           'owner'             => $iOwnerId,
-              'description'     => $this->oMigrationModule->_oDb->escape($sAlbum),
-           'location'         => _t('_Undefined'),
-           'AllowAlbumView'  => BX_DOL_PG_ALL,
-       );
-
-       $iAlbumId = (int) $oAlbums->addAlbum($aData);
-       // check objects;
-       $sqlQuery = "SELECT COUNT(*) FROM `sys_albums_objects` WHERE `id_album` = {$iAlbumId} AND `id_object` = {$iFileId}";
-       if (!$this->oMigrationModule->_oDb->getOne($sQuery)) {
-           $oAlbums->addObject($iAlbumId, $iFileId, true);
-       }
-    }
-
-    /**
-     * Function export photo file;
-     *
-     * @param  : $aFile (array) - array with medID and medExt elements;
-     * @return : (boolean) false if not exist;
-     */
-    function _exportFile ($aFile = array()) {
-        $bOpperation = true;
-
-        $sFile = $aFile['medFile'];
-        $sSourceFilePath = $this->oMigrationModule->_oDb->getExtraParam('config_root') . $this->sOldFilesPath . $aFile['medProfId'] . '/photo_' . $sFile;
-        $sNewDirectory = BX_DIRECTORY_PATH_ROOT . $this->sNewFilesPath;
-        if (file_exists($sSourceFilePath) && is_dir($sNewDirectory)) {
-            //copy as original
-            copy($sSourceFilePath, $sNewDirectory . $aFile['medID'] . '.' . $aFile['medExt']);
-            foreach ($this->aNewSizes as $aValue) {
-                $sNewFile = $sNewDirectory . $aFile['medID'] . $aValue['postfix'] . '.jpg';
-                imageResize($sSourceFilePath, $sNewFile, $aValue['width'], $aValue['height'], true);
-            }
-        }
-        else {
-            $bOpperation = false;
-        }
-
-        return $bOpperation;
-    }
-
-    /**
-     * Function export all votings;
-     *
-     * @param     : $iFileId (integer);
-     * @return : (string) - error message or empty;
-     */
-    function _exportVotings ($iFileId) {
-        $iFileId = (int)$iFileId;
-        $sqlQuery = "SELECT * FROM `{$this->aOldTables['rate']}` WHERE `med_id` = {$iFileId}";
-        $rResult = mysql_query($sqlQuery, $this->rOldDb);
-        if ($rResult) {
-            while ($aRow = mysql_fetch_assoc($rResult)) {
-               $sqlQuery =
-               "
-                   INSERT INTO
-                       `{$this->sType}_rating`
-                SET
-                    `gal_id` = {$aRow['med_id']},
-                    `gal_rating_count` = {$aRow['med_rating_count']},
-                    `gal_rating_sum`   = {$aRow['med_rating_sum']}
-               ";
-
-                $iResult = (int)$this->oMigrationModule->_oDb->query($sqlQuery);
-                if ($iResult <= 0) {
-                    return 'Database error. Cannot insert votes information in the database.';
-                }
-
-                //export voting tracks;
-                $sError = $this->_exportVotingTrack($aRow['med_id']);
-
-                if ($sError) {
-                    return $sError;
-                }
-
-                $fRate = $aRow['med_rating_sum'] / $aRow['med_rating_count'];
-                //update primary table;
-                $sqlQuery =
-                "
-                    UPDATE
-                        `{$this->sType}_main`
-                    SET
-                        `Rate` = $fRate,
-                        `RateCount` = {$aRow['med_rating_count']}
-                    WHERE
-                        `ID` = {$iFileId}
-                ";
-
-                $iResult = (int)$this->oMigrationModule->_oDb->query($sqlQuery);
-                if ($iResult <= 0) {
-                    return 'Database error. Cannot update votes information in the database.';
-                }
-            }
-        }
-    }
-
-    /**
-     * Function export all votings track;
-     *
-     * @param     : $iGalId (integer);
-     * @return : (string) - error message or empty;
-     */
-    function _exportVotingTrack ($iGalId) {
-        $iGalId = (int) $iGalId;
-        $sqlQuery = "SELECT * FROM `{$this->aOldTables['rate_track']}` WHERE `med_id` = {$iGalId}";
-        $rResult = mysql_query($sqlQuery, $this->rOldDb);
-        if ($rResult) {
-            while ($aRow = mysql_fetch_assoc($rResult)) {
-              $sqlQuery =
-                "
-                    INSERT INTO
-                        `{$this->sType}_voting_track`
-                    SET
-                        `gal_id`   = {$aRow['med_id']},
-                        `gal_ip`   = '{$aRow['med_ip']}',
-                        `gal_date` = '{$aRow['med_date']}'
-                    ";
-                $iResult = (int)$this->oMigrationModule->_oDb->query($sqlQuery);
-                if ($iResult <= 0) {
-                    return 'Database error. Cannot insert votes track information to the database.';
-                }
-            }
-        }
-    }
-}
-
-?>

+ 0 - 290
modules/boonex/data_migration/classes/BxDataMigrationProfiles.php

@@ -1,290 +0,0 @@
-<?php
-
-    require_once 'BxDataMigrationData.php';
-
-    class BxDataMigrationProfiles extends BxDataMigrationData
-    {
-        var $bAvatarInstalled;
-        var $iTransffered = 0;
-
-        /**
-         * Class constructor;
-         *
-         * @param  : $oMigrationModule (object) - object instance of migration class;
-         * @param  : $rOldDb (resourse) - connect to old dolphin's database;
-         * @param  : $oDolModule (object);
-         * @return : void;
-         */
-        function BxDataMigrationProfiles(&$oMigrationModule, &$rOldDb, $oDolModule = '')
-        {
-            parent::BxDataMigrationData($oMigrationModule, $rOldDb, $oDolModule);
-            $this -> bAvatarInstalled = $this -> oMigrationModule -> _oDb -> isModule('avatar') ? true : false;
-        }
-
-        /**
-         * Function migrate profiles data;
-         *
-         * @return : (string) operation result;
-         */
-        function getMigration()
-        {
-            // set new status;
-            $this -> setResultStatus('Profiles transfer now');
-
-            mysql_query('SET NAMES utf8', $this->rOldDb);
-
-            $sError = $this -> transformProfiles();
-            if($sError) {
-               $this -> setResultStatus($sError);
-               return MIGRATION_FAILED;
-            }
-
-            // set as finished;
-            $this -> setResultStatus('All profiles were transferred (' .  $this -> iTransffered . ' items)');
-
-            return MIGRATION_SUCCESSFUL;
-        }
-
-        /**
-         * Function Transform all old profiles;
-         *
-         * @return : (string) - error message if nedded;
-         */
-        function transformProfiles()
-        {
-            // upate new profiles table;
-            $sError = $this -> _updateNewProfiles();
-            if($sError) {
-                return $sError;
-            }
-
-            $sQuery = "SELECT * FROM `Profiles`";
-            $rResult = mysql_query($sQuery, $this -> rOldDb);
-
-             while( $aRow = mysql_fetch_assoc($rResult) )
-             {
-                  if( !$this -> isProfileExisting($aRow['NickName']) ) {
-                     // escape all data;
-                     $aRow = $this -> escapeData($aRow);
-
-                     $sQuery =
-                     "
-                         INSERT INTO
-                             `Profiles`
-                         SET
-                             `ID`            = '{$aRow['ID']}',
-                             `NickName`       = '{$aRow['NickName']}',
-                             `Email`          = '{$aRow['Email']}',
-                             `Password`       = '{$aRow['Password']}',
-                             `Status`         = '{$aRow['Status']}',
-                             `Couple`           = '{$aRow['Couple']}',
-                             `Sex`                 = '{$aRow['Sex']}',
-                             `LookingFor`    = '{$aRow['LookingFor']}',
-                             `Headline`         = '{$aRow['Headline']}',
-                             `DescriptionMe` = '{$aRow['DescriptionMe']}',
-                             `Country`         = '{$aRow['Country']}',
-                             `City`             = '{$aRow['City']}',
-                             `DateOfBirth`    = '{$aRow['DateOfBirth']}',
-                             `Featured`        = '{$aRow['Featured']}',
-                             `DateReg`        = '{$aRow['DateReg']}',
-                             `DateLastEdit`  = '{$aRow['DateLastEdit']}',
-                             `DateLastLogin` = '{$aRow['DateLastLogin']}',
-                             `DateLastNav`     = '{$aRow['DateLastNav']}',
-                             `aff_num`         = '{$aRow['aff_num']}',
-                             `Tags`             = '{$aRow['Tags']}',
-                             `zip`             = '{$aRow['zip']}',
-                             `EmailNotify`     = '{$aRow['EmailNotify']}'
-                     ";
-
-                     $iResult = (int) $this -> oMigrationModule -> _oDb -> query($sQuery);
-                     if($iResult <= 0) {
-                        return 'Database error. Cannot insert new profile in the database.';
-                     }
-
-                     // update passwords
-                     $this -> oMigrationModule -> _oDb -> query("UPDATE `Profiles` SET `Salt` = CONV(FLOOR(RAND()*99999999999999), 10, 36) WHERE `ID` = '{$aRow['ID']}'");
-                     $this -> oMigrationModule -> _oDb -> query("UPDATE `Profiles` SET `Password` = SHA1(CONCAT(`Password`, `Salt`)) WHERE `ID` = '{$aRow['ID']}'");
-
-                     createUserDataFile($aRow['ID']);
-
-                     // migrate profile's picture;
-                     if($aRow['Picture'] && $this -> bAvatarInstalled) {
-                         $this -> _exportAvatar($aRow['ID'], $aRow['PrimPhoto']);
-                     }
-
-                     // migrate friends;
-                     $sResult = $this -> _exportFriends($aRow['ID']);
-                     if($sResult) {
-                         return $sResult;
-                     }
-
-                     $this -> iTransffered++;
-                  }
-             }
-        }
-
-        /**
-         * Function get profile image;
-         *
-         * @param  : $iImgId (integer) - profile's image id;
-         * @return : (string) - image's name;
-         */
-        function getProfileImage($iImgId)
-        {
-            $iImgId = (int) $iImgId;
-
-            $sQuery = "SELECT `med_file` FROM `media` WHERE `med_id` = {$iImgId} AND `med_type` = 'photo' LIMIT 1";
-            $rResult = mysql_query($sQuery, $this -> rOldDb);
-            $aRow = mysql_fetch_assoc($rResult);
-
-            return isset($aRow['med_file']) ? $aRow['med_file'] : '';
-        }
-
-        /**
-         * Function update new dolphin's profiles table;
-         *
-         * @return : (string) - error message or empty;
-         */
-        function _updateNewProfiles()
-        {
-            // define the last profile Id from old Db;
-            $sQuery = "SELECT `ID` FROM `Profiles` ORDER BY `ID` DESC LIMIT 1";
-            $rResult = mysql_query($sQuery, $this -> rOldDb);
-
-            $aRow = mysql_fetch_assoc($rResult);
-            $iLastProfileId = (int) $aRow['ID'];
-            $iLastProfileId++;
-
-            // update current profiles table;
-            $sQuery = "SELECT `ID` FROM `Profiles`";
-            $aProfiles = $this -> oMigrationModule -> _oDb -> getAll($sQuery);
-
-            if($aProfiles) {
-                foreach($aProfiles as $iKey => $aItems)
-                {
-                    $sQuery = "UPDATE `Profiles` SET `ID` = '{$iLastProfileId}' WHERE `ID` = '{$aItems['ID']}'";
-                    $this -> oMigrationModule -> _oDb -> query($sQuery);
-
-                    createUserDataFile($iLastProfileId);
-                    $iLastProfileId++;
-                }
-            }
-        }
-
-        /**
-         * Export all profile's friends;
-         *
-         * @param $iProfileId integer;
-         * @return string - error message if needed;
-         */
-        function _exportFriends($iProfileId)
-        {
-            $iProfileId = (int) $iProfileId;
-
-            $sQuery = "SELECT * FROM `FriendList` WHERE `ID` = {$iProfileId} OR `Profile` = {$iProfileId}";
-            $rResult = mysql_query($sQuery, $this -> rOldDb);
-
-            while( $aRow = mysql_fetch_assoc($rResult) )
-            {
-                if( !$this -> isFriendExisting($aRow['ID'], $aRow['Profile'])) {
-                   // build query;
-                   $sQuery =
-                    "
-                         INSERT IGNORE INTO
-                            `sys_friend_list`
-                        SET
-                           `ID`           = '{$aRow['ID']}',
-                           `Profile`    = '{$aRow['Profile']}',
-                           `Check`      = '{$aRow['Check']}',
-                           `When`          = NOW()
-                   ";
-
-                   $iResult = (int) $this -> oMigrationModule -> _oDb -> query($sQuery);
-                   if($iResult <= 0) {
-                       return 'Database error. Cannot insert friend list in the database.';
-                   }
-                }
-            }
-        }
-
-        /**
-         *  Function export profile's avatar;
-         *
-         * @param  : $iProfileId (integer);
-         * @param  : $sAvatarName (integer) - avatar's id;
-         * @return : void;
-         */
-        function _exportAvatar($iProfileId, $iAvatarId)
-        {
-            $iProfileId = (int) $iProfileId;
-            $iAvatarId = (int) $iAvatarId;
-
-            //define the old avatar's name;
-            $sOldAvatarName = $this -> getProfileImage($iAvatarId);
-
-            if($sOldAvatarName) {
-                //define old avatar's path;
-                $sOldAvatarPath = $this -> oMigrationModule -> _oDb -> getExtraParam('config_profileImage')
-                            .  $iProfileId . '/photo_' . $sOldAvatarName;
-
-                require_once(BX_DIRECTORY_PATH_MODULES . 'boonex/avatar/classes/BxAvaModule.php');
-                $oAvatar = BxDolModule::getInstance('bx_avatar');
-                $oAvatar -> _iProfileId = $iProfileId;
-
-                // resize image;
-                $sNewImagePath = BX_AVA_DIR_TMP . '_' . $iProfileId . BX_AVA_EXT;
-
-                $o =& BxDolImageResize::instance(BX_AVA_W, BX_AVA_W);
-                $o->removeCropOptions ();
-                $o->setJpegOutput (true);
-                $o->setSize (BX_AVA_W, BX_AVA_W);
-                $o->setSquareResize (true);
-                if (IMAGE_ERROR_SUCCESS != $o->resize($sOldAvatarPath, $sNewImagePath))
-                    return false;
-
-                return $oAvatar ->_addAvatar($sNewImagePath, false);
-            }
-        }
-
-        /**
-         * Function will check existing poll in module;
-         *
-         * @param  : $sPollQuestion (string) - poll's question;
-         * @return : true if exist;
-         */
-        function isProfileExisting($sNickName)
-        {
-            $sNickName = $this -> oMigrationModule -> _oDb  -> escape($sNickName);
-            $sQuery  = "SELECT COUNT(*) FROM `Profiles` WHERE `NickName` = '{$sNickName}'";
-            return $this -> oMigrationModule -> _oDb -> getOne($sQuery) ? true : false;
-        }
-
-        /**
-         * Check friends pair;
-         *
-         * @param $iProfileId integer
-         * @param $iFriendId integer
-         * @return boolean - true if already existing
-         */
-        function isFriendExisting($iProfileId, $iFriendId)
-        {
-            $iProfileId = (int) $iProfileId;
-            $iFriendId  = (int) $iFriendId;
-
-            $sQuery =
-            "
-                SELECT
-                    COUNT(*)
-                FROM
-                    `sys_friend_list`
-                WHERE
-                    (
-                        (`ID` = {$iProfileId} AND `Profile` = {$iFriendId})
-                            OR
-                        (`ID` = {$iFriendId} AND `Profile` = {$iProfileId})
-                    )
-            ";
-
-            return $this -> oMigrationModule -> _oDb -> getOne($sQuery) ? true : false;
-        }
-    }

+ 0 - 310
modules/boonex/data_migration/classes/BxDataMigrationProfilesCustomFields.php

@@ -1,310 +0,0 @@
-<?php
-
-    require_once 'BxDataMigrationData.php';
-    require_once( BX_DIRECTORY_PATH_CLASSES . 'BxDolPFM.php' );
-
-    require_once( BX_DIRECTORY_PATH_INC . 'prof.inc.php' );
-
-    class BxDataMigrationProfilesCustomFields extends BxDataMigrationData
-    {
-        var $iTransffered = 0;
-
-        var $aOldProfileTable = array();
-        var $aNewProfileTable = array();
-
-        var $aFiltered = array();
-
-        /**
-         * Class constructor;
-         *
-         * @param  : $oMigrationModule (object) - object instance of migration class;
-         * @param  : $rOldDb (resourse) - connect to old dolphin's database;
-         * @param  : $oDolModule (object);
-         * @return : void;
-         */
-        function BxDataMigrationProfilesCustomFields(&$oMigrationModule, &$rOldDb, $oDolModule = '')
-        {
-            parent::BxDataMigrationData($oMigrationModule, $rOldDb, $oDolModule);
-            $this -> aFiltered = array(
-                'PrimPhoto', 'Picture',
-            );
-        }
-
-        /**
-         * Function migrate profiles custom fields;
-         *
-         * @return : (string) operation result;
-         */
-        function getMigration()
-        {
-            // set new status;
-            $this -> setResultStatus('Profiles custom fields transfer now');
-
-            mysql_query('SET NAMES utf8', $this->rOldDb);
-
-            //-- get old table structure --//
-            $sQuery = "DESCRIBE `Profiles`";
-            $rResult = mysql_query($sQuery, $this -> rOldDb);
-            while( $aRow = mysql_fetch_assoc($rResult) )
-            {
-                 $this -> aOldProfileTable[$aRow['Field']] = array (
-                     'Type' => $aRow['Type'],
-                     'Null' => $aRow['Null'],
-                     'Key'  => $aRow['Key'],
-                     'Default' => $aRow['Default'],
-                     'Extra' => $aRow['Extra'],
-                 );
-            }
-            //--
-
-            //-- get new table structure --//
-            $sQuery = "DESCRIBE `Profiles`";
-            $aRow = $this -> oMigrationModule -> _oDb -> getAll($sQuery);
-            foreach($aRow as $iKey => $aItems)
-            {
-                $this -> aNewProfileTable[$aItems['Field']] = array (
-                     'Type' => $aItems['Type'],
-                     'Null' => $aItems['Null'],
-                     'Key'  => $aItems['Key'],
-                     'Default' => $aItems['Default'],
-                     'Extra' => $aItems['Extra'],
-                 );
-            }
-           //--
-
-           //-- compare the recived array --//
-           foreach($this -> aOldProfileTable as $sKey => $aItems)
-           {
-                if(array_key_exists($sKey, $this -> aNewProfileTable) || in_array($sKey, $this -> aFiltered)) {
-                   unset($this -> aOldProfileTable[$sKey]);
-                }
-           }
-           //--
-
-           //-- alter new table --//
-           foreach($this -> aOldProfileTable as $sKey => $aItems)
-           {
-               // define dafault value;
-               $sDefault = $aItems['Default']
-                   ? "DEFAULT '{$aItems['Default']}'"
-                   : '';
-
-               $sNull  = $aItems['Null'] == 'NO'
-                      ? 'NOT NULL'
-                       : '';
-
-               $sQuery =
-               "
-                       ALTER TABLE `Profiles` ADD `{$sKey}` {$aItems['Type']} {$sNull} {$sDefault}
-               ";
-
-               // add new field
-               $this -> oMigrationModule -> _oDb -> query($sQuery);
-
-               // transfer  into sys_profile_fields
-               $this -> _transferProfileFields($sKey);
-
-               // transfer  into sys_pre_values
-               $this -> _transferPreValues($sKey);
-
-               $this -> iTransffered++;
-           }
-           //--
-
-           //-- transfer all data --//
-           $this -> _transformData();
-           //--
-
-           //-- Recompile all needed cache files --//
-
-           bx_import('BxDolInstallerUtils');
-           $oInstallerUtils = new BxDolInstallerUtils();
-           $oInstallerUtils->updateProfileFieldsHtml();
-
-           $oCacher = new BxDolPFMCacher();
-           $oCacher -> createCache();
-
-           $this -> compilePreValues();
-
-           //--
-
-           // set as finished;
-           $this -> setResultStatus('All profiles custom fields were transferred (' .  $this -> iTransffered . ' items)');
-
-           return MIGRATION_SUCCESSFUL;
-        }
-
-        /**
-         * Transfer all linked values from prevalues
-         *
-         * @param $sFieldName strings
-         * @return void
-         */
-        function _transferPreValues($sFieldName)
-        {
-            $sFieldName = $this -> escape($sFieldName);
-
-            $sQuery = "SELECT * FROM `Prevalues` WHERE `Key` = '{$sFieldName}'";
-            $rResult = mysql_query($sQuery, $this -> rOldDb);
-
-            while( $aRow = mysql_fetch_assoc($rResult) )
-            {
-               // escape all data;
-               $aRow = $this -> escapeData($aRow);
-
-                $sQuery =
-                "
-                    INSERT INTO
-                        `" . BX_SYS_PRE_VALUES_TABLE . "`
-                    SET
-                        `Key`      = '{$aRow['Key']}',
-                        `Value`  = '{$aRow['Value']}',
-                        `Order`  = '{$aRow['Order']}',
-                        `LKey`   = '{$aRow['LKey']}',
-                        `LKey2`  = '{$aRow['LKey2']}',
-                        `LKey3`  = '{$aRow['LKey3']}',
-                        `Extra`  = '{$aRow['Extra']}',
-                        `Extra2` = '{$aRow['Extra2']}',
-                        `Extra3` = '{$aRow['Extra3']}'
-                ";
-
-                 $this -> oMigrationModule -> _oDb -> query($sQuery);
-            }
-        }
-
-        /**
-         * Add new value in sys_profile_fields
-         *
-         * @param $sFieldName strings
-         * @return void
-         */
-        function _transferProfileFields($sFieldName)
-        {
-            $sFieldName = $this -> escape($sFieldName);
-
-            $sQuery = "SELECT * FROM `ProfileFields` WHERE `Name` = '{$sFieldName}'";
-            $rResult = mysql_query($sQuery, $this -> rOldDb);
-
-            while( $aRow = mysql_fetch_assoc($rResult) )
-            {
-                if( !$this -> isFieldExists($aRow['Name']) ) {
-                    // escape all data;
-                       $aRow = $this -> escapeData($aRow);
-
-                    // insert new
-                    $sQuery =
-                    "
-                        INSERT INTO
-                            `sys_profile_fields`
-                        SET
-                            `Name`             = '{$aRow['Name']}',
-                            `Type`             = '{$aRow['Type']}',
-                            `Control`         = '{$aRow['Control']}',
-                            `Extra`         = '{$aRow['Extra']}',
-                            `Min`             = '{$aRow['Min']}',
-                            `Max`             = '{$aRow['Max']}',
-                            `Values`         = '{$aRow['Values']}',
-                            `UseLKey`         = '{$aRow['UseLKey']}',
-                            `Check`         = '{$aRow['Check']}',
-                            `Unique`         = '{$aRow['Unique']}',
-                            `Default`         = '{$aRow['Default']}',
-                            `Mandatory`     = '{$aRow['Mandatory']}',
-                            `Deletable`     = '{$aRow['Deletable']}',
-                            `JoinPage`      = '{$aRow['JoinPage']}',
-                            `JoinBlock`     = '{$aRow['JoinBlock']}',
-                            `JoinOrder`     = '{$aRow['JoinOrder']}',
-                            `EditOwnBlock`  = '{$aRow['EditOwnBlock']}',
-                            `EditOwnOrder`  = '{$aRow['EditOwnOrder']}',
-                            `EditAdmBlock`  = '{$aRow['EditAdmBlock']}',
-                            `EditAdmOrder`  = '{$aRow['EditAdmOrder']}',
-                            `EditModBlock`  = '{$aRow['EditModBlock']}',
-                            `EditModOrder`  = '{$aRow['EditModOrder']}',
-                            `ViewMembBlock` = '{$aRow['ViewMembBlock']}',
-                            `ViewMembOrder` = '{$aRow['ViewMembOrder']}',
-                            `ViewAdmBlock`  = '{$aRow['ViewAdmBlock']}',
-                            `ViewAdmOrder`  = '{$aRow['ViewAdmOrder']}',
-                            `ViewModBlock`  = '{$aRow['ViewModBlock']}',
-                            `ViewModOrder`  = '{$aRow['ViewModOrder']}',
-                            `ViewVisBlock`  = '{$aRow['ViewVisBlock']}',
-                            `ViewVisOrder`  = '{$aRow['ViewVisOrder']}',
-                            `SearchParams`  = '{$aRow['SearchParams']}',
-
-                            `SearchSimpleBlock`  = '{$aRow['SearchSimpleBlock']}',
-                            `SearchSimpleOrder`  = '{$aRow['SearchSimpleOrder']}',
-                            `SearchQuickBlock`   = '{$aRow['SearchQuickBlock']}',
-                            `SearchQuickOrder`   = '{$aRow['SearchQuickOrder']}',
-                            `SearchAdvBlock`     = '{$aRow['SearchAdvBlock']}',
-                            `SearchAdvOrder`     = '{$aRow['SearchAdvOrder']}',
-                            `MatchField`          = '{$aRow['MatchField']}',
-                            `MatchPercent`          = '{$aRow['MatchPercent']}'
-                    ";
-
-                     $this -> oMigrationModule -> _oDb -> query($sQuery);
-                }
-            }
-        }
-
-        /**
-         * Function transfer field value
-         *
-         * @return void
-         */
-        function _transformData()
-        {
-            // get all data from old profiles table;
-            $sQuery = "SELECT * FROM `Profiles`";
-            $rResult = mysql_query($sQuery, $this -> rOldDb);
-
-            while( $aRow = mysql_fetch_assoc($rResult) )
-            {
-               // escape all data;
-               $aRow = $this -> escapeData($aRow);
-
-                //-- update new profiles table --//
-                $sUpdateField = '';
-                foreach($this -> aOldProfileTable as $sKey => $aItems)
-                {
-                    $sValue =
-                    $sUpdateField .= "`{$sKey}` = '{$aRow[$sKey]}',";
-                }
-
-                $sUpdateField = trim($sUpdateField, ',');
-
-                $sQuery =
-                "
-                    UPDATE
-                        `Profiles`
-                    SET
-                        {$sUpdateField}
-                    WHERE
-                        `ID` = {$aRow['ID']}
-                ";
-
-                $this -> oMigrationModule -> _oDb -> query($sQuery);
-                //--
-            }
-        }
-
-        /**
-         * Check field exist in  sys_profile_fields
-         *
-         * @param $sFieldName string
-         * @return true if exist;
-         */
-        function isFieldExists($sFieldName)
-        {
-            $sFieldName = $this -> escape($sFieldName);
-            $sQuery  = sprintf("SELECT COUNT(*) FROM `sys_profile_fields` WHERE `Name` = '%s'", $sFieldName);
-            return $this -> oMigrationModule -> _oDb -> getOne($sQuery) ? true : false;
-        }
-
-        /**
-         * Compile all prevalues value;
-         *
-         * @return boolean - true if file was compiled;
-         */
-        function compilePreValues()
-        {
-            compilePreValues();
-        }
-    }

+ 0 - 385
modules/boonex/data_migration/classes/BxDataMigrationSharedPhotos.php

@@ -1,385 +0,0 @@
-<?php
-
-require_once('BxDataMigrationData.php');
-
-class BxDataMigrationSharedPhotos extends BxDataMigrationData {
-    var $sType;
-    var $sOldFilesPath;
-    var $aOldTables;
-
-    var $sNewAlbumName;
-    var $sNewFilesPath;
-    var $aNewSizes;
-    /**
-     * Class constructor;
-     *
-     * @param  : $oMigrationModule (object) - object instance of migration class;
-     * @param  : $rOldDb (resourse) - connect to old dolphin's database;
-     * @param  : $oDolModule (object);
-     * @return : void;
-     */
-    function BxDataMigrationSharedPhotos (&$oMigrationModule, &$rOldDb, $oDolModule = '') {
-        parent::BxDataMigrationData($oMigrationModule, $rOldDb, $oDolModule);
-        $this->sType = 'bx_photos';
-        $this->sOldFilesPath = 'media/images/sharingImages/';
-
-        $this->aOldTables = array(
-            'main' => 'sharePhotoFiles',
-            'favorite' => 'sharePhotoFavorites',
-            'rate' => 'gphoto_rating',
-            'rate_track' => 'gphoto_voting_track',
-            'cmts' => 'CmtsSharedPhoto'
-        );
-
-        $this->sNewAlbumName = $oDolModule->_oConfig->getGlParam('profile_album_name');
-        $this->sNewFilesPath  = 'modules/boonex/photos/data/files/';
-        $this->aNewSizes = array(
-            'icon'   => array('width' => $oDolModule->_oConfig->getGlParam('icon_width'), 'height' => $oDolModule->_oConfig->getGlParam('icon_height'), 'postfix' => '_ri'),
-            'thumb'  => array('width' => $oDolModule->_oConfig->getGlParam('thumb_width'), 'height' => $oDolModule->_oConfig->getGlParam('thumb_height'), 'postfix' => '_rt'),
-            'browse' => array('width' => $oDolModule->_oConfig->getGlParam('browse_width'), 'height' => $oDolModule->_oConfig->getGlParam('browse_height'), 'postfix' => '_t'),
-            'file'   => array('width' => $oDolModule->_oConfig->getGlParam('file_width'), 'height' => $oDolModule->_oConfig->getGlParam('file_height'), 'postfix' => '_m')
-        );
-    }
-
-    /**
-     * Function migrate shared_photos data;
-     *
-     * @return : (integer) operation result;
-     */
-    function getMigration () {
-        if (!$this->oDolModule) {
-             $this->setResultStatus('System error: object  instance is not received');
-             return MIGRATION_FAILED;
-        }
-
-        // set new status;
-        $this->setResultStatus('Shared photos transfer now');
-
-        mysql_query('SET NAMES utf8', $this->rOldDb);
-
-        $sqlQuery = "SELECT * FROM `{$this->aOldTables['main']}` GROUP BY `medID`";
-        $rResult = mysql_query($sqlQuery, $this->rOldDb);
-        while ($aRow = mysql_fetch_assoc($rResult)) {
-
-                $sUri = !$this->isEntryExisting($aRow['medUri'])
-                    ? $aRow['medUri']
-                    : uriGenerate($aRow['medTitle'], $this->sType . '_main', 'Uri');
-
-                $sUri = $this -> oMigrationModule -> _oDb  -> escape($sUri);
-
-                $aSizeInfo = $this->getSizeInfo($aRow['medID'] . '.' . $aRow['medExt']);
-                $sSize        = $aSizeInfo['width'] . 'x' . $aSizeInfo['height'];
-                $sStatus = $aRow['Approved'] == 'true' ? 'approved' : 'disapproved';
-                $sHash = md5(microtime());
-
-                 // escape all data;
-                $aRow = $this -> escapeData($aRow);
-
-                $sqlQuery =
-                "
-                    INSERT INTO
-                        `{$this->sType}_main`
-                    SET
-                      `Owner` = '{$aRow['medProfId']}',
-                      `Ext`   = '{$aRow['medExt']}',
-                      `Size`  = '$sSize',
-                      `Title` = '{$aRow['medTitle']}',
-                      `Uri`   = '{$sUri}',
-                      `Desc`  = '{$aRow['medDesc']}',
-                      `Tags`  = '{$aRow['medTags']}',
-                      `Date`  = '{$aRow['medDate']}',
-                      `Views` = '{$aRow['medViews']}',
-                      `Hash`  = '$sHash',
-                      `Status` = '$sStatus'
-                ";
-
-            $iResult = (int)$this->oMigrationModule->_oDb->query($sqlQuery);
-            if ($iResult <= 0) {
-                $this->setResultStatus('Database error. Cannot insert new photo to the database.');
-                return MIGRATION_FAILED;
-            }
-
-            // get last file id;
-            $iFileId = $this->oMigrationModule->_oDb->lastId();
-
-            //transform the file
-               $this->_exportFile(
-                   array(
-                       'medID'     => $aRow['medID'],
-                       'medFile'   => $aRow['medFile'],
-                       'medProfId' => $aRow['medProfId'],
-                       'medExt'    => $aRow['medExt'],
-                       'newID'        => $iFileId,
-                   ));
-
-                $oTag = new BxDolTags();
-                $oTag->reparseObjTags($this->sType, $iFileId);
-
-                // define album
-                $sError = $this->_defineAlbum($iFileId, $aRow['medProfId'], $aRow['medTitle']);
-                if ($sError) {
-                    $this->setResultStatus($sError);
-                    return MIGRATION_FAILED;
-                }
-
-                $sError = $this->_exportFavorites(array('old'=>$aRow['medID'], 'new'=>$iFileId));
-                if ($sError) {
-                    $this->setResultStatus($sError);
-                    return MIGRATION_FAILED;
-                }
-
-                $sError = $this->_exportVotings(array('old'=>$aRow['medID'], 'new'=>$iFileId));
-                if ($sError) {
-                    $this->setResultStatus($sError);
-                    return MIGRATION_FAILED;
-                }
-
-                $sError = $this->_exportComments(array('old'=>$aRow['medID'], 'new'=>$iFileId));
-                if ($sError) {
-                    $this->setResultStatus($sError);
-                    return MIGRATION_FAILED;
-                }
-            }
-
-        // set as finished;
-        $this->setResultStatus('All photos were transferred');
-        return MIGRATION_SUCCESSFUL;
-    }
-
-    /**
-     * Function will check existing entry in module;
-     *
-     * @param  : $sEntryUri (string) - entry's uri;
-     * @return : true if exist;
-     */
-    function isEntryExisting($sEntryUri)
-    {
-        $sEntryUri = $this -> oMigrationModule -> _oDb  -> escape($sEntryUri);
-        $sqlQuery  = "SELECT COUNT(*) FROM `{$this->sType}_main` WHERE `Uri` = '$sEntryUri'";
-        return $this -> oMigrationModule -> _oDb -> getOne($sqlQuery) ? true : false;
-    }
-
-    /**
-     * Function returns sizes array of photo;
-     *
-     * @param  : $sFile (string) - file name;
-     * @return : array with 'width' and 'height' elements;
-     */
-    function getSizeInfo ($sFile) {
-        $sFile = strip_tags($sFile);
-        $sFilePath = $this->oMigrationModule->_oDb->getExtraParam('config_root') . $this->sOldFilesPath . $sFile;
-        if (file_exists($sFilePath)) {
-            $aInfo = getimagesize($sFilePath);
-            return array('width' => $aInfo[0], 'height' => $aInfo[1]);
-        }
-        else
-            return $this->aNewSizes['file'];
-    }
-
-    /**
-     * Function creates album and add new object there;
-     *
-     * @param  : $iFileId (int) - file id;
-     * @param  : $iOwnerId (int) - file's owner id;
-     * @param  : $sFileName (string) - file name;
-     * @return : nothing;
-     */
-
-    function _defineAlbum($iFileId, $iOwnerId, $sFileName) {
-       $sNickName = getNickName($iOwnerId);
-       $sAlbum    = str_replace('{nickname}', $sNickName, $this->sNewAlbumName);
-
-       $iFileId = (int) $iFileId;
-       $iOwnerId = (int) $iOwnerId;
-
-       $oAlbums   = &new BxDolAlbums($this->sType, $iOwnerId);
-       $aData     = array(
-           'caption'         => $this->oMigrationModule->_oDb->escape($sAlbum),
-           'owner'             => $iOwnerId,
-              'description'     => $this->oMigrationModule->_oDb->escape($sAlbum),
-           'location'         => _t('_Undefined'),
-           'AllowAlbumView'  => BX_DOL_PG_ALL,
-       );
-
-       $iAlbumId = (int) $oAlbums->addAlbum($aData);
-
-       // check objects;
-       $sqlQuery = "SELECT COUNT(*) FROM `sys_albums_objects` WHERE `id_album` = {$iAlbumId} AND `id_object` = {$iFileId}";
-       if (!$this->oMigrationModule->_oDb->getOne($sQuery)) {
-           $oAlbums->addObject($iAlbumId, $iFileId, true);
-       }
-    }
-
-    /**
-     * Function export photo file;
-     *
-     * @param  : $aFile (array) - array with medID and medExt elements;
-     * @return : (boolean) - true if was copied;
-     */
-    function _exportFile ($aFile = array()) {
-        $bOpperation = true;
-
-        $sFile = $aFile['medID'] . '.' . $aFile['medExt'];
-        $sSourceFilePath = $this->oMigrationModule->_oDb->getExtraParam('config_root') . $this->sOldFilesPath . $sFile;
-        $sNewDirectory = BX_DIRECTORY_PATH_ROOT . $this->sNewFilesPath;
-
-        if ( file_exists($sSourceFilePath) ) {
-            if (!copy($sSourceFilePath, $sNewDirectory . $aFile['newID'] . '.' . $aFile['medExt'])) {
-                return false;
-            }
-            foreach ($this->aNewSizes as $aValue) {
-                $sNewFile = $sNewDirectory . $aFile['newID'] . $aValue['postfix'] . '.jpg';
-                imageResize($sSourceFilePath, $sNewFile, $aValue['width'], $aValue['height'], true);
-            }
-        }
-        else {
-            $bOpperation = false;
-        }
-
-        return $bOpperation;
-     }
-
-     /**
-     * Function export all comments;
-     *
-     * @param     : $iFileId (integer) - file id;
-     * @return : (string) - error message or empty;
-     */
-    function _exportComments ($aFile) {
-        $sQuery = "SELECT * FROM `{$this->aOldTables['cmts']}` WHERE `cmt_object_id` = {$aFile['old']}";
-        $rResult = mysql_query($sQuery, $this->rOldDb);
-        if ($rResult) {
-            while ($aRow = mysql_fetch_assoc($rResult)) {
-                $sText = $this->oMigrationModule->_oDb->escape($aRow['cmt_text']);
-
-                $sqlQuery =
-                "
-                    INSERT INTO
-                        `{$this->sType}_cmts`
-                    SET
-                        `cmt_id`          = {$aRow['cmt_id']},
-                        `cmt_parent_id`  = {$aRow['cmt_parent_id']},
-                        `cmt_object_id`  = {$aFile['new']},
-                        `cmt_author_id`  = {$aRow['cmt_author_id']},
-                        `cmt_text`         = '{$sText}',
-                        `cmt_rate`         = {$aRow['cmt_rate']},
-                        `cmt_rate_count` = {$aRow['cmt_rate_count']},
-                        `cmt_time`         = '{$aRow['cmt_time']}',
-                        `cmt_replies`     = {$aRow['cmt_replies']}
-                ";
-
-                $this->oMigrationModule->_oDb->query($sqlQuery);
-            }
-        }
-    }
-
-    /**
-     * Function export all votings;
-     *
-     * @param     : $iFileId (integer);
-     * @return : (string) - error message or empty;
-     */
-    function _exportVotings ($aFile) {
-        $sqlQuery = "SELECT * FROM `{$this->aOldTables['rate']}` WHERE `gal_id` = {$aFile['old']}";
-        $rResult = mysql_query($sqlQuery, $this->rOldDb);
-        if ($rResult) {
-            while ($aRow = mysql_fetch_assoc($rResult)) {
-               $sqlQuery =
-               "
-                   INSERT INTO
-                       `{$this->sType}_rating`
-                SET
-                    `gal_id` = {$aFile['new']},
-                    `gal_rating_count` = {$aRow['gal_rating_count']},
-                    `gal_rating_sum`   = {$aRow['gal_rating_sum']}
-               ";
-
-                $iResult = (int)$this->oMigrationModule->_oDb->query($sqlQuery);
-                if ($iResult <= 0) {
-                    return 'Database error. Cannot insert votes information in the database.';
-                }
-
-                //export voting tracks;
-                $sError = $this->_exportVotingTrack($aFile);
-
-                if ($sError) {
-                    return $sError;
-                }
-
-                $fRate = $aRow['gal_rating_sum'] / $aRow['gal_rating_count'];
-                //update primary table;
-                $sqlQuery =
-                "
-                    UPDATE
-                        `{$this->sType}_main`
-                    SET
-                        `Rate` = $fRate,
-                        `RateCount` = {$aRow['gal_rating_count']}
-                    WHERE
-                        `ID` = {$aFile['new']}
-                ";
-
-                $iResult = (int)$this->oMigrationModule->_oDb->query($sqlQuery);
-                if ($iResult <= 0) {
-                    return 'Database error. Cannot update votes information in the database.';
-                }
-            }
-        }
-    }
-
-    /**
-     * Function export all votings track;
-     *
-     * @param     : $iGalId (integer);
-     * @return : (string) - error message or empty;
-     */
-    function _exportVotingTrack ($aFile) {
-        $sqlQuery = "SELECT * FROM `{$this->aOldTables['rate_track']}` WHERE `gal_id` = {$aFile['old']}";
-        $rResult = mysql_query($sqlQuery, $this->rOldDb);
-        if ($rResult) {
-            while ($aRow = mysql_fetch_assoc($rResult)) {
-              $sqlQuery =
-                "
-                    INSERT INTO
-                        `{$this->sType}_voting_track`
-                    SET
-                        `gal_id`   = {$aFile['new']},
-                        `gal_ip`   = '{$aRow['gal_ip']}',
-                        `gal_date` = '{$aRow['gal_date']}'
-                    ";
-                $iResult = (int)$this->oMigrationModule->_oDb->query($sqlQuery);
-                if ($iResult <= 0) {
-                    return 'Database error. Cannot insert votes track information to the database.';
-                }
-            }
-        }
-    }
-
-    /**
-     * Function export all favorites records;
-     *
-     * @param  : $iFileId (integer);
-     * @return : (string) - error message or empty;
-     */
-    function _exportFavorites ($aFile) {
-        $sqlQuery = "SELECT `medID`, `userID`, UNIX_TIMESTAMP(`favDate`) as `favDate` FROM `{$this->aOldTables['favorite']}` WHERE `medID` = {$aFile['old']}";
-        $rResult = mysql_query($sqlQuery, $this->rOldDb);
-        while ($aRow = mysql_fetch_assoc($rResult)) {
-          $sqlQuery =
-            "
-                INSERT INTO
-                    `{$this->sType}_favorites`
-                SET
-                    `ID` = {$aFile['new']},
-                    `Profile` = '{$aRow['userID']}',
-                    `Date` = '{$aRow['gal_date']}'
-                ";
-            $iResult = (int)$this->oMigrationModule->_oDb->query($sqlQuery);
-            if ($iResult <= 0) {
-                return 'Database error. Cannot insert favorites information to the database.';
-            }
-        }
-    }
-}
-
-?>

+ 0 - 363
modules/boonex/data_migration/classes/BxDataMigrationSounds.php

@@ -1,363 +0,0 @@
-<?php
-
-    bx_import('BxDolCategories');
-    bx_import('BxDolAlbums');
-
-    require_once 'BxDataMigrationData.php';
-
-    class BxDataMigrationSounds extends BxDataMigrationData
-    {
-        var $sNewAlbumName;
-        var $sType;
-        var $sTablePrefix;
-        var $iTransffered = 0;
-
-        /**
-         * Class constructor;
-         *
-         * @param  : $oMigrationModule (object) - object instance of migration class;
-         * @param  : $rOldDb (resourse) - connect to old dolphin's database;
-         * @param  : $oDolModule (object);
-         * @return : void;
-         */
-        function BxDataMigrationSounds(&$oMigrationModule, &$rOldDb, $oDolModule = '')
-        {
-            parent::BxDataMigrationData($oMigrationModule, $rOldDb, $oDolModule);
-            $this -> sNewAlbumNames = getParam('bx_sounds_profile_album_name');
-
-            $sMainPrefix   = $oDolModule -> _oConfig -> getMainPrefix();
-            $this -> sType = $sMainPrefix;
-            $this -> sTablePrefix = $sMainPrefix . '_';
-        }
-
-        /**
-         * Function migrate sounds;
-         *
-         * @return : (integer) operation result;
-         */
-        function getMigration()
-        {
-            if(!$this -> oDolModule) {
-                 $this -> setResultStatus('System error: object  instance is not received');
-                 return MIGRATION_FAILED;
-            }
-
-            // set new status;
-            $this -> setResultStatus('All sounds transfer now');
-
-            mysql_query('SET NAMES utf8', $this->rOldDb);
-
-            $sQuery = "SELECT * FROM `RayMusicFiles`";
-            $rResult = mysql_query($sQuery, $this -> rOldDb);
-
-            while( $aRow = mysql_fetch_assoc($rResult) )
-            {
-                if( !$this -> isSoundsExisting($aRow['ID']) ) {
-                    // escape all data;
-                    $aRow = $this -> escapeData($aRow);
-
-                    //transform the file
-                    if(!$this -> _exportFile($aRow['ID'])) {
-                        continue;
-                    }
-
-                     // define file status;
-                     $sFileStatus = $aRow['Approved'] == 'true' ? 'approved' : 'disapproved';
-
-                    // execute query;
-                    $sQuery =
-                    "
-                        INSERT INTO
-                            `RayMp3Files`
-                        SET
-                            `ID`             = {$aRow['ID']},
-                            `Title`         = '{$aRow['Title']}',
-                            `Uri`             = '{$aRow['Uri']}',
-                            `Tags`             = '{$aRow['Tags']}',
-                            `Description`     = '{$aRow['Description']}',
-                            `Time`             = '{$aRow['Time']}',
-                            `Date`             = '{$aRow['Date']}',
-                            `Reports`         = '{$aRow['Reports']}',
-                            `Owner`         = '{$aRow['Owner']}',
-                            `Listens`         = '{$aRow['Listens']}',
-                            `Status`         = '$sFileStatus'
-
-                    ";
-
-                    $iResult = (int) $this -> oMigrationModule -> _oDb -> query($sQuery);
-                    if($iResult <= 0) {
-                        $this -> setResultStatus('Database error. Cannot insert new sound in the database.');
-                        return MIGRATION_FAILED;
-                    }
-
-                    $oTag = new BxDolTags();
-                    $oTag -> reparseObjTags($this -> sType, $aRow['ID']);
-
-                    // define sound's album;
-                    $sError = $this -> _defineSoundsAlbum($aRow['ID'], $aRow['Owner'], $aRow['Title']);
-                    if($sError) {
-                        $this -> setResultStatus($sError);
-                        return MIGRATION_FAILED;
-                    }
-
-                    $sError = $this -> _exportVotings($aRow['ID']);
-                    if($sError) {
-                        $this -> setResultStatus($sError);
-                        return MIGRATION_FAILED;
-                    }
-
-                    $sError = $this -> _exportComments($aRow['ID']);
-                    if($sError) {
-                        $this -> setResultStatus($sError);
-                        return MIGRATION_FAILED;
-                    }
-
-                    $this -> iTransffered++;
-                }
-                else {
-                      $this -> setResultStatus('Duplicate data.
-                            Sounds with similar info already exists
-                            (remove all sounds and start again');
-
-                      return MIGRATION_FAILED;
-                }
-            }
-
-            // set as finished;
-            $this -> setResultStatus('All sound were transferred (' .  $this -> iTransffered . ' items)');
-
-            return MIGRATION_SUCCESSFUL;
-        }
-
-        /**
-         * Function define sound's album and if not exist will create;
-         *
-         * @param  : $iFileId (integer);
-         * @param  : $iOwnerId (integer) - sound's owner profile id;
-         * @return : (string) - error message or empty;
-         */
-        function _defineSoundsAlbum($iFileId, $iOwnerId, $sFileName)
-        {
-            $iFileId = (int) $iFileId;
-            $iOwnerId = (int) $iOwnerId;
-
-           $sNickName = getNickName($iOwnerId);
-           if(!$sNickName) {
-              //return 'Owner of ' . $sFileName . ' was not defined';
-           }
-
-           $sAlbum    = str_replace('{nickname}', $sNickName, $this -> sNewAlbumNames);
-
-           $oAlbums   = & new BxDolAlbums($this -> sType, $iOwnerId);
-           $aData     = array(
-               'caption'         => $this -> oMigrationModule -> _oDb  -> escape($sAlbum),
-               'owner'             => $iOwnerId,
-                  'description'     => '',
-               'location'         => '',
-               'AllowAlbumView'  => BX_DOL_PG_ALL,
-           );
-
-           $iAlbumId = (int) $oAlbums -> addAlbum($aData);
-
-           // check objects;
-           $sQuery = "SELECT COUNT(*) FROM `sys_albums_objects` WHERE `id_album` = {$iAlbumId} AND `id_object` = {$iFileId}";
-           if( !$this -> oMigrationModule -> _oDb -> getOne($sQuery) ) {
-               $oAlbums -> addObject($iAlbumId, $iFileId, true);
-           }
-        }
-
-        /**
-         * Function export all sound comments;
-         *
-         * @param     : $iFileId (integer);
-         * @return : (string) - error message or empty;
-         */
-        function _exportComments($iFileId)
-        {
-            $iFileId = (int) $iFileId;
-
-            $sQuery = "SELECT * FROM `CmtsSharedMusic` WHERE `cmt_object_id` = {$iFileId}";
-            $rResult = mysql_query($sQuery, $this -> rOldDb);
-
-            while( $aRow = mysql_fetch_assoc($rResult) )
-            {
-                $sText = $this -> oMigrationModule -> _oDb  -> escape($aRow['cmt_text']);
-                $sQuery =
-                "
-                    INSERT INTO
-                        `{$this -> sTablePrefix}cmts`
-                    SET
-                        `cmt_id`          = {$aRow['cmt_id']},
-                        `cmt_parent_id`  = {$aRow['cmt_parent_id']},
-                        `cmt_object_id`  = {$aRow['cmt_object_id']},
-                        `cmt_author_id`  = {$aRow['cmt_author_id']},
-                        `cmt_text`         = '{$sText}',
-                        `cmt_rate`         = {$aRow['cmt_rate']},
-                        `cmt_rate_count` = {$aRow['cmt_rate_count']},
-                        `cmt_time`         = '{$aRow['cmt_time']}',
-                        `cmt_replies`     = {$aRow['cmt_replies']}
-                ";
-
-                $iResult = (int) $this -> oMigrationModule -> _oDb -> query($sQuery);
-                if($iResult <= 0) {
-                    return 'Database error. Cannot insert comments information in the database.';
-                }
-            }
-        }
-
-        /**
-         * Function export all sound votings;
-         *
-         * @param     : $iFileId (integer);
-         * @return : (string) - error message or empty;
-         */
-        function _exportVotings($iFileId)
-        {
-            $iFileId = (int) $iFileId;
-
-            $sQuery = "SELECT * FROM `gmusic_rating` WHERE `gal_id` = {$iFileId}";
-            $rResult = mysql_query($sQuery, $this -> rOldDb);
-
-            while( $aRow = mysql_fetch_assoc($rResult) )
-            {
-               $sQuery =
-               "
-                   INSERT INTO
-                       `{$this -> sTablePrefix}rating`
-                SET
-                    `gal_id` = {$aRow['gal_id']},
-                    `gal_rating_count` = {$aRow['gal_rating_count']},
-                    `gal_rating_sum`   = {$aRow['gal_rating_sum']}
-               ";
-
-                $iResult = (int) $this -> oMigrationModule -> _oDb -> query($sQuery);
-                if($iResult <= 0) {
-                    return 'Database error. Cannot insert votes information in the database.';
-                }
-
-                //export voting tracks;
-                $sError = $this -> exportVotingTrack($aRow['gal_id']);
-
-                if($sError) {
-                    return $sError;
-                }
-
-                $fRate = $aRow['gal_rating_sum'] / $aRow['gal_rating_count'];
-                //update primary table;
-                $sQuery =
-                "
-                    UPDATE
-                        `RayMp3Files`
-                    SET
-                        `Rate` = $fRate,
-                        `RateCount` = {$aRow['gal_rating_count']}
-                    WHERE
-                        `ID` = {$iFileId}
-                ";
-
-                $iResult = (int) $this -> oMigrationModule -> _oDb -> query($sQuery);
-                if($iResult <= 0) {
-                    return 'Database error. Cannot update votes information in the database.';
-                }
-
-            }
-        }
-
-        /**
-         * Function export all sound votings track;
-         *
-         * @param     : $iGalId (integer);
-         * @return : (string) - error message or empty;
-         */
-        function exportVotingTrack($iGalId)
-        {
-              $iGalId = (int) $iGalId;
-
-              $sQuery = "SELECT * FROM `gmusic_voting_track` WHERE `gal_id` = {$iGalId}";
-              $rResult = mysql_query($sQuery, $this -> rOldDb);
-
-              while( $aRow = mysql_fetch_assoc($rResult) )
-              {
-                  $sQuery =
-                    "
-                    INSERT INTO
-                        `{$this -> sTablePrefix}voting_track`
-                    SET
-                        `gal_id`   = {$aRow['gal_id']},
-                        `gal_ip`   = '{$aRow['gal_ip']}',
-                        `gal_date` = '{$aRow['gal_date']}'
-                    ";
-
-                    $iResult = (int) $this -> oMigrationModule -> _oDb -> query($sQuery);
-                    if($iResult <= 0) {
-                        return 'Database error. Cannot insert votes track information in the database.';
-                    }
-              }
-        }
-
-        /**
-         * Function export sound file;
-         *
-         * @param  : $iFileId (integer);
-         * @return : (boolean);
-         */
-        function _exportFile($iFileId)
-        {
-            $iFileId = (int) $iFileId;
-
-            $bOpperation = true;
-
-            // copy file;
-            $sFileName = $iFileId . '.mp3';
-            $sOldFile  = $this -> oMigrationModule -> _oDb -> getExtraParam('config_root');
-            $sOldFile .= 'ray/modules/music/files/' . $sFileName;
-
-            $sNewDirectory = BX_DIRECTORY_PATH_ROOT . 'flash/modules/mp3/files/';
-            if( !@copy($sOldFile, $sNewDirectory . $sFileName) ){
-                $bOpperation = false;
-            }
-
-            return $bOpperation;
-        }
-
-        /**
-         * Function export all favorites records;
-         *
-         * @param  : $iFileId (integer);
-         * @return : (string) - error message or empty;
-         */
-        function _exportFavorites ($iFileId) {
-            $iFileId = (int)$iFileId;
-            $sqlQuery = "SELECT `medID`, `userID`, UNIX_TIMESTAMP(`favDate`) as `favDate` FROM `shareMusicFavorites` WHERE `medID` = {$iFileId}";
-            $rResult = mysql_query($sqlQuery, $this->rOldDb);
-            while ($aRow = mysql_fetch_assoc($rResult)) {
-              $sqlQuery =
-                "
-                    INSERT INTO
-                        `{$this->sType}_favorites`
-                    SET
-                        `ID`   = {$aRow['medID']},
-                        `Profile`   = '{$aRow['userID']}',
-                        `Date` = '{$aRow['gal_date']}'
-                    ";
-                $iResult = (int)$this->oMigrationModule->_oDb->query($sqlQuery);
-                if ($iResult <= 0) {
-                    return 'Database error. Cannot insert favorites information to the database.';
-                }
-            }
-        }
-
-        /**
-         * Function check exsiting sounds;
-         *
-         * @param : $iSoundId (integer) - sound's id;
-         * @return : true if exist;
-         */
-        function isSoundsExisting($iSoundId)
-        {
-            $iSoundId = (int) $iSoundId;
-
-            $sQuery = "SELECT COUNT(*) FROM `RayMp3Files` WHERE `ID` = '{$iSoundId}'";
-            return $this -> oMigrationModule -> _oDb -> getOne($sQuery) ? true : false;
-        }
-    }

+ 0 - 221
modules/boonex/data_migration/classes/BxDataMigrationTemplate.php

@@ -1,221 +0,0 @@
-<?php
-
-    /***************************************************************************
-    *                            Dolphin Smart Community Builder
-    *                              -------------------
-    *     begin                : Mon Mar 23 2006
-    *     copyright            : (C) 2007 BoonEx Group
-    *     website              : http://www.boonex.com
-    * This file is part of Dolphin - Smart Community Builder
-    *
-    * Dolphin is free software; you can redistribute it and/or modify it under
-    * the terms of the GNU General Public License as published by the
-    * Free Software Foundation; either version 2 of the
-    * License, or  any later version.
-    *
-    * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-    * without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-    * See the GNU General Public License for more details.
-    * You should have received a copy of the GNU General Public License along with Dolphin,
-    * see license.txt file; if not, write to marketing@boonex.com
-    ***************************************************************************/
-
-    bx_import('BxDolModuleTemplate');
-
-    class BxDataMigrationTemplate extends BxDolModuleTemplate
-    {
-        /**
-         * Class constructor
-         */
-        function BxDataMigrationTemplate(&$oConfig, &$oDb)
-        {
-            parent::BxDolModuleTemplate($oConfig, $oDb);
-        }
-
-        function pageCodeAdminStart()
-        {
-            ob_start();
-        }
-
-        function adminBlock ($sContent, $sTitle, $aMenu = array())
-        {
-            return DesignBoxAdmin($sTitle, $sContent, $aMenu);
-        }
-
-        function pageCodeAdmin ($sTitle)
-        {
-            global $_page;
-            global $_page_cont;
-
-            $_page['name_index'] = 9;
-
-            $_page['header'] = $sTitle ? $sTitle : $GLOBALS['site']['title'];
-            $_page['header_text'] = $sTitle;
-
-            $_page_cont[$_page['name_index']]['page_main_code'] = ob_get_clean();
-
-            PageCodeAdmin();
-        }
-
-        /**
-         * Function will include the js file ;
-         *
-         * @param  : $sName (string) - name of needed file ;
-         * @return : (text) ;
-         */
-        function addJs($sName)
-        {
-            return '<script type="text/javascript" src="' . $this -> _oConfig -> getHomeUrl() . 'js/' . $sName . '" language="javascript"/></script>';
-        }
-
-        /**
-         * Function will get spy's css file;
-         *
-         * @param : $sFileName (string) - css file name;
-         * @return : (string);
-         */
-        function getCssFile($sFileName)
-        {
-            return '<link href="' . $this -> getCssUrl($sFileName) . '" rel="stylesheet" type="text/css" />';
-        }
-
-        /**
-         * Function will get config form;
-         *
-         * @param  : $oModule (object) - current module;
-         * @return : (text) - html presentation data;
-         */
-        function getConfigForm(&$oModule)
-        {
-            $aForm = array (
-                'form_attrs' => array (
-                    'action' =>  $oModule -> sPathToModule . 'administration/settings',
-                    'method' => 'post',
-                    'name' => 'form',
-                ),
-
-                'params' => array (
-                    'checker_helper' => 'BxCheckerMigration',
-                    'db' => array(
-                        'submit_name' => 'do_submit', // some filed name with non empty value to determine if the for was submitted,
-                    ),
-                ),
-
-                'inputs' => array(
-                    'location' => array (
-                        'type'     => 'text',
-                        'name'     => 'location',
-                        'caption'  => _t('_bx_data_migration_q_where_located'),
-                        'required' => true,
-                        'value'       => $oModule  -> _oDb -> getExtraParam('root'),
-                        'info'     => _t('_bx_data_migration_q_d_where_located', ' ' . BX_DIRECTORY_PATH_ROOT),
-
-                        // checker params
-                        'checker' => array (
-                            'func'   => 'DolpinDirectory',
-                            'params' => array(),
-                            'error'  => _t('_bx_data_migration_q_e_wrong_path'),
-                        ),
-                    ),
-                ),
-            );
-
-           // add submit button;
-           $aForm['inputs'][] = array (
-                'type' => 'submit',
-                'name' => 'do_submit',
-                'value' => _t('_Submit'),
-           );
-
-           $oForm = & new BxTemplFormView($aForm);
-           $oForm -> initChecker();
-
-            if ( $oForm -> isSubmittedAndValid() ) {
-                $sOutputCode = $oModule -> createConfig( $oForm -> getCleanValue('location') );
-            }
-            else {
-                $sOutputCode = $oForm -> getCode();
-            }
-
-           return $sOutputCode;
-        }
-
-        /**
-         * Function will generate list of modules;
-         *
-         * @param  : $aModules (array) - list of all allowed modules;
-         * @param  : $aStatusTexts (array) - list of modules status texts;
-         * @param  : $oModule (object) - current module's instance;
-         * @return : (text) html presentation data;
-         */
-        function getModulesList($aModules, &$aStatusTexts, &$oModule)
-        {
-            $sLoadingImg  = $this -> getIconUrl('loading.gif');
-            $sOutputCode  = $this -> addJs('data_migration.js');
-
-            $sOutputCode .= "<script type=\"text/javascript\">
-                oDataMigration.sPathToModule = '{$oModule -> sPathToModule}migration/';
-                oDataMigration.sLoadingImg = '{$sLoadingImg}';
-               </script>";
-
-            $aForm = array (
-                'form_attrs' => array (
-                    'action' =>  $oModule -> sPathToModule . 'administration',
-                    'method' => 'post',
-                    'name' => 'form',
-                ),
-
-                'params' => array (
-                    'db' => array(
-                        'submit_name' => 'do_submit', // some filed name with non empty value to determine if the for was submitted,
-                    ),
-                ),
-
-                'inputs' => array(
-                    'modules' => array (
-                        'type'     => 'select',
-                        'name'     => 'module',
-                        'caption'  => _t('_bx_data_migration_select'),
-                        'required' => true,
-                        'attrs'    => array(
-                            'id' => 'modules',
-                        ),
-                    ),
-               ),
-            );
-
-           // add submit button;
-           $aForm['inputs'][] = array (
-                'type'  => 'button',
-                'value' => _t('_bx_data_migration_move'),
-                'attrs'    => array(
-                    'onclick' => 'oDataMigration.moveData( $(\'#modules\').val() )',
-                ),
-           );
-
-            $aForm['inputs'][] = array (
-                     'type' => 'custom',
-                    'content' => '<div id="callback">&nbsp;</div>',
-                    'colspan' => true,
-            );
-
-           $aForm['inputs']['modules']['values'] = $aModules;
-
-           // list of status text processed modules;
-           if( $aStatusTexts && is_array($aStatusTexts) ) {
-               foreach($aStatusTexts as $sModule => $sStatusText)
-               {
-                   $aForm['inputs'][] = array (
-                             'type' => 'custom',
-                            'content' => $sStatusText,
-                            'caption' => $sModule,
-                    );
-               }
-           }
-
-           $oForm = & new BxTemplFormView($aForm);
-           $sOutputCode .= $oForm -> getCode();
-
-           return $this -> addCss('data_migration.css', true) . $sOutputCode;
-        }
-    }

+ 0 - 380
modules/boonex/data_migration/classes/BxDataMigrationVideos.php

@@ -1,380 +0,0 @@
-<?php
-
-require_once('BxDataMigrationData.php');
-
-global $sModulesPath;
-require_once($sModulesPath . 'video/inc/functions.inc.php');
-
-class BxDataMigrationVideos extends BxDataMigrationData {
-    var $sType;
-    var $sOldFilesPath;
-    var $aOldTables;
-    var $aOldFileTypes;
-
-    var $sNewAlbumName;
-    var $sNewFilesPath;
-    var $aNewSizes;
-    var $iTransffered = 0;
-
-    /**
-     * Class constructor;
-     *
-     * @param  : $oMigrationModule (object) - object instance of migration class;
-     * @param  : $rOldDb (resourse) - connect to old dolphin's database;
-     * @param  : $oDolModule (object);
-     * @return : void;
-     */
-    function BxDataMigrationVideos (&$oMigrationModule, &$rOldDb, $oDolModule = '') {
-        parent::BxDataMigrationData($oMigrationModule, $rOldDb, $oDolModule);
-        $this->sType = 'bx_videos';
-        $this->sOldFilesPath = 'ray/modules/movie/files/';
-        $this->aOldFileTypes = array(
-            '.jpg', '.flv', '.mpg'
-        );
-
-        $this->aOldTables = array(
-            'main' => 'RayMovieFiles',
-            'favorite' => 'shareVideoFavorites',
-            'rate' => 'gvideo_rating',
-            'rate_track' => 'gvideo_voting_track',
-            'cmts' => 'CmtsSharedVideo'
-        );
-
-        $this->sNewAlbumName = $oDolModule->_oConfig->getGlParam('profile_album_name');
-        $this->sNewFilesPath  = 'flash/modules/video/files/';
-        $this->aNewSizes = array(
-            'thumb'  => array('width' => $oDolModule->_oConfig->getGlParam('browse_width'), 'height' => $oDolModule->_oConfig->getGlParam('browse_height'), 'postfix' => '_small.jpg'),
-            'file'   => array('width' => $oDolModule->_oConfig->getGlParam('file_width'), 'height' => $oDolModule->_oConfig->getGlParam('file_height'), 'postfix' => '.mp4')
-        );
-    }
-
-    /**
-     * Function migrate shared_photos data;
-     *
-     * @return : (integer) operation result;
-     */
-    function getMigration () {
-        if (!$this->oDolModule) {
-             $this->setResultStatus('System error: object  instance is not received');
-             return MIGRATION_FAILED;
-        }
-
-        // set new status;
-        $this->setResultStatus('Videos transfer now');
-
-        mysql_query('SET NAMES utf8', $this->rOldDb);
-
-        $sqlQuery = "SELECT `ID`, `Title`, `Uri`, `Tags`, `Description`, `Time`, `Date`, `Owner`, if(`Approved`<>'true', 'disapproved', 'approved') as `Status` FROM `{$this->aOldTables['main']}` ORDER BY `ID` ASC";
-        $rResult = mysql_query($sqlQuery, $this->rOldDb);
-        if ($rResult) {
-            while ($aRow = mysql_fetch_assoc($rResult)) {
-                if (!$this->isEntryExisting($aRow['Uri'])) {
-
-                    //transform the file
-                    if ( !$this->_exportFile(array('medID'=>$aRow['ID'])) ) {
-                        continue;
-                    }
-
-                    // escape all data;
-                    foreach($aRow as $sKey => $mValue) {
-                        $aRow[$sKey] = $this->oMigrationModule->_oDb->escape($mValue);
-                        $sqlBody .= "`$sKey` = '{$aRow[$sKey]}', ";
-                    }
-
-                    $sqlBody = trim($sqlBody, ', ');
-
-                    $sqlQuery =
-                    "
-                        INSERT INTO
-                            `RayVideoFiles`
-                        SET
-                          $sqlBody
-                    ";
-
-                    $sqlBody = '';
-
-                    $iResult = (int)$this->oMigrationModule->_oDb->query($sqlQuery);
-                    if ($iResult <= 0) {
-                        $this->setResultStatus('Database error. Cannot insert new photo to the database.');
-                        return MIGRATION_FAILED;
-                    }
-
-                    $oTag = new BxDolTags();
-                    $oTag->reparseObjTags($this->sType, $aRow['ID']);
-
-                    // define album
-                    $sError = $this->_defineAlbum($aRow['ID'], $aRow['Owner'], $aRow['Title']);
-                    if ($sError) {
-                        $this->setResultStatus($sError);
-                        return MIGRATION_FAILED;
-                    }
-
-                    $sError = $this->_exportFavorites($aRow['ID']);
-                    if ($sError) {
-                        $this->setResultStatus($sError);
-                        return MIGRATION_FAILED;
-                    }
-
-                    $sError = $this->_exportVotings($aRow['ID']);
-                    if ($sError) {
-                        $this->setResultStatus($sError);
-                        return MIGRATION_FAILED;
-                    }
-
-                    $sError = $this->_exportComments($aRow['ID']);
-                    if ($sError) {
-                        $this->setResultStatus($sError);
-                        return MIGRATION_FAILED;
-                    }
-
-                    $this -> iTransffered++;
-                }
-                else {
-                    $this->setResultStatus('Duplicate data. Feedback with similar info already exists (remove all news and start again)');
-                    return MIGRATION_FAILED;
-                }
-            }
-        }
-
-        // set as finished;
-        $this -> setResultStatus('All Videos were transferred (' .  $this -> iTransffered . ' items)');
-
-        return MIGRATION_SUCCESSFUL;
-    }
-
-    /**
-     * Function will check existing entry in module;
-     *
-     * @param  : $sEntryUri (string) - entry's uri;
-     * @return : true if exist;
-     */
-    function isEntryExisting($sEntryUri) {
-        $sEntryUri = $this -> oMigrationModule -> _oDb  -> escape($sEntryUri);
-        $sqlQuery  = "SELECT COUNT(*) FROM `RayVideoFiles` WHERE `Uri` = '$sEntryUri'";
-        return $this->oMigrationModule->_oDb->getOne($sqlQuery) ? true : false;
-    }
-
-    /**
-     * Function creates album and add new object there;
-     *
-     * @param  : $iFileId (int) - file id;
-     * @param  : $iOwnerId (int) - file's owner id;
-     * @param  : $sFileName (string) - file name;
-     * @return : nothing;
-     */
-    function _defineAlbum($iFileId, $iOwnerId, $sFileName) {
-       $sNickName = getNickName($iOwnerId);
-       $sAlbum    = str_replace('{nickname}', $sNickName, $this->sNewAlbumName);
-
-       $iFileId = (int) $iFileId;
-       $iOwnerId = (int) $iOwnerId;
-
-       $oAlbums   = &new BxDolAlbums($this->sType, $iOwnerId);
-       $aData     = array(
-           'caption'         => $this->oMigrationModule->_oDb->escape($sAlbum),
-           'owner'             => $iOwnerId,
-              'description'     => $this->oMigrationModule->_oDb->escape($sAlbum),
-           'location'         => _t('_Undefined'),
-           'AllowAlbumView'  => BX_DOL_PG_ALL,
-       );
-
-       $iAlbumId = (int) $oAlbums->addAlbum($aData);
-
-       // check objects;
-       $sqlQuery = "SELECT COUNT(*) FROM `sys_albums_objects` WHERE `id_album` = {$iAlbumId} AND `id_object` = {$iFileId}";
-       if (!$this->oMigrationModule->_oDb->getOne($sqlQuery)) {
-           $oAlbums->addObject($iAlbumId, $iFileId, true);
-       }
-    }
-
-    /**
-     * Function export photo file;
-     *
-     * @param  : $aFile (array) - array with medID and medExt elements;
-     * @return : (boolean) ;
-     */
-    function _exportFile ($aFile = array())
-    {
-        $bOperationResult = true;
-
-        $sSourcePath = $this->oMigrationModule->_oDb->getExtraParam('config_root') . $this->sOldFilesPath;
-        $sNewDirectory = BX_DIRECTORY_PATH_ROOT . $this->sNewFilesPath;
-        foreach ($this->aOldFileTypes as $sValue) {
-            $sFile = $aFile['medID'] . $sValue;
-            $sSourceFilePath = $sSourcePath . $sFile;
-            if (file_exists($sSourceFilePath) && is_dir($sNewDirectory)) {
-                if (!@copy($sSourceFilePath, $sNewDirectory . $sFile)) {
-                    return false;
-                }
-                switch ($sValue) {
-                    case '.jpg':
-                        imageResize($sSourceFilePath, $sNewDirectory . $aFile['medID'] . $this->aNewSizes['thumb']['postfix'], $this->aNewSizes['thumb']['width'], $this->aNewSizes['thumb']['height'], true);
-                        break;
-                    case '.flv':
-                        $this->generateNewFile($sSourceFilePath, $sNewDirectory . $aFile['medID'] . $this->aNewSizes['file']['postfix']);
-                        break;
-                }
-            }
-            else
-                return false;
-        }
-
-        return $bOperationResult;
-    }
-
-    function generateNewFile ($sSource, $sNew) {
-        global $sFfmpegPath;
-        $sMobileCommand = getConverterTmpl($sSource, "qcif") . "-b 512000 -sameq -ab 64000 -acodec libfaac -ac 1 " . $sNew;
-        popen($sMobileCommand, 'r');
-    }
-
-    /**
-     * Function export all comments;
-     *
-     * @param     : $iFileId (integer) - file id;
-     * @return : (string) - error message or empty;
-     */
-    function _exportComments ($iFileId) {
-        $iFileId = (int)$iFileId;
-        $sqlQuery = "SELECT * FROM `{$this->aOldTables['cmts']}` WHERE `cmt_object_id` = {$iFileId}";
-        $rResult = mysql_query($sqlQuery, $this->rOldDb);
-        if ($rResult) {
-            while ($aRow = mysql_fetch_assoc($rResult)) {
-                $sText = $this->oMigrationModule->_oDb->escape($aRow['cmt_text']);
-                $sqlQuery =
-                "
-                    INSERT INTO
-                        `{$this->sType}_cmts`
-                    SET
-                        `cmt_id`          = {$aRow['cmt_id']},
-                        `cmt_parent_id`  = {$aRow['cmt_parent_id']},
-                        `cmt_object_id`  = {$aRow['cmt_object_id']},
-                        `cmt_author_id`  = {$aRow['cmt_author_id']},
-                        `cmt_text`         = '{$sText}',
-                        `cmt_rate`         = {$aRow['cmt_rate']},
-                        `cmt_rate_count` = {$aRow['cmt_rate_count']},
-                        `cmt_time`         = '{$aRow['cmt_time']}',
-                        `cmt_replies`     = {$aRow['cmt_replies']}
-                ";
-
-                $iResult = (int)$this->oMigrationModule->_oDb->query($sqlQuery);
-                if ($iResult <= 0) {
-                    return 'Database error. Cannot insert comments information in the database.';
-                }
-            }
-        }
-    }
-
-    /**
-     * Function export all votings;
-     *
-     * @param     : $iFileId (integer);
-     * @return : (string) - error message or empty;
-     */
-    function _exportVotings ($iFileId) {
-        $iFileId = (int)$iFileId;
-        $sqlQuery = "SELECT * FROM `{$this->aOldTables['rate']}` WHERE `gal_id` = {$iFileId}";
-        $rResult = mysql_query($sqlQuery, $this->rOldDb);
-        if ($rResult) {
-            while ($aRow = mysql_fetch_assoc($rResult)) {
-               $sqlQuery =
-               "
-                   INSERT INTO
-                       `{$this->sType}_rating`
-                SET
-                    `gal_id` = {$aRow['gal_id']},
-                    `gal_rating_count` = {$aRow['gal_rating_count']},
-                    `gal_rating_sum`   = {$aRow['gal_rating_sum']}
-               ";
-
-                $iResult = (int)$this->oMigrationModule->_oDb->query($sqlQuery);
-                if ($iResult <= 0) {
-                    return 'Database error. Cannot insert votes information in the database.';
-                }
-
-                //export voting tracks;
-                $sError = $this->_exportVotingTrack($aRow['gal_id']);
-
-                if ($sError) {
-                    return $sError;
-                }
-
-                $fRate = $aRow['gal_rating_sum'] / $aRow['gal_rating_count'];
-                //update primary table;
-                $sqlQuery =
-                "
-                    UPDATE
-                        `RayVideoFiles`
-                    SET
-                        `Rate` = $fRate,
-                        `RateCount` = {$aRow['gal_rating_count']}
-                    WHERE
-                        `ID` = {$iFileId}
-                ";
-
-                $iResult = (int)$this->oMigrationModule->_oDb->query($sqlQuery);
-                if ($iResult <= 0) {
-                    return 'Database error. Cannot update votes information in the database.';
-                }
-            }
-        }
-    }
-
-    /**
-     * Function export all votings track;
-     *
-     * @param     : $iGalId (integer);
-     * @return : (string) - error message or empty;
-     */
-    function _exportVotingTrack ($iGalId) {
-        $iGalId = (int) $iGalId;
-        $sqlQuery = "SELECT * FROM `{$this->aOldTables['rate_track']}` WHERE `gal_id` = {$iGalId}";
-        $rResult = mysql_query($sqlQuery, $this->rOldDb);
-        if ($rResult) {
-            while ($aRow = mysql_fetch_assoc($rResult)) {
-              $sqlQuery =
-                "
-                    INSERT INTO
-                        `{$this->sType}_voting_track`
-                    SET
-                        `gal_id`   = {$aRow['gal_id']},
-                        `gal_ip`   = '{$aRow['gal_ip']}',
-                        `gal_date` = '{$aRow['gal_date']}'
-                    ";
-                $iResult = (int)$this->oMigrationModule->_oDb->query($sqlQuery);
-                if ($iResult <= 0) {
-                    return 'Database error. Cannot insert votes track information to the database.';
-                }
-            }
-        }
-    }
-
-    /**
-     * Function export all favorites records;
-     *
-     * @param  : $iFileId (integer);
-     * @return : (string) - error message or empty;
-     */
-    function _exportFavorites ($iFileId) {
-        $iFileId = (int)$iFileId;
-        $sqlQuery = "SELECT `medID`, `userID`, UNIX_TIMESTAMP(`favDate`) as `favDate` FROM `{$this->aOldTables['favorite']}` WHERE `medID` = {$iFileId}";
-        $rResult = mysql_query($sqlQuery, $this->rOldDb);
-        while ($aRow = mysql_fetch_assoc($rResult)) {
-          $sqlQuery =
-            "
-                INSERT INTO
-                    `{$this->sType}_favorites`
-                SET
-                    `ID`   = {$aRow['medID']},
-                    `Profile`   = '{$aRow['userID']}',
-                    `Date` = '{$aRow['gal_date']}'
-                ";
-            $iResult = (int)$this->oMigrationModule->_oDb->query($sqlQuery);
-            if ($iResult <= 0) {
-                return 'Database error. Cannot insert favorites information to the database.';
-            }
-        }
-    }
-}
-
-?>

+ 0 - 44
modules/boonex/data_migration/index.php

@@ -1,44 +0,0 @@
-<?php
-
-    /***************************************************************************
-    *                            Dolphin Smart Community Builder
-    *                              -----------------
-    *     begin                : Mon Mar 23 2006
-    *     copyright            : (C) 2006 BoonEx Group
-    *     website              : http://www.boonex.com/
-    * This file is part of Dolphin - Smart Community Builder
-    *
-    * Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License.
-    * http://creativecommons.org/licenses/by/3.0/
-    *
-    * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-    * without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-    * See the Creative Commons Attribution 3.0 License for more details.
-    * You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin,
-    * see license.txt file; if not, write to marketing@boonex.com
-    ***************************************************************************/
-
-    require_once( BX_DIRECTORY_PATH_MODULES . $aModule['path'] . '/classes/' . $aModule['class_prefix'] . 'Module.php');
-
-    $oModule = new BxDataMigrationModule($aModule);
-
-    // ** init some needed variables ;
-
-    global $_page;
-    global $_page_cont;
-
-    $iIndex = 54;
-
-    $_page['name_index']    = $iIndex;
-
-    $sPageCaption = _t('_bx_data_migration');
-
-    $GLOBALS['oTopMenu'] -> setCustomSubHeader($sPageCaption);
-
-    $_page['header']        = $sPageCaption ;
-    $_page['header_text']   = $sPageCaption ;
-    $_page['css_name']      = 'data_migration.css';
-
-    $_page_cont[$iIndex]['page_main_code'] = $oModule -> getPage();
-
-    PageCode($oModule -> _oTemplate);

+ 0 - 124
modules/boonex/data_migration/install/config.php

@@ -1,124 +0,0 @@
-<?php
-
-    /***************************************************************************
-    *                            Dolphin Smart Community Builder
-    *                              -------------------
-    *     begin                : Mon Mar 23 2006
-    *     copyright            : (C) 2007 BoonEx Group
-    *     website              : http://www.boonex.com
-    * This file is part of Dolphin - Smart Community Builder
-    *
-    * Dolphin is free software; you can redistribute it and/or modify it under
-    * the terms of the GNU General Public License as published by the
-    * Free Software Foundation; either version 2 of the
-    * License, or  any later version.
-    *
-    * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-    * without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-    * See the GNU General Public License for more details.
-    * You should have received a copy of the GNU General Public License along with Dolphin,
-    * see license.txt file; if not, write to marketing@boonex.com
-    ***************************************************************************/
-
-    $aConfig = array(
-        /**
-         * Main Section.
-         */
-        'type' => BX_DOL_MODULE_TYPE_MODULE,
-		'name' => 'bx_data_migration',
-        'title' => 'Data migration from Dolphin 6.1.6',
-        'version' => '1.0.6',
-        'vendor' => 'Boonex',
-        'update_url' => '',
-
-        'compatible_with' => array(
-            '7.0.6'
-        ),
-
-        /**
-         * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
-         */
-        'home_dir' => 'boonex/data_migration/',
-        'home_uri' => 'data_migration',
-
-        'db_prefix' => 'bx_data_migration_',
-        'class_prefix' => 'BxDataMigration',
-        /**
-         * Installation/Uninstallation Section.
-         */
-        'install' => array(
-            'check_dependencies' => 0,
-            'show_introduction' => 1,
-            'change_permissions' => 0,
-            'execute_sql' => 1,
-            'update_languages' => 1,
-            'recompile_main_menu' => 0,
-            'recompile_member_menu' => 0,
-            'recompile_site_stats' => 0,
-            'recompile_page_builder' => 0,
-            'recompile_profile_fields' => 0,
-            'recompile_comments' => 0,
-            'recompile_member_actions' => 0,
-            'recompile_tags' => 0,
-            'recompile_votes' => 0,
-            'recompile_categories' => 0,
-            'recompile_search' => 0,
-            'recompile_browse' => 0,
-            'recompile_injections' => 0,
-            'recompile_permalinks' => 1,
-            'recompile_alerts' => 0,
-            'recompile_global_paramaters' => 1,
-            'clear_db_cache'  => 1,
-            'show_conclusion' => 1,
-        ),
-        'uninstall' => array (
-            'check_dependencies' => 0,
-            'show_introduction' => 0,
-            'change_permissions' => 0,
-            'execute_sql' => 1,
-            'update_languages' => 1,
-            'recompile_main_menu' => 0,
-            'recompile_member_menu' => 0,
-            'recompile_site_stats' => 0,
-            'recompile_page_builder' => 0,
-            'recompile_profile_fields' => 0,
-            'recompile_comments' => 0,
-            'recompile_member_actions' => 0,
-            'recompile_tags' => 0,
-            'recompile_votes' => 0,
-            'recompile_categories' => 0,
-            'recompile_search' => 0,
-            'recompile_browse' => 0,
-            'recompile_injections' => 0,
-            'recompile_permalinks' => 1,
-            'recompile_alerts' => 0,
-            'recompile_global_paramaters' => 1,
-            'clear_db_cache'  => 1,
-            'show_conclusion' => 1,
-        ),
-        /**
-         * Dependencies Section
-         */
-        'dependencies' => array(
-        ),
-        /**
-         * Category for language keys.
-         */
-        'language_category' => 'Data migration',
-        /**
-         * Permissions Section
-         */
-        'install_permissions' => array(),
-        'uninstall_permissions' => array(),
-        /**
-         * Introduction and Conclusion Section.
-         */
-        'install_info' => array(
-            'introduction' => 'inst_intro.html',
-            'conclusion' => 'inst_concl.html'
-        ),
-        'uninstall_info' => array(
-            'introduction' => '',
-            'conclusion' => 'uninst_concl.html'
-        )
-    );

+ 0 - 1
modules/boonex/data_migration/install/info/inst_concl.html

@@ -1 +0,0 @@
-Module was successfully installed.

+ 0 - 1
modules/boonex/data_migration/install/info/inst_intro.html

@@ -1 +0,0 @@
-Follow the instructions carefully!!!

+ 0 - 1
modules/boonex/data_migration/install/info/uninst_concl.html

@@ -1 +0,0 @@
-Module was successfully deleted.

+ 0 - 0
modules/boonex/data_migration/install/info/uninst_intro.html


+ 0 - 31
modules/boonex/data_migration/install/installer.php

@@ -1,31 +0,0 @@
-<?php
-
-    /***************************************************************************
-    *                            Dolphin Smart Community Builder
-    *                              -------------------
-    *     begin                : Mon Mar 23 2006
-    *     copyright            : (C) 2007 BoonEx Group
-    *     website              : http://www.boonex.com
-    * This file is part of Dolphin - Smart Community Builder
-    *
-    * Dolphin is free software; you can redistribute it and/or modify it under
-    * the terms of the GNU General Public License as published by the
-    * Free Software Foundation; either version 2 of the
-    * License, or  any later version.
-    *
-    * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-    * without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-    * See the GNU General Public License for more details.
-    * You should have received a copy of the GNU General Public License along with Dolphin,
-    * see license.txt file; if not, write to marketing@boonex.com
-    ***************************************************************************/
-
-    require_once(BX_DIRECTORY_PATH_CLASSES . 'BxDolInstaller.php');
-
-    class BxDataMigrationInstaller extends BxDolInstaller
-    {
-        function BxDataMigrationInstaller(&$aConfig)
-        {
-            parent::BxDolInstaller($aConfig);
-        }
-    }

+ 0 - 48
modules/boonex/data_migration/install/langs/en.php

@@ -1,48 +0,0 @@
-<?php
-
-    /***************************************************************************
-    *                            Dolphin Smart Community Builder
-    *                              -------------------
-    *     begin                : Mon Mar 23 2006
-    *     copyright            : (C) 2007 BoonEx Group
-    *     website              : http://www.boonex.com
-    * This file is part of Dolphin - Smart Community Builder
-    *
-    * Dolphin is free software; you can redistribute it and/or modify it under
-    * the terms of the GNU General Public License as published by the
-    * Free Software Foundation; either version 2 of the
-    * License, or  any later version.
-    *
-    * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-    * without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-    * See the GNU General Public License for more details.
-    * You should have received a copy of the GNU General Public License along with Dolphin,
-    * see license.txt file; if not, write to marketing@boonex.com
-    ***************************************************************************/
-
-    $aLangContent = array
-    (
-        '_bx_data_migration_error_transferred' => 'error transferring',
-        '_bx_data_migration_transferred'       => 'transferred',
-        '_bx_data_migration_in_process'           => 'in process',
-        '_bx_data_migration_start_transfer'    => 'Transfer process has been started in the background, you can refresh this page manually to see upgrade status. Also, you will receive an email after transfer is completed',
-        '_bx_data_migration_install_started'   => 'Module {0} has been started in background, please wait',
-        '_bx_data_migration_install_before'    => 'Please install the {0} before',
-        '_bx_data_migration_data_transferred'  => 'Data was transferred',
-        '_bx_data_migration_module_not_defined'=> 'Module was not defined',
-        '_bx_data_migration_move'               => 'Move data',
-        '_bx_data_migration_already_transfer'  => 'Module {0} already transferred',
-        '_bx_data_migration_not_started'       => 'Queued',
-        '_bx_data_migration_select'               => 'Select the data',
-        '_bx_data_migration_choose_data'       => 'Choose data',
-        '_bx_data_migration_set_config'           => 'Set configuration',
-        '_bx_data_migration'                   => 'Data migration',
-        '_bx_data_migration_module'            => 'Data migration module',
-         '_bx_data_migration_configure'           => 'Configure some settings',
-        '_bx_data_migration_q_where_located'   => 'Where old dolphin is located?',
-        '_bx_data_migration_q_d_where_located' => 'Please enter the absolute path like this ({0})',
-        '_bx_data_migration_q_e_enter_data'    => 'Please enter data',
-        '_bx_data_migration_q_e_wrong_path'       => 'Sorry but directory or header.inc.php file was not found',
-        '_bx_data_migration_was_defined'       => 'Configuration was defined',
-        '_bx_data_migration_was_not_defined'   => 'Configuration was not defined (perhaps header.inc.php is wrong)',
-    );

+ 0 - 64
modules/boonex/data_migration/install/sql/install.sql

@@ -1,64 +0,0 @@
-
-	--
-	-- Table structure for table `bx_data_migration_transfers`
-	--
-	
-	CREATE TABLE `[db_prefix]transfers` (
-	  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
-	  `module` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
-	  `status` enum('not_started','started','finished','error') COLLATE utf8_unicode_ci NOT NULL,
-	  `status_text` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
-	  PRIMARY KEY (`id`)
-	) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-
-	--
-	-- Table structure for table `bx_data_migration_config`
-	--
-	
-	CREATE TABLE `[db_prefix]config` (
-	  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
-	  `name` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
-	  `value` varchar(150) COLLATE utf8_unicode_ci NOT NULL,
-	  PRIMARY KEY (`id`)
-	) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-
-    --
-    -- Admin menu ;
-    --
-
-    INSERT INTO 
-        `sys_menu_admin` 
-    SET
-        `name`          = 'Data migration',
-        `title`         = '_bx_data_migration', 
-        `url`           = '{siteUrl}modules/?r=data_migration/administration/',
-        `description`   = 'Migration all data from previous Dolphin version',
-        `icon`          = 'modules/boonex/data_migration/|data_migration.gif',
-        `parent_id`     = 2;
-
-    --
-    -- Settings
-    --
-
-    INSERT INTO 
-        `sys_options` 
-    (`Name`, `VALUE`, `kateg`, `desc`, `Type`, `check`, `err_text`, `order_in_kateg`, `AvailableValues`) 
-        VALUES
-    ('bx_data_migration_permalinks', 'on', 26, 'Enable friendly permalinks in data migration module', 'checkbox', '', '', '0', '');
-
-    INSERT INTO
-        `sys_permalinks`
-    SET
-        `standard`  = 'modules/?r=data_migration/',
-        `permalink` = 'm/data_migration/',
-        `check`     = 'bx_data_migration_permalinks';
- 
-  	--
-    -- Dumping data for table `sys_cron_jobs`
-    --
-
-    INSERT INTO 
-        `sys_cron_jobs` 
-    (`name`, `time`, `class`, `file`)
-        VALUES
-    ('bx_data_migration', '*/5 * * * *', 'BxDataMigrationCron', 'modules/boonex/data_migration/classes/BxDataMigrationCron.php');

+ 0 - 29
modules/boonex/data_migration/install/sql/uninstall.sql

@@ -1,29 +0,0 @@
-
-	DROP TABLE IF EXISTS `[db_prefix]config`;
-	DROP TABLE IF EXISTS `[db_prefix]transfers`;
-
-    --
-    -- Admin menu ;
-    --
-
-    DELETE FROM
-        `sys_menu_admin` 
-    WHERE
-        `url` = '{siteUrl}modules/?r=data_migration/administration/';
-
-   DELETE FROM
-        `sys_options` 
-   WHERE
-   		`Name` = 'bx_data_migration_permalinks';
- 
-   DELETE FROM
-        `sys_permalinks`
-   WHERE
-        `standard`  = 'modules/?r=data_migration/'
-        	AND
-        `permalink` = 'm/data_migration/';
-
-	DELETE FROM
-	    `sys_cron_jobs` 
-	WHERE
-		`name` = 'bx_data_migration' LIMIT 1;

+ 0 - 27
modules/boonex/data_migration/js/data_migration.js

@@ -1,27 +0,0 @@
-
-    function BxDataMigration()
-    {
-        var sPathToModule;
-        var sLoadingImg;
-
-        /**
-         *  Function will get ajax query;
-         *
-         * @return : (text) - html presentation data;
-         */
-        this.moveData = function(sModule)
-        {
-            var oWrapper = $('#callback');
-
-            oWrapper.html('<img id="loading_img" src="' + this.sLoadingImg + '" />');
-
-            //loading.gif
-            var _sRandom = Math.random();
-            $.get(this.sPathToModule + sModule + '&_random=' + _sRandom , function(sData){
-                oWrapper.find('#loading_img').remove();
-                oWrapper.html(sData);
-            });
-        }
-    }
-
-    var oDataMigration = new BxDataMigration();

+ 0 - 32
modules/boonex/data_migration/request.php

@@ -1,32 +0,0 @@
-<?php
-
-    /***************************************************************************
-    *                            Dolphin Smart Community Builder
-    *                              -------------------
-    *     begin                : Mon Mar 23 2006
-    *     copyright            : (C) 2007 BoonEx Group
-    *     website              : http://www.boonex.com
-    * This file is part of Dolphin - Smart Community Builder
-    *
-    * Dolphin is free software; you can redistribute it and/or modify it under
-    * the terms of the GNU General Public License as published by the
-    * Free Software Foundation; either version 2 of the
-    * License, or  any later version.
-    *
-    * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-    * without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-    * See the GNU General Public License for more details.
-    * You should have received a copy of the GNU General Public License along with Dolphin,
-    * see license.txt file; if not, write to marketing@boonex.com
-    ***************************************************************************/
-
-    require_once( BX_DIRECTORY_PATH_CLASSES . 'BxDolRequest.php' );
-
-    check_logged();
-
-    if ( empty($aRequest) || empty($aRequest[0]) ) {
-        BxDolRequest::processAsFile($aModule, $aRequest);
-    }
-    else {
-        BxDolRequest::processAsAction($aModule, $aRequest);
-    }

+ 0 - 9
modules/boonex/data_migration/templates/base/css/data_migration.css

@@ -1,9 +0,0 @@
-
-    .form_advanced_table .colspan .input_wrapper {
-        width:100%;
-        float:none;
-    }
-
-    #callback {
-        margin:0 auto;
-    }

TEMPAT SAMPAH
modules/boonex/data_migration/templates/base/images/icons/data_migration.gif


TEMPAT SAMPAH
modules/boonex/data_migration/templates/base/images/icons/loading.gif


+ 0 - 52
modules/boonex/facebook_connect/classes/BxFaceBookConnectAlerts.php

@@ -1,52 +0,0 @@
-<?php
-
-    class BxFaceBookConnectAlerts extends BxDolAlertsResponse
-    {
-        var $oModule;
-
-        /**
-         * Class constructor;
-         */
-        function BxFaceBookConnectAlerts() {
-            $this -> oModule = BxDolModule::getInstance('bx_facebook_connect');
-        }
-
-        function response(&$o)
-        {
-            if ( $o -> sUnit == 'profile' ) {
-                switch ( $o -> sAction ) {
-                    case 'logout' :
-                        //delete facebook's session cookie
-                        $sCookieName = $this -> oModule -> oFacebook -> getSessionCookieName();
-                        setcookie($sCookieName, '', time() - 96 * 3600, '/' );
-                        unset($_COOKIE[$sCookieName]);
-                        break;
-
-                    case 'join' :
-                            bx_import('BxDolSession');
-                            $oSession = BxDolSession::getInstance();
-
-                            $iFacebookProfileUid = $oSession
-                                -> getValue($this -> oModule -> _oConfig -> sFacebookSessionUid);
-
-                            if($iFacebookProfileUid) {
-                                $oSession -> unsetValue($this -> oModule -> _oConfig -> sFacebookSessionUid);
-
-                                //save Fb's uid
-                                $this -> oModule -> _oDb -> saveFbUid($o -> iObject, $iFacebookProfileUid);
-
-                                //Auto-friend members if they are already friends on Facebook
-                                $this -> oModule -> _makeFriends($o -> iObject);
-                            }
-                        break;
-
-                    case 'delete' :
-                        //remove Fb account
-                        $this -> oModule -> _oDb -> deleteFbUid($o -> iObject);
-                        break;
-
-                    default :
-                }
-            }
-        }
-    }

+ 0 - 71
modules/boonex/facebook_connect/classes/BxFaceBookConnectConfig.php

@@ -1,71 +0,0 @@
-<?php
-
-    /***************************************************************************
-    *                            Dolphin Smart Community Builder
-    *                              -------------------
-    *     begin                : Mon Mar 23 2006
-    *     copyright            : (C) 2007 BoonEx Group
-    *     website              : http://www.boonex.com
-    * This file is part of Dolphin - Smart Community Builder
-    *
-    * Dolphin is free software; you can redistribute it and/or modify it under
-    * the terms of the GNU General Public License as published by the
-    * Free Software Foundation; either version 2 of the
-    * License, or  any later version.
-    *
-    * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-    * without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-    * See the GNU General Public License for more details.
-    * You should have received a copy of the GNU General Public License along with Dolphin,
-    * see license.txt file; if not, write to marketing@boonex.com
-    ***************************************************************************/
-
-    //-- demo api and secret key --//
-    // api      : 112808408740127;
-    // secret   : 464f98fc9bcac09ca66fa5b8169c9657;
-
-    require_once(BX_DIRECTORY_PATH_CLASSES . 'BxDolConfig.php');
-
-    class BxFaceBookConnectConfig extends BxDolConfig
-    {
-        var $mApiID;
-        var $mApiSecret;
-
-        var $sPageReciver;
-        var $sSessionKey;
-        var $sDefaultRedirectUrl;
-
-        var $sFacebookSessionUid = 'facebook_session';
-        var $sFaceBookAlternativePostfix;
-        var $sRedirectPage;
-
-        var $bAutoFriends;
-        var $aFaceBookReqParams;
-
-        var $sDefaultCountryCode = 'US';
-
-        /**
-         * Class constructor;
-         */
-        function BxFaceBookConnectConfig($aModule)
-        {
-            parent::BxDolConfig($aModule);
-
-            $this -> mApiID          = getParam('bx_facebook_connect_api_key');
-            $this -> mApiSecret   = getParam('bx_facebook_connect_secret');
-            $this -> sPageReciver = BX_DOL_URL_ROOT . $this -> getBaseUri() . 'login';
-
-            $this -> sDefaultRedirectUrl = BX_DOL_URL_ROOT . 'member.php';
-            $this -> sFaceBookAlternativePostfix = '_fb';
-            $this -> sRedirectPage = getParam('bx_facebook_connect_redirect_page');
-
-            $this -> bAutoFriends = 'on' == getParam('bx_facebook_connect_auto_friends')
-                ? true
-                : false;
-
-            $this -> aFaceBookReqParams = array(
-                'req_perms' => 'email,user_hometown,user_birthday,user_interests
-                    ,user_likes,user_location',
-            );
-        }
-    }

+ 0 - 245
modules/boonex/facebook_connect/classes/BxFaceBookConnectDb.php

@@ -1,245 +0,0 @@
-<?php
-
-    /***************************************************************************
-    *                            Dolphin Smart Community Builder
-    *                              -------------------
-    *     begin                : Mon Mar 23 2006
-    *     copyright            : (C) 2007 BoonEx Group
-    *     website              : http://www.boonex.com
-    * This file is part of Dolphin - Smart Community Builder
-    *
-    * Dolphin is free software; you can redistribute it and/or modify it under
-    * the terms of the GNU General Public License as published by the
-    * Free Software Foundation; either version 2 of the
-    * License, or  any later version.
-    *
-    * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-    * without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-    * See the GNU General Public License for more details.
-    * You should have received a copy of the GNU General Public License along with Dolphin,
-    * see license.txt file; if not, write to marketing@boonex.com
-    ***************************************************************************/
-
-    require_once( BX_DIRECTORY_PATH_CLASSES . 'BxDolModuleDb.php' );
-
-    class BxFaceBookConnectDb extends BxDolModuleDb
-    {
-        var $_oConfig;
-        var $sTablePrefix;
-
-        /**
-         * Constructor.
-         */
-        function BxFaceBookConnectDb(&$oConfig)
-        {
-            parent::BxDolModuleDb();
-
-            $this -> _oConfig = $oConfig;
-            $this -> sTablePrefix = $oConfig -> getDbPrefix();
-        }
-
-        /**
-         * Process big number
-         *
-         * @param $mValue mixed
-         * @return integer
-         */
-        function _processBigNumber($mValue)
-        {
-            return preg_replace('/[^0-9]/', '', $mValue);
-        }
-
-        /**
-         * Check fb profile id
-         *
-         * @param $iFbUid integer
-         * @param $sOldFbUid string
-         * @return integer
-         */
-        function getProfileId($iFbUid, $sOldFbUid = '')
-        {
-            $iFbUidCopy = (int) $iFbUid;
-            $iFbUid = $this -> _processBigNumber($iFbUid);
-
-            $sOldFbUid = $sOldFbUid
-                ? process_db_input($sOldFbUid, BX_TAGS_STRIP, BX_SLASHES_AUTO)
-                : '';
-
-            //-- handle 64 bit number on 32bit system ( will need remove it in a feature version)--//
-            if($iFbUidCopy != $iFbUid) {
-                //update id
-                $sQuery = "UPDATE `{$this -> sTablePrefix}accounts` SET `fb_profile` = '{$iFbUid}'
-                    WHERE `fb_profile` = '{$iFbUidCopy}'";
-
-                $this -> query($sQuery);
-            }
-            //--
-
-            //-- new auth method --//
-            $sQuery = "SELECT `id_profile` FROM `{$this -> sTablePrefix}accounts` WHERE
-                `fb_profile` = '{$iFbUid}' LIMIT 1";
-
-            $iProfileId = $this -> getOne($sQuery);
-            //--
-
-            //-- old auth method (will need remove it in a feature version) --//
-            //try get profile's id used the old auth method :(
-            if(!$iProfileId && $sOldFbUid) {
-                $sQuery = "SELECT `ID` FROM `Profiles` WHERE `FacebookProfile` = '{$sOldFbUid}' LIMIT 1";
-                $iProfileId =  $this -> getOne($sQuery);
-
-                //update Fb uid
-                if($iProfileId) {
-                    $this -> saveFbUid($iProfileId, $iFbUid);
-                }
-            }
-            //--
-
-            return $iProfileId;
-        }
-
-        /**
-         *  Save new Fb uid
-         *
-         * @param $iProfileId integer
-         * @param $iFbUid integer
-         * @return void
-         */
-        function saveFbUid($iProfileId, $iFbUid)
-        {
-            $iFbUid = $this -> _processBigNumber($iFbUid);
-            $iProfileId = (int) $iProfileId;
-
-            $sQuery = "REPLACE INTO `{$this -> sTablePrefix}accounts`
-                        SET `id_profile` = {$iProfileId}, `fb_profile` = '{$iFbUid}'";
-
-            $this -> query($sQuery);
-        }
-
-        /**
-         * Delete Fb's uid
-         *
-         * @param $iProfileId integer
-         * @return void
-         */
-        function deleteFbUid($iProfileId)
-        {
-            $iProfileId = (int) $iProfileId;
-            $sQuery = "DELETE FROM `{$this -> sTablePrefix}accounts`
-                WHERE `id_profile` = {$iProfileId}";
-
-            $this -> query($sQuery);
-        }
-
-        /**
-         * Make as friends
-         *
-         * @param $iMemberId integer
-         * @param $iProfileId intger
-         * @return void
-         */
-        function makeFriend($iMemberId, $iProfileId)
-        {
-            $iMemberId = (int) $iMemberId;
-            $iProfileId = (int) $iProfileId;
-
-            $sQuery = "INSERT INTO `sys_friend_list` SET
-                `ID` = '{$iMemberId}', `Profile` = '{$iProfileId}', `Check` = 1";
-
-            $this -> query($sQuery);
-        }
-
-        /**
-         * Create new profile;
-         *
-         * @param  : (array) $aProfileFields    - `Profiles` table's fields;
-         * @return : (integer)  - profile's Id;
-         */
-        function createProfile(&$aProfileFields)
-        {
-            $sFields = null;
-
-            // procces all recived fields;
-            foreach($aProfileFields as $sKey => $mValue)
-            {
-                $mValue = process_db_input($mValue, BX_TAGS_VALIDATE, BX_SLASHES_AUTO);
-                $sKey = process_db_input($sKey, BX_TAGS_STRIP, BX_SLASHES_NO_ACTION);
-                $sFields .= "`{$sKey}` = '{$mValue}', ";
-            }
-
-            $sFields = preg_replace( '/,$/', '', trim($sFields) );
-
-            $sQuery = "INSERT INTO `Profiles` SET {$sFields}";
-            $this -> query($sQuery);
-
-            return db_last_id();
-        }
-
-        /**
-         * Function will update  profile's status;
-         *
-         * @param  : $iProfileId (integer) - profile's Id;
-         * @param  : $sStatus    (string)  - profile's status;
-         * @return : void;
-         */
-        function updateProfileStatus($iProfileId, $sStatus)
-        {
-            $iProfileId = (int)$iProfileId;
-            $sStatus    = process_db_input($sStatus);
-
-            $sQuery = "UPDATE `Profiles` SET `Status` = '{$sStatus}' WHERE `ID` = {$iProfileId}";
-            return $this -> query($sQuery);
-        }
-
-        /**
-         * Function will check field name in 'Profiles` table;
-         *
-         * @param $sFieldName string
-         * @return : (boolean);
-         */
-        function isFieldExist($sFieldName)
-        {
-            $sFieldName = process_db_input($sFieldName);
-            $sQuery = "SELECT `ID` FROM `sys_profile_fields` WHERE `Name` = '{$sFieldName}' LIMIT 1";
-            return $this -> getOne($sQuery) ? true : false;
-        }
-
-        /**
-         * Check existing email
-         *
-         * @param $sEmail string
-         * @return boolean
-         */
-        function isEmailExisting($sEmail)
-        {
-            $sEmail = process_db_input($sEmail, BX_TAGS_STRIP, BX_SLASHES_AUTO);
-
-            $sQuery = "SELECT COUNT(*) FROM `Profiles` WHERE `Email` = '{$sEmail}'";
-            return $this -> getOne($sQuery) ? true : false;
-        }
-
-        /**
-         * Get country's ISO code;
-         *
-         * @param : $sCountry (string) - country name;
-         * @return: (string); - country ISO code;
-         */
-        function getCountryCode($sCountry)
-        {
-            $sCountry = process_db_input($sCountry);
-            $sQuery = "SELECT `ISO2` FROM `sys_countries` WHERE `Country` = '{$sCountry}' LIMIT 1";
-            return $this -> getOne($sQuery);
-        }
-
-        /**
-         * Function will return category's id;
-         *
-         * @param  : $sCatName (string) - catregory's name;
-         * @return : (integer) - category's id;
-         */
-        function getSettingsCategoryId($sCatName)
-        {
-            $sCatName = process_db_input($sCatName);
-            return $this -> getOne('SELECT `kateg` FROM `sys_options` WHERE `Name` = "' . $sCatName . '"');
-        }
-    }

+ 0 - 590
modules/boonex/facebook_connect/classes/BxFaceBookConnectModule.php

@@ -1,590 +0,0 @@
-<?php
-
-    /***************************************************************************
-    *                            Dolphin Smart Community Builder
-    *                              -------------------
-    *     begin                : Mon Mar 23 2006
-    *     copyright            : (C) 2007 BoonEx Group
-    *     website              : http://www.boonex.com
-    * This file is part of Dolphin - Smart Community Builder
-    *
-    * Dolphin is free software; you can redistribute it and/or modify it under
-    * the terms of the GNU General Public License as published by the
-    * Free Software Foundation; either version 2 of the
-    * License, or  any later version.
-    *
-    * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-    * without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-    * See the GNU General Public License for more details.
-    * You should have received a copy of the GNU General Public License along with Dolphin,
-    * see license.txt file; if not, write to marketing@boonex.com
-    ***************************************************************************/
-
-    require_once( BX_DIRECTORY_PATH_INC . 'profiles.inc.php' );
-
-    bx_import('BxDolModuleDb');
-    bx_import('BxDolModule');
-    bx_import('BxDolInstallerUtils');
-    bx_import('BxDolProfilesController');
-    bx_import('BxDolAlerts');
-
-    class BxFaceBookConnectModule extends BxDolModule
-    {
-        // contain some module information ;
-        var $aModuleInfo;
-
-        // contain path for current module;
-        var $sPathToModule;
-        var $sHomeUrl;
-
-        var $oFacebook;
-
-        /**
-         * Class constructor ;
-         *
-         * @param   : $aModule (array) - contain some information about this module;
-         *                  [ id ]           - (integer) module's  id ;
-         *                  [ title ]        - (string)  module's  title ;
-         *                  [ vendor ]       - (string)  module's  vendor ;
-         *                  [ path ]         - (string)  path to this module ;
-         *                  [ uri ]          - (string)  this module's URI ;
-         *                  [ class_prefix ] - (string)  this module's php classes file prefix ;
-         *                  [ db_prefix ]    - (string)  this module's Db tables prefix ;
-         *                  [ date ]         - (string)  this module's date installation ;
-         */
-        function BxFaceBookConnectModule(&$aModule)
-        {
-            parent::BxDolModule($aModule);
-
-            require_once(BX_DIRECTORY_PATH_MODULES . $aModule['path'] . '/inc/facebook.php');
-
-            // prepare the location link ;
-            $this -> sPathToModule  = BX_DOL_URL_ROOT . $this -> _oConfig -> getBaseUri();
-
-            $this -> aModuleInfo    = $aModule;
-            $this -> sHomeUrl       = $this ->_oConfig -> _sHomeUrl;
-
-            // Create our Application instance.
-            $this -> oFacebook  = new Facebook(array(
-                  'appId'  => $this -> _oConfig -> mApiID,
-                  'secret' => $this -> _oConfig -> mApiSecret,
-                  'cookie' => true,
-            ));
-        }
-
-        /**
-         * Function will generate facebook's admin page;
-         *
-         * @return : (text) - html presentation data;
-         */
-        function actionAdministration()
-        {
-            $GLOBALS['iAdminPage'] = 1;
-
-            if( !isAdmin() ) {
-                header('location: ' . BX_DOL_URL_ROOT);
-            }
-
-            // get sys_option's category id;
-            $iCatId = $this-> _oDb -> getSettingsCategoryId('bx_facebook_connect_api_key');
-            if(!$iCatId) {
-                $sOptions = MsgBox( _t('_Empty') );
-            }
-            else {
-                bx_import('BxDolAdminSettings');
-
-                $oSettings = new BxDolAdminSettings($iCatId);
-
-                $mixedResult = '';
-                if(isset($_POST['save']) && isset($_POST['cat'])) {
-                    $mixedResult = $oSettings -> saveChanges($_POST);
-                }
-
-                // get option's form;
-                $sOptions = $oSettings -> getForm();
-                if($mixedResult !== true && !empty($mixedResult)) {
-                    $sOptions = $mixedResult . $sOptions;
-                }
-            }
-
-            $sCssStyles = $this -> _oTemplate -> addCss('forms_adv.css', true);
-
-            $this -> _oTemplate-> pageCodeAdminStart();
-
-                echo DesignBoxAdmin( _t('_bx_facebook_information')
-                        , $GLOBALS['oSysTemplate'] -> parseHtmlByName('default_padding.html', array('content' => _t('_bx_facebook_information_block', BX_DOL_URL_ROOT))) );
-                echo DesignBoxAdmin( _t('_Settings')
-                        , $GLOBALS['oSysTemplate'] -> parseHtmlByName('default_padding.html', array('content' => $sCssStyles . $sOptions) ));
-
-            $this -> _oTemplate->pageCodeAdmin( _t('_bx_facebook_settings') );
-        }
-
-        /**
-         * Generare facebook login form;
-         *
-         * @return (text) - html presentation data;
-         */
-        function actionLoginForm()
-        {
-            $sCode = '';
-
-            if( isLogged() ) {
-                header ('Location:' . $this -> _oConfig -> sDefaultRedirectUrl);
-                exit;
-            }
-
-            if(!$this -> _oConfig -> mApiID || !$this -> _oConfig -> mApiSecret) {
-                $sCode =  MsgBox( _t('_bx_facebook_profile_error_api_keys') );
-            }
-            else {
-                $sSession = $this -> oFacebook -> getSession();
-
-                //redirect to facebook login form
-                if(!$sSession) {
-                    //step one
-                    header('location: ' . $this -> oFacebook -> getLoginUrl($this
-                        -> _oConfig -> aFaceBookReqParams));
-                    exit;
-                }
-                else {
-                    //we already logged in facebook
-                    try {
-                        $aFacebookProfileInfo = $this -> oFacebook -> api('/me');
-                    } catch (FacebookApiException $e) {
-                        $sCode =  MsgBox($e);
-                    }
-
-                    //process profile info
-                    if($aFacebookProfileInfo) {
-                        //-- nedded for old auth method (will need remove it in a feature version) --//
-                        $sOldFacebookUid = md5($aFacebookProfileInfo['proxied_email']
-                            . $aFacebookProfileInfo['first_name']);
-                        //--
-
-                        // try define user id
-                        $iProfileId = $this -> _oDb
-                            -> getProfileId($aFacebookProfileInfo['id'], $sOldFacebookUid);
-
-                        if($iProfileId) {
-                               // get profile info
-                               $aDolphinProfileInfo = getProfileInfo($iProfileId);
-                               $this -> setLogged($iProfileId, $aDolphinProfileInfo['Password']);
-                        }
-                        else {
-                            $sAlternativeNickName = '';
-
-                            //process profile's nickname
-                            $aFacebookProfileInfo['nick_name'] = $this
-                                -> _proccesNickName($aFacebookProfileInfo['first_name']);
-
-                            //-- profile nickname already used by other person --//
-                            if( getID($aFacebookProfileInfo['nick_name']) ) {
-                                   $sAlternativeNickName = $this
-                                    -> getAlternativeName($aFacebookProfileInfo['nick_name']);
-                            }
-                            //--
-
-                            //try to get profile's image
-                            if( NULL != ($aFacebookProfileImage = $this
-                                    -> oFacebook -> api('/me?fields=picture&type=large')) ) {
-
-                                $aFacebookProfileInfo['picture'] = isset($aFacebookProfileImage['picture'])
-                                    ? $aFacebookProfileImage['picture']
-                                    : '';
-                            }
-
-                               //create new profile
-                               $this -> _createProfile($aFacebookProfileInfo, $sAlternativeNickName);
-                        }
-                    }
-                    else {
-                        // FB profile info is not defined;
-                        $sCode = MsgBox( _t('_bx_facebook_profile_error_info') );
-                    }
-                }
-            }
-
-            $this -> _oTemplate -> getPage( _t('_bx_facebook'), $sCode );
-        }
-
-        /**
-         * Logged profile
-         *
-         * @param $iProfileId integer
-         * @param $sPassword string
-         * @param $sCallbackUrl
-         * @param $bRedirect boolean
-         * @return void
-         */
-        function setLogged($iProfileId, $sPassword, $sCallbackUrl = '', $bRedirect = true)
-        {
-            bx_login($iProfileId);
-            $GLOBALS['logged']['member'] = true;
-
-            if($bRedirect) {
-                $sCallbackUrl = $sCallbackUrl
-                    ? $sCallbackUrl
-                    : $this -> _oConfig -> sDefaultRedirectUrl;
-
-                header('location: ' . $sCallbackUrl);
-            }
-        }
-
-        /**
-         * get profile's alternative nickname
-         *
-         * @param $sNickName string
-         * @return string
-         */
-        function getAlternativeName($sNickName)
-        {
-            $sRetNickName = '';
-            $iIndex = 0;
-
-            //-- get new allternative nickname --//
-            do
-            {
-                $sPostfix = $iIndex
-                    ? $this -> _oConfig -> sFaceBookAlternativePostfix . $iIndex
-                    : $this -> _oConfig -> sFaceBookAlternativePostfix;
-
-                if( !getID($sNickName . $sPostfix) ) {
-                    $sRetNickName = $sPostfix;
-                }
-
-                $iIndex++;
-
-            } while ($sRetNickName == '');
-
-            //--
-
-            return $sRetNickName;
-        }
-
-        /**
-         * Assign avatar to user
-         *
-         * @param $sAvatarUrl string
-         * @return void
-         */
-        function _assignAvatar($sAvatarUrl)
-        {
-            if( BxDolInstallerUtils::isModuleInstalled('avatar') ) {
-                BxDolService::call ('avatar', 'make_avatar_from_image_url', array($sAvatarUrl));
-            }
-        }
-
-        /**
-         * Make friends
-         *
-         * @param $iProfileId integer
-         * @return void
-         */
-        function _makeFriends($iProfileId)
-        {
-            if(!$this -> _oConfig -> bAutoFriends) {
-                return;
-            }
-
-            try {
-                //get friends from facebook
-                $aFacebookFriends = $this -> oFacebook -> api('/me/friends/');
-            } catch (FacebookApiException $e) {
-                return;
-            }
-
-            //process friends
-            if( !empty($aFacebookFriends) && is_array($aFacebookFriends) ) {
-                $aFacebookFriends = array_shift($aFacebookFriends);
-
-                foreach($aFacebookFriends as $iKey => $aFriend)
-                {
-                    $iFriendId = $this -> _oDb -> getProfileId($aFriend['id']);
-                    if($iFriendId && !is_friends($iProfileId, $iFriendId) ) {
-                        //add to friends list
-                        $this -> _oDb -> makeFriend($iProfileId, $iFriendId);
-
-                        //create system alert
-                        $oZ = new BxDolAlerts('friend', 'accept', $iProfileId, $iFriendId);
-                        $oZ -> alert();
-                    }
-                }
-            }
-        }
-
-        /**
-         * Create new profile;
-         *
-         * @param  : $aProfileInfo (array) - some profile's information;
-         *          @see : $this -> aFacebookProfileFields;
-         *
-         * @param  : $sAlternativeName (string) - profiles alternative nickname;
-         * @return : (integer) profile's id;
-         */
-        function _createProfile($aProfileInfo, $sAlternativeName = '')
-        {
-            $sCountry = '';
-            $sCity = '';
-
-            $bAvatarRedirect = false;
-            $sMemberAvatar   = !empty($aProfileInfo['picture'])
-                ? $aProfileInfo['picture']
-                : '';
-
-            //-- join by invite only --//
-            if( getParam('reg_by_inv_only') == 'on'
-                && (!isset($_COOKIE['idFriend']) ||  getID($_COOKIE['idFriend']) == 0) ){
-
-                $this -> _oTemplate -> getPage( _t('_bx_facebook')
-                       , MsgBox(_t('_registration by invitation only')));
-                exit;
-               }
-            //--
-
-            // process the date of birth;
-            if( isset($aProfileInfo['birthday']) ) {
-                $aProfileInfo['birthday'] = isset($aProfileInfo['birthday'])
-                    ?  date('Y-m-d', strtotime($aProfileInfo['birthday']) )
-                    :  '';
-            }
-
-            // generate new password for profile;
-            $sNewPassword = genRndPwd();
-            $sPasswordSalt =  genRndSalt();
-
-            $aProfileInfo['password'] = encryptUserPwd($sNewPassword,$sPasswordSalt);
-
-            //-- define user's country and city --//
-
-            $aLocation = array();
-
-            if( isset($aProfileInfo['location']['name']) ) {
-                $aLocation = $aProfileInfo['location']['name'];
-            }
-              else if( isset($aProfileInfo['hometown']['name']) ) {
-                  $aLocation = $aProfileInfo['hometown']['name'];
-              }
-
-              if($aLocation) {
-                  $aCountryInfo = explode(',', $aLocation);
-                  $sCountry = $this -> _oDb -> getCountryCode( trim($aCountryInfo[1]) );
-                  $sCity = trim($aCountryInfo[0]);
-
-                //set default country name, especially for American brothers
-                  if($sCity && !$sCountry) {
-                      $sCountry = $this -> _oConfig -> sDefaultCountryCode;
-                  }
-              }
-
-            //--
-
-              //try define the user's email
-              $sEmail = !empty($aProfileInfo['email'])
-                  ? $aProfileInfo['email']
-                  : $aProfileInfo['proxied_email'];
-
-            //check email
-            if( $this -> _oDb -> isEmailExisting($sEmail) ) {
-                $this -> _oTemplate -> getPage( _t('_bx_facebook'), MsgBox(_t('_bx_facebook_error_email')));
-                exit;
-            }
-
-            //-- fill array with all needed values --//
-            $aProfileFields = array(
-                'NickName'              => $aProfileInfo['nick_name'] . $sAlternativeName,
-                'Email'                 => $sEmail,
-                'Sex'                   => isset($aProfileInfo['gender']) ? $aProfileInfo['gender'] : '',
-                'DateOfBirth'           => $aProfileInfo['birthday'],
-
-                'Password'              => $aProfileInfo['password'],
-
-                'FirstName'                => isset($aProfileInfo['first_name']) ? $aProfileInfo['first_name'] : '',
-                'LastName'                => isset($aProfileInfo['last_name']) ? $aProfileInfo['last_name'] : '',
-
-                'DescriptionMe'         => isset($aProfileInfo['bio']) ? $aProfileInfo['bio'] : '',
-                'Interests'             => isset($aProfileInfo['interests']) ? $aProfileInfo['interests'] : '',
-
-                'Religion'              => isset($aProfileInfo['religion']) ? $aProfileInfo['religion'] : '',
-                'Country'               => $sCountry,
-                'City'                   => $sCity,
-            );
-            //--
-
-            // check fields existence;
-            foreach($aProfileFields as $sKey => $mValue) {
-                if( !$this -> _oDb -> isFieldExist($sKey) ) {
-                    // (field not existence) remove from array;
-                    unset($aProfileFields[$sKey]);
-                }
-            }
-
-            //-- add some system values --//
-            $aProfileFields['Role']       = BX_DOL_ROLE_MEMBER;
-            $aProfileFields['DateReg']       = date( 'Y-m-d H:i:s' ); // set current date;
-            $aProfileFields['Salt']       = $sPasswordSalt;
-            //--
-
-            //check redirect page
-            switch($this -> _oConfig -> sRedirectPage) {
-                case 'join' :
-                    return $this -> _getJoinPage($aProfileFields, $aProfileInfo['id']);
-
-                case 'pedit'  :
-                    $sRedirectUrl = BX_DOL_URL_ROOT . 'pedit.php';
-                    break;
-
-                case 'avatar' :
-                    $bAvatarRedirect = true;
-                    break;
-
-                case 'index'  :
-                    $sRedirectUrl = BX_DOL_URL_ROOT;
-                    break;
-
-                case 'member' :
-                default       :
-                    $sRedirectUrl = BX_DOL_URL_ROOT . 'member.php';
-                    break;
-            }
-
-            // create new profile;
-            $iProfileId = $this -> _oDb -> createProfile($aProfileFields);
-            $oProfileFields = new BxDolProfilesController();
-
-            //remember FB uid for created member
-            $this -> _oDb -> saveFbUid($iProfileId, $aProfileInfo['id']);
-
-            // check profile status;
-            if ( getParam('autoApproval_ifNoConfEmail') == 'on' ) {
-                if ( getParam('autoApproval_ifJoin') == 'on' ) {
-                    $sProfileStatus = 'Active';
-                    if( !empty($aProfileInfo['email']) ) {
-                        $oProfileFields -> sendActivationMail($iProfileId);
-                    }
-                }
-                else {
-                    $sProfileStatus = 'Approval';
-                    if( !empty($aProfileInfo['email']) ) {
-                        $oProfileFields -> sendApprovalMail($iProfileId);
-                    }
-                }
-            }
-            else {
-                if( !empty($aProfileInfo['email']) ) {
-                    $oProfileFields -> sendConfMail($iProfileId);
-                    $sProfileStatus = 'Unconfirmed';
-                }
-                else {
-                    if ( getParam('autoApproval_ifJoin') == 'on' ) {
-                        $sProfileStatus = 'Active';
-                    }
-                    else {
-                        $sProfileStatus = 'Approval';
-                    }
-                }
-            }
-
-            // update profile's status;
-            $this -> _oDb -> updateProfileStatus($iProfileId, $sProfileStatus);
-            $oProfileFields -> createProfileCache($iProfileId);
-
-            if( !empty($aProfileInfo['email']) ) {
-                //-- send email notification --//
-                $oEmailTemplate = new BxDolEmailTemplates();
-                $aTemplate = $oEmailTemplate -> getTemplate('t_fb_connect_password_generated') ;
-                $aNewProfileInfo = getProfileInfo($iProfileId);
-
-                $aPlus = array(
-                    'NickName'       => $aNewProfileInfo['NickName'],
-                    'NewPassword' => $sNewPassword,
-                );
-
-                sendMail( $aNewProfileInfo['Email'], $aTemplate['Subject']
-                    , $aTemplate['Body'], '', $aPlus );
-             }
-            //--
-
-            // create system event
-            $oZ = new BxDolAlerts('profile', 'join', $iProfileId);
-            $oZ -> alert();
-
-            //Auto-friend members if they are already friends on Facebook
-            $this -> _makeFriends($iProfileId);
-
-            // set logged
-            $aProfileInfo = getProfileInfo($iProfileId);
-            $this -> setLogged($iProfileId, $aProfileInfo['Password'], '', false);
-
-             //redirect to avatar page
-            if($bAvatarRedirect) {
-                if( BxDolInstallerUtils::isModuleInstalled('avatar') ) {
-                    // check profile's logo;
-                    if($sMemberAvatar) {
-                        BxDolService::call('avatar', 'set_image_for_cropping', array ($iProfileId, $sMemberAvatar));
-                    }
-
-                    if (BxDolService::call('avatar', 'join', array ($iProfileId, '_Join complete'))) {
-                        exit;
-                    }
-                }
-                else {
-                    header('location:' . $this -> _oConfig -> sDefaultRedirectUrl);
-                    exit;
-                }
-            }
-            else {
-                //assign avatar
-                if($sMemberAvatar) {
-                    $this -> _assignAvatar($sMemberAvatar);
-                }
-
-                //redirect to other page
-                header('location:' . $sRedirectUrl);
-                exit;
-            }
-        }
-
-         /**
-         * get join page
-         *
-         * @param $aProfileFields array
-         * @param $iFacebookUserId integer
-         * @return void
-         */
-        function _getJoinPage($aProfileFields, $iFacebookUserId)
-        {
-            bx_import('BxDolSession');
-            $oSession = BxDolSession::getInstance();
-            $oSession -> setValue($this -> _oConfig -> sFacebookSessionUid, $iFacebookUserId);
-
-            bx_import("BxDolJoinProcessor");
-
-            $GLOBALS['oSysTemplate']->addJsTranslation('_Errors in join form');
-            $GLOBALS['oSysTemplate']->addJs(array('join.js', 'jquery.form.js'));
-
-            $oJoin = new BxDolJoinProcessor();
-
-            //process recived fields
-            foreach($aProfileFields as $sFieldName => $sValue) {
-                $oJoin -> aValues[0][$sFieldName] = $sValue;
-            }
-
-            $this -> _oTemplate -> getPage( _t( '_JOIN_H' ), $oJoin->process());
-            exit;
-        }
-
-        /**
-         * Function will clear all unnecessary sybmols from profile's nickname;
-         *
-         * @param  : $sProfileName (string) - profile's nickname;
-         * @return : (string) - cleared nickname;
-         */
-        function _proccesNickName($sProfileName)
-        {
-            $sProfileName = preg_replace("/^http:\/\/|^https:\/\/|\/$/", '', $sProfileName);
-            $sProfileName = str_replace('/', '_', $sProfileName);
-            $sProfileName = str_replace('.', '-', $sProfileName);
-
-            return $sProfileName;
-        }
-    }

+ 0 - 99
modules/boonex/facebook_connect/classes/BxFaceBookConnectTemplate.php

@@ -1,99 +0,0 @@
-<?php
-
-    /***************************************************************************
-    *                            Dolphin Smart Community Builder
-    *                              -------------------
-    *     begin                : Mon Mar 23 2006
-    *     copyright            : (C) 2007 BoonEx Group
-    *     website              : http://www.boonex.com
-    * This file is part of Dolphin - Smart Community Builder
-    *
-    * Dolphin is free software; you can redistribute it and/or modify it under
-    * the terms of the GNU General Public License as published by the
-    * Free Software Foundation; either version 2 of the
-    * License, or  any later version.
-    *
-    * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-    * without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-    * See the GNU General Public License for more details.
-    * You should have received a copy of the GNU General Public License along with Dolphin,
-    * see license.txt file; if not, write to marketing@boonex.com
-    ***************************************************************************/
-
-   bx_import('BxDolModuleTemplate');
-
-    class BxFaceBookConnectTemplate extends BxDolModuleTemplate
-    {
-        /**
-         * Class constructor
-         */
-        function BxFaceBookConnectTemplate(&$oConfig, &$oDb)
-        {
-            parent::BxDolModuleTemplate($oConfig, $oDb);
-        }
-
-        function pageCodeAdminStart()
-        {
-            ob_start();
-        }
-
-        function adminBlock ($sContent, $sTitle, $aMenu = array())
-        {
-            return DesignBoxAdmin($sTitle, $sContent, $aMenu);
-        }
-
-        function pageCodeAdmin ($sTitle)
-        {
-            global $_page;
-            global $_page_cont;
-
-            $_page['name_index'] = 9;
-
-            $_page['header'] = $sTitle ? $sTitle : $GLOBALS['site']['title'];
-            $_page['header_text'] = $sTitle;
-
-            $_page_cont[$_page['name_index']]['page_main_code'] = ob_get_clean();
-
-            PageCodeAdmin();
-        }
-
-        /**
-         * Function will include the js file ;
-         *
-         * @param  : $sName (string) - name of needed file ;
-         * @return : (text) ;
-         */
-        function addJs($sName)
-        {
-            return '<script type="text/javascript" src="' . $this -> _oConfig -> getHomeUrl() . 'js/' . $sName . '" language="javascript"/></script>';
-        }
-
-        /**
-         * Function will generate default dolphin's page;
-         *
-         * @param  : $sPageCaption   (string) - page's title;
-         * @param  : $sPageContent   (string) - page's content;
-         * @param  : $sPageIcon      (string) - page's icon;
-         * @return : (text) html presentation data;
-         */
-        function getPage($sPageCaption, $sPageContent, $sPageIcon = 'facebook-small-logo.png')
-        {
-            global $_page;
-            global $_page_cont;
-
-            $iIndex = 54;
-
-            $_page['name_index']    = $iIndex;
-
-            // set module's icon;
-            $GLOBALS['oTopMenu'] -> setCustomSubIconUrl( $this -> getIconUrl($sPageIcon) );
-            $GLOBALS['oTopMenu'] -> setCustomSubHeader($sPageCaption);
-
-            $_page['header']        = $sPageCaption ;
-            $_page['header_text']   = $sPageCaption ;
-            $_page['css_name']      = 'face_book_connect.css';
-
-            $_page_cont[$iIndex]['page_main_code'] = $sPageContent;
-            PageCode($this);
-        }
-    }

+ 0 - 775
modules/boonex/facebook_connect/inc/facebook.php

@@ -1,775 +0,0 @@
-<?php
-
-if (!function_exists('curl_init')) {
-  throw new Exception('Facebook needs the CURL PHP extension.');
-}
-if (!function_exists('json_decode')) {
-  throw new Exception('Facebook needs the JSON PHP extension.');
-}
-
-/**
- * Thrown when an API call returns an exception.
- *
- * @author Naitik Shah <naitik@facebook.com>
- */
-class FacebookApiException extends Exception
-{
-  /**
-   * The result from the API server that represents the exception information.
-   */
-  protected $result;
-
-  /**
-   * Make a new API Exception with the given result.
-   *
-   * @param Array $result the result from the API server
-   */
-  public function __construct($result) {
-    $this->result = $result;
-
-    $code = isset($result['error_code']) ? $result['error_code'] : 0;
-    $msg  = isset($result['error'])
-              ? $result['error']['message'] : $result['error_msg'];
-    parent::__construct($msg, $code);
-  }
-
-  /**
-   * Return the associated result object returned by the API server.
-   *
-   * @returns Array the result from the API server
-   */
-  public function getResult() {
-    return $this->result;
-  }
-
-  /**
-   * Returns the associated type for the error. This will default to
-   * 'Exception' when a type is not available.
-   *
-   * @return String
-   */
-  public function getType() {
-    return
-      isset($this->result['error']) && isset($this->result['error']['type'])
-      ? $this->result['error']['type']
-      : 'Exception';
-  }
-
-  /**
-   * To make debugging easier.
-   *
-   * @returns String the string representation of the error
-   */
-  public function __toString() {
-    $str = $this->getType() . ': ';
-    if ($this->code != 0) {
-      $str .= $this->code . ': ';
-    }
-    return $str . $this->message;
-  }
-}
-
-/**
- * Provides access to the Facebook Platform.
- *
- * @author Naitik Shah <naitik@facebook.com>
- */
-class Facebook
-{
-  /**
-   * Version.
-   */
-  const VERSION = '2.0.5';
-
-  /**
-   * Default options for curl.
-   */
-  public static $CURL_OPTS = array(
-    CURLOPT_CONNECTTIMEOUT => 10,
-    CURLOPT_RETURNTRANSFER => true,
-    CURLOPT_TIMEOUT        => 60,
-    CURLOPT_USERAGENT      => 'facebook-php-2.0',
-  );
-
-  /**
-   * List of query parameters that get automatically dropped when rebuilding
-   * the current URL.
-   */
-  protected static $DROP_QUERY_PARAMS = array(
-    'session',
-  );
-
-  /**
-   * Maps aliases to Facebook domains.
-   */
-  public static $DOMAIN_MAP = array(
-    'api'      => 'https://api.facebook.com/',
-    'api_read' => 'https://api-read.facebook.com/',
-    'graph'    => 'https://graph.facebook.com/',
-    'www'      => 'https://www.facebook.com/',
-  );
-
-  /**
-   * The Application ID.
-   */
-  protected $appId;
-
-  /**
-   * The Application API Secret.
-   */
-  protected $apiSecret;
-
-  /**
-   * The active user session, if one is available.
-   */
-  protected $session;
-
-  /**
-   * Indicates that we already loaded the session as best as we could.
-   */
-  protected $sessionLoaded = false;
-
-  /**
-   * Indicates if Cookie support should be enabled.
-   */
-  protected $cookieSupport = false;
-
-  /**
-   * Base domain for the Cookie.
-   */
-  protected $baseDomain = '';
-
-  /**
-   * Initialize a Facebook Application.
-   *
-   * The configuration:
-   * - appId: the application ID
-   * - secret: the application secret
-   * - cookie: (optional) boolean true to enable cookie support
-   * - domain: (optional) domain for the cookie
-   *
-   * @param Array $config the application configuration
-   */
-  public function __construct($config) {
-    $this->setAppId($config['appId']);
-    $this->setApiSecret($config['secret']);
-    if (isset($config['cookie'])) {
-      $this->setCookieSupport($config['cookie']);
-    }
-    if (isset($config['domain'])) {
-      $this->setBaseDomain($config['domain']);
-    }
-  }
-
-  /**
-   * Set the Application ID.
-   *
-   * @param String $appId the Application ID
-   */
-  public function setAppId($appId) {
-    $this->appId = $appId;
-    return $this;
-  }
-
-  /**
-   * Get the Application ID.
-   *
-   * @return String the Application ID
-   */
-  public function getAppId() {
-    return $this->appId;
-  }
-
-  /**
-   * Set the API Secret.
-   *
-   * @param String $appId the API Secret
-   */
-  public function setApiSecret($apiSecret) {
-    $this->apiSecret = $apiSecret;
-    return $this;
-  }
-
-  /**
-   * Get the API Secret.
-   *
-   * @return String the API Secret
-   */
-  public function getApiSecret() {
-    return $this->apiSecret;
-  }
-
-  /**
-   * Set the Cookie Support status.
-   *
-   * @param Boolean $cookieSupport the Cookie Support status
-   */
-  public function setCookieSupport($cookieSupport) {
-    $this->cookieSupport = $cookieSupport;
-    return $this;
-  }
-
-  /**
-   * Get the Cookie Support status.
-   *
-   * @return Boolean the Cookie Support status
-   */
-  public function useCookieSupport() {
-    return $this->cookieSupport;
-  }
-
-  /**
-   * Set the base domain for the Cookie.
-   *
-   * @param String $domain the base domain
-   */
-  public function setBaseDomain($domain) {
-    $this->baseDomain = $domain;
-    return $this;
-  }
-
-  /**
-   * Get the base domain for the Cookie.
-   *
-   * @return String the base domain
-   */
-  public function getBaseDomain() {
-    return $this->baseDomain;
-  }
-
-  /**
-   * Set the Session.
-   *
-   * @param Array $session the session
-   * @param Boolean $write_cookie indicate if a cookie should be written. this
-   * value is ignored if cookie support has been disabled.
-   */
-  public function setSession($session=null, $write_cookie=true) {
-    $session = $this->validateSessionObject($session);
-    $this->sessionLoaded = true;
-    $this->session = $session;
-    if ($write_cookie) {
-      $this->setCookieFromSession($session);
-    }
-    return $this;
-  }
-
-  /**
-   * Get the session object. This will automatically look for a signed session
-   * sent via the Cookie or Query Parameters if needed.
-   *
-   * @return Array the session
-   */
-  public function getSession() {
-    if (!$this->sessionLoaded) {
-      $session = null;
-      $write_cookie = true;
-
-      // try loading session from $_REQUEST
-      if (isset($_REQUEST['session'])) {
-        $session = json_decode(
-          get_magic_quotes_gpc()
-            ? stripslashes($_REQUEST['session'])
-            : $_REQUEST['session'],
-          true
-        );
-        $session = $this->validateSessionObject($session);
-      }
-
-      // try loading session from cookie if necessary
-      if (!$session && $this->useCookieSupport()) {
-        $cookieName = $this->getSessionCookieName();
-        if (isset($_COOKIE[$cookieName])) {
-          $session = array();
-          parse_str(trim(
-            get_magic_quotes_gpc()
-              ? stripslashes($_COOKIE[$cookieName])
-              : $_COOKIE[$cookieName],
-            '"'
-          ), $session);
-          $session = $this->validateSessionObject($session);
-          // write only if we need to delete a invalid session cookie
-          $write_cookie = empty($session);
-        }
-      }
-
-      $this->setSession($session, $write_cookie);
-    }
-
-    return $this->session;
-  }
-
-  /**
-   * Get the UID from the session.
-   *
-   * @return String the UID if available
-   */
-  public function getUser() {
-    $session = $this->getSession();
-    return $session ? $session['uid'] : null;
-  }
-
-  /**
-   * Get a Login URL for use with redirects. By default, full page redirect is
-   * assumed. If you are using the generated URL with a window.open() call in
-   * JavaScript, you can pass in display=popup as part of the $params.
-   *
-   * The parameters:
-   * - next: the url to go to after a successful login
-   * - cancel_url: the url to go to after the user cancels
-   * - req_perms: comma separated list of requested extended perms
-   * - display: can be "page" (default, full page) or "popup"
-   *
-   * @param Array $params provide custom parameters
-   * @return String the URL for the login flow
-   */
-  public function getLoginUrl($params=array()) {
-    $currentUrl = $this->getCurrentUrl();
-    return $this->getUrl(
-      'www',
-      'login.php',
-      array_merge(array(
-        'api_key'         => $this->getAppId(),
-        'cancel_url'      => $currentUrl,
-        'display'         => 'page',
-        'fbconnect'       => 1,
-        'next'            => $currentUrl,
-        'return_session'  => 1,
-        'session_version' => 3,
-        'v'               => '1.0',
-      ), $params)
-    );
-  }
-
-  /**
-   * Get a Logout URL suitable for use with redirects.
-   *
-   * The parameters:
-   * - next: the url to go to after a successful logout
-   *
-   * @param Array $params provide custom parameters
-   * @return String the URL for the logout flow
-   */
-  public function getLogoutUrl($params=array()) {
-    $session = $this->getSession();
-    return $this->getUrl(
-      'www',
-      'logout.php',
-      array_merge(array(
-        'api_key'     => $this->getAppId(),
-        'next'        => $this->getCurrentUrl(),
-        'session_key' => $session['session_key'],
-      ), $params)
-    );
-  }
-
-  /**
-   * Get a login status URL to fetch the status from facebook.
-   *
-   * The parameters:
-   * - ok_session: the URL to go to if a session is found
-   * - no_session: the URL to go to if the user is not connected
-   * - no_user: the URL to go to if the user is not signed into facebook
-   *
-   * @param Array $params provide custom parameters
-   * @return String the URL for the logout flow
-   */
-  public function getLoginStatusUrl($params=array()) {
-    return $this->getUrl(
-      'www',
-      'extern/login_status.php',
-      array_merge(array(
-        'api_key'         => $this->getAppId(),
-        'no_session'      => $this->getCurrentUrl(),
-        'no_user'         => $this->getCurrentUrl(),
-        'ok_session'      => $this->getCurrentUrl(),
-        'session_version' => 3,
-      ), $params)
-    );
-  }
-
-  /**
-   * Make an API call.
-   *
-   * @param Array $params the API call parameters
-   * @return the decoded response
-   */
-  public function api(/* polymorphic */) {
-    $args = func_get_args();
-    if (is_array($args[0])) {
-      return $this->_restserver($args[0]);
-    } else {
-      return call_user_func_array(array($this, '_graph'), $args);
-    }
-  }
-
-   /**
-   * The name of the Cookie that contains the session.
-   *
-   * @return String the cookie name
-   */
-  public function getSessionCookieName() {
-    return 'fbs_' . $this->getAppId();
-  }
-
-  /**
-   * Invoke the old restserver.php endpoint.
-   *
-   * @param Array $params method call object
-   * @return the decoded response object
-   * @throws FacebookApiException
-   */
-  protected function _restserver($params) {
-    // generic application level parameters
-    $params['api_key'] = $this->getAppId();
-    $params['format'] = 'json-strings';
-
-    $result = json_decode($this->_oauthRequest(
-      $this->getApiUrl($params['method']),
-      $params
-    ), true);
-
-    // results are returned, errors are thrown
-    if (is_array($result) && isset($result['error_code'])) {
-      throw new FacebookApiException($result);
-    }
-    return $result;
-  }
-
-  /**
-   * Invoke the Graph API.
-   *
-   * @param String $path the path (required)
-   * @param String $method the http method (default 'GET')
-   * @param Array $params the query/post data
-   * @return the decoded response object
-   * @throws FacebookApiException
-   */
-  protected function _graph($path, $method='GET', $params=array()) {
-    if (is_array($method) && empty($params)) {
-      $params = $method;
-      $method = 'GET';
-    }
-    $params['method'] = $method; // method override as we always do a POST
-
-    $result = json_decode($this->_oauthRequest(
-      $this->getUrl('graph', $path),
-      $params
-    ), true);
-
-    // results are returned, errors are thrown
-    if (is_array($result) && isset($result['error'])) {
-      $e = new FacebookApiException($result);
-      if ($e->getType() === 'OAuthException') {
-        $this->setSession(null);
-      }
-      throw $e;
-    }
-    return $result;
-  }
-
-  /**
-   * Make a OAuth Request
-   *
-   * @param String $path the path (required)
-   * @param Array $params the query/post data
-   * @return the decoded response object
-   * @throws FacebookApiException
-   */
-  protected function _oauthRequest($url, $params) {
-    if (!isset($params['access_token'])) {
-      $session = $this->getSession();
-      // either user session signed, or app signed
-      if ($session) {
-        $params['access_token'] = $session['access_token'];
-      } else {
-        $params['access_token'] = $this->getAppId() .'|'. $this->getApiSecret();
-      }
-    }
-
-    // json_encode all params values that are not strings
-    foreach ($params as $key => $value) {
-      if (!is_string($value)) {
-        $params[$key] = json_encode($value);
-      }
-    }
-    return $this->makeRequest($url, $params);
-  }
-
-  /**
-   * Makes an HTTP request. This method can be overriden by subclasses if
-   * developers want to do fancier things or use something other than curl to
-   * make the request.
-   *
-   * @param String $url the URL to make the request to
-   * @param Array $params the parameters to use for the POST body
-   * @param CurlHandler $ch optional initialized curl handle
-   * @return String the response text
-   */
-  protected function makeRequest($url, $params, $ch=null) {
-    if (!$ch) {
-      $ch = curl_init();
-    }
-
-    $opts = self::$CURL_OPTS;
-    $opts[CURLOPT_POSTFIELDS] = http_build_query($params, null, '&');
-    $opts[CURLOPT_URL] = $url;
-    curl_setopt_array($ch, $opts);
-    $result = curl_exec($ch);
-    if ($result === false) {
-      $e = new FacebookApiException(array(
-        'error_code' => curl_errno($ch),
-        'error'      => array(
-          'message' => curl_error($ch),
-          'type'    => 'CurlException',
-        ),
-      ));
-      curl_close($ch);
-      throw $e;
-    }
-    curl_close($ch);
-    return $result;
-  }
-
-  /**
-   * Set a JS Cookie based on the _passed in_ session. It does not use the
-   * currently stored session -- you need to explicitly pass it in.
-   *
-   * @param Array $session the session to use for setting the cookie
-   */
-  protected function setCookieFromSession($session=null) {
-    if (!$this->useCookieSupport()) {
-      return;
-    }
-
-    $cookieName = $this->getSessionCookieName();
-    $value = 'deleted';
-    $expires = time() - 3600;
-    $domain = $this->getBaseDomain();
-    if ($session) {
-      $value = '"' . http_build_query($session, null, '&') . '"';
-      if (isset($session['base_domain'])) {
-        $domain = $session['base_domain'];
-      }
-      $expires = $session['expires'];
-    }
-
-    // prepend dot if a domain is found
-    if ($domain) {
-      $domain = '.' . $domain;
-    }
-
-    // if an existing cookie is not set, we dont need to delete it
-    if ($value == 'deleted' && empty($_COOKIE[$cookieName])) {
-      return;
-    }
-
-    if (headers_sent()) {
-      // disable error log if we are running in a CLI environment
-      // @codeCoverageIgnoreStart
-      if (php_sapi_name() != 'cli') {
-        error_log('Could not set cookie. Headers already sent.');
-      }
-      // @codeCoverageIgnoreEnd
-
-    // ignore for code coverage as we will never be able to setcookie in a CLI
-    // environment
-    // @codeCoverageIgnoreStart
-    } else {
-      setcookie($cookieName, $value, $expires, '/');
-    }
-    // @codeCoverageIgnoreEnd
-  }
-
-  /**
-   * Validates a session_version=3 style session object.
-   *
-   * @param Array $session the session object
-   * @return Array the session object if it validates, null otherwise
-   */
-  protected function validateSessionObject($session) {
-    // make sure some essential fields exist
-    if (is_array($session) &&
-        isset($session['uid']) &&
-        isset($session['session_key']) &&
-        isset($session['secret']) &&
-        isset($session['access_token']) &&
-        isset($session['sig'])) {
-      // validate the signature
-      $session_without_sig = $session;
-      unset($session_without_sig['sig']);
-      $expected_sig = self::generateSignature(
-        $session_without_sig,
-        $this->getApiSecret()
-      );
-      if ($session['sig'] != $expected_sig) {
-        // disable error log if we are running in a CLI environment
-        // @codeCoverageIgnoreStart
-        if (php_sapi_name() != 'cli') {
-          error_log('Got invalid session signature in cookie.');
-        }
-        // @codeCoverageIgnoreEnd
-        $session = null;
-      }
-      // check expiry time
-    } else {
-      $session = null;
-    }
-    return $session;
-  }
-
-  /**
-   * Build the URL for api given parameters.
-   *
-   * @param $method String the method name.
-   * @return String the URL for the given parameters
-   */
-  protected function getApiUrl($method) {
-    static $READ_ONLY_CALLS =
-      array('admin.getallocation' => 1,
-            'admin.getappproperties' => 1,
-            'admin.getbannedusers' => 1,
-            'admin.getlivestreamvialink' => 1,
-            'admin.getmetrics' => 1,
-            'admin.getrestrictioninfo' => 1,
-            'application.getpublicinfo' => 1,
-            'auth.getapppublickey' => 1,
-            'auth.getsession' => 1,
-            'auth.getsignedpublicsessiondata' => 1,
-            'comments.get' => 1,
-            'connect.getunconnectedfriendscount' => 1,
-            'dashboard.getactivity' => 1,
-            'dashboard.getcount' => 1,
-            'dashboard.getglobalnews' => 1,
-            'dashboard.getnews' => 1,
-            'dashboard.multigetcount' => 1,
-            'dashboard.multigetnews' => 1,
-            'data.getcookies' => 1,
-            'events.get' => 1,
-            'events.getmembers' => 1,
-            'fbml.getcustomtags' => 1,
-            'feed.getappfriendstories' => 1,
-            'feed.getregisteredtemplatebundlebyid' => 1,
-            'feed.getregisteredtemplatebundles' => 1,
-            'fql.multiquery' => 1,
-            'fql.query' => 1,
-            'friends.arefriends' => 1,
-            'friends.get' => 1,
-            'friends.getappusers' => 1,
-            'friends.getlists' => 1,
-            'friends.getmutualfriends' => 1,
-            'gifts.get' => 1,
-            'groups.get' => 1,
-            'groups.getmembers' => 1,
-            'intl.gettranslations' => 1,
-            'links.get' => 1,
-            'notes.get' => 1,
-            'notifications.get' => 1,
-            'pages.getinfo' => 1,
-            'pages.isadmin' => 1,
-            'pages.isappadded' => 1,
-            'pages.isfan' => 1,
-            'permissions.checkavailableapiaccess' => 1,
-            'permissions.checkgrantedapiaccess' => 1,
-            'photos.get' => 1,
-            'photos.getalbums' => 1,
-            'photos.gettags' => 1,
-            'profile.getinfo' => 1,
-            'profile.getinfooptions' => 1,
-            'stream.get' => 1,
-            'stream.getcomments' => 1,
-            'stream.getfilters' => 1,
-            'users.getinfo' => 1,
-            'users.getloggedinuser' => 1,
-            'users.getstandardinfo' => 1,
-            'users.hasapppermission' => 1,
-            'users.isappuser' => 1,
-            'users.isverified' => 1,
-            'video.getuploadlimits' => 1);
-    $name = 'api';
-    if (isset($READ_ONLY_CALLS[strtolower($method)])) {
-      $name = 'api_read';
-    }
-    return self::getUrl($name, 'restserver.php');
-  }
-
-  /**
-   * Build the URL for given domain alias, path and parameters.
-   *
-   * @param $name String the name of the domain
-   * @param $path String optional path (without a leading slash)
-   * @param $params Array optional query parameters
-   * @return String the URL for the given parameters
-   */
-  protected function getUrl($name, $path='', $params=array()) {
-    $url = self::$DOMAIN_MAP[$name];
-    if ($path) {
-      if ($path[0] === '/') {
-        $path = substr($path, 1);
-      }
-      $url .= $path;
-    }
-    if ($params) {
-      $url .= '?' . http_build_query($params);
-    }
-    return $url;
-  }
-
-  /**
-   * Returns the Current URL, stripping it of known FB parameters that should
-   * not persist.
-   *
-   * @return String the current URL
-   */
-  protected function getCurrentUrl() {
-    $protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on'
-      ? 'https://'
-      : 'http://';
-    $currentUrl = $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
-    $parts = parse_url($currentUrl);
-
-    // drop known fb params
-    $query = '';
-    if (!empty($parts['query'])) {
-      $params = array();
-      parse_str($parts['query'], $params);
-      foreach(self::$DROP_QUERY_PARAMS as $key) {
-        unset($params[$key]);
-      }
-      if (!empty($params)) {
-        $query = '?' . http_build_query($params);
-      }
-    }
-
-    // use port if non default
-    $port =
-      isset($parts['port']) &&
-      (($protocol === 'http://' && $parts['port'] !== 80) ||
-       ($protocol === 'https://' && $parts['port'] !== 443))
-      ? ':' . $parts['port'] : '';
-
-    // rebuild
-    return $protocol . $parts['host'] . $port . $parts['path'] . $query;
-  }
-
-  /**
-   * Generate a signature for the given params and secret.
-   *
-   * @param Array $params the parameters to sign
-   * @param String $secret the secret to sign with
-   * @return String the generated signature
-   */
-  protected static function generateSignature($params, $secret) {
-    // work with sorted data
-    ksort($params);
-
-    // generate the base string
-    $base_string = '';
-    foreach($params as $key => $value) {
-      $base_string .= $key . '=' . $value;
-    }
-    $base_string .= $secret;
-
-    return md5($base_string);
-  }
-}

+ 0 - 125
modules/boonex/facebook_connect/install/config.php

@@ -1,125 +0,0 @@
-<?php
-
-    /***************************************************************************
-    *                            Dolphin Smart Community Builder
-    *                              -------------------
-    *     begin                : Mon Mar 23 2006
-    *     copyright            : (C) 2007 BoonEx Group
-    *     website              : http://www.boonex.com
-    * This file is part of Dolphin - Smart Community Builder
-    *
-    * Dolphin is free software; you can redistribute it and/or modify it under
-    * the terms of the GNU General Public License as published by the
-    * Free Software Foundation; either version 2 of the
-    * License, or  any later version.
-    *
-    * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-    * without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-    * See the GNU General Public License for more details.
-    * You should have received a copy of the GNU General Public License along with Dolphin,
-    * see license.txt file; if not, write to marketing@boonex.com
-    ***************************************************************************/
-
-    $aConfig = array(
-        /**
-         * Main Section.
-         */
-		'type' => BX_DOL_MODULE_TYPE_MODULE,
-		'name' => 'bx_facebook_connect',
-        'title' => 'Facebook connect',
-        'version' => '1.0.6',
-        'vendor' => 'Boonex',
-        'update_url' => '',
-
-        'compatible_with' => array(
-            '7.0.6'
-        ),
-
-        /**
-         * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
-         */
-        'home_dir' => 'boonex/facebook_connect/',
-        'home_uri' => 'facebook_connect',
-
-        'db_prefix' => 'bx_facebook_',
-        'class_prefix' => 'BxFaceBookConnect',
-        /**
-         * Installation/Uninstallation Section.
-         */
-        'install' => array(
-            'check_dependencies' => 0,
-            'check_requirements' => 1,
-            'show_introduction' => 1,
-            'change_permissions' => 0,
-            'execute_sql' => 1,
-            'update_languages' => 1,
-            'recompile_main_menu' => 0,
-            'recompile_member_menu' => 0,
-            'recompile_site_stats' => 0,
-            'recompile_page_builder' => 0,
-            'recompile_profile_fields' => 1,
-            'recompile_comments' => 0,
-            'recompile_member_actions' => 0,
-            'recompile_tags' => 0,
-            'recompile_votes' => 0,
-            'recompile_categories' => 0,
-            'recompile_search' => 0,
-            'recompile_browse' => 0,
-            'recompile_injections' => 0,
-            'recompile_permalinks' => 1,
-            'recompile_alerts' => 1,
-            'recompile_global_paramaters' => 1,
-            'clear_db_cache'  => 1,
-            'show_conclusion' => 1,
-        ),
-        'uninstall' => array (
-            'check_dependencies' => 0,
-            'show_introduction' => 0,
-            'change_permissions' => 0,
-            'execute_sql' => 1,
-            'update_languages' => 1,
-            'recompile_main_menu' => 0,
-            'recompile_member_menu' => 0,
-            'recompile_site_stats' => 0,
-            'recompile_page_builder' => 0,
-            'recompile_profile_fields' => 0,
-            'recompile_comments' => 0,
-            'recompile_member_actions' => 0,
-            'recompile_tags' => 0,
-            'recompile_votes' => 0,
-            'recompile_categories' => 0,
-            'recompile_search' => 0,
-            'recompile_browse' => 0,
-            'recompile_injections' => 0,
-            'recompile_permalinks' => 1,
-            'recompile_alerts' => 1,
-            'recompile_global_paramaters' => 1,
-            'clear_db_cache'  => 1,
-            'show_conclusion' => 1,
-        ),
-        /**
-         * Dependencies Section
-         */
-        'dependencies' => array(
-        ),
-        /**
-         * Category for language keys.
-         */
-        'language_category' => 'Facebook',
-        /**
-         * Permissions Section
-         */
-        'install_permissions' => array(),
-        'uninstall_permissions' => array(),
-        /**
-         * Introduction and Conclusion Section.
-         */
-        'install_info' => array(
-            'introduction' => 'inst_intro.html',
-            'conclusion' => 'inst_concl.html'
-        ),
-        'uninstall_info' => array(
-            'introduction' => '',
-            'conclusion' => 'uninst_concl.html'
-        )
-    );

+ 0 - 1
modules/boonex/facebook_connect/install/info/inst_concl.html

@@ -1 +0,0 @@
-Module was successfully installed.

+ 0 - 1
modules/boonex/facebook_connect/install/info/inst_intro.html

@@ -1 +0,0 @@
-Follow the instructions carefully!!!

+ 0 - 1
modules/boonex/facebook_connect/install/info/uninst_concl.html

@@ -1 +0,0 @@
-Module was successfully deleted.

+ 0 - 0
modules/boonex/facebook_connect/install/info/uninst_intro.html


+ 0 - 48
modules/boonex/facebook_connect/install/installer.php

@@ -1,48 +0,0 @@
-<?php
-
-    /***************************************************************************
-    *                            Dolphin Smart Community Builder
-    *                              -------------------
-    *     begin                : Mon Mar 23 2006
-    *     copyright            : (C) 2007 BoonEx Group
-    *     website              : http://www.boonex.com
-    * This file is part of Dolphin - Smart Community Builder
-    *
-    * Dolphin is free software; you can redistribute it and/or modify it under
-    * the terms of the GNU General Public License as published by the
-    * Free Software Foundation; either version 2 of the
-    * License, or  any later version.
-    *
-    * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-    * without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-    * See the GNU General Public License for more details.
-    * You should have received a copy of the GNU General Public License along with Dolphin,
-    * see license.txt file; if not, write to marketing@boonex.com
-    ***************************************************************************/
-
-    require_once(BX_DIRECTORY_PATH_CLASSES . "BxDolInstaller.php");
-
-    class BxFaceBookConnectInstaller extends BxDolInstaller
-    {
-        function BxFaceBookConnectInstaller(&$aConfig)
-        {
-            parent::BxDolInstaller($aConfig);
-        }
-
-        function actionCheckRequirements()
-        {
-            $bError = (int) phpversion() >= 5
-                ? BX_DOL_INSTALLER_SUCCESS
-                : BX_DOL_INSTALLER_FAILED;
-
-            return $bError;
-        }
-
-        function actionCheckRequirementsFailed()
-        {
-            return '
-            <div style="border:1px solid red; padding:10px;">
-                You need <u>PHP 5</u> or higher!
-            </div>';
-        }
-    }

+ 0 - 35
modules/boonex/facebook_connect/install/langs/en.php

@@ -1,35 +0,0 @@
-<?php
-
-    /***************************************************************************
-    *                            Dolphin Smart Community Builder
-    *                              -------------------
-    *     begin                : Mon Mar 23 2006
-    *     copyright            : (C) 2007 BoonEx Group
-    *     website              : http://www.boonex.com
-    * This file is part of Dolphin - Smart Community Builder
-    *
-    * Dolphin is free software; you can redistribute it and/or modify it under
-    * the terms of the GNU General Public License as published by the
-    * Free Software Foundation; either version 2 of the
-    * License, or  any later version.
-    *
-    * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-    * without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-    * See the GNU General Public License for more details.
-    * You should have received a copy of the GNU General Public License along with Dolphin,
-    * see license.txt file; if not, write to marketing@boonex.com
-    ***************************************************************************/
-
-    $aLangContent = array
-    (
-        '_bx_facebook'                         => 'Facebook connect',
-        '_bx_facebook_settings'                => 'Facebook connect settings',
-        '_bx_facebook_information'             => 'Facebook connect information',
-        '_bx_facebook_information_block'       => 'To get your "API Key" and "App Secret" strings, go to the following URL: <br /><a href="http://developers.facebook.com/setup/" target="_blank">Make application</a> <br /><br />For "Site URL" and "Canvas URL" you should use this URL:<br /> <b>{0}modules/?r=facebook_connect/login_form</b> <br /><br />After completing these steps, insert your "API Key" and "App Secret" strings below:',
-        '_bx_facebook_error_occured'           => 'Error occurred',
-        '_bx_facebook_error_email' => 'Sorry but the profile with the received email already exists',
-        '_bx_facebook_profile_exist'           => 'Sorry, but profile {0} already exists',
-        '_bx_facebook_profile_not_defined'     => 'Sorry, but profile not defined',
-        '_bx_facebook_profile_error_info'      => 'Cant\'t define your profile information',
-        '_bx_facebook_profile_error_api_keys'  => 'Please configure the module in admin panel (can\'t define facebook api keys)',
-    );

+ 0 - 160
modules/boonex/facebook_connect/install/sql/install.sql

@@ -1,160 +0,0 @@
-
-    --
-    -- Table structure for table `bx_facebook_accounts`
-    --
-
-    CREATE TABLE `[db_prefix]accounts` (
-      `id_profile` int(10) unsigned NOT NULL,
-      `fb_profile` bigint(20) NOT NULL,
-      PRIMARY KEY (`id_profile`),
-      KEY `fb_profile` (`fb_profile`)
-    ) ENGINE=MyISAM;
-
-
-	INSERT INTO `sys_email_templates` (`Name`, `Subject`, `Body`, `Desc`, `LangID`) VALUES 
-	('t_fb_connect_password_generated', 'You have been generated a new password', '<html><head></head><body style="font: 12px Verdana; color:#000000">\r\n<p><b>Hello <NickName></b>, You have been generated a new password - <b><NewPassword></b></p>\r\n\r\n<p></p>\r\n\r\n<p>---</p>\r\nBest regards,  <SiteName> \r\n<p style="font: bold 10px Verdana; color:red">!!!Auto-generated e-mail, please, do not reply!!!</p></body></html>', 'Facebook connect password generated', 0);
-
-    --
-    -- Dumping data for table `sys_objects_auths`
-    --
-
-    INSERT INTO 
-        `sys_objects_auths` 
-    (`Title`, `Link`) 
-        VALUES
-    ('_bx_facebook', 'modules/?r=facebook_connect/login_form');
-
-    --
-    -- `sys_alerts_handlers` ;
-    --
-
-    INSERT INTO
-        `sys_alerts_handlers`
-    SET
-        `name`  = 'bx_facebook_connect',
-        `class` = 'BxFaceBookConnectAlerts',
-        `file`  = 'modules/boonex/facebook_connect/classes/BxFaceBookConnectAlerts.php';
-
-    SET @iHandlerId := (SELECT `id` FROM `sys_alerts_handlers`  WHERE `name`  =  'bx_facebook_connect');
-
-    --
-    -- `sys_alerts` ;
-    --
-
-    INSERT INTO
-        `sys_alerts`
-    SET
-        `unit`       = 'profile',
-        `action`     = 'logout',
-        `handler_id` = @iHandlerId;
-
-    INSERT INTO
-        `sys_alerts`
-    SET
-        `unit`       = 'profile',
-        `action`     = 'join',
-        `handler_id` = @iHandlerId;
-
-    INSERT INTO
-        `sys_alerts`
-    SET
-        `unit`       = 'profile',
-        `action`     = 'delete',
-        `handler_id` = @iHandlerId;
-
-    --
-    -- need for compatibility with old style login, will need remove it in a feature version
-    --
-
-    ALTER TABLE `Profiles` ADD `FacebookProfile` VARCHAR(32) NOT NULL;
-	ALTER TABLE `Profiles` ADD INDEX (`FacebookProfile`) ;
-
-   	--
-    -- `sys_options_cats` ;
-    --
-
-    SET @iMaxOrder = (SELECT `menu_order` + 1 FROM `sys_options_cats` ORDER BY `menu_order` DESC LIMIT 1);
-    INSERT INTO `sys_options_cats` (`name`, `menu_order`) VALUES ('Facebook connect', @iMaxOrder);
-    SET @iKategId = (SELECT LAST_INSERT_ID());
-
-    --
-    -- Dumping data for table `sys_options`;
-    --
-
-    INSERT INTO 
-        `sys_options` 
-    SET
-        `Name` = 'bx_facebook_connect_api_key',
-        `kateg` = @iKategId,
-        `desc`  = 'Facebook API Key',
-        `Type`  = 'digit',
-        `VALUE` = '',
-        `order_in_kateg` = 1;
-
-    INSERT INTO 
-        `sys_options` 
-    SET
-        `Name` = 'bx_facebook_connect_secret',
-        `kateg` = @iKategId,
-        `desc`  = 'Facebook App Secret',
-        `Type`  = 'digit',
-        `VALUE` = '',
-        `order_in_kateg` = 2;
-
-    INSERT INTO 
-        `sys_options` 
-    SET
-        `Name` = 'bx_facebook_connect_redirect_page',
-        `kateg` = @iKategId,
-        `desc`  = 'Redirect page after first sign in',
-        `Type`  = 'select',
-        `VALUE` = 'join',
-        `AvailableValues` = 'join,pedit,avatar,member,index',
-        `order_in_kateg` = 3;
-
-    INSERT INTO 
-        `sys_options` 
-    SET
-        `Name` = 'bx_facebook_connect_auto_friends',
-        `kateg` = @iKategId,
-        `desc`  = 'Auto-friend members if they are already friends on Facebook',
-        `Type`  = 'checkbox',
-        `VALUE` = 'on',
-        `order_in_kateg` = 4;
-
-    -- 
-    -- `sys_menu_admin`;
-    --
-
-    INSERT INTO 
-        `sys_menu_admin` 
-    SET
-        `name`           = 'Facebook connect',
-        `title`          = '_bx_facebook', 
-        `url`            = '{siteUrl}modules/?r=facebook_connect/administration/', 
-        `description`    = 'Managing the \'facebook connect\' settings', 
-        `icon`           = 'modules/boonex/facebook_connect/|facebook-icon_little.png',
-        `parent_id`      = 2;
-
-    --
-    -- permalink
-    --
-
-    INSERT INTO 
-        `sys_permalinks` 
-    SET
-        `standard`  = 'modules/?r=facebook_connect/', 
-        `permalink` = 'm/facebook_connect/', 
-        `check`     = 'bx_facebook_connect_permalinks';
-        
-    --
-    -- settings
-    --
-
-    INSERT INTO 
-        `sys_options` 
-    (`Name`, `VALUE`, `kateg`, `desc`, `Type`, `check`, `err_text`, `order_in_kateg`, `AvailableValues`) 
-        VALUES
-    ('bx_facebook_connect_permalinks', 'on', 26, 'Enable friendly permalinks in facebook connect', 'checkbox', '', '', '0', '');
-
-    UPDATE `sys_profile_fields` SET `Max` = 500 WHERE `Name` = 'NickName' LIMIT 1;

+ 0 - 84
modules/boonex/facebook_connect/install/sql/uninstall.sql

@@ -1,84 +0,0 @@
-
-    DROP TABLE IF EXISTS `[db_prefix]accounts`;
-	DELETE FROM `sys_email_templates` WHERE `Name` = 't_fb_connect_password_generated';
-
-    --
-    -- Dumping data for table `sys_objects_auths`
-    --
-
-    DELETE FROM 
-        `sys_objects_auths` 
-    WHERE    
-        `Title` = '_bx_facebook';
- 
-    --
-    -- `sys_alerts_handlers` ;
-    --
-
-    SET @iHandlerId := (SELECT `id` FROM `sys_alerts_handlers`  WHERE `name`  =  'bx_facebook_connect');
-
-    DELETE FROM
-        `sys_alerts_handlers`
-    WHERE
-        `id`  = @iHandlerId;
-
-    --
-    -- `sys_alerts` ;
-    --
-
-    DELETE FROM 
-        `sys_alerts`
-    WHERE
-        `handler_id` =  @iHandlerId ;
-
-    --
-    -- need for compatibility with old style login, will need remove it in a feature version!
-    --
-
-	ALTER TABLE `Profiles` 
-		DROP INDEX `FacebookProfile`;
-
-    ALTER TABLE `Profiles`
-        DROP `FacebookProfile`;
-
-    -- 
-    -- `sys_menu_admin`;
-    --
-
-    DELETE FROM 
-        `sys_menu_admin` 
-    WHERE
-        `title` = '_bx_facebook';
-
-    --
-    -- `sys_options_cats` ;
-    --
-
-    SET @iKategId = (SELECT `id` FROM `sys_options_cats` WHERE `name` = 'Facebook connect' LIMIT 1);
-    DELETE FROM `sys_options_cats` WHERE `id` = @iKategId;
-
-    --
-    -- `sys_options` ;
-    --
-
-    DELETE FROM `sys_options` WHERE `kateg` = @iKategId;
-
-    --
-    -- permalink
-    --
-
-    DELETE FROM 
-        `sys_permalinks` 
-    WHERE
-        `standard`  = 'modules/?r=facebook_connect/';
-
-    --
-    -- settings
-    --
-
-    DELETE FROM 
-        `sys_options` 
-    WHERE
-        `Name` = 'bx_facebook_connect_permalinks'
-            AND
-        `kateg` = 26;

+ 0 - 32
modules/boonex/facebook_connect/request.php

@@ -1,32 +0,0 @@
-<?php
-
-    /***************************************************************************
-    *                            Dolphin Smart Community Builder
-    *                              -------------------
-    *     begin                : Mon Mar 23 2006
-    *     copyright            : (C) 2007 BoonEx Group
-    *     website              : http://www.boonex.com
-    * This file is part of Dolphin - Smart Community Builder
-    *
-    * Dolphin is free software; you can redistribute it and/or modify it under
-    * the terms of the GNU General Public License as published by the
-    * Free Software Foundation; either version 2 of the
-    * License, or  any later version.
-    *
-    * Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-    * without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-    * See the GNU General Public License for more details.
-    * You should have received a copy of the GNU General Public License along with Dolphin,
-    * see license.txt file; if not, write to marketing@boonex.com
-    ***************************************************************************/
-
-    require_once( BX_DIRECTORY_PATH_CLASSES . 'BxDolRequest.php' );
-
-    check_logged();
-
-    if ( empty($aRequest) || empty($aRequest[0]) ) {
-        BxDolRequest::processAsFile($aModule, $aRequest);
-    }
-    else {
-        BxDolRequest::processAsAction($aModule, $aRequest);
-    }

TEMPAT SAMPAH
modules/boonex/facebook_connect/templates/base/images/icons/facebook-icon_little.png


TEMPAT SAMPAH
modules/boonex/facebook_connect/templates/base/images/icons/facebook-small-logo.png


TEMPAT SAMPAH
modules/boonex/facebook_connect/templates/base/images/icons/wi-std.png


+ 0 - 1
modules/boonex/facebook_connect/templates/base/login_form.html

@@ -1 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?> <friends_getAppUsers_response xmlns="http://api.facebook.com/1.0/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://api.facebook.com/1.0/ http://api.facebook.com/1.0/facebook.xsd" list="true">  <uid>222333</uid>  <uid>1240079</uid> </friends_getAppUsers_response>

+ 0 - 3
modules/boonex/facebook_connect/templates/base/page_55.html

@@ -1,3 +0,0 @@
-<bx_include_auto:_sub_header.html />
-            __page_main_code__
-<bx_include_auto:_sub_footer.html />

+ 0 - 34
modules/boonex/google_search/classes/BxGSearchConfig.php

@@ -1,34 +0,0 @@
-<?
-/***************************************************************************
-*                            Dolphin Smart Community Builder
-*                              -------------------
-*     begin                : Mon Mar 23 2006
-*     copyright            : (C) 2007 BoonEx Group
-*     website              : http://www.boonex.com
-* This file is part of Dolphin - Smart Community Builder
-*
-* Dolphin is free software; you can redistribute it and/or modify it under
-* the terms of the GNU General Public License as published by the
-* Free Software Foundation; either version 2 of the
-* License, or  any later version.
-*
-* Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-* without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-* See the GNU General Public License for more details.
-* You should have received a copy of the GNU General Public License along with Dolphin,
-* see license.txt file; if not, write to marketing@boonex.com
-***************************************************************************/
-
-bx_import('BxDolConfig');
-
-class BxGSearchConfig extends BxDolConfig {
-
-    /**
-     * Constructor
-     */
-    function BxGSearchConfig($aModule) {
-        parent::BxDolConfig($aModule);
-    }
-}
-
-?>

+ 0 - 42
modules/boonex/google_search/classes/BxGSearchDb.php

@@ -1,42 +0,0 @@
-<?
-/***************************************************************************
-*                            Dolphin Smart Community Builder
-*                              -------------------
-*     begin                : Mon Mar 23 2006
-*     copyright            : (C) 2007 BoonEx Group
-*     website              : http://www.boonex.com
-* This file is part of Dolphin - Smart Community Builder
-*
-* Dolphin is free software; you can redistribute it and/or modify it under
-* the terms of the GNU General Public License as published by the
-* Free Software Foundation; either version 2 of the
-* License, or  any later version.
-*
-* Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-* without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-* See the GNU General Public License for more details.
-* You should have received a copy of the GNU General Public License along with Dolphin,
-* see license.txt file; if not, write to marketing@boonex.com
-***************************************************************************/
-
-bx_import('BxDolModuleDb');
-
-/*
- * Map module Data
- */
-class BxGSearchDb extends BxDolModuleDb {
-
-    /*
-     * Constructor.
-     */
-    function BxGSearchDb(&$oConfig) {
-        parent::BxDolModuleDb();
-        $this->_sPrefix = $oConfig->getDbPrefix();
-    }
-
-    function getSettingsCategory() {
-        return $this->getOne("SELECT `ID` FROM `sys_options_cats` WHERE `name` = 'Google Search' LIMIT 1");
-    }
-}
-
-?>

+ 0 - 158
modules/boonex/google_search/classes/BxGSearchModule.php

@@ -1,158 +0,0 @@
-<?php
-/***************************************************************************
-*                            Dolphin Smart Community Builder
-*                              -------------------
-*     begin                : Mon Mar 23 2006
-*     copyright            : (C) 2007 BoonEx Group
-*     website              : http://www.boonex.com
-* This file is part of Dolphin - Smart Community Builder
-*
-* Dolphin is free software; you can redistribute it and/or modify it under
-* the terms of the GNU General Public License as published by the
-* Free Software Foundation; either version 2 of the
-* License, or  any later version.
-*
-* Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-* without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-* See the GNU General Public License for more details.
-* You should have received a copy of the GNU General Public License along with Dolphin,
-* see license.txt file; if not, write to marketing@boonex.com
-***************************************************************************/
-
-function bx_gsearch_import ($sClassPostfix, $aModuleOverwright = array()) {
-    global $aModule;
-    $a = $aModuleOverwright ? $aModuleOverwright : $aModule;
-    if (!$a || $a['uri'] != 'google_search') {
-        $oMain = BxDolModule::getInstance('bx_google_search');
-        $a = $oMain->_aModule;
-    }
-    bx_import ($sClassPostfix, $a) ;
-}
-
-bx_import('BxDolModule');
-bx_import('BxDolPaginate');
-bx_import('BxDolAlerts');
-
-/**
- * Google Site Search module by BoonEx
- *
- * This module allow user to search the site using Google Site Search
- *
- *
- *
- * Profile's Wall:
- * no wall events
- *
- *
- *
- * Spy:
- * no spy events
- *
- *
- *
- * Memberships/ACL:
- * no acl's  - everybody can use it
- *
- *
- *
- * Service methods:
- *
- * Get search control html
- * @see BxGSearchModule::serviceGetSearchControl
- * BxDolService::call('google_search', 'get_search_control', array());
- *
- *
- *
- * Alerts:
- * no alerts
- *
- */
-class BxGSearchModule extends BxDolModule {
-
-    var $_iProfileId;
-
-    function BxGSearchModule(&$aModule) {
-        parent::BxDolModule($aModule);
-        $GLOBALS['aModule'] = $aModule;
-        $this->_iProfileId = $GLOBALS['logged']['member'] || $GLOBALS['logged']['admin'] ? $_COOKIE['memberID'] : 0;
-        $GLOBALS['oBxGSearchModule'] = &$this;
-    }
-
-    function actionHome () {
-        bx_gsearch_import ('PageMain');
-        $oPage = new BxGSearchPageMain ($this);
-        $this->_oTemplate->pageStart();
-        echo $oPage->getCode();
-        $this->_oTemplate->addJs ('http://www.google.com/jsapi');
-        $this->_oTemplate->addCss ('main.css');
-        $this->_oTemplate->pageCode(_t('_bx_gsearch'), false, false);
-    }
-
-    function actionAdministration () {
-
-        if (!$this->isAdmin()) {
-            $this->_oTemplate->displayAccessDenied ();
-            return;
-        }
-
-        $iId = $this->_oDb->getSettingsCategory('Google Search');
-        if(empty($iId)) {
-            $this->_oTemplate->displayPageNotFound ();
-            return;
-        }
-
-        $this->_oTemplate->pageStart();
-
-        bx_import('BxDolAdminSettings');
-
-        $mixedResult = '';
-        if(isset($_POST['save']) && isset($_POST['cat'])) {
-            $oSettings = new BxDolAdminSettings($iId);
-            $mixedResult = $oSettings->saveChanges($_POST);
-        }
-
-        $oSettings = new BxDolAdminSettings($iId);
-        $sResult = $oSettings->getForm();
-
-        if($mixedResult !== true && !empty($mixedResult))
-            $sResult = $mixedResult . $sResult;
-
-        $aVars = array (
-            'content' => $sResult,
-        );
-        echo $this->_oTemplate->adminBlock ($this->_oTemplate->parseHtmlByName('default_padding', $aVars), _t('_bx_gsearch_administration'));
-
-        $this->_oTemplate->addCssAdmin ('main.css');
-        $this->_oTemplate->addCssAdmin ('forms_adv.css');
-        $this->_oTemplate->pageCodeAdmin (_t('_bx_gsearch_administration'));
-    }
-
-    // ================================== service actions
-
-    /**
-     * Get search control html.
-     * @return html with google search control
-     */
-    function serviceGetSearchControl () {
-        $this->_oTemplate->addCss ('main.css');
-        $this->_oTemplate->addJs ('http://www.google.com/jsapi');
-        $a = parse_url ($GLOBALS['site']['url']);
-        $aVars = array (
-            'is_image_search' => 'on' == getParam('bx_gsearch_block_images') ? 1 : 0,
-            'is_tabbed_search' => 'on' == getParam('bx_gsearch_block_tabbed') ? 1 : 0,
-            'domain' => $a['host'],
-            'keyword' => '',
-            'suffix' => 'simple',
-            'separate_search_form' => 0,
-        );
-        return $this->_oTemplate->parseHtmlByName('search', $aVars);
-    }
-
-    // ================================== other functions
-
-    function isAdmin () {
-        return $GLOBALS['logged']['admin'] || $GLOBALS['logged']['moderator'];
-    }
-}
-
-?>

+ 0 - 58
modules/boonex/google_search/classes/BxGSearchPageMain.php

@@ -1,58 +0,0 @@
-<?php
-/***************************************************************************
-*                            Dolphin Smart Community Builder
-*                              -------------------
-*     begin                : Mon Mar 23 2006
-*     copyright            : (C) 2007 BoonEx Group
-*     website              : http://www.boonex.com
-* This file is part of Dolphin - Smart Community Builder
-*
-* Dolphin is free software; you can redistribute it and/or modify it under
-* the terms of the GNU General Public License as published by the
-* Free Software Foundation; either version 2 of the
-* License, or  any later version.
-*
-* Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-* without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-* See the GNU General Public License for more details.
-* You should have received a copy of the GNU General Public License along with Dolphin,
-* see license.txt file; if not, write to marketing@boonex.com
-***************************************************************************/
-
-bx_import('BxDolPageView');
-
-class BxGSearchPageMain extends BxDolPageView {
-
-    var $_oTemplate;
-    var $_oConfig;
-
-    function BxGSearchPageMain(&$oModule) {
-        $this->_oTemplate = $oModule->_oTemplate;
-        $this->_oConfig = $oModule->_oConfig;
-        parent::BxDolPageView('bx_gsearch');
-    }
-
-    function getBlockCode_SearchForm() {
-        $aVars = array (
-            'suffix' => 'adv',
-            'empty' => MsgBox(_t('_Empty')),
-        );
-        return $this->_oTemplate->parseHtmlByName('search_form', $aVars);
-    }
-
-    function getBlockCode_SearchResults() {
-        $this->_oTemplate->addJs ('http://www.google.com/jsapi');
-        $a = parse_url ($GLOBALS['site']['url']);
-        $aVars = array (
-            'is_image_search' => 'on' == getParam('bx_gsearch_separate_images') ? 1 : 0,
-            'is_tabbed_search' => 'on' == getParam('bx_gsearch_separate_tabbed') ? 1 : 0,
-            'domain' => $a['host'],
-            'keyword' => str_replace('"', '\\"', stripslashes($_GET['keyword'])),
-            'suffix' => 'adv',
-            'separate_search_form' => 1,
-        );
-        return $this->_oTemplate->parseHtmlByName('search', $aVars);
-    }
-}
-
-?>

+ 0 - 38
modules/boonex/google_search/classes/BxGSearchTemplate.php

@@ -1,38 +0,0 @@
-<?
-/***************************************************************************
-*                            Dolphin Smart Community Builder
-*                              -------------------
-*     begin                : Mon Mar 23 2006
-*     copyright            : (C) 2007 BoonEx Group
-*     website              : http://www.boonex.com
-* This file is part of Dolphin - Smart Community Builder
-*
-* Dolphin is free software; you can redistribute it and/or modify it under
-* the terms of the GNU General Public License as published by the
-* Free Software Foundation; either version 2 of the
-* License, or  any later version.
-*
-* Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-* without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-* See the GNU General Public License for more details.
-* You should have received a copy of the GNU General Public License along with Dolphin,
-* see license.txt file; if not, write to marketing@boonex.com
-***************************************************************************/
-
-bx_import ('BxDolTwigTemplate');
-
-/*
- * Map module View
- */
-class BxGSearchTemplate extends BxDolTwigTemplate {
-
-    /**
-     * Constructor
-     */
-    function BxGSearchTemplate(&$oConfig, &$oDb) {
-        parent::BxDolTwigTemplate($oConfig, $oDb);
-        $this->_iPageIndex = 401;
-    }
-}
-
-?>

+ 0 - 119
modules/boonex/google_search/install/config.php

@@ -1,119 +0,0 @@
-<?
-/***************************************************************************
-*                            Dolphin Smart Community Builder
-*                              -------------------
-*     begin                : Mon Mar 23 2006
-*     copyright            : (C) 2007 BoonEx Group
-*     website              : http://www.boonex.com
-* This file is part of Dolphin - Smart Community Builder
-*
-* Dolphin is free software; you can redistribute it and/or modify it under
-* the terms of the GNU General Public License as published by the
-* Free Software Foundation; either version 2 of the
-* License, or  any later version.
-*
-* Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-* without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-* See the GNU General Public License for more details.
-* You should have received a copy of the GNU General Public License along with Dolphin,
-* see license.txt file; if not, write to marketing@boonex.com
-***************************************************************************/
-
-$aConfig = array(
-    /**
-     * Main Section.
-     */
-	'type' => BX_DOL_MODULE_TYPE_MODULE,
-	'name' => 'bx_google_search',
-    'title' => 'Google Search',
-    'version' => '1.0.6',
-    'vendor' => 'Boonex',
-    'update_url' => '',
-
-    'compatible_with' => array(
-        '7.0.6'
-    ),
-
-    /**
-     * 'home_dir' and 'home_uri' - should be unique. Don't use spaces in 'home_uri' and the other special chars.
-     */
-    'home_dir' => 'boonex/google_search/',
-    'home_uri' => 'google_search',
-
-    'db_prefix' => 'bx_gsearch_',
-    'class_prefix' => 'BxGSearch',
-
-    /**
-     * Installation/Uninstallation Section.
-     */
-    'install' => array(
-        'show_introduction' => 0,
-        'change_permissions' => 0,
-        'execute_sql' => 1,
-        'update_languages' => 1,
-        'recompile_global_paramaters' => 1,
-        'recompile_main_menu' => 1,
-        'recompile_member_menu' => 0,
-        'recompile_site_stats' => 0,
-        'recompile_page_builder' => 1,
-        'recompile_profile_fields' => 0,
-        'recompile_comments' => 0,
-        'recompile_member_actions' => 0,
-        'recompile_tags' => 0,
-        'recompile_votes' => 0,
-        'recompile_categories' => 0,
-        'recompile_search' => 0,
-        'recompile_injections' => 0,
-        'recompile_permalinks' => 1,
-        'recompile_alerts' => 0,
-        'clear_db_cache' => 0,
-        'show_conclusion' => 0,
-    ),
-    'uninstall' => array (
-        'show_introduction' => 0,
-        'change_permissions' => 0,
-        'execute_sql' => 1,
-        'update_languages' => 1,
-        'recompile_global_paramaters' => 1,
-        'recompile_main_menu' => 1,
-        'recompile_member_menu' => 0,
-        'recompile_site_stats' => 0,
-        'recompile_page_builder' => 1,
-        'recompile_profile_fields' => 0,
-        'recompile_comments' => 0,
-        'recompile_member_actions' => 0,
-        'recompile_tags' => 0,
-        'recompile_votes' => 0,
-        'recompile_categories' => 0,
-        'recompile_search' => 0,
-        'recompile_injections' => 0,
-        'recompile_permalinks' => 1,
-        'recompile_alerts' => 0,
-        'clear_db_cache' => 0,
-        'show_conclusion' => 0,
-    ),
-
-    /**
-     * Category for language keys.
-     */
-    'language_category' => 'Boonex Site Search',
-
-    /**
-     * Permissions Section
-     */
-    'install_permissions' => array(),
-    'uninstall_permissions' => array(),
-
-    /**
-     * Introduction and Conclusion Section.
-     */
-    'install_info' => array(
-        'introduction' => '',
-        'conclusion' => ''
-    ),
-    'uninstall_info' => array(
-        'introduction' => '',
-        'conclusion' => ''
-    )
-);
-?>

+ 0 - 30
modules/boonex/google_search/install/installer.php

@@ -1,30 +0,0 @@
-<?php
-
-/***************************************************************************
-*                            Dolphin Smart Community Builder
-*                              -------------------
-*     begin                : Mon Mar 23 2006
-*     copyright            : (C) 2007 BoonEx Group
-*     website              : http://www.boonex.com
-* This file is part of Dolphin - Smart Community Builder
-*
-* Dolphin is free software; you can redistribute it and/or modify it under
-* the terms of the GNU General Public License as published by the
-* Free Software Foundation; either version 2 of the
-* License, or  any later version.
-*
-* Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-* without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-* See the GNU General Public License for more details.
-* You should have received a copy of the GNU General Public License along with Dolphin,
-* see license.txt file; if not, write to marketing@boonex.com
-***************************************************************************/
-
-bx_import("BxDolInstaller");
-
-class BxGSearchInstaller extends BxDolInstaller {
-    function BxGSearchInstaller($aConfig) {
-        parent::BxDolInstaller($aConfig);
-    }
-}
-?>

+ 0 - 34
modules/boonex/google_search/install/langs/en.php

@@ -1,34 +0,0 @@
-<?
-/***************************************************************************
-*                            Dolphin Smart Community Builder
-*                              -------------------
-*     begin                : Mon Mar 23 2006
-*     copyright            : (C) 2007 BoonEx Group
-*     website              : http://www.boonex.com
-* This file is part of Dolphin - Smart Community Builder
-*
-* Dolphin is free software; you can redistribute it and/or modify it under
-* the terms of the GNU General Public License as published by the
-* Free Software Foundation; either version 2 of the
-* License, or  any later version.
-*
-* Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-* without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-* See the GNU General Public License for more details.
-* You should have received a copy of the GNU General Public License along with Dolphin,
-* see license.txt file; if not, write to marketing@boonex.com
-***************************************************************************/
-
-$sLangCategory = 'BooneEx Google Search';
-
-$aLangContent = array(
-    '_bx_gsearch' => 'Google Site Search',
-    '_bx_gsearch_menu_title' => 'Google Site Search',
-    '_bx_gsearch_box_title' => 'Google Site Search',
-    '_bx_gsearch_box_title_search_form' => 'Google Site Search',
-    '_bx_gsearch_box_title_search_results' => 'Search Results',
-    '_bx_gsearch_administration' => 'Google Site Search Administration',
-    '_bx_gsearch_no_results' => 'No Results',
-);
-
-?>

+ 0 - 35
modules/boonex/google_search/install/sql/install.sql

@@ -1,35 +0,0 @@
-
--- page compose pages
-SET @iMaxOrder = (SELECT `Order` + 1 FROM `sys_page_compose_pages` ORDER BY `Order` DESC LIMIT 1);
-INSERT INTO `sys_page_compose_pages` (`Name`, `Title`, `Order`) VALUES ('bx_gsearch', 'Google Search', @iMaxOrder);
-
--- page compose blocks
-INSERT INTO `sys_page_compose` (`Page`, `PageWidth`, `Desc`, `Caption`, `Column`, `Order`, `Func`, `Content`, `DesignBox`, `ColWidth`, `Visible`, `MinWidth`) VALUES 
-    ('bx_gsearch', '998px', 'Search Form', '_bx_gsearch_box_title_search_form', '1', '0', 'SearchForm', '', '1', '30', 'non,memb', '0'),
-    ('bx_gsearch', '998px', 'Search Results', '_bx_gsearch_box_title_search_results', '2', '0', 'SearchResults', '', '1', '70', 'non,memb', '0'),
-    ('search_home', '998px', 'Google Search', '_bx_gsearch_box_title', 0, 0, 'PHP', 'return BxDolService::call(''google_search'', ''get_search_control'', array());', 1, 66, 'non,memb', 0);
-
--- permalinks
-INSERT INTO `sys_permalinks` VALUES (NULL, 'modules/?r=google_search/', 'm/google_search/', 'bx_gsearch_permalinks');
-
--- settings
-SET @iMaxOrder = (SELECT `menu_order` + 1 FROM `sys_options_cats` ORDER BY `menu_order` DESC LIMIT 1);
-INSERT INTO `sys_options_cats` (`name`, `menu_order`) VALUES ('Google Search', @iMaxOrder);
-SET @iCategId = (SELECT LAST_INSERT_ID());
-INSERT INTO `sys_options` (`Name`, `VALUE`, `kateg`, `desc`, `Type`, `check`, `err_text`, `order_in_kateg`, `AvailableValues`) VALUES
-('bx_gsearch_permalinks', 'on', 26, 'Enable friendly permalinks in Google Site Search', 'checkbox', '', '', '0', ''),
-('bx_gsearch_block_tabbed', 'on', @iCategId, 'Tabbed search results in block', 'checkbox', '', '', '0', ''),
-('bx_gsearch_block_images', 'on', @iCategId, 'Images search in block', 'checkbox', '', '', '0', ''),
-('bx_gsearch_separate_tabbed', 'on', @iCategId, 'Tabbed search results on separate page', 'checkbox', '', '', '0', ''),
-('bx_gsearch_separate_images', 'on', @iCategId, 'Images search on separate page', 'checkbox', '', '', '0', '');
-
-
--- admin menu
-SET @iMax = (SELECT MAX(`order`) FROM `sys_menu_admin` WHERE `parent_id` = '2');
-INSERT IGNORE INTO `sys_menu_admin` (`parent_id`, `name`, `title`, `url`, `description`, `icon`, `order`) VALUES
-(2, 'bx_gsearch', '_bx_gsearch', '{siteUrl}modules/?r=google_search/administration/', 'Google Site Search module by BoonEx', 'modules/boonex/google_search/|google.png', @iMax+1);
-
--- top menu
-SET @iCatOrder := (SELECT MAX(`Order`)+1 FROM `sys_menu_top` WHERE `Parent` = 138 ORDER BY `Order` DESC LIMIT 1);
-INSERT INTO `sys_menu_top`(`ID`, `Parent`, `Name`, `Caption`, `Link`, `Order`, `Visible`, `Target`, `Onclick`, `Check`, `Editable`, `Deletable`, `Active`, `Type`, `Picture`, `Icon`, `BQuickLink`, `Statistics`) VALUES
-(NULL, 138, 'Google Search', '_bx_gsearch_menu_title', 'modules/?r=google_search/', @iCatOrder, 'non,memb', '', '', '', 1, 1, 1, 'custom', 'bx_n_search_comm.png', '', 0, '');

+ 0 - 17
modules/boonex/google_search/install/sql/uninstall.sql

@@ -1,17 +0,0 @@
-
-DELETE FROM `sys_page_compose_pages` WHERE `Name` IN('bx_gsearch');
-DELETE FROM `sys_page_compose` WHERE `Page` IN('bx_gsearch');
-DELETE FROM `sys_page_compose` WHERE `Page` = 'search_home' AND `Desc` = 'Google Search';
-
-DELETE FROM `sys_permalinks` WHERE `standard` = 'modules/?r=google_search/';
-
-SET @iCategId = (SELECT `ID` FROM `sys_options_cats` WHERE `name` = 'Google Search' LIMIT 1);
-DELETE FROM `sys_options` WHERE `kateg` = @iCategId;
-DELETE FROM `sys_options_cats` WHERE `ID` = @iCategId;
-DELETE FROM `sys_options` WHERE `Name` = 'bx_gsearch_permalinks';
-
-DELETE FROM `sys_menu_admin` WHERE `name` = 'bx_gsearch';
-
-DELETE FROM `sys_menu_top` WHERE `Parent` = 138 AND `Name` = 'Google Search';
-
-

+ 0 - 29
modules/boonex/google_search/request.php

@@ -1,29 +0,0 @@
-<?
-/***************************************************************************
-*                            Dolphin Smart Community Builder
-*                              -------------------
-*     begin                : Mon Mar 23 2006
-*     copyright            : (C) 2007 BoonEx Group
-*     website              : http://www.boonex.com
-* This file is part of Dolphin - Smart Community Builder
-*
-* Dolphin is free software; you can redistribute it and/or modify it under
-* the terms of the GNU General Public License as published by the
-* Free Software Foundation; either version 2 of the
-* License, or  any later version.
-*
-* Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
-* without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-* See the GNU General Public License for more details.
-* You should have received a copy of the GNU General Public License along with Dolphin,
-* see license.txt file; if not, write to marketing@boonex.com
-***************************************************************************/
-
-require_once(BX_DIRECTORY_PATH_INC . 'profiles.inc.php');
-
-check_logged();
-
-bx_import('BxDolRequest');
-BxDolRequest::processAsAction($GLOBALS['aModule'], $GLOBALS['aRequest']);
-
-?>

+ 0 - 8
modules/boonex/google_search/templates/base/admin.html

@@ -1,8 +0,0 @@
-<script type="text/javascript">
-    <!--
-    $(document).ready(function() {
-        getHtmlData( 'bx_gsearch_settings', '__site_url__admin/global_settings.php?mode=ajax&cat=__settings_cat_id__&return_way=__page_url__' );
-    });
-    -->
-</script>
-<div id="bx_gsearch_settings">__loading__</div>

+ 0 - 12
modules/boonex/google_search/templates/base/css/main.css

@@ -1,12 +0,0 @@
-
-.bx_gsearch_container {
-    text-align:center;
-    margin:10px;
-    min-height:64px;
-    position:relative;
-}
-
-.bx_gsearch_container .gsc-control {
-    width:100%;
-    text-align:left;
-}

TEMPAT SAMPAH
modules/boonex/google_search/templates/base/images/icons/google.png


+ 0 - 3
modules/boonex/google_search/templates/base/page_401.html

@@ -1,3 +0,0 @@
-<bx_include_auto:_sub_header.html />
-    __page_main_code__
-<bx_include_auto:_sub_footer.html />

+ 0 - 42
modules/boonex/google_search/templates/base/search.html

@@ -1,42 +0,0 @@
-<div class="bx_gsearch_container" id="bx_gsearch__suffix__">
-    <div class="loading_ajax"><div class="loading_ajax_rotating"></div></div>
-</div>
-<script type="text/javascript">
-
-bx_loading('bx_gsearch__suffix__', true);
-
-google.load('search', '1');
-
-function OnLoad() {
-  // Create a search control
-  var searchControl = new google.search.SearchControl();
-
-  var webSearch = new google.search.WebSearch()
-  webSearch.setSiteRestriction('__domain__');
-  searchControl.addSearcher(webSearch);
-
-  if (__is_image_search__) {
-      var imageSearch = new google.search.ImageSearch();
-      imageSearch.setSiteRestriction('__domain__');
-      searchControl.addSearcher(imageSearch);
-  }
-
-  // draw in tabbed layout mode
-  var drawOptions = new google.search.DrawOptions();
-  if (__is_tabbed_search__)
-    drawOptions.setDrawMode(google.search.SearchControl.DRAW_MODE_TABBED);
-  if (__separate_search_form__)
-    drawOptions.setSearchFormRoot(document.getElementById("bx_gsearch_form__suffix__"));
-
-  // tell the searcher to draw itself and tell it where to attach
-  searchControl.draw(document.getElementById("bx_gsearch__suffix__"), drawOptions);
-  searchControl.setNoResultsString ("<bx_text:_bx_gsearch_no_results />");
-
-  // execute an inital search
-  if ("__keyword__".length > 0)
-    searchControl.execute("__keyword__");
-}
-
-google.setOnLoadCallback(OnLoad);
-
-</script>

+ 0 - 6
modules/boonex/google_search/templates/base/search_form.html

@@ -1,6 +0,0 @@
-<div class="bx_gsearch_container" id="bx_gsearch_form__suffix__">
-    <div class="loading_ajax"><div class="loading_ajax_rotating"></div></div>
-</div>
-<script type="text/javascript">
-    bx_loading('bx_gsearch__suffix__', true);
-</script>

+ 4 - 0
upgrade/files/.gitignore

@@ -0,0 +1,4 @@
+# Ignore everything in this directory
+*
+# Except this file
+!.gitignore

+ 0 - 10
upgrade/files/7.0.0-7.0.1/check.php

@@ -1,10 +0,0 @@
-<?php
-
-$mixCheckResult = 'Update can not be applied';
-
-if ('7.0.0' == $this->oDb->getOne("SELECT `VALUE` FROM `sys_options` WHERE `Name` = 'sys_tmp_version'"))
-    $mixCheckResult = true;
-
-return $mixCheckResult;
-
-?>

+ 0 - 31
upgrade/files/7.0.0-7.0.1/conclusion.html

@@ -1,31 +0,0 @@
-Automatic part of upgade is completed. Please do the following to complete upgrade process: <br />
-<ul>
-    <li>Clean <b>/cache/</b>, <b>/cache_public/</b> and <b>/tmp/</b> via FTP or SSH, leave only .htaccess file there if one exists</li>
-    <li>Recompile language files for all modules from admin panel -&gt; Tools -&gt; Modules</li>
-    <li>Recompile system language file from admin panel -&gt; Settings -&gt; Languages Settings</li>
-    <li>Recompile Orca Forum language file from admin panel -&gt; Modules -&gt; Orca Forum</li>
-    <li>Reinstall 'Profiler' module from admin panel -&gt; Tools -&gt; Modules (you can leave it uninstalled, but do install and uninstall)</li>
-    <li>
-        Set permissions for the following files:
-        <pre style="border:1px solid #060; color:#060; overflow:scroll;">
-chmod -v 666 ./flash/modules/chat/xml/config.xml
-chmod -v 666 ./flash/modules/im/xml/config.xml
-chmod -v 666 ./flash/modules/video/xml/config.xml
-chmod -v 666 ./flash/modules/video_comments/xml/config.xml
-        </pre>
-    </li>
-    <li>A/V Chat / Messenger / Video Player / Video Comments settings were reset, if you changed it before you need to update it again in Dolphin admin panel -&gt; Flash Apps -&gt; A/V Chat / Messenger / Video Player / Comments Video Player -&gt; Settings</li>
-    <li>Remove <b>/upgrade/</b> directory</li>
-    <li>
-        Change the following lines in <b>inc/header.inc.php</b> file:
-        <pre style="border:1px solid #060; color:#060; overflow:scroll;">
-$site['ver']               = '7.0';
-$site['build']             = '0';
-        </pre>
-        to the following:
-        <pre style="border:1px solid #060; color:#060; overflow:scroll;">
-$site['ver']               = '7.0';
-$site['build']             = '1';
-        </pre>
-    </li>
-</ul>

+ 0 - 32
upgrade/files/7.0.0-7.0.1/lang_en.php

@@ -1,32 +0,0 @@
-<?php
-
-$aLangContent = array(
-    '__Myanmar' => 'Myanmar',
-    '__Aland_Islands' => 'Aland Islands',
-    '__Saint_Barthelemy' => 'Saint Barthelemy',
-    '__Guernsey' => 'Guernsey',
-    '__Isle_of_Man' => 'Isle of Man',
-    '__Jersey' => 'Jersey',
-    '__Montenegro' => 'Montenegro',
-    '__Saint Martin_French_part' => 'Saint Martin (French part)',
-    '__Serbia' => 'Serbia',
-    '_FieldCaption_Misc_View' => 'Misc',
-    '_adm_box_cpt_lang_available' => 'Languages',
-    '_adm_box_cpt_lang_edit_language' => 'Edit Language',
-    '_adm_txt_settings_file_not_image' => 'The uploaded file is not an image',
-    '_adm_txt_langs_apply' => 'Search',
-    '_adm_txt_langs_files' => 'List',
-    '_adm_txt_mp_unconfirmed' => 'unconfirmed',
-    '_adm_txt_mp_rejected' => 'rejected',
-    '_adm_txt_mp_promotion' => 'Promotion',
-    '_adm_txt_mp_activation_sent' => 'Confirmation email messages were successfully sent',
-    '_sys_txt_sbs_empty_name_email' => 'You need to enter your name and correct email address.',
-    '_adm_mmail_Send_to_members_info' => '{0} members agreed to receive newslatters',
-    '_adm_fields_mandatory_desc' => 'It will display red asterisk near the field only. For real checking you need to fill in min/max values or custom check field.',
-    '_bad comment parent id' => 'bad comment parent id',
-    '_Please enter 3-2048 characters' => 'Please enter 3-2048 characters',
-    '_You need to select the mood' => 'You need to select the mood',
-    '_adm_box_cpt_featured_modules' => 'Featured Modules',
-);
-
-?>

+ 0 - 9
upgrade/files/7.0.0-7.0.1/modules/ads/lang_en.php

@@ -1,9 +0,0 @@
-<?php
-
-$aLangContent = array(
-    '_bx_ads_wall_added_new' => 'added new',
-    '_bx_ads_wall_photo' => 'ad',
-    '_bx_ads_category_warn' => 'please select category and subcategory',
-);
-
-?>

+ 0 - 7
upgrade/files/7.0.0-7.0.1/modules/ads/sql.sql

@@ -1,7 +0,0 @@
-
-UPDATE `sys_email_templates` SET `Body` = '<html><head></head><body style="font: 12px Verdana; color:#000000">\r\n<div style="border:1px solid #CCCCCC;">\r\n<div style="color:#666666; font-weight:bold; height:23px; padding:3px 0px 0px 6px; text-transform:uppercase;">\r\nCongratulations! <String1>.\r\n</div>\r\n<div style="padding:3px 3px 10px;">\r\nItem title: <Subject><br/>\r\nSeller`s Name: <NickName><br/>\r\nSeller`s email: <EmailS><br/><br/>\r\nBuyer Name: <NickNameB><br/>\r\nBuyer email: <EmailB><br/><br/>\r\nPrice details: <sCustDetails><br/><br/>\r\nLink to Item<br/>\r\n<a href="<ShowAdvLnk>"><ShowAdvLnk></a><br/><br/>\r\nContact the <Who> directly to arrange payment and delivery. To avoid fraud, we recommend dealing locally, avoiding Western Union and wire transfers.<br/><br/>\r\nThank you for using our site,<br/>\r\nP.S. If you ever need support or have comments for us, e-mail us at <site_email></div></div>\r\n</body></html>' WHERE `Name` = 't_BuyNow' AND `Body` = '<html><head></head><body style="font: 12px Verdana; color:#000000">\r\n<div style="border:1px solid #CCCCCC;">\r\n<div style="color:#666666; font-weight:bold; height:23px; padding:3px 0px 0px 6px; text-transform:uppercase;">\r\nCongratulations! <String1>.\r\n</div>\r\n<div style="padding:3px 3px 10px;">\r\nItem title: <Subject><br/>\r\nSeller`s Name: <NickName><br/>\r\nSeller`s email: <EmailS><br/><br/>\r\nBuyer Name: <NickNameB><br/>\r\nBuyer email: <EmailB><br/><br/>\r\nPrice details: <sCustDetails><br/><br/>\r\nLink to Item<br/>\r\n<a href="<ShowAdvLnk>"><ShowAdvLnk></a><br/><br/>\r\nContact the <Who> directly to arrange payment and delivery. To avoid fraud, we recommend dealing locally, avoiding Western Union and wire transfers.<br/><br/>\r\nThank you for using our site,<br/>\r\n<sPowDol><br/>\r\nP.S. If you ever need support or have comments for us, e-mail us at <site_email></div></div>\r\n</body></html>';
-
-UPDATE `sys_email_templates` SET `Body` = '<html><head></head><body style="font: 12px Verdana; color:#000000">\r\n<div style="border:1px solid #CCCCCC;">\r\n<div style="color:#666666; font-weight:bold; height:23px; padding:3px 0px 0px 6px; text-transform:uppercase;">\r\nCongratulations! <String1>.\r\n</div>\r\n<div style="padding:3px 3px 10px;">\r\nItem title: <Subject><br/>\r\nSeller`s Name: <NickName><br/>\r\nSeller`s email: <EmailS><br/><br/>\r\nBuyer Name: <NickNameB><br/>\r\nBuyer email: <EmailB><br/><br/>\r\nPrice details: <sCustDetails><br/><br/>\r\nLink to Item<br/>\r\n<a href="<ShowAdvLnk>"><ShowAdvLnk></a><br/><br/>\r\nContact the <Who> directly to arrange payment and delivery. To avoid fraud, we recommend dealing locally, avoiding Western Union and wire transfers.<br/><br/>\r\nThank you for using our site,<br/>\r\nP.S. If you ever need support or have comments for us, e-mail us at <site_email></div></div>\r\n</body></html>' WHERE  `Name` = 't_BuyNowS' AND `Body` = '<html><head></head><body style="font: 12px Verdana; color:#000000">\r\n<div style="border:1px solid #CCCCCC;">\r\n<div style="color:#666666; font-weight:bold; height:23px; padding:3px 0px 0px 6px; text-transform:uppercase;">\r\nCongratulations! <String1>.\r\n</div>\r\n<div style="padding:3px 3px 10px;">\r\nItem title: <Subject><br/>\r\nSeller`s Name: <NickName><br/>\r\nSeller`s email: <EmailS><br/><br/>\r\nBuyer Name: <NickNameB><br/>\r\nBuyer email: <EmailB><br/><br/>\r\nPrice details: <sCustDetails><br/><br/>\r\nLink to Item<br/>\r\n<a href="<ShowAdvLnk>"><ShowAdvLnk></a><br/><br/>\r\nContact the <Who> directly to arrange payment and delivery. To avoid fraud, we recommend dealing locally, avoiding Western Union and wire transfers.<br/><br/>\r\nThank you for using our site,<br/>\r\n<sPowDol><br/>\r\nP.S. If you ever need support or have comments for us, e-mail us at <site_email></div></div>\r\n</body></html>';
-
-UPDATE `sys_modules` SET `version` = '1.0.1' WHERE `uri` = 'ads' AND `version` = '1.0.0';
-

+ 0 - 13
upgrade/files/7.0.0-7.0.1/modules/articles/lang_en.php

@@ -1,13 +0,0 @@
-<?php
-
-$aLangContent = array(
-    '_articles_pcaption_tag' => 'Tag: {0}',
-    '_articles_pcaption_category' => 'Category: {0}',
-    '_articles_bcaption_tag' => 'Tag: {0}',
-    '_articles_bcaption_category' => 'Category: {0}',
-    '_articles_txt_comments' => 'Comments',
-    '_articles_txt_categories' => 'Categories',
-    '_articles_txt_tags' => 'Tags',
-);
-
-?>

+ 0 - 11
upgrade/files/7.0.0-7.0.1/modules/articles/sql.sql

@@ -1,11 +0,0 @@
-
-UPDATE `sys_page_compose` SET `Content` = 'return BxDolService::call(\'articles\', \'featured_block_index\', array(0, 0, false));' WHERE `Page` = 'index' AND `Content` = 'return BxDolService::call(\'articles\', \'featured_block\', array(0, 0, false));';
-
-UPDATE `sys_page_compose` SET `Content` = 'return BxDolService::call(\'articles\', \'archive_block_index\', array(0, 0, false));' WHERE `Page` = 'index' AND `Content` = 'return BxDolService::call(\'articles\', \'archive_block\', array(0, 0, false));';
-
-UPDATE `sys_page_compose` SET `Content` = 'return BxDolService::call(\'articles\', \'featured_block_member\', array(0, 0, false));' WHERE `Page` = 'member' AND `Content` = 'return BxDolService::call(\'articles\', \'featured_block\', array(0, 0, false));';
-
-UPDATE `sys_page_compose` SET `Content` = 'return BxDolService::call(\'articles\', \'archive_block_member\', array(0, 0, false));' WHERE `Page` = 'member' AND `Content` = 'return BxDolService::call(\'articles\', \'archive_block\', array(0, 0, false));';
-
-UPDATE `sys_modules` SET `version` = '1.0.1' WHERE `uri` = 'articles' AND `version` = '1.0.0';
-

+ 0 - 3
upgrade/files/7.0.0-7.0.1/modules/avatar/sql.sql

@@ -1,3 +0,0 @@
-
-UPDATE `sys_modules` SET `version` = '1.0.1' WHERE `uri` = 'avatar' AND `version` = '1.0.0';
-

+ 0 - 7
upgrade/files/7.0.0-7.0.1/modules/blogs/lang_en.php

@@ -1,7 +0,0 @@
-<?php
-
-$aLangContent = array(
-    '_bx_blog_post_view' => 'Post view',
-);
-
-?>

+ 0 - 18
upgrade/files/7.0.0-7.0.1/modules/blogs/sql.sql

@@ -1,18 +0,0 @@
-
-ALTER TABLE `[db_prefix]_posts` ADD FULLTEXT KEY `ftTags` (`Tags`);
-ALTER TABLE `[db_prefix]_posts` ADD FULLTEXT KEY `ftCategories` (`Categories`);
-
-ALTER TABLE `[db_prefix]_cmts` CHANGE `cmt_rate` `cmt_rate` INT( 11 ) NOT NULL DEFAULT '0';
-ALTER TABLE `[db_prefix]_cmts` CHANGE `cmt_rate_count` `cmt_rate_count` INT( 11 ) NOT NULL DEFAULT '0';
-
-UPDATE `sys_menu_top` SET `Caption` = '_bx_blog_post_view' WHERE `Name` = 'bx_blogpost_view' AND `Caption` = '_bx_blog_Posts';
-
-INSERT IGNORE INTO `sys_permalinks`(`standard`, `permalink`, `check`) VALUES
-('modules/boonex/blogs/blogs.php?action=all', 'blogs/all/', 'permalinks_blogs');
-
-SET @iGlCategID = (SELECT `kateg` FROM `sys_options` WHERE `Name` = 'bx_blogs_thumbsize');
-INSERT IGNORE INTO `sys_options` (`Name`, `VALUE`, `kateg`, `desc`, `Type`, `check`, `err_text`, `order_in_kateg`) VALUES
-('category_auto_app_bx_blogs', 'on', @iGlCategID, 'Auto-activation for categories after blog posts creation', 'checkbox', '', '', 9);
-
-UPDATE `sys_modules` SET `version` = '1.0.1' WHERE `uri` = 'blogs' AND `version` = '1.0.0';
-

+ 0 - 3
upgrade/files/7.0.0-7.0.1/modules/board/sql.sql

@@ -1,3 +0,0 @@
-
-UPDATE `sys_modules` SET `version` = '1.0.1' WHERE `uri` = 'board' AND `version` = '1.0.0';
-

+ 0 - 3
upgrade/files/7.0.0-7.0.1/modules/chat/sql.sql

@@ -1,3 +0,0 @@
-
-UPDATE `sys_modules` SET `version` = '1.0.1' WHERE `uri` = 'chat' AND `version` = '1.0.0';
-

+ 0 - 3
upgrade/files/7.0.0-7.0.1/modules/custom_rss/sql.sql

@@ -1,3 +0,0 @@
-
-UPDATE `sys_modules` SET `version` = '1.0.1' WHERE `uri` = 'custom_rss' AND `version` = '1.0.0';
-

+ 0 - 3
upgrade/files/7.0.0-7.0.1/modules/data_migration/sql.sql

@@ -1,3 +0,0 @@
-
-UPDATE `sys_modules` SET `version` = '1.0.1' WHERE `uri` = 'data_migration' AND `version` = '1.0.0';
-

+ 0 - 3
upgrade/files/7.0.0-7.0.1/modules/desktop/sql.sql

@@ -1,3 +0,0 @@
-
-UPDATE `sys_modules` SET `version` = '1.0.1' WHERE `uri` = 'desktop' AND `version` = '1.0.0';
-

+ 0 - 11
upgrade/files/7.0.0-7.0.1/modules/events/lang_en.php

@@ -1,11 +0,0 @@
-<?php
-
-$aLangContent = array(
-    '_bx_events_action_title_leave' => 'Leave',
-    '_bx_events_caption_browse_by_author_joined_events' => 'Browse Author Joined Events: ',
-    '_bx_events_event_leave_success' => 'You have successfully left this event',
-    '_bx_events_block_joined_events' => 'Joined Events',
-    '_bx_events_menu_view_comments' => 'Comments',
-);
-
-?>

+ 0 - 19
upgrade/files/7.0.0-7.0.1/modules/events/sql.sql

@@ -1,19 +0,0 @@
-
-DELETE FROM `sys_page_compose` WHERE `Page` = 'profile' AND `Desc` = 'Joined Events' AND `Caption` = '_bx_events_block_joined_events';
-INSERT INTO `sys_page_compose` (`Page`, `PageWidth`, `Desc`, `Caption`, `Column`, `Order`, `Func`, `Content`, `DesignBox`, `ColWidth`, `Visible`, `MinWidth`) VALUES 
-('profile', '998px', 'Joined Events', '_bx_events_block_joined_events', 0, 0, 'PHP', 'bx_import(''BxDolService''); return BxDolService::call(''events'', ''profile_block_joined'', array($this->oProfileGen->_iProfileID));', 1, 66, 'non,memb', 0);
-
-
-DELETE FROM `sys_objects_actions` WHERE `Type` = 'bx_events' AND `Caption` = '{TitleDelete}';
-DELETE FROM `sys_objects_actions` WHERE `Type` = 'bx_events' AND `Caption` = '{TitleJoin}';
-DELETE FROM `sys_objects_actions` WHERE `Type` = 'bx_events' AND `Caption` = '{AddToFeatured}';
-INSERT INTO `sys_objects_actions` (`Caption`, `Icon`, `Url`, `Script`, `Eval`, `Order`, `Type`) VALUES 
-    ('{TitleDelete}', 'modules/boonex/events/|action_block.png', '', 'getHtmlData( ''ajaxy_popup_result_div_{ID}'', ''{evalResult}'', false, ''post'');return false;', '$oConfig = $GLOBALS[''oBxEventsModule'']->_oConfig; return  BX_DOL_URL_ROOT . $oConfig->getBaseUri() . ''delete/{ID}'';', '1', 'bx_events'),
-    ('{TitleJoin}', 'modules/boonex/events/|user_add.png', '', 'getHtmlData( ''ajaxy_popup_result_div_{ID}'', ''{evalResult}'', false, ''post'');return false;', '$oConfig = $GLOBALS[''oBxEventsModule'']->_oConfig; return BX_DOL_URL_ROOT . $oConfig->getBaseUri() . ''join/{ID}/{iViewer}'';', '2', 'bx_events'),
-    ('{AddToFeatured}', 'modules/boonex/events/|star__plus.png', '', 'getHtmlData( ''ajaxy_popup_result_div_{ID}'', ''{evalResult}'', false, ''post'');return false;', '$oConfig = $GLOBALS[''oBxEventsModule'']->_oConfig; return BX_DOL_URL_ROOT . $oConfig->getBaseUri() . ''mark_featured/{ID}'';', 6, 'bx_events');
-
-
-UPDATE `sys_menu_top` SET `Link` = 'modules/?r=events/browse/user/{profileNick}|modules/?r=events/browse/joined/{profileNick}' WHERE `Name` = 'Events' AND `Parent` = 9 AND `Link` = 'modules/?r=events/browse/user/{profileNick}';
-
-UPDATE `sys_modules` SET `version` = '1.0.1' WHERE `uri` = 'events' AND `version` = '1.0.0';
-

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini