Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
824 views
in Q2A Core by
Hi!

I'd like to create a filtered user info page, where you can only see, what is the user did recently (beside with the normal page)

So it would be great to have normal user infos with "/index.php?qa=user&qa_1=test_user" and filtered user info with "index.php?qa=user2&qa_1=test_user" (or something like that)

From the qa-page-user.php i cut out the information i don't need, but i'm not a php expert as you can see, and i can't ,,call in" the qa-page-user2.php.

How can i manage that?

Thanks in advance!

Best regards,
Thom
Q2A version: 1.4.3

1 Answer

0 votes
by

You can do this in a plugin using a page module. Your module's process_request(...) function can start with the contents of qa-page-user.php and you can then go and modify it from there.

by
edited by
I as well would be happy on some more instruction. In my case i simply want a second user page which holds the latest activities and a third one which holds favorite posts. I figured out how to get the favorites visible even for not logged in users but i cant set up that page.

To just try what i can do myself, I took the example page plugin, changed all "example" against "fav", took from DG´s activity module slightly modified

class qa_fav_page {


private $directory;
    private $urltoroot;
    private $user;
    private $reqmatch = '#user-fav/([^/]+)#';


    function load_module( $directory, $urltoroot )
    {
        $this->directory = $directory;
        $this->urltoroot = $urltoroot;
    }

    function suggest_requests() // for display in admin interface
    {
        return array(
            array(
                'title' => 'Fav page',
                'request' => 'user-fav',
                'nav' => 'M',
            ),
        );
    }
   
    function match_request( $request )
    {
        return preg_match( $this->reqmatch, $request ) > 0;
    }

function process_request($request)
        {

and from here on the qa-page-user.php content as mentioned above.

I can add the page in admin and set a link, but thats all, calling the page throws PAGE NOT FOUND. Not even getting to the point to have that page for each user in user context...

For those, who have less experience it seems to be extremely difficult to set something like this up.

Or is there another way to duplicate the single user page, and then just cutting out what is not needed on the one or other ?

Any help is welcome. I am as well willing to pay as mentioned several times before. Unluckily on very most plugin requests dont come in responses or offers at least. For me and others this is kind of ugly to observe as it is simply a stop point.
...