[wikka-community] Page forward (was Site forward)

Dario Taraborelli dartar
Sun Feb 3 22:26:19 GMT 2008


Krzysztof,

I'm curious to know if you tried to test/update Dreck's code

http://wikkawiki.org/RedirectingPages

Dario

On 3 Feb 2008, at 17:12, Krzysztof Trybowski wrote:

> Dnia 1 lutego 2008 mahefa randimbisoa napisal(a):
>> Create a file redirect.php in actions/ folder and add put in it the
>> following code:
>> <?php
>> @ob_end_clean();
>> header('Location: '.$this->Href('', $page));
>> die();
>> ?>
>
>> Now, use just the following code inside the page bestofbeer:
>
>> {{redirect page="beer"}}
>
> Let's better add some basic checks to the code:
> -if $page is set and non-empty
> -if we don't redirect to the same page
>
> It doesn't check if we didn't make a loop of more pages, but this
> would require some more coding. For now the simple solution would be
> like this:
>
>
> <?php
> if (isset($page) and $page != '' and $this->GetPageTag() != $page) {
>        @ob_end_clean();
>        header('Location: '.$this->Href('', $page));
>        die();
> } else {
>        echo('Redirect error!');
> }
> ?>
>
> Regards, KT
>
> -- 
> Krzysztof Trybowski
>  Gadu-Gadu: 1458144 --- Skype: trybowski
>  AQQ: 141062 --- ICQ: 4350719 --- gpg key-id: 0xC937B0F2


--
Dario Taraborelli
Wikka Development Team
http://wikkawiki.org





More information about the community mailing list