Esempio n. 1
0
File: query.php Progetto: 01J/topm
 /**
  * Method to convert the query object into a URI string.
  *
  * @param   string  $base  The base URI. [optional]
  *
  * @return  string  The complete query URI.
  *
  * @since   2.5
  */
 public function toURI($base = null)
 {
     // Set the base if not specified.
     if (empty($base)) {
         $base = 'index.php?option=com_finder&view=search';
     }
     // Get the base URI.
     $uri = JUri::getInstance($base);
     // Add the static taxonomy filter if present.
     if (!empty($this->filter)) {
         $uri->setVar('f', $this->filter);
     }
     // Get the filters in the request.
     $input = JFactory::getApplication()->input;
     $t = $input->request->get('t', array(), 'array');
     // Add the dynamic taxonomy filters if present.
     if (!empty($this->filters)) {
         foreach ($this->filters as $nodes) {
             foreach ($nodes as $node) {
                 if (!in_array($node, $t)) {
                     continue;
                 }
                 $uri->setVar('t[]', $node);
             }
         }
     }
     // Add the input string if present.
     if (!empty($this->input)) {
         $uri->setVar('q', $this->input);
     }
     // Add the start date if present.
     if (!empty($this->date1)) {
         $uri->setVar('d1', $this->date1);
     }
     // Add the end date if present.
     if (!empty($this->date2)) {
         $uri->setVar('d2', $this->date2);
     }
     // Add the start date modifier if present.
     if (!empty($this->when1)) {
         $uri->setVar('w1', $this->when1);
     }
     // Add the end date modifier if present.
     if (!empty($this->when2)) {
         $uri->setVar('w2', $this->when2);
     }
     // Add a menu item id if one is not present.
     if (!$uri->getVar('Itemid')) {
         // Get the menu item id.
         $query = array('view' => $uri->getVar('view'), 'f' => $uri->getVar('f'), 'q' => $uri->getVar('q'));
         $item = FinderHelperRoute::getItemid($query);
         // Add the menu item id if present.
         if ($item !== null) {
             $uri->setVar('Itemid', $item);
         }
     }
     return $uri->toString(array('path', 'query'));
 }
JPluginHelper::importPlugin('content');
$dispatcher = JDispatcher::getInstance();
// Include menu itemid's in URLs by forming $itemids lookup array
//$itemids = makeMenuItemArray('content_blog_section');
$itemids = $this->menuitemarray;
foreach ($rows as $row) {
    $item = new FeedItem();
    $item->title = htmlspecialchars($row->title);
    $itemid = $itemids[$row->sectionid];
    // be sure itemid has some content!
    /*>>> AGE 20071012 */
    if ($itemid == "" && $finder_exists) {
        //$itemid = $mainframe->getItemid( $row->id, 0, 0 );
        // Get the menu item id.
        //$query = array('id' => $row->id);
        $itemid = FinderHelperRoute::getItemid($row->id);
    }
    /*<<< AGE 20071012 */
    if ($itemid == "") {
        $itemid = 99999999;
    }
    $item->link = JRoute::_(ContentHelperRoute::getArticleRoute($row->slug, $row->catslug), false, 2);
    $item->guid = $item->link;
    //Jroute produces htmlspecialchar modified urls.
    //We need to decode them because the feedclass also specialchars them, giving us things like &amp;amp;
    //TODO - test special characters
    //$itemurl = htmlspecialchars_decode ($itemurl);
    /* >> DAN 2009/12/14 */
    /* fulltext options:
     * 0 -> Do nothing
     * 1 -> Read more link