You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
Dave... our conversation got distracted and I didn't get a closure here.
Here is my last reply.
It seems as though this line
$href_url = preg_replace('/' . $app . '-catshow/','Category',$cat_url);
is causing all the other lines below it to take on that format. Even my product links come out formatted as a category style. Once $href_url is set it is applying to all the others.
Is there somewhere else in ccp besides KHXC_Display where if I change the variable $href_url just for categories to cat_url so the line would read
$cat_url = preg_replace('/' . $app . '-catshow/','Category',$cat_url); that I could change it to use that cat_url for category urls?
Offline
I don't see how it could be. The routine that builds the link is called one time for each link that is being built. As soon as you get the category link built the routine returns. The next request to build a link starts the process all over again.
In the IF where you made the changes it should be safe to use a completely different name such as $cat_url but you'll have to add an if to only do the change and use the other name if it's a category link being built. Within that if you'll also need to return $cat_url instead of the logic falling through and returning $href_url since it will no longer be correct.
Offline
I haven't done "ifs" anywhere.
All I thought I needed to do was alter your code in KHXC_Display and htaccess.
I haven't changed code to accomplish this anywhere else.
So by changing KHXC_Display is makes all the other ones goofy... but the cat works great. It's like the first line of the block
$href_url = preg_replace('/' . $app . '-catshow/','Category',$cat_url);
is making all these
$href_url = preg_replace('/' . $app . '-prodshow/','gift',$href_url);
$href_url = preg_replace('/' . $app . '-display/','reference',$href_url);
$href_url = preg_replace('/' . $app . '-prodspec\/KHXCseo.php/','store-specials.php',$href_url);
$href_url = preg_replace('/' . $app . '-prodnew\/KHXCseo.php/','new-products.php',$href_url);
$href_url = preg_replace('/' . $app . '-prodall\/KHXCseo.php/','view-all-products.php',$href_url);
$href_url = preg_replace('/' . $app . '-prodidx\/KHXCseo.php/','product-index.php',$href_url);
$href_url = preg_replace('/' . $app . '-prodbest\/KHXCseo.php/','best-sellers.php',$href_url);
$href_url = preg_replace('/' . $app . '-prodsearch\/KHXCseo.php/','advanced-product-search.php',$href_url);
$href_url = preg_replace('/' . $app . '-contact\/KHXCseo.php/','contact-us.php',$href_url);
$href_url = preg_replace('/' . $app . '-viewcart\/KHXCseo.php/','view-shopping-cart.php',$href_url);
$href_url = preg_replace('/' . $app . '-acctorders\/KHXCseo.php/','order-status.php',$href_url);
go bad. They show up like
/ccp0-prodbest/KHXCseo/
/ccp0-prodall/KHXCseo/
and so on. I believe like the rest of those lines don't exist.
Offline
Right after this line
$href_url .= $app . '-' . $ns . '/' . $ref . '.html';
add
if ($ns == 'catshow') { $href_url_cat = $href_url . $app . '-' . $ns . '/' . $ref . '/'; $href_url = preg_replace('/' . $app . '-catshow/','sports_memorabilia',$href_url_cat); // +-- // | Return the URL. // +-- return $href_url; }
and see if you get the desired result. I still see no way for the other strangeness you're seeing to happen but this should avoid it.
Offline
Getting close!!! That corrected the problems with all the links other than cat links.
However, it now is duplicating the cat links to as
/sports_memorabilia/baseball_memorabilia_autographed_signed.htmlsports_memorabilia/baseball_memorabilia_autographed_signed/
Offline
I'm quite confident you'll figure out what needs to be tweaked
Offline
if ($ns == 'catshow') {
$href_url_cat = $app . '-' . $ns . '/' . $ref . '/';
$href_url = preg_replace('/' . $app . '-catshow/','sports_memorabilia',$href_url_cat);
// +--
// | Return the URL.
// +--
return $href_url;
}
Offline
Forgive me if I'm being dumb, but how do I actually get to khxc_display?
I've searched all around the backend interface but can't locate it anywhere.
Thanks
Will
Offline
It's a program and not visible or able to be gotten to through admin. You'll find it in your private directory under /core/KHXC_Display and you'll need to use your FTP client to get to it.
Make sure you keep a backup as it's a rather critical bit of code
Offline
I don't have FTP access, I'm hosted with Howard @ Greenbarn.
Shall I contact him and get him to do it?
Offline
You don't have FTP access???? Wow, I guess your only choice is to ask Howard for your copy of it, change it and ask him to put it on your site for you. Or have him give you a quote to make the changes.
Offline