diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-03-27 04:29:23 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2006-03-27 04:29:23 +0000 |
commit | 7673d000dd8ec85908a99a1174840c8ca3c53e16 (patch) | |
tree | 8cbce751084279e680055f156824c52ea3b3b88b /lib | |
parent | 75434cbeb6e6c2e4107b9932a79b3d146dbdcc0f (diff) | |
download | ampache-7673d000dd8ec85908a99a1174840c8ca3c53e16.tar.gz ampache-7673d000dd8ec85908a99a1174840c8ca3c53e16.tar.bz2 ampache-7673d000dd8ec85908a99a1174840c8ca3c53e16.zip |
added some more to flagging and updated mail page to fit new standards
Diffstat (limited to 'lib')
-rw-r--r-- | lib/class/flag.class.php | 52 | ||||
-rw-r--r-- | lib/upload.php | 21 |
2 files changed, 73 insertions, 0 deletions
diff --git a/lib/class/flag.class.php b/lib/class/flag.class.php index 8bbdc2c9..dc6f44a3 100644 --- a/lib/class/flag.class.php +++ b/lib/class/flag.class.php @@ -113,6 +113,30 @@ class Flag { } // get_total /** + * get_flagged + * This returns an array of ids of flagged songs if no limit is passed + * it gets everything + */ + function get_flagged($count=0) { + + if ($count) { $limit_clause = "LIMIT " . intval($count); } + + $sql = "SELECT id FROM flagged ORDER BY id $limit_clause"; + $db_results = mysql_query($sql, dbh()); + + /* Default it to an array */ + $results = array(); + + /* While the query */ + while ($r = mysql_fetch_assoc($db_results)) { + $results[] = $r['id']; + } + + return $results; + + } // get_flagged + + /** * add * This adds a flag entry for an item, it takes an id, a type, the flag type * and a comment and then inserts the mofo @@ -138,6 +162,34 @@ class Flag { } // add /** + * delete_flag + * This deletes the flagged entry and rescans the file to revert to the origional + * state, in a perfect world, I could just roll the changes back... not until 3.4 + */ + function delete_flag() { + + $sql = "DELETE FROM flagged WHERE id='$this->id'"; + $db_results = mysql_query($sql, dbh()); + + return true; + + } // reject + + /** + * approve + * This approves the current flag object ($this->id) by setting approved to + * 1 + */ + function approve() { + + $sql = "UPDATE flagged SET approved='1' WHERE id='$this->id'"; + $db_results = mysql_query($sql, dbh()); + + return true; + + } // approve + + /** * print_name * This function formats and prints out a userfriendly name of the flagged * object diff --git a/lib/upload.php b/lib/upload.php index 43cfc7bd..deac8ffd 100644 --- a/lib/upload.php +++ b/lib/upload.php @@ -240,4 +240,25 @@ function report_file_error( $error_code ) { } // report_file_error + +/** + * show_upload_status_style + * Pure fluf, it shows Grey for 'unknown' Green for Add and Red for delete + */ +function show_upload_status_style($action) { + + switch ($action) { + case 'add': + return 'width:10px;background:green;'; + break; + case 'delete': + return 'width:10px;background:red;'; + break; + default: + return 'width:10px;'; + break; + } // end switch + +} // show_upload_status_style + ?> |