Method for deleting discarded stories

Register an Account
Reply
 
Thread Tools Display Modes
  #51 (permalink)  
Old 03-21-2008, 02:14 PM
Constant Pligger
 
Join Date: Apr 2007
Posts: 1,042
Quote:
Originally Posted by tbones View Post
Delete_storylink($linkid) needs the ID of every single story therefore I wonder whether itīs more efficient to use this function directly at Admin: Change the status.

Would it be very difficult to apply it there?
If itīs too difficult you could also change discard at Admin - News Management to delete since discard is this still available through the admin menu at the article itself (I use that in 99% of all cases).
Reply With Quote
  #52 (permalink)  
Old 03-21-2008, 03:32 PM
Pligg Donor
Pligg Version: 9.8.2 +
Pligg Template: yget
 
Join Date: Jul 2007
Posts: 123
Quote:
Originally Posted by bbrian017 View Post
Hi fingerprn thanks for the quick reply on this topic! Do you recall doing any other adjustment to make it work or did you just follow the initial post?
No adjustments needed.
Reply With Quote
  #53 (permalink)  
Old 03-21-2008, 04:19 PM
Banned
Pligg Version: 9.9.5
 
Join Date: Oct 2007
Location: Canada
Posts: 784
Would this have an affect on loading time? Also how do I remove everything from 2007 from the database!
Reply With Quote
  #54 (permalink)  
Old 03-21-2008, 04:34 PM
wnw's Avatar
wnw wnw is offline
Casual Pligger
Pligg Version: 9.9.5
Pligg Template: Wnw
 
Join Date: Dec 2007
Posts: 55
works like a charm..thanks
Reply With Quote
  #55 (permalink)  
Old 03-21-2008, 05:30 PM
Pligg Donor
Pligg Version: 9.8.2 +
Pligg Template: yget
 
Join Date: Jul 2007
Posts: 123
Quote:
Originally Posted by bbrian017 View Post
Would this have an affect on loading time? Also how do I remove everything from 2007 from the database!
1. Unless you have thousands of discarded stories, I doubt it would help that much. There are only two things I've found that can signifcantly speed up loading time: a more powerful server and eAccelerator (do a search for this term in the forum for more info).

2. I'm assuming you mean delete ALL stories from before 2007 and not just discarded ones since the original mod already does this. Here is an UNTESTED solution:

In admin_delete_stories.php, find:

$sql_query = "SELECT * FROM " . table_links . " WHERE link_status = 'discard'";

and replace with:

Code:
$sql_query = "SELECT * FROM " . table_links . " WHERE link_date < '2008-01-01 00:00:00'";
Hope this helps.
Reply With Quote
  #56 (permalink)  
Old 03-31-2008, 07:52 PM
New Pligger
Pligg Version: 9.9
Pligg Template: Mr. Techie
 
Join Date: Mar 2008
Location: Italy
Posts: 14
Wonderful Hack !!!!
Reply With Quote
  #57 (permalink)  
Old 04-01-2008, 03:58 PM
Banned
Pligg Version: 9.9.5
 
Join Date: Oct 2007
Location: Canada
Posts: 784
Hey thanks fingerprn, I will try that when I get home! But you know what I have been doing but it's a slow process!

I have searched for all queued stories and I discarded the last like 125 pages! and then I deleted all discarded stories and it seems to have worked well!


This mod is pretty cool!
Reply With Quote
  #58 (permalink)  
Old 04-03-2008, 04:25 PM
New Pligger
 
Join Date: Apr 2008
Posts: 3
Thanks a lot for this!
Reply With Quote
  #59 (permalink)  
Old 04-07-2008, 05:35 AM
longcountdown's Avatar
Pligg Donor
Pligg Version: 9.8.2
Pligg Template: moderno-orange
 
Join Date: Nov 2007
Location: Japan
Posts: 75
Excellent! 331 discarded stories deleted and the database was optimized! :-D
Reply With Quote
  #60 (permalink)  
Old 04-12-2008, 06:27 AM
Constant Pligger
 
Join Date: Apr 2007
Posts: 1,042
Quote:
Originally Posted by tbones View Post
I would like to appreciate the participation of the commenters so I donīt want to delete discarded stories with comments. Iīd rather subsitute the title and the content of the story with "This content has been moved" as a polite message.

Could you help me with a hack for that alternative?
Iīve found a general way to preserve but not show stories and use your mod: Itīs based on redwineīs work (http://forums.pligg.com/core-develop...submitted.html) and defines a new category 'hidden'.

First you have to change the database tables:
Code:
alter table your_table_name_links change link_status link_status enum('discard','queued','published','abuse','duplicated','hidden') NOT NULL default 'discard';

insert into your_table_name_totals (`name`, `total`) values ('hidden', 0);
Then you do what redwine suggested with the files /templates/yourtemplate/admin_templates/admin_links_center.tpl and admin_links.php except you change 'pending' to 'hidden'.

Thatīs it!
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Url Method 2 works for everything except stories coreyvf Questions and Comments 2 10-11-2009 02:07 AM
Voting method 2, displaying stories in order of rating radaro Questions and Comments 4 02-03-2008 02:44 AM
v9.5: Comments to discarded stories tbones Questions and Comments 6 01-28-2008 07:49 AM
Clicking on a tag reveals stories that have been discarded kbeeveer46 Questions and Comments 0 08-07-2006 01:36 AM
User vote count shouldn't include discarded stories gragland Questions and Comments 0 07-26-2006 09:14 PM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development