summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--LibertyBase.php4
-rw-r--r--LibertyContent.php28
-rwxr-xr-xLibertyStructure.php9
-rwxr-xr-xLibertySystem.php3
-rw-r--r--edit_storage_inc.php6
-rw-r--r--plugins/data.articles.php7
-rw-r--r--plugins/data.wikigraph.php6
-rw-r--r--templates/comments.tpl10
-rw-r--r--templates/edit_storage.tpl2
-rw-r--r--templates/list_content_inc.tpl7
10 files changed, 39 insertions, 43 deletions
diff --git a/LibertyBase.php b/LibertyBase.php
index 27951d3..0f7cc73 100644
--- a/LibertyBase.php
+++ b/LibertyBase.php
@@ -3,7 +3,7 @@
* Base class for Management of Liberty Content
*
* @package liberty
- * @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyBase.php,v 1.5 2005/08/11 13:03:45 squareing Exp $
+ * @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyBase.php,v 1.6 2005/08/30 22:25:07 squareing Exp $
* @author spider <spider@steelsun.com>
*/
// +----------------------------------------------------------------------+
@@ -62,8 +62,6 @@ class LibertyBase extends BitBase {
require_once( constant( strtoupper( $type['handler_package'] ).'_PKG_PATH' ).$type['handler_file'] );
$ret = new $type['handler_class']( NULL, $pContentId );
$ret->load();
- } else {
- print "UNHANDLED ERROR. UNKNOWN CONTENT: $pContentId -> $pContentGuid";
}
}
return $ret;
diff --git a/LibertyContent.php b/LibertyContent.php
index d7e398a..0360247 100644
--- a/LibertyContent.php
+++ b/LibertyContent.php
@@ -3,7 +3,7 @@
* Management of Liberty content
*
* @package liberty
-* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyContent.php,v 1.8 2005/08/24 20:55:17 squareing Exp $
+* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyContent.php,v 1.9 2005/08/30 22:25:07 squareing Exp $
* @author spider <spider@steelsun.com>
*/
@@ -118,7 +118,7 @@ class LibertyContent extends LibertyBase {
* with the require values for LibertyContent::store()
*/
function verify( &$pParamHash ) {
- global $gLibertySystem;
+ global $gLibertySystem, $gBitSystem;
if( empty( $pParamHash['user_id'] ) ) {
global $gBitUser;
$pParamHash['user_id'] = $gBitUser->getUserId();
@@ -127,7 +127,7 @@ class LibertyContent extends LibertyBase {
if( empty( $pParamHash['content_id'] ) ) {
if( empty( $this->mContentId ) ) {
// These should never be updated, only inserted
- $pParamHash['content_store']['created'] = !empty( $pParamHash['created'] ) ? $pParamHash['created'] : date( "U" );
+ $pParamHash['content_store']['created'] = !empty( $pParamHash['created'] ) ? $pParamHash['created'] : $gBitSystem->getUTCTime();
$pParamHash['content_store']['user_id'] = $pParamHash['user_id'];
} else {
$pParamHash['content_id'] = $this->mContentId;
@@ -144,7 +144,7 @@ class LibertyContent extends LibertyBase {
$pParamHash['content_store']['title'] = NULL;
}
- $pParamHash['content_store']['last_modified'] = !empty( $pParamHash['last_modified'] ) ? $pParamHash['last_modified'] : date("U");
+ $pParamHash['content_store']['last_modified'] = !empty( $pParamHash['last_modified'] ) ? $pParamHash['last_modified'] : $gBitSystem->getUTCTime();
// WARNING: Assume WIKI if t
if( isset( $pParamHash['content_id'] ) ) {
@@ -265,11 +265,7 @@ class LibertyContent extends LibertyBase {
$this->mDb->StartTrans();
$this->expungeComments();
- if( $gBitSystem->isPackageActive( 'categories' ) ) {
- require_once( CATEGORIES_PKG_PATH.'categ_lib.php' );
- global $categlib;
- $categlib->uncategorize_object( $this->mType['content_type_guid'], $this->mContentId );
- }
+ $this->invokeServices( 'content_expunge_function', $this );
/* seems out of place - xing
if( $func = $gLibertySystem->getPluginFunction( $pParamHash['format_guid'], 'expunge_function' ) ) {
@@ -550,11 +546,13 @@ class LibertyContent extends LibertyBase {
*/
function addHit() {
global $gBitUser;
- if( $this->mContentId && ($gBitUser->mUserId != $this->mInfo['user_id'] ) ) {
- $query = "update `".BIT_DB_PREFIX."tiki_content` set `hits`=`hits`+1 where `content_id` = ?";
- $result = $this->mDb->query( $query, array( $this->mContentId ) );
+ if( empty( $_REQUEST['post_comment_submit'] ) && empty( $_REQUEST['post_comment_request'] ) ) {
+ if( $this->mContentId && ( $gBitUser->mUserId != $this->mInfo['user_id'] ) ) {
+ $query = "UPDATE `".BIT_DB_PREFIX."tiki_content` SET `hits`=`hits`+1 WHERE `content_id` = ?";
+ $result = $this->mDb->query( $query, array( $this->mContentId ) );
+ }
}
- return true;
+ return TRUE;
}
/**
@@ -1097,8 +1095,8 @@ class LibertyContent extends LibertyBase {
// If stuff inside [] is *really* malformatted, $data
// will be empty. -rlpowell
if (!$this->isCached( $url ) && $data)
- {
- $refresh = date("U");
+ { global $gBitSystem;
+ $refresh = $gBitSystem->getUTCTime();
$query = "insert into `".BIT_DB_PREFIX."tiki_link_cache`(`url`,`data`,`refresh`) values(?,?,?)";
$result = $this->mDb->query($query, array($url,BitDb::db_byte_encode($data),$refresh) );
return !isset($error);
diff --git a/LibertyStructure.php b/LibertyStructure.php
index 7274191..b9027f6 100755
--- a/LibertyStructure.php
+++ b/LibertyStructure.php
@@ -3,7 +3,7 @@
* Management of Liberty Content
*
* @package liberty
- * @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyStructure.php,v 1.6 2005/08/24 20:55:17 squareing Exp $
+ * @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertyStructure.php,v 1.7 2005/08/30 22:25:07 squareing Exp $
* @author spider <spider@steelsun.com>
*/
@@ -270,9 +270,10 @@ class LibertyStructure extends LibertyBase {
* @return the new entries structure_id or null if not created.
*/
function storeNode( &$pParamHash ) {
+ global $gBitSystem;
$ret = null;
// If the page doesn't exist then create a new wiki page!
- $now = date("U");
+ $now = $gBitSystem->getUTCTime();
// $created = $this->create_page($name, 0, '', $now, tra('created from structure'), 'system', '0.0.0.0', '');
// if were not trying to add a duplicate structure head
if ( $this->verifyNode( $pParamHash ) ) {
@@ -385,7 +386,7 @@ class LibertyStructure extends LibertyBase {
function s_export_structure($structure_id) {
- global $exportlib, $bitdomain;
+ global $exportlib, $bitdomain, $gBitSystem;
include_once( WIKI_PKG_PATH.'export_lib.php' );
include_once (BIT_PKG_PATH."util/tar.class.php");
@@ -398,7 +399,7 @@ class LibertyStructure extends LibertyBase {
foreach ($pages as $page) {
$data = $exportlib->export_wiki_page($page["title"], 0);
- $tar->addData($page["title"], $data, date("U"));
+ $tar->addData($page["title"], $data, $gBitSystem->getUTCTime());
}
$tar->toTar("dump/$bitdomain" . $title . ".tar", FALSE);
header ("location: dump/$bitdomain" . $title . ".tar");
diff --git a/LibertySystem.php b/LibertySystem.php
index 1c358bf..28e18d2 100755
--- a/LibertySystem.php
+++ b/LibertySystem.php
@@ -3,7 +3,7 @@
* System class for handling the liberty package
*
* @package liberty
-* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertySystem.php,v 1.6 2005/08/24 20:55:17 squareing Exp $
+* @version $Header: /cvsroot/bitweaver/_bit_liberty/LibertySystem.php,v 1.7 2005/08/30 22:25:07 squareing Exp $
* @author spider <spider@steelsun.com>
*/
@@ -28,6 +28,7 @@ define( 'DATA_PLUGIN', 'data' );
define( 'LIBERTY_SERVICE_ACCESS_CONTROL', 'access_control' );
define( 'LIBERTY_SERVICE_CATEGORIZATION', 'categorization' );
+define( 'LIBERTY_SERVICE_COMMERCE', 'commerce' );
define( 'LIBERTY_SERVICE_MENU', 'menu' );
define( 'LIBERTY_SERVICE_DOCUMENT_GENERATION', 'document_generation' );
diff --git a/edit_storage_inc.php b/edit_storage_inc.php
index 5c8cf0f..8567bc1 100644
--- a/edit_storage_inc.php
+++ b/edit_storage_inc.php
@@ -3,7 +3,7 @@
* edit_storage_inc
*
* @author spider <spider@steelsun.com>
- * @version $Revision: 1.4 $
+ * @version $Revision: 1.5 $
* @package liberty
* @subpackage functions
*
@@ -12,7 +12,7 @@
*
* Calculate a base URL for the attachment deletion/removal icons to use
*/
-global $gBitSmarty, $gContent, $gBitUser;
+global $gBitSmarty, $gContent, $gBitUser, $gLibertySystem;
$attachmentActionBaseURL = $_SERVER['PHP_SELF'].'?';
$GETArgs = split('&',$_SERVER['QUERY_STRING']);
@@ -49,6 +49,6 @@ if (!empty($_REQUEST['deleteAttachment'])) {
$gContent->detachAttachment($attachmentId);
}
}
-
+$gBitSmarty->assign_by_ref('gLibertySystem', $gLibertySystem);
?>
diff --git a/plugins/data.articles.php b/plugins/data.articles.php
index 81c2297..22fed53 100644
--- a/plugins/data.articles.php
+++ b/plugins/data.articles.php
@@ -1,6 +1,6 @@
<?php
/**
- * @version $Revision: 1.5 $
+ * @version $Revision: 1.6 $
* @package liberty
* @subpackage plugins_data
*/
@@ -18,7 +18,7 @@
// | by: StarRider <starrrider@users.sourceforge.net>
// | Reworked from: wikiplugin_articles.php - see deprecated code below
// +----------------------------------------------------------------------+
-// $Id: data.articles.php,v 1.5 2005/08/07 17:40:31 squareing Exp $
+// $Id: data.articles.php,v 1.6 2005/08/30 22:25:07 squareing Exp $
/**
* definitions
@@ -92,6 +92,7 @@ if( $gBitSystem->isPackageActive( 'articles' ) ) {
function wikiplugin_articles($data,$params) {
global $gBitSmarty;
+ global $gBitSystem;
global $artlib;
global $feature_articles;
global $bit_p_read_article;
@@ -108,7 +109,7 @@ if( $gBitSystem->isPackageActive( 'articles' ) ) {
} else {
$topic = $artlib->get_topic_id($topic);
}
- $now = date("U");
+ $now = $gBitSystem->getUTCTime();
$listpages = $artlib->list_articles(0, $max, 'publish_date_desc', '', $now, $user, '', $topic);
for ($i = 0; $i < count($listpages["data"]); $i++) {
$listpages["data"][$i]["parsed_heading"] = $artlib->parseData($listpages["data"][$i]["heading"]);
diff --git a/plugins/data.wikigraph.php b/plugins/data.wikigraph.php
index 484dcaa..9f4e9d2 100644
--- a/plugins/data.wikigraph.php
+++ b/plugins/data.wikigraph.php
@@ -1,6 +1,6 @@
<?php
/**
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
* @package liberty
* @subpackage plugins_data
*/
@@ -18,12 +18,12 @@
// | by: wolff_borg <wolff_borg@yahoo.com.au>
// | Reworked from: wikiplugin_wikigraph.php - see deprecated code below
// +----------------------------------------------------------------------+
-// $Id: data.wikigraph.php,v 1.2 2005/08/24 20:55:17 squareing Exp $
+// $Id: data.wikigraph.php,v 1.3 2005/08/30 22:25:07 squareing Exp $
/**
* definitions
*/
global $gBitSystem;
-if (!$gBitSystem->isPackageActive( 'wiki' ) ) { // Do not include this Plugin if the Package is not active
+if ($gBitSystem->isPackageActive( 'wiki' ) ) { // Do not include this Plugin if the Package is not active
define( 'PLUGIN_GUID_DATAWIKIGRAPH', 'datawikigraph' );
global $gLibertySystem;
$pluginParams = array ( 'tag' => 'WIKIGRAPH',
diff --git a/templates/comments.tpl b/templates/comments.tpl
index 5536c59..ad7082d 100644
--- a/templates/comments.tpl
+++ b/templates/comments.tpl
@@ -72,8 +72,8 @@
</div>
<div class="row submit">
- <input type="submit" name="post_comment_preview" value="{tr}preview{/tr}"/>&nbsp;
- <input type="submit" name="post_comment_submit" value="{tr}post{/tr}"/>
+ <input type="submit" name="post_comment_preview" value="{tr}Preview{/tr}"/>&nbsp;
+ <input type="submit" name="post_comment_submit" value="{tr}Post{/tr}"/>
</div>
{/legend}
{elseif $gBitUser->hasPermission( 'bit_p_post_comments' )}
@@ -126,9 +126,7 @@
{libertypagination hash=$commentsPgnHash}
</div><!-- end .body -->
{/strip}
- <script type="text/javascript">
- //<![CDATA[
+ <script type="text/javascript">//<![CDATA[
document.write('<\/div>');
- //]]>
- </script>
+ //]]></script>
</div><!-- end .comment -->
diff --git a/templates/edit_storage.tpl b/templates/edit_storage.tpl
index 1073e56..f31b435 100644
--- a/templates/edit_storage.tpl
+++ b/templates/edit_storage.tpl
@@ -20,7 +20,7 @@ include (LIBERTY_PKG_PATH."edit_storage_inc.php");
{formlabel label="Existing Attachment ID"}
{forminput}
<input type="text" name="existing_attachment_id[]" id="existing_attachment_id_input" size="6"/><br />
- <a href="{$smarty.const.LIBERTY_PKG_URL}attachment_browser.php" title="{tr}Opens attachemnt browser in new window{/tr}" onkeypress="popUpWin(this.href,'standard',600,400);" onclick="popUpWin(this.href,'standard',600,400);return false;">{tr}Attachment Browser{/tr}</a>
+ <a href="{$smarty.const.LIBERTY_PKG_URL}attachment_browser.php" title="{tr}Opens attachment browser in new window{/tr}" onkeypress="popUpWin(this.href,'standard',600,400);" onclick="popUpWin(this.href,'standard',600,400);return false;">{tr}Attachment Browser{/tr}</a>
{/forminput}
</div>
diff --git a/templates/list_content_inc.tpl b/templates/list_content_inc.tpl
index 8560e1f..4476e35 100644
--- a/templates/list_content_inc.tpl
+++ b/templates/list_content_inc.tpl
@@ -33,16 +33,15 @@
<th>{smartlink ititle="Title" isort=title page=$page user_id=$user_id idefault=1 content_type_guid=$contentSelect}</th>
<th>{smartlink ititle="Content Type" isort=content_type_guid page=$page user_id=$user_id content_type_guid=$contentSelect}</th>
<th>{smartlink ititle="Author" isort=$isort_author page=$page content_type_guid=$contentSelect}</th>
- <th>{smartlink ititle="Most recent editor" isort=$isort_editor page=$page content_type_guid=$contentSelect}</th>
+ <th colspan="2">{smartlink ititle="Most recent editor" isort=$isort_editor page=$page content_type_guid=$contentSelect}</th>
</tr>
{foreach from=$contentList item=item}
<tr class="{cycle values='odd,even'}">
<td>{$item.display_link}</td>
<td>{assign var=content_type_guid value=`$item.content_type_guid`}{$contentTypes.$content_type_guid}</td>
<td>{displayname real_name=$item.creator_real_name user=$item.creator_user}</td>
- <td style="text-align:right;">
- {displayname real_name=$item.modifier_real_name user=$item.modifier_user} {$item.last_modified|bit_short_date}
- </td>
+ <td style="text-align:right;">{displayname real_name=$item.modifier_real_name user=$item.modifier_user}</td>
+ <td style="text-align:right;">{$item.last_modified|bit_short_date}</td>
</tr>
{/foreach}
</table>