How to code up a disclaimer page users must pass through to reach certain board?

Started by ElectricSquid, May 20, 2008, 01:03:07 PM

Previous topic - Next topic

ElectricSquid

I searched that whole template for all sorts of keywords in his "find this" code, but nothing. It's not there and I don't know why. Maybe it's the theme i'm using ???

edit-  but the boards show on my cellphone. I use the cell all the time to reply and stuff.

ElectricSquid

I also checked TPwireless.template and Wireless.template. Nothing.
I searched for "loadTemplate" and "MessageIndex" from the "loadTemplate('MessageIndex');" part of the "find this" code.

Eliana Tamerin

No, in your Sources folder. You're looking in /Themes/default when you should be looking in /Sources for the MessageIndex.php file (it's not a template file).
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!


ElectricSquid

OK, found it, did it, but it did nothing at all.
No errors or anything, just no change. Is there something else I'm supposed to be doing along with his code to make it work?

[SiNaN]

For that we should change the Display.php file. But in that case it will show the disclaimer page for every topic they go in. That can be annoying. Remove the link at the last post, you can just show the last post's subject.
Former SMF Core Developer | My Mods | SimplePortal

Eliana Tamerin

Could also just change the last post link on the board index, no?
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

ElectricSquid

Removing the link for the latest reply sounds like the easiest and least annoying solution. How do i do that for that board only without losing the link in all our other boards lastest replies?

[SiNaN]

BoardIndex.template.php

Find:

$board['last_post']['link']

Replace:

$board['id'] == '1453' ? $board['last_post']['subject'] : $board['last_post']['link']

Change the 1453 as the board ID. If you want to make it for a couple of boards, you can use in_array function.
Former SMF Core Developer | My Mods | SimplePortal

ElectricSquid

I have board 122 and 123 that needs it. How do i do the in_array for that. Please forgive my newness to this. Im trying to learn as much as i can, as fast as i can, as i go. Thank you for all this great help.

[SiNaN]

If you have two, then you can use this:

($board['id'] == '122' || $board['id'] == '123') ? $board['last_post']['subject'] : $board['last_post']['link']

If you had more, it should have to be:

in_array($board['id'], array(1,2,3,4,5)) ? $board['last_post']['subject'] : $board['last_post']['link']

1,2,3,4,5 are the board IDs.
Former SMF Core Developer | My Mods | SimplePortal

ElectricSquid

Thanks for the lesson and the code. I'll try that once i get home.

ElectricSquid

I tried it and it works perfectly.

Just what I needed to complete the redirect code. Now any user must pass through the Disclaimer Page and Agree before entering these chosen boards.

I have marked this topic as Solved, since the above given code works without error and I have achieved the desired effect by using it.

My thanks to all who helped create this mod


Illori

does not look like it, and i would recommend you upgrade to RC5 so you can get the security fixes. most people are no longer coding for versions of smf that have security issues in them.

Advertisement: