\MOD_layoutbits

Collection of functions that create elements for a page.

An example for its use: $layoutbits = MOD_layoutbits::get(); // get the singleton instance $id = $geo->getCityID($cityname);

Summary

Methods
Properties
Constants
PIC_100_100()
PIC_75_75()
PIC_50_50()
PIC_40_40()
PIC_30_30()
PIC_15_15()
__construct()
get()
test()
linkWithPicture()
linkWithPictureVar()
smallUserPic_userId()
smallUserPic_username()
smallUserPic_usernameVar()
userPic_userId()
userPic_username()
ago()
ago_qualified()
FindTrad()
GetPreference()
getParams()
fage_value()
truncate()
truncate_words()
getGenderTranslated()
No public properties found
No constants found
member_pic_url()
No protected properties found
N/A
_getThumb()
_dummyPic_userId()
_incognitoPic_userId()
_memberNotFoundPic()
$_instance
N/A

Properties

$_instance

$_instance : \MOD_layoutbits

Singleton instance

Type

\MOD_layoutbits

Methods

PIC_100_100()

PIC_100_100( $username,  $picfile,  $style)

Quasi-constant functions for userthumbnails

Parameters

$username
$picfile
$style

PIC_75_75()

PIC_75_75( $username,  $picfile,  $style)

Parameters

$username
$picfile
$style

PIC_50_50()

PIC_50_50( $username,  $picfile,  $style)

Parameters

$username
$picfile
$style

PIC_40_40()

PIC_40_40( $username,  $picfile,  $style)

Parameters

$username
$picfile
$style

PIC_30_30()

PIC_30_30( $username,  $picfile,  $style)

Parameters

$username
$picfile
$style

PIC_15_15()

PIC_15_15( $username,  $picfile,  $style)

Parameters

$username
$picfile
$style

__construct()

__construct()

get()

get() : \PApps

singleton getter

Returns

\PApps

test()

test()

linkWithPicture()

linkWithPicture(string $username,  $picfile, string $mode) : string

function LinkWithPicture build a link with picture and Username to the member profile.

Optional parameter status can be used to alter the link. Old version found in FunctionsTools.php

Usually it is more convenient to use smallUserPic_userId($userId) or smallUserPic_username($username)

Parameters

string $username
$picfile
string $mode

can be used to enable 'map_style'

Returns

string —

html-formatted link with picture

linkWithPictureVar()

linkWithPictureVar(string $username, string $height, string $width, string $quality, string $picfile, string $style) : string

function LinkWithPicture build a link with picture and Username to the member profile.

Optional parameter status can be used to alter the link. Old version found in FunctionsTools.php

Usually it is more convenient to use smallUserPic_userId($userId) or smallUserPic_username($username)

Parameters

string $username
string $height

of picture

string $width

of picture

string $quality

of picture

string $picfile

alternative picture path

string $style

css-class for the image-tag

Returns

string —

html-formatted link with picture

smallUserPic_userId()

smallUserPic_userId( $userId)

100x100 avatar picture for forums etc

Parameters

$userId

smallUserPic_username()

smallUserPic_username(string $username)

100x100 avatar picture for forums etc

Parameters

string $username

smallUserPic_usernameVar()

smallUserPic_usernameVar(string $username,  $height,  $width,  $quality)

XxX avatar picture for all over the website

Parameters

string $username
$height
$width
$quality

userPic_userId()

userPic_userId( $userId)

Parameters

$userId

userPic_username()

userPic_username( $username)

Parameters

$username

ago()

ago(int $timestamp) : string

returns a sentence based on a given timestamp like: 20 minutes ago

Parameters

int $timestamp

unix timestamp

Returns

string

ago_qualified()

ago_qualified( $timestamp)

Parameters

$timestamp

FindTrad()

FindTrad( $IdTrad,  $ReplaceWithBr)

Parameters

$IdTrad
$ReplaceWithBr

GetPreference()

GetPreference( $namepref,  $idm)

Parameters

$namepref
$idm

getParams()

getParams( $Param)

Parameters

$Param

fage_value()

fage_value( $dd,  $nn)

Parameters

$dd
$nn

truncate()

truncate(string $string, int $length, string $omission) : string

Truncate a string

Parameters

string $string

Input string

int $length

Maximum length of truncated version

string $omission

Trailing characters indicating omission,

                    default: '...'

Returns

string —

Truncated version of string

truncate_words()

truncate_words(string $text, int $limit, string $ellipsis) : string

Truncate a string with full words

Parameters

string $text

Input string

int $limit

length of truncated version

string $ellipsis

Trailing characters indicating ellipsis,

                    default: ' ...'

Returns

string —

Truncated version of string

getGenderTranslated()

getGenderTranslated( $gender,  $hideGender,  $addGenderText) : string

Returns a string with the gender if that isn't hidden. Translated of the form 'Gender: male/female/other'

Parameters

$gender
$hideGender
$addGenderText

Returns

string —

'Gender: male/female/other/ translated or empty string

member_pic_url()

member_pic_url()

_getThumb()

_getThumb( $file,  $max_x,  $max_y,  $quality,  $thumbdir,  $mode)

Thumbnail creator. (by markus5, Markus Hutzler 25.02.2007) tested with GD Version: bundled (2.0.28 compatible) with GIF Read Support: Enabled with JPG Support: Enabled with PNG Support: Enabled

this function creates a thumbnail of a JPEG, GIF or PNG image file: path (with /)!!! max_x / max_y delimit the maximal size. default = 100 (it keeps the ratio) the quality can be set. default = 85 this function returns the thumb filename or null

modified by Fake51 $mode specifies if the new image is based on a cropped and resized version of the old, or just a resized $mode = "square" means a cropped version $mode = "ratio" means merely resized

Parameters

$file
$max_x
$max_y
$quality
$thumbdir
$mode

_dummyPic_userId()

_dummyPic_userId(integer $userId) : string

This function return a picture according to member gender if (any).

It is used when no personal picture is found.

Parameters

integer $userId

Returns

string —

path+filename of the dummy picture

_incognitoPic_userId()

_incognitoPic_userId(int $userId) : string

Picture for members with non-public profile.

TODO: make a nice picture dedicated for this case! TODO: allow users to upload separate avatars for the public!

Parameters

int $userId

Returns

string —

relative picture url

_memberNotFoundPic()

_memberNotFoundPic() : string

The pic that is shown if the username or id is not found in the database (which means, something has gone wrong)

Returns

string —

relative picture url