Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
295 views
in Q2A Core by

Does anyone have some thoughts on how best to simplify what appears to be these pretty convoluted lines of code?

        $url = str_replace("\\", '/', dirname(__FILE__));
        $root = qa_path_absolute($url);

        $pos = strpos($url, 'qa-plugin/');
        $url = substr($url, $pos);

        $pos = strpos($root, 'index.php');
        $root = substr($root, 0, $pos);

        $url = $root . $url;

        $qa_content['q_list']['form']['hidden']['viewedquestionsurl'] = $url;

Q2A version: 1.7.4
by
You should clarify what you want and IN(before) and OUT(After) at first.

Please log in or register to answer this question.

...