[geeklog-devel] Search Engine Friendly URLs for Stories

Vincent Furia vmf at abtech.org
Wed Jan 14 15:46:48 EST 2004


I wrote this against the current CVS version of geeklog-1.3.  I've 
tested it pretty well on linux.  I doubt it will work under Windows with 
IIS since it uses the same methodology as Staticpages.  Like 
staticpages, it is keyed on the $_CONF['url_rewrite'] variable.

Let me know if there are any questions.

I'd also like to add the recommendation that the 
"start_readmore_anchortag" and "end_readmore_anchortag" be available to 
the template regardless of whether there is more text to read.  The 
"readmore_link" should still only be available if there is a story 
body.  In any case, it should be possible for there to be a link to go 
directly to the article page, even for articles that have no comments 
and no body (so the article page can still be crawled by search engines).

-Vinny


Index: lib-common.php
===================================================================
RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/lib-common.php,v
retrieving revision 1.274
diff -u -r1.274 lib-common.php
--- lib-common.php      13 Jan 2004 20:00:40 -0000      1.274
+++ lib-common.php      14 Jan 2004 20:32:52 -0000
@@ -487,11 +487,11 @@
             $numwords = sizeof( explode( ' ', $A['bodytext'] ));
             $article->set_var( 'readmore_words', $numwords );
 
-            $article->set_var( 'readmore_link', '<a href="' . 
$_CONF['site_url'
]
-                    . '/article.php?story=' . $A['sid'] . '">' . $LANG01[2]
+            $article->set_var( 'readmore_link', '<a href="' . 
COM_buildURL($_CO
NF['site_url']
+                    . '/article.php?story=' . $A['sid']) . '">' . 
$LANG01[2]
                     . '</a> (' . $numwords . ' ' . $LANG01[62] . ') ' );
             $article->set_var( 'start_readmore_anchortag', '<a href="'
-                    . $_CONF['site_url'] . '/article.php?story=' . 
$A['sid']
+                    . COM_buildURL($_CONF['site_url'] . 
'/article.php?story=' .
 $A['sid'])
                     . '">' );
             $article->set_var( 'end_readmore_anchortag', '</a>' );
         }
Index: article.php
===================================================================
RCS file: /usr/cvs/geeklog/geeklog-1.3/public_html/article.php,v
retrieving revision 1.39
diff -u -r1.39 article.php
--- article.php 12 Dec 2003 21:58:10 -0000      1.39
+++ article.php 14 Jan 2004 20:32:52 -0000
@@ -54,11 +54,11 @@
 
 // MAIN
 
+COM_setArgNames (array ('story'));
+$story = COM_applyFilter ( COM_getArgument ('story') );
 if (isset ($HTTP_POST_VARS['story'])) {
     $story = COM_applyFilter($HTTP_POST_VARS['story']);
-} else {
-    $story = COM_applyFilter($HTTP_GET_VARS['story']);
-}
+}
 if (empty ($story)) {
     echo COM_refresh ($_CONF['site_url'] . '/index.php');
     exit();

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: rewrite.diff
URL: <https://pairlist8.pair.net/pipermail/geeklog-devel/attachments/20040114/cc5dfbc3/attachment.ksh>


More information about the geeklog-devel mailing list