Interspire Product Knowledge Base

Would you like to...

Print this page Print this page

Email this page Email this page

Post a comment Post a comment

Subscribe me

Add to favorites Add to favorites

Remove Highlighting Remove Highlighting

Edit this Article

Export to PDF

User Opinions (0 votes)

No users have voted.

How would you rate this answer?



Thank you for rating this answer.

How can I change the symbol between the words from + to a - ?

File 1: To change the urls to use a - instead of a + in the urls, you need to edit the lib/general.php file. Search for the GetUrl() function. To change it for categories, edit the line

$url .= $GLOBALS['AKB_CLASS_HELPER']->GetCompleteCategoryPath((int) $id);

and change it to

$url .= str_replace('+', '-', $GLOBALS['AKB_CLASS_HELPER']->GetCompleteCategoryPath((int) $id));

To change it for questions, edit the line

$url .= $id.'/';

and change it to

$url .= str_replace('+', '-', $id).'/';

To change it for searching, edit the line

$url .= urlencode($id);

and change it to

$url .= str_replace('+', '-', urlencode($id));


File 2: Now in the includes/classes/class.helper.php file find the function _MakeURLSafe($val) and just before the return $val; line add the line

$val = str_replace('+', '-', $val);

Also in the _MakeURLNormal($val) function just below it, just after the { at the start of the function add the line

$val = str_replace('-', '+', $val);

so the two functions become

        /**
        * _MakeURLSafe
        * Make a string safe for being a url
        *
        * @param string $val The string to make safe
        *
        * @return string The safe string
        */
        function _MakeURLSafe($val)
        {
            $val = str_replace('/', '{47}', $val);
            $val = urlencode($val);
            $val = str_replace('+', '-', $val);
            return $val;
        }

        /**
        * _MakeURLNormal
        * Make a url which was made safe with _MakeURLSafe normal again
        *
        * @param string The sanitized string
        *
        * @return string The original string
        */
        function _MakeURLNormal($val)
        {
            $val = str_replace('-', '+', $val);
            $val = urldecode($val);
            $val = str_replace('{47}', '/', $val);
            return $val;
        }





Powered by Interspire Knowledge Manager - World's #1 Best Selling FAQ and Knowledge Base Software