Source for file copyrights_lib.php
Documentation is available at copyrights_lib.php
* Copyright (c) 2004 bitweaver.org
* Copyright (c) 2003 tikwiki.org
* Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
* All Rights Reserved. See below for details and a complete list of authors.
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details
* @subpackage CopyrightsLib
$query = "select * from `". BIT_DB_PREFIX. "liberty_copyrights` WHERE `page_id`=? order by ". $this->mDb->convertSortmode( "copyright_order_asc" );
$query_cant = "select count(*) from `". BIT_DB_PREFIX. "liberty_copyrights` WHERE `page_id`=?";
$result = $this->mDb->query($query, array( $pPageId ));
$cant = $this->mDb->getOne($query_cant, array( $pPageId ));
while ($res = $result->fetchRow()) {
$query = "select MAX(`copyright_order`) from `". BIT_DB_PREFIX. "liberty_copyrights` where `page_id` = ?";
return $this->mDb->getOne($query, array( $pPageId ));
$query = "select `copyrightID` from `". BIT_DB_PREFIX. "liberty_copyrights` where `page_id`=? and `title`=?";
return $this->mDb->getOne($query, array( $pPageId ,$title));
function add_copyright( $pPageId , $title, $year, $authors, $pUserId) {
//$unique = $this->unique_copyright( $pPageId ,$title);
//$this->edit_copyright($unique,$title,$year,$authors,$pUserId);
$query = "insert into `". BIT_DB_PREFIX. "liberty_copyrights` (`page_id`, `title`, `copyright_year`, `authors`, `copyright_order`, `user_id`) values (?,?,?,?,?,?)";
$this->mDb->query($query,array( $pPageId ,$title,$year,$authors,$order,$pUserId));
$query = "update `". BIT_DB_PREFIX. "liberty_copyrights` SET `copyright_year`=?, `title`=?, `authors`=?, `user_id`=? where `copyright_id`=?";
$this->mDb->query($query,array($year,$title,$authors,$pUserId,(int) $id));
$query = "delete from `". BIT_DB_PREFIX. "liberty_copyrights` where `copyright_id`=?";
$this->mDb->query($query,array((int) $id));
$query = "update `". BIT_DB_PREFIX. "liberty_copyrights` set `copyright_order`=`copyright_order`-1 where `copyright_id`=?";
$result = $this->mDb->query($query,array((int) $id));
$query = "update `". BIT_DB_PREFIX. "liberty_copyrights` set `copyright_order`=`copyright_order`+1 where `copyright_id`=?";
$result = $this->mDb->query($query,array((int) $id));
|