Pligg CMS Forums


Go Back   Pligg CMS Forum > Pligg Help > General Help



How to delete Posts?


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-13-2007, 07:00 PM
New Pligger
 
Join Date: May 2007
Posts: 9
Unhappy How to delete Posts?

How do i delete posts by users or in generel posts by users i dont want on my website?
Reply With Quote
Sponsor
  #2 (permalink)  
Old 05-13-2007, 07:07 PM
Yankidank's Avatar
Coder/Designer
Pligg Version: SVN
Pligg Template: Wistie
 
Join Date: Dec 2005
Location: Ocala, FL
Posts: 2,913
Send a message via AIM to Yankidank Send a message via Skype™ to Yankidank
  1. Log in as an admin or god level user.
  2. Find the story you wish to modify/delete.
  3. Click on "admin links" just below the title.
  4. Click "Admin: change the status".
  5. Choose "Set to discard", "Set to queued" or "Set to published".

Need a Web Host ?
Save up to $84
when you purchase hosting from Dreamhost.com.
Use the coupon code PLIGG when buying a web hosting package from Dreamhost.com
Reply With Quote
  #3 (permalink)  
Old 05-30-2007, 07:59 PM
New Pligger
 
Join Date: May 2007
Posts: 13
If you set a post to 'discard', it doesn't show up on the upcoming or published pages, but it still exists (takes up space in the database, clutters up the News Management window). Is there a way to cleanly delete the post like it never existed? Seems you should be able to do this without hacking away with phpMyAdmin, and risking the nasty side affects that come with deleting the wrong things.
Reply With Quote
  #4 (permalink)  
Old 06-09-2007, 06:17 PM
Pligg Donor
 
Join Date: Jun 2007
Posts: 62
I agree. I have quite a few test posts which all are labeled 'discard' but they clutter up my admin news management page.
Reply With Quote
  #5 (permalink)  
Old 06-09-2007, 06:46 PM
P1mpPanther's Avatar
Constant Pligger
 
Join Date: Feb 2007
Posts: 292
i think the only way to actually "remove" the posts is from the database - you can probably do it with phpMyAdmin or something similar.
Reply With Quote
  #6 (permalink)  
Old 06-09-2007, 08:38 PM
New Pligger
 
Join Date: May 2007
Posts: 13
Quote:
Originally Posted by P1mpPanther View Post
i think the only way to actually "remove" the posts is from the database - you can probably do it with phpMyAdmin or something similar.
Undoubtedly it's possible if you know where to delete the post, and then where to find all the references to the post to delete as well, but that's not practical. This software needs a built in method for truly and properly deleting a post.
Reply With Quote
  #7 (permalink)  
Old 06-17-2007, 05:38 AM
New Pligger
 
Join Date: Jun 2007
Posts: 2
I have got the same problem.

I want to completly delete newsposts but it seems not to be possible.

For the upcoming releases please fix this problem.
Reply With Quote
  #8 (permalink)  
Old 06-30-2007, 05:04 PM
New Pligger
 
Join Date: Jun 2007
Posts: 7
So when I goto PhpMyAdmin. In my database which table contains the posts?

Thanks,
ivnj
Reply With Quote
  #9 (permalink)  
Old 07-03-2007, 07:14 AM
New Pligger
 
Join Date: Jul 2007
Posts: 29
It is the pligg_links table.
You can easily delete alls DISCARD posts with the SQL-command:
DELETE FROM pligg_links WHERE link_status = 'discard'

But a better way is, of course, to integrate this into the admin control panel
I take a look at it and maybe upload a hack here.
Reply With Quote
  #10 (permalink)  
Old 07-03-2007, 08:36 AM
New Pligger
 
Join Date: Jul 2007
Posts: 29
Ok got this finished.

Changes in admin_links.php, just enter under the links for marking
Code:
<a href=# onclick="javascript:window.open('admin_delete.php?time=259200', 'ab 3 Tage löschen', 'width=200, height=100')">delete 3-day old discard</a>
and now make a new file called admin_delete.php
it is maybe to much included, but i works ;)
Code:
<?php
include_once('Smarty.class.php');
$main_smarty = new Smarty;

include('config.php');
include(mnminclude.'html1.php');
include(mnminclude.'link.php');
include(mnminclude.'user.php');
include(mnminclude.'smartyvariables.php');
			
// require user to log in
force_authentication();

// restrict access to god only
$canIhaveAccess = 0;
$canIhaveAccess = $canIhaveAccess + checklevel('god');

// sidebar
$main_smarty = do_sidebar($main_smarty);

if ($canIhaveAccess == 1 && isset($_GET[time])) {
	$time = $_GET[time];
	
	$time = date("U") - $time;
	$time = date("Y-m-d H:i:s",$time);   
	
	$db->query ("DELETE FROM " . table_links . " WHERE link_date < '$time' AND link_status = 'discard'");
	echo MYSQL_AFFECTED_ROWS()." rows affected";
}
?>
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing how the posts are sorted on frontpage cbolseth Customization Assistance 6 03-29-2009 06:11 PM
how to delete links from database? ivytony General Help 1 02-16-2008 12:15 AM
Please Help (How to Delete Posts) netspider General Help 1 02-12-2008 06:32 AM
Delete Posts, Database Level, Feed Import Problem pligge General Help 1 05-27-2007 08:30 PM

Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Use the coupon code PLIGG at Dreamhost.com to receive a discount of up to $84.00 Make a donation to support Pligg CMS development