[pLog-svn] r2481 - in plog/trunk: . bin-devel class/action
class/action/admin class/config class/controller class/dao
class/data class/data/captcha class/data/utf8 class/gallery
class/gallery/dao class/gallery/data class/gallery/resizers
class/locale class/net class/net/http class/net/http/phpsniff
class/net/xmlrpc class/plugin class/summary/action
class/summary/view class/template/smarty/plugins class/view
class/view/admin config imgs imgs/authimage js/ui locale
templates/admin templates/grey templates/grey-sf
templates/rss templates/standard
templates/standard-with-plugins templates/summary
jondaley at devel.plogworld.net
jondaley at devel.plogworld.net
Mon Sep 19 02:23:58 GMT 2005
Author: jondaley
Date: 2005-09-19 02:23:51 +0000 (Mon, 19 Sep 2005)
New Revision: 2481
Added:
plog/trunk/bin-devel/build-diff.sh
plog/trunk/class/data/captcha/
plog/trunk/class/data/captcha/captcha.class.php
plog/trunk/class/data/utf8/
plog/trunk/class/data/utf8/utf8_funcs.php
plog/trunk/class/summary/view/summaryusercreationview.class.php
plog/trunk/class/template/smarty/plugins/modifier.substr.php
plog/trunk/class/template/smarty/plugins/modifier.utf8_truncate.php
plog/trunk/imgs/authimage/
plog/trunk/imgs/authimage/marble.gif
plog/trunk/imgs/authimage/ocean.gif
plog/trunk/imgs/authimage/pine.gif
plog/trunk/imgs/authimage/rain.gif
plog/trunk/imgs/authimage/sky.gif
plog/trunk/imgs/authimage/transparent.gif
plog/trunk/locale/locale_fa_IR.php
plog/trunk/locale/locale_nl_NL.php
plog/trunk/locale/locale_ru_RU.php
plog/trunk/locale/locale_tr_TR.php
Removed:
plog/trunk/class/data/captcha/captcha.class.php
plog/trunk/class/data/utf8/utf8_funcs.php
plog/trunk/imgs/authimage/marble.gif
plog/trunk/imgs/authimage/ocean.gif
plog/trunk/imgs/authimage/pine.gif
plog/trunk/imgs/authimage/rain.gif
plog/trunk/imgs/authimage/sky.gif
plog/trunk/imgs/authimage/transparent.gif
Modified:
plog/trunk/blog.php
plog/trunk/class/action/addcommentaction.class.php
plog/trunk/class/action/admin/adminaddresourcealbumaction.class.php
plog/trunk/class/action/admin/adminloginaction.class.php
plog/trunk/class/action/admin/adminmainaction.class.php
plog/trunk/class/action/admin/adminnewpostaction.class.php
plog/trunk/class/action/admin/adminpostmanagementcommonaction.class.php
plog/trunk/class/action/blogaction.class.php
plog/trunk/class/action/commentaction.class.php
plog/trunk/class/action/resourceserveraction.class.php
plog/trunk/class/action/viewarticleaction.class.php
plog/trunk/class/action/viewarticletrackbacksaction.class.php
plog/trunk/class/config/configfilestorage.class.php
plog/trunk/class/controller/controller.class.php
plog/trunk/class/dao/article.class.php
plog/trunk/class/dao/articles.class.php
plog/trunk/class/dao/searchengine.class.php
plog/trunk/class/data/mimetype.class.php
plog/trunk/class/data/plogcalendar.class.php
plog/trunk/class/gallery/dao/galleryalbums.class.php
plog/trunk/class/gallery/dao/galleryresource.class.php
plog/trunk/class/gallery/dao/galleryresources.class.php
plog/trunk/class/gallery/data/galleryresourcezipmetadatareader.class.php
plog/trunk/class/gallery/galleryconstants.php
plog/trunk/class/gallery/resizers/galleryimagemagickresizer.class.php
plog/trunk/class/locale/locale.class.php
plog/trunk/class/locale/locales.class.php
plog/trunk/class/locale/pluginlocale.class.php
plog/trunk/class/net/customrequestgenerator.class.php
plog/trunk/class/net/customurlhandler.class.php
plog/trunk/class/net/http/httpclient.class.php
plog/trunk/class/net/http/phpsniff/phpSniff.class.php
plog/trunk/class/net/linkformatmatcher.class.php
plog/trunk/class/net/linkparser.class.php
plog/trunk/class/net/rawrequestgenerator.class.php
plog/trunk/class/net/request.class.php
plog/trunk/class/net/xmlrpc/IXR_Library.lib.php
plog/trunk/class/plugin/pluginmanager.class.php
plog/trunk/class/summary/action/bloglistaction.class.php
plog/trunk/class/summary/action/dofinishregister.class.php
plog/trunk/class/summary/action/doreadagreement.class.php
plog/trunk/class/summary/action/dousercreation.class.php
plog/trunk/class/summary/action/douserregister.class.php
plog/trunk/class/summary/action/userlistaction.class.php
plog/trunk/class/view/admin/adminpostslistview.class.php
plog/trunk/class/view/resourceserverview.class.php
plog/trunk/class/view/view.class.php
plog/trunk/config/config.properties.php
plog/trunk/js/ui/common.js
plog/trunk/locale/locale_de_DE.php
plog/trunk/locale/locale_en_UK.php
plog/trunk/locale/locale_fi_FI.php
plog/trunk/locale/locale_ja_JP.php
plog/trunk/rss.php
plog/trunk/templates/admin/dashboard.template
plog/trunk/templates/admin/editcomments.template
plog/trunk/templates/admin/editlinks.template
plog/trunk/templates/admin/editpost.template
plog/trunk/templates/admin/editposts.template
plog/trunk/templates/admin/newlink.template
plog/trunk/templates/admin/newpost.template
plog/trunk/templates/admin/newpost_customfields.template
plog/trunk/templates/admin/newresourcealbum.template
plog/trunk/templates/grey-sf/postandcomments.template
plog/trunk/templates/grey/postandcomments.template
plog/trunk/templates/rss/atom.template
plog/trunk/templates/rss/rss090.template
plog/trunk/templates/rss/rss20.template
plog/trunk/templates/standard-with-plugins/postandcomments.template
plog/trunk/templates/standard/postandcomments.template
plog/trunk/templates/summary/index.template
plog/trunk/templates/summary/post.template
plog/trunk/templates/summary/registerstep1.template
plog/trunk/templates/summary/summary.template
plog/trunk/wizard.php
plog/trunk/xmlrpc.php
Log:
the rest of the changes from 1.0.2. revs 2358 through 2477. whew. now to see if it actually works. this merge was pretty rough.
Copied: plog/trunk/bin-devel/build-diff.sh (from rev 2477, plog/branches/plog-1.0.2/bin-devel/build-diff.sh)
Property changes on: plog/trunk/bin-devel/build-diff.sh
___________________________________________________________________
Name: svn:executable
+ *
Modified: plog/trunk/blog.php
===================================================================
--- plog/trunk/blog.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/blog.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -30,7 +30,7 @@
//
$vars["op"] = "op";
foreach( $vars as $key => $value ) {
- if( $params["$key"] != "" )
+ if( is_array( $params ) && array_key_exists( $key, $params ) && $params["$key"] != "" )
HttpVars::setRequestValue( $vars["$key"], $params["$key"] );
}
Modified: plog/trunk/class/action/addcommentaction.class.php
===================================================================
--- plog/trunk/class/action/addcommentaction.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/action/addcommentaction.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -83,11 +83,9 @@
}
$this->_userName = Textfilter::filterAllHTML($this->_request->getValue( "userName" ));
$this->_commentText = trim($this->_request->getValue( "commentText" ));
- $this->_commentTopic = trim($this->_request->getValue( "commentTopic" ));
- // remove all weird stuff from the text and topic
+ $this->_commentTopic = trim(Textfilter::filterAllHTML($this->_request->getValue( "commentTopic" )));
+ // remove all weird stuff from the comment text
$tf = new TextFilter();
- $this->_commentTopic = $tf->xhtmlize($tf->filterHTML( $this->_commentTopic ));
- // and also from the text
$this->_commentText = $tf->xhtmlize($tf->filterHTML( $this->_commentText ));
// now, if the option is set, we 'beautify' the text typed by users
if( $this->_config->getValue( "beautify_comments_text" )) {
Modified: plog/trunk/class/action/admin/adminaddresourcealbumaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminaddresourcealbumaction.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/action/admin/adminaddresourcealbumaction.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -46,7 +46,8 @@
$this->_albumName = Textfilter::filterAllHTML($this->_request->getValue( "albumName" ));
$this->_albumDescription = Textfilter::filterAllHTML($this->_request->getValue( "albumDescription" ));
$this->_parentId = $this->_request->getValue( "parentId" );
-
+ $showAlbum = $this->_request->getValue("showAlbum") ? 1 : 0;
+
// create the album
$albums = new GalleryAlbums();
$t = new Timestamp();
@@ -56,7 +57,7 @@
$this->_parentId,
$t->getTimestamp(),
Array(),
- true );
+ $showAlbum);
$this->notifyEvent( EVENT_PRE_ALBUM_ADD, Array( "album" => &$album ));
// and add it to the database
Modified: plog/trunk/class/action/admin/adminloginaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminloginaction.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/action/admin/adminloginaction.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -10,6 +10,7 @@
include_once( PLOG_CLASS_PATH."class/misc/version.class.php" );
include_once( PLOG_CLASS_PATH."class/locale/locales.class.php" );
include_once( PLOG_CLASS_PATH."class/data/validator/stringvalidator.class.php" );
+ include_once( PLOG_CLASS_PATH."class/view/admin/adminnewpostview.class.php" );
/**
* \ingroup Action
@@ -35,8 +36,8 @@
{
$this->Action( $actionInfo, $request );
- $config =& Config::getConfig();
- $this->_locale =& Locales::getLocale( $config->getValue( "default_locale" ));
+ $this->_config =& Config::getConfig();
+ $this->_locale =& Locales::getLocale( $this->_config->getValue( "default_locale" ));
// data validation
$this->registerFieldValidator( "userName", new StringValidator());
@@ -105,7 +106,20 @@
$pm->notifyEvent( EVENT_BLOGS_LOADED, Array( "blogs" => &$userBlogs, "from" => "Login" ));
- $this->_view = new AdminDashboardView( $userInfo, $userBlogs );
+ // check if we are skipping the dashboard
+ if( $this->_config->getValue( "skip_dashboard" )) {
+ // get the first blog that came
+ $this->_blogInfo = end( $userBlogs );
+ // set it in the session
+ $session = HttpVars::getSession();
+ $session["SessionInfo"]->setValue( "blogInfo", $this->_blogInfo );
+ HttpVars::setSession( $session );
+ // and then continue...
+ AdminController::setForwardAction( "newPost" );
+ }
+ else {
+ $this->_view = new AdminDashboardView( $userInfo, $userBlogs );
+ }
// better to return true if everything's fine
return true;
}
Modified: plog/trunk/class/action/admin/adminmainaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminmainaction.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/action/admin/adminmainaction.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -91,8 +91,11 @@
// if all correct, we can now set the blogInfo object in the session for later
// use
+ $this->_session->setValue( "blogInfo", $this->_blogInfo );
$session = HttpVars::getSession();
- $session["SessionInfo"]->setValue( "blogId", $this->_blogInfo->getId() );
+ // TODO: we might need this. merging problem from 1.0.2 to 1.1.
+ // $session["SessionInfo"]->setValue( "blogId", $this->_blogInfo->getId() );
+ $session["SessionInfo"] = $this->_session;
HttpVars::setSession( $session );
return true;
Modified: plog/trunk/class/action/admin/adminnewpostaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminnewpostaction.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/action/admin/adminnewpostaction.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -29,7 +29,7 @@
function perform()
{
$categories = new ArticleCategories();
- $blogCategories = $categories->getBlogCategories( $this->_blogInfo->getId(), false, $categoriesOrder );
+ $blogCategories = $categories->getBlogCategories( $this->_blogInfo->getId() );
// but make sure that we have at least one!
if( count($blogCategories) == 0) {
$this->_view = new AdminTemplatedView( $this->_blogInfo, "newpostcategory" );
Modified: plog/trunk/class/action/admin/adminpostmanagementcommonaction.class.php
===================================================================
--- plog/trunk/class/action/admin/adminpostmanagementcommonaction.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/action/admin/adminpostmanagementcommonaction.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -123,7 +123,7 @@
{
$this->_postText = trim(Textfilter::xhtmlize($this->_request->getValue( "postText" )));
$this->_postExtendedText = trim(Textfilter::xhtmlize($this->_request->getValue( "postExtendedText" )));
- $this->_postTopic = trim(Textfilter::filterAllHTML($this->_request->getValue( "postTopic" )));
+ $this->_postTopic = trim(Textfilter::xhtmlize(Textfilter::filterAllHTML($this->_request->getValue( "postTopic" ))));
$this->_postCategories = $this->_request->getValue( "postCategories" );
$this->_postSlug = trim(Textfilter::filterAllHTML($this->_request->getValue( "postSlug" )));
$this->_postStatus = $this->_request->getValue( "postStatus" );
Modified: plog/trunk/class/action/blogaction.class.php
===================================================================
--- plog/trunk/class/action/blogaction.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/action/blogaction.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -164,7 +164,7 @@
// "user" parameter.
if( !$blogId && !$blogName ) {
// check if there was a user parameter
- if( !empty($userName) ) {
+ if( !empty($userName) ) {
// if so, check to which blogs the user belongs
$users = new Users();
$userInfo = $users->getUserInfoFromUsername( $userName );
@@ -175,7 +175,11 @@
// get the first one (any better rule for this?)
if( !empty($userBlogs)) {
$blogId = $userBlogs[0]->getId();
+ } else {
+ $blogId = $this->_config->getValue('default_blog_id');
}
+ } else {
+ $blogId = $this->_config->getValue('default_blog_id');
}
}
else {
Modified: plog/trunk/class/action/commentaction.class.php
===================================================================
--- plog/trunk/class/action/commentaction.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/action/commentaction.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -81,9 +81,7 @@
}
// if everything's fine, we set up the article object for the view
- $this->_view->setValue( "category", $category );
$this->_view->setValue( "post", $article );
- $this->_view->setValue( "user", $user );
$this->_view->setValue( "parentId", $this->_parentId );
$this->_view->setValue( "comments", $postComments );
$this->_view->setValue( "postcomments", $postComments );
Modified: plog/trunk/class/action/resourceserveraction.class.php
===================================================================
--- plog/trunk/class/action/resourceserveraction.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/action/resourceserveraction.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -59,7 +59,7 @@
// "user" parameter.
if( !$blogId && !$blogName ) {
// check if there was a user parameter
- if( !empty($userName) ) {
+ if( !empty($userName) ) {
// if so, check to which blogs the user belongs
$users = new Users();
$userInfo = $users->getUserInfoFromUsername( $userName );
@@ -70,7 +70,11 @@
// get the first one (any better rule for this?)
if( !empty($userBlogs)) {
$blogId = $userBlogs[0]->getId();
+ } else{
+ $blogId = $this->_config->getValue('default_blog_id');
}
+ } else{
+ $blogId = $this->_config->getValue('default_blog_id');
}
}
else {
@@ -193,7 +197,7 @@
$this->_view = new ResourceServerView();
$this->_view->addHeaderResponse( "HTTP/1.1 404 Not Found" );
$this->_view->addHeaderResponse( "Status: 404 Not Found" );
- $this->_view->addHeaderResponse( "X-pLog-Error: Resource $resId not found" );
+ $this->_view->addHeaderResponse( "X-pLog-Error: Resource $this->_resId not found" );
return false;
}
Modified: plog/trunk/class/action/viewarticleaction.class.php
===================================================================
--- plog/trunk/class/action/viewarticleaction.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/action/viewarticleaction.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -73,11 +73,14 @@
* @private
* updates the article referrers given an id
*/
- function _updateArticleReferrersById($articleId){
- $referrers = new Referers();
- $referrers->addReferer( $_SERVER['HTTP_REFERER'],
- $articleId, $this->_blogInfo->getId());
- }
+ function _updateArticleReferrersById($articleId){
+ if ( array_key_exists( 'HTTP_REFERER', $_SERVER ) )
+ {
+ $referrers = new Referers();
+ $referrers->addReferer( $_SERVER['HTTP_REFERER'],
+ $articleId, $this->_blogInfo->getId());
+ }
+ }
/**
* @private
* updates the article referrers, given a slug
Modified: plog/trunk/class/action/viewarticletrackbacksaction.class.php
===================================================================
--- plog/trunk/class/action/viewarticletrackbacksaction.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/action/viewarticletrackbacksaction.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -115,7 +115,6 @@
// if everything's fine, we set up the article object for the view
$this->_view->setValue( "post", $article );
- $this->_view->setValue( "user", $user );
$this->_view->setValue( "trackbacks", $article->getTrackbacks( true ));
$this->setCommonData();
Modified: plog/trunk/class/config/configfilestorage.class.php
===================================================================
--- plog/trunk/class/config/configfilestorage.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/config/configfilestorage.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -244,7 +244,7 @@
{
$value = $this->_props->getValue( $key );
if( $value == "" || $value == null )
- if( !isset( $defaultValue ) || is_null( $defaultValue ) )
+ if(isset($defaultValue))
$value = $defaultValue;
return $value;
Modified: plog/trunk/class/controller/controller.class.php
===================================================================
--- plog/trunk/class/controller/controller.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/controller/controller.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -261,7 +261,6 @@
// get the name of the action
$request = new Request( $httpRequest );
- $actionName = $request->getValue($this->_actionParam );
$i = 0;
$performed = false;
@@ -270,7 +269,10 @@
// get the value of this varilable, every loop
global $_plogController_forwardAction;
global $_plogController_previousAction;
-
+
+ // jondaley: 08/29/2005, what are these here for??
+ // perhaps the global statements should be moved
+ // inside the elseif loop below?
$_plogController_forwardAction;
$_plogController_previousAction;
@@ -278,11 +280,13 @@
// if this is the first iteration, then we have to take this path...
// since we will use the http request to determine which action to
// use next
+ $actionName = $request->getValue($this->_actionParam );
$actionClass = $this->_getActionClassName($request->getValue($this->_actionParam));
}
elseif (!empty($_plogController_forwardAction)) {
// if we're forwarding the current execution flow to another action, then
// we'll go this way
+ $actionName = $_plogController_forwardAction;
$actionClass = $this->_getActionClassName($_plogController_forwardAction);
$httpRequest = HttpVars::getRequest();
$_plogController_forwardAction = null;
Modified: plog/trunk/class/dao/article.class.php
===================================================================
--- plog/trunk/class/dao/article.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/dao/article.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -175,8 +175,13 @@
*/
function getExtendedText()
{
- $postParts = explode( POST_EXTENDED_TEXT_MODIFIER, $this->_text );
- return $postParts[1];
+ $postParts = explode( POST_EXTENDED_TEXT_MODIFIER, $this->_text );
+ $extendedText = "";
+ if ( count($postParts) > 1 )
+ {
+ $extendedText = $postParts[1];
+ }
+ return $extendedText;
}
/**
@@ -819,6 +824,11 @@
if( is_null($this->_fields) )
$this->getCustomFields();
+ if ( !array_key_exists( $fieldName, $this->_fields ) )
+ {
+ return null;
+ }
+
return $this->_fields["$fieldName"];
}
Modified: plog/trunk/class/dao/articles.class.php
===================================================================
--- plog/trunk/class/dao/articles.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/dao/articles.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -493,7 +493,7 @@
if( !$result )
return Array();
- $postPerDay = Array();
+ $postsPerDay = Array();
while( $row = $result->FetchRow()) {
$day = substr($row['date'],6,2);
$postsPerDay[$day] = 1;
Modified: plog/trunk/class/dao/searchengine.class.php
===================================================================
--- plog/trunk/class/dao/searchengine.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/dao/searchengine.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -344,7 +344,7 @@
foreach( $results as $item ) {
$article = $item->getArticle();
- if( $alreadySeen[$article->getId()] == false ) {
+ if( !array_key_exists( $article->getId(), $alreadySeen ) || $alreadySeen[$article->getId()] == false ) {
array_push( $result, $item );
$alreadySeen[$article->getId()] = true;
}
Copied: plog/trunk/class/data/captcha (from rev 2477, plog/branches/plog-1.0.2/class/data/captcha)
Deleted: plog/trunk/class/data/captcha/captcha.class.php
===================================================================
--- plog/branches/plog-1.0.2/class/data/captcha/captcha.class.php 2005-09-18 21:06:33 UTC (rev 2477)
+++ plog/trunk/class/data/captcha/captcha.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -1,148 +0,0 @@
-<?php
-
- include_once( PLOG_CLASS_PATH."class/object/object.class.php" );
-
- /**
- * default expiration time for old images, 1h
- */
- define( "CAPTCHA_DEFAULT_EXPIRATION_TIME", 3600 );
-
- /**
- * background folder and background default image
- */
- define( "CAPTCHA_BACKGROUND_FOLDER", PLOG_CLASS_PATH."imgs/authimage/" );
- define( "CAPTCHA_BACKGROUND_FILE", "sky.gif" );
- /**
- * change this to your default key, used for the "encryption"
- */
- define( "CAPTCHA_DEFAULT_KEY", "default-key" );
- /**
- * where you would like to store the images
- */
- define( "CAPTCHA_CACHE_FOLDER", "./tmp" );
- /**
- * default length of the code
- */
- define( "CAPTCHA_DEFAULT_CODE_LENGTH", 6 );
-
- /**
- * Class to generate CAPTCHA images, based on Mark Wu's AuthImage plugin.
- *
- * Usage:
- * <pre>
- * $auth = new Captcha();
- * $auth->generate();
- * ...
- * if( $auth->validate( $_POST["authImage"] )) {
- * // validation ok!
- * }
- * else {
- * // error in validation!
- * }
- * </pre>
- */
- class Captcha extends Object
- {
- function Captcha()
- {
- $this->Object();
-
- $this->key = CAPTCHA_DEFAULT_KEY;
- $this->cacheFolder = CAPTCHA_CACHE_FOLDER;
- $this->expiredTime = CAPTCHA_DEFAULT_EXPIRATION_TIME;
- $this->length = CAPTCHA_DEFAULT_CODE_LENGTH;
- }
-
- /**
- * @private
- */
- function encrypt($string, $key) {
- $plainText = $string.$key;
- $encodeText = md5($plainText);
- return $encodeText;
- }
-
- /**
- * @private
- */
- function generateCode() {
- $code = "";
- for($i=0; $i < $this->length; $i++) $code .= rand(0,9);
- return $code;
- }
-
- /**
- * generates a new image and returns the url
- *
- * @return a url to the captcha image
- */
- function generate()
- {
- // Delete those cached authimage files that never used
- $this->purgeOld($this->expiredTime);
-
- $code = $this->generateCode();
- $encrypt = $this->encrypt($code, $this->key);
- $background = CAPTCHA_BACKGROUND_FOLDER.CAPTCHA_BACKGROUND_FILE;
- $tempFile = $this->cacheFolder."/".$encrypt.".gif";
-
- if(function_exists ( 'imagecreatefromgif' )){
- $image = @imagecreatefromgif($background) or die("Cannot Initialize new GD image stream");
- }
- else if(function_exists ( 'imagecreatefrompng' )){
- $image = @imagecreatefrompng($background) or die("Cannot Initialize new GD image stream");
- }
- else {
- die("Server doesn't support GIF or PNG creation. Sorry.");
- }
-
- $textColor = imageColorAllocate($image, 0x00, 0x00, 0x00);
- ImageString($image, 5, 7, 2, $code, $textColor);
-
- if ( !function_exists ( 'ImageGIF' ) ) {
- ImagePNG($image, $tempFile);
- } else {
- ImageGIF($image, $tempFile);
- }
-
- // Now chmod it so it can be deleted later by the user
- chmod($tempFile, 0666);
-
- return( $tempFile );
- }
-
- /**
- * checks whether the given code validates with any of the authimages
- * previously generated
- *
- * @param code The code
- * @return True if the code is valid or false otherwise
- */
- function validate( $code )
- {
- include_once( PLOG_CLASS_PATH."class/file/file.class.php" );
- $encrypt = $this->encrypt($code, $this->key);
- $tempFile = $this->cacheFolder."/".$encrypt.".gif";
- $result = File::exists( $tempFile );
-
- return( $result );
- }
-
- /**
- * Removes the old captcha images that are not needed anymre
- *Ê@private
- */
- function purgeOld( $expireTime = CAPTCHA_DEFAULT_EXPIRATION_TIME )
- {
- include_once( PLOG_CLASS_PATH."class/misc/glob.class.php" );
- $files = Glob::myGlob( $this->cacheFolder, "*.gif" );
- if( $files ) {
- foreach( $files as $file ) {
- $diff = time() - filectime( $file );
- if ($diff > $expireTime)
- unlink( $file );
- }
- }
- }
- }
-?>
\ No newline at end of file
Copied: plog/trunk/class/data/captcha/captcha.class.php (from rev 2477, plog/branches/plog-1.0.2/class/data/captcha/captcha.class.php)
Modified: plog/trunk/class/data/mimetype.class.php
===================================================================
--- plog/trunk/class/data/mimetype.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/data/mimetype.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -213,7 +213,10 @@
"mxu" => "video/vnd.mpegurl",
"avi" => "video/x-msvideo",
"movie" => "video/x-sgi-movie",
- "ice" => "x-conference-xcooltalk"
+ "ice" => "x-conference-xcooltalk",
+ "wmv"=>"video/x-ms-wmv",
+ "wma"=>"audio/x-ms-wma",
+ "asf"=>"video/x-msvideo"
);
// default mime type returned if it could not be found
@@ -238,7 +241,8 @@
$filename = explode('.', $filename);
// take the last part of the file to get the file extension
- $filename = $filename[count($filename)-1];
+ $filename = $filename[count($filename)-1];
+
// find mime type
return $this->privFindType($filename);
@@ -252,6 +256,7 @@
function privFindType($ext) {
// return mime type for extension
if (isset($this->mimetypes[$ext])) {
+ // die($this->mimetypes[$ext]);
return $this->mimetypes[$ext];
// if the extension wasn't found return octet-stream
} else {
Modified: plog/trunk/class/data/plogcalendar.class.php
===================================================================
--- plog/trunk/class/data/plogcalendar.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/data/plogcalendar.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -89,7 +89,7 @@
if( $this->_dayPosts == null )
return "";
- if( $this->_dayPosts[$day] > 0 ) {
+ if( array_key_exists( $day, $this->_dayPosts) && $this->_dayPosts[$day] > 0 ) {
if( $day < 10 ) $day = "0".$day;
$date = "$year$month$day";
Copied: plog/trunk/class/data/utf8 (from rev 2477, plog/branches/plog-1.0.2/class/data/utf8)
Deleted: plog/trunk/class/data/utf8/utf8_funcs.php
===================================================================
--- plog/branches/plog-1.0.2/class/data/utf8/utf8_funcs.php 2005-09-18 21:06:33 UTC (rev 2477)
+++ plog/trunk/class/data/utf8/utf8_funcs.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -1,190 +0,0 @@
-<?php
-
-/**
- * utf8 interrelated functions
- * @autor CB
- * @email cb.utblog at gmail.com
- * @homepage http://www.utblog.com/plog/CB
- * @date 25 Jul 2005
- */
-
-/**
- * int utf8_isValidChar(string $inputStr, $start = 0)
- * Is it a valid utf8 character
- * @param $inputStr input string
- * @param $start start index
- * @return the ascii bytes of the utf8 char if it is a valid utf8 char. 0 if input array is empty, or -1 if it's invalid
- * @note don't use pass-by-reference for $inArr here, otherwise efficiency will decreased significantly
- * @note change param $inArr from char array to string ($inputStr), for porformance purpose.
- * @note preg_split consumes too much memory and cpu when split a big string to char array
- */
-function utf8_isValidChar($inputStr, $start = 0)
-{
- $size = strlen($inputStr);
- if($size <=0 || $start < 0 || $size <= $start) return 0;
-
- $inOrd = ord($inputStr{$start});
- $us = 0;
- if($inOrd <= 0x7F) { //0xxxxxxx
- return 1;
- } else if($inOrd >= 0xC0 && $inOrd <= 0xDF ) { //110xxxxx 10xxxxxx
- $us = 2;
- } else if($inOrd >= 0xE0 && $inOrd <= 0xEF ) { //1110xxxx 10xxxxxx 10xxxxxx
- $us = 3;
- } else if($inOrd >= 0xF0 && $inOrd <= 0xF7 ) { //11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
- $us = 4;
- } else if($inOrd >= 0xF8 && $inOrd <= 0xFB ) { //111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
- $us = 5;
- } else if($inOrd >= 0xFC && $inOrd <= 0xFD ) { //1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx
- $us = 6;
- } else
- return -1;
-
- if($size - $start < $us)
- return -1;
-
- for($i=1; $i<$us; $i++)
- {
- $od = ord($inputStr{$start+$i});
- if($od <0x80 || $od > 0xBF)
- return -1;
- }
- return $us;
-}
-
-/**
- * mix utf8_substr(string $inputString, int $start_index, int $length = -1, bool $ignore_invalid_utf8_char = true)
- * @param $inputStr
- * @param $start start index, must be large than 0
- * @param $length. if $length <0, return all text begin from $start
- * @param $ignore_error whether ignore the invalid characters (in return string, these invalid chars will be replaced with '?') or not. default is true (ignore)
- * @return the substring, or false (empty string '')
- */
-function utf8_substr($inputStr, $start, $length = -1, $ignore_error = true)
-{
- if($start<0 || $length == 0)
- return false;
- //discard preg_split function. it consumes too much system resource when it tries to split a big string to pieces
- //$rawArr = preg_split('//',$inputStr,-1, PREG_SPLIT_NO_EMPTY);
- //find start
- $si = 0;
- $si_single = 0;
- while($si < $start)
- {
- $hm = utf8_isValidChar($inputStr, $si_single);
- if($hm == -1)
- {
- //ignore invalid character?
- if(!$ignore_error)
- return false;
- //array_shift is very slow
- //array_shift($rawArr);
- $si++;
- $si_single++;
- }
- else if($hm == 0)
- {
- //$start is bigger than the utf8_length of inputString
- return false;
- }
- else
- {
- //for($i=0; $i<$hm; $i++) array_shift($rawArr);
- $si++;
- $si_single += $hm;
- }
- }
- if($length < 0)
- //return implode('', $rawArr);
- return substr($inputStr, $si_single);
- $retArr = array();
- $li = 0;
- while($li < $length)
- {
- $hm = utf8_isValidChar($inputStr, $si_single);
- if($hm == -1)
- {
- if(!$ignore_error)
- return false;
- $retArr[] = '?';
- //array_shift($rawArr);
- $li++;
- $si_single++;
- }
- else if($hm == 0)
- {
- //end of string
- return implode('', $retArr);
- }
- else
- {
- //for($i=0; $i<$hm; $i++) $retArr[] = array_shift($rawArr);
- for($i=0; $i<$hm; $i++) $retArr[] = $inputStr{$si_single++};
- $li++;
- }
- }
- return implode('', $retArr);
-}
-
-/**
- * int utf8_strlen(string $inputString, bool $ignore_invalid_utf8_char = true)
- * @return length of string encoded as utf8 ( how many utf8 characters )
- * -1 if given $ignore_error is false and there's invalid utf8 char in the inputString
- * @note if $ignore_error is true (the default value), every invalid utf8 character will be count as ONE utf8 char
- */
-function utf8_strlen($inputStr, $ignore_error = true)
-{
- //$rawArr = preg_split('//',$inputStr,-1, PREG_SPLIT_NO_EMPTY);
- $len = 0;
- $si_single = 0;
- while(($hm = utf8_isValidChar($inputStr, $si_single)) != 0)
- {
- if($hm == -1)
- {
- if(!$ignore_error)
- return -1;
- //array_shift($rawArr);
- $si_single++;
- }
- else
- //for($i=0; $i<$hm; $i++) array_shift($rawArr);
- $si_single += $hm;
- $len++;
- }
- return $len;
-}
-
-/**
- * int utf8_proportion(string $inputString)
- * @param $inputString
- * @return percentage of valid utf8 chars of $inputString
- * @see http://www.utblog.com/plog/1/article/292
- */
-function utf8_proportion($inputStr)
-{
- //$rawArr = preg_split('//',$inputStr,-1, PREG_SPLIT_NO_EMPTY);
- //$rawLen = count($rawArr);
- $rawLen = strlen($inputStr);
- if($rawLen == 0)
- return 100;
- $validChars = 0;
- $si_single = 0;
- while(($hm = utf8_isValidChar($inputStr, $si_single)) != 0)
- {
- if($hm == -1)
- {
- //array_shift($rawArr);
- $si_single++;
- continue;
- }
- //for($i=0; $i<$hm; $i++) array_shift($rawArr);
- $validChars += $hm;
- $si_single += $hm;
- }
- if($validChars == $rawLen)
- return 100;
- else
- return (int)($validChars*100.0/$rawLen);
-}
-
-?>
Copied: plog/trunk/class/data/utf8/utf8_funcs.php (from rev 2477, plog/branches/plog-1.0.2/class/data/utf8/utf8_funcs.php)
Modified: plog/trunk/class/gallery/dao/galleryalbums.class.php
===================================================================
--- plog/trunk/class/gallery/dao/galleryalbums.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/gallery/dao/galleryalbums.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -264,9 +264,8 @@
$albums["$key"][] = $album;
$ids[] = $album->getId();
}
- }
-
- return $albums;
+ }
+ return $albums;
}
/**
@@ -297,7 +296,7 @@
function _getNestedAlbumList( $albums, $start = 0, $level = -1 )
{
$level++;
- if( $albums["$start"] == "" )
+ if( !array_key_exists( $start, $albums ) || $albums["$start"] == "" )
return Array();
foreach( $albums["$start"] as $album ) {
Modified: plog/trunk/class/gallery/dao/galleryresource.class.php
===================================================================
--- plog/trunk/class/gallery/dao/galleryresource.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/gallery/dao/galleryresource.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -32,6 +32,7 @@
var $_metadata;
var $_album;
var $_thumbnailFormat;
+ var $_fileDescriptor;
/**
* Constructor.
@@ -90,6 +91,7 @@
"properties" => "getProperties",
"metadata" => "getMetadata"
);
+ $this->_fileDescriptor = false;
}
/**
@@ -229,6 +231,49 @@
return $this->_getData( $fileName );
}
+
+ /**
+ * returns a buffer of bytes limited to $chunkSize in bytes from
+ * the file descriptor provided
+ *
+ * @return a buffer of bytes from the file or false if empty or error
+ */
+ function &_getDataChunk(&$filedesc,$chunkSize)
+ {
+ if (feof($filedesc) || !$filedesc)
+ {
+ /* finished reading file */
+ if (feof($filedesc))
+ fclose($filedesc);
+
+ return false;
+ }
+ else
+ {
+ /* return $chunksize of bytes */
+ return fread($filedesc,$chunkSize);
+ }
+ }
+
+ function &getDataChunk($chunksize)
+ {
+ if (!$this->_fileDescriptor)
+ {
+ $fileParts = explode(".",$this->getFileName());
+ $fileExt = $fileParts[count($fileParts)-1];
+ $resourceStorageFolder =
+ GalleryResourceStorage::getResourcesStorageFolder();
+ $fileName = $resourceStorageFolder.$this->getOwnerId().
+ "/".$this->getOwnerId()."-".$this->getId().".".$fileExt;
+
+ /* store this for use again */
+ $this->_fileDescriptor = @fopen($fileName,"rb");
+ /* open failed... we'll just say empty file */
+ if (!$this->_fileDescriptor)
+ return false;
+ }
+ return $this->_getDataChunk($this->_fileDescriptor,$chunksize);
+ }
/**
* Sets the album id. You should normally not need to use this method
Modified: plog/trunk/class/gallery/dao/galleryresources.class.php
===================================================================
--- plog/trunk/class/gallery/dao/galleryresources.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/gallery/dao/galleryresources.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -57,7 +57,7 @@
"mpg" => GALLERY_RESOURCE_VIDEO,
"mpeg" => GALLERY_RESOURCE_VIDEO,
"wmv" => GALLERY_RESOURCE_VIDEO,
- "asf" => GALLERY_RESOURCE_VIDEO,
+ //"asf" => GALLERY_RESOURCE_VIDEO,
"mov" => GALLERY_RESOURCE_VIDEO,
"divx" => GALLERY_RESOURCE_VIDEO,
"rm" => GALLERY_RESOURCE_VIDEO,
@@ -243,23 +243,6 @@
}
/**
- * @private
- * finds out the right resource type for a given file upload
- */
- function getResourceType( $fileName )
- {
- // get the resource type
- $fileParts = explode( ".", $fileName );
- $fileExt = strtolower($fileParts[count($fileParts)-1]);
- if( array_key_exists( $fileExt, $this->_extensionToType ))
- $resourceType = $this->_extensionToType[ $fileExt ];
- else
- $resourceType = GALLERY_RESOURCE_UNKNOWN;
-
- return $resourceType;
- }
-
- /**
* Adds a row related to a resource to the database. You should usually use
* GalleryResources::addResource() or GalleryResources::addResourceFromDisk(), which are more
* suitable and will do most of the job for you.
@@ -337,6 +320,99 @@
return $resourceId;
}
+ /**
+ * generates the thumbnail of a file that we have just added.
+ *
+ * @param resFile the resource file from which we're trying to generate the
+ * thubmail.
+ * @param fileName The name and path of the new thumbnail we're going to create
+ */
+ function generateResourceThumbnail( $resFile, $resourceId, $ownerId )
+ {
+ // get some configuration settings regarding the size of the
+ // thumbnails, and also the default format for thumbnails
+ $config =& Config::getConfig();
+ $previewHeight = $config->getValue( "thumbnail_height", GALLERY_DEFAULT_THUMBNAIL_HEIGHT );
+ $previewWidth = $config->getValue( "thumbnail_width", GALLERY_DEFAULT_THUMBNAIL_WIDTH );
+ $previewKeepAspectRatio = $config->getValue( "thumbnails_keep_aspect_ratio" );
+
+ // get the file extension
+ $fileParts = explode( ".", $resFile );
+ $fileExt = strtolower($fileParts[count($fileParts)-1]);
+ $fileName = $ownerId."-".$resourceId.".".$fileExt;
+
+ // and start the resizing process
+ $resizer = new GalleryResizer( $resFile );
+ GalleryResourceStorage::checkPreviewsStorageFolder( $ownerId );
+ $outFile = GalleryResourceStorage::getPreviewsFolder( $ownerId ).$fileName;
+
+ // and finally, we can generate the preview!
+ $result = $resizer->generate( $outFile, $previewWidth, $previewHeight, $previewKeepAspectRatio );
+
+ return $result;
+ }
+
+ /**
+ * generates the medium-sized thumbnail of a file that we have just added
+ *
+ * @param resFile the resource file from which we're trying to generate the
+ * thubmail.
+ * @param fileName The name and path of the new thumbnail we're going to create
+ */
+ function generateResourceMediumSizeThumbnail( $resFile, $resourceId, $ownerId )
+ {
+ // get some configuration settings regarding the size of the
+ // thumbnails, and also the default format for thumbnails
+ $config =& Config::getConfig();
+ $previewHeight = $config->getValue( "medium_size_thumbnail_height", GALLERY_DEFAULT_MEDIUM_SIZE_THUMBNAIL_HEIGHT );
+ $previewWidth = $config->getValue( "medium_size_thumbnail_width", GALLERY_DEFAULT_MEDIUM_SIZE_THUMBNAIL_WIDTH );
+ $previewKeepAspectRatio = $config->getValue( "thumbnails_keep_aspect_ratio" );
+
+ // get the file extension
+ $fileParts = explode( ".", $resFile );
+ $fileExt = strtolower($fileParts[count($fileParts)-1]);
+ $fileName = $ownerId."-".$resourceId.".".$fileExt;
+
+ // and start the resizing process
+ $resizer = new GalleryResizer( $resFile );
+ GalleryResourceStorage::checkMediumSizePreviewsStorageFolder( $ownerId );
+ $outFile = GalleryResourceStorage::getMediumSizePreviewsFolder( $ownerId ).$fileName;
+
+ // and finally, we can generate the preview!
+ $result = $resizer->generate( $outFile, $previewWidth, $previewHeight, $previewKeepAspectRatio );
+
+ return $result;
+ }
+
+ /**
+ * @private
+ * @param fileName
+ * @param metadata
+ */
+ function _getResourceType( $fileName, &$metadata )
+ {
+ // find out the right resource type based on the extension
+ // get the resource type
+ $fileParts = explode( ".", $fileName );
+ $fileExt = strtolower($fileParts[count($fileParts)-1]);
+
+ //asf need special working
+ if ("asf" == $fileExt ){
+ if (!($metadata["audio"]["codec"]))
+ $resourceType = GALLERY_RESOURCE_SOUND;
+ else
+ $resourceType = GALLERY_RESOURCE_VIDEO;
+ }
+ else {
+ if( array_key_exists( $fileExt, $this->_extensionToType ))
+ $resourceType = $this->_extensionToType[ $fileExt ];
+ else
+ $resourceType = GALLERY_RESOURCE_UNKNOWN;
+ }
+
+ return( $resourceType );
+ }
+
/**
* adds a resource to the database. This method requires a FileUpload parameter and it
* will take care of processing the upload file and so on. If the file is already in disk and we'd
@@ -383,18 +459,21 @@
include_once( PLOG_CLASS_PATH."class/gallery/getid3/getid3.php" );
$getId3 = new GetID3();
$metadata = $getId3->analyze( $upload->getTmpName());
-
- // find out the right resource type based on the extension
- $resourceType = $this->getResourceType( $upload->getFileName());
-
+ // nifty helper method from the getid3 package
+ getid3_lib::CopyTagsToComments($metadata);
+
+ $resourceType = $this->_getResourceType( $upload->getFileName(), $metadata );
+
// set the flags
$flags = 0;
if( $resourceType == GALLERY_RESOURCE_IMAGE )
$flags = $flags|GALLERY_RESOURCE_PREVIEW_AVAILABLE;
-
+
+ $info = $this->_filterMetadata( $metadata, $resourceType );
+
// add the record to the database
$fileName = $upload->getFileName();
- $resourceId = $this->addResourceToDatabase( $ownerId, $albumId, $description, $flags, $resourceType, $filePath, $fileName, $metadata );
+ $resourceId = $this->addResourceToDatabase( $ownerId, $albumId, $description, $flags, $resourceType, $filePath, $fileName, $info );
if( !$resourceId )
return false;
@@ -427,6 +506,53 @@
}
/**
+ * @private
+ * Returns an array with only those bits of metadata as generate by getid3 that
+ * we'd like to keep, instead of one huge array
+ *
+ * @param metadata
+ * @param resourceType
+ */
+ function _filterMetadata( &$metadata, $resourceType )
+ {
+ $info = Array();
+ $info["md5_file"] = $metadata["md5_file"];
+ $info["md5_data"] = $metadata["md5_data"];
+ $info["filesize"]= $metadata["filesize"];
+ $info["fileformat"] = $metadata["fileformat"];
+ $info["comments"] = $metadata["comments"];
+
+ if($resourceType == GALLERY_RESOURCE_IMAGE){
+ $info["video"] = $metadata["video"];
+ $info["jpg"]["exif"]["FILE"] = $metadata["jpg"]["exif"]["FILE"];
+ $info["jpg"]["exif"]["COMPUTED"] = $metadata["jpg"]["exif"]["COMPUTED"];
+ $info["jpg"]["exif"]["IFD0"] = $metadata["jpg"]["exif"]["IFD0"];
+ $metadata["jpg"]["exif"]["EXIF"]["MakerNote"] = "";
+ $info["jpg"]["exif"]["EXIF"] = $metadata["jpg"]["exif"]["EXIF"];
+ }
+ else if($resourceType == GALLERY_RESOURCE_SOUND){
+ $info["audio"] = $metadata["audio"];
+ $info["playtime_string"] = $metadata["playtime_string"];
+ $info["playtime_seconds"] = $metadata["playtime_seconds"];
+ }
+ else if($resourceType == GALLERY_RESOURCE_VIDEO){
+ $info["video"] = $metadata["video"];
+ $info["audio"] = $metadata["audio"];
+ $info["playtime_seconds"] = $metadata["playtime_seconds"];
+ $info["playtime_string"] = $metadata["playtime_string"];
+ }
+ else if( $resourceType == GALLERY_RESOURCE_ZIP ) {
+ $info["zip"]["compressed_size"] = $metadata["zip"]["compressed_size"];
+ $info["zip"]["uncompressed_size"] = $metadata["zip"]["uncompressed_size"];
+ $info["zip"]["entries_count"] = $metadata["zip"]["entries_count"];
+ $info["zip"]["copmression_method"] = $metadata["zip"]["copmression_method"];
+ $info["zip"]["compression_speed"] = $metadata["zip"]["compression_speed"];
+ }
+
+ return( $info );
+ }
+
+ /**
* adds a resource to the gallery when the resource is already stored on disk, instead of
* it coming from an upload as it usually happens. This method is better than
* GalleryResources::addResource() when instead of dealing with uploaded files, the file
@@ -461,10 +587,12 @@
include_once( PLOG_CLASS_PATH."class/gallery/getid3/getid3.php" );
$getId3 = new GetID3();
$metadata = $getId3->analyze( $fullFilePath );
+ // nifty helper method from the getid3 package
+ getid3_lib::CopyTagsToComments($metadata);
- // find out the right resource type based on the extension
- $resourceType = $this->getResourceType( $fileName );
-
+ $resourceType = $this->_getResourceType( $fullFilePath, $metadata );
+ $info = $this->_filterMetadata( $metadata, $resourceType );
+
// set the flags
$flags = 0;
if( $resourceType == GALLERY_RESOURCE_IMAGE )
@@ -613,6 +741,13 @@
$row["date"],
$row["thumbnail_format"],
$row["id"] );
+
+ // we should also try to get some information about
+ // to which album this resource belongs
+ $album = $this->albums->getAlbum( $row["album_id"], $row["owner_id"], false );
+ $res->setAlbum( $album );
+ // print_r(unserialize($row["metadata"]));
+
return $res;
}
}
Modified: plog/trunk/class/gallery/data/galleryresourcezipmetadatareader.class.php
===================================================================
--- plog/trunk/class/gallery/data/galleryresourcezipmetadatareader.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/gallery/data/galleryresourcezipmetadatareader.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -14,16 +14,6 @@
$this->GalleryResourceBaseMetadataReader( $resource );
}
- /**
- * Returns an array with the name of the files insize the zip archive
- *
- * @return Array of strings.
- */
- function getFiles()
- {
- return $this->_metadata["zip"]["files"];
- }
-
/**
* returns the total compressed size of this file
*
Modified: plog/trunk/class/gallery/galleryconstants.php
===================================================================
--- plog/trunk/class/gallery/galleryconstants.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/gallery/galleryconstants.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -9,7 +9,7 @@
* These are the different resource types that we can recognize.
* They are very broad groups, tho.
*/
- define( "GALLERY_TYPE_RESOURCE_ANY", 0 );
+ define( "GALLERY_RESOURCE_ANY", 0 );
define( "GALLERY_RESOURCE_IMAGE", 1 );
define( "GALLERY_RESOURCE_VIDEO", 2 );
define( "GALLERY_RESOURCE_SOUND", 3 );
Modified: plog/trunk/class/gallery/resizers/galleryimagemagickresizer.class.php
===================================================================
--- plog/trunk/class/gallery/resizers/galleryimagemagickresizer.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/gallery/resizers/galleryimagemagickresizer.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -35,7 +35,7 @@
$convertPath = $config->getValue( "path_to_convert", DEFAULT_PATH_TO_CONVERT );
// run the command
$command = $convertPath." -geometry ".$width."x".$height." ".$this->_image." ".$outFile;
- $cmdOuput = system($command, $retval);
+ $cmdOutput = system($command, $retval);
// check if there was an error creating the thubmnail
if($cmdOutput === FALSE || $retval )
Modified: plog/trunk/class/locale/locale.class.php
===================================================================
--- plog/trunk/class/locale/locale.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/locale/locale.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -114,7 +114,13 @@
if( File::isReadable( $fileName ))
include( $fileName );
- $this->_messages = $messages;
+ // The following is just to handle the case where there isn't
+ // a valid local file.
+ if ( !isset($messages) || !is_array( $messages ) )
+ {
+ $messages = array();
+ }
+ $this->_messages = $messages;
unset($messages);
@@ -426,9 +432,9 @@
*
* @return A string with the ordinal representation of the day.
*/
- function getDayOrdinal( $t )
+ function getDateOrdinal( $date )
{
- $dayOrdinal = $t->getDay();
+ $dayOrdinal = $date;
$last_digit = substr( $dayOrdinal, -1 );
if( $dayOrdinal < 10 )
$dayOrdinal = $last_digit;
@@ -442,12 +448,19 @@
$dayOrdinal .= "."; break;
case "en":
default:
- $dayOrdinal = $this->_getOrdinal( $t->getDay()); break;
+ $dayOrdinal = $this->_getOrdinal( $date); break;
}
return $dayOrdinal;
- }
+ }
+ function getDayOrdinal( $t )
+ {
+ $dayOrdinal = $t->getDay();
+ return $this->getDateOrdinal( $dayOrdinal );
+ }
+
+
/**
* Formats the date of a Timestamp object according to the given format:
*
@@ -467,6 +480,7 @@
* <li>%S seconds</li>
* <li>%y 2-digit year representation</li>
* <li>%Y 4-digit year representation</li>
+ * <li>%O Difference to Greenwich time (GMT) in hours</li>
* <li>%% the '%' character
* </ul>
* (these have been added by myself and are therefore incompatible with php)<ul>
@@ -474,7 +488,7 @@
* <li>%D cardinal representation of the day</li>
* </ul>
*/
- function formatDate( $timeStamp, $format = null )
+ function formatDate( $timeStamp, $format = null, $blog = null )
{
// load the file if it hadn't been loaded yet
if( !is_array($this->_messages))
@@ -488,13 +502,46 @@
// and the same for the weekdays
$weekdayId = $timeStamp->getWeekdayId();
$weekday = $this->_messages["days"][$weekdayId];
+
+
+ // Get the time stamp string
+ $strTimeStamp = $timeStamp->getTimestamp();
+ //Convert this to a php timestamp.
+ $time = mktime(
+ substr($strTimeStamp,8,2),
+ substr($strTimeStamp,10,2),
+ substr($strTimeStamp,12,2),
+ substr($strTimeStamp,4,2),
+ substr($strTimeStamp,6,2),
+ substr($strTimeStamp,0,4)
+ );
+
+ // Get the time zone offset for the server, on the specified date
+ $timeZoneSec = date("Z", $time);
+ if ( $blog ) {
+ //
+ // The blog was specified. Use it to get the time offset
+ //
+ $timeDiff = 0;
+ $blogSettings = $blog->getSettings();
+ $timeDiff = $blogSettings->getValue( 'time_offset' );
+
+ // The following line relies on the fact that the result will
+ // be an int.
+ $timeZoneSec += ( $timeDiff * 3600 );
+ }
+ // Now convert the time zone seconds to hours and minutes
+ $timeZoneHours = intval( abs($timeZoneSec) / 3600 );
+ $timeZoneMins = intval(( abs($timeZoneSec) % 3600 ) / 60 );
+ $timeZoneDirection = ($timeZoneSec < 0 ) ? "-" : "+";
+
// if the user did not specify a format, let's use the default one
if( $format == null )
$format = $this->_dateFormat;
// now we can continue normally
- $values["%a"] = function_exists('html_entity_decode') ? htmlentities(substr(html_entity_decode($weekday), 0, 3 )) : substr($weekday, 0, 2 );
+ $values["%a"] = function_exists('html_entity_decode') ? htmlentities(substr(html_entity_decode($weekday), 0, 3 )) : substr($weekday, 0, 3 );
$values["%A"] = $weekday;
$values["%b"] = function_exists('html_entity_decode') ? htmlentities(substr(html_entity_decode($monthStr), 0, 3 )) : substr($monthStr, 0, 3);
$values["%B"] = $monthStr;
@@ -510,6 +557,7 @@
$values["%S"] = $timeStamp->getSeconds();
$values["%y"] = substr($timeStamp->getYear(), 2, 4 );
$values["%Y"] = $timeStamp->getYear();
+ $values["%O"] = sprintf( "%s%02d%02d", $timeZoneDirection, $timeZoneHours, $timeZoneMins );
$values["%%"] = "%";
$values["%T"] = $this->getDayOrdinal( $timeStamp )." ".$this->tr("of")." ".$monthStr;
$values["%D"] = $this->getDayOrdinal( $timeStamp );
@@ -532,6 +580,127 @@
return $text;
}
+ /**
+ * Formats the date of a Timestamp object according to the given format:
+ * This function assumes that the timestamp is local and it converts it
+ * to GMT before formatting.
+ *
+ * (compatible with PHP):<ul>
+ * <li>%a abbreviated weekday</li>
+ * <li>%A complete weekday</li>
+ * <li>%b abbreviated month</li>
+ * <li>%B long month</li>
+ * <li>%d day of the month, 2 digits with leading zero</li>
+ * <li>%j day of the month, numeric (without leading zero)</li>
+ * <li>%H hours, in 24-h format</li>
+ * <li>%I hours, in 12-h format (without leading zero)</li>
+ * <li>%p returns 'am' or 'pm'</li>
+ * <li>%P returns 'AM' or 'PM'</li>
+ * <li>%M minutes</li>
+ * <li>%m month number, from 00 to 12</li>
+ * <li>%S seconds</li>
+ * <li>%y 2-digit year representation</li>
+ * <li>%Y 4-digit year representation</li>
+ * <li>%O Difference to Greenwich time (GMT) in hours (Will always be +0000)</li>
+ * <li>%% the '%' character
+ * </ul>
+ * (these have been added by myself and are therefore incompatible with php)<ul>
+ * <li>%T "_day_ of _month_", where the day is in ordinal form and 'month' is the name of the month</li>
+ * <li>%D cardinal representation of the day</li>
+ * </ul>
+ */
+ function formatDateGMT( $timeStamp, $format = null, $blog = null )
+ {
+ // load the file if it hadn't been loaded yet
+ if( !is_array($this->_messages))
+ $this->_loadLocaleFile();
+
+ if ( $blog ) {
+ //
+ // The blog was specified. Use it to get the time offset
+ //
+ $timeDiff = 0;
+ $blogSettings = $blog->getSettings();
+ $timeDiff = $blogSettings->getValue( 'time_offset' );
+ $timeDiff *= -1;
+
+ if( $timeDiff > 0 )
+ $timeStamp->addSeconds( $timeDiff * 3600 );
+ else
+ $timeStamp->subtractSeconds( $timeDiff * (-3600));
+
+ }
+ // Convert this timestamp to on that is in GMT
+ $strTimeStamp = $timeStamp->getTimestamp();
+ // Now have a local time stamp
+ // Is this step really necessary, since we previously had a time stamp
+ $time = mktime(
+ substr($strTimeStamp,8,2),
+ substr($strTimeStamp,10,2),
+ substr($strTimeStamp,12,2),
+ substr($strTimeStamp,4,2),
+ substr($strTimeStamp,6,2),
+ substr($strTimeStamp,0,4)
+ );
+
+ // This does not take into account the time offset that the user
+ // specified, since we are converting the time to GMT. Since the
+ // offset is just used to handle time zone differences, it is not
+ // necessary, as the time GMT is still the same.
+
+ // timestamp only returns the values in english, so we should translate
+ // them before using
+ $monthId = gmdate( "n", $time );
+ $monthStr = $this->_messages["months"][$monthId-1];
+ //print("monthstr: $monthStr");
+ // and the same for the weekdays
+ $weekdayId = gmdate( "w", $time );
+ $weekday = $this->_messages["days"][$weekdayId];
+
+ // if the user did not specify a format, let's use the default one
+ if( $format == null )
+ $format = $this->_dateFormat;
+
+ // now we can continue normally
+ $values["%a"] = function_exists('html_entity_decode') ? htmlentities(substr(html_entity_decode($weekday), 0, 3 )) : substr($weekday, 0, 3 );
+ $values["%A"] = $weekday;
+ $values["%b"] = function_exists('html_entity_decode') ? htmlentities(substr(html_entity_decode($monthStr), 0, 3 )) : substr($monthStr, 0, 3);
+ $values["%B"] = $monthStr;
+ $values["%d"] = gmdate( "d", $time );
+ $values["%e"] = intval(gmdate( "d", $time ));
+ $values["%j"] = gmdate( "j", $time );
+ $values["%H"] = gmdate( "H", $time );
+ $values["%I"] = gmdate( "g", $time );
+ $values["%p"] = gmdate( "a", $time );
+ $values["%P"] = gmdate( "A", $time );
+ $values["%M"] = gmdate( "i", $time );
+ $values["%m"] = gmdate( "m", $time );
+ $values["%S"] = gmdate( "s", $time );
+ $values["%y"] = gmdate( "y", $time );
+ $values["%Y"] = gmdate( "Y", $time );
+ $values["%O"] = "+0000";
+ $values["%%"] = "%";
+ $values["%T"] = $this->getDateOrdinal( gmdate( "d", $time ) )." ".$this->tr("of")." ".$monthStr;
+ $values["%D"] = $this->getDateOrdinal( gmdate( "d", $time ) );
+ /* Start Hack By FiFtHeLeMeNt For Persian Language */
+ list( $jyear, $jmonth, $jday ) = JalaliCalendar::gregorian_to_jalali(gmdate( "Y", $time ), gmdate( "m", $time ), gmdate( "d", $time ));
+ $values["%q"] = JalaliCalendar::Convertnumber2farsi($jyear);
+ $values["%w"]= JalaliCalendar::Convertnumber2farsi($jmonth);
+ $values["%o"] = JalaliCalendar::Convertnumber2farsi($jday);
+ $values["%R"] = JalaliCalendar::monthname($jmonth);
+ $values["%T"] = JalaliCalendar::Convertnumber2farsi(gmdate( "H", $time ));
+ $values["%U"] = JalaliCalendar::Convertnumber2farsi(gmdate( "i", $time ));
+ /* End Hack By FiFtHeLeMeNt For Persian Language */
+
+ $text = $format;
+ foreach( array_keys($values) as $key ) {
+ if( ereg($key, $text) )
+ $text = str_replace( $key, $values[$key], $text );
+ }
+
+ return $text;
+ }
+
/**
* merges two locales
*/
Modified: plog/trunk/class/locale/locales.class.php
===================================================================
--- plog/trunk/class/locale/locales.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/locale/locales.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -88,7 +88,9 @@
}
// merge the plugin locale with the big locale
- $locale->mergeLocale( $pluginLocale );
+ if ( isset( $pluginLocale ) ) {
+ $locale->mergeLocale( $pluginLocale );
+ }
}
}
Modified: plog/trunk/class/locale/pluginlocale.class.php
===================================================================
--- plog/trunk/class/locale/pluginlocale.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/locale/pluginlocale.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -46,8 +46,18 @@
{
$fileName = PLOG_CLASS_PATH."plugins/".$this->_pluginId."/locale/locale_".$this->_code.".php";
- include( $fileName );
-
+ if( File::isReadable( $fileName ))
+ {
+ include( $fileName );
+ }
+
+ // The following is just to handle the case where a plugin doesn't
+ // have a valid local file.
+ if ( !isset($messages) || !is_array( $messages ) )
+ {
+ $messages = array();
+ }
+
$this->_messages = $messages;
}
}
Modified: plog/trunk/class/net/customrequestgenerator.class.php
===================================================================
--- plog/trunk/class/net/customrequestgenerator.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/net/customrequestgenerator.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -94,6 +94,7 @@
$ownerInfo = $this->_blogInfo->getOwnerInfo();
// this is quite a dirty one but it works...
+ $newDate = $date;
if( strlen($date) == 6 ) $newDate = $date."00000000";
if( strlen($date) == 8 ) $newDate = $date."000000";
$t = new Timestamp( $newDate );
Modified: plog/trunk/class/net/customurlhandler.class.php
===================================================================
--- plog/trunk/class/net/customurlhandler.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/net/customurlhandler.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -58,19 +58,18 @@
"resource_download_link_format" => $path.$config->getValue( "resource_download_link_format" ),
"resource_preview_link_format" => $path.$config->getValue( "resource_preview_link_format" ),
"resource_medium_size_preview_link_format" => $path.$config->getValue( "resource_medium_size_preview_link_format" ));
-
// if the url did not match any of the current settings, then let's try to parse it as an old
// "search engine friendly" url
- $this->_fallback = Array( "permalink_format" => "/post/{blogid}/{postid}",
- "category_link_format" => "/category/{$blogid}/{postid}",
- "blog_link_format" => "/blogid}",
- "archive_link_format" => "/archives/{blogid}/{year}/{month}/{day}",
- "user_posts_link_format" => "/user/{blogid}/{userid}",
- "post_trackbacks_link_format" => "/trackbacks/{blogid}/{postid}",
- "template_link_format" => "/static/{blogid}/{templatename}",
- "album_link_format" => "/album/{blogid}/{albumid}",
- "resource_link_format" => "/resource/{blogid}/{resourceid}",
- "resource_download_link_format" => "/get/{blogid}/{resourceid}",
+ $this->_fallback = Array( "permalink_format" => $path."/post/{blogid}/{postid}",
+ "category_link_format" => $path."/category/{blogid}/{catid}",
+ "blog_link_format" => $path."/{blogid}",
+ "archive_link_format" => $path."/archives/{blogid}/{year}/{month}/{day}",
+ "user_posts_link_format" => $path."/user/{blogid}/{userid}",
+ "post_trackbacks_link_format" => $path."/trackbacks/{blogid}/{postid}",
+ "template_link_format" => $path."/static/{blogid}/{templatename}",
+ "album_link_format" => $path."/album/{blogid}/{albumid}",
+ "resource_link_format" => $path."/resource/{blogid}/{resourceid}",
+ "resource_download_link_format" => $path."/get/{blogid}/{resourceid}",
"resource_preview_link_format" => "", // this one does not exist
"resource_medium_size_preview_link_format" => "" ); // this one does not exist either
}
@@ -79,7 +78,6 @@
{
// decode the string, since it seems that php will not do it for us in this case...
$requestUri = urldecode( $requestUri);
-
// we should remove anything that comes after a '?' parameter, since we don't want to take
// HTTP GET parameters into account
if(( $pos = strpos( $requestUri, '?' ))) {
@@ -112,7 +110,24 @@
$matched = true;
if( $this->_format == "permalink_format" ) {
$this->_includeFile = $this->_indexName;
- $this->_params["date"] = $this->_params["year"].$this->_params["month"].$this->_params["day"].$this->_params["hours"].$this->_params["minutes"];
+ if ( array_key_exists( "year", $this->_params ) )
+ {
+ $this->_params["date"] = $this->_params["year"];
+ if( array_key_exists( "month", $this->_params ) )
+ {
+ $this->_params["date"] .= $this->_params["month"];
+ if( array_key_exists( "day", $this->_params ) )
+ {
+ $this->_params["date"] .= $this->_params["day"];
+ if ( array_key_exists( "hours", $this->_params ) )
+ {
+ $this->_params["date"] .= $this->_params["hours"];
+ if( array_key_exists( "minutes", $this->_params ) )
+ $this->_params["date"] .= $this->_params["minutes"];
+ }
+ }
+ }
+ }
$this->_params["op"] = "ViewArticle";
$this->_vars = Array( "postid" => "articleId",
"postname" => "articleName",
@@ -143,7 +158,24 @@
}
elseif( $this->_format == "archive_link_format" ) {
$this->_includeFile = $this->_indexName;
- $this->_params["date"] = $this->_params["year"].$this->_params["month"].$this->_params["day"].$this->_params["hours"].$this->_params["minutes"];
+ if ( array_key_exists( "year", $this->_params ) )
+ {
+ $this->_params["date"] = $this->_params["year"];
+ if( array_key_exists( "month", $this->_params ) )
+ {
+ $this->_params["date"] .= $this->_params["month"];
+ if( array_key_exists( "day", $this->_params ) )
+ {
+ $this->_params["date"] .= $this->_params["day"];
+ if ( array_key_exists( "hours", $this->_params ) )
+ {
+ $this->_params["date"] .= $this->_params["hours"];
+ if( array_key_exists( "minutes", $this->_params ) )
+ $this->_params["date"] .= $this->_params["minutes"];
+ }
+ }
+ }
+ }
$this->_params["op"] = "Default";
$this->_vars = Array( "blogid" => "blogId",
"blogname" => "blogName",
@@ -152,7 +184,24 @@
}
elseif( $this->_format == "user_posts_link_format" ) {
$this->_includeFile = $this->_indexName;
- $this->_params["date"] = $this->_params["year"].$this->_params["month"].$this->_params["day"].$this->_params["hours"].$this->_params["minutes"];
+ if ( array_key_exists( "year", $this->_params ) )
+ {
+ $this->_params["date"] = $this->_params["year"];
+ if( array_key_exists( "month", $this->_params ) )
+ {
+ $this->_params["date"] .= $this->_params["month"];
+ if( array_key_exists( "day", $this->_params ) )
+ {
+ $this->_params["date"] .= $this->_params["day"];
+ if ( array_key_exists( "hours", $this->_params ) )
+ {
+ $this->_params["date"] .= $this->_params["hours"];
+ if( array_key_exists( "minutes", $this->_params ) )
+ $this->_params["date"] .= $this->_params["minutes"];
+ }
+ }
+ }
+ }
$this->_params["op"] = "Default";
$this->_vars = Array( "blogid" => "blogId",
"blogname" => "blogName",
@@ -166,7 +215,24 @@
elseif( $this->_format == "post_trackbacks_link_format" ) {
$this->_includeFile = $this->_indexName;
$this->_params["op"] = "Trackbacks";
- $this->_params["date"] = $this->_params["year"].$this->_params["month"].$this->_params["day"].$this->_params["hours"].$this->_params["minutes"];
+ if ( array_key_exists( "year", $this->_params ) )
+ {
+ $this->_params["date"] = $this->_params["year"];
+ if( array_key_exists( "month", $this->_params ) )
+ {
+ $this->_params["date"] .= $this->_params["month"];
+ if( array_key_exists( "day", $this->_params ) )
+ {
+ $this->_params["date"] .= $this->_params["day"];
+ if ( array_key_exists( "hours", $this->_params ) )
+ {
+ $this->_params["date"] .= $this->_params["hours"];
+ if( array_key_exists( "minutes", $this->_params ) )
+ $this->_params["date"] .= $this->_params["minutes"];
+ }
+ }
+ }
+ }
$this->_vars = Array( "blogid" => "blogId",
"blogname" => "blogName",
"blogowner" => "blogUserName",
Modified: plog/trunk/class/net/http/httpclient.class.php
===================================================================
--- plog/trunk/class/net/http/httpclient.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/net/http/httpclient.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -140,7 +140,7 @@
}
else
{
- $path = $URI_PARTS["path"].($URI_PARTS["query"] ? "?".$URI_PARTS["query"] : "");
+ $path = $URI_PARTS["path"].(( array_key_exists( "query", $URI_PARTS ) && $URI_PARTS["query"] ) ? "?".$URI_PARTS["query"] : "");
// no proxy, send only the path
$this->_httprequest($path, $fp, $URI, $this->_httpmethod);
}
Modified: plog/trunk/class/net/http/phpsniff/phpSniff.class.php
===================================================================
--- plog/trunk/class/net/http/phpsniff/phpSniff.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/net/http/phpsniff/phpSniff.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -191,8 +191,8 @@
// 20020425 :: besfred
if(empty($UA)) $UA = getenv('HTTP_USER_AGENT');
if(empty($UA)) {
- $pv = explode(".", PHP_VERSION);
- $UA = ( $pv[0] > 3 && $pv[1] > 0 ) ? $_SERVER['HTTP_USER_AGENT'] : $HTTP_SERVER_VARS['HTTP_USER_AGENT'];
+ global $HTTP_SERVER_VARS;
+ $UA = ( phpversion() >= "4.1.0" ) ? $_SERVER['HTTP_USER_AGENT'] : $HTTP_SERVER_VARS['HTTP_USER_AGENT'];
}
// 20020910 :: rraymond
if(empty($UA)) return false;
Modified: plog/trunk/class/net/linkformatmatcher.class.php
===================================================================
--- plog/trunk/class/net/linkformatmatcher.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/net/linkformatmatcher.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -42,7 +42,6 @@
*/
function identify()
{
- $match = false;
foreach( $this->_formats as $key => $format ) {
$lp = new LinkParser( $format );
$params = $lp->parseLink( $this->_request );
Modified: plog/trunk/class/net/linkparser.class.php
===================================================================
--- plog/trunk/class/net/linkparser.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/net/linkparser.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -74,10 +74,10 @@
// Extract the token names from the structure:
preg_match_all("#\{(.+?)\}#", $this->_linkFormat, $tokens);
+ $result = array();
for($i = 0; $i < count($tokens[1]); $i++) {
$name = $tokens[1][$i];
$value = $values[$i+1];
-
$result["$name"] = $value;
}
Modified: plog/trunk/class/net/rawrequestgenerator.class.php
===================================================================
--- plog/trunk/class/net/rawrequestgenerator.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/net/rawrequestgenerator.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -414,8 +414,8 @@
$this->addParameter( "resource", $resource->getFileName());
$this->addParameter( "mode", "preview" );
- $resourceLink = $this->getResourceServerUrl().$this->getRequest();
-
+ $resourceLink = $this->getResourceServerUrl().$this->getRequest( false );
+
return $resourceLink;
}
@@ -432,7 +432,7 @@
$this->addParameter( "resource", $resource->getFileName());
$this->addParameter( "mode", "medium" );
- $resourceLink = $this->getResourceServerUrl().$this->getRequest();
+ $resourceLink = $this->getResourceServerUrl().$this->getRequest( false );
return $resourceLink;
}
Modified: plog/trunk/class/net/request.class.php
===================================================================
--- plog/trunk/class/net/request.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/net/request.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -4,9 +4,12 @@
include_once( PLOG_CLASS_PATH."class/config/properties.class.php" );
include_once( PLOG_CLASS_PATH."class/config/config.class.php" );
- define( "CHECK_CONFIG_REQUEST_MODE", 0 );
- define( "NORMAL_REQUEST_MODE", 1 );
- define( "SEARCH_ENGINE_FRIENDLY_MODE", 2);
+ if ( !defined("CHECK_CONFIG_REQUEST_MODE") )
+ define( "CHECK_CONFIG_REQUEST_MODE", 0 );
+ if ( !defined("NORMAL_REQUEST_MODE") )
+ define( "NORMAL_REQUEST_MODE", 1 );
+ if ( !defined("SEARCH_ENGINE_FRIENDLY_MODE") )
+ define( "SEARCH_ENGINE_FRIENDLY_MODE", 2);
/**
* \ingroup Net
Modified: plog/trunk/class/net/xmlrpc/IXR_Library.lib.php
===================================================================
--- plog/trunk/class/net/xmlrpc/IXR_Library.lib.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/net/xmlrpc/IXR_Library.lib.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -89,7 +89,7 @@
case 'struct':
$return = '<struct>'."\n";
foreach ($this->data as $name => $value) {
- $return .= " <member><name>$name</name><value>";
+ $return .= " <member><name>".htmlspecialchars($name)."</name><value>";
$return .= $value->getXml()."</value></member>\n";
}
$return .= '</struct>';
Modified: plog/trunk/class/plugin/pluginmanager.class.php
===================================================================
--- plog/trunk/class/plugin/pluginmanager.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/plugin/pluginmanager.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -310,7 +310,7 @@
function notifyEvent( $eventType, $params = Array())
{
// check if there is any plugin that wants to be notified about this event
- $plugins = $this->_pluginEventList["$eventType"];
+ $plugins = array_key_exists( $eventType, $this->_pluginEventList ) ? $this->_pluginEventList["$eventType"] : Array();
if( !is_array($plugins) || empty($plugins))
return $params;
Modified: plog/trunk/class/summary/action/bloglistaction.class.php
===================================================================
--- plog/trunk/class/summary/action/bloglistaction.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/summary/action/bloglistaction.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -1,7 +1,6 @@
<?php
include_once( PLOG_CLASS_PATH."class/summary/action/summaryaction.class.php" );
- include_once( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
include_once( PLOG_CLASS_PATH."class/summary/view/summarybloglistview.class.php" );
/**
@@ -9,9 +8,6 @@
*/
class BlogListAction extends SummaryAction
{
-
- var $_page;
-
function BlogListAction( $actionInfo, $request )
{
$this->SummaryAction( $actionInfo, $request );
@@ -27,7 +23,7 @@
// create the view
$this->_view = new SummaryBlogListView( Array( "summary" => "BlogList",
- "page" => $this->_page,
+ "page" => $page,
"locale" => $this->_locale->getLocaleCode()));
if( $this->_view->isCached()) {
Modified: plog/trunk/class/summary/action/dofinishregister.class.php
===================================================================
--- plog/trunk/class/summary/action/dofinishregister.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/summary/action/dofinishregister.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -131,12 +131,12 @@
// if the blog was created, we can add some basic information
// add a category
$articleCategories = new ArticleCategories();
- $articleCategory = new ArticleCategory( $this->_locale->tr("register_default_category" ), "", $newblogId, true );
+ $articleCategory = new ArticleCategory( $locale->tr("register_default_category" ), "", $newblogId, true );
$catId = $articleCategories->addArticleCategory( $articleCategory );
// add an article based on that category
- $articleTopic = $this->_locale->tr( "register_default_article_topic" );
- $articleText = $this->_locale->tr("register_default_article_text" );
+ $articleTopic = $locale->tr( "register_default_article_topic" );
+ $articleText = $locale->tr("register_default_article_text" );
$article = new Article( $articleTopic, $articleText, Array( $catId ), $userId, $newblogId, POST_STATUS_PUBLISHED, 0, Array(), "welcome" );
$article->setDateObject( new Timestamp()); // set it to the current date
$article->setCommentsEnabled( true ); // enable comments
Modified: plog/trunk/class/summary/action/doreadagreement.class.php
===================================================================
--- plog/trunk/class/summary/action/doreadagreement.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/summary/action/doreadagreement.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -10,12 +10,13 @@
{
function perform()
{
- if( $this->_config->getValue( "summary_show_agreement" ))
+ if( $this->_config->getValue( "summary_show_agreement" )) {
$this->_view = new SummaryView( "registerstep0" );
- else
- $this->_view = new SummaryView( "registerstep1" );
-
- $this->setCommonData();
+ $this->setCommonData();
+ }
+ else {
+ SummaryController::setForwardAction( "RegisterStep1" );
+ }
}
}
?>
Modified: plog/trunk/class/summary/action/dousercreation.class.php
===================================================================
--- plog/trunk/class/summary/action/dousercreation.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/summary/action/dousercreation.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -7,6 +7,7 @@
include_once( PLOG_CLASS_PATH."class/data/validator/passwordvalidator.class.php" );
include_once( PLOG_CLASS_PATH."class/dao/users.class.php" );
include_once( PLOG_CLASS_PATH."class/summary/view/doblogregistrationview.class.php" );
+ include_once( PLOG_CLASS_PATH."class/summary/view/summaryusercreationview.class.php" );
/**
* starts the user and blog registration process
@@ -23,8 +24,12 @@
$this->registerFieldValidator( "userPassword", new PasswordValidator());
$this->registerFieldValidator( "userPasswordCheck", new PasswordValidator());
$this->registerFieldValidator( "userEmail", new EmailValidator());
+ $this->_config =& Config::getConfig();
+ if( $this->_config->getValue( "use_captcha_auth" )) {
+ $this->registerFieldValidator( "userAuth", new StringValidator());
+ }
$this->registerField( "userFullName" );
- $view = new SummaryView( "registerstep1" );
+ $view = new SummaryUserCreationView();
$view->setErrorMessage( $this->_locale->tr("error_adding_user" ));
$this->setValidationErrorView( $view );
}
@@ -38,11 +43,12 @@
$this->confirmPassword = $tf->filterAllHTML($this->_request->getValue( "userPasswordCheck" ));
$this->userEmail = $tf->filterAllHTML($this->_request->getValue( "userEmail" ));
$this->userFullName = $tf->filterAllHTML($this->_request->getValue( "userFullName" ));
+ $this->captcha = $this->_request->getValue( "userAuth" );
// check if there is already a user with the same username and quit if so
$users = new Users();
if( $users->userExists( $this->userName )) {
- $this->_view = new SummaryView( "registerstep1" );
+ $this->_view = new SummaryUserCreationView();
//$this->_form->hasRun( true );
$this->_form->setFieldValidationStatus( "userName", false );
$this->setCommonData( true );
@@ -50,27 +56,39 @@
}
// check if this email account has registered and quit if so, but only if the configuration
- // says that we should only allow one blog per email account
- if( $this->_config->getValue( "force_one_blog_per_email_account" )) {
- if( $users->emailExists($this->userEmail)) {
- $this->_view = new SummaryView( "registerstep1" );
- //$this->_form->hasRun( true );
- $this->_form->setFieldValidationStatus( "userEmail", false );
- $this->setCommonData( true );
- return false;
- }
- }
+ // says that we should only allow one blog per email account
+ if( $this->_config->getValue( "force_one_blog_per_email_account" )) {
+ if( $users->emailExists($this->userEmail)) {
+ $this->_view = new SummaryUserCreationView();
+ //$this->_form->hasRun( true );
+ $this->_form->setFieldValidationStatus( "userEmail", false );
+ $this->setCommonData( true );
+ return false;
+ }
+ }
// check if the passwords match, and stop processing if so too
if( $this->userPassword != $this->confirmPassword ) {
- $this->_view = new SummaryView( "registerstep1" );
+ $this->_view = new SummaryUserCreationView();
$this->_view->setErrorMessage( $this->_locale->tr("error_passwords_dont_match"));
$this->_form->setFieldValidationStatus( "userPasswordCheck", false );
$this->setCommonData( true );
return false;
}
+
+ // check if the captcha matches
+ if( $this->_config->getValue( "use_captcha_auth")) {
+ include_once( PLOG_CLASS_PATH."class/data/captcha/captcha.class.php" );
+ $captcha = new Captcha();
+ if( !$captcha->validate( $this->captcha )) {
+ $this->_view = new SummaryUserCreationView();
+ $this->_view->setErrorMessage( $this->_locale->tr("error_invalid_auth_code"));
+ $this->_form->setFieldValidationStatus( "userAuth", false );
+ $this->setCommonData( true );
+ return false;
+ }
+ }
-
// if everything went fine, then proceed
$this->_view = new doBlogRegistrationView();
$this->setValues();
Modified: plog/trunk/class/summary/action/douserregister.class.php
===================================================================
--- plog/trunk/class/summary/action/douserregister.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/summary/action/douserregister.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -1,6 +1,7 @@
<?php
include_once( PLOG_CLASS_PATH."class/summary/action/registeraction.class.php" );
+ include_once( PLOG_CLASS_PATH."class/summary/view/summaryusercreationview.class.php" );
/**
* shows a form so that users can register
@@ -9,8 +10,8 @@
{
function perform()
{
- $this->_view = new SummaryView( "registerstep1" );
- $this->setCommonData();
+ $this->_view = new SummaryUserCreationView();
+ $this->setCommonData();
}
}
?>
Modified: plog/trunk/class/summary/action/userlistaction.class.php
===================================================================
--- plog/trunk/class/summary/action/userlistaction.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/summary/action/userlistaction.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -2,18 +2,12 @@
include_once( PLOG_CLASS_PATH."class/summary/action/summaryaction.class.php" );
include_once( PLOG_CLASS_PATH."class/summary/view/summaryuserlistview.class.php" );
- include_once( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
/**
* shows a list with all the users, pager included
*/
class UserListAction extends SummaryAction
{
-
- var $_numUsers;
- var $_numUsersPerPage;
- var $_page;
-
function UserListAction( $actionInfo, $request )
{
$this->SummaryAction( $actionInfo, $request );
Copied: plog/trunk/class/summary/view/summaryusercreationview.class.php (from rev 2477, plog/branches/plog-1.0.2/class/summary/view/summaryusercreationview.class.php)
Copied: plog/trunk/class/template/smarty/plugins/modifier.substr.php (from rev 2477, plog/branches/plog-1.0.2/class/template/smarty/plugins/modifier.substr.php)
Copied: plog/trunk/class/template/smarty/plugins/modifier.utf8_truncate.php (from rev 2477, plog/branches/plog-1.0.2/class/template/smarty/plugins/modifier.utf8_truncate.php)
Modified: plog/trunk/class/view/admin/adminpostslistview.class.php
===================================================================
--- plog/trunk/class/view/admin/adminpostslistview.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/view/admin/adminpostslistview.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -106,14 +106,18 @@
* gets the value of a parameter
* @private
*/
- function _getParameter( $params, $paramId, $defaultValue )
- {
- $value = $params["$paramId"];
- if( $value == "" )
- $value = $this->getSessionValue( $paramId, $defaultValue );
-
- return $value;
- }
+ function _getParameter( $params, $paramId, $defaultValue )
+ {
+ $value = "";
+ if( array_key_exists( $paramId, $params ) )
+ {
+ $value = $params["$paramId"];
+ }
+ if( $value == "" )
+ $value = $this->getSessionValue( $paramId, $defaultValue );
+
+ return $value;
+ }
function _setViewParameters( $params )
{
@@ -123,7 +127,7 @@
$this->_showStatus = $this->_getParameter( $params, "showStatus", 0 );
$this->_showUser = $this->_getParameter( $params, "showUser", 0 );
$this->_showMonth = $this->_getParameter( $params, "showMonth", $this->_locale->formatDate( new Timestamp(), "%Y%m" ));
- $this->_searchTerms = $params["searchTerms"];
+ $this->_searchTerms = $this->_getParameter( $params, "searchTerms", "");
}
/**
Modified: plog/trunk/class/view/resourceserverview.class.php
===================================================================
--- plog/trunk/class/view/resourceserverview.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/view/resourceserverview.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -8,6 +8,7 @@
define( 'RESOURCE_VIEW_MODE_PREVIEW', 'preview' );
define( 'RESOURCE_VIEW_MODE_MEDIUM', 'medium' );
define( 'DEFAULT_HTTP_CACHE_LIFETIME', '86400');
+ define( 'RESOURCE_DEFAULT_CHUNK_SIZE', '32768' );
/**
* \ingroup View
@@ -97,7 +98,8 @@
elseif( $this->_mode == RESOURCE_VIEW_MODE_MEDIUM )
print( $this->_resource->getMediumSizePreview());
else {
- print( $this->_resource->getData());
+ while($chunk =& $this->_resource->getDataChunk( RESOURCE_DEFAULT_CHUNK_SIZE ))
+ echo( $chunk );
}
return true;
Modified: plog/trunk/class/view/view.class.php
===================================================================
--- plog/trunk/class/view/view.class.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/class/view/view.class.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -262,21 +262,25 @@
* @return The value associated to the parameter or empty if not
* found
*/
- function getSessionValue( $param, $defaultValue = "" )
- {
- $session = HttpVars::getSession();
+ function getSessionValue( $param, $defaultValue = "" )
+ {
+ $session = HttpVars::getSession();
$viewName = get_class( $this );
- $keyName = "{$viewName}_{$param}";
-
- $value = $session["$keyName"];
- if( $value == "" && $defaultValue != "" )
- $value = $defaultValue;
-
- return $value;
- }
-
-
- /**
+ $keyName = "{$viewName}_{$param}";
+
+ $value = "";
+ if ( array_key_exists( $keyName, $session ) )
+ {
+ $value = $session["$keyName"];
+ }
+ if( $value == "" && $defaultValue != "" )
+ $value = $defaultValue;
+
+ return $value;
+ }
+
+
+ /**
* gets the current page from the HTTP request
*
* @return the page number from the request
Modified: plog/trunk/config/config.properties.php
===================================================================
--- plog/trunk/config/config.properties.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/config/config.properties.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -2,6 +2,30 @@
#
# database settings
#
+# Installation instructions:
+# NEW INSTALL
+# Leave these values blank,
+# and go to the URL where you installed pLog
+# and look at /wizard.php and type the appropriate
+# values in there.
+#
+# This file needs to be writable
+# by whatever user your php scripts run as.
+# The easiest thing to do is to make this file
+# writable by everyone, and then after the wizard
+# completes, remove write privileges from everyone
+# except yourself.
+#
+# UPGRADE
+# remove all files from your old plog directory
+# (back them up somewhere, also backup your current
+# database)
+# Upload new pLog files into the same directory,
+# and then copy your old config.properties.php
+# over this file, and then run the wizard.
+# (note, if upgrading between minor releases:
+# 1.0 to 1.0.1, etc. you shouldn't run the wizard)
+
$config["db_host"] = "";
$config["db_username"] = "";
$config["db_password"] = "";
Copied: plog/trunk/imgs/authimage (from rev 2477, plog/branches/plog-1.0.2/imgs/authimage)
Deleted: plog/trunk/imgs/authimage/marble.gif
===================================================================
(Binary files differ)
Copied: plog/trunk/imgs/authimage/marble.gif (from rev 2477, plog/branches/plog-1.0.2/imgs/authimage/marble.gif)
Property changes on: plog/trunk/imgs/authimage/marble.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: plog/trunk/imgs/authimage/ocean.gif
===================================================================
(Binary files differ)
Copied: plog/trunk/imgs/authimage/ocean.gif (from rev 2477, plog/branches/plog-1.0.2/imgs/authimage/ocean.gif)
Property changes on: plog/trunk/imgs/authimage/ocean.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: plog/trunk/imgs/authimage/pine.gif
===================================================================
(Binary files differ)
Copied: plog/trunk/imgs/authimage/pine.gif (from rev 2477, plog/branches/plog-1.0.2/imgs/authimage/pine.gif)
Property changes on: plog/trunk/imgs/authimage/pine.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: plog/trunk/imgs/authimage/rain.gif
===================================================================
(Binary files differ)
Copied: plog/trunk/imgs/authimage/rain.gif (from rev 2477, plog/branches/plog-1.0.2/imgs/authimage/rain.gif)
Property changes on: plog/trunk/imgs/authimage/rain.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: plog/trunk/imgs/authimage/sky.gif
===================================================================
(Binary files differ)
Copied: plog/trunk/imgs/authimage/sky.gif (from rev 2477, plog/branches/plog-1.0.2/imgs/authimage/sky.gif)
Property changes on: plog/trunk/imgs/authimage/sky.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Deleted: plog/trunk/imgs/authimage/transparent.gif
===================================================================
(Binary files differ)
Copied: plog/trunk/imgs/authimage/transparent.gif (from rev 2477, plog/branches/plog-1.0.2/imgs/authimage/transparent.gif)
Property changes on: plog/trunk/imgs/authimage/transparent.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: plog/trunk/js/ui/common.js
===================================================================
--- plog/trunk/js/ui/common.js 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/js/ui/common.js 2005-09-19 02:23:51 UTC (rev 2481)
@@ -290,12 +290,15 @@
function previewPost( formId )
{
+
form = document.getElementById( formId )
- if( submitNewPost( form )) {
- preview = window.open( 'about:blank', '', 'scrollbars=yes,resizable=yes,toolbar=no' );
+ if( submitNewPost( form )) {
+ preview = window.open( '', '', 'scrollbars=yes,resizable=yes,toolbar=no' );
+ preview.focus();
- // write the contents as a form with hidden fields
+ // write the contents as a form with hidden fields
+ preview.document.open();
preview.document.write( '<html><body><div style="display:none">' +
'<form name="previewForm" method="post" action="admin.php">' +
'<input type="hidden" name="op" value="previewPost">' );
@@ -309,7 +312,7 @@
else {
postText = form.postText.value;
postExtendedText = form.postExtendedText.value;
- }
+ }
preview.document.write( '<textarea name="postText">' + postText + '</textarea>' +
'<textarea name="postTopic">' + form.postTopic.value + '</textarea>' +
'<textarea name="postExtendedText">' + postExtendedText + '</textarea>' +
@@ -323,7 +326,8 @@
if( form.postCategories.options[i].selected )
preview.document.write( '<option selected="selected" value="' + form.postCategories.options[i].value + '">test</option>' );
}
- preview.document.write( '</select>' );
+
+ preview.document.write( '</select>' );
// custom fields -- since we don't know their exact names and amount, we need to loop through the whole form to find them!
for(var i = 0; i < form.elements.length; i++ ) {
var itemName = form.elements[i].name;
@@ -341,9 +345,10 @@
preview.document.write( '</form></div>' +
'<b>Loading preview, please wait...</b>' +
'</body></html>' );
+ preview.document.close();
// and submit the form
- preview.document.previewForm.submit();
+ preview.document.previewForm.submit();
}
}
Modified: plog/trunk/locale/locale_de_DE.php
===================================================================
--- plog/trunk/locale/locale_de_DE.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/locale/locale_de_DE.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -682,7 +682,7 @@
$messages['help_temp_folder'] = 'Verzeichniss, in das pLog temporäre Dateien, wie z.B. kompilierte Templates, speichert. Um die Sicherheit zu erhöhen, können Sie ein Verzeichniss ausserhalb des Webserver-Verzeichnissbaums nutzen. [Standard = ./tmp]';
$messages['help_base_url'] = 'URL unter dem dieses Blog installiert ist';
$messages['help_subdomains_enabled'] = 'Subdomains aktivieren oder deaktivieren. Wenn Sie diese Funktion nutzen möchten, lesen Sie bitte vorher die Dokumentation! [Standard = Nein]';
-$messages['help_subdomains_base_url'] = 'Wenn Subdomains aktiviert sind, ist dies die URL-Basis. Benutzen Sie {blogname}, um den Blognamen oder {username} um den Benutzernamen zum Generieren des Links zum Blog zu verwenden (z.B. http://{blogname}.yourdomain.com})';
+$messages['help_subdomains_base_url'] = 'Wenn Subdomains aktiviert sind, ist dies die URL-Basis. Benutzen Sie {blogname}, um den Blognamen oder {username} um den Benutzernamen zum Generieren des Links zum Blog zu verwenden (z.B. http://{blogname}.yourdomain.com)';
$messages['help_include_blog_id_in_url'] = 'Diese Einstellung ist nur wichtig, wenn Subdomains und "normale" URLs aktiviert sind und bewirkt, dass intern generierte URLs nicht den "Blog-ID" Parameter verwenden. Ändern Sie diese Einstellung nur, wenn Sie genau wissen, was Sie tun! [Standard = Ja]';
$messages['help_script_name'] = 'Ändern Sie diese Einstellung, falls Sie die Datei index.php umbenennen müssen [Standard = index.php]';
$messages['help_show_posts_max'] = 'Maximale Anzahl der Artikel, die auf der Hauptseite angezeigt werden. Diese Einstellung hat nur Auswirkungen auf neue Blogs. [Standard = 15]';
Modified: plog/trunk/locale/locale_en_UK.php
===================================================================
--- plog/trunk/locale/locale_en_UK.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/locale/locale_en_UK.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -689,7 +689,7 @@
$messages['help_temp_folder'] = 'Folder that pLog can use to write its temporary data such as compiled templates, etc. Use a folder outside the web server tree for increased security [Default = ./tmp]';
$messages['help_base_url'] = 'Base URL where this blog is installed';
$messages['help_subdomains_enabled'] = 'Enable or disable subdomains. Please see the documentation for more information regarding subdomains [Default = No]';
-$messages['help_subdomains_base_url'] = 'When subdomains are enabled, this base URL is used instead of base_url. Use {blogname} to get the blog name and {username} to get the name of the user owner of the blog in order to generate a link to a blog. (i.e. http://{blogname}.yourdomain.com})';
+$messages['help_subdomains_base_url'] = 'When subdomains are enabled, this base URL is used instead of base_url. Use {blogname} to get the blog name and {username} to get the name of the user owner of the blog in order to generate a link to a blog. (i.e. http://{blogname}.yourdomain.com)';
$messages['help_include_blog_id_in_url'] = 'Meaningful only when subdomains are enabled and "normal" URLs are enabled, forces internally-generated URLs not to have the "blogId" parameter. Do not change unless you know what you are doing [Default = Yes]';
$messages['help_script_name'] = 'Set this if you need to rename index.php to something else [Default = index.php]';
$messages['help_show_posts_max'] = 'Maximum number of posts shown in the main page. Only meaningful for new blogs [Default = 15]';
Copied: plog/trunk/locale/locale_fa_IR.php (from rev 2477, plog/branches/plog-1.0.2/locale/locale_fa_IR.php)
Property changes on: plog/trunk/locale/locale_fa_IR.php
___________________________________________________________________
Name: svn:executable
+ *
Modified: plog/trunk/locale/locale_fi_FI.php
===================================================================
--- plog/trunk/locale/locale_fi_FI.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/locale/locale_fi_FI.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -683,7 +683,7 @@
$messages['help_temp_folder'] = 'pLogin käyttämä väliaikainen temp-kansio. Käytä web-serveripuun (public_html) ulkopuolella olevaa kansiota parannetun turvallisuuden saavuttamiseksi [Vakio = ./tmp]';
$messages['help_base_url'] = 'PerusURL, jonne pLog on asennettu';
$messages['help_subdomains_enabled'] = 'Kytke päälle alidomainit. Katso dokumentoinnista lisäinformaatiota alidomaineista [Vakio = Ei]';
-$messages['help_subdomains_base_url'] = 'Kun alidomainit ovat päällä, tätä perusURL:lää käytetään base_urlin sijasta. Käytä {blogname} saadaksesi blogin nimen ja {username} saadaksesi käyttäjän nimen, joka omistaa blogin generoidaksesi linkin blogiin (esim. http://{blogname}.yourdomain.com})';
+$messages['help_subdomains_base_url'] = 'Kun alidomainit ovat päällä, tätä perusURL:lää käytetään base_urlin sijasta. Käytä {blogname} saadaksesi blogin nimen ja {username} saadaksesi käyttäjän nimen, joka omistaa blogin generoidaksesi linkin blogiin (esim. http://{blogname}.yourdomain.com)';
$messages['help_include_blog_id_in_url'] = 'Tarvitaan vain kun alidomainit ovat päällä ja "normaalit" URLit ovat päällä. Pakottaa sisäisesti generoidut URLit olemaan ilmane "blogId" -parameteria. Älä vaihda, ellet tiedä mitä teet [Vakio = Kyllä]';
$messages['help_script_name'] = 'Jos sinun täytyy muuttaa index.php joksikin muuksi [Vakio = index.php]';
$messages['help_show_posts_max'] = 'Pääsivulla näytettävien viestien maksimimäärä. Koskee vain uusia blogeja [Vakio = 15]';
@@ -901,4 +901,4 @@
$messages['menu'] = 'Menu';
$messages['albums'] = 'Albumit';
$messages['admin'] = 'Admin';
-?>
\ No newline at end of file
+?>
Modified: plog/trunk/locale/locale_ja_JP.php
===================================================================
--- plog/trunk/locale/locale_ja_JP.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/locale/locale_ja_JP.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -688,7 +688,7 @@
$messages['help_temp_folder'] = '¥³¥ó¥Ñ¥¤¥ëºÑ¤ß¥Æ¥ó¥×¥ì¡¼¥ÈÅù¤Î°ì»þŪ¤Ê¥Ç¡¼¥¿¤ò½ñ¤¹þ¤à¤¿¤á¤Î¥Õ¥©¥ë¥À¤Ç¤¹¡£¥»¥¥å¥ê¥Æ¥£¡¼¶¯²½¤Î¤¿¤á¤Ë¥¦¥§¥Ö¥µ¡¼¥Ð¡¼¥Ä¥ê¡¼¤Î³°¤Ë¤¢¤ë¥Õ¥©¥ë¥À¤ò»ØÄꤷ¤Æ²¼¤µ¤¤¡£ [¥Ç¥Õ¥©¥ë¥È = ./tmp]';
$messages['help_base_url'] = '¤³¤ÎBlog¤¬¥¤¥ó¥¹¥È¡¼¥ë¤µ¤ì¤ë¥Ù¡¼¥¹URL¤Ë¤Ê¤ê¤Þ¤¹¡£';
$messages['help_subdomains_enabled'] = '͸ú¤Ë¤¹¤ë¤È¥µ¥Ö¥É¥á¥¤¥ó¤¬»ÈÍѤµ¤ì¤Þ¤¹¡£¾ÜºÙ¤Ï¥µ¥Ö¥É¥á¥¤¥ó¤Ë´Ø¤¹¤ë¥É¥¥å¥á¥ó¥È¤ò¤´Í÷²¼¤µ¤¤¡£ [¥Ç¥Õ¥©¥ë¥È = ¤¤¤¤¤¨]';
-$messages['help_subdomains_base_url'] = '¥µ¥Ö¥É¥á¥¤¥ó¤ò͸ú¤Ë¤·¤¿¾ì¹ç¡¢base_url¤ÎÂå¤ï¤ê¤Ë¤³¤³¤Ç»ØÄꤷ¤¿¥Ù¡¼¥¹URL¤¬»ÈÍѤµ¤ì¤Þ¤¹¡£Blog̾¤Î¼èÆÀ¤Ï {blogname} ¡¢Blog¥ª¡¼¥Ê¡¼¤Î¥æ¡¼¥¶¡¼Ì¾¤Î¼èÆÀ¤Ï {username} ¤ò»ÈÍѤ·¤ÆBlog¤Ø¤Î¥ê¥ó¥¯¤ò¼èÆÀ¤·¤Æ²¼¤µ¤¤¡£ (Îã : http://{blogname}.yourdomain.com})';
+$messages['help_subdomains_base_url'] = '¥µ¥Ö¥É¥á¥¤¥ó¤ò͸ú¤Ë¤·¤¿¾ì¹ç¡¢base_url¤ÎÂå¤ï¤ê¤Ë¤³¤³¤Ç»ØÄꤷ¤¿¥Ù¡¼¥¹URL¤¬»ÈÍѤµ¤ì¤Þ¤¹¡£Blog̾¤Î¼èÆÀ¤Ï {blogname} ¡¢Blog¥ª¡¼¥Ê¡¼¤Î¥æ¡¼¥¶¡¼Ì¾¤Î¼èÆÀ¤Ï {username} ¤ò»ÈÍѤ·¤ÆBlog¤Ø¤Î¥ê¥ó¥¯¤ò¼èÆÀ¤·¤Æ²¼¤µ¤¤¡£ (Îã : http://{blogname}.yourdomain.com)';
$messages['help_include_blog_id_in_url'] = '¥µ¥Ö¥É¥á¥¤¥ó¤È"Ä̾ï¤Î"URL¤¬Í¸ú¤Ê¾ì¹ç¤ËÆâÉô¼èÆÀURL¤Ë"blogId"¥Ñ¥é¥á¡¼¥¿¡¼¤ò¼èÆÀ¤·¤Ê¤¤¤è¤¦¤ËÀßÄê¤Ç¤¤Þ¤¹¡£¤³¤Îµ¡Ç½¤ò»ÈÍѤ¹¤ëÊý¤Î¤ßÊѹ¹¤·¤Æ²¼¤µ¤¤¡£ [¥Ç¥Õ¥©¥ë¥È = ¤Ï¤¤]';
$messages['help_script_name'] = 'index.php¤ò¾¤Î̾¾Î¤ËÊѹ¹¤¹¤ë¾ì¹ç¤Î¤ßÊѹ¹¤·¤Æ²¼¤µ¤¤¡£ [¥Ç¥Õ¥©¥ë¥È = index.php]';
$messages['help_show_posts_max'] = '¥á¥¤¥ó¥Ú¡¼¥¸¤Ëɽ¼¨¤µ¤»¤ëµ»ö¿ô¡£¿·µ¬Blog¤Î¤ß͸ú¤Ç¤¹¡£ [¥Ç¥Õ¥©¥ë¥È = 15]';
@@ -906,4 +906,4 @@
$messages['menu'] = '¥á¥Ë¥å¡¼';
$messages['albums'] = '¥¢¥ë¥Ð¥à';
$messages['admin'] = '´ÉÍý¼Ô';
-?>
\ No newline at end of file
+?>
Copied: plog/trunk/locale/locale_nl_NL.php (from rev 2477, plog/branches/plog-1.0.2/locale/locale_nl_NL.php)
Copied: plog/trunk/locale/locale_ru_RU.php (from rev 2477, plog/branches/plog-1.0.2/locale/locale_ru_RU.php)
Copied: plog/trunk/locale/locale_tr_TR.php (from rev 2477, plog/branches/plog-1.0.2/locale/locale_tr_TR.php)
Modified: plog/trunk/rss.php
===================================================================
--- plog/trunk/rss.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/rss.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -6,6 +6,7 @@
include_once( PLOG_CLASS_PATH."class/controller/controller.class.php" );
include_once( PLOG_CLASS_PATH."class/net/http/session/sessioninfo.class.php" );
+ include_once( PLOG_CLASS_PATH."class/net/http/session/sessionmanager.class.php" );
include_once( PLOG_CLASS_PATH."class/net/http/httpvars.class.php" );
include_once( PLOG_CLASS_PATH."class/plugin/pluginmanager.class.php" );
@@ -23,6 +24,7 @@
//
// if there is no session object, we better create one
//
+ SessionManager::Init();
$session = HttpVars::getSession();
if( $session["SessionInfo"] == "" ) {
$session["SessionInfo"] = new SessionInfo();
Modified: plog/trunk/templates/admin/dashboard.template
===================================================================
--- plog/trunk/templates/admin/dashboard.template 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/templates/admin/dashboard.template 2005-09-19 02:23:51 UTC (rev 2481)
@@ -30,12 +30,12 @@
{foreach from=$recentposts[$blogId] item=post}
<tr style="background-color: {cycle values="#FFFFFF,#F7F7F7"};">
<td>
- <a target="_blank" href="{$url->postPermalink($post)}">{$post->getTopic()}</a><br/>
+ <a target="_blank" href="{$url->postPermalink($post)}">{$post->getTopic()|strip_tags}</a><br/>
</td>
<td>
<div class="list_action_button">
<a href="?op=blogSelect&blogId={$blog->getId()}&action=editPost&postId={$post->getId()}"><img src="imgs/admin/icon_edit-16.png" alt="{$locale->tr("edit")}" /></a>
- <a href="?op=blogSelect&blogId={$blog->getId()}&action=deletePost&postIds[]={$post->getId()}"><img src="imgs/admin/icon_delete-16.png" alt="{$locale->tr("delete")}" /></a>
+ <a href="?op=blogSelect&blogId={$blog->getId()}&action=deletePost&postId={$post->getId()}"><img src="imgs/admin/icon_delete-16.png" alt="{$locale->tr("delete")}" /></a>
</div>
</td>
</tr>
@@ -60,7 +60,7 @@
{if $comment->getTopic() == ""}
<i>{$locale->tr("no_subject")}</i>
{else}
- {$comment->getTopic()}
+ {$comment->getTopic()|strip_tags}
{/if}
</a>
</td>
@@ -70,7 +70,7 @@
{/if}
</td>
<td>
- <a href="{$url->postPermalink($article)}">{$article->getTopic()}</a>
+ <a href="{$url->postPermalink($article)}">{$article->getTopic()|strip_tags}</a>
</td>
<td>
{assign var=commentDate value=$comment->getDateObject()}
@@ -78,7 +78,7 @@
</td>
<td>
<div class="list_action_button">
- <a href="?op=blogSelect&blogId={$blog->getId()}&action=deleteComment&commentIds[]={$comment->getId()}&articleId={$article->getId()}"><img src="imgs/admin/icon_delete-16.png" alt="{$locale->tr("delete")}" /></a>
+ <a href="?op=blogSelect&blogId={$blog->getId()}&action=deleteComment&commentId={$comment->getId()}&articleId={$article->getId()}"><img src="imgs/admin/icon_delete-16.png" alt="{$locale->tr("delete")}" /></a>
{if $comment->getStatus() == 0}
<a href="?op=blogSelect&blogId={$blog->getId()}&action=markComment&mode=1&articleId={$comment->getArticleId()}&commentId={$comment->getId()}">
<img src="imgs/admin/icon_spam-16.png" alt="{$locale->tr("mark_as_spam")}" />
@@ -120,7 +120,7 @@
</a>
</td>
<td>
- <a href="{$url->postPermalink($article)}">{$article->getTopic()}</a>
+ <a href="{$url->postPermalink($article)}">{$article->getTopic()|strip_tags}</a>
</td>
<td>
{assign var=trackbackDate value=$trackback->getDateObject()}
@@ -128,7 +128,7 @@
</td>
<td>
<div class="list_action_button">
- <a href="?op=blogSelect&blogId={$blog->getId()}&action=deleteTrackback&articleId={$article->getId()}&trackbackIds[]={$trackback->getId()}"><img src="imgs/admin/icon_delete-16.png" alt="{$locale->tr("delete_trackback")}" /></a>
+ <a href="?op=blogSelect&blogId={$blog->getId()}&action=deleteTrackback&articleId={$article->getId()}&trackbackId={$trackback->getId()}"><img src="imgs/admin/icon_delete-16.png" alt="{$locale->tr("delete_trackback")}" /></a>
</div>
</td>
</tr>
Modified: plog/trunk/templates/admin/editcomments.template
===================================================================
--- plog/trunk/templates/admin/editcomments.template 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/templates/admin/editcomments.template 2005-09-19 02:23:51 UTC (rev 2481)
@@ -53,7 +53,7 @@
<input class="checkbox" type="checkbox" name="commentIds[{$comment->getId()}]" id="checks_{$comment->getId()}" value="{$comment->getId()}" />
</td>
<td class="col_highlighted">
- {$comment->getTopic()}
+ {$comment->getTopic()|strip_tags}
</td>
<td>
{$comment->getText()}
Modified: plog/trunk/templates/admin/editlinks.template
===================================================================
--- plog/trunk/templates/admin/editlinks.template 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/templates/admin/editlinks.template 2005-09-19 02:23:51 UTC (rev 2481)
@@ -56,7 +56,7 @@
</td>
<td>
{if $link->getRssFeed() != ""}
- <a href="{$link->getRssFeed()}"><img src="imgs/admin/rss_logo_small.gif" style="border:0px;" /></a>
+ <a href="{$link->getRssFeed()}"><img src="imgs/rss_logo_small.gif" style="border:0px;" /></a>
{/if}
</td>
<td>
Modified: plog/trunk/templates/admin/editpost.template
===================================================================
--- plog/trunk/templates/admin/editpost.template 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/templates/admin/editpost.template 2005-09-19 02:23:51 UTC (rev 2481)
@@ -35,7 +35,7 @@
<label for="postTopic">{$locale->tr("topic")}</label>
<span class="required">*</span>
<div class="formHelp">{$locale->tr("topic_help")}</div>
- <input type="text" id="postTopic" name="postTopic" style="width:100%" value="{$postTopic}" />
+ <input type="text" id="postTopic" name="postTopic" style="width:100%" value="{$postTopic|escape:"html"}" />
{include file="$admintemplatepath/validate.template" field=postTopic message=$locale->tr("error_missing_post_topic")}
</div>
@@ -65,11 +65,11 @@
{/if}
</div>
- <div class="field">
+ <!--<div class="field">
<label for="trackbackUrls">{$locale->tr("trackback_urls")}</label>
<div class="formHelp">{$locale->tr("trackback_urls_help")}</div>
<textarea rows="5" id="trackbackUrls" name="trackbackUrls" style="width:100%">{$trackbackUrls}</textarea>
- </div>
+ </div>-->
<!-- text area custom fields -->
{include file="$admintemplatepath/newpost_customfields.template" type=2 fields=$customfields}
@@ -80,7 +80,7 @@
<div class="field">
<label for="postSlug">{$locale->tr("post_slug")}</label>
<div class="formHelp">{$locale->tr("post_slug_help")}</div>
- <input type="text" name="postSlug" id="postSlug" style="width:100%" value="{$postSlug}" />
+ <input type="text" name="postSlug" id="postSlug" style="width:100%" value="{$postSlug|escape:"html"}" />
</div>
<div class="field">
Modified: plog/trunk/templates/admin/editposts.template
===================================================================
--- plog/trunk/templates/admin/editposts.template 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/templates/admin/editposts.template 2005-09-19 02:23:51 UTC (rev 2481)
@@ -93,7 +93,7 @@
</td>
<td class="col_highlighted">
<a href="?op=editPost&postId={$post->getId()}">
- {$post->getTopic()}
+ {$post->getTopic()|strip_tags}
</a>
</td>
<td>
Modified: plog/trunk/templates/admin/newlink.template
===================================================================
--- plog/trunk/templates/admin/newlink.template 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/templates/admin/newlink.template 2005-09-19 02:23:51 UTC (rev 2481)
@@ -56,11 +56,13 @@
</select>
</div>
+ {*
<div class="field">
<label for="bookmarklet">{$locale->tr("bookmarklet")}</label>
<div class="formHelp">{$locale->tr("bookmarklet_help")}</div>
<a href="javascript:void(plogbm=window.open('{$url->getAdminUrl()}?op=newLink&linkName='+encodeURIComponent(document.title)+'&linkUrl='+encodeURIComponent(location.href),'plogbm','toolbar=1,status=1,location=1,scrollbars=1,menubar=1,resizable=1'));" onclick="window.alert('{$locale->tr("bookmarklet_help")}');">{$locale->tr("bookmarkit_to_plog")}</a>
</div>
+ *}
</fieldset>
<div class="buttons">
Modified: plog/trunk/templates/admin/newpost.template
===================================================================
--- plog/trunk/templates/admin/newpost.template 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/templates/admin/newpost.template 2005-09-19 02:23:51 UTC (rev 2481)
@@ -62,7 +62,7 @@
<label for="postTopic">{$locale->tr("topic")}</label>
<span class="required">*</span>
<div class="formHelp">{$locale->tr("topic_help")}</div>
- <input type="text" name="postTopic" style="width:100%" id="postTopic" value="{$postTopic}" />
+ <input type="text" name="postTopic" style="width:100%" id="postTopic" value="{$postTopic|escape:"html"}" />
{include file="$admintemplatepath/validate.template" field=postTopic message=$locale->tr("error_missing_post_topic")}
</div>
@@ -91,11 +91,11 @@
{/if}
</div>
- <div class="field">
+ <!--<div class="field">
<label for="trackbackUrls">{$locale->tr("trackback_urls")}</label>
<div class="formHelp">{$locale->tr("trackback_urls_help")}</div>
<textarea rows="5" id="trackbackUrls" name="trackbackUrls" style="width:100%">{$trackbackUrls}</textarea>
- </div>
+ </div>-->
<!-- text area custom fields -->
{include file="$admintemplatepath/newpost_customfields.template" type=2 fields=$customfields}
@@ -106,7 +106,7 @@
<div class="field">
<label for="postSlug">{$locale->tr("post_slug")}</label>
<div class="formHelp">{$locale->tr("post_slug_help")}</div>
- <input type="text" name="postSlug" id="postSlug" style="width:100%" value="{$postSlug}" />
+ <input type="text" name="postSlug" id="postSlug" style="width:100%" value="{$postSlug|escape:"html"}" />
</div>
<div class="field">
@@ -180,11 +180,13 @@
{/if}
</div>
+ {*
<div class="field">
<br /><label for="bookmarklet">{$locale->tr("bookmarklet")}</label>
<div class="formHelp">{$locale->tr("bookmarklet_help")}</div>
<a href="javascript:bm=document.selection?document.selection.createRange().text:document.getSelection();void(plogbm=window.open('{$url->getAdminUrl()}?op=newPost&sendTrackbacks=1&postText='+encodeURIComponent('<p>'+bm+' ... '+'<a href="'+window.location.href+'">'+'{$locale->tr("original_post")}'+'</a></p>'),'plogbm','toolbar=1,status=1,location=1,scrollbars=1,menubar=1,resizable=1'))" onclick="window.alert('{$locale->tr("bookmarklet_help")}');">{$locale->tr("blogit_to_plog")}</a>
- </div>
+ </div>
+ *}
<!-- checkbox custom fields -->
{include file="$admintemplatepath/newpost_customfields.template" type=3 fields=$customfields}
Modified: plog/trunk/templates/admin/newpost_customfields.template
===================================================================
--- plog/trunk/templates/admin/newpost_customfields.template 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/templates/admin/newpost_customfields.template 2005-09-19 02:23:51 UTC (rev 2481)
@@ -4,7 +4,7 @@
<div class="field">
<label for="customField[{$fieldId}]">{$field->getName()}</label>
<div class="formHelp">{$field->getDescription()}</div>
- <input type="text" name="customField[{$fieldId}]" id="customField[{$fieldId}]" value="{$customField[$fieldId]}" />
+ <input type="text" name="customField[{$fieldId}]" id="customField[{$fieldId}]" value="{$customField[$fieldId]|escape:"html"}" />
</div>
{elseif $field->getType() == 2 && ($type == 2 || $type == "")}
<div class="field">
Modified: plog/trunk/templates/admin/newresourcealbum.template
===================================================================
--- plog/trunk/templates/admin/newresourcealbum.template 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/templates/admin/newresourcealbum.template 2005-09-19 02:23:51 UTC (rev 2481)
@@ -35,7 +35,14 @@
<div class="formHelp">{$locale->tr("album_description_help")}</div>
<textarea name="albumDescription" id="albumDescription" rows="10" cols="60">{$albumDescription}</textarea>
</div>
- </fieldset>
+ <div class="field">
+ <label for="showAlbum">{$locale->tr("show")}</label>
+ <div class="formHelp">
+ <input class="checkbox" type="checkbox" id="showAlbum" name="showAlbum" value="1"
+ checked="checked" />
+ {$locale->tr("show_album_help")}
+ </div>
+ </div> </fieldset>
<div class="buttons">
<input type="reset" name="reset" value="{$locale->tr("reset")}" />
<input type="submit" name="addAlbum" value="{$locale->tr("add")}" />
Modified: plog/trunk/templates/grey/postandcomments.template
===================================================================
--- plog/trunk/templates/grey/postandcomments.template 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/templates/grey/postandcomments.template 2005-09-19 02:23:51 UTC (rev 2481)
@@ -17,7 +17,7 @@
{include file="$blogtemplate/post.template"}
{foreach from=$comments item=comment}
<p class="commentheader">
- <img src="{$url->getUrl("/imgs/comment_icon1.gif")}"/> {$comment->getTopic()} <span class="categoryinfo">[<a href="{$url->replyCommentLink($post,$comment)}">{$locale->tr("reply")}</a>]</span>
+ <img src="{$url->getUrl("/imgs/comment_icon1.gif")}"/> {$comment->getTopic()|strip_tags} <span class="categoryinfo">[<a href="{$url->replyCommentLink($post,$comment)}">{$locale->tr("reply")}</a>]</span>
</p>
<p>
{$comment->getText()}
Modified: plog/trunk/templates/grey-sf/postandcomments.template
===================================================================
--- plog/trunk/templates/grey-sf/postandcomments.template 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/templates/grey-sf/postandcomments.template 2005-09-19 02:23:51 UTC (rev 2481)
@@ -15,7 +15,7 @@
{include file="$blogtemplate/post.template"}
{foreach from=$comments item=comment}
<p class="commentheader">
- <img src="{$url->getUrl("/imgs/comment_icon1.gif")}"/> {$comment->getTopic()} <span class="categoryinfo">[<a href="{$url->replyCommentLink($post,$comment)}">{$locale->tr("reply")}</a>]</span>
+ <img src="{$url->getUrl("/imgs/comment_icon1.gif")}"/> {$comment->getTopic()|strip_tags} <span class="categoryinfo">[<a href="{$url->replyCommentLink($post,$comment)}">{$locale->tr("reply")}</a>]</span>
</p>
<p>
{$comment->getText()}
Modified: plog/trunk/templates/rss/atom.template
===================================================================
--- plog/trunk/templates/rss/atom.template 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/templates/rss/atom.template 2005-09-19 02:23:51 UTC (rev 2481)
@@ -3,7 +3,7 @@
<title>{$blog->getBlog()|escape}</title>
<link rel="alternate" type="text/html" href="{$url->blogLink()}" />
{assign var="newestDate" value=$posts[0]->getDateObject()}
-<modified>{$locale->formatDate($newestDate, "%Y-%m-%dT%H:%M:%SZ")}</modified>
+<modified>{$locale->formatDate($newestDate, "%Y-%m-%dT%H:%M:%S%O", $blog)}</modified>
<tagline>{$blog->getAbout()|escape}</tagline>
<generator url="http://www.plogworld.net/" version="1.0.1">pLog</generator>
{assign var="blogOwner" value=$posts[0]->getUserInfo()}
@@ -14,9 +14,9 @@
<title>{$post->getTopic()|escape}</title>
<link rel="alternate" type="text/html" href="{$url->postPermalink($post)}" />
{assign var="postDate" value=$post->getDateObject()}
- <modified>{$postDate->getW3Date()}</modified>
- <issued>{$locale->formatDate($postDate, "%Y-%m-%dT%H:%M:%S")}</issued>
- <created>{$locale->formatDate($postDate, "%Y-%m-%dT%H:%M:%SZ")}</created>
+ <modified>{$locale->formatDate($postDate, "%Y-%m-%dT%H:%M:%S%O", $blog)}</modified>
+ <issued>{$locale->formatDate($postDate, "%Y-%m-%dT%H:%M:%S%O", $blog)}</issued>
+ <created>{$locale->formatDate($postDate, "%Y-%m-%dT%H:%M:%S%O", $blog)}</created>
<summary type="text/plain">{$post->getText()|strip_tags|truncate:200:" ..."|escape:"html"}</summary>
<author>
{assign var="postOwner" value=$post->getUserInfo()}
Modified: plog/trunk/templates/rss/rss090.template
===================================================================
--- plog/trunk/templates/rss/rss090.template 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/templates/rss/rss090.template 2005-09-19 02:23:51 UTC (rev 2481)
@@ -16,8 +16,9 @@
<description>{$post->getText()|escape}</description>
<link>{$url->postPermalink($post)}</link>
{assign var="postDate" value=$post->getDateObject()}
- <pubDate>{$postDate->getUnixDate()|date_format:"%a, %d %b %Y %H:%M:%S"} +0000</pubDate>
+ <pubDate>{$locale->formatDate($postDate, "%a, %d %b %Y %H:%M:%S %O", $blog)}</pubDate>
</item>
{/foreach}
</rdf:RDF>
-
+
+
Modified: plog/trunk/templates/rss/rss20.template
===================================================================
--- plog/trunk/templates/rss/rss20.template 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/templates/rss/rss20.template 2005-09-19 02:23:51 UTC (rev 2481)
@@ -9,7 +9,7 @@
<title>{$blog->getBlog()|escape}</title>
<link>{$url->blogLink()}</link>
<description>{$blog->getAbout()|escape}</description>
- <pubDate>{$locale->formatDate($now, "%a, %d %b %Y %H:%M:%S")}</pubDate>
+ <pubDate>{$locale->formatDate($now, "%a, %d %b %Y %H:%M:%S %O")}</pubDate>
<generator>http://www.plogworld.net</generator>
{foreach from=$posts item=post}
<item>
@@ -26,7 +26,7 @@
<category>{$category->getName()|escape}</category>
{/foreach}
{assign var="postDate" value=$post->getDateObject()}
- <pubDate>{$locale->formatDate($postDate, "%a, %d %b %Y %H:%M:%S")}</pubDate>
+ <pubDate>{$locale->formatDate($postDate, "%a, %d %b %Y %H:%M:%S %O", $blog)}</pubDate>
<source url="{$url->rssLink("rss20")}">{$blog->getBlog()|escape}</source>
{foreach from=$post->getArticleResources() item=resource}
{** please uncomment the line below if you'd like to server everything but images, instead of
Modified: plog/trunk/templates/standard/postandcomments.template
===================================================================
--- plog/trunk/templates/standard/postandcomments.template 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/templates/standard/postandcomments.template 2005-09-19 02:23:51 UTC (rev 2481)
@@ -20,7 +20,7 @@
<h2>{$locale->tr("comments")}</h2>
{foreach from=$comments item=comment}
-<h3 class="commentheader"><img src="{$url->getUrl("/imgs/comment_icon1.gif")}" alt="Comment Icon" /> {$comment->getTopic()}</h3>
+<h3 class="commentheader"><img src="{$url->getUrl("/imgs/comment_icon1.gif")}" alt="Comment Icon" /> {$comment->getTopic()|strip_tags}</h3>
<p class="commentposterinfo">
{assign var="postDate" value=$comment->getTimestamp()}
Modified: plog/trunk/templates/standard-with-plugins/postandcomments.template
===================================================================
--- plog/trunk/templates/standard-with-plugins/postandcomments.template 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/templates/standard-with-plugins/postandcomments.template 2005-09-19 02:23:51 UTC (rev 2481)
@@ -19,7 +19,7 @@
<h2>{$locale->tr("comments_for_post")}</h2>
{foreach from=$comments item=comment}
-<a name="{$comment->getId()}"><h3 class="commentheader"><img src="{$url->getUrl("/imgs/comment_icon1.gif")}" alt="Comment Icon" /> {$comment->getTopic()}</h3></a>
+<a name="{$comment->getId()}"><h3 class="commentheader"><img src="{$url->getUrl("/imgs/comment_icon1.gif")}" alt="Comment Icon" /> {$comment->getTopic()|strip_tags}</h3></a>
<p class="commentposterinfo">
{assign var="postDate" value=$comment->getTimestamp()}
Modified: plog/trunk/templates/summary/index.template
===================================================================
--- plog/trunk/templates/summary/index.template 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/templates/summary/index.template 2005-09-19 02:23:51 UTC (rev 2481)
@@ -46,7 +46,7 @@
</div>
<div id="column-right">
- <form id="searchForm" method="post" action=".">
+ <form id="searchForm" method="post" action="{$smarty.server.PHP_SELF}">
<fieldset class="inputField">
<h4>{$locale->tr("summary_search_blogs")}</h4>
<div class="field">
Modified: plog/trunk/templates/summary/post.template
===================================================================
--- plog/trunk/templates/summary/post.template 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/templates/summary/post.template 2005-09-19 02:23:51 UTC (rev 2481)
@@ -1,6 +1,6 @@
{assign var="blog" value=$post->getBlogInfo()}
{assign var="request" value=$blog->getBlogRequestGenerator()}
- <h5>{$post->getTopic()}</h5>
+ <h5>{$post->getTopic()|strip_tags}</h5>
<div class="subtitle">
{$locale->tr("blog")} <a href="{$request->blogLink()}">{$blog->getBlog()}</a>
</div>
@@ -19,4 +19,4 @@
<img src="imgs/comment.png" width="11" height="10" alt="{$locale->tr("comments")}" />
<a href="{$request->postPermalink($post)}#comments">{if $post->getTotalComments() eq 0}{$locale->tr("comment on this")}{else}{$post->getTotalComments()} {$locale->tr("comments")|capitalize}{/if}</a>
<br style="clear: both;" />
- </div>
\ No newline at end of file
+ </div>
Modified: plog/trunk/templates/summary/registerstep1.template
===================================================================
--- plog/trunk/templates/summary/registerstep1.template 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/templates/summary/registerstep1.template 2005-09-19 02:23:51 UTC (rev 2481)
@@ -33,9 +33,19 @@
<label for="userPasswordCheck">{$locale->tr("email")}</label>
<span class="required">*</span>
<div class="formHelp">{$locale->tr("email_help")}</div>
- <input type="text" name="userEmail" id="userEmail" value="{$userEmail}"/>
+ <input type="text" name="userEmail" id="userEmail" value="{$userEmail}" />
{include file="summary/validate.template" field=userEmail message=$locale->tr("error_incorrect_email_address")}
</div>
+ {if $useCaptchaAuth}
+ <div class="field">
+ <label for="userAuth">{$locale->tr("auth_img")}</label>
+ <span class="required">*</span>
+ <div class="formHelp">{$locale->tr("auth_img_help")}</div>
+ <img src="{$userAuthImgPath}" alt="CAPTCHA" />
+ <input type="text" name="userAuth" id="userAuth" value="" />
+ {include file="summary/validate.template" field=userAuth message=$locale->tr("error_incorrect_auth_img")}
+ </div>
+ {/if}
</fieldset>
<div class="buttons">
<input type="submit" value="{$locale->tr("register_next")} »" name="Register"/>
Modified: plog/trunk/templates/summary/summary.template
===================================================================
--- plog/trunk/templates/summary/summary.template 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/templates/summary/summary.template 2005-09-19 02:23:51 UTC (rev 2481)
@@ -1,6 +1,6 @@
{include file="summary/header.template"}
{foreach from=$posts item=post}
- <h3>{$post->getTopic()}</h3>
+ <h3>{$post->getTopic()|strip_tags}</h3>
{assign var="postDate" value=$post->getDateObject()}
{assign var="postOwner" value=$post->getUserInfo()}
<span class="date">{$postOwner->getUsername()} | {$locale->formatDate($postDate,"%d %B, %Y %H:%M")}</span>
Modified: plog/trunk/wizard.php
===================================================================
--- plog/trunk/wizard.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/wizard.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -586,6 +586,8 @@
$Inserts[112] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('template_cache_lifetime', '-1', 3);";
$Inserts[113] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('use_http_accept_language_detection', '0', 1);";
$Inserts[114] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('session_save_path', '', 3);";
+$Inserts[115] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('skip_dashboard', '0', 1);";
+$Inserts[116] = "INSERT INTO {dbprefix}config (config_key, config_value, value_type) VALUES('use_captcha_auth', '0', 1);";
/**
* Open a connection to the database
@@ -1376,7 +1378,7 @@
// ---
// add the new configuration settings that were added for 1.0
// ---
- $newSettings = range( 71, 112 );
+ $newSettings = range( 71, 116 );
foreach( $newSettings as $settingId ) {
$setting = $Inserts[$settingId];
$query = str_replace( "{dbprefix}", $this->_dbPrefix, $setting );
Modified: plog/trunk/xmlrpc.php
===================================================================
--- plog/trunk/xmlrpc.php 2005-09-19 01:36:38 UTC (rev 2480)
+++ plog/trunk/xmlrpc.php 2005-09-19 02:23:51 UTC (rev 2481)
@@ -278,6 +278,9 @@
// we have to do this in long way
$blogInfo = $blogsG->getBlogInfo( $blogid );
$url = $blogInfo->getBlogRequestGenerator();
+ // disable the generation of xhtml content or else the IXR_XMLRPC library will
+ // escape things twice!
+ $url->setXHTML( false );
$dummy["htmlUrl"] = $url->categoryLink( $cat );
$dummy["rssUrl"] = "http://";
@@ -312,13 +315,15 @@
$userInfo = $users->getUserInfoFromUsername( $username );
$item = $articles->getUserArticle( $postid, $userInfo->getId() );
+ $dateObject = $item->getDateObject();
+ $time = $dateObject->getTimestamp();
$time = mktime(
- substr($item->_date,8,2),
- substr($item->_date,10,2),
- substr($item->_date,12,2),
- substr($item->_date,4,2),
- substr($item->_date,6,2),
- substr($item->_date,0,4)
+ substr($time,8,2),
+ substr($time,10,2),
+ substr($time,12,2),
+ substr($time,4,2),
+ substr($time,6,2),
+ substr($time,0,4)
);
$dummy = array();
@@ -354,13 +359,15 @@
$userInfo = $users->getUserInfoFromUsername( $username );
$item = $articles->getUserArticle( $postid, $userInfo->getId() );
+ $dateObject = $item->getDateObject();
+ $time = $dateObject->getTimestamp();
$time = mktime(
- substr($item->_date,8,2),
- substr($item->_date,10,2),
- substr($item->_date,12,2),
- substr($item->_date,4,2),
- substr($item->_date,6,2),
- substr($item->_date,0,4)
+ substr($time,8,2),
+ substr($time,10,2),
+ substr($time,12,2),
+ substr($time,4,2),
+ substr($time,6,2),
+ substr($time,0,4)
);
$articleCat = $item->getCategory();
@@ -610,13 +617,15 @@
foreach($list as $item)
{
+ $dateObject = $item->getDateObject();
+ $time = $dateObject->getTimestamp();
$time = mktime(
- substr($item->_date,8,2),
- substr($item->_date,10,2),
- substr($item->_date,12,2),
- substr($item->_date,4,2),
- substr($item->_date,6,2),
- substr($item->_date,0,4)
+ substr($time,8,2),
+ substr($time,10,2),
+ substr($time,12,2),
+ substr($time,4,2),
+ substr($time,6,2),
+ substr($time,0,4)
);
$dummy = array();
@@ -663,13 +672,15 @@
foreach($list as $item)
{
+ $dateObject = $item->getDateObject();
+ $time = $dateObject->getTimestamp();
$time = mktime(
- substr($item->_date,8,2),
- substr($item->_date,10,2),
- substr($item->_date,12,2),
- substr($item->_date,4,2),
- substr($item->_date,6,2),
- substr($item->_date,0,4)
+ substr($time,8,2),
+ substr($time,10,2),
+ substr($time,12,2),
+ substr($time,4,2),
+ substr($time,6,2),
+ substr($time,0,4)
);
$articleCat = $item->getCategory();
More information about the pLog-svn
mailing list