miniBB ® 

miniBB

®
Support Forums
  
 | Start | Register | Search | Statistics | File Bank | Manual |
Specific miniBB Support Forums / Specific /  
 

display $l_returntoforums and footer with error messages

 
Author hubba
Guest
#1 | Posted: 7 Sep 2007 13:53 
hi,

even though i only have basic php-knowledgement, i managed to implement the "https://www.minibb.com/forums/12_3128_0.html" and "https://www.minibb.com/forums/12_4177_0.html" -workarounds. both work as considered, but what puzzles me is the following:

when trying to view profiles as guest, i get the output:
$l_profviewDenied (which i inserted as $errorMSG= in the workaround)
$l_returntoforums
and the footer which comes with addon_whoisonline

when i try to view a thread or login with an inactive account, i only get:
$l_accessDenied
without any return-link or footer

i tried to insert parts of the "restrict anonymous from viewing profiles"-workaround into index.php at line 235 (if ($forb>0) {), but it didn't really work and after all it'd be a core-destructive solution, which i wouldn't like.

could you please point me in the right direction of where i need to insert the link and footer for general failure messages?

thanks in advance
keep up the good work

Author Paul
Lead Developer 
#2 | Posted: 8 Sep 2007 10:50 
Sorry I didn't understand completely what you mean and/or why it is so important for you.

That's right, if the user tries to log in with inactive account, there is no link to forums, because - why it would be needed? Would it be so impossible or difficult just to press a BACK button? Or if you have forums for active profiles only, the user could not access the forums anyway, so why should be there a link. This code is built-in directly in index.php so if you would like to modify have a go.

Author hubba
Guest
#3 | Posted: 17 Sep 2007 14:33 
thanks for your answer

i'm running an admin-approval board, where all of my friends can register, but accounts have to be activated to make sure no one else can get in. that's why i implemented the two work arounds.

to avoid confusions, $l_accessDenied says "access denied. if you already registered and have logged in, your account has to be approved by an admin before you can enter the forums"

people might get confused if they can see the footer while not logged in, but get a simple "access denied" when registered and logged in for the first time. that's why i'd like to make no difference between the two error codes. but hey, maybe that's just my perfectionism. :)

Author Paul
Lead Developer 
#4 | Posted: 18 Sep 2007 01:25 
i'm running an admin-approval board, where all of my friends can register, but accounts have to be activated to make sure no one else can get in. that's why i implemented the two work arounds.

Have you checked this thread? There is no need to implement any kind of work-arounds I suppose...

Author hubba
Guest
#5 | Posted: 18 Sep 2007 10:42 
checked all the threads. it is working as i supposed it to work, only with that little blemish. :) but that's totally okay as i want to keep it simple and not ever touch the minibb-core (besides templates). thanks again for your work.

the other plugins are used to make it not only unable for anonymous visitors to post, but to disable making db-requests as unregistered user at all. that is why those two error-messages differ in terms of displaying footers.

i also wanted to say that i totally support your way of working on the software. nothing comes for free and to keep minibb as simple, quick, small and configurable as it could be, giving custom support hasn't to be for free. so thank you for all the time you spend unpaid in the forums anyway. keep on keeping on!

Author Paul
Lead Developer 
#6 | Posted: 18 Sep 2007 14:57 
Thank you for your support as well :-)

However I would like to be sure I understood that you achieved what you wanted.

1) Approving the users, have you used the method I suggested or still kept your own?

2) What do you mean by "blemish"?

3) the other plugins are used to make it not only unable for anonymous visitors to post, but to disable making db-requests as unregistered user at all. that is why those two error-messages differ in terms of displaying footers.

I am a bit confused... do not really understand what do you mean. If you set up $allForumsReg setting in setup_options.php to TRUE, that will mean guests won't be able to post. I think this is enough for guests, since they can't act nowhere else. Or are you supposing other things?..

Author hubba
Guest
#7 | Posted: 19 Sep 2007 07:19 
setup_options.php:
$allForumsReg=TRUE;
$registerInactiveUsers=TRUE;

=> unregistered users unable to post
=> new registered users unable to do anything until approved by admin

bb_specials.php:
defined array of all forums
including:
"$clForumsUsers=array();
foreach($clForums as $k) $clForumsUsers[$k]=array();"

+

/* Hack - hiding all forums from not logged users */
(as mentioned in https://www.minibb.com/forums/12_3128_0.html)

+

lang_xxx.php
if(!isset($clForums)) $clForums=array();
if($user_id!=0) {
foreach($clForums as $k) if(!in_array($user_id, $clForumsUsers[$k])) $clForumsUsers[$k][]=$user_id;

=> unregistered users unable to view anything

bb_plugins.php:
implemented
"/* Restrict anonymous users from viewing public profile */"-hack
(https://www.minibb.com/forums/12_4177_0.html)

=> unregistered users unable to view profiles

--
so the forums are totally unviewable for unregistered users, registering is possible but has to be approved by an admin ($emailadmin=1;)
it's totally private :)

the only thing unregistered users visiting the site can do is
- register
- log in with an existing account
- viewing overall stats through index.php?action=stats
- view memberlist through index.php?action=stats&lst=2

--
ad 2)

as ${$dbUserAct}=0; is implemented in the core (which i don't wanna touch) and produces a general error code ($l_accessDenied) without displaying any footer.
which is okay, but differs from the output from the hacks mentioned above (which display a footer after error message)

--
right now i'm playing around with the file_upload and image_gallery -plugin which i bought from you recently. maybe some more questions coming up :)

Author Paul
Lead Developer 
#8 | Posted: 19 Sep 2007 11:22 
You also can disable the stats with the bb_plugins.php code like

if($user_id==0 and $action=='stats'){
//your warning message code here
}

Ok I understand everything you did (correctly), the only thing I still can't get is what have you did with ${$dbUserAct} and how it's related to the modifications...

Author hubba
Guest
#9 | Posted: 19 Sep 2007 13:12 
thanks for your snippet. disabling stats at all is much more comfortable than the previous solution.

one last try to make myself clear :)

as it's in the core-code, ${$dbUserAct} decides whether a logged-in user is active or not and displays $l_accessDenied without any footers or backlinks. my problem is, i just can't find out where or how to add the code for the footer like it's added in the "restrict anonymous from viewing profiles"-hack which would be something like:

echo load_header();
echo ParseTpl(makeUp('main_warning'));
$endtime=get_microtime();
$totaltime=sprintf ("%01.3f", ($endtime-$starttime));
if(isset($includeFooter)) include($includeFooter); else echo ParseTpl(makeUp('main_footer'));
exit;

Author Paul
Lead Developer 
#10 | Posted: 20 Sep 2007 02:37 
Ok do you mean the default miniBB version? This question isn't related to your modifications?

That's right, if user logs in being inactive, he receives only $l_accessDenied message with no back links. But these links would be quite unuseful for him, do you understand it? :-) Even he clicks on any of the links, he can not access the forum. So why display them at all?

However...

In index.php there is only one place which says:

$l_returntoforums=''; $correctErr='';

and this would be the place where you could paste any of the links. And you were right from the beginning - it is part of if ($forb>0) { and nothing additionally can be improved or added here as an add-on or hack.

And by the way, it loads up the footer in full, but that's right, it won't parse any of the additional variables, because this condition works out even before loading of any plugins is started. But I personally don't see much problems in it, or the reason of confuse coming from your users.

Anyway, I think now there is no big problem to implement in the default miniBB version, that in this place, it loads up the script time and $includeFooter if specified. I will release it in 2.1.

If you want to modify it in advance, here is the solution:

1) In the $forb>0 condition, disable

//$l_loadingtime='';
//echo ParseTpl(makeUp('main_footer'));
//exit;

2) Before /* End stuff */ comment, paste:
else {

3) closer to the end of index.php where it says

}
else {
//loginError=1
if($loginError==1) $tpl='main_warning'; else $tpl='main_posthold';
echo load_header(); echo ParseTpl(makeUp($tpl));
}


BEFORE it paste the closing parenthese:

}//forb

It works on my side in all aspects.

Author hubba
Guest
#11 | Posted: 20 Sep 2007 06:32 
thanks paul! that was exactly what i meant!

btw. i got lightbox to work with imgs and automatic-gallery plugin. looks awesome! :) maybe i'll create a how-to thread later on.

Author Paul
Lead Developer 
#12 | Posted: 20 Sep 2007 09:07 
that was exactly what i meant!

Ok :-)

i got lightbox to work with imgs and automatic-gallery plugin. looks awesome! :) maybe i'll create a how-to thread later on.

Ok! So my help / custom support won't be needed, right?

I suppose only modification of bb_plugins.php was needed which defines the displaying method in parseMessage(). There you could assign the displaying with lightbox.

Specific miniBB Support Forums / Specific /
 display $l_returntoforums and footer with error messages
 Share Topic's Link

Your Reply Click this icon to move up to the quoted message


  ?
Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.


Before posting, make sure your message is compliant with forum rules; otherwise it could be locked or removed with no explanation.

 

 
miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Check out the Captcha add-on: protect your miniBB-forums from the automated spam and flood.


  ⇑