News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

Hi SMF newbie questions

Started by SiUK, March 07, 2010, 12:17:39 PM

Previous topic - Next topic

SiUK

Hello, just registered :-)

I installed SMF v 1.1.11 last night, and I have a couple of queries:

1.) I created a custom login page on my website today, and using a modified SSI (I styled the login in the SSI.php) I can now login to the SMF forums from my custom login page (once logged in it redirects back to the same page to show no. of messages, and welcome, and link to continue to forums), and I can also logout from the page, which redirects back to same page to produce the login screen. Also, the logout link on the forums also now redirects back to the custom login page. Took me ages to work it out but it now works. Hurrah! But I would like to know this:

My question is: how can I redirect users that are not logged if they bypass my custom login page and go straight to the board index? I have set the board to members only, and manually removed registration links from the login screens and the the button bar, with a message about the forums being private (friends and family only..members registered by admin only)  But what I would like to do is redirect any 'guest' back to my custom login page so they don't even get the forums login screen.

2.) When posting I notice that the board sends you back to the message index. I have looked in the admin section for an option to stay on the topic but cannot see anything...not even under theme options (using a modified mobile theme by crip). It is very annoying being sent back to the message index.

I ran a very heavily customised flat file forums for over ten years (used YaBBSE Gold) and so more used to hacking about perl, and not at all used to PHP, but I seem to have worked out what to remove ;-). So can you please bear this in mind when answering.

Thankyou for your help.


sAce

why dont you just disable guest access, that will allow only members to browse the forum

acp > configuration > features and options

SiUK

Hello

Thanks for answer, but I have already done that. I am aware of that feature. I would still like to redirect to my login page instead of the forum login page appearing.

Thanks.

Arantor

2. is available from Current Theme > Reset Options, the option you want to be setting on user profiles is 'Return to the topic after posting'.

1. is a little trickier though by no means impossible. So, let me clarify exactly, you want to totally hide the forum own registration screen. What about the forum own login screen? Say they're a guest and try and go to... I don't know... user profiles. If guests aren't allowed to see that, up pops the "You're not allowed to access [this]" with a login box.
Holder of controversial views, all of which my own.


SiUK

#4
Hello.

2) Thanks. Man alive, those options were well buried away! :-)

Under reset options only options for two themes were listed, but then I read the text (doh!) and realised that the default theme's options were being used by the theme I was using. Anyhow, sorted.

1)
Quoteyou want to totally hide the forum own registration screen.

Yes. Well so far I've removed the links to the registration from the forum login screen and commented out the button bar code for the registration link.

QuoteWhat about the forum own login screen?

Yes, that especially.

QuoteSay they're a guest and try and go to... I don't know... user profiles. If guests aren't allowed to see that, up pops the "You're not allowed to access [this]" with a login box.

Well, yes, if they try and view anything directly and they are a guest, I want them to be redirected to my custom login page.

And also:

At the moment, ff a member (or anyone) enters an incorrect username and password from my custom login page the forum login page appears. I want to be able to redirect incorrect attempts back to my page..or a custom page. Is that possible?

Sorry for delay in reply. Just got back in.

Thankyou.

Arantor

Sure it's possible, just the more you try and hide SMF's away the harder it gets to actually make it all work properly.

That said, I'm sure I documented how to achieve this a while ago with redirectexit in Register.php and the changes to make for it.
Holder of controversial views, all of which my own.


SiUK

Hello.

Thanks again for help. Well that was fun..sort of!   ;)

There are quite a number of redirects to add, depending on type of error or validation. Anyhow, it works perfectly now. If a guest tries to access the board index they get redirect. Any username or password error or cookie problem and they get redirected to a custom Oops! page  ;D The three files I modified were:

Register.php
index.php
LogInOut.php

I still have to add a redirect so that when guests attempt to access a topic directly they get sent back to the Oops! page.

Arantor

That's Display.php that deals with that.
Holder of controversial views, all of which my own.


SiUK

Thanks, Arantor. That was a very quick response.

I'll go take a look now.


SiUK

Could you give me a pointer? I don't seem to be able to find this one.

If someone directly enters this url: hxxp://mydomain.com/private/index.php?topic=3.0 into their browser's address field, I am looking to redirect to custom Oops.php page.

At the moment the forum login box appears with this message:

Warning!
The topic or board you are looking for appears to be either missing or off limits to you.


The URL in the browser's address field doesn't change however.

Maybe I'm just being thick, but I can't find how to redirect this in Display.php ...sorry.


Arantor

I think you're looking for the is_not_guest() call in Display.php off the top of my head.
Holder of controversial views, all of which my own.


Advertisement: