Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
628 views
in Q2A Core by
In v1.3, I modified qa-page-home.php so that All-activity page would display as a default page instead Question page.

I'd like to do the same thing in V1.4 but I could not find qa-page-home.php.

Could you show me any clue to deal with that?
related to an answer for: error when upgrade to v1.4

1 Answer

0 votes
by
 
Best answer

Actually with a few modifications (that will be in the final release) you should be able to do this much more easily using the new $QA_CONST_PATH_MAP setting in qa-config.php (which lets you modify Q2A's standard URLs).

First, change this line in qa-base.php:

if ( strlen(@$requestparts[0]) && isset($QA_CONST_PATH_MAP) && strlen(@$QA_CONST_PATH_MAP[$requestparts[0]]) )

... to ...

if ( strlen(@$requestparts[0]) && isset($QA_CONST_PATH_MAP) && isset($QA_CONST_PATH_MAP[$requestparts[0]]) )

Then, change these lines in qa-index.php:

if ( strlen(@$requestparts[$key]) && isset($QA_CONST_PATH_MAP) ) {
$replacement=array_search($requestparts[$key], $QA_CONST_PATH_MAP, true);
 
... to ...
 
if (isset($QA_CONST_PATH_MAP)) {
$replacement=array_search((string)@$requestparts[$key], $QA_CONST_PATH_MAP, true);
 
Finally, add this in your qa-config.php file:
 
$QA_CONST_PATH_MAP=array(
'activity' => '',
);
 
Everything but the last step will be taken care of in the next release.
 
Please let me know how this works for you, and if it causes any odd behavior elsewhere!
 
By the way, the functionality in qa-page-home.php has now been split into many files, but you'd want to be looking in qa-page-default.php.

 

...