Source for file contact.class.php
Documentation is available at contact.class.php
* @copyright Refer to copyright.php
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* @author Mambo Foundation Inc see README.php
/** ensure this file is being included by a parent file */
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
include_once( $mosConfig_absolute_path .
'/includes/vcard.class.php' );
/** @var int Primary key */
/** @var int A link to a registered user */
/** @var int A link to a category */
* @param database A database connector object
$this->mosDBTable( '#__contact_details', 'id', $database );
static $contact_cats =
'';
if (!is_array($contact_cats)) {
$database =
mamboDatabase::getInstance();
/* Query to retrieve all categories that belong under the contacts section and that are published. */
$query =
"SELECT *, COUNT(a.id) AS numlinks, MIN(a.id) as minimum"
.
"\n FROM #__categories AS cc"
.
"\n LEFT JOIN #__contact_details AS a ON a.catid = cc.id"
.
"\n WHERE a.published='1'"
.
"\n AND cc.section='com_contact_details'"
.
"\n AND cc.published='1'"
.
"\n AND a.access <= '".
$user->gid .
"'"
.
"\n AND cc.access <= '".
$user->gid .
"'"
.
"\n ORDER BY cc.ordering"
$database->setQuery( $query );
$contact_cats =
$database->loadObjectList();
if (!$contact_cats) $contact_cats =
array();
.
"\n FROM #__contact_details"
.
"\n WHERE catid = '".
$catid.
"'"
.
"\n AND access <= '".
$user->gid .
"'"
$contacts =
$database->doSQLget($query, 'mosContact');
* class needed to extend vcard class and to correct minor errors
// needed to fix bug in vcard class
function setName( $family=
'', $first=
'', $additional=
'', $prefix=
'', $suffix=
'' ) {
$this->properties["N"] =
"$family;$first;$additional;$prefix;$suffix";
// needed to fix bug in vcard class
function setAddress( $postoffice=
'', $extended=
'', $street=
'', $city=
'', $region=
'', $zip=
'', $country=
'', $type=
'HOME;POSTAL' ) {
// $type may be DOM | INTL | POSTAL | PARCEL | HOME | WORK or any combination of these: e.g. "WORK;PARCEL;POSTAL"
$key.=
';ENCODING=QUOTED-PRINTABLE';
// added ability to set filename
// added ability to set position/title
// added ability to set organisation/company
$text =
"BEGIN:VCARD\r\n";
$text .=
"VERSION:2.1\r\n";
$text .=
"$key:$value\r\n";
$text .=
"REV:" .
date("Y-m-d") .
"T".
date("H:i:s").
"Z\r\n";
$text .=
"MAILER: ".
sprintf(T_('Mambo vCard for %s'),$sitename) .
"\r\n";
$text .=
"END:VCARD\r\n";
Documentation generated on Mon, 05 May 2008 16:18:08 +0400 by phpDocumentor 1.4.0