Skip to main content Help Control Panel

Aubagne HipHop

Tout le Hip Hop d'Aubagne et des alentours

Home «   Server software «  

Documentation: images/images.php

Class Images - The database abstraction layer for images

Images are saved into the file system of the web server. Each image also has a related record in the database.

This script is a reference file of this system.

Licence: GNU Lesser General Public License

Auteurs:

Testeurs:

delete() - Delete one image in the database and in the file system

function delete($id)

delete_for_anchor() - Delete all images for a given anchor

function delete_for_anchor($anchor)

get() - Get one image by id

function &get($id)

get_by_anchor_and_name() - Get one image by anchor and name

function &get_by_anchor_and_name($anchor, $name)

get_icon_href() - Get the web address of an image

function get_icon_href($item)

get_thumbnail_href() - Get the web address of one thumbnail

function get_thumbnail_href($item)

get_url() - Get the url to view an image

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

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

Voir aussi:

list_by_date() - List newest images

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

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


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

Voir aussi:

list_by_date_for_anchor() - List newest images for one anchor

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

Example: [php] include_once 'images/images.php'; $items = Images::list_by_date_for_anchor('section:12', 0, 10); $context['text'] .= Skin::build_list($items, 'compact'); [/code]

Voir aussi:

list_by_date_for_author() - List newest images for one author

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

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

Voir aussi:

list_by_size() - List biggest images

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

list_selected() - List selected images

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

Accept following variants:

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

function post($fields, $capability='?')

Accept following situations:

setup() - Create or alter tables for images

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