Example #1
0
function sectional()
{
    $OBJ =& get_instance();
    global $rs;
    $pages = $OBJ->db->fetchArray("SELECT id, title, content, url, \n        section, sec_desc, sec_disp, year, secid    \n        FROM " . PX . "objects, " . PX . "sections \n        WHERE status = '1' \n        AND hidden != '1' \n        AND section_id = secid  \n        ORDER BY sec_ord ASC, ord ASC");
    if (!$pages) {
        return 'Error with pages query';
    }
    foreach ($pages as $record) {
        $record['content'] = truncate($record['content']);
        $order[$record['sec_desc']][] = array('id' => $record['id'], 'title' => $record['title'], 'preview' => $record['content'], 'url' => $record['url'], 'year' => $record['year'], 'secid' => $record['secid'], 'disp' => $record['sec_disp']);
    }
    return section_list($order);
}
Example #2
0
function section_delete()
{
    $name = ps('name');
    safe_delete("txp_section", "name='{$name}'");
    section_list(messenger('section', $name, 'deleted'));
}