Development Wiki

From phpBB Development Wiki

Revision as of 00:43, 28 March 2009 by Highway of life (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

user::page user class member

$user->page contains an array of the following elements.

Assuming we are viewing a page at
and the phpBB3 installation is located at:

Parameter Description
page_name Contains the page name of the current page: index.php
page_dir Contains the current directory relative to the phpBB root: ../about
query_string Contains the query string parameters: cow=moo&cat=meow&mouse=squeak
script_path The current script path: /about/
root_script_path The phpBB root (script) path: /community/
page The current page including query string relative to the phpBB root path: ../about/index.php?cow=moo&cat=meow&mouse=squeak
forum (int) forum_id of the forum the user is currently viewing: 15

Elements of this array can be accessed using the following example.

echo $user->page['script_path'];

Example Var Dump

 'page_name'       => string 'index.php' (length=9)
 'page_dir'        => string '../about' (length=8)
 'query_string'    => string 'cow=moo&cat=meow&mouse=squeak' (length=29)
 'script_path'     => string '/about/' (length=7)
 'root_script_path'=> string '/community/' (length=11)
 'page'            => string '../about/index.php?cow=moo&cat=meow&mouse=squeak' (length=48)
 'forum'           => int 0

See Also