Hi Amigo well I am just trying to learn how to create plugins and I am stuck with this issue! I am simply reverse engendering some plugins like this one!
$test = "do you see me";
$listCmp = new FOLLOWLIST_UserList($dtoList, $listCount, $perPage, true, $test);
class FOLLOWLIST_UserList extends BASE_CMP_Users
{
public $test;
public function __construct( array $list, $itemCount, $usersOnPage, $showOnline = true, $test)
{
$this->test = $test;
parent::__construct($list, $itemCount, $usersOnPage, $showOnline);
}
public function getFields( $userIdList)
{
echo $this->test;
$fields = array();
$qs = array();
$qBdate = BOL_QuestionService::getInstance()->findQuestionByName('birthdate');
if ( $qBdate !== null && $qBdate->onView )
$qs[] = 'birthdate';
$qSex = BOL_QuestionService::getInstance()->findQuestionByName('sex');
if ( $qSex !== null && $qSex->onView )
$qs[] = 'sex';
$questionList = BOL_QuestionService::getInstance()->getQuestionData($userIdList, $qs);
foreach ( $questionList as $uid => $question )
{
$fields[$uid] = array();
$age = '';
if ( !empty($question['birthdate']) )
{
$date = UTIL_DateTime::parseDate($question['birthdate'], UTIL_DateTime::MYSQL_DATETIME_DATE_FORMAT);
$age = UTIL_DateTime::getAge($date['year'], $date['month'], $date['day']);
}
$sexValue = '';
if ( !empty($question['sex']) )
{
$sex = $question['sex'];
for ( $i = 0; $i < 31; $i++ )
{
$val = pow(2, $i);
if ( (int) $sex & $val )
{
$sexValue .= BOL_QuestionService::getInstance()->getQuestionValueLang('sex', $val) . ', ';
}
}
if ( !empty($sexValue) )
{
$sexValue = substr($sexValue, 0, -2);
}
}
if ( !empty($sexValue) && !empty($age) )
{
$fields[$uid][] = array(
'label' => '',
'value' => $sexValue . ' ' . $age
);
}
}
return $fields;
}
}
I am not sure why I need to add true or whatever to here to make it pass $test value???
$listCmp = new FOLLOWLIST_UserList($dtoList, $listCount, $perPage, true, $test);