siristru

Joomla: Combine SQL query / Get URL input / Update <title>

Jan 19th, 2021 (edited)
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.79 KB | None | 0 0
  1. /* START Mirek's mod */
  2. $uriQuery = $app->input->getArray();
  3. $eSid = explode(':',$uriQuery['sid']);
  4. //print_r($eSid);
  5. if($eSid[0] > 7) {
  6.  
  7. $db = JFactory::getDbo();
  8. $query = $db->getQuery(true);
  9. $query->select($db->quoteName(array('baseData')));
  10. $query->from($db->quoteName('#__sobipro_field_data'));
  11. $query->where($db->quoteName('sid') . ' = ' . $db->quote($eSid[0]));
  12. $query->where('(fid = 1 OR fid = 3)');
  13. $db->setQuery($query);
  14. $column = $db->loadColumn();
  15. $cColumn = array_values(array_unique($column));
  16. //print_r($cColumn);
  17. $doc->setTitle($cColumn[0].' - '.$cColumn[1]);
  18. require_once(JPATH_LIBRARIES.'/src/Document/Renderer/Html/HeadRenderer.php');
  19. $header_renderer = new JDocumentRendererHead($doc);
  20. $header_contents = $header_renderer->render(null);
  21.  
  22. }
  23. /* END of Mirek's mod */
Add Comment
Please, Sign In to add comment