summaryrefslogtreecommitdiff
path: root/BitPage.php
diff options
context:
space:
mode:
authorMax Kremmel <xing@synapse.plus.com>2005-10-29 17:57:43 +0000
committerMax Kremmel <xing@synapse.plus.com>2005-10-29 17:57:43 +0000
commitcba52a666bb221c21f622600af12252305b69320 (patch)
tree85cf20bc8adf7cf845948829a881870fbb763fc5 /BitPage.php
parent05e583e9e3ce79084c57f384610d82e29909e395 (diff)
downloadwiki-cba52a666bb221c21f622600af12252305b69320.tar.gz
wiki-cba52a666bb221c21f622600af12252305b69320.tar.bz2
wiki-cba52a666bb221c21f622600af12252305b69320.zip
merge recent changes into HEAD
Diffstat (limited to 'BitPage.php')
-rw-r--r--BitPage.php82
1 files changed, 54 insertions, 28 deletions
diff --git a/BitPage.php b/BitPage.php
index de5107c..21af36e 100644
--- a/BitPage.php
+++ b/BitPage.php
@@ -1,11 +1,11 @@
<?php
/**
- * @version $Header: /cvsroot/bitweaver/_bit_wiki/BitPage.php,v 1.11 2005/10/23 14:44:19 squareing Exp $
+ * @version $Header: /cvsroot/bitweaver/_bit_wiki/BitPage.php,v 1.12 2005/10/29 17:57:43 squareing Exp $
* @package wiki
*
* @author spider <spider@steelsun.com>
*
- * @version $Revision: 1.11 $ $Date: 2005/10/23 14:44:19 $ $Author: squareing $
+ * @version $Revision: 1.12 $ $Date: 2005/10/29 17:57:43 $ $Author: squareing $
*
* Copyright (c) 2004 bitweaver.org
* Copyright (c) 2003 tikwiki.org
@@ -13,7 +13,7 @@
* All Rights Reserved. See copyright.txt for details and a complete list of authors.
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details
*
- * $Id: BitPage.php,v 1.11 2005/10/23 14:44:19 squareing Exp $
+ * $Id: BitPage.php,v 1.12 2005/10/29 17:57:43 squareing Exp $
*/
/**
@@ -756,7 +756,7 @@ class BitPage extends LibertyAttachable {
* This can take some time to calculate, and so should not normally be enabled
* @param pOrphansOnly If Set list only unattached pages ( ones not used in other content )
*/
- function getList($offset = 0, $maxRecords = -1, $sort_mode = 'title_desc', $find = '', $pUserId=NULL, $pExtras=FALSE, $pOrphansOnly=FALSE ) {
+ function getList($offset = 0, $maxRecords = -1, $sort_mode = 'title_desc', $find = '', $pUserId=NULL, $pExtras=FALSE, $pOrphansOnly=FALSE, $pGetData=FALSE ) {
global $gBitSystem;
if ($sort_mode == 'size_desc') {
$sort_mode = 'page_size_desc';
@@ -798,16 +798,45 @@ class BitPage extends LibertyAttachable {
$bindVars = array_merge($bindVars, array( $pUserId ));
}
- $query = "SELECT uue.`login` AS modifier_user, uue.`real_name` AS modifier_real_name, uuc.`login` AS creator_user, uuc.`real_name` AS creator_real_name ,`page_id`, `hits`, `page_size` as `len`, tc.`title`, tc.`format_guid`, tp.`description`, tc.`last_modified`, tc.`created`, `ip`, `comment`, `version`, `flag`, tp.`content_id`
- FROM `".BIT_DB_PREFIX."tiki_pages` tp INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc ON (tc.`content_id` = tp.`content_id`), `".BIT_DB_PREFIX."users_users` uue, `".BIT_DB_PREFIX."users_users` uuc
- WHERE tc.`content_type_guid`=? AND tc.`modifier_user_id`=uue.`user_id` AND tc.`user_id`=uuc.`user_id` $mid
- ORDER BY ".$this->mDb->convert_sortmode($sort_mode);
- $query_cant = "select count(*) from
- `".BIT_DB_PREFIX."tiki_pages` tp INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc
- ON (tc.`content_id` = tp.`content_id`)
+ if( $pGetData ) {
+ $get_data = 'tc.`data`,';
+ } else {
+ $get_data = '';
+ }
+
+ $query = "SELECT
+ uue.`login` AS modifier_user,
+ uue.`real_name` AS modifier_real_name,
+ uuc.`login` AS creator_user,
+ uuc.`real_name` AS creator_real_name,
+ `page_id`,
+ `hits`,
+ `page_size` as `len`,
+ tc.`title`,
+ tc.`format_guid`,
+ tp.`description`,
+ tc.`last_modified`,
+ tc.`created`,
+ $get_data
+ `ip`,
+ `comment`,
+ `version`,
+ `flag`,
+ tp.`content_id`
+ FROM `".BIT_DB_PREFIX."tiki_pages` tp
+ INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc ON (tc.`content_id` = tp.`content_id`),
+ `".BIT_DB_PREFIX."users_users` uue,
+ `".BIT_DB_PREFIX."users_users` uuc
+ WHERE tc.`content_type_guid`=?
+ AND tc.`modifier_user_id`=uue.`user_id`
+ AND tc.`user_id`=uuc.`user_id` $mid
+ ORDER BY ".$this->mDb->convert_sortmode( $sort_mode );
+ $query_cant = "SELECT COUNT(*)
+ FROM `".BIT_DB_PREFIX."tiki_pages` tp
+ INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc ON (tc.`content_id` = tp.`content_id`)
WHERE tc.`content_type_guid`=? $mid";
- if ($pOrphansOnly) {
+ if( $pOrphansOnly ) {
$query = "SELECT
uue.`login` AS modifier_user,
uue.`real_name` AS modifier_real_name,
@@ -821,43 +850,40 @@ class BitPage extends LibertyAttachable {
tp.`description`,
tc.`last_modified`,
tc.`created`,
+ $get_data
`ip`,
`comment`,
`version`,
`flag`,
tp.`content_id`
FROM `".BIT_DB_PREFIX."tiki_pages` tp
- LEFT JOIN `".BIT_DB_PREFIX."tiki_links` tl ON tp.`content_id` = tl.`to_content_id`
- INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc
- ON (tc.`content_id` = tp.`content_id`),
+ LEFT JOIN `".BIT_DB_PREFIX."tiki_links` tl ON (tp.`content_id` = tl.`to_content_id`)
+ INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc ON (tc.`content_id` = tp.`content_id`),
`".BIT_DB_PREFIX."users_users` uue,
`".BIT_DB_PREFIX."users_users` uuc
WHERE tc.`content_type_guid`=?
AND tc.`modifier_user_id`=uue.`user_id`
AND tc.`user_id`=uuc.`user_id` $mid
AND tl.`to_content_id` is NULL
- ORDER BY "
- . $this->mDb->convert_sortmode($sort_mode);
- $query_cant = "select count(*)
- FROM `".BIT_DB_PREFIX."tiki_pages` tp
- LEFT JOIN `".BIT_DB_PREFIX."tiki_links` tl on tp.`content_id` = tl.`to_content_id`
- INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc
- ON (tc.`content_id` = tp.`content_id`)
- WHERE tc.`content_type_guid`=?
- AND tl.`to_content_id` is NULL";
+ ORDER BY ".$this->mDb->convert_sortmode( $sort_mode );
+ $query_cant = "SELECT COUNT(*)
+ FROM `".BIT_DB_PREFIX."tiki_pages` tp
+ LEFT JOIN `".BIT_DB_PREFIX."tiki_links` tl ON (tp.`content_id` = tl.`to_content_id`)
+ INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc ON (tc.`content_id` = tp.`content_id`)
+ WHERE tc.`content_type_guid`=? $mid
+ AND tl.`to_content_id` IS NULL";
}
-
// If sort mode is versions then offset is 0, maxRecords is -1 (again) and sort_mode is nil
// If sort mode is links then offset is 0, maxRecords is -1 (again) and sort_mode is nil
// If sort mode is backlinks then offset is 0, maxRecords is -1 (again) and sort_mode is nil
$this->mDb->StartTrans();
- $result = $this->mDb->query($query,$bindVars,$maxRecords,$offset);
- $cant = $this->mDb->getOne($query_cant,$bindVars);
+ $result = $this->mDb->query( $query, $bindVars, $maxRecords, $offset );
+ $cant = $this->mDb->getOne( $query_cant, $bindVars );
$this->mDb->CompleteTrans();
$ret = array();
- while ($res = $result->fetchRow()) {
+ while( $res = $result->fetchRow() ) {
$aux = array();
$aux = $res;
$aux['creator'] = (isset( $res['creator_real_name'] ) ? $res['creator_real_name'] : $res['creator_user'] );