[SOLVED] Restoring posts?

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
User avatar
Toxyy
Registered User
Posts: 697
Joined: Mon Oct 24, 2016 3:22 pm
Location: Namek
Contact:

[SOLVED] Restoring posts?

Post by Toxyy » Sat Dec 22, 2018 1:14 am

There doesn't seem to be an event related to restoring posts, and I'm not sure if its core.approve_posts_after or something. I need to change the forums/topics table on a post soft delete and also when it's restored.
Last edited by Toxyy on Sat Jan 05, 2019 1:59 am, edited 1 time in total.
I am a web developer/administrator, specializing in forums. If you have work you need done or are too lazy to do, pm me!

My extensions:
[3.2][BETA] Anonymous Posts || [3.2][BETA] Sticky Ad || [3.2][RC] Show User Activity ||
[3.2][DEV] User Delete Topics

User avatar
caiocald
Registered User
Posts: 60
Joined: Mon Feb 26, 2018 9:32 pm
Location: Brasil
Name: B!
Contact:

Re: Restoring posts?

Post by caiocald » Sat Dec 22, 2018 4:15 am

Have you tried searching with this extension?

Att

viewtopic.php?t=2283446

User avatar
Toxyy
Registered User
Posts: 697
Joined: Mon Oct 24, 2016 3:22 pm
Location: Namek
Contact:

Re: Restoring posts?

Post by Toxyy » Sat Dec 22, 2018 7:23 am

caiocald wrote:
Sat Dec 22, 2018 4:15 am
Have you tried searching with this extension?
It's a certain function probably within mcp.php so martii's extension can't help right now unfortunately.

By the way I think he has a newer version, but I can't remember.
I am a web developer/administrator, specializing in forums. If you have work you need done or are too lazy to do, pm me!

My extensions:
[3.2][BETA] Anonymous Posts || [3.2][BETA] Sticky Ad || [3.2][RC] Show User Activity ||
[3.2][DEV] User Delete Topics

User avatar
</Solidjeuh>
Registered User
Posts: 1684
Joined: Tue Mar 29, 2016 3:45 am
Location: Aalst (Belgium)
Name: Andy Dm
Contact:

Re: Restoring posts?

Post by </Solidjeuh> » Sat Dec 22, 2018 8:35 am

Toxyy wrote:
Sat Dec 22, 2018 7:23 am
[By the way I think he has a newer version, but I can't remember.
This: viewtopic.php?f=456&t=2470356
Register a free account & Play!!
~~~ https://www.solidjeuh.be ~~~

User avatar
caiocald
Registered User
Posts: 60
Joined: Mon Feb 26, 2018 9:32 pm
Location: Brasil
Name: B!
Contact:

Re: Restoring posts?

Post by caiocald » Sat Dec 22, 2018 8:36 am

Toxyy wrote:
Sat Dec 22, 2018 7:23 am
caiocald wrote:
Sat Dec 22, 2018 4:15 am
Have you tried searching with this extension?
It's a certain function probably within mcp.php so martii's extension can't help right now unfortunately.

By the way I think he has a newer version, but I can't remember.
Look at the link from his repository in github

User avatar
Toxyy
Registered User
Posts: 697
Joined: Mon Oct 24, 2016 3:22 pm
Location: Namek
Contact:

Re: Restoring posts?

Post by Toxyy » Sat Dec 22, 2018 7:36 pm

caiocald wrote:
Sat Dec 22, 2018 8:36 am
Look at the link from his repository in github
No:
</Solidjeuh> wrote:
Sat Dec 22, 2018 8:35 am
This: viewtopic.php?f=456&t=2470356
I am a web developer/administrator, specializing in forums. If you have work you need done or are too lazy to do, pm me!

My extensions:
[3.2][BETA] Anonymous Posts || [3.2][BETA] Sticky Ad || [3.2][RC] Show User Activity ||
[3.2][DEV] User Delete Topics

User avatar
mrgoldy
Jr. Extension Validator
Posts: 1051
Joined: Tue Oct 06, 2009 7:34 pm
Location: The Netherlands
Name: Gijs

Re: Restoring posts?

Post by mrgoldy » Sat Dec 22, 2018 7:57 pm

I am having a hard time understanding your question, as in; what are you really after?
The event that is triggered for restoring is indeed named "approve", but the $action variable defined in the $event is set to restore.
This is cause 'approve' and 'restore' share a lot of the same functionallity and events are commonly names after the class/function they are in, and since this function is named approve_posts()/approve_topics() it's named ".._approve_..".

The way I usually find the event I want, is some tracking through Github (or local editor), eventhough I somehow prefer Github.
For example, the mcp 'restore' action leads here: https://github.com/phpbb/phpbb/blob/mas ... ue.php#L52
That calls a function here: https://github.com/phpbb/phpbb/blob/mas ... hp#L60-L64
Which is this function: https://github.com/phpbb/phpbb/blob/mas ... e.php#L687

So yeah, you have the correct function, you justh ave to check for the correct action in the event data! :+1:
phpBB Studio / ''Proud member of the Studio"

User avatar
Toxyy
Registered User
Posts: 697
Joined: Mon Oct 24, 2016 3:22 pm
Location: Namek
Contact:

Re: [SOLVED] Restoring posts?

Post by Toxyy » Sat Jan 05, 2019 1:58 am

mrgoldy wrote:
Sat Dec 22, 2018 7:57 pm
...
So I took your advice and dug even deeper and decided to make events in the two sync functions instead as it covers fixing info for most mcp actions. Thanks!
I am a web developer/administrator, specializing in forums. If you have work you need done or are too lazy to do, pm me!

My extensions:
[3.2][BETA] Anonymous Posts || [3.2][BETA] Sticky Ad || [3.2][RC] Show User Activity ||
[3.2][DEV] User Delete Topics

Post Reply

Return to “Extension Writers Discussion”