Announcement

  •  » Extensions
  •  » Creating a "not permitted page" nice created in the layout!

#1 2005-08-24 23:57:37

vcb
Member
2005-08-24
3

Creating a "not permitted page" nice created in the layout!

Ok what I've done is creating first 2 files:
permit.php in the root dir
and permit.tpl in the default them dir

Then in functions_category.inc.php change the function check_restrictions to this:

Code:

function check_restrictions( $category_id )
{
  global $user,$lang;

  if ( in_array( $category_id, $user['restrictions'] ) )
  {
    Header("Location: permit.php");
    exit();
  }
}

Then I've opened the permit.php and copied the content of register.php in it.
Next is copying from catagory.php line 75 to 268 (untill the thumbnail page)
And paste this below the line

Code:

//-------------------------------------------------------------- errors display

into permit.php

Then rename all the references to register to permit, like this:

Code:

//
// Start output of page
//
$title= $lang['register_page_title'];
include(PHPWG_ROOT_PATH.'include/page_header.php');

$template->set_filenames( array('permit'=>'permit.tpl') );

And in the end of permit.php
Should say:

Code:

$template->parse('permit');

Now we copy the content of catagory.tpl into permit.tpl.
I removed line 59 till 95 so you got only the div home standing from that point on.
Between these lines (I have it now hardcoded) you can add some text like not permitted and so on.
I use this adjustment in cooperation with the last topic i've made that makes it possible to show all
catagories, even the private ones.

I just post here my adjustments hopefully some-one can use it to, improve it (a lot of copy paste)

:)

Offline

 
  •  » Extensions
  •  » Creating a "not permitted page" nice created in the layout!

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact