Hi.
This is a piece of code that I wrote for a one of my modules in Joomla 1.5, and im afraid im not skilled enough yet to do this procedure in the correct way..
Please can someone help me structure this code in the right way - the actual code is fine, it just doesnt do its job properly..
Its pretty much the end bit - the if (x = y & a = b) parts...
Any help would be much appreciated
Thanks
Chris
// Uddeim Notification Extract
$query = "SELECT firstname FROM #__comprofiler WHERE id = ". (int)$my->id;
$sql="SELECT id FROM #__menu WHERE link LIKE '%com_uddeim%' AND published>=0 LIMIT 1";
$database->setQuery($sql);
$allmessages=$database->loadObjectList();
$totalmessages=count($allmessages);
$pms_link = sefRelToAbs("index.php?option=com_uddeim&task=inbox".($item_id ? "&Itemid=".$item_id : ""));
if ( $totalpendingconnections === null ) trigger_error( $_CB_database->getErrorMsg(), E_USER_WARNING );
if($totalpendingconnections > 0) {
$results .= "<div><a href='".cbSef("index.php?option=com_comprofiler&task=manageConnections".$andItemid)."' class='mod_login".$class_sfx."'>".$totalpendingconnections." "._UE_CONNECTIONREQUIREACTION."</a></div>";
} else {
$results = null;
}
if($totalmessages > 0) {
$results2 .= "<br><img src='components/com_uddeim/templates/default/images/menu_inbox.gif'> Messages: You have a <a href='$pms_link'>new message</a>";
} else {
$results2 = null;
}
if($results==null & $results2==null) {
echo "<img src='http://www.capetownalive.co.za/modules/mod_s4jrandomprofile/images/user.png'> Friends: " . _UE_NOACTIONREQUIRED;
echo "<br><img src='components/com_uddeim/templates/default/images/menu_inbox.gif'> Messages: No new messages";
} elseif ($results==null & $results2 !==null) {
echo "<img src='http://www.capetownalive.co.za/modules/mod_s4jrandomprofile/images/user.png'> Friends: " . _UE_NOACTIONREQUIRED;
echo "<br><img src='components/com_uddeim/templates/default/images/menu_inbox.gif'> Messages: You have a <a href='$pms_link'>new message</a>";
} elseif ($results2==null & $results!==null) {
echo $results;
echo "<br><img src='components/com_uddeim/templates/default/images/menu_inbox.gif'> Messages: No new messages";
}
}