Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
755 views
in Plugins by
Hi i have found double (//) or triple (///) or four(////) slash in url of blog navigations, categories etc. how to remove these and convert into one slash only
by
Then later add to each url of the site
by
where do you got the "slash in url of blog navigations" . Blog navigation means ??

2 Answers

+2 votes
by
Please check the plugin code (checl all page modules ) . There mightbe one extra slashes are there . Check for the below two functions . There might be one extra slash added by mistake - 
 
function match_request($request)
{
if ($request=='blog')   // may be change to if ($request=='/blog') in the file 
return true;
 
return false;
}
 
function suggest_requests() // for display in admin interface
{
return array(
array(
'title' => 'Example',
'request' => 'blog',    //might be there is 'request' => '/blog', in the plugin file . 
'nav' => 'M', 
),
);
}
 
If the request parts starts with a / then remove those . It should work perfect for you . 

Hope this helps . 

by
which file need to check
by
first check the qa-plugin.php . You would find few files were registered with page module .
eg - if you found something like this
    qa_register_plugin_module('page', 'qa-example-page.php', 'qa_example_page', 'Example Page');

then qa-example-page.php is the right file for you to check .
by
find something in qa-blog file

return array(
            array(
                'title' => 'Blog',
                'request' => 'blog',
                'nav' => 'M', // 'M'=main, 'F'=footer, 'B'=before main, 'O'=opposite main, null=none
            ),
        );
    }
by
where these files located unable to find
by
Then it looks good only . can you check the match_request($request) function . paste the content here please .

If this is also fine then cross check the Preferred site URL: in Admin -> General section
by
public function match_request( $request )
    {
        return strpos($request, 'blog') !== false;
    }
       
    /*
        MAIN function: display the chat room, or run an AJAX request
    */
    public function process_request( $request )
    {
        $category_1 = qa_opt('qa_blog_cat_1');
        $category_2 = qa_opt('qa_blog_cat_2');
        $category_3 = qa_opt('qa_blog_cat_3');
        $category_4 = qa_opt('qa_blog_cat_4');
        $category_5 = qa_opt('qa_blog_cat_5');
       
        $qa_content=qa_content_prepare();
        $cat = -1;
        if (isset($_GET['category'])) $cat = $_GET['category'];
            $qa_content['navigation']['sub'] = array();
$qa_content['navigation']['sub']['all'] = array(    'label' => qa_lang('qa_blog_lang/nav_all'),
                'url' => qa_path_to_root().'/blog',
                'selected' => isset($_GET['category']) ? 0 : 1);
        $qa_content['navigation']['sub']['cat1'] = array('label' => $category_1,
                'url' => qa_path_to_root().'/blog?category=1',
                'selected' => $cat == 1 ? 1 : 0);           
        $qa_content['navigation']['sub']['cat2'] = array('label' => $category_2,
                'url' => qa_path_to_root().'/blog?category=2',
                'selected' => $cat == 2 ? 1 : 0);
        $qa_content['navigation']['sub']['cat3'] = array('label' => $category_3,
                'url' => qa_path_to_root().'/blog?category=3',
                'selected' => $cat == 3 ? 1 : 0);
        $qa_content['navigation']['sub']['cat4'] = array('label' => $category_4,
                'url' => qa_path_to_root().'/blog?category=4',
                'selected' => $cat == 4 ? 1 : 0);
        $qa_content['navigation']['sub']['cat5'] = array('label' => $category_5,
                'url' => qa_path_to_root().'/blog?category=5',
                'selected' => $cat == 5 ? 1 : 0);
        $qa_content['navigation']['sub']['post'] = array('label' => qa_lang('qa_blog_lang/nav_post'),
                'url' => qa_path_to_root().'/articles');
by
then it should work . I am not sure whats wrong here . Conatct Jaxilla . He might help .
by
Got the answer thanks
by
Please post that also here . It would help others who is using the plugin .
0 votes
by
in qa-blog file find qa_path_to_root().'/ everywhere and remove all /

else simple open file in notepad and press c+h

replace

qa_path_to_root().'/

with

qa_path_to_root().'
...