Skip to main content Help Control Panel

Aubagne HipHop

Tout le Hip Hop d'Aubagne et des alentours

Home «   Server software «  

Documentation: decisions/decisions.php

Class Decisions - The database abstraction layer for decisions

Decisions are a way to record signatures added to pages. Information stored in a decision includes:

At the moment YACS supports following decision types:

This script is a reference file of this system.

Licence: GNU Lesser General Public License

Auteurs:

delete() - Delete one decision

function delete($id)



Voir aussi:

delete_for_anchor() - Delete all decisions for a given anchor

function delete_for_anchor($anchor)



Voir aussi:

get() - Get one decision by id

function &get($id)



Voir aussi:

get_ballot() - Link to surfer ballot, if any

function get_ballot($anchor)

get_img() - Get a element

function get_img($type)



get_next_url() - Get id of next decision

function get_next_url($item, $anchor, $order='date', $capability='?')

This function is used to build navigation bars.

Voir aussi:

get_options() - Get types as options of a <SELECT> field

function get_options($type)



Voir aussi:

get_previous_url() - Get id of previous decision

function get_previous_url($item, $anchor, $order='date', $capability='?')

This function is used to build navigation bars.

Voir aussi:

get_radio_buttons() - Get types as radio buttons

function get_radio_buttons($name, $type)



Voir aussi:

get_results_for_anchor() - Sum up all decisions for one anchor

function get_results_for_anchor($anchor)

get_title() - Get a default title from the type selected

function get_title($type)

get_url() - Get the url to view a decision

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

By default, a relative URL will be provided (e.g. 'decisions/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. 'decisions/view.php/512').

Voir aussi:

list_by_date() - List newest decisions

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

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


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

Voir aussi:

list_by_date_for_anchor() - List newest decisions for one anchor

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

If variant is 'compact', the list start with the most recent decisions. Else decisions are ordered depending of their edition date.

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


Voir aussi:

list_by_date_for_author() - List newest decisions for one author

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

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

list_selected() - List selected decisions

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

Accept following layouts:

list_threads_by_date() - Thread newest decisions

function &list_threads_by_date($offset=0, $count=10, $variant='date')

Result of this query should be processed with a layout adapted to articles

Voir aussi:

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

function post($fields)

On error this script updates $context['error'].

Voir aussi:

search() - Search for some keywords in all decisions

function &search($pattern, $offset=0, $count=10, $variant='search')



setup() - Create tables for decisions

function setup()

Voir aussi:

stat() - Get some statistics

function &stat()



Voir aussi:

stat_for_anchor() - Get some statistics for one anchor

function &stat_for_anchor($anchor, $capability='?')



Voir aussi:

stat_threads() - Get some statistics on threads

function &stat_threads()



Voir aussi:

Tools
Browse the source of this script
Server software