Elxis CMS Forum

Extensions => Components => Topic started by: webgift on October 06, 2010, 17:23:48

Title: Sitemap and eBlog
Post by: webgift on October 06, 2010, 17:23:48
I have created a top menu which has eblog items and at the eblog posts i have connected top menu with new menu items --> Url / Link type.
At the sitemap doubles the records with eblog posts and category icons which directs to the same post.

I try to disable the option Expands eblogs with no result. Ι have the same results even if this option is Yes or No!

IOS sitemap ver : 2.2 r70.
Elxis 2009.2

Any idea ?
Title: Re: Sitemap and eBlog
Post by: datahell on October 06, 2010, 18:26:04
Yes, I have an idea: τα έκανες κώλος (you make them ass) ;D
Title: Re: Sitemap and eBlog
Post by: webgift on October 06, 2010, 18:34:54
 :'( :'( :'(. ;D
But why :
I see at the administrator/components/com_sitemap/extensions/eblog.sitemap.php

These lines : 144 - 184

Code: [Select]
        if ($xartis->cfg->get('EXPANDEBLOG')) {
            $andwhere = ($this->rev2241) ? " AND b.published='1'" : '';
            $query = "SELECT b.id, b.title, b.blogid, b.dateadded, b.seotitle, s.seotitle AS seoblog FROM #__eblog b"
            ."\n LEFT JOIN #__eblog_settings s ON s.blogid=b.blogid"
            ."\n WHERE s.published='1'".$andwhere
            ."\n AND ((b.language IS NULL) OR (b.language LIKE '%".$xartis->maplang."%'))"
            ."\n ORDER BY b.dateadded DESC";
            if ($xartis->cfg->get('MAXITEMS')) {
                $database->setQuery($query, '#__', $xartis->cfg->get('MAXITEMS'), 0);
            } else {
                $database->setQuery($query);
            }
            $rows = $database->loadObjectList();

            if ($rows) {
                $tnow = time() + ($mainframe->getCfg('offset') * 3600);
                foreach($rows as $row) {
                    $node = new stdClass;
                    $node->name = $row->title;
                    $node->link = 'index.php?option=com_eblog&task=show&blogid='.$row->blogid.'&id='.$row->id;
                    $node->seolink = 'eblog/'.$row->seoblog.'/'.$row->seotitle.'.html';
                    $node->id = $_Itemid;
                    $node->modified = $this->_toTimestamp($row->dateadded);
                    $diff = $tnow - $node->modified;
                    if ($diff < 86400) {
                        $node->changefreq = 'daily';
                        $node->priority = '0.8';
                    } elseif ($diff < 2419200) {
                        $node->changefreq = 'weekly';
                        $node->priority = '0.7';
                    } else {
                        $node->changefreq = 'monthly';
                        $node->priority = '0.6';
                    }
                    $node->pid = $row->blogid;
                    $node->icon = 'document';
                    $list['link'.$row->id] = $node;
                    unset($node, $diff);
                }
            }
        }

This if :  if ($xartis->cfg->get('EXPANDEBLOG')) doesn't work :(.
Title: Re: Sitemap and eBlog
Post by: webgift on October 06, 2010, 18:43:52
I feel RAKOS and XOMA :'( ;D
Title: Re: Sitemap and eBlog
Post by: datahell on October 06, 2010, 18:52:13
nop, if ($xartis->cfg->get('EXPANDEBLOG')) is correct.
The problem is with your menus set up.
Title: Re: Sitemap and eBlog
Post by: webgift on October 06, 2010, 18:55:09
do you mean the menu items type : Url - links ?
How can i link the menu items with one eblog post ? Other than menu type : link / url ?  :'( :'(
Title: Re: Sitemap and eBlog
Post by: datahell on October 06, 2010, 19:00:17
I don't find it a good idea to create links to single eblog posts. Don't do it...
Title: Re: Sitemap and eBlog
Post by: webgift on October 06, 2010, 19:05:35
I knew that ( ass )  ;D but i find so easy to navigate a visitor on the website like drop down menu at the top.
Is there any customization to avoid these double records on the google-language.xml ?
language = english , greek!

Pleaseeeeeeee!
Title: Re: Sitemap and eBlog
Post by: webgift on October 07, 2010, 01:22:24
I found!
For those who use drop down menu Or Full Expand menus up to 2 levels , eBlog Component , they have menu items type = URL / LINK  which these direct to eblog posts and they want to avoid double records on the sitemap menu link and google.xml file then the basic philosophy is :
File : sitemap.class.php
Folder : administrator/components/com_sitemap/includes/
xartografos::getMenuTree
Line : 164

We add $url = 'http';
At the $query below we add the red colored line:
-----------------------------------------------------------
$query = "SELECT m.id, m.name, m.parent, m.link, m.type, m.browserNav, m.menutype,"
      ."\n m.ordering, m.params, m.componentid, m.language, c.name AS component"
      ."\n FROM #__menu m"
        ."\n LEFT JOIN #__components c ON m.type='components' AND c.id=m.componentid"
        ."\n WHERE m.published='1' AND m.menutype = '".$menutype."'"
       .( $noauth ? "\n AND m.access IN (".$my->allowed.")" : '' )
        ."\n AND m.link NOT LIKE '%".$url."%' "
       ."\n AND ((m.language IS NULL) OR (m.language LIKE '%".$this->maplang."%'))"
       ."\n GROUP BY m.id"
        ."\n ORDER BY m.menutype, m.parent, m.ordering";
---------------------------------------------------------

Now we are OK!
Tested the xml files and It's OK!.

Datahell what's your opinion ?