lildog Posted April 30, 2006 Posted April 30, 2006 Hey all, I wanted a little php coding advice if possible. I am using Linda McGrath's Login Box and have Customer Private Messages also installed. I wanted to add a link in the info box if there is a message for the customer. Here is the code that displays the alert, it is currently in the account.php <?php $result = tep_db_query("select customers_private_messages from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . " '"); $result_array = tep_db_fetch_array($result); if ($result_array['customers_private_messages'] != "") { echo PRIVATE_MESSAGES_YES . "<P>" . $result_array['customers_private_messages']; } else {echo PRIVATE_MESSAGES_NO;} ?> I want to add it in the login box here: <?php $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => BOX_HEADING_LOGIN_BOX_MY_ACCOUNT); new infoBoxHeading($info_box_contents, true, true); $info_box_contents = array(); $info_box_contents[] = array('align' => 'left', 'text' => '<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, '', 'SSL') . '">' . LOGIN_BOX_PRODUCTS_NEW . '</a><br>' . '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . LOGIN_BOX_MY_ACCOUNT . '</a><br>' . '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') . '">' . LOGIN_BOX_ACCOUNT_HISTORY . '</a><br>' . '<a href="' . tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL') . '">' . LOGIN_BOX_ACCOUNT_EDIT . '</a><br>' . '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL') . '">' . LOGIN_BOX_ADDRESS_BOOK . '</a><br>' . '<a href="' . tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'NONSSL') . '">' . LOGIN_BOX_PRODUCT_NOTIFICATIONS . '</a><br>' . '<a href="' . tep_href_link(FILENAME_LOGOFF, '', 'NONSSL') . '">' . LOGIN_BOX_LOGOFF . '</a>'); new infoBox($info_box_contents); ?> I added a define in english.php for PRIVATE_MESSAGES_YES. I just assume display nothing at all if there are not messages. Thanks, Todd
Recommended Posts
Archived
This topic is now archived and is closed to further replies.