Skip to main content Help Control Panel

Aubagne HipHop

Tout le Hip Hop d'Aubagne et des alentours

Home «   Server software «  

Documentation: tables/tables.php

Class Tables - The database abstraction layer for tables

Tables are mySQL queries saved into the database, used to build dynamic tables on-the-fly. A nice feature to extend yacs with little effort. Also a very powerful tool to be used in conjonction with overlays that update the database directly.

This script is a reference file of this system.

Voir aussi:

Licence: GNU Lesser General Public License

Auteurs:

build() - Build one table

function build($id, $variant='simple')

Accept following variants:

delete() - Delete one table in the database

function delete($id)

delete_for_anchor() - Delete all tables for a given anchor

function delete_for_anchor($anchor)

get() - Get one table by id

function &get($id)

get_url() - Get the url to view an table

function get_url($id, $action='view')

By default, a relative URL will be provided (e.g. 'tables/view.php?id=512'), which may be not processed correctly by search engines. If the parameter 'with_friendly_urls' has been set to 'Y' in the configuration panel, this function will return an URL parsable by search engines (e.g. 'tables/view.php/512').

Voir aussi:

list_by_date() - List newest tables

function &list_by_date($offset=0, $count=10, $variant='full')

This function never lists inactive tables. It is aiming to provide a simple list of the most recent tables to put in simple boxes.

To build a simple box of the newest tables in your main index page, just use the following example:
// side bar with the list of most recent tables
include_once 'tables/tables.php';
$local['title_en'] = 'Most recent tables';
$local['title_fr'] = 'Tables récentes';
$title i18n::user('title');
$items Tables::list_by_date(010'');
$text Skin::build_list($items'compact');
$context['text'] .= Skin::build_box($title$text'navigation');


You can also display the newest table separately, using Tables::get_newest() In this case, skip the very first table in the list by using Tables::list_by_date(1, 10, '')

Voir aussi:

list_by_date_for_anchor() - List newest tables for one anchor

function &list_by_date_for_anchor($anchor, $offset=0, $count=20, $variant='no_anchor', $capability='?')

Example:
include_once 'tables/tables.php';
$items Tables::list_by_date_for_anchor(010'''section:12');
$context['text'] .= Skin::build_list($items'compact');


list_by_date_for_author() - List newest tables for one author

function &list_by_date_for_author($author_id, $offset=0, $count=20, $variant='date')

Example: include_once 'tables/tables.php'; $items = Tables::list_by_date_for_author(0, 10, '', 12); $context['text'] .= Skin::build_list($items, 'compact');

Voir aussi:

list_selected() - List selected tables

function &list_selected(&$result, $layout='compact', $capability='?')

@variant string 'compact' or nothing

post() - Post a new table or an updated table

function post($fields)



Voir aussi:

setup() - Create or alter tables for tables

function setup()

stat() - Get some statistics

function &stat()

stat_for_anchor() - Get some statistics for one anchor

function &stat_for_anchor($anchor)

Tools
Browse the source of this script
Server software