createdByUserNum and rule to rewrite

5 posts by 3 authors in: Forums > CMS Builder
Last Post: July 19, 2010   (RSS)

By Djulia - July 15, 2010 - edited: July 15, 2010

Hi,

I would like to use a one rule to rewrite with createdByUserNum :

xxx.php?createdByUserNum=3
xxx.php?createdByUserNum=3&page=2
xxx.php?createdByUserNum=3&page=3
...

For example:

listing.php?"username"-3
listing.php?"username"-3&page=2
listing.php?"username"-3&page=3


Did somebody already test ?

Thanks for your suggestions.

Djulia

Re: [Jason] createdByUserNum and rule to rewrite

By Djulia - July 16, 2010

Hi Jason,

Thank you!

Your solution is good.

But, it would be possible to modify the value of prevPageLink and nextPageLink ?

Currently, I obtain for : user.php?&userName-3

$listingMetaData['nextPageLink'] ==> user.php?userName-3=&page=2
$listingMetaData['prevPageLink'] ==> user.php?userName-3=&page=1

Thanks again. :)

Djulia

Re: [Jason] createdByUserNum and rule to rewrite

By Djulia - July 16, 2010 - edited: July 16, 2010

Hi Jason,

The post of Dave helped me to find a solution.
http://www.interactivetools.com/forum/gforum.cgi?post=58611#58611


<?php
//
$str = @$_SERVER['REQUEST_URI'];
parse_str($str, $output);
$user = array_keys($output);

$pageLink = "{$user[1]}";
$listingMetaData['prevPageLink'] = "{$_SERVER['PHP_SELF']}?page={$listingMetaData['prevPage']}&{$pageLink}";
$listingMetaData['nextPageLink'] = "{$_SERVER['PHP_SELF']}?page={$listingMetaData['nextPage']}&{$pageLink}";
$listingMetaData['firstPageLink'] = "{$_SERVER['PHP_SELF']}?page=1&{$pageLink}";
$listingMetaData['lastPageLink'] = "{$_SERVER['PHP_SELF']}?page={$listingMetaData['totalPages']}&{$pageLink}";
?>

Thanks to have taken the time to answer me ! :)

Djulia

Re: [Djulia] createdByUserNum and rule to rewrite

By Donna - July 19, 2010

Glad to hear you got that sorted out. :)
Donna

--
support@interactivetools.com