Montego Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic
Author Message
Testy1
Newbie
Newbie



Joined: Jan 06, 2009
Posts: 17

PostPosted: Tue Apr 07, 2009 8:02 pm Reply with quote

not sure which way to go here Sad

Ive grabbed a copy of the old module (jmap) which is a sitemap feature.Ive been slowly enhancing and cleaning it up to the stage where it now works quite well.By next issue is shortlinks.

Now it does currently work as most of the shortlinks are already obviously covered elsewhere but.....there is always a but Smile

Should the module be writing the url's to the sitemap.xml file as clean url's or.........

here is my current xml file

Code:

<?xml version="1.0" encoding="UTF-8" ?>
<urlset
      xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
            http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
  <url><loc>http://localhost/raven/modules.php?name=Content</loc><changefreq>daily</changefreq></url>
</urlset>


should the module have an option where if shortlinks is on it writes the sitemap file as specified below?
Code:

<?xml version="1.0" encoding="UTF-8" ?>
<urlset
      xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
            http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
  <url><loc>http://localhost/raven/content.html</loc><changefreq>daily</changefreq></url>
</urlset>

Hope you understand what I haven't said properly Razz
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Wed Apr 08, 2009 8:23 am Reply with quote

Testy1,

I am assuming that you have a PHP script (this jmap) that is dynamically generating the XML.

There are multiple ways to do this. The one you mentioned is full-proof and should work just fine.

How I have done it for nukeSEO's Google site map is a bit different. Since Kguske's script is dynamically producing the output, I simply needed to make sure the upfront ShortLinks calls are done so that the output XML is buffered in the output buffer, and then to make sure to run that through the final ShortLinks function to re-write the URL's.

If you are interested in having ShortLinks tap your URLs, I would take a look at what I had incorporated into nukeSEO (its core to the latest version from kguske's site).

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
Testy1
Newbie
Newbie



Joined: Jan 06, 2009
Posts: 17

PostPosted: Wed Apr 08, 2009 6:29 pm Reply with quote

I downloaded the latest nukeSEO but could not find anything.
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Wed Apr 08, 2009 7:04 pm Reply with quote

I'll have to check again in the morning... might be Friday. Quite busy. I could have sworn he added it. I know that I covered it either here or on his site in a forum post too.

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
Testy1
Newbie
Newbie



Joined: Jan 06, 2009
Posts: 17

PostPosted: Wed Apr 08, 2009 9:06 pm Reply with quote

Actually just so we are on the same page.The jmap module actually writes to the sitemap.xml file

I have updated it for rn 2.3 so here is an example of the legal docs

Code:

case 'Legal' : $result15 = $db->sql_query( 'S ELECT * FROM ' . $prefix . '_legal_docs WHERE doc_status=\'1\'' );
while ( $row15 = $db->sql_fetchrow($result15) ) {
    $row15['did'] = ( int )$row15['did'];
    $row15['doc_name'] = mb_convert_encoding( $row15['doc_name'], 'UTF-8' );
    $r15Title = ereg_replace( '_', ' ', $row15['doc_name'] );
    echo "<tr><td></td><td>    <img src=\"modules/Site_Map/images/cat2.gif\" alt=\"cat2\" /> <a href=\"modules.php?name=Legal&amp;op=$row15[doc_name]\">" . $r15Title . "</a></td>";
    if ( $xml ) {
        //XML-Output
        @f write( $var, "  <url><loc>$nukeurl/modules.php?name=Legal&amp;op=$row15[doc_name]</loc></url>\n" );
    }
}
$db->sql_freeresult( $result14 );
break;


Somehow I would have to write shortened url's to the xml file correct?

EDIT: Just for reference had to add space on select and on f write
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Thu Apr 09, 2009 9:28 am Reply with quote

Yes, judging by this, you will have to hard-code the shortened links.

Yeah, I know about some restrictions on posting. Just haven't gotten around to some needed "tweakage".

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
Testy1
Newbie
Newbie



Joined: Jan 06, 2009
Posts: 17

PostPosted: Thu Apr 09, 2009 8:50 pm Reply with quote

is there a similar setup in ravennuke core, or some other script that I can look at to get an idea.I have no idea where to even start.
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Fri Apr 10, 2009 7:54 am Reply with quote

Question: does this script include mainfile.php somewhere up at the top? If not, what about config.php?

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
Testy1
Newbie
Newbie



Joined: Jan 06, 2009
Posts: 17

PostPosted: Fri Apr 10, 2009 8:33 pm Reply with quote

actually, it doesn't never noticed that before.

The file Im talking about is the main index file for the module.

e.g. modules/Site_map/index.php

Here is the file if you need a better understanding

http://www.mediafire.com/download.php?myjmgzgeyny

I think im getting confused with the actual writing of the file, as all other shortlinks stuff I have done has been internally or dynamically generated.
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Sat Apr 11, 2009 9:44 am Reply with quote

Testy1, you are going to have to just hard code the shortened links. You may be able to use the following if you want to allow for turning SL off and on:

Code:

if (defined('TNSL_USE_SHORTLINKS')) {
   build the hard-coded shortened link
} else {
   use the existing code
}


But, you may need to at the top of the script (after the first security check is made - the first if statement) an:

require_once NUKE_BASE_DIR . 'mainfile.php';

----
Not sure why you wouldn't just want to use nukeSEO's sitemap? This other one you are using almost looks like it may have been written for NukeEvo. Interesting.
 
View user's profile Send private message Visit poster's website
Testy1
Newbie
Newbie



Joined: Jan 06, 2009
Posts: 17

PostPosted: Sat Apr 11, 2009 7:35 pm Reply with quote

google kept saying there where error's with it, because it wasn't an actual file i.e dynamic

google recommend checking it here http://www.validome.org/google/

I ended up finding jmap somewhere and decided to fix it up to work with rn.May need to look at some other ideas
 
View user's profile Send private message
montego
Site Admin/Owner
Site Admin/Owner



Joined: Feb 12, 2005
Posts: 1399

PostPosted: Sat Apr 11, 2009 10:30 pm Reply with quote

Ah... got it. Mine's been valid for 3 years using nukeSEO. But, I'm running pretty basic stuff.

Anyways, good luck.

_________________
“To err is human, but when the eraser wears out ahead of the pencil, you’re overdoing it.”
-- Josh Jenkins 
View user's profile Send private message Visit poster's website
Guardian
Site Admin
Site Admin



Joined: Jul 18, 2005
Posts: 397

PostPosted: Tue Apr 14, 2009 3:54 pm Reply with quote

Before you go any further, just remember that Google has a specific XML schema (namespaces) requirement so even though a sitemap might be valid and well-formed with regard to XML standards, it might not be the same schema that Google requires.

In the code I see above, you seem to be missing the 'priority' namespace.
 
View user's profile Send private message
Testy1
Newbie
Newbie



Joined: Jan 06, 2009
Posts: 17

PostPosted: Tue Apr 14, 2009 7:30 pm Reply with quote

Guardian wrote:
Before you go any further, just remember that Google has a specific XML schema (namespaces) requirement so even though a sitemap might be valid and well-formed with regard to XML standards, it might not be the same schema that Google requires.

In the code I see above, you seem to be missing the 'priority' namespace.


yes I have done some research, just not quite sure how to implement the priority yet Sad, I may just set them all to .5 lol
 
View user's profile Send private message
Testy1
Newbie
Newbie



Joined: Jan 06, 2009
Posts: 17

PostPosted: Tue Apr 14, 2009 7:32 pm Reply with quote

Even this site shows as invalid

http://www.validome.org/google/validate?url=http://montegoscripts.com/sitemap.html&lang=en&googleTyp=SITEMAP

am I missing something?
 
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 4 Hours
 
Forums ©
linear-bunch
linear-bunch