Example #1
0
 /**
  * News Letters block
  */
 function getBlockCode_Subscribe()
 {
     global $site;
     $iUserId = isLogged() ? getLoggedId() : 0;
     $oSubscription = new BxDolSubscription();
     $aButton = $oSubscription->getButton($iUserId, 'system', '');
     $sContent = $oSubscription->getData() . $GLOBALS['oSysTemplate']->parseHtmlByName('home_page_subscribe.html', array('message' => _t('_SUBSCRIBE_TEXT', $site['title']), 'button_title' => $aButton['title'], 'button_script' => $aButton['script']));
     return array($sContent, array(), array(), false);
 }
Example #2
0
 function getBlockCode_ActionList()
 {
     $sCode = null;
     bx_import('BxDolSubscription');
     $oSubscription = new BxDolSubscription();
     $aButton = $oSubscription->getButton($this->iProfileId, $this->oConfig->getMainPrefix(), '', (int) $this->aFileInfo['medID']);
     $aReplacement = array('favorited' => $this->aFileInfo['favorited'] == false ? '' : 'favorited', 'moduleUrl' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri(), 'fileUri' => $this->aFileInfo['medUri'], 'iViewer' => $this->iProfileId, 'ID' => (int) $this->aFileInfo['medID'], 'Owner' => (int) $this->aFileInfo['medProfId'], 'OwnerName' => $this->aFileInfo['NickName'], 'AlbumUri' => $this->aFileInfo['albumUri'], 'sbs_' . $this->oConfig->getMainPrefix() . '_title' => $aButton['title'], 'sbs_' . $this->oConfig->getMainPrefix() . '_script' => $aButton['script']);
     $sActionsList = $GLOBALS['oFunctions']->genObjectsActions($aReplacement, $this->oConfig->getMainPrefix());
     if (!is_null($sActionsList)) {
         $sCode = $oSubscription->getData() . $sActionsList;
     }
     return $sCode;
 }
Example #3
0
 function getBlockCode_Actions()
 {
     global $oFunctions;
     if ($this->_oMain->_iProfileId || $this->_oMain->isAdmin()) {
         $oSubscription = new BxDolSubscription();
         $aSubscribeButton = $oSubscription->getButton($this->_oMain->_iProfileId, 'bx_store', '', (int) $this->aDataEntry['id']);
         $aInfo = array('BaseUri' => $this->_oMain->_oConfig->getBaseUri(), 'iViewer' => $this->_oMain->_iProfileId, 'ownerID' => (int) $this->aDataEntry['author_id'], 'ID' => (int) $this->aDataEntry['id'], 'URI' => (int) $this->aDataEntry['uri'], 'ScriptSubscribe' => $aSubscribeButton['script'], 'TitleSubscribe' => $aSubscribeButton['title'], 'TitleEdit' => $this->_oMain->isAllowedEdit($this->aDataEntry) ? _t('_bx_store_action_title_edit') : '', 'TitleDelete' => $this->_oMain->isAllowedDelete($this->aDataEntry) ? _t('_bx_store_action_title_delete') : '', 'TitleShare' => $this->_oMain->isAllowedShareProduct($this->aDataEntry) ? _t('_bx_store_action_title_share') : '', 'TitleBroadcast' => $this->_oMain->isAllowedBroadcast($this->aDataEntry) ? _t('_bx_store_action_title_broadcast') : '', 'AddToFeatured' => $this->_oMain->isAllowedMarkAsFeatured($this->aDataEntry) ? $this->aDataEntry['featured'] ? _t('_bx_store_action_remove_from_featured') : _t('_bx_store_action_add_to_featured') : '');
         if (!$aInfo['TitleEdit'] && !$aInfo['TitleDelete'] && !$aInfo['TitleShare'] && !$aInfo['AddToFeatured'] && !$aInfo['TitleBroadcast'] && !$aInfo['TitleSubscribe']) {
             return '';
         }
         return $oSubscription->getData() . $oFunctions->genObjectsActions($aInfo, 'bx_store');
     }
     return '';
 }
Example #4
0
 function getBlockCode_Actions()
 {
     global $oFunctions;
     if ($this->_oMain->_iProfileId || $this->_oMain->isAdmin()) {
         $oSubscription = new BxDolSubscription();
         $aSubscribeButton = $oSubscription->getButton($this->_oMain->_iProfileId, 'bx_groups', '', (int) $this->aDataEntry['id']);
         $isFan = $this->_oDb->isFan((int) $this->aDataEntry['id'], $this->_oMain->_iProfileId, 0) || $this->_oDb->isFan((int) $this->aDataEntry['id'], $this->_oMain->_iProfileId, 1);
         $aInfo = array('BaseUri' => $this->_oMain->_oConfig->getBaseUri(), 'iViewer' => $this->_oMain->_iProfileId, 'ownerID' => (int) $this->aDataEntry['author_id'], 'ID' => (int) $this->aDataEntry['id'], 'URI' => $this->aDataEntry['uri'], 'ScriptSubscribe' => $aSubscribeButton['script'], 'TitleSubscribe' => $aSubscribeButton['title'], 'TitleEdit' => $this->_oMain->isAllowedEdit($this->aDataEntry) ? _t('_bx_groups_action_title_edit') : '', 'TitleDelete' => $this->_oMain->isAllowedDelete($this->aDataEntry) ? _t('_bx_groups_action_title_delete') : '', 'TitleJoin' => $this->_oMain->isAllowedJoin($this->aDataEntry) ? $isFan ? _t('_bx_groups_action_title_leave') : _t('_bx_groups_action_title_join') : '', 'IconJoin' => $isFan ? 'signout' : 'signin', 'TitleInvite' => $this->_oMain->isAllowedSendInvitation($this->aDataEntry) ? _t('_bx_groups_action_title_invite') : '', 'TitleShare' => $this->_oMain->isAllowedShare($this->aDataEntry) ? _t('_bx_groups_action_title_share') : '', 'TitleBroadcast' => $this->_oMain->isAllowedBroadcast($this->aDataEntry) ? _t('_bx_groups_action_title_broadcast') : '', 'AddToFeatured' => $this->_oMain->isAllowedMarkAsFeatured($this->aDataEntry) ? $this->aDataEntry['featured'] ? _t('_bx_groups_action_remove_from_featured') : _t('_bx_groups_action_add_to_featured') : '', 'TitleManageFans' => $this->_oMain->isAllowedManageFans($this->aDataEntry) ? _t('_bx_groups_action_manage_fans') : '', 'TitleUploadPhotos' => $this->_oMain->isAllowedUploadPhotos($this->aDataEntry) ? _t('_bx_groups_action_upload_photos') : '', 'TitleUploadVideos' => $this->_oMain->isAllowedUploadVideos($this->aDataEntry) ? _t('_bx_groups_action_upload_videos') : '', 'TitleUploadSounds' => $this->_oMain->isAllowedUploadSounds($this->aDataEntry) ? _t('_bx_groups_action_upload_sounds') : '', 'TitleUploadFiles' => $this->_oMain->isAllowedUploadFiles($this->aDataEntry) ? _t('_bx_groups_action_upload_files') : '');
         if (!$aInfo['TitleEdit'] && !$aInfo['TitleDelete'] && !$aInfo['TitleJoin'] && !$aInfo['TitleInvite'] && !$aInfo['TitleShare'] && !$aInfo['TitleBroadcast'] && !$aInfo['AddToFeatured'] && !$aInfo['TitleManageFans'] && !$aInfo['TitleUploadPhotos'] && !$aInfo['TitleUploadVideos'] && !$aInfo['TitleUploadSounds'] && !$aInfo['TitleUploadFiles']) {
             return '';
         }
         return $oSubscription->getData() . $oFunctions->genObjectsActions($aInfo, 'bx_groups');
     }
     return '';
 }
 function getBlockCode_ActionList()
 {
     $sCode = null;
     $sMainPrefix = $this->oConfig->getMainPrefix();
     bx_import('BxDolSubscription');
     $oSubscription = BxDolSubscription::getInstance();
     $aButton = $oSubscription->getButton($this->iProfileId, $sMainPrefix, '', (int) $this->aFileInfo['medID']);
     bx_import('BxDolAlbums');
     $sProfileAlbumUri = BxDolAlbums::getAbumUri($this->oConfig->getGlParam('profile_album_name'), $this->iProfileId);
     $aReplacement = array('favorited' => $this->aFileInfo['favorited'] == false ? '' : 'favorited', 'featured' => (int) $this->aFileInfo['Featured'], 'featuredCpt' => '', 'approvedCpt' => '', 'approvedAct' => '', 'moduleUrl' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri(), 'fileUri' => $this->aFileInfo['medUri'], 'fileKey' => $this->aFileInfo['Hash'], 'fileExt' => $this->aFileInfo['medExt'], 'iViewer' => $this->iProfileId, 'ID' => (int) $this->aFileInfo['medID'], 'Owner' => (int) $this->aFileInfo['medProfId'], 'OwnerName' => $this->aFileInfo['NickName'], 'AlbumUri' => $this->aFileInfo['albumUri'], 'Tags' => bx_php_string_apos($this->aFileInfo['medTags']), 'TitleAvatar' => $this->aFileInfo['medProfId'] == $this->iProfileId && 'sys_avatar' == getParam('sys_member_info_thumb') ? _t('_' . $sMainPrefix . '_set_as_avatar') : '', 'SetAvatarCpt' => $this->aFileInfo['medProfId'] == $this->iProfileId && $sProfileAlbumUri == $this->aFileInfo['albumUri'] && 'bx_photos_thumb' == getParam('sys_member_info_thumb') ? _t('_' . $sMainPrefix . '_set_as_avatar') : '', 'sbs_' . $sMainPrefix . '_title' => $aButton['title'], 'sbs_' . $sMainPrefix . '_script' => $aButton['script'], 'shareCpt' => $this->oModule->isAllowedShare($this->aFileInfo) ? _t('_Share') : '', 'cropCpt' => $this->oModule->isAllowedEdit($this->aFileInfo) && $this->aFileInfo['medProfId'] == $this->iProfileId ? _t('_bx_photos_crop_action') : '');
     if (isAdmin($this->iProfileId)) {
         $sMsg = $aReplacement['featured'] > 0 ? 'un' : '';
         $aReplacement['featuredCpt'] = _t('_' . $sMainPrefix . '_action_' . $sMsg . 'feature');
     }
     if ($this->oModule->isAllowedApprove($this->aFileInfo)) {
         $sMsg = '';
         $iAppr = 1;
         if ($this->aFileInfo['Approved'] == 'approved') {
             $sMsg = 'de';
             $iAppr = 0;
         }
         $aReplacement['approvedCpt'] = _t('_' . $sMainPrefix . '_admin_' . $sMsg . 'activate');
         $aReplacement['approvedAct'] = $iAppr;
     }
     $sActionsList = $GLOBALS['oFunctions']->genObjectsActions($aReplacement, $sMainPrefix);
     if (!is_null($sActionsList)) {
         $sCode = $oSubscription->getData() . $sActionsList;
     }
     return $sCode;
 }
Example #6
0
 function getBlockCode_ActionList()
 {
     $sCode = null;
     $sMainPrefix = $this->oConfig->getMainPrefix();
     bx_import('BxDolSubscription');
     $oSubscription = BxDolSubscription::getInstance();
     $aButton = $oSubscription->getButton($this->iProfileId, $sMainPrefix, '', (int) $this->aFileInfo['medID']);
     $sCode .= $oSubscription->getData();
     $aReplacement = array('favorited' => $this->aFileInfo['favorited'] == false ? '' : 'favorited', 'featured' => (int) $this->aFileInfo['Featured'], 'featuredCpt' => '', 'approvedCpt' => '', 'approvedAct' => '', 'moduleUrl' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri(), 'fileUri' => $this->aFileInfo['medUri'], 'iViewer' => $this->iProfileId, 'ID' => (int) $this->aFileInfo['medID'], 'Owner' => (int) $this->aFileInfo['medProfId'], 'OwnerName' => $this->aFileInfo['NickName'], 'AlbumUri' => $this->aFileInfo['albumUri'], 'sbs_' . $sMainPrefix . '_title' => $aButton['title'], 'sbs_' . $sMainPrefix . '_script' => $aButton['script'], 'shareCpt' => $this->oModule->isAllowedShare($this->aFileInfo) ? _t('_Share') : '', 'downloadCpt' => $this->oModule->isAllowedDownload($this->aFileInfo) ? _t('_Download') : '');
     if (isAdmin($this->iProfileId)) {
         $sMsg = $aReplacement['featured'] > 0 ? 'un' : '';
         $aReplacement['featuredCpt'] = _t('_' . $sMainPrefix . '_action_' . $sMsg . 'feature');
     }
     if ($this->oModule->isAllowedApprove($this->aFileInfo)) {
         $sMsg = '';
         $iAppr = 1;
         if ($this->aFileInfo['Approved'] == 'approved') {
             $sMsg = 'de';
             $iAppr = 0;
         }
         $aReplacement['approvedCpt'] = _t('_' . $sMainPrefix . '_admin_' . $sMsg . 'activate');
         $aReplacement['approvedAct'] = $iAppr;
     }
     $aReplacement['repostCpt'] = $aReplacement['repostScript'] = '';
     if (BxDolRequest::serviceExists('wall', 'get_repost_js_click')) {
         $sCode .= BxDolService::call('wall', 'get_repost_js_script');
         $aReplacement['repostCpt'] = _t('_Repost');
         $aReplacement['repostScript'] = BxDolService::call('wall', 'get_repost_js_click', array($this->iProfileId, $sMainPrefix, 'add', (int) $this->aFileInfo['medID']));
     }
     $sActionsList = $GLOBALS['oFunctions']->genObjectsActions($aReplacement, $sMainPrefix);
     if (is_null($sActionsList)) {
         return '';
     }
     return $sCode . $sActionsList;
 }
Example #7
0
 function getBlockCode_ActionList()
 {
     $sCode = null;
     bx_import('BxDolSubscription');
     $oSubscription = new BxDolSubscription();
     $aButton = $oSubscription->getButton($this->iProfileId, $this->oConfig->getMainPrefix(), '', (int) $this->aFileInfo['medID']);
     $aReplacement = array('featured' => (int) $this->aFileInfo['Featured'], 'featuredCpt' => '', 'moduleUrl' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri(), 'fileUri' => $this->aFileInfo['medUri'], 'iViewer' => $this->iProfileId, 'favorited' => $this->aFileInfo['favorited'] == false ? '' : 'favorited', 'ID' => (int) $this->aFileInfo['medID'], 'Owner' => (int) $this->aFileInfo['medProfId'], 'OwnerName' => $this->aFileInfo['NickName'], 'AlbumUri' => $this->aFileInfo['albumUri'], 'sbs_' . $this->oConfig->getMainPrefix() . '_title' => $aButton['title'], 'sbs_' . $this->oConfig->getMainPrefix() . '_script' => $aButton['script'], 'shareCpt' => $this->oModule->isAllowedShare($this->aFileInfo) ? _t('_Share') : '', 'downloadCpt' => $this->oModule->isAllowedDownload($this->aFileInfo) ? _t('_Download') : '');
     if (isAdmin($this->iProfileId)) {
         $sMsg = $aReplacement['featured'] > 0 ? 'un' : '';
         $aReplacement['featuredCpt'] = _t('_' . $this->oConfig->getMainPrefix() . '_action_' . $sMsg . 'feature');
     }
     $sActionsList = $GLOBALS['oFunctions']->genObjectsActions($aReplacement, $this->oConfig->getMainPrefix());
     if (!is_null($sActionsList)) {
         $sCode = $oSubscription->getData() . $sActionsList;
     }
     return $sCode;
 }
Example #8
0
 /**
  * Overwtire the method of parent class.
  *
  * @param BxDolAlerts $oAlert an instance of alert.
  */
 function response($oAlert)
 {
     $bFromWall = !empty($oAlert->aExtras) && (int) $oAlert->aExtras['from_wall'] == 1;
     if (is_array($oAlert->aExtras) && isset($oAlert->aExtras['privacy_view']) && $oAlert->aExtras['privacy_view'] == BX_DOL_PG_HIDDEN) {
         return;
     }
     if ($bFromWall) {
         $this->_oModule->_iOwnerId = (int) $oAlert->aExtras['owner_id'];
         $sMedia = strtolower(str_replace('bx_', '', $oAlert->sUnit));
         $aMediaInfo = $this->_oModule->_oTemplate->getCommonMedia($sMedia, $oAlert->iObject);
         $iOwnerId = $this->_oModule->_iOwnerId;
         $iObjectId = $this->_oModule->_getAuthorId();
         $sType = $this->_oModule->_oConfig->getCommonPostPrefix() . $sMedia;
         $sAction = '';
         $sContent = serialize(array('type' => $sMedia, 'id' => $oAlert->iObject));
         $sTitle = $aMediaInfo['title'];
         $sDescription = $aMediaInfo['description'];
     } else {
         $iOwnerId = $oAlert->iSender;
         $iObjectId = $oAlert->iObject;
         $sType = $oAlert->sUnit;
         $sAction = $oAlert->sAction;
         $sContent = is_array($oAlert->aExtras) && !empty($oAlert->aExtras) ? serialize($oAlert->aExtras) : '';
         $sTitle = $sDescription = '';
     }
     if ($oAlert->sUnit == 'profile' && $oAlert->sAction == 'delete') {
         $this->_oModule->_oDb->deleteEvent(array('owner_id' => $oAlert->iObject));
         $this->_oModule->_oDb->deleteEventCommon(array('object_id' => $oAlert->iObject));
         //delete all subscriptions
         $oSubscription = new BxDolSubscription();
         $oSubscription->unsubscribe(array('type' => 'object_id', 'unit' => 'bx_wall', 'object_id' => $oAlert->iObject));
         return;
     }
     if ($oAlert->sUnit == 'profile' && $oAlert->sAction == 'edit' && $iOwnerId != $iObjectId) {
         return;
     }
     $iId = $this->_oModule->_oDb->insertEvent(array('owner_id' => $iOwnerId, 'object_id' => $iObjectId, 'type' => $sType, 'action' => $sAction, 'content' => process_db_input($sContent, BX_TAGS_NO_ACTION, BX_SLASHES_NO_ACTION), 'title' => process_db_input($sTitle, BX_TAGS_NO_ACTION, BX_SLASHES_NO_ACTION), 'description' => process_db_input($sDescription, BX_TAGS_NO_ACTION, BX_SLASHES_NO_ACTION)));
     if ($bFromWall) {
         echo "<script>parent." . $this->_oModule->_sJsPostObject . "._getPost(null, " . $iId . ")</script>";
     } else {
         $this->_oModule->_oDb->updateSimilarObject($iId, $oAlert);
     }
 }
Example #9
0
 /**
  * Notifies the necessary handlers about the alert.
  */
 function alert()
 {
     $oSubscription = new BxDolSubscription();
     $oSubscription->send($this->sUnit, $this->sAction, $this->iObject, $this->aExtras);
     if (isset($this->_aAlerts[$this->sUnit]) && isset($this->_aAlerts[$this->sUnit][$this->sAction])) {
         foreach ($this->_aAlerts[$this->sUnit][$this->sAction] as $iHandlerId) {
             $aHandler = $this->_aHandlers[$iHandlerId];
             if (!empty($aHandler['file']) && !empty($aHandler['class']) && file_exists(BX_DIRECTORY_PATH_ROOT . $aHandler['file'])) {
                 if (!class_exists($aHandler['class'])) {
                     require_once BX_DIRECTORY_PATH_ROOT . $aHandler['file'];
                 }
                 $oHandler = new $aHandler['class']();
                 $oHandler->response($this);
             } else {
                 if (!empty($aHandler['eval'])) {
                     eval($aHandler['eval']);
                 }
             }
         }
     }
 }
Example #10
0
    function getBlockCode_ViewActions()
    {
        global $oFunctions;
        if ($this->_oSites->iOwnerId || $this->_oSites->isAdmin()) {
            $aInfo = array('iViewer' => $this->_oSites->iOwnerId, 'ownerID' => (int) $this->_aSite['ownerid'], 'ID' => (int) $this->_aSite['id'], 'TitleEdit' => $this->_oSites->isAllowedEdit($this->_aSite) ? _t('_bx_sites_action_title_edit') : '', 'TitleDelete' => $this->_oSites->isAllowedDelete($this->_aSite) ? _t('_bx_sites_action_title_delete') : '', 'TitleShare' => $this->_oSites->isAllowedShareSite($this->_aSite) ? _t('_bx_sites_action_title_share') : '', 'AddToFeatured' => $this->_oSites->isAllowedMarkAsFeatured($this->_aSite) && (int) $this->_aSite['allowView'] == BX_DOL_PG_ALL ? (int) $this->_aSite['featured'] == 1 ? _t('_bx_sites_action_remove_from_featured') : _t('_bx_sites_action_add_to_featured') : '');
            $oSubscription = new BxDolSubscription();
            $aButton = $oSubscription->getButton($this->_oSites->iOwnerId, 'bx_sites', '', $this->_aSite['id']);
            $aInfo['sbs_sites_title'] = $aButton['title'];
            $aInfo['sbs_sites_script'] = $aButton['script'];
            if (!$aInfo['TitleEdit'] && !$aInfo['TitleDelete'] && !$aInfo['TitleShare'] && !$aInfo['AddToFeatured'] && !$aInfo['sbs_sites_title']) {
                return '';
            }
            $sScript = '';
            if ($aInfo['TitleShare']) {
                $sUrlSharePopup = BX_DOL_URL_ROOT . $this->_oSites->_oConfig->getBaseUri() . "share_popup/" . $this->_aSite['id'];
                $sScript = <<<EOF
                    <script type="text/javascript">
                    function bx_site_show_share_popup ()
                    {
                        if (!\$('#bx_sites_share_popup').length) {
                            \$('<div id="bx_sites_share_popup" style="display: none;"></div>').prependTo('body');
                        }

                        \$('#bx_sites_share_popup').load(
                            '{$sUrlSharePopup}',
                            function() {
                                \$(this).dolPopup({fog: {color: '#fff', opacity: .7}});
                            }
                        );
                    }
                    </script>
EOF;
            }
            return $oSubscription->getData() . $sScript . $oFunctions->genObjectsActions($aInfo, 'bx_sites');
        }
        return '';
    }
Example #11
0
    function getBlockCode_ViewActions()
    {
        global $oFunctions;
        if ($this->_oSites->iOwnerId || $this->_oSites->isAdmin()) {
            $sCode = '';
            $aInfo = array('iViewer' => $this->_oSites->iOwnerId, 'ownerID' => (int) $this->_aSite['ownerid'], 'ID' => (int) $this->_aSite['id'], 'TitleEdit' => $this->_oSites->isAllowedEdit($this->_aSite) ? _t('_bx_sites_action_title_edit') : '', 'TitleDelete' => $this->_oSites->isAllowedDelete($this->_aSite) ? _t('_bx_sites_action_title_delete') : '', 'TitleShare' => $this->_oSites->isAllowedShare($this->_aSite) ? _t('_Share') : '', 'AddToFeatured' => $this->_oSites->isAllowedMarkAsFeatured($this->_aSite) && (int) $this->_aSite['allowView'] == BX_DOL_PG_ALL ? (int) $this->_aSite['featured'] == 1 ? _t('_bx_sites_action_remove_from_featured') : _t('_bx_sites_action_add_to_featured') : '');
            $oSubscription = BxDolSubscription::getInstance();
            $aButton = $oSubscription->getButton($this->_oSites->iOwnerId, 'bx_sites', '', $this->_aSite['id']);
            $sCode .= $oSubscription->getData();
            $aInfo['sbs_sites_title'] = $aButton['title'];
            $aInfo['sbs_sites_script'] = $aButton['script'];
            if (!$aInfo['TitleEdit'] && !$aInfo['TitleDelete'] && !$aInfo['TitleShare'] && !$aInfo['AddToFeatured'] && !$aInfo['sbs_sites_title']) {
                return '';
            }
            if ($aInfo['TitleShare']) {
                $sUrlSharePopup = BX_DOL_URL_ROOT . $this->_oSites->_oConfig->getBaseUri() . "share_popup/" . $this->_aSite['id'];
                $sCode .= <<<EOF
                    <script type="text/javascript">
                    function bx_site_show_share_popup ()
                    {
                        if (!\$('#bx_sites_share_popup').length) {
                            \$('<div id="bx_sites_share_popup" style="display: none;"></div>').prependTo('body');
                        }

                        \$('#bx_sites_share_popup').load(
                            '{$sUrlSharePopup}',
                            function() {
                                \$(this).dolPopup();
                            }
                        );
                    }
                    </script>
EOF;
            }
            $aInfo['repostCpt'] = $aInfo['repostScript'] = '';
            if (BxDolRequest::serviceExists('wall', 'get_repost_js_click')) {
                $sCode .= BxDolService::call('wall', 'get_repost_js_script');
                $aInfo['repostCpt'] = _t('_Repost');
                $aInfo['repostScript'] = BxDolService::call('wall', 'get_repost_js_click', array($this->_oSites->iOwnerId, 'bx_sites', 'add', (int) $this->_aSite['id']));
            }
            $aCodeActions = $oFunctions->genObjectsActions($aInfo, 'bx_sites');
            if (empty($aCodeActions)) {
                return '';
            }
            return $sCode . $aCodeActions;
        }
        return '';
    }
Example #12
0
 function getBlockCode_Actions()
 {
     global $oFunctions;
     if ($this->_oMain->_iProfileId || $this->_oMain->isAdmin()) {
         $sCode = '';
         $oSubscription = BxDolSubscription::getInstance();
         $aSubscribeButton = $oSubscription->getButton($this->_oMain->_iProfileId, 'bx_store', '', (int) $this->aDataEntry['id']);
         $sCode .= $oSubscription->getData();
         $aInfo = array('BaseUri' => $this->_oMain->_oConfig->getBaseUri(), 'iViewer' => $this->_oMain->_iProfileId, 'ownerID' => (int) $this->aDataEntry['author_id'], 'ID' => (int) $this->aDataEntry['id'], 'URI' => (int) $this->aDataEntry['uri'], 'ScriptSubscribe' => $aSubscribeButton['script'], 'TitleSubscribe' => $aSubscribeButton['title'], 'TitleEdit' => $this->_oMain->isAllowedEdit($this->aDataEntry) ? _t('_bx_store_action_title_edit') : '', 'TitleDelete' => $this->_oMain->isAllowedDelete($this->aDataEntry) ? _t('_bx_store_action_title_delete') : '', 'TitleShare' => $this->_oMain->isAllowedShare($this->aDataEntry) ? _t('_bx_store_action_title_share') : '', 'TitleBroadcast' => $this->_oMain->isAllowedBroadcast($this->aDataEntry) ? _t('_bx_store_action_title_broadcast') : '', 'AddToFeatured' => $this->_oMain->isAllowedMarkAsFeatured($this->aDataEntry) ? $this->aDataEntry['featured'] ? _t('_bx_store_action_remove_from_featured') : _t('_bx_store_action_add_to_featured') : '', 'TitleActivate' => method_exists($this->_oMain, 'isAllowedActivate') && $this->_oMain->isAllowedActivate($this->aDataEntry) ? _t('_bx_store_admin_activate') : '');
         if (BxDolRequest::serviceExists('wall', 'get_repost_js_click')) {
             $sCode .= BxDolService::call('wall', 'get_repost_js_script');
             $aInfo['repostCpt'] = _t('_Repost');
             $aInfo['repostScript'] = BxDolService::call('wall', 'get_repost_js_click', array($this->_oMain->_iProfileId, 'bx_store', 'add', (int) $this->aDataEntry['id']));
         }
         $sCodeActions = $oFunctions->genObjectsActions($aInfo, 'bx_store');
         if (empty($sCodeActions)) {
             return '';
         }
         return $sCode . $sCodeActions;
     }
     return '';
 }
Example #13
0
 function getBlockCode_Actions()
 {
     global $oFunctions;
     if ($this->_oMain->_iProfileId || $this->_oMain->isAdmin()) {
         $sCode = '';
         $oSubscription = BxDolSubscription::getInstance();
         $aSubscribeButton = $oSubscription->getButton($this->_oMain->_iProfileId, 'bx_events', '', (int) $this->aDataEntry['ID']);
         $sCode .= $oSubscription->getData();
         $isFan = $this->_oDb->isFan((int) $this->aDataEntry['ID'], $this->_oMain->_iProfileId, 0) || $this->_oDb->isFan((int) $this->aDataEntry['ID'], $this->_oMain->_iProfileId, 1);
         $this->aInfo = array('BaseUri' => $this->_oMain->_oConfig->getBaseUri(), 'iViewer' => $this->_oMain->_iProfileId, 'ownerID' => (int) $this->aDataEntry['ResponsibleID'], 'ID' => (int) $this->aDataEntry['ID'], 'URI' => $this->aDataEntry['EntryUri'], 'ScriptSubscribe' => $aSubscribeButton['script'], 'TitleSubscribe' => $aSubscribeButton['title'], 'TitleEdit' => $this->_oMain->isAllowedEdit($this->aDataEntry) ? _t('_bx_events_action_title_edit') : '', 'TitleDelete' => $this->_oMain->isAllowedDelete($this->aDataEntry) ? _t('_bx_events_action_title_delete') : '', 'TitleJoin' => $this->_oMain->isAllowedJoin($this->aDataEntry) ? $isFan ? _t('_bx_events_action_title_leave') : _t('_bx_events_action_title_join') : '', 'IconJoin' => $isFan ? 'sign-out' : 'sign-in', 'TitleInvite' => $this->_oMain->isAllowedSendInvitation($this->aDataEntry) ? _t('_bx_events_action_title_invite') : '', 'TitleShare' => $this->_oMain->isAllowedShare($this->aDataEntry) ? _t('_bx_events_action_title_share') : '', 'TitleBroadcast' => $this->_oMain->isAllowedBroadcast($this->aDataEntry) ? _t('_bx_events_action_title_broadcast') : '', 'AddToFeatured' => $this->_oMain->isAllowedMarkAsFeatured($this->aDataEntry) ? $this->aDataEntry['Featured'] ? _t('_bx_events_action_remove_from_featured') : _t('_bx_events_action_add_to_featured') : '', 'TitleManageFans' => $this->_oMain->isAllowedManageFans($this->aDataEntry) ? _t('_bx_events_action_manage_fans') : '', 'TitleUploadPhotos' => $this->_oMain->isAllowedUploadPhotos($this->aDataEntry) ? _t('_bx_events_action_upload_photos') : '', 'TitleUploadVideos' => $this->_oMain->isAllowedUploadVideos($this->aDataEntry) ? _t('_bx_events_action_upload_videos') : '', 'TitleUploadSounds' => $this->_oMain->isAllowedUploadSounds($this->aDataEntry) ? _t('_bx_events_action_upload_sounds') : '', 'TitleUploadFiles' => $this->_oMain->isAllowedUploadFiles($this->aDataEntry) ? _t('_bx_events_action_upload_files') : '', 'TitleActivate' => method_exists($this->_oMain, 'isAllowedActivate') && $this->_oMain->isAllowedActivate($this->aDataEntry) ? _t('_bx_events_admin_activate') : '');
         if (BxDolRequest::serviceExists('wall', 'get_repost_js_click')) {
             $sCode .= BxDolService::call('wall', 'get_repost_js_script');
             $this->aInfo['repostCpt'] = _t('_Repost');
             $this->aInfo['repostScript'] = BxDolService::call('wall', 'get_repost_js_click', array($this->_oMain->_iProfileId, 'bx_events', 'add', (int) $this->aDataEntry['ID']));
         }
         $sCodeActions = $oFunctions->genObjectsActions($this->aInfo, 'bx_events');
         if (empty($sCodeActions)) {
             return '';
         }
         return $sCode . $sCodeActions;
     }
     return '';
 }
Example #14
0
/***************************************************************************
 *
 *   This is a free software; you can modify it under the terms of BoonEx
 *   Product License Agreement published on BoonEx site at http://www.boonex.com/downloads/license.pdf
 *   You may not however distribute it for free or/and a fee.
 *   This notice may not be removed from the source code. You may not also remove any other visible
 *   reference and links to BoonEx Group as provided in source code.
 *
 ***************************************************************************/
require_once 'inc/header.inc.php';
require_once BX_DIRECTORY_PATH_INC . 'utils.inc.php';
require_once BX_DIRECTORY_PATH_INC . 'design.inc.php';
require_once BX_DIRECTORY_PATH_INC . 'languages.inc.php';
require_once BX_DIRECTORY_PATH_PLUGINS . 'Services_JSON.php';
bx_import('BxDolSubscription');
$oSubscription = new BxDolSubscription();
$aResult = array();
if (isset($_POST['direction'])) {
    $sUnit = process_db_input($_POST['unit']);
    $sAction = process_db_input($_POST['action']);
    $iObjectId = (int) $_POST['object_id'];
    switch ($_POST['direction']) {
        case 'subscribe':
            if (isset($_POST['user_id']) && (int) $_POST['user_id'] != 0) {
                $aResult = $oSubscription->subscribeMember((int) $_POST['user_id'], $sUnit, $sAction, $iObjectId);
            } else {
                if (isset($_POST['user_name']) && isset($_POST['user_email'])) {
                    $aResult = $oSubscription->subscribeVisitor($_POST['user_name'], $_POST['user_email'], $sUnit, $sAction, $iObjectId);
                }
            }
            break;
Example #15
0
 function _deleteFile($iFileId)
 {
     $aInfo = $this->serviceCheckDelete($iFileId);
     if (!$aInfo) {
         return false;
     }
     if ($this->_oDb->deleteData($iFileId)) {
         $aFilesPostfix = $this->_oConfig->aFilePostfix;
         //delete temp files
         $aFilesPostfix['temp'] = '';
         if (isset($aFilesPostfix['original'])) {
             $aFilesPostfix['original'] = $this->_getOriginalExt($aInfo, $aFilesPostfix['original']);
         }
         foreach ($aFilesPostfix as $sValue) {
             $sFilePath = $this->_oConfig->getFilesPath() . $iFileId . $sValue;
             @unlink($sFilePath);
         }
         bx_import('BxDolVoting');
         $oVoting = new BxDolVoting($this->_oConfig->getMainPrefix(), 0, 0);
         $oVoting->deleteVotings($iFileId);
         bx_import('BxDolCmts');
         $oCmts = new BxDolCmts($this->_oConfig->getMainPrefix(), $iFileId);
         $oCmts->onObjectDelete();
         bx_import('BxDolCategories');
         //tags & categories parsing
         $oTag = new BxDolTags();
         $oTag->reparseObjTags($this->_oConfig->getMainPrefix(), $iFileId);
         $oCateg = new BxDolCategories();
         $oCateg->reparseObjTags($this->_oConfig->getMainPrefix(), $iFileId);
         $bUpdateCounter = $aInfo['Approved'] == 'approved' ? true : false;
         $this->oAlbums->removeObjectTotal($iFileId, $bUpdateCounter);
         //delete all subscriptions
         $oSubscription = BxDolSubscription::getInstance();
         $oSubscription->unsubscribe(array('type' => 'object_id', 'unit' => $this->_oConfig->getMainPrefix(), 'object_id' => $iFileId));
         bx_import('BxDolAlerts');
         $oAlert = new BxDolAlerts($this->_oConfig->getMainPrefix(), 'delete', $iFileId, $this->_iProfileId, $aInfo);
         $oAlert->alert();
         $this->isAllowedDelete($aInfo, true);
     } else {
         return false;
     }
     return true;
 }
Example #16
0
 function getProfileViewActions($iProfileId, $bDynamic = false)
 {
     global $oTemplConfig;
     $iProfileId = (int) $iProfileId;
     if (!$iProfileId) {
         return '';
     }
     $aProfileInfo = getProfileInfo($iProfileId);
     if (empty($aProfileInfo)) {
         return '';
     }
     $iViewerId = getLoggedId();
     // prepare all needed keys
     $aConfig = array('url' => BX_DOL_URL_ROOT, 'anonym_mode' => '', 'member_id' => $iViewerId, 'member_pass' => getPassword($iViewerId));
     $aMainKeys = array('cpt_edit', 'cpt_send_letter', 'cpt_fave', 'cpt_befriend', 'cpt_remove_friend', 'cpt_get_mail', 'cpt_share', 'cpt_report', 'cpt_block', 'cpt_unblock', 'cpt_activate', 'cpt_ban', 'cpt_delete', 'cpt_delete_spam', 'cpt_feature', 'act_activate', 'act_ban', 'act_feature');
     $aMain = array_fill_keys($aMainKeys, '');
     if (isMember($iViewerId)) {
         $aMain['cpt_edit'] = _t('_EditProfile');
         $aMain['cpt_send_letter'] = _t('_SendLetter');
         $aMain['cpt_fave'] = _t('_Fave');
         $aMain['cpt_remove_fave'] = _t('_Remove Fave');
         $aMain['cpt_befriend'] = _t('_Befriend');
         $aMain['cpt_remove_friend'] = _t('_Remove friend');
         $aMain['cpt_get_mail'] = _t('_Get E-mail');
         $aMain['cpt_share'] = $this->isAllowedShare($this->_aProfile) ? _t('_Share') : '';
         $aMain['cpt_report'] = _t('_Report Spam');
         $aMain['cpt_block'] = _t('_Block');
         $aMain['cpt_unblock'] = _t('_Unblock');
     }
     if (isAdmin($iViewerId) || isModerator($iViewerId) and $iViewerId != $iProfileId) {
         $sMsgKeyStart = '_adm_btn_mp_';
         // delete
         $aMain['cpt_delete'] = _t($sMsgKeyStart . 'delete');
         // delete spam
         $aMain['cpt_delete_spam'] = _t($sMsgKeyStart . 'delete_spammer');
         // activate / deactivate
         $sTypeActiv = 'activate';
         if ($aProfileInfo['Status'] == 'Active') {
             $sTypeActiv = 'de' . $sTypeActiv;
         }
         $aMain['cpt_activate'] = _t($sMsgKeyStart . $sTypeActiv);
         $aMain['act_activate'] = $sTypeActiv;
         // ban / unban
         $sTypeBan = 'ban';
         if (isLoggedBanned($aProfileInfo['ID'])) {
             $sTypeBan = 'un' . $sTypeBan;
         }
         $aMain['cpt_ban'] = _t($sMsgKeyStart . $sTypeBan);
         $aMain['act_ban'] = $sTypeBan;
         // feature / unfeature
         $sTypeFeat = 'featured';
         $aMain['cpt_feature'] = _t('_Feature it');
         if ((int) $aProfileInfo['Featured']) {
             $sTypeFeat = 'un' . $sTypeFeat;
             $aMain['cpt_feature'] = _t('_De-Feature it');
         }
         $aMain['act_feature'] = $sTypeFeat;
     }
     //--- Subscription integration ---//
     $oSubscription = BxDolSubscription::getInstance();
     $sAddon = $oSubscription->getData($bDynamic);
     $aButton = $oSubscription->getButton($iViewerId, 'profile', '', $iProfileId);
     $aMain['sbs_profile_title'] = $aButton['title'];
     $aMain['sbs_profile_script'] = $aButton['script'];
     //--- Subscription integration ---//
     $aCheckGreet = checkAction(getLoggedId(), ACTION_ID_SEND_VKISS);
     $aMain['cpt_greet'] = $aCheckGreet[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED ? _t('_Greet') : '';
     $aMain = array_merge($aProfileInfo, $aConfig, $aMain);
     return $sAddon . $this->genObjectsActions($aMain, 'Profile');
 }
Example #17
0
    /**
     * Generate presentation Advertisement code with images and other
     *
     * @param $iID	ID of Advertisement
     * @return HTML presentation of data
     */
    function ActionPrintAdvertisement($iID)
    {
        global $site;
        global $aPreValues;
        $iAdvertisementID = (int) $iID;
        $sRetHtml = '';
        $sSiteUrl = BX_DOL_URL_ROOT;
        if ($this->bAdminMode && $iAdvertisementID > 0) {
            $iFeaturedStatus = $this->_oDb->getFeaturedStatus($iAdvertisementID);
            $iNewStatus = $iFeaturedStatus == 1 ? 0 : 1;
            if (bx_get('do') == 'cfs') {
                $this->_oDb->UpdateFeatureStatus($iAdvertisementID, $iNewStatus);
            }
        }
        $aSqlResStr = $this->_oDb->getAdInfo($iAdvertisementID);
        if ($aSqlResStr) {
            $iOwnerID = (int) $aSqlResStr['IDProfile'];
            $bPossibleToView = $this->oPrivacy->check('view', $iAdvertisementID, $this->_iVisitorID);
            if ($this->isAllowedView($iOwnerID, true) == false || $bPossibleToView == false) {
                return $this->_oTemplate->displayAccessDenied();
            }
            bx_import('BxDolViews');
            new BxDolViews('ads', $iAdvertisementID);
            $aNameRet = getProfileInfo($aSqlResStr['IDProfile']);
            $sCountryName = $aSqlResStr['Country'];
            $sCountryPic = $sCountryName == '' ? '' : ' <img alt="' . $sCountryName . '" src="' . ($site['flags'] . strtolower($sCountryName)) . '.gif"/>';
            $sCountryName = _t($aPreValues['Country'][$sCountryName]['LKey']);
            $sPostedByC = _t('_bx_ads_Posted_by');
            $sPhoneC = _t('_Phone');
            $sDetailsC = _t('_bx_ads_Details');
            $sUserOtherListC = _t('_bx_ads_Users_other_listing');
            $sActionsC = _t('_Actions');
            $sSureC = _t('_Are_you_sure');
            $sPostedBy .= '<div class="cls_res_info">';
            $sPostedBy .= $sPostedByC . ': <span style="color:#333333;"><a href="' . getProfileLink($aNameRet['ID']) . '">' . $aNameRet['NickName'] . '</a></span>';
            $sPostedBy .= '</div>';
            if ($aNameRet['Phone'] != "") {
                $sPostedBy .= '<div class="cls_res_info">';
                $sPostedBy .= $sPhoneC . ": <div class=\"clr3\">{$aNameRet['Phone']}</div>";
                $sPostedBy .= '</div>';
            }
            $sTimeAgo = defineTimeInterval($aSqlResStr['DateTime_UTS'], false);
            $aTags = array();
            $aTagsLinks = array();
            $aTags = preg_split("/[;,]/", $aSqlResStr['Tags']);
            foreach ($aTags as $sTag) {
                $sSubLink = $this->bUseFriendlyLinks ? "ads/tag/" : $this->sHomeUrl . "classifieds_tags.php?tag=";
                $sTagS = htmlspecialchars(title2uri($sTag));
                $aTagsLinks[] = '<a href="' . "{$sSubLink}{$sTagS}" . '">' . $sTag . '</a>';
            }
            $sTags .= implode(", ", $aTagsLinks);
            $sMemberActionForms = '';
            if ($this->_iVisitorID > 0 && $this->_iVisitorID != $aNameRet['ID']) {
                //print Send PM button and other actions
                if (getParam('bx_ads_enable_paid') == 'on') {
                    $sMemberActionForms .= <<<EOF
<form action="{$this->sCurrBrowsedFile}" name="BuyNowForm" method="post">
    <input type="hidden" name="BuyNow" value="BuyNow" />
    <input type="hidden" name="IDAdv" value="{$iAdvertisementID}" />
    <input type="hidden" name="IDSeller" value="{$aSqlResStr['IDProfile']}" />
</form>
EOF;
                }
                $sMemberActionForms .= <<<EOF
<form action="{$sSiteUrl}mail.php" name="post_pm" id="post_pm" method="get">
    <input type="hidden" name="mode" value="compose" />
    <input type="hidden" name="recipient_id" value="{$aSqlResStr['IDProfile']}" />
    <input type="hidden" name="subject" value="{$aSqlResStr['Subject']}" />
</form>
EOF;
            }
            $sEntryUrl = $this->genUrl($iAdvertisementID, $aSqlResStr['EntryUri'], 'entry');
            $sMediaIDs = $this->_oDb->getMediaOfAd($iAdvertisementID);
            if ($sMediaIDs != '') {
                $aReadyMedia = explode(',', $sMediaIDs);
                $sPictureSectContent = $this->_blockPhoto($aReadyMedia, $iOwnerID);
            }
            $sPictureSect = $sPictureSectContent != '' ? DesignBoxContent(_t('_bx_ads_Ad_photos'), $sPictureSectContent, 1) : '';
            $this->sTAPhotosContent = $sPictureSectContent;
            bx_import('BxDolSubscription');
            $oSubscription = BxDolSubscription::getInstance();
            $aButton = $oSubscription->getButton($this->_iVisitorID, $this->_oConfig->getUri(), '', $iAdvertisementID);
            $aActionKeys = array('BaseUri' => $this->_oConfig->getBaseUri(), 'visitor_id' => $this->_iVisitorID, 'owner_id' => $aNameRet['ID'], 'admin_mode' => "'" . $this->bAdminMode . "'", 'ads_id' => $iAdvertisementID, 'ads_status' => $aSqlResStr['Status'], 'ads_act_type' => $aSqlResStr['Status'] == 'active' ? 'inactive' : 'active', 'ads_featured' => (int) $aSqlResStr['Featured'], 'sure_label' => $sSureC, 'ads_entry_url' => $sEntryUrl, 'only_menu' => 0, 'sbs_ads_title' => $aButton['title'], 'sbs_ads_script' => $aButton['script'], 'TitleShare' => $this->isAllowedShare($aSqlResStr) ? _t('_Share') : '');
            $sActionsTable = $GLOBALS['oFunctions']->genObjectsActions($aActionKeys, 'bx_ads', false);
            $sSubsAddon = $oSubscription->getData();
            $sActionsSectContent = $sSubsAddon . $sMemberActionForms . $sActionsTable;
            $sActionsSect = $this->_iVisitorID > 0 || $this->bAdminMode ? DesignBoxContent($sActionsC, $sActionsSectContent, 1) : '';
            $this->sTAActionsContent = $this->_iVisitorID > 0 || $this->bAdminMode ? $sActionsSectContent : '';
            bx_import('Cmts', $this->_aModule);
            $this->oCmtsView = new BxAdsCmts($this->_oConfig->getCommentSystemName(), $iAdvertisementID);
            $sCommentsSectContent = $this->oCmtsView->getExtraCss();
            $sCommentsSectContent .= $this->oCmtsView->getExtraJs();
            $sCommentsSectContent .= !$this->oCmtsView->isEnabled() ? '' : $this->oCmtsView->getCommentsFirst();
            $this->sTACommentsContent = $sCommentsSectContent;
            $sCommSect = DesignBoxContent($aCaptions['Comments'], $sCommentsSectContent, 1);
            $sUserOtherListing = $this->getMemberAds($aSqlResStr['IDProfile'], 2, $iAdvertisementID);
            $sDataTimeFormatted = getLocaleDate($aSqlResStr['DateTime_UTS']);
            $iViews = (int) $aSqlResStr['Views'];
            $sOwnerThumb = get_member_thumbnail($aSqlResStr['IDProfile'], 'none', true);
            $sAdsMessage = process_html_output($aSqlResStr['Message']);
            $sCategLink = $this->bUseFriendlyLinks ? BX_DOL_URL_ROOT . 'ads/cat/' . $aSqlResStr['CEntryUri'] : "{$this->sCurrBrowsedFile}?bClassifiedID={$aSqlResStr['CatID']}";
            $sSCategLink = $this->bUseFriendlyLinks ? BX_DOL_URL_ROOT . 'ads/subcat/' . $aSqlResStr['SEntryUri'] : "{$this->sCurrBrowsedFile}?bSubClassifiedID={$aSqlResStr['SubID']}";
            $aSubjVariables = array('author_unit' => $sOwnerThumb, 'date' => $sDataTimeFormatted, 'date_ago' => $sTimeAgo, 'cats' => $this->_oTemplate->parseHtmlByTemplateName('category', array('cat_link' => $sCategLink, 'sub_cat_link' => $sSCategLink, 'cat_name' => $aSqlResStr['Name'], 'sub_cat_name' => $aSqlResStr['NameSub'])), 'tags' => $sTags, 'fields' => '');
            $sSubjectSectContent = $this->_oTemplate->parseHtmlByName('entry_view_block_info.html', $aSubjVariables);
            $sSubjectSect = DesignBoxContent(_t('_Info'), $sSubjectSectContent, 1);
            $this->sTAInfoContent = $sSubjectSectContent;
            $sDescriptionContent = '<div class="dbContent bx-def-bc-margin bx-def-font-large">' . $sAdsMessage . '</div>';
            $sDescriptionSect = DesignBoxContent(_t('_Description'), $sDescriptionContent, 1);
            $this->sTADescription = $sDescriptionContent;
            //adding form
            $aForm = array('form_attrs' => array('name' => 'custom_values_form', 'action' => $oAds->sCurrBrowsedFile), 'inputs' => array('Country' => array('type' => 'value', 'name' => 'Country', 'caption' => _t('_Country'), 'value' => $sCountryName . $sCountryPic), 'City' => array('type' => 'value', 'name' => 'City', 'caption' => _t('_City'), 'value' => $aSqlResStr['City'])));
            if ($aSqlResStr['CustomFieldName1'] && $aSqlResStr['CustomFieldValue1']) {
                $aForm['inputs']['Custom1'] = array('type' => 'value', 'name' => 'Custom1', 'caption' => $aSqlResStr['CustomFieldName1'], 'value' => $aSqlResStr['Unit1'] . $aSqlResStr['CustomFieldValue1']);
            }
            if ($aSqlResStr['CustomFieldName2'] && $aSqlResStr['CustomFieldValue2']) {
                $aForm['inputs']['Custom2'] = array('type' => 'value', 'name' => 'Custom2', 'caption' => $aSqlResStr['CustomFieldName2'], 'value' => $aSqlResStr['Unit2'] . $aSqlResStr['CustomFieldValue2']);
            }
            $oForm = new BxTemplFormView($aForm);
            $sOtherInfoContent = $oForm->getCode();
            $sOtherInfoSect = DesignBoxContent(_t('_bx_ads_Custom_Values'), $sOtherInfoContent, 1);
            $this->sTAOtherInfo = $sOtherInfoContent;
            $bPossibleToRate = $this->oPrivacy->check('rate', $iAdvertisementID, $this->_iVisitorID);
            $oVotingView = new BxTemplVotingView('ads', $iAdvertisementID);
            $iVote = $oVotingView && $oVotingView->isEnabled() && $bPossibleToRate ? 1 : 0;
            $sVotePostRating = $oVotingView->getBigVoting($iVote);
            $sRatingSect = DesignBoxContent(_t('_Rate'), $sVotePostRating, 1);
            $this->sTARateContent = '<div class="bx-def-bc-margin">' . $sVotePostRating . '</div>';
            $sOtherListingContent = <<<EOF
<div class="dbContent">
    {$sUserOtherListing}
</div>
EOF;
            $sSPaginateActions = <<<EOF
<div class="paginate bx-def-padding-left bx-def-padding-right">
    <div class="view_all">
        <a href="{$this->sCurrBrowsedFile}" onclick="document.forms['UsersOtherListingForm'].submit(); return false;">{$sUserOtherListC}</a>
        <form action="{$this->sCurrBrowsedFile}" name="UsersOtherListingForm" method="post">
            <input type="hidden" name="UsersOtherListing" value="1" />
            <input type="hidden" name="IDProfile" value="{$aSqlResStr['IDProfile']}" />
        </form>
    </div>
    <div class="pages_section"></div>
</div>
EOF;
            $sOtherListingSect = DesignBoxContent($sUserOtherListC, $sOtherListingContent . $sSPaginateActions, 1);
            $this->sTAOtherListingContent = $sOtherListingContent . $sSPaginateActions;
            $sHomeLink = $this->bUseFriendlyLinks ? BX_DOL_URL_ROOT . 'ads/' : "{$this->sCurrBrowsedFile}?Browse=1";
            $sBrowseAllAds = _t('_bx_ads_Browse_All_Ads');
            $sBreadCrumbs = <<<EOF
<div class="breadcrumbs">
<a href="{$sHomeLink}">{$sBrowseAllAds}</a>
/
<a href="{$sCategLink}">{$aSqlResStr['Name']}</a>
/
<a href="{$sSCategLink}">{$aSqlResStr['NameSub']}</a>
</div>
EOF;
            $aBlocks[1] .= $sActionsSect;
            $aBlocks[1] .= $sSubjectSect;
            $aBlocks[1] .= $sRatingSect;
            $aBlocks[1] .= $sOtherListingSect;
            $aBlocks[2] .= $sPictureSect;
            $aBlocks[2] .= $sCommSect;
            $sRetHtml = <<<EOF
{$sBreadCrumbs}
<div>
    <div class="clear_both"></div>
    <div class="cls_info_left">
        {$aBlocks['1']}
    </div>
    <div class="cls_info">
        {$sDescriptionSect}
        {$aBlocks['2']}
    </div>
    <div class="clear_both"></div>
</div>
<div class="clear_both"></div>
EOF;
            bx_import('BxDolAlerts');
            $oZ = new BxDolAlerts('ads', 'view', $iAdvertisementID, $this->_iVisitorID);
            $oZ->alert();
            $sAdCover = $this->getAdCover($aSqlResStr['Media'], 'icon');
            if ($sAdCover != '' && $aSqlResStr['Media']) {
                $GLOBALS['oTopMenu']->setCustomSubIconUrl($sAdCover);
            }
            $GLOBALS['oTopMenu']->setCustomSubHeader(htmlspecialchars($aSqlResStr['Subject']));
            $GLOBALS['oTopMenu']->setCustomBreadcrumbs(array(_t('_bx_ads_Ads') => $sHomeLink, $aSqlResStr['Subject'] => ''));
            $this->_oTemplate->setPageDescription(htmlspecialchars($aSqlResStr['Subject']));
            $this->_oTemplate->addPageKeywords(htmlspecialchars($aSqlResStr['Tags']));
        }
        return $sRetHtml;
    }
Example #18
0
 /**
  * Function will generate block with actions;
  */
 function getBlockCode_ActionsBlock()
 {
     $sCode = '';
     if (!$this->aPollInfo) {
         return MsgBox(_t('_Empty'));
     }
     // prepare all needed keys
     $aUnitInfo = array('ViewerID' => (int) $this->iMemberId, 'ID' => (int) $this->aPollInfo['id_poll'], 'BaseUri' => $this->oModule->_oConfig->getBaseUri());
     $aUnitInfo['base_url'] = BX_DOL_URL_ROOT . $aUnitInfo['BaseUri'];
     $aUnitInfo['approved_cpt'] = '';
     $aUnitInfo['approved_act'] = '';
     $aUnitInfo['del_poll_title'] = $aUnitInfo['del_poll_url'] = $aUnitInfo['del_poll_script'];
     if (isLogged() && ($this->aPollInfo['id_profile'] == $this->iMemberId || isAdmin())) {
         $sDeleteLink = $this->oModule->getModulePath() . '&action=delete_poll&id=' . $aUnitInfo['ID'];
         $aUnitInfo['del_poll_title'] = _t('_bx_poll_delete');
         $aUnitInfo['del_poll_url'] = $sDeleteLink;
         $aUnitInfo['del_poll_script'] = "if(confirm('" . bx_js_string(_t('_Are_you_sure')) . "')) window.open ('" . $sDeleteLink . "','_self'); return false;";
     }
     $sMainPrefix = 'bx_poll';
     if (isAdmin($this->iMemberId) || isModerator($this->iMemberId) && $this->aPollInfo['id_profile'] != $this->iMemberId) {
         $sMsg = '_';
         $iAppr = 1;
         if ($this->aPollInfo['poll_approval'] == 1) {
             $sMsg .= 'dis';
             $iAppr = 0;
         }
         $aUnitInfo['approved_cpt'] = _t('_' . $sMainPrefix . $sMsg . 'approve');
         $aUnitInfo['approved_act'] = $iAppr;
     }
     $oSubscription = BxDolSubscription::getInstance();
     $aButton = $oSubscription->getButton($this->iMemberId, $sMainPrefix, '', $this->aPollInfo['id_poll']);
     $sCode .= $oSubscription->getData();
     $aUnitInfo['sbs_poll_title'] = $aButton['title'];
     $aUnitInfo['sbs_poll_script'] = $aButton['script'];
     $aUnitInfo['TitleShare'] = $this->oModule->isAllowedShare($this->aPollInfo) ? _t('_Share') : '';
     if (BxDolRequest::serviceExists('wall', 'get_repost_js_click')) {
         $sCode .= BxDolService::call('wall', 'get_repost_js_script');
         $aUnitInfo['repostCpt'] = _t('_Repost');
         $aUnitInfo['repostScript'] = BxDolService::call('wall', 'get_repost_js_click', array($this->iMemberId, $sMainPrefix, 'add', $this->aPollInfo['id_poll']));
     }
     $sActions = $GLOBALS['oFunctions']->genObjectsActions($aUnitInfo, $sMainPrefix);
     if (empty($sActions)) {
         return '';
     }
     return $sCode . $sActions;
 }
Example #19
0
 * CC-BY License - http://creativecommons.org/licenses/by/3.0/
 */
define('BX_SECURITY_EXCEPTIONS', true);
$aBxSecurityExceptions = array('POST.body', 'REQUEST.body');
require_once '../inc/header.inc.php';
require_once BX_DIRECTORY_PATH_INC . 'design.inc.php';
require_once BX_DIRECTORY_PATH_INC . 'admin_design.inc.php';
require_once BX_DIRECTORY_PATH_INC . 'utils.inc.php';
require_once BX_DIRECTORY_PATH_INC . 'prof.inc.php';
bx_import('BxTemplFormView');
bx_import('BxDolEmailTemplates');
bx_import('BxDolPaginate');
bx_import('BxDolSubscription');
bx_import('BxTemplSearchResult');
$logged['admin'] = member_auth(1, true, true);
$oSubscription = BxDolSubscription::getInstance();
if ($_POST['queue_message'] && $_POST['msgs_id']) {
    set_time_limit(1800);
    $sActionResult = QueueMessage();
}
if ($_POST['add_message']) {
    $action = 'add';
}
if ($_POST['delete_message'] && $_POST['msgs_id']) {
    $sActionResult = DeleteMessage() ? _t('_adm_mmail_Message_was_deleted') : _t('_adm_mmail_Message_was_not_deleted');
}
if ($_POST['preview_message']) {
    $action = 'preview';
}
if (bx_get('action') == 'empty') {
    $sActionResult = EmptyQueue() ? _t('_adm_mmail_Queue_empty') : _t('_adm_mmail_Queue_emptying_failed');
Example #20
0
    function serviceViewBlock($mixed, $iStart = -1, $iPerPage = -1, $sFilter = '', $sTimeline = '', $sType = 'id', $aModules = array())
    {
        $sContent = '';
        $aOwner = $this->_oDb->getUser($mixed, $sType);
        $this->_iOwnerId = $aOwner['id'];
        $oSubscription = new BxDolSubscription();
        $aButton = $oSubscription->getButton($this->getUserId(), 'bx_wall', '', $this->_iOwnerId);
        $aTopMenu = array('wall-view-all' => array('href' => 'javascript:void(0)', 'onclick' => 'javascript:' . $this->_sJsViewObject . '.changeFilter(this)', 'title' => _t('_wall_view_all'), 'active' => 1), 'wall-view-owner' => array('href' => 'javascript:void(0)', 'onclick' => 'javascript:' . $this->_sJsViewObject . '.changeFilter(this)', 'title' => _t('_wall_view_owner', getNickName($aOwner['id']))), 'wall-view-other' => array('href' => 'javascript:void(0)', 'onclick' => 'javascript:' . $this->_sJsViewObject . '.changeFilter(this)', 'title' => _t('_wall_view_other')), 'wall-get-rss' => array('href' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'rss/' . $aOwner['username'] . '/', 'target' => '_blank', 'title' => _t('_wall_get_rss')), 'wall-subscription' => array('href' => 'javascript:void(0);', 'onclick' => 'javascript:' . $aButton['script'] . '', 'title' => $aButton['title']));
        if ($iStart == -1) {
            $iStart = 0;
        }
        if ($iPerPage == -1) {
            $iPerPage = $this->_oConfig->getPerPage();
        }
        if (empty($sFilter)) {
            $sFilter = BX_WALL_FILTER_ALL;
        }
        //--- Prepare JavaScript paramaters ---//
        $oJson = new Services_JSON();
        ob_start();
        ?>
        var <?php 
        echo $this->_sJsViewObject;
        ?>
 = new BxWallView({
            sActionUrl: '<?php 
        echo BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri();
        ?>
',
            sObjName: '<?php 
        echo $this->_sJsViewObject;
        ?>
',
            iOwnerId: <?php 
        echo $this->_iOwnerId;
        ?>
,
            sAnimationEffect: '<?php 
        echo $this->_oConfig->getAnimationEffect();
        ?>
',
            iAnimationSpeed: '<?php 
        echo $this->_oConfig->getAnimationSpeed();
        ?>
',
            oRequestParams: <?php 
        echo $oJson->encode(array('WallOwnerId' => $this->_iOwnerId, 'WallStart' => $iStart, 'WallPerPage' => $iPerPage, 'WallFilter' => $sFilter, 'WallTimeline' => $sTimeline, 'WallModules' => $aModules));
        ?>
        });
<?php 
        $sJsContent = ob_get_clean();
        //--- Is used with common Pagination
        //$oPaginate = $this->_getPaginate($sFilter, $sTimeline, $aModules);
        $aVariables = array('timeline' => $this->_getTimeline($iStart, $iPerPage, $sFilter, $sTimeline, $aModules), 'content' => $this->_getPosts('desc', $iStart, $iPerPage, $sFilter, $sTimeline, $aModules), 'view_js_content' => $sJsContent);
        $GLOBALS['oTopMenu']->setCurrentProfileID((int) $this->_iOwnerId);
        $this->_oTemplate->addCss(array('forms_adv.css', 'view.css'));
        $this->_oTemplate->addJs(array('main.js', 'view.js'));
        return array($this->_oTemplate->parseHtmlByName('view.html', $aVariables), $aTopMenu, LoadingBox('bx-wall-view-loading'), false, 'getBlockCaptionMenu');
    }
Example #21
0
 function onSiteDeleted($iSiteId)
 {
     // delete associated tags and categories
     $this->reparseTags($iSiteId);
     $this->reparseCategories($iSiteId);
     // delete sites votings
     bx_import('BxDolVoting');
     $oVotingProfile = new BxDolVoting('bx_sites', 0, 0);
     $oVotingProfile->deleteVotings($iSiteId);
     // delete sites comments
     bx_import('BxDolCmts');
     $oCmts = new BxDolCmts('bx_sites', $iSiteId);
     $oCmts->onObjectDelete();
     // delete views
     bx_import('BxDolViews');
     $oViews = new BxDolViews('bx_sites', $iSiteId, false);
     $oViews->onObjectDelete($iSiteId);
     //delete all subscriptions
     $oSubscription = BxDolSubscription::getInstance();
     $oSubscription->unsubscribe(array('type' => 'object_id', 'unit' => 'bx_sites', 'object_id' => $iSiteId));
     // arise alert
     bx_import('BxDolAlerts');
     $oAlert = new BxDolAlerts('bx_sites', 'delete', $iSiteId, $this->iOwnerId);
     $oAlert->alert();
 }
Example #22
0
<?php

/**
 * Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
 * CC-BY License - http://creativecommons.org/licenses/by/3.0/
 */
require_once 'inc/header.inc.php';
require_once BX_DIRECTORY_PATH_INC . 'design.inc.php';
bx_import('BxDolSubscription');
check_logged();
$oSubscription = new BxDolSubscription();
// --------------- page components
$iIndex = 0;
$_page = array('css_name' => '', 'header' => _t('_sys_pcpt_my_subscriptions'), 'header_text' => _t('_sys_bcpt_my_subscriptions'), 'name_index' => $iIndex);
$_page_cont[$iIndex]['page_main_code'] = $oSubscription->getMySubscriptions();
// --------------- [END] page components
PageCode();
// --------------- page components functions
 function _actDelete($aIds)
 {
     if (!$this->_isDeleteAllowed(true)) {
         return false;
     }
     if (is_int($aIds) || is_string($aIds)) {
         $aIds = array((int) $aIds);
     }
     $bResult = $this->_oDb->deleteEntries($aIds);
     if ($bResult) {
         $oTags = new BxDolTags();
         $oCategories = new BxDolCategories();
         $oSubscription = BxDolSubscription::getInstance();
         foreach ($aIds as $iId) {
             //--- Entry -> Delete for Alerts Engine ---//
             $oAlert = new BxDolAlerts($this->_oConfig->getAlertsSystemName(), 'delete', $iId, BxDolTextData::getAuthorId());
             $oAlert->alert();
             //--- Entry -> Delete for Alerts Engine ---//
             //--- Reparse Global Tags ---//
             $oTags->reparseObjTags($this->_oConfig->getTagsSystemName(), $iId);
             //--- Reparse Global Tags ---//
             //--- Reparse Global Categories ---//
             $oCategories->reparseObjTags($this->_oConfig->getCategoriesSystemName(), $iId);
             //--- Reparse Global Categories ---//
             //--- Remove all subscriptions ---//
             $oSubscription->unsubscribe(array('type' => 'object_id', 'unit' => $this->_oConfig->getSubscriptionsSystemName(), 'object_id' => $iId));
             //--- Remove all subscriptions ---//
         }
     }
     return $bResult;
 }
Example #24
0
 function onEventDeleted($iEntryId, $aDataEntry = array())
 {
     // delete associated tags and categories
     $this->reparseTags($iEntryId);
     $this->reparseCategories($iEntryId);
     // delete votings
     bx_import('Voting', $this->_aModule);
     $sClass = $this->_aModule['class_prefix'] . 'Voting';
     $oVoting = new $sClass($this->_sPrefix, 0, 0);
     $oVoting->deleteVotings($iEntryId);
     // delete comments
     bx_import('Cmts', $this->_aModule);
     $sClass = $this->_aModule['class_prefix'] . 'Cmts';
     $oCmts = new $sClass($this->_sPrefix, $iEntryId);
     $oCmts->onObjectDelete();
     // delete views
     bx_import('BxDolViews');
     $oViews = new BxDolViews($this->_sPrefix, $iEntryId, false);
     $oViews->onObjectDelete();
     // delete forum
     $this->_oDb->deleteForum($iEntryId);
     // delete associated locations
     if (BxDolModule::getInstance('BxWmapModule')) {
         BxDolService::call('wmap', 'response_entry_delete', array($this->_oConfig->getUri(), $iEntryId));
     }
     // delete all subscriptions
     $oSubscription = new BxDolSubscription();
     $oSubscription->unsubscribe(array('type' => 'object_id', 'unit' => $this->_sPrefix, 'object_id' => $iEntryId));
     // arise alert
     $oAlert = new BxDolAlerts($this->_sPrefix, 'delete', $iEntryId, $this->_iProfileId);
     $oAlert->alert();
 }
Example #25
0
 function getActionsBlock()
 {
     if ($this->iPostViewType == 3 && $this->iViewingPostID > 0) {
         $iMemberID = (int) $this->aViewingPostInfo['OwnerID'];
         $aOwnerInfo = getProfileInfo($iMemberID);
         $sOwnerNickname = getNickName($iMemberID);
         $aUser = array('Permalink' => $aOwnerInfo['NickName'], 'Link' => $iMemberID);
         $sOwnerBlogLinkSub = $this->genBlogLink('show_member_blog_home', $aUser, '', '', '', true);
         $sApproveC = _t('_Approve');
         $sDisApproveC = _t('_Disapprove');
         $sFeatureItC = _t('_Feature it');
         $sDeFeatureItC = _t('_De-Feature it');
         $bApproveAllowed = $this->isAllowedApprove() ? 'true' : 'false';
         if ($this->_iVisitorID == $iMemberID && $iMemberID > 0 || $this->bAdminMode || $bApproveAllowed) {
             $iFeaturedStatus = $this->_oDb->getFeaturedStatus($this->iViewingPostID);
             $sFeatureC = (int) $iFeaturedStatus == 1 ? $sDeFeatureItC : $sFeatureItC;
             if ($this->bAdminMode || $bApproveAllowed == 'true') {
                 $iApproved = 0;
                 //0 = not changed; 1 = app; 2 = disapp;
                 if (bx_get('sa') == 'approve') {
                     //approve this post
                     $this->_oDb->setPostStatus($this->iViewingPostID, 'approval');
                     $this->onPostApproveDisapprove($this->iViewingPostID, true);
                     $iApproved = 1;
                 }
                 if (bx_get('sa') == 'disapprove') {
                     //disapprove this post
                     $this->_oDb->setPostStatus($this->iViewingPostID);
                     $this->onPostApproveDisapprove($this->iViewingPostID, false);
                     $iApproved = 2;
                 }
                 $sCurPostStatus = $this->_oDb->getActiveStatus($this->iViewingPostID);
                 switch ($iApproved) {
                     case 0:
                         $sSAAction = $sCurPostStatus == 'disapproval' ? 'approve' : 'disapprove';
                         $sSACaption = $sCurPostStatus == 'disapproval' ? $sApproveC : $sDisApproveC;
                         break;
                     case 1:
                         $sSAAction = 'disapprove';
                         $sSACaption = $sDisApproveC;
                         break;
                     case 2:
                         $sSAAction = 'approve';
                         $sSACaption = $sApproveC;
                         break;
                 }
             }
         }
         $sLink = $this->genBlogLink('show_member_blog_home', $aUser);
         $sViewingPostUri = $this->_oDb->getPostUriByID($this->iViewingPostID);
         $aViewingPost = array('Permalink' => $sViewingPostUri, 'Link' => $this->iViewingPostID);
         $sViewingPostLink = $this->genBlogLink('show_member_post', $aUser, '', $aViewingPost);
         $sLink = $this->genBlogLink('show_member_post', $aUser, '', $aViewingPost, '', true);
         $sProcessingFile = $this->genBlogSubUrl();
         bx_import('BxDolSubscription');
         $oSubscription = BxDolSubscription::getInstance();
         $aButton = $oSubscription->getButton($this->_iVisitorID, 'bx_' . $this->_oConfig->getUri(), '', $this->iViewingPostID);
         $sSubsAddon = $oSubscription->getData();
         $aActionKeys = array('edit_allowed' => $this->isAllowedPostEdit(-1) ? 'true' : 'false', 'visitor_id' => $this->_iVisitorID, 'owner_id' => $iMemberID, 'blog_owner_link' => $sOwnerBlogLinkSub, 'owner_title' => $sOwnerNickname, 'owner_name' => $aOwnerInfo['NickName'], 'admin_mode' => "'" . $this->bAdminMode . "'", 'post_id' => $this->iViewingPostID, 'post_featured' => (int) $iFeaturedStatus, 'sure_label' => _t('_Are_you_sure'), 'post_entry_url' => $sLink, 'post_inside_entry_url' => $sViewingPostLink, 'sSACaption' => $sSACaption, 'sSAAction' => $sSAAction, 'work_url' => $sProcessingFile, 'only_menu' => 0, 'sbs_blogs_title' => $aButton['title'], 'sbs_blogs_script' => $aButton['script'], 'site_url' => BX_DOL_URL_ROOT, 'allow_approve' => $bApproveAllowed, 'base_url' => $this->sHomeUrl, 'TitleShare' => $this->isAllowedShare($this->aViewingPostInfo) ? _t('_Share') : '');
         if (BxDolRequest::serviceExists('wall', 'get_repost_js_click')) {
             $sSubsAddon .= BxDolService::call('wall', 'get_repost_js_script');
             $aActionKeys['repostCpt'] = _t('_Repost');
             $aActionKeys['repostScript'] = BxDolService::call('wall', 'get_repost_js_click', array($this->_iVisitorID, 'bx_blogs', 'create', $this->iViewingPostID));
         }
         $sActionsVal = $GLOBALS['oFunctions']->genObjectsActions($aActionKeys, 'bx_blogs', false);
         return $sSubsAddon . $sActionsVal;
     }
 }
$sTemplate = 'short_profile_info.html';
if (isset($_GET['ID']) && (int) $_GET['ID'] > 0) {
    $iProfId = (int) $_GET['ID'];
    $aProfileInfo = getProfileInfo($iProfId);
    $aMemberInfo = getProfileInfo($iMemberId);
    $aProfileInfo['window_width'] = $oTemplConfig->popUpWindowWidth;
    $aProfileInfo['window_height'] = $oTemplConfig->popUpWindowHeight;
    $aProfileInfo['anonym_mode'] = $oTemplConfig->bAnonymousMode;
    $aProfileInfo['member_pass'] = $aMemberInfo['Password'];
    $aProfileInfo['member_id'] = $iMemberId;
    $bDisplayType = getParam('enable_new_dhtml_popups') == 'on' ? 0 : 1;
    $aProfileInfo['display_type'] = $bDisplayType;
    $aProfileInfo['url'] = BX_DOL_URL_ROOT;
    $aProfileInfo['status_message'] = process_line_output($aProfileInfo['UserStatusMessage']);
    //--- Subscription integration ---//
    $oSubscription = new BxDolSubscription();
    $aButton = $oSubscription->getButton($iMemberId, 'profile', '', $iProfId);
    $aProfileInfo['sbs_profile_title'] = $aButton['title'];
    $aProfileInfo['sbs_profile_script'] = $aButton['script'];
    //--- Subscription integration ---//
    //--- Check for member/non-member ---//
    if (isMember()) {
        $aProfileInfo['cpt_edit'] = _t('_EditProfile');
        $aProfileInfo['cpt_send_letter'] = _t('_SendLetter');
        $aProfileInfo['cpt_fave'] = _t('_Fave');
        $aProfileInfo['cpt_befriend'] = _t('_Befriend');
        $aProfileInfo['cpt_remove_friend'] = _t('_Remove friend');
        $aProfileInfo['cpt_greet'] = _t('_Greet');
        $aProfileInfo['cpt_get_mail'] = _t('_Get E-mail');
        $aProfileInfo['cpt_share'] = _t('_Share');
        $aProfileInfo['cpt_report'] = _t('_Report Spam');
Example #27
0
 * CC-BY License - http://creativecommons.org/licenses/by/3.0/
 */
define('BX_SECURITY_EXCEPTIONS', true);
$aBxSecurityExceptions = array('POST.body', 'REQUEST.body');
require_once '../inc/header.inc.php';
require_once BX_DIRECTORY_PATH_INC . 'design.inc.php';
require_once BX_DIRECTORY_PATH_INC . 'admin_design.inc.php';
require_once BX_DIRECTORY_PATH_INC . 'utils.inc.php';
require_once BX_DIRECTORY_PATH_INC . 'prof.inc.php';
bx_import('BxTemplFormView');
bx_import('BxDolEmailTemplates');
bx_import('BxDolPaginate');
bx_import('BxDolSubscription');
bx_import('BxTemplSearchResult');
$logged['admin'] = member_auth(1, true, true);
$oSubscription = new BxDolSubscription();
if ($_POST['queue_message'] && $_POST['msgs_id']) {
    $sActionResult = QueueMessage();
}
if ($_POST['add_message']) {
    $action = 'add';
}
if ($_POST['delete_message'] && $_POST['msgs_id']) {
    $sActionResult = DeleteMessage() ? _t('_adm_mmail_Message_was_deleted') : _t('_adm_mmail_Message_was_not_deleted');
}
if ($_POST['preview_message']) {
    $action = 'preview';
}
if (bx_get('action') == 'empty') {
    $sActionResult = EmptyQueue() ? _t('_adm_mmail_Queue_empty') : _t('_adm_mmail_Queue_emptying_failed');
}
Example #28
0
 /**
  * Function will generate the view message block ;
  *
  * @return   : Html presentation data ;
  */
 function getBlockCode_ViewMessage()
 {
     global $oSysTemplate;
     global $oFunctions;
     global $site;
     global $oTemplConfig;
     // init some needed variables;
     $sOutputHtml = null;
     $sActionsList = null;
     // generate page toggle ellements ;
     $aToggleItems = array('inbox' => _t('_Inbox'), 'outbox' => _t('_Outbox'), 'trash' => _t('_Trash'), 'compose' => _t('_Compose'));
     $sRequest = 'mail.php' . '?';
     foreach ($aToggleItems as $sKey => $sValue) {
         $aTopToggleEllements[$sValue] = array('href' => $sRequest . '&mode=' . $sKey, 'dynamic' => false, 'active' => false);
     }
     // language keys ;
     $aLanguageKeys = array('back_inbox' => _t('_Back') . ' ' . _t('_to') . ' ' . _t('_Inbox'), 'back_outbox' => _t('_Back') . ' ' . _t('_to') . ' ' . _t('_Outbox'), 'back_trash' => _t('_Back') . ' ' . _t('_to') . ' ' . _t('_Trash'), 'spam_message' => _t('_Spam report'), 'delete_message' => _t('_Delete'), 'reply_message' => _t('_Reply'), 'restore_message' => _t('_Restore'), 'are_you_sure' => _t('_Are you sure?'), 'more' => _t('_More actions'), 'mark_read' => _t('_Mark as old'), 'mark_unread' => _t('_Mark as New'));
     $sQuery = "\r\n                SELECT \r\n                    *,\r\n                    DATE_FORMAT(`Date`, '%d.%m.%Y %H:%i') AS `Date`\r\n                FROM \r\n                    `sys_messages` \r\n                WHERE \r\n                    `ID` = {$this->aMailBoxSettings['messageID']} \r\n                AND\r\n                    (\r\n                        `Sender` = {$this->aMailBoxSettings['member_id']}\r\n                            OR\r\n                        `Recipient` = {$this->aMailBoxSettings['member_id']}\r\n                    )\r\n            ";
     $rResult = db_res($sQuery);
     while (true == ($aRow = mysql_fetch_assoc($rResult))) {
         // ** generate member's information ;
         $sMemberIcon = get_member_thumbnail($aRow['Sender'], 'none');
         $aMemberInfo = getProfileInfo($aRow['Sender']);
         // define the back link;
         if ($aRow['Trash'] == 'recipient') {
             $sBackCaption = $aLanguageKeys['back_trash'];
             $sBackUrl = 'mail.php' . '?mode=trash';
         } else {
             if ($aRow['Sender'] == $this->aMailBoxSettings['member_id']) {
                 $sBackCaption = $aLanguageKeys['back_outbox'];
                 $sBackUrl = 'mail.php' . '?mode=outbox';
             } else {
                 $sBackCaption = $aLanguageKeys['back_inbox'];
                 $sBackUrl = 'mail.php' . '?mode=inbox';
             }
         }
         $sMemberNickName = $aMemberInfo['NickName'];
         $sMemberLocation = getProfileLink($aMemberInfo['ID']);
         $sMemberSexImage = isset($aMemberInfo['Sex']) ? $oFunctions->genSexIcon($aMemberInfo['Sex']) : null;
         $sMemberAge = isset($aMemberInfo['DateOfBirth']) && $aMemberInfo['DateOfBirth'] != "0000-00-00" ? _t("_y/o", age($aMemberInfo['DateOfBirth'])) : null;
         $sMemberCountry = isset($aMemberInfo['Country']) && $aMemberInfo['Country'] ? $aMemberInfo['Country'] : null;
         $sMemberFlag = $sMemberCountry ? $site['flags'] . strtolower($sMemberCountry) . $this->sMembersFlagExtension : null;
         if ($sMemberCountry) {
             $sMemberCountryFlag = '<img src="' . $sMemberFlag . '" alt="' . $sMemberCountry . '" />';
         }
         $sCity = isset($aMemberInfo['City']) && $aMemberInfo['City'] ? $aMemberInfo['City'] . ', ' : null;
         // member's city and country;
         $sMemberCountry = $sCity . $sMemberCountry;
         // generate the member's actions list;
         if ($aRow['Sender'] != $this->aMailBoxSettings['member_id']) {
             // prepare all needed keywords ;
             $aMemberInfo['window_width'] = $oTemplConfig->popUpWindowWidth;
             $aMemberInfo['window_height'] = $oTemplConfig->popUpWindowHeight;
             $aMemberInfo['anonym_mode'] = $oTemplConfig->bAnonymousMode;
             $aMemberInfo['member_pass'] = $aMemberInfo['Password'];
             $aMemberInfo['member_id'] = $aMemberInfo['ID'];
             $bDisplayType = getParam('enable_new_dhtml_popups') == 'on' ? 0 : 1;
             $aMemberInfo['display_type'] = $bDisplayType;
             $aMemberInfo['url'] = BX_DOL_URL_ROOT;
             //--- Subscription integration ---//
             $oSubscription = new BxDolSubscription();
             $sAddon = $oSubscription->getData();
             $aButton = $oSubscription->getButton((int) $this->aMailBoxSettings['member_id'], 'profile', '', (int) $aRow['Sender']);
             $aMemberInfo['sbs_profile_title'] = $aButton['title'];
             $aMemberInfo['sbs_profile_script'] = $aButton['script'];
             //--- Subscription integration ---//
             $aMemberInfo['cpt_edit'] = '';
             $aMemberInfo['cpt_send_letter'] = _t('_SendLetter');
             $aMemberInfo['cpt_remove_friend'] = _t('_Remove friend');
             $aMemberInfo['cpt_fave'] = _t('_Fave');
             $aMemberInfo['cpt_befriend'] = _t('_Befriend');
             $aMemberInfo['cpt_greet'] = _t('_Greet');
             $aMemberInfo['cpt_get_mail'] = _t('_Get E-mail');
             $aMemberInfo['cpt_share'] = _t('_Share');
             $aMemberInfo['cpt_report'] = _t('_Report');
             $aMemberInfo['cpt_block'] = _t('_Block');
             $aMemberInfo['cpt_unblock'] = _t('_Unblock');
             $aMemberInfo['member_id'] = $this->aMailBoxSettings['member_id'];
             $sActionsList = $sAddon . $oFunctions->genObjectsActions($aMemberInfo, 'Profile');
         }
         // try to define the message status ;
         if ($aRow['Sender'] == $this->aMailBoxSettings['member_id']) {
             if (strstr($aRow['Trash'], 'sender')) {
                 $this->aMailBoxSettings['mailbox_mode'] = 'trash';
             } else {
                 $this->aMailBoxSettings['mailbox_mode'] = 'outbox';
             }
             $sRelocateParameter = 'outbox';
         } else {
             if ($aRow['Sender'] != $this->aMailBoxSettings['member_id']) {
                 if (strstr($aRow['Trash'], 'recipient')) {
                     $this->aMailBoxSettings['mailbox_mode'] = 'trash';
                 } else {
                     $this->aMailBoxSettings['mailbox_mode'] = 'inbox';
                 }
                 $sRelocateParameter = 'inbox';
             }
         }
         // generate extended mailbox actions
         switch ($this->aMailBoxSettings['mailbox_mode']) {
             case 'inbox':
                 // generate actions for inbox mode ;
                 $aForm = array('form_attrs' => array('action' => null, 'method' => 'post'), 'params' => array('remove_form' => true, 'db' => array('submit_name' => 'do_submit')), 'inputs' => array('actions' => array('type' => 'input_set', 'colspan' => 'true', 0 => null, 1 => array('type' => 'button', 'value' => $aLanguageKeys['spam_message'], 'attrs' => array('onclick' => 'if ( typeof oMailBoxViewMessage != \'undefined\') oMailBoxViewMessage.spamMessages(\'\', ' . $aRow['Sender'] . ')')), 2 => array('type' => 'button', 'value' => $aLanguageKeys['delete_message'], 'attrs' => array('onclick' => 'if ( typeof oMailBoxViewMessage != \'undefined\') oMailBoxViewMessage.deleteMessages(' . $aRow['ID'] . ')')), 3 => array('type' => 'select', 'values' => array('' => $aLanguageKeys['more'], 'unread' => $aLanguageKeys['mark_unread'], 'read' => $aLanguageKeys['mark_read']), 'attrs' => array('onchange' => 'if ( typeof oMailBoxViewMessage != \'undefined\') oMailBoxViewMessage.markMessages(this.value, ' . $aRow['ID'] . ')')))));
                 if ($aRow['Sender'] != $this->aMailBoxSettings['member_id']) {
                     $aForm['inputs']['actions'][0] = array('type' => 'button', 'value' => $aLanguageKeys['reply_message'], 'attrs' => array('onclick' => 'oMailBoxViewMessage.replyMessage(' . $this->aMailBoxSettings['messageID'] . ', ' . $aRow['Sender'] . ');'));
                 }
                 $oForm = new BxTemplFormView($aForm);
                 $sMessageBoxActions = $oForm->getCode();
                 break;
             case 'outbox':
                 // generate actions for outbox mode ;
                 $aForm = array('form_attrs' => array('action' => null, 'method' => 'post'), 'params' => array('remove_form' => true, 'db' => array('submit_name' => 'do_submit')), 'inputs' => array('actions' => array('type' => 'input_set', 'colspan' => 'true', 0 => array('type' => 'button', 'value' => $aLanguageKeys['delete_message'], 'attrs' => array('onclick' => 'if (typeof oMailBoxViewMessage != \'undefined\') oMailBoxViewMessage.deleteMessages(' . $aRow['ID'] . ')')))));
                 $oForm = new BxTemplFormView($aForm);
                 $sMessageBoxActions = $oForm->getCode();
                 break;
             case 'trash':
                 // generate actions for outbox mode ;
                 $aForm = array('form_attrs' => array('action' => null, 'method' => 'post'), 'params' => array('remove_form' => true, 'db' => array('submit_name' => 'do_submit')), 'inputs' => array('actions' => array('type' => 'input_set', 'colspan' => 'true', 0 => null, 1 => array('type' => 'button', 'value' => $aLanguageKeys['restore_message'], 'attrs' => array('onclick' => 'if (typeof oMailBoxViewMessage != \'undefined\') oMailBoxViewMessage.restoreMessages(' . $aRow['ID'] . ');')))));
                 if ($aRow['Sender'] != $this->aMailBoxSettings['member_id']) {
                     $aForm['inputs']['actions'][0] = array('type' => 'button', 'value' => $aLanguageKeys['reply_message'], 'attrs' => array('onclick' => 'oMailBoxViewMessage.replyMessage(' . $this->aMailBoxSettings['messageID'] . ', ' . $aRow['Sender'] . ');'));
                 }
                 $oForm = new BxTemplFormView($aForm);
                 $sMessageBoxActions = $oForm->getCode();
                 break;
         }
         // prepare for output ;
         $aTemplateKeys = array('inbox_mode' => $sBackUrl, 'back_to_inbox' => $sBackCaption, 'back_img_src' => getTemplateIcon('back_to_inbox.png'), 'member_thumbnail' => $sMemberIcon, 'member_nick_name' => $sMemberNickName, 'member_location' => $sMemberLocation, 'member_sex_img' => $sMemberSexImage, 'member_sex' => $aMemberInfo['Sex'], 'member_age' => $sMemberAge, 'member_flag' => $sMemberCountryFlag, 'city_country' => $sMemberCountry, 'clock_img' => getTemplateIcon('clock.png'), 'date_create' => $aRow['Date'], 'message_subject' => $aRow['Subject'], 'member_actions_list' => $sActionsList, 'message_text' => $aRow['Text'], 'are_you_sure' => $aLanguageKeys['are_you_sure'], 'current_page' => 'mail.php', 'spam_message' => $aLanguageKeys['spam_message'], 'delete_message' => $aLanguageKeys['delete_message'], 'message_id' => $aRow['ID'], 'message_actions' => $sMessageBoxActions, 'page_mode' => $sRelocateParameter);
         // build and return final template ;
         $sOutputHtml = $oSysTemplate->parseHtmlByName($this->aUsedTemplates['view_message_box'], $aTemplateKeys);
     }
     // if message nothing found ;
     if (!mysql_num_rows($rResult)) {
         $sOutputHtml = MsgBox(_t('_Empty'));
     }
     return array($oTemplConfig->sTinyMceEditorJS . $sOutputHtml, $aTopToggleEllements);
 }
Example #29
0
function profile_delete($ID, $isDeleteSpammer = false)
{
    //global $MySQL;
    global $dir;
    //recompile global profiles cache
    $GLOBALS['MySQL']->cleanCache('sys_browse_people');
    $ID = (int) $ID;
    if (!$ID) {
        return false;
    }
    if (!($aProfileInfo = getProfileInfo($ID))) {
        return false;
    }
    $iLoggedInId = getLoggedId();
    db_res("DELETE FROM `sys_admin_ban_list` WHERE `ProfID`='" . $ID . "' LIMIT 1");
    db_res("DELETE FROM `sys_greetings` WHERE `ID` = '{$ID}' OR `Profile` = '{$ID}'");
    db_res("DELETE FROM `sys_block_list` WHERE `ID` = '{$ID}' OR `Profile` = '{$ID}'");
    db_res("DELETE FROM `sys_messages` WHERE Recipient = {$ID} OR `Sender` = {$ID}");
    db_res("DELETE FROM `sys_fave_list` WHERE ID = {$ID} OR Profile = {$ID}");
    db_res("DELETE FROM `sys_friend_list` WHERE ID = {$ID} OR Profile = {$ID}");
    db_res("DELETE FROM `sys_acl_levels_members` WHERE `IDMember` = {$ID}");
    db_res("DELETE FROM `sys_tags` WHERE `ObjID` = {$ID} AND `Type` = 'profile'");
    db_res("DELETE FROM `sys_sbs_entries` WHERE `subscriber_id` = {$ID} AND `subscriber_type` = '1'");
    // delete profile votings
    require_once BX_DIRECTORY_PATH_CLASSES . 'BxDolVoting.php';
    $oVotingProfile = new BxDolVoting('profile', 0, 0);
    $oVotingProfile->deleteVotings($ID);
    // delete profile comments
    require_once BX_DIRECTORY_PATH_CLASSES . 'BxDolCmts.php';
    $oCmts = new BxDolCmts('profile', $ID);
    $oCmts->onObjectDelete();
    // delete all comments in all comments' systems, this user posted
    $oCmts->onAuthorDelete($ID);
    $iPossibleCoupleID = (int) db_value("SELECT `ID` FROM `Profiles` WHERE `Couple` = '{$ID}'");
    if ($iPossibleCoupleID) {
        db_res("DELETE FROM `Profiles` WHERE `ID` = '{$iPossibleCoupleID}'");
        //delete cache file
        deleteUserDataFile($iPossibleCoupleID);
    }
    // delete associated locations
    if (BxDolModule::getInstance('BxWmapModule')) {
        BxDolService::call('wmap', 'response_entry_delete', array('profiles', $ID));
    }
    //delete all subscriptions
    $oSubscription = BxDolSubscription::getInstance();
    $oSubscription->unsubscribe(array('type' => 'object_id', 'unit' => 'profile', 'object_id' => $ID));
    db_res("DELETE FROM `Profiles` WHERE `ID` = '{$ID}'");
    if ($isDeleteSpammer) {
        bx_import('BxDolStopForumSpam');
        $oBxDolStopForumSpam = new BxDolStopForumSpam();
        $oBxDolStopForumSpam->submitSpammer(array('username' => $aProfileInfo['NickName'], 'email' => $aProfileInfo['Email'], 'ip' => bx_member_ip_get_last($ID)));
    }
    // delete moxiemanager files
    $sMoxieFilesPath = BX_DIRECTORY_PATH_ROOT . 'media/moxie/files/' . substr($aProfileInfo['NickName'], 0, 1) . '/' . substr($aProfileInfo['NickName'], 0, 2) . '/' . substr($aProfileInfo['NickName'], 0, 3) . '/' . $aProfileInfo['NickName'];
    bx_rrmdir($sMoxieFilesPath);
    // create system event
    $oZ = new BxDolAlerts('profile', 'delete', $ID, 0, array('profile_info' => $aProfileInfo, 'logged_in' => $iLoggedInId, 'delete_spammer' => $isDeleteSpammer));
    $oZ->alert();
    //delete cache file
    deleteUserDataFile($ID);
}
Example #30
0
 function serviceViewBlockProfileTimeline($mixed, $iStart = -1, $iPerPage = -1, $sFilter = '', $sTimeline = '', $sType = 'id', $aModules = array())
 {
     $sContent = '';
     $sJsObject = $this->_oConfig->getJsObject('view');
     $aOwner = $this->_oDb->getUser($mixed, $sType);
     $this->_iOwnerId = $aOwner['id'];
     if (!$this->_isViewAllowed()) {
         return $sContent;
     }
     $oSubscription = BxDolSubscription::getInstance();
     $aButton = $oSubscription->getButton($this->_getAuthorId(), 'bx_wall', '', $this->_iOwnerId);
     $aTopMenu = array('wall-view-all' => array('href' => 'javascript:void(0)', 'onclick' => 'javascript:' . $sJsObject . '.changeFilter(this)', 'title' => _t('_wall_view_all'), 'active' => 1), 'wall-view-owner' => array('href' => 'javascript:void(0)', 'onclick' => 'javascript:' . $sJsObject . '.changeFilter(this)', 'title' => _t('_wall_view_owner', getNickName($aOwner['id']))), 'wall-view-other' => array('href' => 'javascript:void(0)', 'onclick' => 'javascript:' . $sJsObject . '.changeFilter(this)', 'title' => _t('_wall_view_other')), 'wall-get-rss' => array('href' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'rss/' . $aOwner['username'] . '/', 'target' => '_blank', 'title' => _t('_wall_get_rss')), 'wall-subscription' => array('href' => 'javascript:void(0);', 'onclick' => 'javascript:' . $aButton['script'] . '', 'title' => $aButton['title']));
     if ($iStart == -1) {
         $iStart = 0;
     }
     if ($iPerPage == -1) {
         $iPerPage = $this->_oConfig->getPerPage('profile');
     }
     if (empty($sFilter)) {
         $sFilter = BX_WALL_FILTER_ALL;
     }
     $aVariables = array('timeline' => $this->_getTimeline($iStart, $iPerPage, $sFilter, $sTimeline, $aModules), 'content' => $this->_getPosts('desc', $iStart, $iPerPage, $sFilter, $sTimeline, $aModules), 'view_js_content' => $this->_oTemplate->getJsCode('view', array('iOwnerId' => $this->_iOwnerId), array('WallOwnerId' => $this->_iOwnerId, 'WallStart' => $iStart, 'WallPerPage' => $iPerPage, 'WallFilter' => $sFilter, 'WallTimeline' => $sTimeline, 'WallModules' => $aModules)));
     $GLOBALS['oTopMenu']->setCurrentProfileID((int) $this->_iOwnerId);
     bx_import('BxTemplFormView');
     $oForm = new BxTemplFormView(array());
     $oForm->addCssJs(true, true);
     $this->_oTemplate->addCss(array('view.css', 'view_phone.css'));
     $this->_oTemplate->addJs(array('modernizr.js', 'main.js', 'view.js'));
     return array($oSubscription->getData() . $this->_oTemplate->parseHtmlByName('view.html', $aVariables), $aTopMenu, LoadingBox('bx-wall-view-loading'), false, 'getBlockCaptionMenu');
 }