Page 1 of 1

pulling values from stdclass object array in Joomla

Posted: Fri Nov 26, 2010 2:54 am
by codywood
Hi I am new to the forum and a novice php coder. Normally I can get things figured out by search around but this has been weeks of trying everything I have seen and getting no luck.
This is a Joomal Plugin called Community Builder.

Here is part of the page code that needs help.

Code: Select all

<?php
	}
	function _getUserListCell( &$cellFields ) {
		$html				=	array();		
		foreach ( $cellFields as $fieldView ) {
			if ( $fieldView->value !== null ) {
				if  ( $fieldView->title ) {
					$title	=	'<span class="cbUserListFieldTitle cbUserListFT_' . $fieldView->name . '">'
							.	$fieldView->title
							.	':'
							.	'</span> ';
				} else {
					$title	=	'';
				}
				$html[]		=	'<span class="cbUserListFieldTitle cbUserListFT_' . $fieldView->name . '">'
							.	$fieldView->value
							.	':'
							.	'</span> ';			}
		}
		return "\n\t\t\t\t" . implode( "\n\t\t\t\t", $html ) . "\n";
	}
}
?>
if I do a print_r($cellFields); if get this.

Array ( [0] => stdClass Object ( [name] => avatar [value] => [title] => ) [1] => stdClass Object ( [name] => firstname [value] => - [title] => ) [2] => stdClass Object ( [name] => lastname [value] => - [title] => ) [3] => stdClass Object ( [name] => cb_city [value] => - [title] => ) [4] => stdClass Object ( [name] => cb_state [value] => - [title] => ) [5] => stdClass Object ( [name] => cb_gym [value] => - [title] => ) [7] => stdClass Object ( [name] => cb_twlink [value] => - [title] => ) ) Array ( [0] => stdClass Object ( [name] => avatar [value] =>

In the mysql database the fields are avatar, firstname, lastname, cb_city ect..... I need to find out how to pull out all of the values rather then the auto populating way it does it now. I want to have control so I can put a facebook and twitter icon in there and have it link to each users facebook/twitter url. They way it does it now is just spits out the link. I just want more control and want to be able to pull out the individual values and help style the page the way I want.

Sorry if this does not make much sense but any help would be appreciated! Thanks