Uutiset:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu
Advertisement:

What 'action' is this?

Aloittaja Biology Forums, elokuu 06, 2013, 12:31:59 AP

« edellinen - seuraava »

Biology Forums

I'd like you to visit this example page (yes, it's a login/error page):

http://biology-forums.com/index.php?topic=808682

I'll like to know what 'action' this page belongs to so that I could code something to appear while in this action.

Sorck

That page appears because of a failed isAllowedTo('my_permission_here') call usually. It's slightly more complicated when it's on a topic page as it also considers the board that it's in so it might actually look more like isAllowedTo('view_topic', $id_board). Check out the isAllowedTo() function docs for more info on how it works.

As it's on a topic page it will be called in Display.php. The actual error page I assume is in Errors.template.php though I could be wrong.

Biology Forums

Lainaus käyttäjältä: Sorck - elokuu 06, 2013, 06:32:40 AP
That page appears because of a failed isAllowedTo('my_permission_here') call usually. It's slightly more complicated when it's on a topic page as it also considers the board that it's in so it might actually look more like isAllowedTo('view_topic', $id_board). Check out the isAllowedTo() function docs for more info on how it works.

As it's on a topic page it will be called in Display.php. The actual error page I assume is in Errors.template.php though I could be wrong.

Thanks, I looked up the text string "topic_gone" in display.php and error.php, and it wasn't there :( Where else could it be?

Edit: Found it, it's in Load.php ;)

IchBin™

There is no action. The action is based upon whether you see the actual word "action" in your URL. For example:

www.yourdomain.com/index.php?action=help

Action is equal to help.

If you want to check for something specific in a page, you have to look at your URL.

if (!empty($_GET['topic']) && $_GET['topic'] == '808682')
    echo 'do something here when in topic 808682';
IchBin™        TinyPortal

Biology Forums

Lainaus käyttäjältä: IchBin™ - elokuu 06, 2013, 05:01:26 IP
There is no action. The action is based upon whether you see the actual word "action" in your URL. For example:

www.yourdomain.com/index.php?action=help

Action is equal to help.

If you want to check for something specific in a page, you have to look at your URL.

if (!empty($_GET['topic']) && $_GET['topic'] == '808682')
    echo 'do something here when in topic 808682';

Thanks, IchBin™

Advertisement: