Re: Turba fields
Scott Greenberg <me <at> gogogadgetscott.info>
2005-08-03 03:12:47 GMT
Both object_id and object_uid are created when adding a new turba object
(contact). The initialization varers based on the turba driver. Below I have
listed info for the sql driver. If you are using another option refer to
./turba/lib/Driver/*.php > function _makeKey, id is the same in all cases.
<?php
if (!isset($GLOBALS['conf']['server']['name'])) {
$GLOBALS['conf']['server']['name'] = $_SERVER['SERVER_NAME'];
}
$user = 'user';
$contacts = array(
array('Test1', 'test1 <at> none.net'),
array('Test2', 'test2 <at> none.net'),
array('Test3', 'test3 <at> none.net')
);
foreach ($contacts as $contact) {
$id = md5(uniqid(mt_rand(), true));
$uid = date('YmdHis') . '.' . substr(base_convert(microtime(), 10,
36), -16)
. $GLOBALS['conf']['server']['name'];
$sql = "INSERT INTO `turba_objects` (`object_id` , `owner_id` ,
`object_type` , `object_uid` , `object_members` , `object_name` ,
`object_alias` , `object_email`) VALUES ('$id', '$user', 'Object', '$uid',
NULL, '$contact[0]', '', '$contact[1]');";
(Continue reading)