diff options
| -rw-r--r-- | BitBlog.php | 56 | ||||
| -rw-r--r-- | BitBlogPost.php | 185 | ||||
| -rw-r--r-- | admin/upgrade_inc.php | 12 | ||||
| -rw-r--r-- | display_bitblogpost_inc.php | 2 | ||||
| -rw-r--r-- | modules/mod_last_blog_posts.tpl | 4 | ||||
| -rw-r--r-- | modules/mod_last_created_blogs.tpl | 4 | ||||
| -rw-r--r-- | modules/mod_last_modified_blogs.tpl | 4 | ||||
| -rw-r--r-- | modules/mod_top_active_blogs.tpl | 4 | ||||
| -rw-r--r-- | modules/mod_top_visited_blogs.tpl | 4 | ||||
| -rw-r--r-- | post.php | 4 | ||||
| -rw-r--r-- | send_post.php | 4 | ||||
| -rw-r--r-- | templates/blog_header.tpl | 10 | ||||
| -rw-r--r-- | templates/blog_list_post.tpl | 18 | ||||
| -rw-r--r-- | templates/blog_post.tpl | 4 | ||||
| -rw-r--r-- | templates/center_list_blog_posts.tpl | 4 | ||||
| -rw-r--r-- | templates/edit_blog.tpl | 4 | ||||
| -rw-r--r-- | templates/list_blogs.tpl | 20 | ||||
| -rw-r--r-- | templates/menu_blogs.tpl | 10 | ||||
| -rw-r--r-- | templates/menu_blogs_admin.tpl | 2 | ||||
| -rw-r--r-- | templates/popup_categs.tpl | 4 | ||||
| -rw-r--r-- | templates/print_blog_post.tpl | 8 | ||||
| -rw-r--r-- | templates/send_blog_post.tpl | 2 | ||||
| -rw-r--r-- | templates/user_watch_blog_post.tpl | 4 | ||||
| -rw-r--r-- | templates/view_blog.tpl | 14 | ||||
| -rw-r--r-- | templates/view_blog_post.tpl | 24 | ||||
| -rw-r--r-- | view.php | 6 |
26 files changed, 229 insertions, 188 deletions
diff --git a/BitBlog.php b/BitBlog.php index aa262cb..ead4dc3 100644 --- a/BitBlog.php +++ b/BitBlog.php @@ -50,9 +50,9 @@ class BitBlog extends BitBase { $query = "SELECT tb.*, uu.`login` as `user`, uu.`real_name` FROM `".BIT_DB_PREFIX."tiki_blogs` tb INNER JOIN `".BIT_DB_PREFIX."users_users` uu ON (uu.`user_id` = tb.`user_id`) - $mid order by tb.".$this->convert_sortmode($sort_mode); + $mid order by tb.".$this->mDb->convert_sortmode($sort_mode); - $result = $this->query($query,$bindvars,$maxRecords,$offset); + $result = $this->mDb->query($query,$bindvars,$maxRecords,$offset); $ret = array(); @@ -68,7 +68,7 @@ class BitBlog extends BitBase { $retval["data"] = $ret; $query_cant = "SELECT COUNT(tb.`blog_id`) FROM `".BIT_DB_PREFIX."tiki_blogs` tb $mid"; - $cant = $this->getOne($query_cant, $bindvars); + $cant = $this->mDb->getOne($query_cant, $bindvars); $retval["cant"] = $cant; return $retval; } @@ -83,9 +83,9 @@ class BitBlog extends BitBase { WHERE tb.`user_id` = ? $mid"; if ($maxRecords && is_numeric($maxRecords) && $maxRecords >= 0) { - $blogsRes = $this->query($sql, array($user_id), $maxRecord); + $blogsRes = $this->mDb->query($sql, array($user_id), $maxRecord); } else { - $blogsRes = $this->query($sql, array($user_id)); + $blogsRes = $this->mDb->query($sql, array($user_id)); } $ret = $blogsRes->getRows(); } @@ -96,7 +96,7 @@ class BitBlog extends BitBase { $ret = NULL; if ($user_id) { $sql = "SELECT COUNT(*) FROM `".BIT_DB_PREFIX."tiki_blogs` WHERE `user_id` = ?"; - $ret = $this->getOne($sql, array( $user_id )); + $ret = $this->mDb->getOne($sql, array( $user_id )); } return $ret; } @@ -129,7 +129,7 @@ class BitBlog extends BitBase { LEFT OUTER JOIN `".BIT_DB_PREFIX."tiki_user_preferences` tup ON ( uu.`user_id`=tup.`user_id` AND tup.`pref_name`='theme' ) WHERE tb.`blog_id`= ?"; - $result = $this->query($query,array((int)$blog_id)); + $result = $this->mDb->query($query,array((int)$blog_id)); $ret = $result->fetchRow(); if ($ret) { $ret['avatar'] = (!empty($res['avatar']) ? BIT_ROOT_URL.$res['avatar'] : NULL); @@ -160,7 +160,7 @@ class BitBlog extends BitBase { $query = "SELECT tb.*, uu.`login` as `user`, uu.`real_name` FROM `".BIT_DB_PREFIX."tiki_blogs` tb INNER JOIN `".BIT_DB_PREFIX."users_users` uu ON (uu.`user_id` = tb.`user_id`) WHERE tb.`user_id` = ? $mid "; - $result = $this->query($query,$bindvars); + $result = $this->mDb->query($query,$bindvars); $ret = array(); while ($res = $result->fetchRow()) { @@ -184,7 +184,7 @@ class BitBlog extends BitBase { array_push( $bindvars, $gBitUser->mUserId ); } $query = "update `".BIT_DB_PREFIX."tiki_blogs` set `hits` = `hits`+1 where `blog_id`=? $ownerSql"; - $result = $this->query($query,$bindvars); + $result = $this->mDb->query($query,$bindvars); } return true; @@ -199,14 +199,14 @@ class BitBlog extends BitBase { if ( !empty( $blog_id ) ) { $query = "update `".BIT_DB_PREFIX."tiki_blogs` set `title`=? ,`description`=?,`user_id`=?,`public`=?,`last_modified`=?,`max_posts`=?,`heading`=?,`use_title`=?,`use_find`=?,`allow_comments`=? where `blog_id`=?"; - $result = $this->query($query,array($title,$description,$user_id,$public,$now,$max_posts,$heading,$use_title,$use_find,$allow_comments,$blog_id)); + $result = $this->mDb->query($query,array($title,$description,$user_id,$public,$now,$max_posts,$heading,$use_title,$use_find,$allow_comments,$blog_id)); } else { $query = "insert into `".BIT_DB_PREFIX."tiki_blogs`(`created`,`last_modified`,`title`,`description`,`user_id`,`public`,`posts`,`max_posts`,`hits`,`heading`,`use_title`,`use_find`,`allow_comments`) values(?,?,?,?,?,?,?,?,?,?,?,?,?)"; - $result = $this->query($query,array($creation_date,(int) $now,$title,$description,$user_id,$public,0,(int) $max_posts,0,$heading,$use_title,$use_find,$allow_comments)); + $result = $this->mDb->query($query,array($creation_date,(int) $now,$title,$description,$user_id,$public,0,(int) $max_posts,0,$heading,$use_title,$use_find,$allow_comments)); $query2 = "select max(`blog_id`) from `".BIT_DB_PREFIX."tiki_blogs` where `last_modified`=?"; - $blog_id = $this->getOne($query2,array((int) $now)); + $blog_id = $this->mDb->getOne($query2,array((int) $now)); } return $blog_id; @@ -216,9 +216,9 @@ class BitBlog extends BitBase { $this->mDb->StartTrans(); $query = "delete from `".BIT_DB_PREFIX."tiki_blogs` where `blog_id`=?"; - $result = $this->query($query,array((int) $blog_id)); + $result = $this->mDb->query($query,array((int) $blog_id)); $query = "delete from `".BIT_DB_PREFIX."tiki_blog_posts` where `blog_id`=?"; - $result = $this->query($query,array((int) $blog_id)); + $result = $this->mDb->query($query,array((int) $blog_id)); $this->remove_object( BITBLOG_CONTENT_TYPE_GUID, $blog_id ); $this->mDb->CompleteTrans(); return true; @@ -233,10 +233,10 @@ class BitBlog extends BitBase { // Now remove comments $object = $type . $id; // $query = "delete from `".BIT_DB_PREFIX."tiki_comments` where `object`=? and `object_type`=?"; -// $result = $this->query($query, array( $id, $type )); +// $result = $this->mDb->query($query, array( $id, $type )); // Remove individual permissions for this object if they exist $query = "delete from `".BIT_DB_PREFIX."users_objectpermissions` where `object_id`=? and `object_type`=?"; - $result = $this->query($query,array((int)$object,$type)); + $result = $this->mDb->query($query,array((int)$object,$type)); return true; } @@ -246,7 +246,7 @@ class BitBlog extends BitBase { if ($blog_id && is_numeric($blog_id)) { $sql = "SELECT `post_id` FROM `".BIT_DB_PREFIX."tiki_blog_posts` WHERE `blog_id` = ?"; - $rs = $this->query($sql, array($blog_id)); + $rs = $this->mDb->query($sql, array($blog_id)); $rows = $rs->getRows(); $numPosts = count($rows); if ($numPosts > 0) { @@ -270,10 +270,10 @@ class BitBlog extends BitBase { $day2 = $today - (3 * 24 * 60 * 60); // Purge old activity $query = "delete from `".BIT_DB_PREFIX."tiki_blog_activity` where `day`<?"; - $result = $this->query($query,array((int) $day2)); + $result = $this->mDb->query($query,array((int) $day2)); // Register new activity $query = "select count(*) from `".BIT_DB_PREFIX."tiki_blog_activity` where `blog_id`=? and `day`=?"; - $result = $this->getOne($query,array((int) $blog_id,(int)$today)); + $result = $this->mDb->getOne($query,array((int) $blog_id,(int)$today)); if ($result) { $query = "update `".BIT_DB_PREFIX."tiki_blog_activity` set `posts`=`posts`+1 where `blog_id`=? and `day`=?"; @@ -281,24 +281,24 @@ class BitBlog extends BitBase { $query = "insert into `".BIT_DB_PREFIX."tiki_blog_activity`(`blog_id`,`day`,`posts`) values(?,?,1)"; } - $result = $this->query($query,array((int) $blog_id,(int) $today)); + $result = $this->mDb->query($query,array((int) $blog_id,(int) $today)); // Calculate activity $query = "select `posts` from `".BIT_DB_PREFIX."tiki_blog_activity` where `blog_id`=? and `day`=?"; - $vtoday = $this->getOne($query,array((int) $blog_id,(int) $today)); - $day0 = $this->getOne($query,array((int) $blog_id,(int) $day0)); - $day1 = $this->getOne($query,array((int) $blog_id,(int) $day1)); - $day2 = $this->getOne($query,array((int) $blog_id,(int) $day2)); + $vtoday = $this->mDb->getOne($query,array((int) $blog_id,(int) $today)); + $day0 = $this->mDb->getOne($query,array((int) $blog_id,(int) $day0)); + $day1 = $this->mDb->getOne($query,array((int) $blog_id,(int) $day1)); + $day2 = $this->mDb->getOne($query,array((int) $blog_id,(int) $day2)); $activity = (2 * $vtoday) + ($day0)+(0.5 * $day1) + (0.25 * $day2); // Update tiki_blogs with activity information $query = "update `".BIT_DB_PREFIX."tiki_blogs` set `activity`=? where `blog_id`=?"; - $result = $this->query($query,array($activity,(int) $blog_id)); + $result = $this->mDb->query($query,array($activity,(int) $blog_id)); } function get_blog_owner($blog_id) { $user_id = NULL; if ($blog_id && is_numeric($blog_id)) { $sql = "SELECT `user_id` FROM `".BIT_DB_PREFIX."tiki_blogs` WHERE `blog_id` = ?"; - $user_id = $this->getOne($sql, array($blog_id)); + $user_id = $this->mDb->getOne($sql, array($blog_id)); } return $user_id; } @@ -308,14 +308,14 @@ class BitBlog extends BitBase { if ($post_id && is_numeric($post_id)){ $sql = "SELECT tc.`user_id` FROM `".BIT_DB_PREFIX."tiki_blog_posts` tbp, `".BIT_DB_PREFIX."tiki_content` tc WHERE tbp.`post_id`= ? AND tbp.`content_id` = tc.`content_id`"; - $user_id = $this->getOne($sql, array($post_id)); + $user_id = $this->mDb->getOne($sql, array($post_id)); } return $user_id; } function viewerCanPostIntoBlog() { global $gBitUser; - return ($this->mInfo['user_id'] == $gBitUser->mUserId || $gBitUser->isAdmin() || $this->mInfo['public'] == 'y' || $this->viewerHasPermission('bit_p_blog_post')); + return ($this->mInfo['user_id'] == $gBitUser->mUserId || $gBitUser->isAdmin() || $this->mInfo['public'] == 'y' ); } function viewerHasPermission($pPermName = NULL) { diff --git a/BitBlogPost.php b/BitBlogPost.php index 62cd835..1747453 100644 --- a/BitBlogPost.php +++ b/BitBlogPost.php @@ -1,12 +1,12 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_blogs/BitBlogPost.php,v 1.4 2005/08/01 18:40:03 squareing Exp $ + * $Header: /cvsroot/bitweaver/_bit_blogs/BitBlogPost.php,v 1.5 2005/08/07 17:35:54 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * 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: BitBlogPost.php,v 1.4 2005/08/01 18:40:03 squareing Exp $ + * $Id: BitBlogPost.php,v 1.5 2005/08/07 17:35:54 squareing Exp $ * * Virtual base class (as much as one can have such things in PHP) for all * derived tikiwiki classes that require database access. @@ -16,7 +16,7 @@ * * @author drewslater <andrew@andrewslater.com>, spiderr <spider@steelsun.com> * - * @version $Revision: 1.4 $ $Date: 2005/08/01 18:40:03 $ $Author: squareing $ + * @version $Revision: 1.5 $ $Date: 2005/08/07 17:35:54 $ $Author: squareing $ */ /** @@ -30,40 +30,42 @@ define( 'BITBLOGPOST_CONTENT_TYPE_GUID', 'bitblogpost' ); /** * @package blogs - * @subpackage BitBlogPost */ class BitBlogPost extends LibertyAttachable { var $mPostId; function BitBlogPost( $pPostId=NULL, $pContentId=NULL ) { LibertyAttachable::LibertyAttachable(); $this->registerContentType( BITBLOGPOST_CONTENT_TYPE_GUID, array( - 'content_type_guid' => BITBLOGPOST_CONTENT_TYPE_GUID, - 'content_description' => 'Blog Post', - 'handler_class' => 'BitBlogPost', - 'handler_package' => 'blogs', - 'handler_file' => 'BitBlogPost.php', - 'maintainer_url' => 'http://www.bitweaver.org' - ) ); + 'content_type_guid' => BITBLOGPOST_CONTENT_TYPE_GUID, + 'content_description' => 'Blog Post', + 'handler_class' => 'BitBlogPost', + 'handler_package' => 'blogs', + 'handler_file' => 'BitBlogPost.php', + 'maintainer_url' => 'http://www.bitweaver.org' + ) ); $this->mPostId = $pPostId; $this->mContentId = $pContentId; } + /** + * Load a Blog Post section + */ function load( $pLoadComments = TRUE ) { if( !empty( $this->mPostId ) || !empty( $this->mContentId ) ) { global $gBitSystem; $lookupColumn = !empty( $this->mPostId )? 'post_id' : 'content_id'; $lookupId = !empty( $this->mPostId )? $this->mPostId : $this->mContentId; $query = "SELECT tbp.*, tc.*, tb.`title` as `blogtitle`, tb.`allow_comments`,tb.`allow_comments`, tb.`use_title`, tb.`user_id` AS `blog_user_id`, uu.`login` as `user`, uu.`real_name`, tf.`storage_path` as avatar, tup.`value` AS `blog_style` - FROM `".BIT_DB_PREFIX."tiki_blog_posts` tbp - INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc ON (tc.`content_id` = tbp.`content_id`) - INNER JOIN `".BIT_DB_PREFIX."tiki_blogs` tb ON (tb.`blog_id` = tbp.`blog_id`) - INNER JOIN `".BIT_DB_PREFIX."users_users` uu ON( uu.`user_id` = tc.`user_id` ) - LEFT OUTER JOIN `".BIT_DB_PREFIX."tiki_attachments` ta ON (uu.`user_id` = ta.`user_id` AND uu.`avatar_attachment_id`=ta.`attachment_id`) - LEFT OUTER JOIN `".BIT_DB_PREFIX."tiki_files` tf ON (tf.`file_id` = ta.`foreign_id`) - LEFT OUTER JOIN `".BIT_DB_PREFIX."tiki_user_preferences` tup ON ( uu.`user_id`=tup.`user_id` AND tup.`pref_name`='theme' ) - WHERE tbp.`$lookupColumn`=? "; + FROM `".BIT_DB_PREFIX."tiki_blog_posts` tbp + INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc ON (tc.`content_id` = tbp.`content_id`) + INNER JOIN `".BIT_DB_PREFIX."tiki_blogs` tb ON (tb.`blog_id` = tbp.`blog_id`) + INNER JOIN `".BIT_DB_PREFIX."users_users` uu ON( uu.`user_id` = tc.`user_id` ) + LEFT OUTER JOIN `".BIT_DB_PREFIX."tiki_attachments` ta ON (uu.`user_id` = ta.`user_id` AND uu.`avatar_attachment_id`=ta.`attachment_id`) + LEFT OUTER JOIN `".BIT_DB_PREFIX."tiki_files` tf ON (tf.`file_id` = ta.`foreign_id`) + LEFT OUTER JOIN `".BIT_DB_PREFIX."tiki_user_preferences` tup ON ( uu.`user_id`=tup.`user_id` AND tup.`pref_name`='theme' ) + WHERE tbp.`$lookupColumn`=? "; - $result = $this->query($query,array((int) $lookupId)); + $result = $this->mDb->query($query,array((int) $lookupId)); if ($result->numRows()) { $this->mInfo = $result->fetchRow(); @@ -103,6 +105,9 @@ class BitBlogPost extends LibertyAttachable { return( count( $this->mInfo ) ); } + /** + * Verify that the store hash is valid and complete missing values + */ function verify( &$pParamHash ) { global $gBitUser; if( !empty( $pParamHash['post_id'] ) && empty( $this->mContentId ) && empty( $pParamHash['content_id'] ) ) { @@ -116,11 +121,17 @@ class BitBlogPost extends LibertyAttachable { return( count( $this->mErrors ) == 0 ); } + /** + * Check that the class has a valid blog loaded + */ function isValid() { return( !empty( $this->mPostId ) && is_numeric( $this->mPostId ) && $this->mPostId > 0 ); } - function isBlogOwner( $pUserId=NULL ) { + /** + * Check if the current user is the blog owner + */ + function isBlogOwner( $pUserId=NULL ) { $ret = FALSE; global $gBitUser; if( empty( $pUserId ) && $gBitUser->isValid() ) { @@ -132,13 +143,16 @@ class BitBlogPost extends LibertyAttachable { return $ret; } + /** + * Store a Blog Post + */ function store( &$pParamHash ) { global $gBlog, $gBitSystem; $pParamHash['upload']['thumbnail'] = TRUE; $this->mDb->StartTrans(); if( $this->verify( $pParamHash ) && LibertyAttachable::store( $pParamHash ) ) { - if( !empty( $pParamHash['attachment_id'] ) ) { + if( !empty( $pParamHash['attachment_id'] ) ) { // we just shoved an attachment onto the blog so we will concat the new link for usability. // THis is a bit hackish to do here. I imagine we will allow for this down in Liberty eventually, // but right now there is a chicken-n-egg situation storing 'data' before the attachments. - spiderr @@ -153,19 +167,19 @@ class BitBlogPost extends LibertyAttachable { $now = date("U"); if (empty($pParamHash['post_date'])) $pParamHash['post_date'] = (int)$now; - $pParamHash['post_id'] = $this->GenID('tiki_blog_posts_post_id_seq'); + $pParamHash['post_id'] = $this->mDb->GenID('tiki_blog_posts_post_id_seq'); $query = "insert into `".BIT_DB_PREFIX."tiki_blog_posts`(`blog_id`, `post_id`, `content_id`, `trackbacks_from`,`trackbacks_to`) values(?,?,?,?,?)"; - $result = $this->query($query,array($pParamHash['blog_id'],$pParamHash['post_id'],$pParamHash['content_store']['content_id'],serialize(array()),serialize(array()))); + $result = $this->mDb->query($query,array($pParamHash['blog_id'],$pParamHash['post_id'],$pParamHash['content_store']['content_id'],serialize(array()),serialize(array()))); $this->mPostId = $pParamHash['post_id']; // Send trackbacks recovering only successful trackbacks $trackbacks = serialize( $this->sendTrackbacks( $pParamHash['trackback'] ) ); // Update post with trackbacks successfully sent $query = "update `".BIT_DB_PREFIX."tiki_blog_posts` set `trackbacks_from`=?, `trackbacks_to` = ? where `post_id`=?"; - $this->query($query,array(serialize(array()),$trackbacks,(int) $pParamHash['post_id'])); + $this->mDb->query($query,array(serialize(array()),$trackbacks,(int) $pParamHash['post_id'])); $query = "update `".BIT_DB_PREFIX."tiki_blogs` set `last_modified`=?,`posts`=`posts`+1 where `blog_id`=?"; - $result = $this->query($query,array((int)$now,(int) $pParamHash['blog_id'])); + $result = $this->mDb->query($query,array((int)$now,(int) $pParamHash['blog_id'])); $gBlog->add_blog_activity($pParamHash['blog_id']); // let's reload to get a full mInfo hash which is needed below @@ -203,7 +217,7 @@ class BitBlogPost extends LibertyAttachable { if( !empty( $pParamHash['trackbacks'] ) ) { $trackbacks = serialize($gBlog->send_trackbacks($post_id, $trackbacks)); $query = "update `".BIT_DB_PREFIX."tiki_blog_posts` set `trackbacks_to`=? where `post_id`=?"; - $result = $this->query($query,array($trackbacks,$user_id,$post_id)); + $result = $this->mDb->query($query,array($trackbacks,$user_id,$post_id)); } } $this->mDb->CompleteTrans(); @@ -211,22 +225,25 @@ class BitBlogPost extends LibertyAttachable { } + /** + * Remove complete blog post set and any comments + */ function expunge() { $this->mDb->StartTrans(); // let's force a full load to make sure everything is loaded. $this->load(); if( $this->isValid() ) { // First kill any comments which belong to this post - foreach($this->mInfo['comments'] as $comment) { + foreach($this->mInfo['comments'] as $comment) { $tmpComment = new LibertyComment($comment['comment_id']); $tmpComment->deleteComment(); } $query = "delete from `".BIT_DB_PREFIX."tiki_blog_posts` where `post_id`=?"; - $result = $this->query( $query, array( (int) $this->mPostId ) ); + $result = $this->mDb->query( $query, array( (int) $this->mPostId ) ); $query = "update `".BIT_DB_PREFIX."tiki_blogs` set `posts`=`posts`-1 where `blog_id`=?"; - $result = $this->query( $query, array( (int)$this->mInfo['blog_id'] ) ); + $result = $this->mDb->query( $query, array( (int)$this->mInfo['blog_id'] ) ); // Do this last so foreign keys won't complain (not the we have them... yet ;-) LibertyAttachable::expunge(); } @@ -235,6 +252,12 @@ class BitBlogPost extends LibertyAttachable { return true; } + /** + * Generate a valid url for the Blog + * + * @param object PostId of the item to use + * @return object Url String + */ function getDisplayUrl( $pPostId=NULL ) { $ret = NULL; if( empty( $pPostId ) ) { @@ -247,13 +270,22 @@ class BitBlogPost extends LibertyAttachable { } else { $ret = BLOGS_PKG_URL.'view_post.php?post_id='.$pPostId; } + } else { + $ret = BLOGS_PKG_URL.'view_post.php?post='.$pPostId; } return $ret; } + /** + * Generate a valid display link for the Blog + * + * @param object PostId of the item to use + * @param array Not used + * @return object Fully formatted html link for use by Liberty + */ function getDisplayLink( $pPostId=NULL, $pMixed=NULL ) { - return BitBlogPost::getDisplayUrl( $pPostId ); + return "<a title=\"$pPostId\" href=\"" . BitBlogPost::getDisplayUrl( $pPostId ) . "\">$pPostId</a>"; } /** @@ -267,33 +299,33 @@ class BitBlogPost extends LibertyAttachable { function sendTrackbacks( $pTrackbacks ) { $ret = array(); if( $this->isValid() && !empty( $pTrackbacks ) ) { - // Split to get each URI - $tracks = explode(',', $pTrackbacks); + // Split to get each URI + $tracks = explode(',', $pTrackbacks); - //Build uri for post - $parts = parse_url($_SERVER['REQUEST_URI']); - $uri = httpPrefix(). str_replace('post', - 'view_post', $parts['path']). '?post_id=' . $this->mPostId . '&blog_id=' . $this->mInfo['blog_id']; - include_once ( UTIL_PKG_PATH.'Snoopy.class.inc' ); - $snoopy = new Snoopy; + //Build uri for post + $parts = parse_url($_SERVER['REQUEST_URI']); + $uri = httpPrefix(). str_replace('post', + 'view_post', $parts['path']). '?post_id=' . $this->mPostId . '&blog_id=' . $this->mInfo['blog_id']; + include_once ( UTIL_PKG_PATH.'Snoopy.class.inc' ); + $snoopy = new Snoopy; - foreach ($tracks as $track) { - @$fp = fopen($track, 'r'); + foreach ($tracks as $track) { + @$fp = fopen($track, 'r'); - if ($fp) { - $data = ''; + if ($fp) { + $data = ''; - while (!feof($fp)) { - $data .= fread($fp, 32767); - } + while (!feof($fp)) { + $data .= fread($fp, 32767); + } - fclose ($fp); - preg_match("/trackback:ping=(\"|\'|\s*)(.+)(\"|\'\s)/", $data, $reqs); + fclose ($fp); + preg_match("/trackback:ping=(\"|\'|\s*)(.+)(\"|\'\s)/", $data, $reqs); - if (!isset($reqs[2])) - return $ret; + if (!isset($reqs[2])) + return $ret; - @$fp = fopen($reqs[2], 'r'); + @$fp = fopen($reqs[2], 'r'); if ($fp) { fclose ($fp); @@ -338,10 +370,9 @@ class BitBlogPost extends LibertyAttachable { $whereSql = ' AND tc.`user_id` = ? '; } - if( $pListHash['find'] ) { $findesc = '%' . strtoupper( $pListHash['find'] ) . '%'; - $mid = "AND (UPPER(`data`) like ?) "; + $mid = "AND (UPPER(`data`) like ?) "; $bindvars[] =$findesc; } else { $mid = ""; @@ -353,15 +384,15 @@ class BitBlogPost extends LibertyAttachable { } $query = "SELECT tbp.*, tc.*, tb.`title` AS `blogtitle`, tb.`allow_comments`, uu.`email`, uu.`login` as `user`, uu.`real_name`, tf.`storage_path` as avatar - FROM `".BIT_DB_PREFIX."tiki_blogs` tb, `".BIT_DB_PREFIX."tiki_blog_posts` tbp - INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc ON (tc.`content_id` = tbp.`content_id`) - INNER JOIN `".BIT_DB_PREFIX."users_users` uu ON (uu.`user_id` = tc.`user_id`) - LEFT OUTER JOIN `".BIT_DB_PREFIX."tiki_attachments` ta ON (uu.`user_id` = ta.`user_id` AND ta.`attachment_id` = uu.`avatar_attachment_id`) - LEFT OUTER JOIN `".BIT_DB_PREFIX."tiki_files` tf ON (tf.`file_id` = ta.`foreign_id`) - WHERE tb.`blog_id` = tbp.`blog_id` $whereSql $mid order by tc.".$this->convert_sortmode( $pListHash['sort_mode'] ); + FROM `".BIT_DB_PREFIX."tiki_blogs` tb, `".BIT_DB_PREFIX."tiki_blog_posts` tbp + INNER JOIN `".BIT_DB_PREFIX."tiki_content` tc ON (tc.`content_id` = tbp.`content_id`) + INNER JOIN `".BIT_DB_PREFIX."users_users` uu ON (uu.`user_id` = tc.`user_id`) + LEFT OUTER JOIN `".BIT_DB_PREFIX."tiki_attachments` ta ON (uu.`user_id` = ta.`user_id` AND ta.`attachment_id` = uu.`avatar_attachment_id`) + LEFT OUTER JOIN `".BIT_DB_PREFIX."tiki_files` tf ON (tf.`file_id` = ta.`foreign_id`) + WHERE tb.`blog_id` = tbp.`blog_id` $whereSql $mid order by tc.".$this->mDb->convert_sortmode( $pListHash['sort_mode'] ); $query_cant = "SELECT COUNT(tbp.`post_id`) FROM `".BIT_DB_PREFIX."tiki_blog_posts` tbp, `".BIT_DB_PREFIX."tiki_content` tc WHERE tc.`content_id` = tbp.`content_id` $whereSql $mid"; - $result = $this->query($query,$bindvars,$pListHash['max_records'],$pListHash['offset']); - $cant = $this->getOne($query_cant,$bindvars); + $result = $this->mDb->query($query,$bindvars,$pListHash['max_records'],$pListHash['offset']); + $cant = $this->mDb->getOne($query_cant,$bindvars); $ret = array(); while ($res = $result->fetchRow()) { @@ -377,7 +408,7 @@ class BitBlogPost extends LibertyAttachable { $res['comments'] = NULL; } - $res['post_url'] = BitBlogPost::getDisplayLink( $res['post_id'] ); + $res['post_url'] = BitBlogPost::getDisplayUrl( $res['post_id'] ); $res['display_url'] = $res['post_url']; $res['blog_url'] = BitBlog::getBlogUrl( $res['blog_id'] ); @@ -417,7 +448,9 @@ class BitBlogPost extends LibertyAttachable { return $retval; } - + /** + * + */ function addTrackbackFrom( $url, $title = '', $excerpt = '', $blog_name = '') { if( $this->isValid() ) { $tbs = $this->getTrackbacksFrom( $this->mPostId ); @@ -430,11 +463,14 @@ class BitBlogPost extends LibertyAttachable { $tbs[$url] = $aux; $st = serialize($tbs); $query = "update `".BIT_DB_PREFIX."tiki_blog_posts` set `trackbacks_from`=? where `post_id`=?"; - $this->query( $query, array( $st, $this->mPostId ) ); + $this->mDb->query( $query, array( $st, $this->mPostId ) ); return true; } } + /** + * + */ function getTrackbacksFrom() { if( $this->isValid() ) { $st = $this->mDb->getOne("select `trackbacks_from` from `".BIT_DB_PREFIX."tiki_blog_posts` where `post_id`=?",array( $this->mPostId ) ); @@ -442,6 +478,9 @@ class BitBlogPost extends LibertyAttachable { } } + /** + * + */ function getTrackbacksTo() { if( $this->isValid() ) { $st = $this->mDb->getOne("select `trackbacks_to` from `".BIT_DB_PREFIX."tiki_blog_posts` where `post_id`=?", array( $this->mPostId ) ); @@ -449,22 +488,26 @@ class BitBlogPost extends LibertyAttachable { } } + /** + * + */ function clearTrackbacksFrom() { if( $this->isValid() ) { $empty = serialize(array()); $query = "update `".BIT_DB_PREFIX."tiki_blog_posts` set `trackbacks_from` = ? where `post_id`=?"; - $this->query( $query, array( $empty, $this->mPostId ) ); + $this->mDb->query( $query, array( $empty, $this->mPostId ) ); } } + /** + * + */ function clearTrackbacksTo() { - if( $this->isValid() ) { - $empty = serialize(array()); + if( $this->isValid() ) { + $empty = serialize(array()); $query = "update `".BIT_DB_PREFIX."tiki_blog_posts` set `trackbacks_to` = ? where `post_id`=?"; - $this->query( $query, array( $empty, $this->mPostId ) ); + $this->mDb->query( $query, array( $empty, $this->mPostId ) ); } } - - -} +}
\ No newline at end of file diff --git a/admin/upgrade_inc.php b/admin/upgrade_inc.php index 769c4b5..cebaca2 100644 --- a/admin/upgrade_inc.php +++ b/admin/upgrade_inc.php @@ -1,6 +1,6 @@ <?php -global $gBitSystem, $gUpgradeFrom, $gUpgradeTo; +global $gBitSystem, $gUpgradeFrom, $gUpgradeTo, $gBitDb; require_once( BLOGS_PKG_PATH.'BitBlogPost.php' ); @@ -52,20 +52,20 @@ array( 'QUERY' => // STEP 3 array( 'PHP' => ' global $gBitSystem; - $startPost = $gBitSystem->getOne( "SELECT MAX(`post_id`) FROM `'.BIT_DB_PREFIX.'tiki_blog_posts`" ); - $gBitSystem->mDb->mDb->CreateSequence( "tiki_blog_posts_post_id_seq", $startPost + 1 ); + $startPost = $gBitSystem->mDb->getOne( "SELECT MAX(`post_id`) FROM `'.BIT_DB_PREFIX.'tiki_blog_posts`" ); + $gBitSystem->mDb->CreateSequence( "tiki_blog_posts_post_id_seq", $startPost + 1 ); $query = "SELECT tbp.`post_id`, uu.`user_id`, uu.`user_id` AS modifier_user_id, tbp.`created`, tbp.`created` AS last_modified, tbp.`data`, tbp.`title` FROM `'.BIT_DB_PREFIX.'tiki_blog_posts` tbp INNER JOIN `'.BIT_DB_PREFIX.'users_users` uu ON( tbp.`user`=uu.`login` )"; - if( $rs = $gBitSystem->query( $query ) ) { + if( $rs = $gBitSystem->mDb->query( $query ) ) { while( !$rs->EOF ) { $postId = $rs->fields["post_id"]; unset( $rs->fields["post_id"] ); - $conId = $gBitSystem->mDb->mDb->GenID( "tiki_content_id_seq" ); + $conId = $gBitDb->GenID( "tiki_content_id_seq" ); $rs->fields["content_id"] = $conId; $rs->fields["content_type_guid"] = BITBLOGPOST_CONTENT_TYPE_GUID; $rs->fields["format_guid"] = PLUGIN_GUID_TIKIWIKI; $gBitSystem->mDb->associateInsert( "tiki_content", $rs->fields ); - $gBitSystem->query( "UPDATE `'.BIT_DB_PREFIX.'tiki_blog_posts` SET `content_id`=? WHERE `post_id`=? ", array( $conId, $postId ) ); + $gBitSystem->mDb->query( "UPDATE `'.BIT_DB_PREFIX.'tiki_blog_posts` SET `content_id`=? WHERE `post_id`=? ", array( $conId, $postId ) ); $rs->MoveNext(); } } diff --git a/display_bitblogpost_inc.php b/display_bitblogpost_inc.php index 6a1479f..5de68e9 100644 --- a/display_bitblogpost_inc.php +++ b/display_bitblogpost_inc.php @@ -66,7 +66,7 @@ $gBitSmarty->assign('blog_id', $_REQUEST["blog_id"]); if( !empty( $gContent->mInfo['blog_style'] ) && $gBitSystem->getPreference('feature_user_theme') == 'h' ) { $gBitSystem->setStyle( $gContent->mInfo['blog_style'] ); - $gBitLoc['styleSheet'] = $gBitSystem->getStyleCss( $gContent->mInfo['blog_style'], $gContent->mInfo['user_id'] ); + $gBitSystem->mStyles['styleSheet'] = $gBitSystem->getStyleCss( $gContent->mInfo['blog_style'], $gContent->mInfo['user_id'] ); $gBitSmarty->assign( 'userStyle', $gContent->mInfo['blog_style'] ); } diff --git a/modules/mod_last_blog_posts.tpl b/modules/mod_last_blog_posts.tpl index 51d4ad2..b9c8d9f 100644 --- a/modules/mod_last_blog_posts.tpl +++ b/modules/mod_last_blog_posts.tpl @@ -1,4 +1,4 @@ -{* $Header: /cvsroot/bitweaver/_bit_blogs/modules/mod_last_blog_posts.tpl,v 1.1 2005/06/19 03:57:42 bitweaver Exp $ *} +{* $Header: /cvsroot/bitweaver/_bit_blogs/modules/mod_last_blog_posts.tpl,v 1.2 2005/08/07 17:35:54 squareing Exp $ *} {strip} {if $blogsPackageActive} {bitmodule title="$moduleTitle" name="last_blog_posts"} @@ -17,7 +17,7 @@ {/section} </ul> {if $user_blog_id} - <div style="text-align:center;"><a href="{$gBitLoc.BIT_ROOT_URL}blogs/view.php?blog_id={$user_blog_id}">Visit my blog</a></div> + <div style="text-align:center;"><a href="{$smarty.const.BIT_ROOT_URL}blogs/view.php?blog_id={$user_blog_id}">Visit my blog</a></div> {/if} {/bitmodule} {/if} diff --git a/modules/mod_last_created_blogs.tpl b/modules/mod_last_created_blogs.tpl index 76e2c82..4836412 100644 --- a/modules/mod_last_created_blogs.tpl +++ b/modules/mod_last_created_blogs.tpl @@ -1,4 +1,4 @@ -{* $Header: /cvsroot/bitweaver/_bit_blogs/modules/mod_last_created_blogs.tpl,v 1.2 2005/07/17 17:36:01 squareing Exp $ *} +{* $Header: /cvsroot/bitweaver/_bit_blogs/modules/mod_last_created_blogs.tpl,v 1.3 2005/08/07 17:35:54 squareing Exp $ *} {strip} {if $gBitSystem->isFeatureActive( 'feature_blogs' )} {if $nonums eq 'y'} @@ -9,7 +9,7 @@ {bitmodule title="$moduleTitle" name="last_created_blogs"} <ol class="blogs"> {section name=ix loop=$modLastCreatedBlogs} - <li><a href="{$gBitLoc.BLOGS_PKG_URL}view.php?blog_id={$modLastCreatedBlogs[ix].blog_id}">{$modLastCreatedBlogs[ix].title}</a></li> + <li><a href="{$smarty.const.BLOGS_PKG_URL}view.php?blog_id={$modLastCreatedBlogs[ix].blog_id}">{$modLastCreatedBlogs[ix].title}</a></li> {sectionelse} <li></li> {/section} diff --git a/modules/mod_last_modified_blogs.tpl b/modules/mod_last_modified_blogs.tpl index d554dde..6c0c343 100644 --- a/modules/mod_last_modified_blogs.tpl +++ b/modules/mod_last_modified_blogs.tpl @@ -1,4 +1,4 @@ -{* $Header: /cvsroot/bitweaver/_bit_blogs/modules/mod_last_modified_blogs.tpl,v 1.2 2005/07/17 17:36:01 squareing Exp $ *} +{* $Header: /cvsroot/bitweaver/_bit_blogs/modules/mod_last_modified_blogs.tpl,v 1.3 2005/08/07 17:35:54 squareing Exp $ *} {strip} {if $gBitSystem->isFeatureActive( 'feature_blogs' )} {if $nonums eq 'y'} @@ -9,7 +9,7 @@ {bitmodule title="$moduleTitle" name="last_modified_blogs"} <ol class="blogs"> {section name=ix loop=$modLastModifiedBlogs} - <li><a href="{$gBitLoc.BLOGS_PKG_URL}view.php?blog_id={$modLastModifiedBlogs[ix].blog_id}">{$modLastModifiedBlogs[ix].title}</a></li> + <li><a href="{$smarty.const.BLOGS_PKG_URL}view.php?blog_id={$modLastModifiedBlogs[ix].blog_id}">{$modLastModifiedBlogs[ix].title}</a></li> {sectionelse} <li></li> {/section} diff --git a/modules/mod_top_active_blogs.tpl b/modules/mod_top_active_blogs.tpl index 532720f..7fbb972 100644 --- a/modules/mod_top_active_blogs.tpl +++ b/modules/mod_top_active_blogs.tpl @@ -1,4 +1,4 @@ -{* $Header: /cvsroot/bitweaver/_bit_blogs/modules/mod_top_active_blogs.tpl,v 1.2 2005/07/17 17:36:01 squareing Exp $ *} +{* $Header: /cvsroot/bitweaver/_bit_blogs/modules/mod_top_active_blogs.tpl,v 1.3 2005/08/07 17:35:54 squareing Exp $ *} {strip} {if $gBitSystem->isPackageActive( 'blogs' ) && $gBitUser->hasPermission( 'bit_p_read_blog' )} {if $nonums eq 'y'} @@ -9,7 +9,7 @@ {bitmodule title="$moduleTitle" name="top_active_blogs"} <ol class="blogs"> {section name=ix loop=$modTopActiveBlogs} - <li><a href="{$gBitLoc.BLOGS_PKG_URL}view.php?blog_id={$modTopActiveBlogs[ix].blog_id}">{$modTopActiveBlogs[ix].title}</a></li> + <li><a href="{$smarty.const.BLOGS_PKG_URL}view.php?blog_id={$modTopActiveBlogs[ix].blog_id}">{$modTopActiveBlogs[ix].title}</a></li> {sectionelse} <li></li> {/section} diff --git a/modules/mod_top_visited_blogs.tpl b/modules/mod_top_visited_blogs.tpl index 69f0e6b..a34418c 100644 --- a/modules/mod_top_visited_blogs.tpl +++ b/modules/mod_top_visited_blogs.tpl @@ -1,4 +1,4 @@ -{* $Header: /cvsroot/bitweaver/_bit_blogs/modules/mod_top_visited_blogs.tpl,v 1.2 2005/07/17 17:36:01 squareing Exp $ *} +{* $Header: /cvsroot/bitweaver/_bit_blogs/modules/mod_top_visited_blogs.tpl,v 1.3 2005/08/07 17:35:54 squareing Exp $ *} {strip} {if $gBitSystem->isPackageActive( 'blogs' )} {if $nonums eq 'y'} @@ -10,7 +10,7 @@ {bitmodule title="$moduleTitle" name="top_visited_blogs"} <ol class="blogs"> {section name=ix loop=$modTopVisitedBlogs} - <li><a href="{$gBitLoc.BLOGS_PKG_URL}view.php?blog_id={$modTopVisitedBlogs[ix].blog_id}">{$modTopVisitedBlogs[ix].title}</a></li> + <li><a href="{$smarty.const.BLOGS_PKG_URL}view.php?blog_id={$modTopVisitedBlogs[ix].blog_id}">{$modTopVisitedBlogs[ix].title}</a></li> {sectionelse} <li></li> {/section} @@ -1,6 +1,6 @@ <?php /** - * @version $Header: /cvsroot/bitweaver/_bit_blogs/post.php,v 1.4 2005/08/01 18:40:04 squareing Exp $ + * @version $Header: /cvsroot/bitweaver/_bit_blogs/post.php,v 1.5 2005/08/07 17:35:54 squareing Exp $ * @package blogs * @subpackage functions @@ -129,6 +129,7 @@ if( isset($_REQUEST["post_id"]) && $_REQUEST["post_id"] > 0 ) { if (isset($_REQUEST["preview"])) { $data = $_REQUEST['edit']; + $parsed_data = $gContent->parseData( $_REQUEST['edit'], (!empty($_REQUEST['format_guid']) ? $_REQUEST['format_guid'] : 'tikiwiki' )); if ($blog_spellcheck == 'y') { @@ -250,7 +251,6 @@ $gBitSmarty->assign_by_ref('blogs', $blogs); $gBitSmarty->assign('blog_id', $blog_id); $section = 'blogs'; - $gBitSystem->setBrowserTitle("Create Blog Post"); // Display the Index Template $gBitSystem->display( $mid ); diff --git a/send_post.php b/send_post.php index 288dc4b..f1843bb 100644 --- a/send_post.php +++ b/send_post.php @@ -1,6 +1,6 @@ <?php /** - * @version $Header: /cvsroot/bitweaver/_bit_blogs/send_post.php,v 1.4 2005/08/01 18:40:04 squareing Exp $ + * @version $Header: /cvsroot/bitweaver/_bit_blogs/send_post.php,v 1.5 2005/08/07 17:35:54 squareing Exp $ * @package blogs * @subpackage functions @@ -101,7 +101,7 @@ if (isset($_REQUEST['send'])) { $emails = explode(',', $_REQUEST['addresses']); $foo = parse_url($_SERVER["REQUEST_URI"]); - $machine = httpPrefix(). $gContent->getDisplayLink(); + $machine = $gContent->getDisplayUrl(); foreach ($emails as $email) { $gBitSmarty->assign('mail_site', $_SERVER["SERVER_NAME"]); diff --git a/templates/blog_header.tpl b/templates/blog_header.tpl index b3c40b7..476f16d 100644 --- a/templates/blog_header.tpl +++ b/templates/blog_header.tpl @@ -8,19 +8,19 @@ <td> {if $gBitUser->hasPermission( 'bit_p_blog_post' )} {if ($gBitUser->mUserId and $creator eq $gBitUser->mUserId) or $gBitUser->hasPermission( 'bit_p_blog_admin' ) or $public eq 'y'} - <a title="{tr}post{/tr}" href="{$gBitLoc.BLOGS_PKG_URL}post.php?blog_id={$blog_id}">{biticon ipackage=liberty iname="post" iexplain="post"}</a> + <a title="{tr}post{/tr}" href="{$smarty.const.BLOGS_PKG_URL}post.php?blog_id={$blog_id}">{biticon ipackage=liberty iname="post" iexplain="post"}</a> {/if} {/if} {if $gBitSystem->isPackageActive( 'rss' ) && $rss_blog eq 'y'} - <a title="{tr}RSS feed{/tr}" href="{$gBitLoc.BLOGS_PKG_URL}rss.php?blog_id={$blog_id}">{biticon ipackage="rss" iname="rss" iexplain="RSS feed"}</a> + <a title="{tr}RSS feed{/tr}" href="{$smarty.const.BLOGS_PKG_URL}rss.php?blog_id={$blog_id}">{biticon ipackage="rss" iname="rss" iexplain="RSS feed"}</a> {/if} {if ($gBitUser->isRegistered() and $creator eq $gBitUser->mUserId) or $gBitUser->hasPermission( 'bit_p_blog_admin' )} - <a title="{tr}Edit blog{/tr}" href="{$gBitLoc.BLOGS_PKG_URL}edit.php?blog_id={$blog_id}">{biticon ipackage=liberty iname="edit" iexplain="edit"}</a> + <a title="{tr}Edit blog{/tr}" href="{$smarty.const.BLOGS_PKG_URL}edit.php?blog_id={$blog_id}">{biticon ipackage=liberty iname="edit" iexplain="edit"}</a> {/if} {if $gBitUser->isRegistered() and $gBitSystem->isFeatureActive( 'feature_user_watches' )} {if $user_watching_blog eq "n"} - <a title="{tr}monitor this blog{/tr}" href="{$gBitLoc.BLOGS_PKG_URL}view.php?blog_id={$blog_id}&watch_event=blog_post&watch_object={$blog_id}&watch_action=add">{biticon ipackage="users" iname="watch" iexplain="monitor this blog"}</a> - {else}<a title="{tr}stop monitoring this blog{/tr}" href="{$gBitLoc.BLOGS_PKG_URL}view.php?blog_id={$blog_id}&watch_event=blog_post&watch_object={$blog_id}&watch_action=remove">{biticon ipackage="users" iname="unwatch" iexplain="stop monitoring this blog"}</a> + <a title="{tr}monitor this blog{/tr}" href="{$smarty.const.BLOGS_PKG_URL}view.php?blog_id={$blog_id}&watch_event=blog_post&watch_object={$blog_id}&watch_action=add">{biticon ipackage="users" iname="watch" iexplain="monitor this blog"}</a> + {else}<a title="{tr}stop monitoring this blog{/tr}" href="{$smarty.const.BLOGS_PKG_URL}view.php?blog_id={$blog_id}&watch_event=blog_post&watch_object={$blog_id}&watch_action=remove">{biticon ipackage="users" iname="unwatch" iexplain="stop monitoring this blog"}</a> {/if} {/if} </td> diff --git a/templates/blog_list_post.tpl b/templates/blog_list_post.tpl index 83947c8..79081ad 100644 --- a/templates/blog_list_post.tpl +++ b/templates/blog_list_post.tpl @@ -2,27 +2,27 @@ <div class="post" {if $user_dbl eq 'y' and (($blogPosts[ix].ownsblog eq 'y') or ($gBitUser->mUserId and $blogPosts[ix].user_id eq $gBitUser->mUserId) or $gBitUser->hasPermission( 'bit_p_blog_admin' ))} - ondblclick="location.href='{$gBitLoc.BLOGS_PKG_URL}post.php?blog_id={$blogPosts[ix].blog_id}{$blog_id}&post_id={$blogPosts[ix].post_id}{$post_id}';" + ondblclick="location.href='{$smarty.const.BLOGS_PKG_URL}post.php?blog_id={$blogPosts[ix].blog_id}{$blog_id}&post_id={$blogPosts[ix].post_id}{$post_id}';" {/if} > {if $gBitUser->hasPermission( 'bit_p_view_tabs_and_tools' )} <div class="floaticon"> {if $gBitSystem->isPackageActive( 'rss' ) && $gBitSystem->isFeatureActive( 'rss_blogs' )} - <a href="{$gBitLoc.BLOGS_PKG_URL}blogs_rss.php?blog_id={$blogPosts[ix].blog_id}">{biticon ipackage=rss iname=rss iexplain="rss feed"}</a> + <a href="{$smarty.const.BLOGS_PKG_URL}blogs_rss.php?blog_id={$blogPosts[ix].blog_id}">{biticon ipackage=rss iname=rss iexplain="rss feed"}</a> {/if} {if ($blogPosts[ix].ownsblog eq 'y') or ($gBitUser->mUserId and $blogPosts[ix].user_id eq $gBitUser->mUserId) or $gBitUser->hasPermission( 'bit_p_blog_admin' )} - <a title="{tr}Edit{/tr}" href="{$gBitLoc.BLOGS_PKG_URL}post.php?blog_id={$blogPosts[ix].blog_id}&post_id={$blogPosts[ix].post_id}">{biticon ipackage=liberty iname="edit" iexplain="edit"}</a> - <a title="{tr}Remove{/tr}" href="{$gBitLoc.BLOGS_PKG_URL}view.php?blog_id={$blogPosts[ix].blog_id}&remove={$blogPosts[ix].post_id}">{biticon ipackage=liberty iname="delete" iexplain="delete"}</a> + <a title="{tr}Edit{/tr}" href="{$smarty.const.BLOGS_PKG_URL}post.php?blog_id={$blogPosts[ix].blog_id}&post_id={$blogPosts[ix].post_id}">{biticon ipackage=liberty iname="edit" iexplain="edit"}</a> + <a title="{tr}Remove{/tr}" href="{$smarty.const.BLOGS_PKG_URL}view.php?blog_id={$blogPosts[ix].blog_id}&remove={$blogPosts[ix].post_id}">{biticon ipackage=liberty iname="delete" iexplain="delete"}</a> {/if} {**====== NOTEPAD PACKAGE CHECK IS BROKEN {if $gBitUser->mUserId and $gBitSystem->isPackageActive( 'notepad' ) and $gBitUser->hasPermission( 'bit_p_notepad' )} - <a title="{tr}Save to notepad{/tr}" href="{$gBitLoc.BLOGS_PKG_URL}view.php?blog_id={$blogPosts[ix].blog_id}&savenotepad={$blogPosts[ix].post_id}">{biticon ipackage=liberty iname="save" iexplain="save"}</a> + <a title="{tr}Save to notepad{/tr}" href="{$smarty.const.BLOGS_PKG_URL}view.php?blog_id={$blogPosts[ix].blog_id}&savenotepad={$blogPosts[ix].post_id}">{biticon ipackage=liberty iname="save" iexplain="save"}</a> {/if} ========= NOTEPAD PACKAGE CHECK IS BROKEN **} - <a title="{tr}print{/tr}" href="{$gBitLoc.BLOGS_PKG_URL}print_blog_post.php?post_id={$blogPosts[ix].post_id}">{biticon ipackage=liberty iname="print" iexplain="print"}</a> - <a title="{tr}email this post{/tr}" href="{$gBitLoc.BLOGS_PKG_URL}send_post.php?post_id={$blogPosts[ix].post_id}">{biticon ipackage=liberty iname="mail_send" iexplain="email this post"}</a> + <a title="{tr}print{/tr}" href="{$smarty.const.BLOGS_PKG_URL}print_blog_post.php?post_id={$blogPosts[ix].post_id}">{biticon ipackage=liberty iname="print" iexplain="print"}</a> + <a title="{tr}email this post{/tr}" href="{$smarty.const.BLOGS_PKG_URL}send_post.php?post_id={$blogPosts[ix].post_id}">{biticon ipackage=liberty iname="mail_send" iexplain="email this post"}</a> </div> {/if} @@ -54,7 +54,7 @@ </div> <!-- end .content --> {if $blogPosts[ix].pages > 1} - <a href="{$gBitLoc.BLOGS_PKG_URL}view_post.php?blog_id={$blogPosts[ix].blog_id}&post_id={$blogPosts[ix].post_id}">{tr}read more{/tr} ({$blogPosts[ix].pages} {tr}pages{/tr})</a> + <a href="{$smarty.const.BLOGS_PKG_URL}view_post.php?blog_id={$blogPosts[ix].blog_id}&post_id={$blogPosts[ix].post_id}">{tr}read more{/tr} ({$blogPosts[ix].pages} {tr}pages{/tr})</a> {/if} </div> <!-- end .body --> @@ -65,7 +65,7 @@ {if $blogPosts[ix].allow_comments eq 'y' and $gBitSystem->isFeatureActive( 'feature_blogposts_comments' )} {$blogPosts[ix].num_comments} {if $blogPosts[ix].num_comments == 1} {tr}comment{/tr} {else} {tr}comments{/tr}{/if} | - <a href="{$gBitLoc.BLOGS_PKG_URL}view_post.php?find={$find}&blog_id={$blogPosts[ix].blog_id}&offset={$offset}&sort_mode={$sort_mode}&post_id={$blogPosts[ix].post_id}&post_comment_request=1">{if $blogPosts[ix].num_comments > 0}{tr}view comments{/tr}{else}{tr}add comment{/tr}{/if}</a> + <a href="{$smarty.const.BLOGS_PKG_URL}view_post.php?find={$find}&blog_id={$blogPosts[ix].blog_id}&offset={$offset}&sort_mode={$sort_mode}&post_id={$blogPosts[ix].post_id}&post_comment_request=1">{if $blogPosts[ix].num_comments > 0}{tr}view comments{/tr}{else}{tr}add comment{/tr}{/if}</a> {/if} </div> <!-- end .footer --> </div> <!-- end .blog --> diff --git a/templates/blog_post.tpl b/templates/blog_post.tpl index fbd9d44..f44bffc 100644 --- a/templates/blog_post.tpl +++ b/templates/blog_post.tpl @@ -1,4 +1,4 @@ -{* $Header: /cvsroot/bitweaver/_bit_blogs/templates/blog_post.tpl,v 1.3 2005/07/17 17:36:01 squareing Exp $ *} +{* $Header: /cvsroot/bitweaver/_bit_blogs/templates/blog_post.tpl,v 1.4 2005/08/07 17:35:55 squareing Exp $ *} {literal} <script type="text/javascript"> function confirmDelete(fileName, location) { @@ -115,7 +115,7 @@ function confirmDelete(fileName, location) { <tr class="{cycle values="odd,even"}"> <td align="center">{if $storage.thumbnail_url.small}<img src="{$storage.thumbnail_url.small}" /><br/>{/if}{$storage.filename}</td> <td>{$storage.wiki_plugin_link|escape}</td> - <td align="right"><a href="javascript:confirmDelete('Delete {$storage.filename}?','{$gBitLoc.BLOGS_PKG_URL}post.php?post_id={$post_id}&remove_image={$attachmentId}')">{biticon ipackage=liberty iname=delete iexplain="remove"}</a></td> + <td align="right"><a href="javascript:confirmDelete('Delete {$storage.filename}?','{$smarty.const.BLOGS_PKG_URL}post.php?post_id={$post_id}&remove_image={$attachmentId}')">{biticon ipackage=liberty iname=delete iexplain="remove"}</a></td> </tr> {/foreach} <tr> diff --git a/templates/center_list_blog_posts.tpl b/templates/center_list_blog_posts.tpl index 2764fb6..124fe77 100644 --- a/templates/center_list_blog_posts.tpl +++ b/templates/center_list_blog_posts.tpl @@ -1,4 +1,4 @@ -{* $Header: /cvsroot/bitweaver/_bit_blogs/templates/center_list_blog_posts.tpl,v 1.1 2005/06/19 03:57:42 bitweaver Exp $ *} +{* $Header: /cvsroot/bitweaver/_bit_blogs/templates/center_list_blog_posts.tpl,v 1.2 2005/08/07 17:35:55 squareing Exp $ *} {if $blogPosts || $showEmpty} <div class="floaticon">{bithelp}</div> @@ -17,7 +17,7 @@ {/section} </div> - {pagination url="`$gBitLoc.BLOGS_PKG_URL`index.php" user_id="`$gQueryUserId`"} + {pagination url="`$smarty.const.BLOGS_PKG_URL`index.php" user_id="`$gQueryUserId`"} {*minifind sort_mode=$sort_mode*} </div> diff --git a/templates/edit_blog.tpl b/templates/edit_blog.tpl index c81bb67..0942f77 100644 --- a/templates/edit_blog.tpl +++ b/templates/edit_blog.tpl @@ -1,4 +1,4 @@ -{* $Header: /cvsroot/bitweaver/_bit_blogs/templates/edit_blog.tpl,v 1.2 2005/07/17 17:36:01 squareing Exp $ *} +{* $Header: /cvsroot/bitweaver/_bit_blogs/templates/edit_blog.tpl,v 1.3 2005/08/07 17:35:55 squareing Exp $ *} {strip} <div class="floaticon">{bithelp}</div> @@ -21,7 +21,7 @@ {/if} {if $individual eq 'y'} - {formfeedback warning="<a href='`$gBitLoc.KERNEL_PKG_URL`object_permissions.php?objectName=blog%20`$title`&object_type=blog&permType=blogs&object_id=`$blog_id`'>There are individual permissions set for this blog</a>" position="top"} + {formfeedback warning="<a href='`$smarty.const.KERNEL_PKG_URL`object_permissions.php?objectName=blog%20`$title`&object_type=blog&permType=blogs&object_id=`$blog_id`'>There are individual permissions set for this blog</a>" position="top"} {/if} {form ipackage="blogs" ifile="edit.php"} diff --git a/templates/list_blogs.tpl b/templates/list_blogs.tpl index ad58fc1..97fa579 100644 --- a/templates/list_blogs.tpl +++ b/templates/list_blogs.tpl @@ -8,6 +8,8 @@ </div> <div class="body"> + {minifind sort_mode=$sort_mode} + <div class="navbar"> <ul> <li>{biticon ipackage=liberty iname=sort iexplain="sort by"}</li> @@ -35,31 +37,29 @@ </ul> </div> - <div class="clear"></div> - - <ul class="data"> + <ul class="clear data"> {section name=changes loop=$listpages} <li class="item {cycle values='odd,even'}"> <div class="floaticon"> {if $gBitUser->hasPermission( 'bit_p_blog_post' )} {if ($gBitUser->isAdmin()) or ($listpages[changes].individual eq 'n') or ($listpages[changes].individual_gBitUser->hasPermission( 'bit_p_blog_post' ))} {if ($gBitUser->mUserId and $listpages[changes].user_id eq $gBitUser->mUserId) or ($gBitUser->hasPermission( 'bit_p_blog_admin' )) or ($listpages[changes].public eq 'y')} - <a title="{tr}post{/tr}" href="{$gBitLoc.BLOGS_PKG_URL}post.php?blog_id={$listpages[changes].blog_id}">{biticon ipackage=liberty iname="edit" iexplain="post"}</a> + <a title="{tr}post{/tr}" href="{$smarty.const.BLOGS_PKG_URL}post.php?blog_id={$listpages[changes].blog_id}">{biticon ipackage=liberty iname="edit" iexplain="post"}</a> {/if} {/if} {/if} {if ($gBitUser->mUserId and $listpages[changes].user_id eq $gBitUser->mUserId) or ($gBitUser->hasPermission( 'bit_p_blog_admin' ))} {if ($gBitUser->isAdmin()) or ($listpages[changes].individual eq 'n') or ($listpages[changes].individual_gBitUser->hasPermission( 'bit_p_blog_create_blog' ))} - <a title="{tr}edit{/tr}" href="{$gBitLoc.BLOGS_PKG_URL}edit.php?blog_id={$listpages[changes].blog_id}">{biticon ipackage=liberty iname="config" iexplain="configure"}</a> + <a title="{tr}edit{/tr}" href="{$smarty.const.BLOGS_PKG_URL}edit.php?blog_id={$listpages[changes].blog_id}">{biticon ipackage=liberty iname="config" iexplain="configure"}</a> {/if} {/if} {if ($gBitUser->mUserId and $listpages[changes].user_id eq $gBitUser->mUserId) or ($gBitUser->hasPermission( 'bit_p_blog_admin' ))} {if ($gBitUser->isAdmin()) or ($listpages[changes].individual eq 'n') or ($listpages[changes].individual_gBitUser->hasPermission( 'bit_p_blog_create_blog' ))} - <a title="{tr}remove{/tr}" href="{$gBitLoc.BLOGS_PKG_URL}list_blogs.php?offset={$offset}&sort_mode={$sort_mode}&remove={$listpages[changes].blog_id}">{biticon ipackage=liberty iname="delete" iexplain="delete"}</a> + <a title="{tr}remove{/tr}" href="{$smarty.const.BLOGS_PKG_URL}list_blogs.php?offset={$offset}&sort_mode={$sort_mode}&remove={$listpages[changes].blog_id}">{biticon ipackage=liberty iname="delete" iexplain="delete"}</a> {/if} {/if} {if $gBitUser->isAdmin()} - <a title="{tr}perms{/tr}" href="{$gBitLoc.KERNEL_PKG_URL}object_permissions.php?objectName=blog%20{$listpages[changes].title}&objectType=blog&permType=blogs&object_id={$listpages[changes].blog_id}">{if $listpages[changes].individual eq 'y'}{biticon ipackage=liberty iname="permissionsi_set" iexplain="set permissions"}{else}{biticon ipackage=liberty iname="permissions" iexplain="set permissions"}{/if}</a> + <a title="{tr}perms{/tr}" href="{$smarty.const.KERNEL_PKG_URL}object_permissions.php?objectName=blog%20{$listpages[changes].title}&objectType=blog&permType=blogs&object_id={$listpages[changes].blog_id}">{if $listpages[changes].individual eq 'y'}{biticon ipackage=liberty iname="permissionsi_set" iexplain="set permissions"}{else}{biticon ipackage=liberty iname="permissions" iexplain="set permissions"}{/if}</a> {/if} </div> @@ -114,11 +114,9 @@ </li> {/section} </ul> - </div><!-- end .body --> - {pagination} - - {minifind sort_mode=$sort_mode} + {pagination} + </div><!-- end .body --> </div><!-- end .blog --> {/strip} diff --git a/templates/menu_blogs.tpl b/templates/menu_blogs.tpl index 2c7ebbd..f0e9dfe 100644 --- a/templates/menu_blogs.tpl +++ b/templates/menu_blogs.tpl @@ -1,14 +1,14 @@ {strip} <ul> {if $gBitUser->hasPermission( 'bit_p_read_blog' )} - <li><a class="item" href="{$gBitLoc.BLOGS_PKG_URL}index.php">{tr}Recent Posts{/tr}</a></li> - <li><a class="item" href="{$gBitLoc.BLOGS_PKG_URL}list_blogs.php">{tr}List Blogs{/tr}</a></li> + <li><a class="item" href="{$smarty.const.BLOGS_PKG_URL}index.php">{tr}Recent Posts{/tr}</a></li> + <li><a class="item" href="{$smarty.const.BLOGS_PKG_URL}list_blogs.php">{tr}List Blogs{/tr}</a></li> {/if}{if $gBitUser->hasPermission( 'bit_p_create_blogs' )} - <li><a class="item" href="{$gBitLoc.BLOGS_PKG_URL}edit.php">{tr}Create a Blog{/tr}</a></li> + <li><a class="item" href="{$smarty.const.BLOGS_PKG_URL}edit.php">{tr}Create a Blog{/tr}</a></li> {/if}{if $gBitUser->hasPermission( 'bit_p_blog_post' )} - <li><a class="item" href="{$gBitLoc.BLOGS_PKG_URL}post.php">{tr}Post to a Blog{/tr}</a></li> + <li><a class="item" href="{$smarty.const.BLOGS_PKG_URL}post.php">{tr}Post to a Blog{/tr}</a></li> {/if}{if $gBitSystem->isFeatureActive( 'feature_blog_rankings' ) and $gBitUser->hasPermission( 'bit_p_read_blog' )} - <li><a class="item" href="{$gBitLoc.BLOGS_PKG_URL}rankings.php">{tr}Blog Rankings{/tr}</a></li> + <li><a class="item" href="{$smarty.const.BLOGS_PKG_URL}rankings.php">{tr}Blog Rankings{/tr}</a></li> {/if} </ul> {/strip} diff --git a/templates/menu_blogs_admin.tpl b/templates/menu_blogs_admin.tpl index f3ccd02..2e67856 100644 --- a/templates/menu_blogs_admin.tpl +++ b/templates/menu_blogs_admin.tpl @@ -1 +1 @@ -<ul><li><a class="item" href="{$gBitLoc.KERNEL_PKG_URL}admin/index.php?page=blogs">{tr}Blogs Settings{/tr}</a></li></ul>
\ No newline at end of file +<ul><li><a class="item" href="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page=blogs">{tr}Blogs Settings{/tr}</a></li></ul>
\ No newline at end of file diff --git a/templates/popup_categs.tpl b/templates/popup_categs.tpl index e23afda..badfccd 100644 --- a/templates/popup_categs.tpl +++ b/templates/popup_categs.tpl @@ -1,2 +1,2 @@ -{section name=i loop=$categs}<div><a href="{$gBitLoc.BLOGS_PKG_URL}{$page}?blog_id=:::blogid:::&post_id=:::postid:::&addcateg={$categs[i].category_id}">{biticon ipackage=categories -iname=$categs[i].name|cat:'.png'}</a></div>{/section}<div><a href="{$gBitLoc.BLOGS_PKG_URL}{$page}?blog_id=:::blogid:::&post_id=:::postid:::&delcategs=1">{tr}Clear{/tr}</a></div> +{section name=i loop=$categs}<div><a href="{$smarty.const.BLOGS_PKG_URL}{$page}?blog_id=:::blogid:::&post_id=:::postid:::&addcateg={$categs[i].category_id}">{biticon ipackage=categories +iname=$categs[i].name|cat:'.png'}</a></div>{/section}<div><a href="{$smarty.const.BLOGS_PKG_URL}{$page}?blog_id=:::blogid:::&post_id=:::postid:::&delcategs=1">{tr}Clear{/tr}</a></div> diff --git a/templates/print_blog_post.tpl b/templates/print_blog_post.tpl index ccac845..3a6f18d 100644 --- a/templates/print_blog_post.tpl +++ b/templates/print_blog_post.tpl @@ -53,15 +53,15 @@ a:hover { background-color : #deceae; } <hr /> <table> <tr><td> -<a href="{$gBitLoc.BLOGS_PKG_URL}view_post.php?blog_id={$post_info.blog_id}&post_id={$post_info.post_id}">{tr}Permalink{/tr}</a> +<a href="{$smarty.const.BLOGS_PKG_URL}view_post.php?blog_id={$post_info.blog_id}&post_id={$post_info.post_id}">{tr}Permalink{/tr}</a> ({tr}referenced by{/tr}: {$post_info.trackbacks_from_count} {tr}posts{/tr} {tr}references{/tr}: {$post_info.trackbacks_to_count} {tr}posts{/tr}) {if $post_info.allow_comments eq 'y' and $gBitSystem->isFeatureActive( 'feature_blogposts_comments' )} {$post_info.num_comments} {tr}comments{/tr} - <a href="{$gBitLoc.BLOGS_PKG_URL}view_post.php?find={$find}&blog_id={$post_info.blog_id}&offset={$offset}&sort_mode={$sort_mode}&post_id={$post_info.post_id}">{tr}view comments{/tr}</a> + <a href="{$smarty.const.BLOGS_PKG_URL}view_post.php?find={$find}&blog_id={$post_info.blog_id}&offset={$offset}&sort_mode={$sort_mode}&post_id={$post_info.post_id}">{tr}view comments{/tr}</a> {/if} </td><td> -<a title="{tr}print{/tr}" href="{$gBitLoc.BLOGS_PKG_URL}print_blog_post.php?post_id={$post_info.post_id}">{biticon ipackage=liberty iname="print" iexplain="Print"}</a> -<a title="{tr}email this post{/tr}" href="{$gBitLoc.BLOGS_PKG_URL}send_post.php?post_id={$post_info.post_id}">{biticon ipackage=liberty iname="mail_send" iexplain="Email"}</a> +<a title="{tr}print{/tr}" href="{$smarty.const.BLOGS_PKG_URL}print_blog_post.php?post_id={$post_info.post_id}">{biticon ipackage=liberty iname="print" iexplain="Print"}</a> +<a title="{tr}email this post{/tr}" href="{$smarty.const.BLOGS_PKG_URL}send_post.php?post_id={$post_info.post_id}">{biticon ipackage=liberty iname="mail_send" iexplain="Email"}</a> </td></tr></table> </div> diff --git a/templates/send_blog_post.tpl b/templates/send_blog_post.tpl index 3c74003..eed99b5 100644 --- a/templates/send_blog_post.tpl +++ b/templates/send_blog_post.tpl @@ -17,7 +17,7 @@ </div> {else} <h3>{tr}Send post to these addresses{/tr}</h3> - <form method="post" action="{$gBitLoc.BLOGS_PKG_URL}send_post.php"> + <form method="post" action="{$smarty.const.BLOGS_PKG_URL}send_post.php"> <input type="hidden" name="post_id" value="{$post_info.post_id}" /> <table class="panel"> <tr> diff --git a/templates/user_watch_blog_post.tpl b/templates/user_watch_blog_post.tpl index 96a6714..dc91202 100644 --- a/templates/user_watch_blog_post.tpl +++ b/templates/user_watch_blog_post.tpl @@ -1,8 +1,8 @@ {tr}New blog post: {$mail_title} by {$mail_user} at {$mail_date|bit_short_datetime}{/tr} {tr}View the blog at:{/tr} -{$mail_machine_raw}/{$gBitLoc.BLOGS_PKG_URL}view_post.php?blog_id={$mail_blogid}&post_id={$mail_postid} +{$mail_machine_raw}/{$smarty.const.BLOGS_PKG_URL}view_post.php?blog_id={$mail_blogid}&post_id={$mail_postid} {tr}If you don't want to receive these notifications follow this link:{/tr} -{$mail_machine_raw}/{$gBitLoc.USERS_PKG_URL}user_watches.php?hash={$mail_hash} +{$mail_machine_raw}/{$smarty.const.USERS_PKG_URL}user_watches.php?hash={$mail_hash} diff --git a/templates/view_blog.tpl b/templates/view_blog.tpl index 7bf3449..94555e7 100644 --- a/templates/view_blog.tpl +++ b/templates/view_blog.tpl @@ -1,26 +1,26 @@ -{* $Header: /cvsroot/bitweaver/_bit_blogs/templates/view_blog.tpl,v 1.2 2005/07/17 17:36:01 squareing Exp $ *} +{* $Header: /cvsroot/bitweaver/_bit_blogs/templates/view_blog.tpl,v 1.3 2005/08/07 17:35:55 squareing Exp $ *} {strip} <div class="display blogs"> <div class="floaticon"> {if $gBitUser->hasPermission( 'bit_p_blog_post' )} - {if ($gBitUser->mUserId and $creator eq $gBitUser->mUserId) or $gBitUser->hasPermission( 'bit_p_blog_admin' ) or $public eq 'y' or $bit_p_blog_post eq 'y'} - <a title="{tr}post{/tr}" href="{$gBitLoc.BLOGS_PKG_URL}post.php?blog_id={$blog_id}">{biticon ipackage=liberty iname="post" iexplain="post"}</a> + {if ($gBitUser->mUserId and $creator eq $gBitUser->mUserId) or $gBitUser->object_has_permission($gBitUser->mUserId, $blog_id, 'bitblog', 'bit_p_blog_post') or $gBitUser->hasPermission( 'bit_p_blog_admin' ) or $public eq 'y'} + <a title="{tr}post{/tr}" href="{$smarty.const.BLOGS_PKG_URL}post.php?blog_id={$blog_id}">{biticon ipackage=liberty iname="post" iexplain="post"}</a> {/if} {/if} {if $gBitSystem->isPackageActive( 'rss' ) && $rss_blog eq 'y'} - <a title="{tr}RSS feed{/tr}" href="{$gBitLoc.BLOGS_PKG_URL}blogs_rss.php?blog_id={$blog_id}">{biticon ipackage="rss" iname="rss" iexplain="RSS feed"}</a> + <a title="{tr}RSS feed{/tr}" href="{$smarty.const.BLOGS_PKG_URL}blogs_rss.php?blog_id={$blog_id}">{biticon ipackage="rss" iname="rss" iexplain="RSS feed"}</a> {/if} {if ($gBitUser->mUserId and $creator eq $gBitUser->mUserId) or $gBitUser->hasPermission( 'bit_p_blog_admin' )} - <a title="{tr}Edit blog{/tr}" href="{$gBitLoc.BLOGS_PKG_URL}edit.php?blog_id={$blog_id}">{biticon ipackage=liberty iname="config" iexplain="edit"}</a> + <a title="{tr}Edit blog{/tr}" href="{$smarty.const.BLOGS_PKG_URL}edit.php?blog_id={$blog_id}">{biticon ipackage=liberty iname="config" iexplain="edit"}</a> {/if} {if $gBitUser->isRegistered() and $gBitSystem->isFeatureActive( 'feature_user_watches' )} {if $user_watching_blog eq 'n'} - <a title="{tr}monitor this blog{/tr}" href="{$gBitLoc.BLOGS_PKG_URL}view.php?blog_id={$blog_id}&watch_event=blog_post&watch_object={$blog_id}&watch_action=add">{biticon ipackage="users" iname="watch" iexplain="monitor this blog"}</a> + <a title="{tr}monitor this blog{/tr}" href="{$smarty.const.BLOGS_PKG_URL}view.php?blog_id={$blog_id}&watch_event=blog_post&watch_object={$blog_id}&watch_action=add">{biticon ipackage="users" iname="watch" iexplain="monitor this blog"}</a> {else} - <a title="{tr}stop monitoring this blog{/tr}" href="{$gBitLoc.BLOGS_PKG_URL}view.php?blog_id={$blog_id}&watch_event=blog_post&watch_object={$blog_id}&watch_action=remove">{biticon ipackage="users" iname="unwatch" iexplain="stop monitoring this blog"}</a> + <a title="{tr}stop monitoring this blog{/tr}" href="{$smarty.const.BLOGS_PKG_URL}view.php?blog_id={$blog_id}&watch_event=blog_post&watch_object={$blog_id}&watch_action=remove">{biticon ipackage="users" iname="unwatch" iexplain="stop monitoring this blog"}</a> {/if} {/if} </div> diff --git a/templates/view_blog_post.tpl b/templates/view_blog_post.tpl index b4b934f..0faf0c1 100644 --- a/templates/view_blog_post.tpl +++ b/templates/view_blog_post.tpl @@ -12,17 +12,17 @@ <div class="display blogs"> <div class="floaticon"> {if ($ownsblog eq 'y') or $gBitUser->hasPermission( 'bit_p_blog_admin' )} - <a href="{$gBitLoc.BLOGS_PKG_URL}post.php?blog_id={$post_info.blog_id}&post_id={$post_info.post_id}">{biticon ipackage=liberty iname="edit" iexplain="edit"}</a> - <a href="{$gBitLoc.BLOGS_PKG_URL}view.php?blog_id={$post_info.blog_id}&remove={$post_info.post_id}">{biticon ipackage=liberty iname="delete" iexplain="delete"}</a> + <a href="{$smarty.const.BLOGS_PKG_URL}post.php?blog_id={$post_info.blog_id}&post_id={$post_info.post_id}">{biticon ipackage=liberty iname="edit" iexplain="edit"}</a> + <a href="{$smarty.const.BLOGS_PKG_URL}view.php?blog_id={$post_info.blog_id}&remove={$post_info.post_id}">{biticon ipackage=liberty iname="delete" iexplain="delete"}</a> {/if} {if $gBitSystem->isPackageActive( 'notepad' ) and $gBitUser->hasPermission( 'bit_p_notepad' )} - <a title="{tr}Save to notepad{/tr}" href="{$gBitLoc.BLOGS_PKG_URL}view_post.php?blog_id={$smarty.request.blog_id}&post_id={$smarty.request.post_id}&savenotepad=1">{biticon ipackage=liberty iname="save" iexplain="save"}</a> + <a title="{tr}Save to notepad{/tr}" href="{$smarty.const.BLOGS_PKG_URL}view_post.php?blog_id={$smarty.request.blog_id}&post_id={$smarty.request.post_id}&savenotepad=1">{biticon ipackage=liberty iname="save" iexplain="save"}</a> {/if} {if $gBitUser->hasPermission( 'bit_p_print' )} - <a href="{$gBitLoc.BLOGS_PKG_URL}print_blog_post.php?post_id={$post_id}">{biticon ipackage=liberty iname="print" iexplain="print"}</a> + <a href="{$smarty.const.BLOGS_PKG_URL}print_blog_post.php?post_id={$post_id}">{biticon ipackage=liberty iname="print" iexplain="print"}</a> {/if} - <a href="{$gBitLoc.BLOGS_PKG_URL}send_post.php?post_id={$post_id}">{biticon ipackage=liberty iname="mail_send" iexplain="email this post"}</a> + <a href="{$smarty.const.BLOGS_PKG_URL}send_post.php?post_id={$post_id}">{biticon ipackage=liberty iname="mail_send" iexplain="email this post"}</a> </div> <div class="header"> @@ -43,21 +43,21 @@ <div class="body" {if $user_dbl eq 'y' and (($ownsblog eq 'y') or $gBitUser->hasPermission( 'bit_p_blog_admin' ))} - ondblclick="location.href='{$gBitLoc.BLOGS_PKG_URL}post.php?blog_id={$post_info.blog_id}&post_id={$post_info.post_id}';" + ondblclick="location.href='{$smarty.const.BLOGS_PKG_URL}post.php?blog_id={$post_info.blog_id}&post_id={$post_info.post_id}';" {/if} > <div class="content"> {$parsed_data} <p> {displayname hash=$post_info}<br /> - {tr}in{/tr} <a href="{$gBitLoc.BLOGS_PKG_URL}view.php?blog_id={$post_info.blog_id}">{$post_info.blogtitle}</a><br /> + {tr}in{/tr} <a href="{$smarty.const.BLOGS_PKG_URL}view.php?blog_id={$post_info.blog_id}">{$post_info.blogtitle}</a><br /> {tr}Posted at{/tr} {$post_info.created|bit_long_time} </p> </div> <!-- end .content --> </div> <!-- end .body --> <div class="footer"> - <a href="{$gBitLoc.BLOGS_PKG_URL}view_post.php?post_id={$post_id}">{tr}Permalink{/tr}</a> + <a href="{$smarty.const.BLOGS_PKG_URL}view_post.php?post_id={$post_id}">{tr}Permalink{/tr}</a> {tr}referenced by{/tr} {$post_info.trackbacks_from_count} {tr}posts{/tr} | {tr}references{/tr} {$post_info.trackbacks_to_count} {tr}posts{/tr} {if $post_info.allow_comments eq 'y' and $gBitSystem->isFeatureActive( 'feature_blogposts_comments' )} | {$post_info.num_comments} {tr}comments{/tr} @@ -67,11 +67,11 @@ {if $pages > 1} <div class="pagination"> - <a href="{$gBitLoc.BLOGS_PKG_URL}view_post.php?blog_id={$smarty.request.blog_id}&post_id={$smarty.request.post_id}&page={$first_page}">{biticon ipackage=liberty iname="nav_first" iexplain="first page"}</a> - <a href="{$gBitLoc.BLOGS_PKG_URL}view_post.php?blog_id={$smarty.request.blog_id}&post_id={$smarty.request.post_id}&page={$prev_page}">{biticon ipackage=liberty iname="nav_prev" iexplain="previous page"}</a> + <a href="{$smarty.const.BLOGS_PKG_URL}view_post.php?blog_id={$smarty.request.blog_id}&post_id={$smarty.request.post_id}&page={$first_page}">{biticon ipackage=liberty iname="nav_first" iexplain="first page"}</a> + <a href="{$smarty.const.BLOGS_PKG_URL}view_post.php?blog_id={$smarty.request.blog_id}&post_id={$smarty.request.post_id}&page={$prev_page}">{biticon ipackage=liberty iname="nav_prev" iexplain="previous page"}</a> {tr}page{/tr}:{$page}/{$pages} - <a href="{$gBitLoc.BLOGS_PKG_URL}view_post.php?blog_id={$smarty.request.blog_id}&post_id={$smarty.request.post_id}&page={$next_page}">{biticon ipackage=liberty iname="nav_next" iexplain="next page"}</a> - <a href="{$gBitLoc.BLOGS_PKG_URL}view_post.php?blog_id={$smarty.request.blog_id}&post_id={$smarty.request.post_id}&page={$last_page}">{biticon ipackage=liberty iname="nav_last" iexplain="last page"}</a> + <a href="{$smarty.const.BLOGS_PKG_URL}view_post.php?blog_id={$smarty.request.blog_id}&post_id={$smarty.request.post_id}&page={$next_page}">{biticon ipackage=liberty iname="nav_next" iexplain="next page"}</a> + <a href="{$smarty.const.BLOGS_PKG_URL}view_post.php?blog_id={$smarty.request.blog_id}&post_id={$smarty.request.post_id}&page={$last_page}">{biticon ipackage=liberty iname="nav_last" iexplain="last page"}</a> </div> {/if} @@ -1,6 +1,6 @@ <?php /** - * @version $Header: /cvsroot/bitweaver/_bit_blogs/view.php,v 1.3 2005/08/01 18:40:04 squareing Exp $ + * @version $Header: /cvsroot/bitweaver/_bit_blogs/view.php,v 1.4 2005/08/07 17:35:54 squareing Exp $ * @package blogs * @subpackage functions @@ -80,7 +80,7 @@ $blog_data = $gBlog->get_blog($_REQUEST["blog_id"]); if( !empty( $blog_data['blog_style'] ) && $gBitSystem->getPreference('feature_user_theme') == 'h' ) { $gBitSystem->setStyle( $blog_data['blog_style'] ); - $gBitLoc['styleSheet'] = $gBitSystem->getStyleCss( $blog_data['blog_style'], $blog_data['user_id'] ); + $gBitSystem->mStyles['styleSheet'] = $gBitSystem->getStyleCss( $blog_data['blog_style'], $blog_data['user_id'] ); $gBitSmarty->assign( 'userStyle', $blog_data['blog_style'] ); } @@ -187,7 +187,7 @@ if( $gBitSystem->isFeatureActive( 'feature_user_watches' ) ) { if ($_REQUEST['watch_action'] == 'add') { $blogPost = new BitBlogPost( $_REQUEST['watch_object'] ); if( $blogPost->load() ) { - $gBitUser->storeWatch( $_REQUEST['watch_event'], $_REQUEST['watch_object'], tra('blog'), $blogPost->mInfo['title'], $blogPost->getDisplayLink() ); + $gBitUser->storeWatch( $_REQUEST['watch_event'], $_REQUEST['watch_object'], tra('blog'), $blogPost->mInfo['title'], $blogPost->getDisplayUrl() ); } } else { $gBitUser->expungeWatch( $_REQUEST['watch_event'], $_REQUEST['watch_object'] ); |
