HomeHelpTrac

Changeset 8251


Ignore:
Timestamp:
01/05/09 22:59:11 (3 years ago)
Author:
Anton Lesnikov
Message:
  1. Chat module added, removed an old one.
  2. Removed an old modules mechanism.
  3. Request and Service classes for module engine.
Location:
trunk
Files:
4 added
4 deleted
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/change_status.php

    r7109 r8251  
    2222require_once( BX_DIRECTORY_PATH_INC . 'design.inc.php' ); 
    2323require_once( BX_DIRECTORY_PATH_INC . 'profiles.inc.php' ); 
    24 require_once( BX_DIRECTORY_PATH_INC . 'modules.inc.php' ); 
    2524require_once( BX_DIRECTORY_PATH_INC . 'tags.inc.php' ); 
    2625 
     
    6564                { 
    6665                    db_res( "UPDATE `Profiles` SET `Status` = 'Suspended' WHERE `ID` = '{$member['ID']}';" ); 
    67                      
    68                     modules_block($p_arr['ID']); 
    6966                } 
    7067            break; 
     
    7370                if ( $p_arr['Status'] == 'Suspended' ) 
    7471                { 
    75                     db_res( "UPDATE `Profiles` SET `Status` = 'Active' WHERE `ID` = {$member['ID']}" ); 
    76                      
    77                     // call modules to add user to modules 
    78                     $check_res = checkAction($member['ID'], ACTION_ID_USE_CHAT); 
    79                     if ( $check_res[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED ) 
    80                         modules_unblock($p_arr['ID'], 'chat'); 
    81                      
    82                     $check_res = checkAction($member['ID'], ACTION_ID_USE_FORUM); 
    83                     if ( $check_res[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED ) 
    84                         modules_unblock($p_arr['ID'], 'forum'); 
     72                    db_res( "UPDATE `Profiles` SET `Status` = 'Active' WHERE `ID` = {$member['ID']}" );                                      
    8573                } 
    8674            break; 
  • trunk/inc/admin.inc.php

    r8237 r8251  
    2121require_once( 'header.inc.php' ); 
    2222require_once( BX_DIRECTORY_PATH_INC . 'utils.inc.php' ); 
    23 require_once( BX_DIRECTORY_PATH_INC . 'modules.inc.php' ); 
    2423require_once( BX_DIRECTORY_PATH_INC . 'design.inc.php' ); 
    2524require_once( BX_DIRECTORY_PATH_INC . 'sharing.inc.php' ); 
    2625require_once( BX_DIRECTORY_PATH_INC . 'admin_design.inc.php' ); 
    27  
    28 //require_once( BX_DIRECTORY_PATH_CLASSES . 'BxDolBlogs.php' ); 
    29 require_once( BX_DIRECTORY_PATH_ROOT . 'modules/boonex/blogs/classes/BxBlogsModule.php'); 
    30  
    31 //require_once( BX_DIRECTORY_PATH_CLASSES . 'BxDolClassifieds.php' ); 
    32 require_once( BX_DIRECTORY_PATH_ROOT . 'modules/boonex/ads/classes/BxAdsModule.php'); 
     26require_once( BX_DIRECTORY_PATH_MODULES . 'boonex/blogs/classes/BxBlogsModule.php'); 
     27require_once( BX_DIRECTORY_PATH_MODULES . 'boonex/ads/classes/BxAdsModule.php'); 
    3328require_once( BX_DIRECTORY_PATH_CLASSES . 'BxDolEvents.php' ); 
    3429require_once( BX_DIRECTORY_PATH_CLASSES . 'BxDolSharedMedia.php' ); 
     
    10511046     
    10521047    if ( !getProfileInfo( $ID ) ) 
    1053         return false; 
    1054  
    1055     modules_del($ID); 
     1048        return false;    
    10561049 
    10571050    // create system event 
  • trunk/inc/classes/BxDolInstaller.php

    r8229 r8251  
    8383        $aResult = $this->_perform('install', 'Installation'); 
    8484        if($aResult['result']) { 
    85             db_res("INSERT INTO `sys_modules`(`title`, `vendor`, `path`, `uri`, `date`) VALUES ('" . $this->_aConfig['title'] . "', '" . $this->_aConfig['vendor'] . "', '" . $this->_aConfig['home_dir'] . "', '" . $this->_aConfig['home_uri'] . "', UNIX_TIMESTAMP())"); 
     85            db_res("INSERT INTO `sys_modules`(`title`, `vendor`, `path`, `uri`, `class_prefix`, `date`) VALUES ('" . $this->_aConfig['title'] . "', '" . $this->_aConfig['vendor'] . "', '" . $this->_aConfig['home_dir'] . "', '" . $this->_aConfig['home_uri'] . "', '" . $this->_aConfig['class_prefix'] . "', UNIX_TIMESTAMP())"); 
    8686            $iModuleId = (int)db_last_id(); 
    8787 
  • trunk/install/index.php

    r8236 r8251  
    132132define('BX_DIRECTORY_PATH_PLUGINS', \$dir['plugins']); 
    133133define('BX_DIRECTORY_PATH_DBCACHE', \$dir['inc'] . 'db_cached/' ); 
     134define('BX_DIRECTORY_PATH_MODULES', \$dir['root'] . 'modules/' ); 
    134135 
    135136define('DATABASE_HOST', \$db['host']); 
  • trunk/install/sql/v61.sql

    r8242 r8251  
    61806180 
    61816181INSERT INTO `MemActions` VALUES(1, 'send greetings', NULL); 
    6182 INSERT INTO `MemActions` VALUES(2, 'use chat', NULL); 
    61836182INSERT INTO `MemActions` VALUES(4, 'view profiles', NULL); 
    61846183INSERT INTO `MemActions` VALUES(5, 'use forum', NULL); 
     
    61896188INSERT INTO `MemActions` VALUES(10, 'use Ray instant messenger', NULL); 
    61906189INSERT INTO `MemActions` VALUES(11, 'use Ray video recorder', NULL); 
    6191 INSERT INTO `MemActions` VALUES(12, 'use Ray chat', NULL); 
    61926190INSERT INTO `MemActions` VALUES(13, 'use guestbook', NULL); 
    61936191INSERT INTO `MemActions` VALUES(14, 'view other members'' guestbooks', NULL); 
     
    84468444INSERT INTO `TopMenu` VALUES(29, 28, 'All Videos', '_All Videos', 'browseMedia.php?type=video|viewVideo.php', 0, 'non,memb', '', '', '', 1, 1, 1, 'custom', 1, 'bx_videos.png', 1, ''); 
    84478445INSERT INTO `TopMenu` VALUES(30, 28, 'Upload Video', '_Upload Video', 'uploadMedia.php?type=video', 1, 'memb', '', '', '', 1, 1, 1, 'custom', 0, 'bx_videos.png', 1, ''); 
    8448 INSERT INTO `TopMenu` VALUES(32, 0, 'Chat', '_Chat', 'chat.php', 11, 'non,memb', '', '', '', 1, 1, 1, 'top', 0, 'bx_chat.png', 1, ''); 
    84498446INSERT INTO `TopMenu` VALUES(33, 0, 'Boards', '_Boards', 'board.php', 10, 'non,memb', '', '', '', 1, 1, 1, 'top', 0, 'bx_boards.png', 1, ''); 
    84508447INSERT INTO `TopMenu` VALUES(38, 0, 'Music', '_Music', 'browseMedia.php?type=music|viewMusic.php', 5, 'non,memb', '', '', '', 1, 1, 1, 'top', 0, 'bx_music.png', 1, ''); 
     
    85028499INSERT INTO `TopMenu` VALUES(99, 5, 'Login', '_Login', 'member.php', 2, 'non', '', 'showItemEditForm(''login_div''); $( ''#login_div'' ).show().load( ''member.php?action=show_login_form&relocate='' + encodeURIComponent( window.location )  );return false;', '', 0, 1, 1, 'custom', 0, '', 0, ''); 
    85038500INSERT INTO `TopMenu` VALUES(100, 5, 'Main', '_Main', 'index.php|', 0, 'non,memb', '', '', '', 1, 1, 1, 'custom', 1, '', 0, ''); 
    8504  
     8501INSERT INTO `TopMenu` VALUES(101, 'Chat', '_chat_top_menu_item', 'm/chat/', 11, 'non,memb', '', '', '', 1, 1, 1, 'top', 0, 'bx_chat.png', 1, ''); 
    85058502-- -------------------------------------------------------- 
    85068503 
     
    87698766  `path` varchar(255) NOT NULL default '',   
    87708767  `uri` varchar(255) NOT NULL default '', 
     8768  `class_prefix` varchar(32) NOT NULL default '', 
    87718769  `date` int(11) unsigned NOT NULL default '0', 
    87728770  PRIMARY KEY  (`id`), 
     
    87788776-- Dumping data for table `sys_modules` 
    87798777-- 
    8780 INSERT INTO `sys_modules` (`title`, `vendor`, `path`, `uri`, `date`) VALUES ('Wall Module', 'Boonex', 'boonex/wall/', 'chat', UNIX_TIMESTAMP()); 
     8778INSERT INTO `sys_modules` (`title`, `vendor`, `path`, `uri`, `date`) VALUES ('Wall Module', 'Boonex', 'boonex/wall/', 'wall', 'BxWall', UNIX_TIMESTAMP()); 
    87818779 
    87828780-- 
  • trunk/modules/boonex/chat/classes/BxChatDb.php

    r8219 r8251  
    2121***************************************************************************/ 
    2222 
    23 require_once( BX_DIRECTORY_PATH_CLASSES . 'BxDolDb.php' ); 
     23require_once( BX_DIRECTORY_PATH_CLASSES . 'BxDolModuleDb.php' ); 
    2424 
    25 class BxChatDb extends BxDolDb {     
     25class BxChatDb extends BxDolModuleDb {   
    2626    var $_oConfig; 
    2727    /* 
     
    2929     */ 
    3030    function BxChatDb(&$oConfig) { 
    31         parent::BxDolDb(); 
     31        parent::BxDolModuleDb(); 
    3232         
    3333        $this->_oConfig = $oConfig; 
  • trunk/modules/boonex/chat/index.php

    r8229 r8251  
    1818***************************************************************************/ 
    1919 
    20 require_once( BX_DIRECTORY_PATH_INC . 'design.inc.php' ); 
    21 require_once( BX_DIRECTORY_PATH_ROOT . 'modules/boonex/chat/classes/BxChatModule.php'); 
     20require_once( BX_DIRECTORY_PATH_MODULES . $aModule['path'] . '/classes/' . $aModule['class_prefix'] . 'Module.php'); 
    2221 
    2322$iId = isset($_COOKIE['memberID']) ? (int)$_COOKIE['memberID'] : 0; 
    24 $oChat = new BxChatModule(); 
     23$iIndex = 57; 
    2524 
    26 $_page['name_index']    = 57; 
     25global $_page; 
     26global $_page_cont; 
     27 
     28$_page['name_index']    = $iIndex; 
    2729$_page['css_name']      = 'main.css'; 
    2830 
     
    3234$logged['member'] = member_auth(0); 
    3335 
    34 $_ni = $_page['name_index']; 
    35 $_page_cont[$_ni]['page_main_code'] = $oChat->getContent($iId); 
     36 
     37$oChat = new BxChatModule(); 
     38$_page_cont[$iIndex]['page_main_code'] = $oChat->getContent($iId); 
    3639 
    3740PageCode($oChat->_oTemplate); 
  • trunk/modules/boonex/chat/install/sql/install.sql

    r8219 r8251  
    1 INSERT INTO `TopMenu` (`Parent`, `Name`, `Caption`, `Link`, `Order`, `Visible`, `Target`, `Onclick`, `Check`, `Editable`, `Deletable`, `Active`, `Type`, `Strict`, `Picture`, `BQuickLink`, `Statistics`) VALUES(0, 'Chat', '_chat_top_menu_item', 'modules/boonex/chat/chat.php', 11, 'non,memb', '', '', '', 1, 1, 1, 'top', 0, 'bx_chat.png', 1, ''); 
     1INSERT INTO `TopMenu` (`Parent`, `Name`, `Caption`, `Link`, `Order`, `Visible`, `Target`, `Onclick`, `Check`, `Editable`, `Deletable`, `Active`, `Type`, `Strict`, `Picture`, `BQuickLink`, `Statistics`) VALUES(0, 'Chat', '_chat_top_menu_item', 'm/chat/', 11, 'non,memb', '', '', '', 1, 1, 1, 'top', 0, 'bx_chat.png', 1, ''); 
    22 
    33INSERT INTO `MemActions` SET `Name`='use chat'; 
  • trunk/modules/boonex/wall/classes/BxWallDb.php

    r7803 r8251  
    2121***************************************************************************/ 
    2222 
    23 require_once( BX_DIRECTORY_PATH_CLASSES . 'BxDolDb.php' ); 
     23require_once( BX_DIRECTORY_PATH_CLASSES . 'BxDolModuleDb.php' ); 
    2424 
    25 class BxWallDb extends BxDolDb {     
     25class BxWallDb extends BxDolModuleDb {   
    2626    var $_oConfig; 
    2727    /* 
     
    2929     */ 
    3030    function BxWallDb(&$oConfig) { 
    31         parent::BxDolDb(); 
     31        parent::BxDolModuleDb(); 
    3232         
    3333        $this->_oConfig = $oConfig; 
  • trunk/modules/index.php

    r8233 r8251  
    2121 
    2222    require_once("../inc/header.inc.php"); 
    23     require_once(BX_DIRECTORY_PATH_INC . "db.inc.php"); 
    24      
     23    require_once(BX_DIRECTORY_PATH_INC . "design.inc.php"); 
     24    require_once(BX_DIRECTORY_PATH_CLASSES . 'BxDolModuleDb.php'); 
    2525     
    2626    $aRequest = explode('/', $_GET['r']); 
    27     $aModule = db_arr("SELECT `id`, `title`, `vendor`, `path`, `uri`, `date` FROM `sys_modules` WHERE `uri`='" . $aRequest[0] . "' LIMIT 1");     
    28     $sRequest = $_SERVER['QUERY_STRING']; 
    2927     
    30     include(BX_DIRECTORY_PATH_ROOT . 'modules/' . $aModule['path'] . 'index.php'); 
     28    $oDb = new BxDolModuleDb(); 
     29    $aModule = $oDb->getModuleByUri(array_shift($aRequest)); 
     30 
     31    include(BX_DIRECTORY_PATH_MODULES . $aModule['path'] . 'request.php'); 
    3132?> 
  • trunk/periodic/cmd.php

    r7387 r8251  
    2323require_once( BX_DIRECTORY_PATH_INC . 'profiles.inc.php' ); 
    2424require_once( BX_DIRECTORY_PATH_INC . 'admin.inc.php' ); 
    25 require_once( BX_DIRECTORY_PATH_INC . 'modules.inc.php' ); 
    2625require_once( BX_DIRECTORY_PATH_INC . 'membership_levels.inc.php' ); 
    2726 
     
    147146} 
    148147 
    149  
    150  
    151 function modules_proceed() 
    152 { 
    153     // select all profiles and check who can't use chat or forum 
    154     $p_res = db_res( "SELECT `ID` FROM `Profiles`"); 
    155     while ( $p_arr = mysql_fetch_array($p_res) ) 
    156     { 
    157         $check_res = checkAction($p_arr['ID'], ACTION_ID_USE_CHAT); 
    158         if ( $check_res[CHECK_ACTION_RESULT] != CHECK_ACTION_RESULT_ALLOWED ) 
    159         { 
    160             modules_block($p_arr['ID'], 'chat'); 
    161         } 
    162         else  
    163         { 
    164             modules_unblock($p_arr['ID'], 'chat'); 
    165         } 
    166          
    167         $check_res = checkAction($p_arr['ID'], ACTION_ID_USE_FORUM); 
    168         if ( $check_res[CHECK_ACTION_RESULT] != CHECK_ACTION_RESULT_ALLOWED ) 
    169         { 
    170             modules_block($p_arr['ID'], 'forum'); 
    171         } 
    172         else  
    173         { 
    174             modules_unblock($p_arr['ID'], 'forum'); 
    175         }        
    176     } 
    177  
    178     echo "\n- Modules check -\n"; 
    179     echo "Profiles processed successfully\n"; 
    180 } 
    181  
    182148// ------------- 
    183149 
     
    247213        if ( $current_membership_arr['ID'] != $last_membership_arr['ID'] ) 
    248214        { 
    249             modules_update($row['ID']); // Handle membership level change 
    250215            if ($further_membership_arr['ID'] == MEMBERSHIP_ID_STANDARD)         
    251216            { 
     
    289254clean_database(); 
    290255 
    291 modules_proceed(); 
    292  
    293256finish(); 
    294257 
Note: See TracChangeset for help on using the changeset viewer.