MyBB Community Forums

Full Version: Downloading (Exporting) User's Own Threads/Posts
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
A user on my website posed an interesting question to me earlier today. 

Can a user download (export) their own threads/posts in a similar manner that is done for PMs?

If no...

Can this be done through the database via phpMyAdmin?

Does anyone have any idea if this can be done?
Anyone know how this can be done?

Let me know!
I’m slightly curious about this as well.
I'm not aware of any way to export the way you can PMs from the software but you can definitely get the data directly from the database. Something like this would work for getting the posts for a specific user:

SELECT subject, dateline, message FROM posts WHERE uid = {user_id};

That's obviously just raw data and would include hidden posts as well (add "AND visible = 1" to the end if you want to omit hidden posts). Once you have that, you'd need to process it a bit. You can make the date/time readable by replacing dateline above with:

DATE_FORMAT(FROM_UNIXTIME(dateline), '%Y-%m-%d %H:%i') AS dateline

The above would give you a date formatted as YYYY-MM-DD and a 24-hour time.

There's obviously a ton more you could do but without knowing exactly what you're looking for, this should give you the basics at least.
(2018-10-25, 06:42 PM)Petie Wrote: [ -> ]I'm not aware of any way to export the way you can PMs from the software but you can definitely get the data directly from the database. Something like this would work for getting the posts for a specific user:

SELECT subject, dateline, message FROM posts WHERE uid = {user_id};

That's obviously just raw data and would include hidden posts as well (add "AND visible = 1" to the end if you want to omit hidden posts). Once you have that, you'd need to process it a bit. You can make the date/time readable by replacing dateline above with:

DATE_FORMAT(FROM_UNIXTIME(dateline), '%Y-%m-%d %H:%i') AS dateline

The above would give you a date formatted as YYYY-MM-DD and a 24-hour time.

There's obviously a ton more you could do but without knowing exactly what you're looking for, this should give you the basics at least.

That looks like a start.

Here's what the user is requesting.

This user has over 1,000 posts in various forums, but she does NOT want all 1,000 posts. She is requesting the last 500 posts in all forums.

Or... something like this in the screenshot... see the bottom of the screenshot. (those are my posts)

She was wondering if there is an option that can be added on for all users to download their own threads/posts to their liking. 

I am not certain if this can be done through MyBB itself (or via plugin?), or this has to be done via some database commands. 

[Image: c8108d39e1f8238f5a3a2f02d9652f60.png]
Use the GDPR Amnesia plugin.
(2018-10-25, 08:12 PM)Wires Wrote: [ -> ]Use the GDPR Amnesia plugin.

My website is not of European origin. 

It's a USA website and I don't use the Amnesia plugin for that reason.
That’s not what I meant. I meant that it has the functions (I believe) you’re looking for, whether you actually need to comply with GDPR or not.
(2018-10-26, 02:00 AM)Wires Wrote: [ -> ]That’s not what I meant. I meant that it has the functions (I believe) you’re looking for, whether you actually need to comply with GDPR or not.

Reading up on Amnesia, I don't see anything about the ability of a user to archive their threads/posts.

All I see is the ERASURE of their posts.
(2018-10-25, 07:51 PM)Serpius Wrote: [ -> ]She is requesting the last 500 posts in all forums.

Easy.

SELECT p_id, subject, dateline, message FROM posts WHERE uid = {user_id} ORDER BY p_id DESC LIMIT 500;

Select the appropriate tables, from the posts table, where user id is the users ID number, order by post ID number, descending, limit 500, so the last 500 posts.
Pages: 1 2