| Author |
Message |
Testy1
Newbie


Joined: Jan 06, 2009
Posts: 17
|
Posted:
Tue Apr 07, 2009 8:02 pm |
|
not sure which way to go here
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
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  |
| |
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 1294
|
Posted:
Wed Apr 08, 2009 8:23 am |
|
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 |
|
|
 |
Testy1
Newbie


Joined: Jan 06, 2009
Posts: 17
|
Posted:
Wed Apr 08, 2009 6:29 pm |
|
I downloaded the latest nukeSEO but could not find anything. |
| |
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 1294
|
Posted:
Wed Apr 08, 2009 7:04 pm |
|
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 |
|
|
 |
Testy1
Newbie


Joined: Jan 06, 2009
Posts: 17
|
Posted:
Wed Apr 08, 2009 9:06 pm |
|
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&op=$row15[doc_name]\">" . $r15Title . "</a></td>";
if ( $xml ) {
//XML-Output
@f write( $var, " <url><loc>$nukeurl/modules.php?name=Legal&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 |
| |
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 1294
|
Posted:
Thu Apr 09, 2009 9:28 am |
|
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 |
|
|
 |
Testy1
Newbie


Joined: Jan 06, 2009
Posts: 17
|
Posted:
Thu Apr 09, 2009 8:50 pm |
|
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. |
| |
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 1294
|
Posted:
Fri Apr 10, 2009 7:54 am |
|
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 |
|
|
 |
Testy1
Newbie


Joined: Jan 06, 2009
Posts: 17
|
Posted:
Fri Apr 10, 2009 8:33 pm |
|
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. |
| |
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 1294
|
Posted:
Sat Apr 11, 2009 9:44 am |
|
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. |
| |
|
|
 |
Testy1
Newbie


Joined: Jan 06, 2009
Posts: 17
|
Posted:
Sat Apr 11, 2009 7:35 pm |
|
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 |
| |
|
|
 |
montego
Site Admin/Owner


Joined: Feb 12, 2005
Posts: 1294
|
Posted:
Sat Apr 11, 2009 10:30 pm |
|
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 |
|
|
 |
Guardian
Site Admin


Joined: Jul 18, 2005
Posts: 383
|
Posted:
Tue Apr 14, 2009 3:54 pm |
|
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. |
| |
|
|
 |
Testy1
Newbie


Joined: Jan 06, 2009
Posts: 17
|
Posted:
Tue Apr 14, 2009 7:30 pm |
|
| 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 , I may just set them all to .5 lol |
| |
|
|
 |
Testy1
Newbie


Joined: Jan 06, 2009
Posts: 17
|
Posted:
Tue Apr 14, 2009 7:32 pm |
|
|
|
 |
|
|