Once a story/link is submitted, does it ever get deleted?
Put differently, if someone submits a link/story, does the Pligg system delete it after a certain amount of time?
I'm hoping the answer is "No". For what I plan to use Pligg for, I'd like all submitted links/stories to remain in the system forever.
In other words, does Pligg ever clean up the "Queued" or "Published" sections automatically? I hope not.
Thanks.
Sincerely,
Naomi
![]() |
| | LinkBack | Thread Tools | Display Modes |
| |||
| Once a Story is Submitted does it ever get deleted? Last edited by Naomi; 11-28-2006 at 11:51 AM.. |
| ||||
|
Nope, they stay there forever.
__________________ I accept donations for my time helping users like you on the forum and IRC. |
| ||||
|
Eventually we need to make a way to purge stories from the DB to save room, but for now there is no method to actually clear it from mysql.
|
| |||
| Thanks!
Thanks! That's great. Naomi |
| |||
|
//deletes a story and dependencies function delete_link($link_id) { global $db; $tables = array ( "pligg_links" => "link_id", "pligg_comments" => "comment_link_id", "pligg_feed_link" => "feed_link_id", "pligg_tags" => "tag_link_id", "pligg_trackbacks" => "trackback_link_id", "pligg_votes" => "vote_link_id", ); foreach($tables as $table => $field) $db->query("DELETE FROM ".$table." WHERE ".$field." = '".$link_id."'"); return true; } You could just do a query for link_id for a certain date range, then then run the delete_link to get rid of the story. It's simple to do. Could even have a script on a cron job that deletes all stories older than say 1 month. Or you can count how many link_id there are, and if you get over that threshold, then start deleting the oldest link_id until you are back under the threshold. |
| The Following User Says Thank You to acidride For This Useful Post: | ||
| |||
|
Another option could be to move older stories to an archive (move them to a separate database table) - and use a very simple text only viewing for old stories. Similar to what forums like vbulletin do with their archive viewing. That way all stories can still be viewed in a "pligg_archived" table, and the pligg_links table will never become so big as to affect performance. You could also cache archived pages once they had been viewed once, since they will never really change. Last edited by Simon; 04-09-2007 at 06:07 PM.. |
| |||
|
Why is it a problem for them to remain in the db? As long as archived stories are in their own table, and treated separately to "live" stories, then that keeps everything nice and clean. An admin could always choose to prune the archive table, or not include it in db backups. I don't think you can really have an archive unless the information is still somewhere in the database.
|
| |||
|
wow, I did not know that stories never get deleted. I submitted a story and then previewed it, but didn't actually submit it in step 3, the funny thing is, after I left the page, the story could still be accessed if you enter in the URL if it passed step 2 in the submit process. is this a bug or is this normal? |
| ||||
|
Hard thing about archiving things is that it probably requires some sort of cron job to change the tables after a certain period of time. After being around here for quite a long time I can tell you that many people have no idea what that is. When a feature has a high majority of users who aren't going to know how to use it it usually gets pushed down on the feature requests list.
__________________ I accept donations for my time helping users like you on the forum and IRC. |
![]() |
« Previous Thread
|
Next Thread »
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [SOLVED] Complete solution to approve the story after being submitted | redwine | Modification Tutorials | 36 | 11-09-2008 01:15 PM |
| Email notification when a story is submitted | federrer | General Help | 1 | 04-24-2008 01:48 AM |
| In Profile Submitted view page not show in center & show only 1 story not all | bhatiacane | Template Support | 3 | 10-13-2007 02:22 AM |
| Idea for scalable story promotion | jvallery | Suggestions | 6 | 04-18-2006 09:41 PM |





Linear Mode

