0
Hello.
1. How can I get an ID actor whose name matches the name of the current user?
2. Is it possible to create a menu item with a link to such gotten ID (current user=artist)?
1. How can I get an ID actor whose name matches the name of the current user?
2. Is it possible to create a menu item with a link to such gotten ID (current user=artist)?
Responses (6)
-
Accepted Answer
-
Accepted Answer
-
Accepted Answer
0SOLUTION as user's profile LINK, not menu item:
<?php $db = JFactory::getDBO(); $query = ' SELECT id,artist_name FROM #__muscol_artists '; $db->setQuery( $query ); $artist_list = $db->loadObjectList(); for ($i=0, $n=count($artist_list);$i < $n; $i++) { $row = $artist_list[$i]; if ($row->artist_name == JFactory::getUser()->name) { $id = $row->id; } } ?> <a href="/<?php echo JRoute::_('index.php?option=com_muscol&view=artist&id='. $id);?>"> <span class="icon-user"></span><?php echo JText::_('Artist profile');?></a>
Your Reply

Please login to post a reply
You will need to be logged in to be able to post a reply. Login using the form on the right or register an account if you are new here.
Register Here »