[pLog-svn] r3760 - plog/trunk/class/net
oscar at devel.lifetype.net
oscar at devel.lifetype.net
Thu Jul 20 20:22:31 GMT 2006
Author: oscar
Date: 2006-07-20 20:22:31 +0000 (Thu, 20 Jul 2006)
New Revision: 3760
Modified:
plog/trunk/class/net/modrewriterequestgenerator.class.php
Log:
first half of the support for paging when using mod_rewrite URLs
Modified: plog/trunk/class/net/modrewriterequestgenerator.class.php
===================================================================
--- plog/trunk/class/net/modrewriterequestgenerator.class.php 2006-07-20 19:50:18 UTC (rev 3759)
+++ plog/trunk/class/net/modrewriterequestgenerator.class.php 2006-07-20 20:22:31 UTC (rev 3760)
@@ -430,5 +430,48 @@
return $request;
}
+
+ /**
+ * given the parameters, recalculates the current URL. This method also has support
+ * for paged urls
+ *
+ * @param category
+ * @param userInfo
+ * @param date
+ * @param page
+ * @return the current url with its page
+ */
+ function getCurrentUrl( $category = null, $userInfo = null, $date = null, $page = null )
+ {
+ if( $category ) {
+ $url = $this->categoryLink( $category );
+ }
+ elseif( $userInfo ) {
+ $url = $this->postUserLink( $userInfo );
+ }
+ elseif( $date > -1 ) {
+ $url = $this->getArchiveLink( $date );
+ }
+ else {
+ // if none of the above, we should at least get a link to the blog!
+ $url = $this->blogLink();
+ }
+
+ $pageFormat = "/page/";
+
+ return( $url.$pageFormat );
+ }
+
+ /**
+ * Returns the page format for this URL generator
+ *
+ * @return A page suffix
+ */
+ function getPageSuffix( $page = "" )
+ {
+ $pageFormat = "/page/".$page;
+
+ return( $pageFormat );
+ }
}
?>
More information about the pLog-svn
mailing list