Need to know file names where move thread code is present

gginni

Active member
Hi,

I want to do some custom things while moving thread in particular forum. I know PHP and I did same for mybb code with pretty ease but here you guys have used framework, so it is taking a lot of efforts to understand. Do you guys have any developers guide??

I actually want to do some custom coding while moving thread.

I checked the template and it is post request to "threads/move" but I'm unable to find in which file should I make changes...

Let's say I add a text box in move thread popup. Now I need to read the textbox value on submit button and do some mysql operation. Just tell me file name, remaining things I will do at my own :)
 
You will be looking in XenForo_ControllerPublic_Thread and the function will be actionMove() (line 1001)

XenForo_ControllerPublic_Thread is located at library/XenForo/ControllerPublic/Thread.php.

You'll be better off creating an add-on rather than edit the existing XF code.
 
You will be looking in XenForo_ControllerPublic_Thread and the function will be actionMove() (line 1001)

XenForo_ControllerPublic_Thread is located at library/XenForo/ControllerPublic/Thread.php.

You'll be better off creating an add-on rather than edit the existing XF code.

Thanks a lot bro :)... I know it is not advisable to change the existing XF code directly but bro this is for personal use and I want to do things bit faster :)

Thanks for telling file name and function name :)... You saved my efforts :)... I will do the required changes now :)
 
Thanks a lot bro :)... I know it is not advisable to change the existing XF code directly but bro this is for personal use and I want to do things bit faster :)

Thanks for telling file name and function name :)... You saved my efforts :)... I will do the required changes now :)

It's not "faster". When you upgrade to 1.2 (or even just 1.1.5) everything will be overridden so you will have to do the changes again.

Best way is to extend the relevant class and create a listener. In this case you can even disable the change if it breaks your forum.
 
It's not "faster". When you upgrade to 1.2 (or even just 1.1.5) everything will be overridden so you will have to do the changes again.

Best way is to extend the relevant class and create a listener. In this case you can even disable the change if it breaks your forum.

It will take time for me to learn how to create listeners ... I wanted to get things faster so that I can go live with the forum... Now I have done the required changes in that function only and those are minor changes... Even if upgrade will come then I can again replace those lines in the same file

And I will surely look at how to create listeners and all and after that will not be playing with xenforo files directly :).. It is just need of an hour coz I want to get things done fast :)
 
It will take time for me to learn how to create listeners ... I wanted to get things faster so that I can go live with the forum... Now I have done the required changes in that function only and those are minor changes... Even if upgrade will come then I can again replace those lines in the same file

And I will surely look at how to create listeners and all and after that will not be playing with xenforo files directly :).. It is just need of an hour coz I want to get things done fast :)

It doesn't. All you need is:

Listener.php
Code:
class SomeClass_Listener {
    public static function loadClassController($class, array &$extend) {
        switch ($class) {
            case 'XenForo_ControllerPublic_Thread':
                $extend[] = 'SomeClass_ControllerPublicThread';
                break;
        }
    }
}

ControllerPublicThread.php
Code:
class SomeClass_ControllerPublicThread extends XFCP_SomeClass_ControllerPublicThread {
    ... functionality to override here
}

Then add the entry in the Code listeners class and refer it to an addon. If you haven't created one, make one.
 
Thanks for telling bro :)... I will surely look at how to create add-ons and will soon start creating add-ons :)
 
Back
Top Bottom