function Load_CBfield($fieldname) {
$database =& $config->getDb();
$user =& JFactory::getUser();
$userId = $user->get( 'id' );
$sql = "SELECT ($fieldname) FROM #__comprofiler WHERE id= {$userId}";
$database->setQuery( $sql );
echo $database->loadResult();
}
<?php
$type = Load_CBfield("cb_membership");
if ($type == "paid") echo $title;
else echo $mySobi->title;
?>
Please Log in to join the conversation.
function Load_CBfield( $field ) {
$database =& $config->getDb();
$user =& JFactory::getUser();
$user_id = $user->get( 'id' );
$sql = "SELECT `" . $field . "` FROM `#__comprofiler` WHERE `id` = " . (int) $user_id;
$database->setQuery( $sql );
return $database->loadResult();
}
Please Log in to join the conversation.