Developer's Manual  System Variables and Constants  $suDOC

$suDOC

Array $suDOC is a global array that contains data of currently loaded page. In general, the array has elements equivalent to contnent table fields. See content table structure for more information on fieldsâŔ™ data types. The array has the following structure:

<?
$suDOC
= Array(
    
'id'         => int page_id,                
    
'parent'     => int page_parent,
    
'sort'       => string sort_order,
    
'sorttype'   => int sort_type,
    
'childs'     => int number_of_childs,
    
'path'       => string path,
    
'active'     => int active,
    
'map'        => int map,
    
'title'      => string page_title,
    
'short'      => string page_short_description,
    
'date'       => string datetime,
    
'template'   => array page_template,
    
'blocks'     => array page_blocks,
    
'custom'     => array page_custom_proeprties,
    
'search'     => int search,
    
'redirect'   => string redirect,
    
'owner'      => int page_creator,
    
'chger'      => int last_changer,
    
'cdate'      => string date_of_creation,
    
'udate'      => string date_of_last_update,     
    
'cache'      => string cache,                  // for internal use only
    
'userint'    => int userint,
    
'userbit'    => int userbit,
    
'userstr'    => string userstr,
    
'status'     => int status,                    // page status, for internal use only
    
'data'       => string data,                   // for internal use only.
    
'pdata'      => string pdata,                  // availabe in edit mode, for internal use only.
    
'pactive'    => int pactive,                   // availabe in edit mode, for internal use only.
    
'ptitle'     => string ptitle,                 // availabe in edit mode, for internal use only.
    
'chgerLogin' => string changer_login,          // availabe in edit mode, for internal use only.
    
'chgerName'  => string changer_name,           // availabe in edit mode, for internal use only.
    
'ownerLogin' => string page_creator_login,     // availabe in edit mode, for internal use only.
    
'ownerName'  => string page_creator_name,      // availabe in edit mode, for internal use only.
    
'e'          => int e,                         // availabe in edit mode, for internal use only.
    
'p'          => int p,                         // availabe in edit mode, for internal use only.
    
'wdata'      => string wdata,                  // availabe in edit mode, for internal use only.
    
'template_'  => string page_template,          // availabe in edit mode, for internal use only.
    
'lang'       => string language,
    
'timestamp'  => string timestamp,
    
'tmplTitle'  => string path_to_page_template,
    
'blocks_'    => string blocks                  // availabe in edit mode, for internal use only.
)
?>

Examples

Using $suDOC['id'] for selecting child pages of currently loaded page. Query returns pages in the same order as they appear in the SiteMap window.

<?
$active
= suPUBL ? ' AND active = 1 ' : '';
$query = "SELECT id, title, short
          FROM "
. suPAGES . "
          WHERE parent = "
. $suDOC['id'] . $active . "
          ORDER BY sort"
;
?>

Selecting first-level folders only.

<?
$active
= suPUBL ? ' AND active = 1 ' : '';
$query = "SELECT id, title, short
          FROM "
. suPAGES . "
          WHERE parent = 1 AND childs > 0 "
. $active . "
          ORDER BY sort"
;
?>
Please login to add comments.