Posts: 4
Threads: 2
Joined: Aug 2009
Hi Guys,
Xampp server, version 1.4 getsimple. Using the default theme, with a page called 'suzuki-jeep' under the parent page of 'cars'. I get a double slash as below between the parent and subpage.
http://localhost/getsimple/cars//suzuki-jeep | Saved Thursday, August 13th, 2009 - 8:12 PM
I presume it should have one slash, I have taken a look at the <?php get_page_url(); ?> function but I am just starting with PHP so not sure what I am looking at/for.
Blown away with this cms, I have been looking around for a simple flat cms for yonks and this fits the bill perfectly.
Posts: 104
Threads: 8
Joined: Aug 2009
It's the way that parent is being matched here:
Code:
function get_page_url() {
global $url;
global $SITEURL;
global $PRETTYURLS;
global $parent;
if ($PRETTYURLS == '1') {
if ($parent != '') {$parent = $parent."/"; }
if ($url == 'index' ) { $url = ''; }
echo $SITEURL . @$parent ;
} else {
echo $SITEURL .'index.php?id='.$url;
}
}
Trying to figure out a better way to do it without regex right now
------
I can't design for shit but I can code the shit out of your design
Posts: 104
Threads: 8
Joined: Aug 2009
This works for me:
Code:
function get_page_url() {
global $url;
global $SITEURL;
global $PRETTYURLS;
global $parent;
if ($PRETTYURLS == '1') {
if ($url == 'index' ) { $url = ''; }
echo $SITEURL . @$parent . $url ;
} else {
echo $SITEURL .'index.php?id='.$url;
}
}
This is in theme_functions.php, line 65. haven't tried it without prettyurls yet.
------
I can't design for shit but I can code the shit out of your design
Posts: 4
Threads: 2
Joined: Aug 2009
Hi Derek,
Mod works fine with pretty URLs
http://localhost/getsimple/cars/suzuki-jeep | Saved Thursday, August 13th, 2009 - 8:12 PM
Thanks
Steve
Posts: 1,848
Threads: 86
Joined: Aug 2009
I think I know what's happening here and dereks fix is it. I created a funtion tsl() that puts a trailing slash on urls, but I also add on in the code, which derek removed. Thanks guys!
-
Chris
Thanks for using GetSimple! - Download
Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Posts: 4
Threads: 2
Joined: Aug 2009
Hi, ugraded to 1.5.
Now the parent page shows;
http://localhost/getsimple//cars | Saved Thursday, August 13th, 2009 - 11:10 PM
And the child page shows;
http://localhost/getsimple/cars/suzuki-jeep | Saved Thursday, August 13th, 2009 - 8:12 PM
I must admit, I didn't pay much attention to what happened to the parent when Derek posted the fix as I was focusing on the child, it must have been OK or I would have noticed it, but anyway as you can see now we have a double slash on the parent.
Steve
Posts: 1,848
Threads: 86
Joined: Aug 2009
thanks steve. I thought i had it fixed, but i guess not. Let me look into this more. I am not really sure how that second slash is getting there in the first place. I should have to add that slash to work.... hmmmm.
-
Chris
Thanks for using GetSimple! - Download
Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Posts: 104
Threads: 8
Joined: Aug 2009
Steve, try deleting everything in your admin/inc folder, re-upload those files form the current version, and then post the results
------
I can't design for shit but I can code the shit out of your design
Posts: 104
Threads: 8
Joined: Aug 2009
I am getting the error on parent items now too. Chris, did you change your TSL function or anything else?
------
I can't design for shit but I can code the shit out of your design