Updating access denied or acces of forbidden duplicates

I use MSE and language editor both and if I make a change to the Access denied or forbidden, it changes both the title of the page and in the page content.

and I f I have images or too long of a description it really screws up my pages.is there a way to just change the content?

Quote · 9 Apr 2012

by default it uses same lang key for page title and msg but you can change it if you dive in codes. For you to start up take a look at displayAccessDenied() function in 

inc/classes/BxDolTemplate.php at line 1572

and if it a module that uses a twig class you need to look in ( i wonder what "twig" mean Undecided)

BxDolTwigTemplate.php at line 121

i hope you understand the above...

so much to do....
Quote · 9 Apr 2012

I found those, I even added a second key and changed the $stitle at msgbox to $stitleb and made $stitleb had the new key assigned to it. I cleared my cache and it still didnt change

so i looked at the one I was testing was for the photos and it uses the key _bx_photos_forbidden

for that error message where would I find this to change?

Quote · 9 Apr 2012

well it was not tested by me but i thought it will work....:(

so much to do....
Quote · 9 Apr 2012

in the inc/classes/bxDolTwigTemplate.php around line 121  find this

 

    function displayAccessDenied () {
        $this->pageStart();
###
#SteveSoft
#04-07-2012
#       
        echo MsgBox(_t('_Login_or_join_now'));
        $this->pageCode (_t('_Member_Access_Only'), true, false);
    }   

I added 2 keys _Login_or_join_now <- displays your message

_Member_Access_Only <- is the title of the box

 

When they access a page they shouldn't they get the message you choose and the title of the msgbox you want.

 

Hope that helps!

 

http://www.mytikibar.com
Quote · 10 Apr 2012

well I have just tried that changing the title and msgbox keys but It still hasnt changed to my new messages. I even compiled the language file again

I am not sure if I am supposed to do anything else besides make a new key and change the key in the function.

 

Quote · 12 Apr 2012

None of the solutions provided are correct for the specific message your trying to change. Both are misunderstanding your request.

Reverse all the changes you made so far. I will provide a solution in a few minutes. I have to work on it. Unfortunately the code that needs to be changed is shared by the files, photos, videos and sounds modules.

It will not be quite as simple, but should not be too difficult.

Give me a few, i will be back.

https://www.deanbassett.com
Quote · 12 Apr 2012

Ok. This edit will need 4 new language keys. Because the code is shared by 4 modules, the change will require that all 4 be separated.

So create the following 4 keys.Do not change the keys names from the ones i provide. The prefix has to be accurate as it is part of the code.

So. The 4 new language keys are....
Language Key - _bx_files_forbidden_box_header
Language Text - Access is forbidden

Language Key - _bx_photos_forbidden_box_header
Language Text - Access is forbidden

Language Key - _bx_sounds_forbidden_box_header
Language Text - Access is forbidden

Language Key - _bx_videos_forbidden_box_header
Language Text - Access is forbidden


Now for the code change.

Edit inc/classes/BxDolFilesModule

At around line 213 look for this.

    function actionView ($sUri) {
        $aIdent = array(
           'fileUri' => $sUri,
        );
        $aInfo = $this->_oDb->getFileInfo($aIdent);
        if (!empty($aInfo)) {
           if (!$this->isAllowedView($aInfo)) {
               $sKey  = _t('_' . $this->_oConfig->getMainPrefix() . '_forbidden');
               $sCode = DesignBoxContent($sKey, MsgBox($sKey), 1);
           }
           else {


Change it to this.

    function actionView ($sUri) {
        $aIdent = array(
           'fileUri' => $sUri,
        );
        $aInfo = $this->_oDb->getFileInfo($aIdent);
        if (!empty($aInfo)) {
           if (!$this->isAllowedView($aInfo)) {
               $sKey  = _t('_' . $this->_oConfig->getMainPrefix() . '_forbidden');
               // Added this line to get contents of new key.
               $sKeyBoxHeader  = _t('_' . $this->_oConfig->getMainPrefix() . '_forbidden_box_header');
               //Changed this line to use new key in header
               $sCode = DesignBoxContent($sKeyBoxHeader, MsgBox($sKey), 1);
           }
           else {


The changes i made are marked.

Now you can change the box header text and what appears in the message box separately.

_bx_photos_forbidden will hold the text used in the message box.

and

_bx_photos_forbidden_box_header will hold the text used in the box header.



I am pretty sure this will do what you wanted to do. Unless of course i am also misunderstanding things. But as always, make backups so reversing changes is quick and painless.


https://www.deanbassett.com
Quote · 12 Apr 2012

Thank you Deano,

That actually worked. it fixed the header and msgbox area. I am still having a problem with the , I guess title right underneath the Top Menu.
when you click on photos  you have your Top Menu then right underneath you have a Icon and Title

Then under that a sub menu then block header and then the msg box.  The msg box content is the same as that Title next to the icon. bx_photo_forbidden   shows the same both in the msgbox and in that title. The Header mod works great. I dont know why they dont have that already built in dolphin.

 

Is there a way to have that title or whatever it is called set up as a third key?

Quote · 12 Apr 2012

Ok. I think i get it. All right. We will have to do it this way instead. You already did 4 of them, so just do the last 4 in this new set of instructions.

8 New Keys.

So create the following 8 keys.Do not change the keys names from the ones i provide. The prefix has to be accurate as it is part of the code.

So. The 8 new language keys are....
Language Key - _bx_files_forbidden_box_header
Language Text - Access is forbidden

Language Key - _bx_photos_forbidden_box_header
Language Text - Access is forbidden

Language Key - _bx_sounds_forbidden_box_header
Language Text - Access is forbidden

Language Key - _bx_videos_forbidden_box_header
Language Text - Access is forbidden

Language Key - _bx_files_forbidden_box_message
Language Text - Access is forbidden

Language Key - _bx_photos_forbidden_box_message
Language Text - Access is forbidden

Language Key - _bx_sounds_forbidden_box_message
Language Text - Access is forbidden

Language Key - _bx_videos_forbidden_box_message
Language Text - Access is forbidden


Now the code. Slightly different.

    function actionView ($sUri) {
        $aIdent = array(
           'fileUri' => $sUri,
        );
        $aInfo = $this->_oDb->getFileInfo($aIdent);
        if (!empty($aInfo)) {
           if (!$this->isAllowedView($aInfo)) {
               $sKey  = _t('_' . $this->_oConfig->getMainPrefix() . '_forbidden');
               // Added these 2 new lines to get contents of new keys.
               $sKeyBoxHeader  = _t('_' . $this->_oConfig->getMainPrefix() . '_forbidden_box_header');
               $sKeyBoxMessage  = _t('_' . $this->_oConfig->getMainPrefix() . '_forbidden_box_message');
               //Changed this line to use new keys.
               $sCode = DesignBoxContent($sKeyBoxHeader, MsgBox($sKeyBoxMessage ), 1);
           }
           else {



This way the origional key is used for the title and this provides two new keys for the header and the message box text.


EDIT: I must have edited this 3 or 4 times before i got it right. So just in case you grabbed this before i finished updating it, you may want to double check it.


https://www.deanbassett.com
Quote · 12 Apr 2012

lol

I noticed after I copied and pasted the message wasnt working and then I had noticed that you had header on both ends of the new code, I've done that before on some other php projects i've worked on. Copied and pasted and forget to change everything.

But yes it now works. You are the best person ever. I have my _forbidden one Text      the forbidden_header another text   and the forbidden message my membership upgrade page. I originally had it redirecting to my membership page, but somehow it messes up and redirects at different time. So now I can take that out and just put my member ship page code in the forbidden_Message

 

Thank you again believe it or not, just that little bit is helping me understand just how dolphin works.

Quote · 12 Apr 2012

Alrighty then.

Now on to my next battle. Or hmmm. perhaps some sleep first.

https://www.deanbassett.com
Quote · 12 Apr 2012
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.