function MlClonetwoPageFields($iAreaID)
 {
     global $site;
     $this->sCacheFile = BX_DIRECTORY_PATH_DBCACHE . 'db_' . 'ml_clonetwo_fields' . '_' . md5($site['ver'] . $site['build'] . $site['url']) . '.php';
     $this->iAreaID = $iAreaID;
     switch ($this->iAreaID) {
         case 1:
             $this->areaPageName = 'Join';
             break;
         case 2:
             $this->areaPageName = 'Edit';
             break;
         case 5:
             $this->areaPageName = 'View';
             break;
     }
     if (!$this->loadCache()) {
         return false;
     }
     $oModuleDb = new BxDolModuleDb();
     $this->_aModule = $oModuleDb->getModuleByUri('clonetwo');
     $this->_oMain = new MlClonetwoModule($this->_aModule);
     $sDelimeter = getParam('ml_clonetwo_multi_divider');
     $this->_sDelimeter = $sDelimeter ? $sDelimeter : ';';
     $this->_iProfileId = getLoggedId();
     $this->_aMedia = array('photos' => array('post' => 'ready_images', 'upload_func' => 'uploadPhotos', 'tag' => BX_WELLS_PHOTOS_TAG, 'cat' => BX_WELLS_PHOTOS_CAT, 'thumb' => 'thumb', 'module' => 'photos', 'title_upload_post' => 'images_titles', 'title_upload' => _t('_ml_clonetwo_form_caption_file_title'), 'service_method' => 'get_photo_array'), 'videos' => array('post' => 'ready_videos', 'upload_func' => 'uploadVideos', 'tag' => BX_WELLS_VIDEOS_TAG, 'cat' => BX_WELLS_VIDEOS_CAT, 'thumb' => false, 'module' => 'videos', 'title_upload_post' => 'videos_titles', 'title_upload' => _t('_ml_clonetwo_form_caption_file_title'), 'service_method' => 'get_video_array'), 'sounds' => array('post' => 'ready_sounds', 'upload_func' => 'uploadSounds', 'tag' => BX_WELLS_SOUNDS_TAG, 'cat' => BX_WELLS_SOUNDS_CAT, 'thumb' => false, 'module' => 'sounds', 'title_upload_post' => 'sounds_titles', 'title_upload' => _t('_ml_clonetwo_form_caption_file_title'), 'service_method' => 'get_music_array'), 'files' => array('post' => 'ready_files', 'upload_func' => 'uploadFiles', 'tag' => BX_WELLS_FILES_TAG, 'cat' => BX_WELLS_FILES_CAT, 'thumb' => false, 'module' => 'files', 'title_upload_post' => 'files_titles', 'title_upload' => _t('_ml_clonetwo_form_caption_file_title'), 'service_method' => 'get_file_array'));
 }
예제 #2
0
 function processing()
 {
     $oModules = new BxDolModuleDb();
     $aModules = $oModules->getModules();
     $aResult = array();
     foreach ($aModules as $aModule) {
         $aCheckInfo = BxDolInstallerUi::checkForUpdates($aModule);
         if (isset($aCheckInfo['version'])) {
             $aResult[] = _t('_adm_txt_modules_update_text_ext', $aModule['title'], $aCheckInfo['version']);
         }
     }
     if (empty($aResult)) {
         return;
     }
     $aAdmins = $GLOBALS['MySQL']->getAll("SELECT * FROM `Profiles` WHERE `Role`&" . BX_DOL_ROLE_ADMIN . "<>0 AND `EmailNotify`='1'");
     if (empty($aAdmins)) {
         return;
     }
     $oEmailTemplate = new BxDolEmailTemplates();
     $sMessage = implode('<br />', $aResult);
     foreach ($aAdmins as $aAdmin) {
         $aTemplate = $oEmailTemplate->getTemplate('t_ModulesUpdates', $aAdmin['ID']);
         sendMail($aAdmin['Email'], $aTemplate['Subject'], $aTemplate['Body'], $aAdmin['ID'], array('MessageText' => $sMessage));
     }
 }
예제 #3
0
 function __construct($aCustomForm)
 {
     if (isset($aCustomForm['inputs']['allow_post_in_forum_to']['type'])) {
         $oModuleDb = new BxDolModuleDb();
         if (!$oModuleDb->getModuleByUri('forum')) {
             $aCustomForm['inputs']['allow_post_in_forum_to']['type'] = 'hidden';
         }
     }
     parent::__construct($aCustomForm);
 }
예제 #4
0
 public static function call($mixed, $sMethod, $aParams = array(), $sClass = 'Module')
 {
     $oDb = new BxDolModuleDb();
     if (is_string($mixed)) {
         $aModule = $oDb->getModuleByUri($mixed);
     } else {
         $aModule = $oDb->getModuleById($mixed);
     }
     return empty($aModule) ? '' : BxDolRequest::processAsService($aModule, $sMethod, $aParams, $sClass);
 }
예제 #5
0
 function BxDolFormMedia($aCustomForm)
 {
     if (isset($aCustomForm['inputs']['allow_post_in_forum_to']['type'])) {
         $oModuleDb = new BxDolModuleDb();
         if (!$oModuleDb->getModuleByUri('forum')) {
             $aCustomForm['inputs']['allow_post_in_forum_to']['type'] = 'hidden';
         }
     }
     parent::BxTemplFormView($aCustomForm);
 }
예제 #6
0
 function getBlockCode_ForumFeed()
 {
     if (!$this->_oMain->isAllowedReadForum($this->aDataEntry)) {
         return '';
     }
     $oModuleDb = new BxDolModuleDb();
     if (!$oModuleDb->getModuleByUri('forum')) {
         return '';
     }
     $sRssId = 'forum|' . $this->_oConfig->getUri() . '|' . rawurlencode($this->aDataEntry[$this->_oDb->_sFieldUri]);
     return '<div class="RSSAggrCont" rssid="' . $sRssId . '" rssnum="8" member="' . getLoggedId() . '">' . $GLOBALS['oFunctions']->loadingBoxInline() . '</div>';
 }
예제 #7
0
 public function isActive()
 {
     if (empty($this->_sActiveUri)) {
         return false;
     }
     bx_import('BxDolModuleDb');
     $oModuleDb = new BxDolModuleDb();
     if (!$oModuleDb->isModule($this->_sActiveUri)) {
         return false;
     }
     return true;
 }
function getMemberMenuAdsList($iID)
{
    $oMemberMenu = bx_instance('BxDolMemberMenu');
    $oModuleDb = new BxDolModuleDb();
    $aModule = $oModuleDb->getModuleByUri('ads');
    $oAds = new BxAdsModule($aModule);
    $sAdsMainLink = $oAds->bUseFriendlyLinks ? BX_DOL_URL_ROOT . 'ads/my_page/' : "{$oAds->sCurrBrowsedFile}?action=my_page";
    $iMyAdsCnt = $oAds->_oDb->getMemberAdsCnt($iID);
    // language keys;
    $aLanguageKeys = array('ads' => _t('_bx_ads_Ads'));
    // fill all necessary data;
    $aLinkInfo = array('item_img_src' => $oAds->_oTemplate->getIconUrl('ads.png'), 'item_img_alt' => $aLanguageKeys['ads'], 'item_link' => $sAdsMainLink, 'item_onclick' => null, 'item_title' => $aLanguageKeys['ads'], 'extra_info' => $iMyAdsCnt);
    return $oMemberMenu->getGetExtraMenuLink($aLinkInfo);
}
예제 #9
0
 function __construct(&$oConfig)
 {
     parent::__construct();
     $this->_oConfig = $oConfig;
     $this->_sTable = $oConfig->sTableName;
     $this->sTablePrefix = $oConfig->sTablePrefix;
 }
예제 #10
0
 function BxPollDb(&$oConfig)
 {
     parent::BxDolModuleDb();
     $this->_oConfig = $oConfig;
     $this->_sTable = $oConfig->sTableName;
     $this->sTablePrefix = $oConfig->sTablePrefix;
 }
예제 #11
0
 function __construct(&$oConfig)
 {
     parent::__construct($oConfig);
     $this->_oConfig = $oConfig;
     $this->_sTableInvites = $this->_sPrefix . 'invites';
     $this->_sTableRequests = $this->_sPrefix . 'requests';
 }
예제 #12
0
 public function __construct(&$oConfig)
 {
     parent::__construct($oConfig);
     $this->_oConfig = $oConfig;
     $this->_sTable = $this->_sPrefix . 'events';
     $this->_sTableHandlers = $this->_sPrefix . 'handlers';
 }
예제 #13
0
 function actionCheckPayment($bInstall = true)
 {
     if (!$bInstall) {
         return BX_DOL_INSTALLER_SUCCESS;
     }
     $aError = array('code' => BX_DOL_INSTALLER_FAILED, 'content' => _t('_adm_txt_modules_wrong_dependency_install_payment'));
     $sPayment = getParam('sys_default_payment');
     if (empty($sPayment)) {
         return $aError;
     }
     $oModuleDb = new BxDolModuleDb();
     $aPayment = $oModuleDb->getModuleByUri($sPayment);
     if (empty($aPayment) || !is_array($aPayment)) {
         return $aError;
     }
     return BX_DOL_INSTALLER_SUCCESS;
 }
예제 #14
0
 function BxDolFilesDb(&$oConfig)
 {
     parent::BxDolModuleDb($oConfig);
     $this->_oConfig =& $oConfig;
     $this->iViewer = getLoggedId();
     $this->aFileFields = array('medID' => 'ID', 'Categories' => 'Categories', 'medProfId' => 'Owner', 'medTitle' => 'Title', 'medUri' => 'Uri', 'medDesc' => 'Description', 'medTags' => 'Tags', 'medDate' => 'Date', 'medViews' => 'Views', 'Approved' => 'Status', 'Featured' => 'Featured', 'Rate' => 'Rate', 'RateCount' => 'RateCount');
     $this->aFavoriteFields = array('fileId' => 'ID', 'ownerId' => 'Profile', 'favDate' => 'Date');
 }
예제 #15
0
 function getNotInstalled($sResult)
 {
     //--- Get Items ---//
     $oModules = new BxDolModuleDb();
     $aModules = $oModules->getModules();
     $aInstalled = array();
     foreach ($aModules as $aModule) {
         $aInstalled[] = $aModule['path'];
     }
     $aNotInstalled = array();
     $sPath = BX_DIRECTORY_PATH_ROOT . 'modules/';
     if ($rHandleVendor = opendir($sPath)) {
         while (($sVendor = readdir($rHandleVendor)) !== false) {
             if (substr($sVendor, 0, 1) == '.' || !is_dir($sPath . $sVendor)) {
                 continue;
             }
             if ($rHandleModule = opendir($sPath . $sVendor)) {
                 while (($sModule = readdir($rHandleModule)) !== false) {
                     if (!is_dir($sPath . $sVendor . '/' . $sModule) || substr($sModule, 0, 1) == '.' || in_array($sVendor . '/' . $sModule . '/', $aInstalled)) {
                         continue;
                     }
                     $sConfigPath = $sPath . $sVendor . '/' . $sModule . '/install/config.php';
                     if (!file_exists($sConfigPath)) {
                         continue;
                     }
                     include $sConfigPath;
                     $aNotInstalled[$aConfig['title']] = array('name' => $aConfig['home_uri'], 'value' => $aConfig['home_dir'], 'title' => _t('_adm_txt_modules_title_module', $aConfig['title'], !empty($aConfig['version']) ? $aConfig['version'] : $this->_sDefVersion, $aConfig['vendor']), 'bx_if:update' => array('condition' => false, 'content' => array()), 'bx_if:latest' => array('condition' => false, 'content' => array()));
                 }
                 closedir($rHandleModule);
             }
         }
         closedir($rHandleVendor);
     }
     ksort($aNotInstalled);
     //--- Get Controls ---//
     $aButtons = array('modules-install' => _t('_adm_btn_modules_install'), 'modules-delete' => _t('_adm_btn_modules_delete'));
     $sControls = BxTemplSearchResult::showAdminActionsPanel('modules-not-installed-form', $aButtons, 'pathes');
     if (!empty($sResult)) {
         $sResult = MsgBox(_t($sResult), 3);
     }
     return $sResult . $GLOBALS['oAdmTemplate']->parseHtmlByName('modules_list.html', array('type' => 'not-installed', 'bx_repeat:items' => $aNotInstalled, 'controls' => $sControls));
 }
예제 #16
0
 function checkForUpdatesByPath($sPath)
 {
     bx_import('BxDolModuleDb');
     $oModuleDb = new BxDolModuleDb();
     $aModule = $oModuleDb->getModulesBy(array('type' => 'path', 'value' => $sPath));
     $aResult = self::checkForUpdates($aModule);
     $aResult['content'] = $this->_parseUpdate($aResult);
     return $aResult;
 }
 function MlModCreatorDb(&$oConfig)
 {
     parent::BxDolModuleDb();
     $this->_sPrefix = $oConfig->getDbPrefix();
 }
예제 #18
0
 function __construct(&$oConfig)
 {
     parent::__construct();
     $this->_oConfig = $oConfig;
 }
 /**
  * Function will generate chat block for current member ;
  *
  * @param  : $iSender (integer)     - sender member's Id;
  * @return : (array);
  */
 function getChatBox($iSender)
 {
     global $oFunctions;
     $iSender = (int) $iSender;
     $oModuleDb = new BxDolModuleDb();
     $oUserStatus = new BxDolUserStatusView();
     $sMemberThumb = $oFunctions->getMemberThumbnail($iSender, 'none');
     $sMemberIcon = $oFunctions->getMemberIcon($iSender, 'none', false, '_plain');
     $aSenderInfo = getProfileInfo($iSender);
     $sSenderLink = getProfileLink($iSender);
     $sStatusIcon = $oUserStatus->getStatusIcon($iSender);
     // language keys;
     $aLanguageKeys = array('minimize' => _t('_simple_messenger_minimize_button'), 'close' => _t('_simple_messenger_close_button'), 'video_mess' => _t('_simple_messenger_switch_to_video'));
     // contain data for sender block;
     $aSenderBlock = array('sender_thumb' => $sMemberThumb, 'sender_link' => $sSenderLink, 'status_text' => $aSenderInfo['UserStatusMessage'], 'sender_nick' => getNickName($aSenderInfo['ID']), 'reduce_title' => $aLanguageKeys['minimize'], 'close_title' => $aLanguageKeys['close'], 'history_window_id' => $this->aCoreSettings['history_block_prefix'] . $iSender, 'sender_id' => $iSender, 'bx_if:video_messenger' => array('condition' => $oModuleDb->isModule('messenger'), 'content' => array('sender_id' => $this->iLoggedMemberId, 'sender_passw' => getPassword($this->iLoggedMemberId), 'recipient_id' => $iSender, 'video_messenger' => $aLanguageKeys['video_mess'])));
     $aMessagesList = $this->getMessagesHistory($this->iLoggedMemberId, $iSender, 0, false);
     // process nick name;
     $sNickName = getNickName($aSenderInfo['ID']);
     if (mb_strlen($sNickName) > $this->iMaxNickLength) {
         $sNickName = mb_substr($sNickName, 0, $this->iMaxNickLength) . '...';
     }
     $aTemplateKeys = array('block_indent' => $this->sMemberMenuPosition == 'bottom' ? 'bottom_indent' : 'top_indent', 'chat_block_position' => $this->sMemberMenuPosition == 'bottom' ? 'chat_block_bottom_position' : 'chat_block_top_position', 'sender_nick' => $sNickName, 'sender_icon' => $sMemberIcon, 'member_status' => $sStatusIcon, 'history_window_id' => $this->aCoreSettings['history_block_prefix'] . $iSender, 'history_block_position' => $this->sMemberMenuPosition == 'bottom' ? 'history_bottom_position' : 'history_top_position', 'recipient_id' => $iSender, 'bx_if:menu_pos_top' => array('condition' => $this->sMemberMenuPosition == 'bottom', 'content' => $aSenderBlock), 'bx_if:menu_pos_bottom' => array('condition' => $this->sMemberMenuPosition != 'bottom', 'content' => $aSenderBlock), 'messages' => $aMessagesList['messages_list']);
     // generate the chat box's content;
     $sOutputCode = $this->_oTemplate->parseHtmlByName('chat_block.html', $aTemplateKeys);
     $aRetArray = array('chat_box' => $sOutputCode, 'last_message' => $aMessagesList['last_message'], 'count_messages' => $aMessagesList['count_messages']);
     return $aRetArray;
 }
예제 #20
0
 function BxDskDb(&$oConfig)
 {
     parent::BxDolModuleDb();
 }
예제 #21
0
 /**
  * Function will generate list of member's friends ;
  *
  * @param  : $iMemberId (integer) - member's Id;
  * @return : Html presentation data;
  */
 function get_member_menu_friends_list($iMemberId = 0)
 {
     global $oFunctions;
     $iMemberId = (int) $iMemberId;
     $iOnlineTime = (int) getParam('member_online_time');
     // define the member's menu position ;
     $sExtraMenuPosition = isset($_COOKIE['menu_position']) ? $_COOKIE['menu_position'] : getParam('ext_nav_menu_top_position');
     $aLanguageKeys = array('requests' => _t('_Friend Requests'), 'online' => _t('_Online Friends'));
     // get all friends requests ;
     $iFriendsRequests = getFriendRequests($iMemberId);
     $iOnlineFriends = getFriendNumber($iMemberId, 1, $iOnlineTime);
     // try to generate member's messages list ;
     $sWhereParam = "AND p.`DateLastNav` > SUBDATE(NOW(), INTERVAL " . $iOnlineTime . " MINUTE)";
     $aAllFriends = getMyFriendsEx($iMemberId, $sWhereParam, 'last_nav_desc', "LIMIT 5");
     $oModuleDb = new BxDolModuleDb();
     $sVideoMessengerImgPath = $GLOBALS['oSysTemplate']->getIconUrl('video.png');
     $sMessengerTitle = _t('_Chat');
     foreach ($aAllFriends as $iFriendID => $aFriendsPrm) {
         $aMemberInfo = getProfileInfo($iFriendID);
         $sThumb = $oFunctions->getMemberIcon($aMemberInfo['ID'], 'none');
         $sHeadline = mb_strlen($aMemberInfo['UserStatusMessage']) > 40 ? mb_substr($aMemberInfo['UserStatusMessage'], 0, 40) . '...' : $aMemberInfo['UserStatusMessage'];
         $aFriends[] = array('profile_link' => getProfileLink($iFriendID), 'profile_nick' => $aMemberInfo['NickName'], 'profile_id' => $iFriendID, 'thumbnail' => $sThumb, 'head_line' => $sHeadline, 'bx_if:video_messenger' => array('condition' => $oModuleDb->isModule('messenger'), 'content' => array('sender_id' => $iMemberId, 'sender_passw' => getPassword($iMemberId), 'recipient_id' => $iFriendID, 'video_img_src' => $sVideoMessengerImgPath, 'messenger_title' => $sMessengerTitle)));
     }
     $aExtraSection = array('friends_request' => $aLanguageKeys['requests'], 'request_count' => $iFriendsRequests, 'ID' => $iMemberId, 'online_friends' => $aLanguageKeys['online'], 'online_count' => $iOnlineFriends);
     // fill array with needed keys ;
     $aTemplateKeys = array('bx_if:menu_position_bottom' => array('condition' => $sExtraMenuPosition == 'bottom', 'content' => $aExtraSection), 'bx_if:menu_position_top' => array('condition' => $sExtraMenuPosition == 'top' || $sExtraMenuPosition == 'static', 'content' => $aExtraSection), 'bx_repeat:friend_list' => $aFriends);
     $sOutputCode = $GLOBALS['oSysTemplate']->parseHtmlByName('view_friends_member_menu_friends_list.html', $aTemplateKeys);
     return $sOutputCode;
 }
 function savePage()
 {
     $aDiff = $this->getDiffValues(0);
     list($aUpd, $aMedia) = $this->oPF->getPageFromValues($aDiff);
     $sDelimeter = getParam('ml_clonetwo_multi_divider');
     $sDelimeter = $sDelimeter ? $sDelimeter : ';';
     if ($aDiff['title']) {
         $aUpd['uri'] = uriGenerate($aDiff['title'], 'ml_clonetwo_main', 'title');
     }
     $sTitle = $aDiff['title'] ? $aDiff['title'] : db_value("SELECT `title` FROM `ml_clonetwo_main` WHERE `id` = {$this->iPageID} LIMIT 1");
     if (!empty($aMedia)) {
         foreach ($aMedia as $sKey => $sValue) {
             $aMediaData = explode($sDelimeter, $aUpd[$sValue]);
             switch ($sKey) {
                 case 'photo':
                     $sTable = 'ml_clonetwo_images';
                     $iIdField = 'entry_id';
                     $iMedIdField = 'media_id';
                     if ($_POST['thumb_radio']) {
                         db_res("UPDATE `ml_clonetwo_main` SET `thumb` = {$_POST['thumb_radio']} WHERE `id` = {$this->iPageID} LIMIT 1");
                     }
                     if (!empty($_POST[$sValue . '_check_photos'])) {
                         foreach ($_POST[$sValue . '_check_photos'] as $sValue) {
                             if ($sValue) {
                                 db_res("DELETE FROM `{$sTable}` WHERE `{$iIdField}` = {$this->iPageID} AND `{$iMedIdField}` = {$sValue} LIMIT 1");
                             }
                         }
                     }
                     if (BxDolRequest::serviceExists("photos", "perform_photo_upload", 'Uploader')) {
                         $i = 0;
                         foreach ($aMediaData as $sData) {
                             $aInfo = array('medTitle' => $_POST[$sValue . '_title_photos'][$i] ? $_POST[$sValue . '_title_photos'][$i] : $_FILES[$sValue]['name'][$i], 'Categories' => array($aUpd['title'] . ' ' . _t("_bx_{$sKey}s")), 'album' => _t('_ml_clonetwo_photo_album', $aUpd['title']));
                             if ($sData) {
                                 $this->looper();
                                 $iMediaId = BxDolService::call("photos", "perform_photo_upload", array($GLOBALS['dir']['tmp'] . $sData, $aInfo, false), 'Uploader');
                                 if ($iMediaId) {
                                     @unlink($GLOBALS['dir']['tmp'] . $sData);
                                     if (db_value("SHOW TABLES LIKE '{$sTable}'")) {
                                         db_res("INSERT INTO `{$sTable}` SET `{$iIdField}` = {$this->iPageID}, `{$iMedIdField}` = {$iMediaId}");
                                     }
                                     if (!db_value("SELECT `thumb` FROM `ml_clonetwo_main` WHERE `id` = {$this->iPageID} LIMIT 1") && $i == 0) {
                                         db_res("UPDATE `ml_clonetwo_main` SET `thumb` = {$iMediaId} WHERE `id` = {$this->iPageID} LIMIT 1");
                                     }
                                 }
                             }
                             $i++;
                         }
                     }
                     break;
                 case 'video':
                     $sTable = 'ml_clonetwo_videos';
                     $iIdField = 'entry_id';
                     $iMedIdField = 'media_id';
                     if (!empty($_POST[$sValue . '_check_videos'])) {
                         foreach ($_POST[$sValue . '_check_videos'] as $sValue) {
                             if ($sValue) {
                                 db_res("DELETE FROM `{$sTable}` WHERE `{$iIdField}` = {$this->iPageID} AND `{$iMedIdField}` = {$sValue} LIMIT 1");
                             }
                         }
                     }
                     if (BxDolRequest::serviceExists("videos", "perform_video_upload", 'Uploader')) {
                         $i = 0;
                         if ($sData) {
                             foreach ($aMediaData as $sData) {
                                 $aInfo = array('medTitle' => $_POST[$sValue . '_title_videos'][$i] ? $_POST[$sValue . '_title_videos'][$i] : $_FILES[$sValue]['name'][$i], 'Categories' => array($aUpd['title'] . ' ' . _t("_bx_{$sKey}s")), 'album' => _t('_ml_clonetwo_photo_album', $aUpd['title']));
                                 $this->looper();
                                 $iMediaId = BxDolService::call("videos", "perform_video_upload", array($GLOBALS['dir']['tmp'] . $sData, $aInfo, false), 'Uploader');
                                 if ($iMediaId) {
                                     @unlink($GLOBALS['dir']['tmp'] . $sData);
                                     if (db_value("SHOW TABLES LIKE '{$sTable}'")) {
                                         db_res("INSERT INTO `{$sTable}` SET `{$iIdField}` = {$this->iPageID}, `{$iMedIdField}` = {$iMediaId}");
                                     }
                                 }
                             }
                             $i++;
                         }
                     }
                     break;
                 case 'sound':
                     $sTable = 'ml_clonetwo_sounds';
                     $iIdField = 'entry_id';
                     $iMedIdField = 'media_id';
                     if (!empty($_POST[$sValue . '_check_sounds'])) {
                         foreach ($_POST[$sValue . '_check_sounds'] as $sValue) {
                             if ($sValue) {
                                 db_res("DELETE FROM `{$sTable}` WHERE `{$iIdField}` = {$this->iPageID} AND `{$iMedIdField}` = {$sValue} LIMIT 1");
                             }
                         }
                     }
                     if (BxDolRequest::serviceExists("sounds", "perform_music_upload", 'Uploader')) {
                         $i = 0;
                         if ($sData) {
                             foreach ($aMediaData as $sData) {
                                 $aInfo = array('medTitle' => $_POST[$sValue . '_title_sounds'][$i] ? $_POST[$sValue . '_title_sounds'][$i] : $_FILES[$sValue]['name'][$i], 'Categories' => array($aUpd['title'] . ' ' . _t("_bx_{$sKey}s")), 'album' => _t('_ml_clonetwo_photo_album', $aUpd['title']));
                                 $this->looper();
                                 $iMediaId = BxDolService::call("sounds", "perform_music_upload", array($GLOBALS['dir']['tmp'] . $sData, $aInfo, false), 'Uploader');
                                 if ($iMediaId) {
                                     @unlink($GLOBALS['dir']['tmp'] . $sData);
                                     if (db_value("SHOW TABLES LIKE '{$sTable}'")) {
                                         db_res("INSERT INTO `{$sTable}` SET `{$iIdField}` = {$this->iPageID}, `{$iMedIdField}` = {$iMediaId}");
                                     }
                                 }
                             }
                             $i++;
                         }
                     }
                     break;
                 case 'file':
                     $sTable = 'ml_clonetwo_files';
                     $iIdField = 'entry_id';
                     $iMedIdField = 'media_id';
                     if (!empty($_POST[$sValue . '_check_files'])) {
                         foreach ($_POST[$sValue . '_check_files'] as $sValue) {
                             if ($sValue) {
                                 db_res("DELETE FROM `{$sTable}` WHERE `{$iIdField}` = {$this->iPageID} AND `{$iMedIdField}` = {$sValue} LIMIT 1");
                             }
                         }
                     }
                     if (BxDolRequest::serviceExists("files", "perform_file_upload", 'Uploader')) {
                         $i = 0;
                         if ($sData) {
                             foreach ($aMediaData as $sData) {
                                 $aInfo = array('medTitle' => $_POST[$sValue . '_title_files'][$i] ? $_POST[$sValue . '_title_files'][$i] : $_FILES[$sValue]['name'][$i], 'Categories' => array($aUpd['title'] . ' ' . _t("_bx_{$sKey}s")), 'album' => _t('_ml_clonetwo_photo_album', $aUpd['title']));
                                 $this->looper();
                                 $iMediaId = BxDolService::call("files", "perform_file_upload", array($GLOBALS['dir']['tmp'] . $sData, $aInfo, false), 'Uploader');
                                 if ($iMediaId) {
                                     @unlink($GLOBALS['dir']['tmp'] . $sData);
                                     if (db_value("SHOW TABLES LIKE '{$sTable}'")) {
                                         db_res("INSERT INTO `{$sTable}` SET `{$iIdField}` = {$this->iPageID}, `{$iMedIdField}` = {$iMediaId}");
                                     }
                                 }
                             }
                             $i++;
                         }
                     }
                     break;
                 case 'youtube':
                     $i = 0;
                     $sTable = 'ml_clonetwo_youtube';
                     $iUIdField = 'id';
                     $iIdField = 'id_entry';
                     $sUrlField = 'url';
                     $sTitleField = 'title';
                     if (!empty($_POST[$sValue . '_check_youtube'])) {
                         foreach ($_POST[$sValue . '_check_youtube'] as $sValue) {
                             if ($sValue) {
                                 db_res("DELETE FROM `{$sTable}` WHERE `{$iIdField}` = {$this->iPageID} AND `{$iUIdField}` = {$sValue} LIMIT 1");
                             }
                         }
                     }
                     foreach ($aMediaData as $sData) {
                         if ($sData) {
                             $sTitle = $_POST[$sValue . '_title_youtube'][$i];
                             if (db_value("SHOW TABLES LIKE '{$sTable}'") && $sData) {
                                 db_res("INSERT INTO `{$sTable}` SET `{$iIdField}` = {$this->iPageID}, `{$sUrlField}` = '{$sData}', `{$sTitleField}` = '{$sTitle}'");
                             }
                         }
                         $i++;
                     }
                     break;
                 case 'rss':
                     $i = 0;
                     $sTable = 'ml_clonetwo_rss';
                     $iUIdField = 'id';
                     $iIdField = 'id_entry';
                     $sUrlField = 'url';
                     $sTitleField = 'name';
                     if (!empty($_POST[$sValue . '_check_rss'])) {
                         foreach ($_POST[$sValue . '_check_rss'] as $sValue) {
                             if ($sValue) {
                                 db_res("DELETE FROM `{$sTable}` WHERE `{$iIdField}` = {$this->iPageID} AND `{$iUIdField}` = {$sValue} LIMIT 1");
                             }
                         }
                     }
                     foreach ($aMediaData as $sData) {
                         if ($sData) {
                             $sTitle = $_POST[$sValue . '_title_rss'][$i];
                             if (db_value("SHOW TABLES LIKE '{$sTable}'") && $sData) {
                                 db_res("INSERT INTO `{$sTable}` SET `{$iIdField}` = {$this->iPageID}, `{$sUrlField}` = '{$sData}', `{$sTitleField}` = '{$sTitle}'");
                             }
                         }
                         $i++;
                     }
                     break;
             }
         }
     }
     $oModuleDb = new BxDolModuleDb();
     $aModule = $oModuleDb->getModuleByUri('clonetwo');
     $iProfileId = getLoggedId();
     bx_import('BxDolTags');
     $o = new BxDolTags();
     $o->reparseObjTags('ml_clonetwo', $this->iPageID);
     bx_import('BxDolCategories');
     $o = new BxDolCategories();
     $o->reparseObjTags('ml_clonetwo', $this->iPageID);
     $this->oPC->updatePage($this->iPageID, $aUpd);
 }
예제 #23
0
 function _recompileLanguageForAllModules($iLangId)
 {
     $oDb = new BxDolModuleDb();
     $aLanguage = $GLOBALS['MySQL']->getRow("SELECT `ID` AS `id`, `Name` AS `name`, `Title` AS `title` FROM `sys_localization_languages` WHERE `ID` = {$iLangId}");
     if (!$aLanguage) {
         return false;
     }
     // save class properties
     $aSave['config'] = $this->_aConfig;
     $aSave['home_path'] = $this->_sHomePath;
     $aSave['module_path'] = $this->_sModulePath;
     $aModules = $oDb->getModules();
     foreach ($aModules as $a) {
         $aConfig = false;
         $bInclude = @(include BX_DIRECTORY_PATH_MODULES . $a['path'] . 'install/config.php');
         if (!$bInclude || !$aConfig) {
             continue;
         }
         $this->_aConfig = $aConfig;
         $this->_sHomePath = $this->_sBasePath . $aConfig['home_dir'];
         $this->_sModulePath = $this->_sBasePath . $aConfig['home_dir'];
         $b = $this->_updateLanguage(true, $aLanguage);
     }
     // restore class properties
     $this->_aConfig = $aSave['config'];
     $this->_sHomePath = $aSave['home_path'];
     $this->_sModulePath = $aSave['module_path'];
     return true;
 }
예제 #24
0
 function __construct(&$oConfig)
 {
     parent::__construct($oConfig);
 }
예제 #25
0
 function BxOAuthDb(&$oConfig)
 {
     parent::BxDolModuleDb();
     $this->_oConfig = $oConfig;
 }
예제 #26
0
 function serviceGetActionsChecklist($sType)
 {
     bx_instance('BxDolModuleDb');
     $oModuleDb = new BxDolModuleDb();
     $aHandlers = $this->_oDb->getHandlers(array('type' => $sType));
     $aResults = array();
     foreach ($aHandlers as $aHandler) {
         $aModule = $oModuleDb->getModuleByUri($aHandler['module_uri']);
         if (empty($aModule)) {
             $aModule['title'] = _t('_wall_alert_module_' . $aHandler['alert_unit']);
         }
         $aResults[$aHandler['id']] = $aModule['title'] . ' (' . _t('_wall_alert_action_' . $aHandler['alert_action']) . ')';
     }
     asort($aResults);
     return $aResults;
 }
예제 #27
0
 function _methodExists($mixedModule, $sMethodType, $sMethodName, $sClass = "Module")
 {
     $aModule = $mixedModule;
     if (is_string($mixedModule)) {
         $oModuleDb = new BxDolModuleDb();
         $aModule = $oModuleDb->getModuleByUri($mixedModule);
     }
     $sClass = $aModule['class_prefix'] . $sClass;
     if (($oModule = BxDolRequest::_require($aModule, $sClass)) === false) {
         return false;
     }
     $sMethod = $sMethodType . str_replace(' ', '', ucwords(str_replace('_', ' ', $sMethodName)));
     return method_exists($oModule, $sMethod);
 }
예제 #28
0
 function BxDolTwigModuleDb(&$oConfig)
 {
     parent::BxDolModuleDb($oConfig);
 }
* 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 '../../../inc/header.inc.php';
require_once BX_DIRECTORY_PATH_INC . 'admin.inc.php';
require_once BX_DIRECTORY_PATH_MODULES . 'modloaded/clonetwo/classes/MlClonetwoModule.php';
bx_import('BxDolModuleDb');
$_page['name_index'] = 151;
check_logged();
$oModuleDb = new BxDolModuleDb();
$aModule = $oModuleDb->getModuleByUri('clonetwo');
$_page['header'] = _t('_ml_clonetwo_create_page');
$_page['header_text'] = _t('_ml_clonetwo_create_page');
$oMlClonetwo = new MlClonetwoModule($aModule);
$_ni = $_page['name_index'];
$_page_cont[$_ni]['page_main_code'] = PageCompPages($oMlClonetwo);
$oMlClonetwo->_oTemplate->addCss('forms_extra.css');
function PageCompPages($oMlClonetwo)
{
    if (!$oMlClonetwo->isAllowedAdd()) {
        return DesignBoxContent(_t('_ml_clonetwo_create_page'), MsgBox(_t('_Access denied')), 1);
    }
    require_once BX_DIRECTORY_PATH_MODULES . 'modloaded/clonetwo/classes/MlClonetwoCreatePageProcessor.php';
    $oCreatePageProc = new MlClonetwoCreatePageProcessor();
    $aVars = array('form' => $oCreatePageProc->process(), 'create_url' => BX_DOL_URL_ROOT . 'modules/modloaded/clonetwo/create.php');
예제 #30
0
 function BxPmtDb(&$oConfig)
 {
     parent::BxDolModuleDb($oConfig);
     $this->_oConfig =& $oConfig;
 }