joomla3.1

fulltext query in joomla

安稳与你 提交于 2019-12-10 18:16:55
问题 How do I buld a fulltext search query with joomla objects. I have been trying but it's not working $db = JFactory::getDBO(); $query = $db->getQuery(true); $query->select('*'); $query->from('#__unis_subjects AS s'); $query->join('', '#__unis AS u ON s.university = u.id'); $query->join('', '#__unis_faculties AS f ON f.id = s.faculty'); $query->where('MATCH (s.subject) AGAINST ("' . $query . '")'); if (!$db->query()) { throw new Exception($db->getErrorMsg()); } $data = $db->loadObjectList(); var

How to get the tags associated to an article in Joomla

时光总嘲笑我的痴心妄想 提交于 2019-12-10 13:01:34
问题 I need to get the TAGS associated with an article in Joomla 3.1.5 I have tried the following but they do not return a string: echo $article->item->tags->itemTags; and $tags = $article->get("tags"); And just for the record I am loading the article info as such (getting the article title works perfectly) $article = JTable::getInstance("content"); $article->load(JRequest::getInt("id")); $pageTitle = $article->get("title"); $user =& JFactory::getUser(); 回答1: If you look in components/com_content

Manually control <head> markup in Joomla

狂风中的少年 提交于 2019-12-06 03:52:57
Is there a way to manually configure the contents of the <head> section of the site in Joomla 3.1? I want to use the templating system for the entire markup of the page, including everything between <html></html> . I just read this: http://forum.joomla.org/viewtopic.php?f=466&t=230787 and I am astonished at the response. Surely this is template/data separation 101. Has this been fixed in the latest Joomla release? If you are planning for a template development and you need all your template data get separated from Joomla libraries or core file (the head section). Normally the head section

How to use cookies from a component?

試著忘記壹切 提交于 2019-12-04 11:19:37
问题 How can I use cookies in a Joomla component? setcookie( JUtility::getHash('JLOGIN_REMEMBER'), false, time() - 86400, '/' ); Can anybody describe how this works? 回答1: // Get input cookie object $inputCookie = JFactory::getApplication()->input->cookie; // Get cookie data $value = $inputCookie->get($name = 'myCookie', $defaultValue = null); // Check that cookie exists $cookieExists = ($value !== null); // Set cookie data $inputCookie->set($name = 'myCookie', $value = '123', $expire = 0); //

Joomla Database - How to use LIMIT in getQuery?

Deadly 提交于 2019-12-03 08:35:37
问题 I want to build the below query using joomla inbuilt database class. SELECT * FROM table_name ORDER BY id DESC LIMIT 1 This is the query I have built up to now. $db =& JFactory::getDBO(); $query = $db->getQuery(true); $query->select($db->nameQuote('*')); $query->from($db->nameQuote(TABLE_PREFIX.'table_name')); $db->setQuery($query); $rows = $db->loadObjectList(); I don't know how to add the limit(LIMIT 1) to the query. Can someone please tell me how to do it? Thanks 回答1: Older than Joomla 3.0

How to use cookies from a component?

十年热恋 提交于 2019-12-03 07:05:23
How can I use cookies in a Joomla component? setcookie( JUtility::getHash('JLOGIN_REMEMBER'), false, time() - 86400, '/' ); Can anybody describe how this works? // Get input cookie object $inputCookie = JFactory::getApplication()->input->cookie; // Get cookie data $value = $inputCookie->get($name = 'myCookie', $defaultValue = null); // Check that cookie exists $cookieExists = ($value !== null); // Set cookie data $inputCookie->set($name = 'myCookie', $value = '123', $expire = 0); // Remove cookie $inputCookie->set('myCookie', null, time() - 1); Some rules about $expire value its a Unix

Joomla Database - How to use LIMIT in getQuery?

两盒软妹~` 提交于 2019-12-02 22:27:43
I want to build the below query using joomla inbuilt database class. SELECT * FROM table_name ORDER BY id DESC LIMIT 1 This is the query I have built up to now. $db =& JFactory::getDBO(); $query = $db->getQuery(true); $query->select($db->nameQuote('*')); $query->from($db->nameQuote(TABLE_PREFIX.'table_name')); $db->setQuery($query); $rows = $db->loadObjectList(); I don't know how to add the limit(LIMIT 1) to the query. Can someone please tell me how to do it? Thanks Older than Joomla 3.0 $db = JFactory::getDBO(); $query = $db->getQuery(true); $query->select('*') ->from($db->nameQuote('#__table

Importing jQuery into Joomla

允我心安 提交于 2019-11-26 15:29:42
I have been a Joomla developer for almost an year now. I have been struggling to import jQuery into joomla everyday. Joomla comes with mootools. When I import jQuery it crashes. Also when I create modules I have to import jQuery into each module which makes to site slow. Sometimes it makes the whole site crashes. I want both mootools and jquery to work hand in hand so I can use both without any crashes. What's the best way to import jQuery into Joomla ? Is there a specific place where the import should be done to use one jquery library site-wide( both backend and frontend ) ? Thanks This is

Importing jQuery into Joomla

ぐ巨炮叔叔 提交于 2019-11-26 04:27:22
问题 I have been a Joomla developer for almost an year now. I have been struggling to import jQuery into joomla everyday. Joomla comes with mootools. When I import jQuery it crashes. Also when I create modules I have to import jQuery into each module which makes to site slow. Sometimes it makes the whole site crashes. I want both mootools and jquery to work hand in hand so I can use both without any crashes. What\'s the best way to import jQuery into Joomla ? Is there a specific place where the