Go Back   Pligg CMS Forum > Pligg Help > General Help

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-16-2007, 06:50 AM
dollars5's Avatar
Pligg is my love :)
 
Join Date: Dec 2006
Location: India
Posts: 2,154
Thanks: 290
Thanked 266 Times in 177 Posts
A small change to admin_links.php

Hello All,

In admin_links .php there is a provision to change the status of a story to published from the admin-news management - but the problems was that the link published date was not updated - I just added the following lines to fix it:
Find the following code:
Code:
// if admin changes the link status
	if ($_GET['action'] == "bulkmod") {
		if(isset($_POST['submit'])) {
			$comment = array();
			foreach ($_POST["link"] as $k => $v) {
				$comment[intval($k)] = $v;
			}
			foreach($comment as $key => $value) {
				if ($value == "publish") {
the replace the original update query with the following code:
Code:
$db->query("UPDATE " . table_links . " SET link_status = 'published' , link_published_date = now() WHERE link_id = '$key'");
In similar manner replace the queued update query to the following
Code:
$db->query("UPDATE " . table_links . " SET link_status = 'queued' , link_published_date=0 WHERE link_id = '$key'");
so the final code block will look like:
Code:
// if admin changes the link status
	if ($_GET['action'] == "bulkmod") {
		if(isset($_POST['submit'])) {
			$comment = array();
			foreach ($_POST["link"] as $k => $v) {
				$comment[intval($k)] = $v;
			}
			foreach($comment as $key => $value) {
				if ($value == "publish") {
					$db->query("UPDATE " . table_links . " SET link_status = 'published' , link_published_date = now() WHERE link_id = '$key'");
				}
				elseif ($value == "queued") {
					$db->query("UPDATE " . table_links . " SET link_status = 'queued' , link_published_date=0 WHERE link_id = '$key'");
				}
				elseif ($value == "discard") {
					$db->query('UPDATE `' . table_links . '` SET `link_status` = "discard" WHERE `link_id` = "'.$key.'"');
				}
			}

			header("Location: ".my_pligg_base."/admin_links.php");
		}
	}
this will update the timestamps accordingly - since the site that develop made use of these parameters I noticed it. If it is changed in the SVN too - I would really be happy.
Reply With Quote
The Following User Says Thank You to dollars5 For This Useful Post:
  #2 (permalink)  
Old 04-16-2007, 08:08 AM
kbeeveer46's Avatar
Pligg Developer/Admin
Pligg Version: 0
Pligg Template: none
 
Join Date: Jun 2006
Location: Muncie, Indiana
Posts: 3,547
Thanks: 254
Thanked 649 Times in 513 Posts
Thanks for the heads up. This will be put in the SVn asap.
__________________
I accept donations for my time helping users like you on the forum and IRC.
Reply With Quote
Reply

Thread Tools
Display Modes
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't change password rssfeeds Installation and Upgrade Help 1 08-02-2008 06:14 AM
HELP: Continuos parse errors when trying to change the template code juanmartinbravo General Help 7 01-26-2008 05:03 AM
[SOLVED] how to change site title mkooo Modification Tutorials 2 06-28-2007 06:00 PM
A Small Change Templora "Digital Nature" 3 01-23-2007 04:28 PM
How to make / change a template in Pligg Beta 7 jimbeam General Help 0 12-05-2006 01:19 PM


Search Engine Friendly URLs by vBSEO 3.2.0