Commit 9bf065a8 authored by gillesm's avatar gillesm

User information can display tracker users informations defined with...

User information can display tracker users informations defined with TrackerId,field1,field2,field3...
The image are displayed
All the other types (text, textarea, checkboxes, lists, button radio) are displayed with their value
Google Card are not yet coded nor subscription.
parent f4b7c9ca
<?php
// $Header: /cvsroot/tikiwiki/tiki/lib/trackers/trackerlib.php,v 1.184 2007-03-06 20:57:21 sylvieg Exp $
// $Header: /cvsroot/tikiwiki/tiki/lib/trackers/trackerlib.php,v 1.185 2007-03-21 18:10:00 gillesm Exp $
//this script may only be included - so its better to die if called directly.
if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
header("location: index.php");
......@@ -1838,14 +1838,16 @@ class TrackerLib extends TikiLib {
return $ret;
}
/* look if a tracker has only one item per user and if an item has already being created for the user or the IP*/
function get_user_item($trackerId, $trackerOptions) {
function get_user_item($trackerId, $trackerOptions,$userparam=null) {
global $user, $IP;
if (empty($trackerOptions['oneUserItem']) || $trackerOptions['oneUserItem'] != 'y') {
return 0;
}
if (!empty($user)) {
$userreal=$userparam!=null?$userparam:$user;
if (!empty($userreal)) {
if ($fieldId = $this->get_field_id_from_type($trackerId, 'u', '1')) { // user creator field
$value = $user;
$value = $userreal;
$items = $this->get_items_list($trackerId, $fieldId, $value);
if ($items)
return $items[0];
......
......@@ -52,6 +52,21 @@
{/if}
{/if}
<tr><td class="form">{tr}Displayed time zone{/tr}:</td><td>{$display_timezone}</td></tr>
{if $user_tracker_infos}
{foreach item=value key=fieldId from=$ValueTrk }
{if $FieldTrk[$fieldId].type == 'i' }
<tr><td class="form">{tr}{$FieldTrk[$fieldId].name}{/tr}:</td><td>
<img src="{$value}" alt="" {if $FieldTrk[$fieldId].option[2]} width="{$FieldTrk[$fieldId].option[2]}"{/if}{if $FieldTrk[$fieldId].option[3]} height="{$FieldTrk[$fieldId].option[3]}"{/if}>
{elseif $value}
<tr><td class="form">{tr}{$FieldTrk[$fieldId].name}{/tr}:</td><td>
{$value}
{/if}
</td></tr>
{/foreach}
{/if}
{if $feature_friends eq 'y' && $user ne $userwatch && $user}
{if $friend}
<tr><td class="form">&nbsp;</td><td class="form">
......
<?php
// $Header: /cvsroot/tikiwiki/tiki/tiki-user_information.php,v 1.39 2007-03-06 19:29:52 sylvieg Exp $
// $Header: /cvsroot/tikiwiki/tiki/tiki-user_information.php,v 1.40 2007-03-21 18:10:00 gillesm Exp $
// Copyright (c) 2002-2007, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
......@@ -11,8 +11,9 @@ require_once ('tiki-setup.php');
include_once ('lib/messu/messulib.php');
include_once ('lib/userprefs/scrambleEmail.php');
include_once('lib/registration/registrationlib.php');
include_once ('lib/registration/registrationlib.php');
include_once ('lib/wiki/wikilib.php');
include_once ('lib/trackers/trackerlib.php');
if (isset($_REQUEST['userId'])) {
$userwatch = $tikilib->get_user_login($_REQUEST['userId']);
......@@ -133,6 +134,25 @@ if ($feature_display_my_to_others == 'y') {
$smarty->assign_by_ref('user_galleries', $user_galleries);
}
if ( $user_tracker_infos ) {
// arg passed 11,56,58,68
$trackerinfo=explode(',',$user_tracker_infos) ;
$UserTrackerID=$trackerinfo[0] ;
array_shift ($trackerinfo);
foreach ( $trackerinfo as $value )
{
$field=$trklib->get_tracker_field($value) ;
$FieldTrk[$value]=$field;
$ValueTrk[$value]=$trklib->get_item_value($UserTrackerID,$trklib->get_user_item($UserTrackerID,array('oneUserItem'=>'y'),$userwatch),$value);
$FieldTrk[$value]["options"]=explode(',', $FieldTrk[$value]["options"]);
}
$smarty->assign_by_ref('FieldTrk',$FieldTrk);
$smarty->assign_by_ref('ValueTrk',$ValueTrk);
}
ask_ticket('user-information');
// disallow robots to index page:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment