joomla-framework

How to return the user_id from the Joomla-Framework on insert/update a (new) user

三世轮回 提交于 2020-01-07 03:46:11
问题 I try to insert/update a new user to a joomla page from an external script. The following code works very well. However I'll need the user_id of the added or updated user but the script returns just "useractivate". The Joomla Forum/Documentation (https://github.com/joomla/joomla-cms/issues/9644) suggests to use $db->insertid(); But I was not able to get this work. Up to now I tried this: $db = JFactory::getDbo(); var_dup($db->insertid()); and get the result: 0 User Creation <?php define( '

Get current article category ID (catid) in Joomla 3.2

我们两清 提交于 2019-12-24 00:42:51
问题 I need to get current article category id, in older joomla version I used: <?php $catid = JRequest::getInt('catid'); echo $catid; ?> But in Joomla 3.2 I get 0. 回答1: You can eliminate the extra database query by taking advantage of the fact that the article model instance is cached and so is the query result for the current article. So, use the content model class to get what you are after. $app = Jfactory::getApplication(); $input=$app->input; if ($input->getCmd('option')=='com_content' &&