Live Stoners Live Stoner Chat - Jul-Sep '23

Status
Not open for further replies.
Thats a great idea, except I dont know what that means. :biggrin:


@NORBY wants site info/help that is beyond my tech spec......so I have put it into Reported Post to see if anyone can Answer it for him......... :headbang:
 
Pan fried cheese and smokies for brekkie.

breakfast.jpg
 

who thinks a post forwarding option to your own created threads would be a good idea for the people who have a few threads going.​

I find it a bit time consuming copy & pasting and then have to upload pics and vids again too.​

It would make my life easyier if i could forward my origonal post to another thread or multible threads lol​

(I had to copy and paste this from another thread)View attachment 1628689


I'm pretty sure there's no option for that in the Admin panel - it would probably be a custom plugin if it could be done.

Lemme just ask my GPT what it thinks ^_^
:passit:

Edit: it doesn't sound so bad .. here's the steps involved

Steps to Create the Plugin​

  1. Environment Setup: Make sure you have a local or test environment set up for your XenForo forum to test the plugin.
  2. Database Alterations: You might need to make some database alterations if you're storing metadata about the forwarded posts.
  3. Backend Logic: This is where the bulk of your PHP code will go.
  4. Frontend Interface: This could be a simple button near each post to forward it, along with some JavaScript to handle the UI.
  5. Testing: Rigorous testing to make sure it doesn't break anything on the existing forum.
  6. Deployment: Once tested, the plugin can be installed on the live forum.
and we just need to mash this code and some other bits and peices together

This is the backend logic (we know how important thems are)

Code:
class YourPluginName_ControllerPublic_Thread extends XFCP_YourPluginName_ControllerPublic_Thread
{
    public function actionForward()
    {
        // Get the post ID and user ID
        $postId = $this->_input->filterSingle('post_id', XenForo_Input::UINT);
        $userId = XenForo_Visitor::getUserId();

        // Check if the user is the thread creator
        if ($this->isThreadCreator($userId)) {
            // Logic to forward the post to the user's thread
            $this->forwardPostToThread($postId, $userId);
        }
    }

    private function isThreadCreator($userId)
    {
        // Logic to check if the user is the thread creator
    }

    private function forwardPostToThread($postId, $userId)
    {
        // Logic to forward the post
    }
}


And the front end interface (for yamming ( i wanna yamit with you ... I'm yammmin .... and i hope you like yammin toooo)

Code:
<!-- Add this in the post template loop -->
<a href="javascript:void(0);" onclick="forwardPost({$post.post_id})">Forward</a>

<script>
function forwardPost(postId) {
    // JavaScript code to trigger the backend logic
}
</script>


And i think thats about all there is too it - but i've gone as far as i can ... i'm at my limit!! :help: Hobbessseeeyyyyyyyyyyyyyy *shakes fist at the sky*

:bighug::pass:
 
@Mossy - happy Saturday! :D

I'll take the environment, and you've got the database ... wwwillie can take the code .. norbys on the testing .. and finally hobbesey for the deployment.


I've got a really good feeling about this one


 
Status
Not open for further replies.
Back
Top