Skip to main content Help Control Panel

Aubagne HipHop

Tout le Hip Hop d'Aubagne et des alentours

Home «   Server software «  

Documentation: servers/servers.php

Class Servers - The database abstraction layer for servers

This script is a reference file of this system.

Licence: GNU Lesser General Public License

Auteurs:

delete() - Delete one server in the database

function delete($id)

get() - Get one server by id

function &get($id)

This function can be used to search for one server entry, either by id or submitting its nick name.

get_banned_pattern() - List banned servers

function get_banned_pattern()

This function is used to limit external links saved into the database. It makes a pattern suitable for preg_match() out of this list.

Banned hosts and domains are manually put in the configuration file for servers, as a list of words separated by spaces or commas.

Following domains are always banned:

Here is an example of usage:
// the url to check
$url = ...

// list banned servers
include_once '../servers/servers.php';
$banned_pattern Servers::get_banned_pattern();

// skip banned hosts
if(preg_match($banned_pattern$url))
    continue;


This function will always return a valid pattern string, even if no configuration file has been saved.

Voir aussi:

get_by_url() - Get one server by url

function &get_by_url($url)

This function can be used to search for one server entry.

get_url() - Get the url to view a server profile

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

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

Voir aussi:

list_by_date() - List newest servers

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

Used to list servers that have been ping us, or that have been manually added, recently.

Voir aussi:

list_by_date_for_anchor() - List servers anchored to the given reference

function &list_by_date_for_anchor($anchor, $offset=0, $count=10, $variant='compact')

This script is used to display feeders attached to categories.

Voir aussi:

list_for_feed() - List servers that will feed us

function &list_for_feed($offset=0, $count=10, $variant='feed')

This script is used internally to locate servers to be polled at feeding times. Profiles that have not been polled for a long time are returned first.

All entries are seeked, and the active field is not taken into account.

Voir aussi:

list_for_ping() - List servers to be pinged

function &list_for_ping($offset=0, $count=10, $variant='ping')

This script is used internally to locate servers to be pinged on content change.

All entries are seeked, and the active field is not taken into account.

Voir aussi:

list_for_search() - List servers to be searched

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

This script is used internally to locate servers to which search requests may be submitted.

All entries are seeked, and the active field is not taken into account.

Voir aussi:

list_selected() - List selected servers

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

Accept following variants:

ping() - Create or update a server entry

function ping($title, $url)

This function is called when a remote server pings us, to mean its content has changed.

If the provided URL does not exist, a new server profile is created. Else the profile is updated only if ping is still allowed for this server profile.

Voir aussi:

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

function post($fields)



Voir aussi:

setup() - Create or alter tables for servers

function setup()

Voir aussi:

stamp() - Stamp one server profile

function stamp($id)

This is used to remember the date of last feed.

$param int the id of the server to update

stat() - Get some statistics

function &stat()

Tools
Browse the source of this script
Server software