歡迎光臨, 訪客. 請先 登入註冊一個帳號.
十一月 23, 2024, 09:32:56 上午
19595 文章 在 3865 主題 由 4579 會員
最新註冊會員: aa123aa1
  列出文章
頁: [1]
1  開發 / 核心補強 / Re: plog首页(index.php?blogId=X)文章有现成的分页处理吗? 於: 十二月 01, 2005, 08:37:42 上午
在后台管理的
管理设置=>全局设置=>模板设置
中的template_cache_enabled
设置为否

请问楼主,小弟依葫芦画瓢,但是上传defaultaction.class.php后首页一点变化也没有,不知是不是还要有其他的地方要修改呀!请教请教!  傷心 傷心 傷心 傷心
2  開發 / 核心補強 / Re: plog首页(index.php?blogId=X)文章有现成的分页处理吗? 於: 十一月 28, 2005, 02:26:00 下午
在后台,把模板设置中的cache设置为否,分页搞定!
3  支援 / 使用與操作 / Re: 试问为什么不能上传BMP格式的图片文件? 於: 十一月 25, 2005, 10:49:07 上午
very sorry ! 吐舌頭 没能神会MARK兄的意思

不能正常显示的是更换imagemagick后上传的缩图,没有任何错误提示。但从imagemagick 介绍文档中它是支持jpg/gif格式的 。

BTW: 不知是否方便向MARK兄在线请教,我的MSN:ffsword@hotmail.com ,or anything else?

天阿!ffsword  !

真的是我問一句你答一句嗎?這樣下去,我可能會先放棄。

1. 是先前已經縮圖的圖無法顯示
2. 還是現在新上傳的無法產生縮圖
3. 有沒有 error log

如果你在是這樣簡單,但是卻沒有內容的回答。

sigh ... 我可能會選擇不回答。 傷心

Mark

4  支援 / 使用與操作 / Re: 试问为什么不能上传BMP格式的图片文件? 於: 十一月 25, 2005, 10:07:20 上午
无法显示压缩图

可以阿!我的沒問題,你的出現什麼問題呢?無法顯現?是無法顯現縮圖,還是無法顯現原圖?

Mark
5  支援 / 使用與操作 / Re: 试问为什么不能上传BMP格式的图片文件? 於: 十一月 25, 2005, 09:14:58 上午
目前GD只支持GIF、JPG、PNG、WBMP、XBM等几种格式,如果你需要缩图部分
支持BMP缩图,可以使用imagemagick. 然后在 管理设置----资源中心 在thumbnail_method
一栏改为imagemagick,接着还需要在 path_to_convert 一栏输入 imagemagick的路径。

imagemagick 可以在这里下载:http://www.imagemagick.org/script/index.php

说明:我自己使用freebsd主机,确认可以使用 imagemagick,windows主机我还没使用过。
但 imagemagick 有windows版本的,相信没问题,试好了,记住回来汇报哦。   開懷大笑

ps: 这篇应该发在 使用与操作 区比较合适,我不能移动这个区的帖子,请有权限的版主代劳。谢谢。

换成了imagemagick ,可以上传BMP图片,但JPG/GIF,上传后不能正常显示了 :(
6  支援 / 使用與操作 / Re: 试问为什么不能上传BMP格式的图片文件? 於: 十一月 23, 2005, 11:33:52 下午
谢谢LSS的回复  微笑
并不是因为Bmp文件大的原因,而是目前lifetype/plog 文件上传不支持bmp格式文件,上传部分出错信息:

Exception message: Trying to generate a thumbnail of an unsupported format!
Error code: 0
-- Backtrace --
/blog/plog/class/gallery/resizers/gallerygdresizer.class.php(90): throw
/blog/plog/class/gallery/resizers/gallerygdresizer.class.php(44): gallerygdresizer.thumbnail
/blog/plog/class/gallery/resizers/galleryresizer.class.php(151): gallerygdresizer.generate
/blog/plog/class/gallery/dao/galleryresources.class.php(466): galleryresizer.generate
/blog/plog/class/gallery/dao/galleryresources.class.php(579): galleryresources.generateresourcethumbnail
/blog/plog/class/action/admin/adminaddresourceaction.class.php(78): galleryresources.addresource
/blog/plog/class/controller/controller.class.php(306): adminaddresourceaction.perform
/blog/plog/admin.php(49): admincontroller.process

Exception message: Trying to generate a thumbnail of an unsupported format!

bmp 圖檔一般而言檔案都很大,是否大過 2M Bytes ?或是你自己設定的上傳檔案大小限制?

上传操作后,bmp图片文件能够上传到服务器,但是不能正常显示。
7  支援 / 使用與操作 / 试问为什么不能上传BMP格式的图片文件? 於: 十一月 23, 2005, 08:38:35 下午
RT。
想实现BMP上传
8  開發 / 核心補強 / Re: plog首页(index.php?blogId=X)文章有现成的分页处理吗? 於: 十一月 06, 2005, 02:12:40 下午
俺对首页的分页处理是参照 adminpostslistview.class.php ,
defaultaction.class.php 修改代码如下:

<?php

   include_once( PLOG_CLASS_PATH."class/action/blogaction.class.php" );
    include_once( PLOG_CLASS_PATH."class/view/defaultview.class.php" );
    include_once( PLOG_CLASS_PATH."class/net/http/session/sessioninfo.class.php" );
    include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
    include_once( PLOG_CLASS_PATH."class/view/errorview.class.php" );
   include_once( PLOG_CLASS_PATH."class/view/view.class.php" );
   include_once( PLOG_CLASS_PATH."class/plugin/pluginmanager.class.php" );   
   include_once( PLOG_CLASS_PATH."class/data/pager/pager.class.php" );

    /**
     * \ingroup Action
     * @private
     *
     * This class represents the defaut view in our application
     */
   class DefaultAction extends BlogAction
   {

      var $_config;
        var $_date;
        var $_categoryId;
      var $_categoryName;
      var $_userId;
      var $_userName;
      var $_postAmount;
      var $_page;       //add by FFS

      function DefaultAction( $actionInfo, $request )
        {
         $this->BlogAction( $actionInfo, $request );
         // add by FFS (for show page)
         //$this->_page = view::getCurrentPageFromRequest();      
         if ($_REQUEST["page"]=="")
            $this->_page = 1;
         else
            $this->_page = $_REQUEST["page"];
        }

        function validate()
        {
            // value of the Date parameter from the request
            $this->_date = $this->_request->getValue( "Date", -1 );

         $this->_categoryName = $this->_request->getValue( 'postCategoryName' );
            $this->_categoryId = $this->_request->getValue( 'postCategoryId' );
            /* if( $this->_categoryId == '' )
               if( $this->_date == -1 )
                   $this->_categoryId = 0;
                else
                   $this->_categoryId = -1; */
         // **** add ****
         if( $this->_categoryId == '' )
               $this->_categoryId = -1;
         // **** end ***
         $this->_userId = $this->_request->getValue( 'userId', -1 );
         $this->_userName = $this->_request->getValue( 'userName' );

            return true;
        }

        /**
         * Executes the action
         */
        function perform()
        {
           // first of all, we have to determine which blog we would like to see
         $blogId = $this->_blogInfo->getId();

            // fetch the settings for that blog
            $blogSettings = $this->_blogInfo->getSettings();

            // prepare the view
           $this->_view = new DefaultView( $this->_blogInfo,
                                         Array( "categoryId" => $this->_categoryId,
                            "blogId" => $this->_blogInfo->getId(),
                            "categoryName" => $this->_categoryName,
                        "date" => $this->_date,
                        "userName" => $this->_userName,
                        "userId" => $this->_userId ));
                                           
         // check if everything's cached because if it is, then we don't have to
         // do any work... it's already been done before and we should "safely" assume
         // that there hasn't been any change so far
         if( $this->_view->isCached()) {
            return true;
         }

            // if we got a category name instead of a category id, then we
            // should first look up this category in the database and see if
            // it exists
            $categories = new ArticleCategories();
            if( $this->_categoryName ) {
                $category = $categories->getCategoryByName( $this->_categoryName, $this->_blogInfo->getId());
                if( !$category ) {
                    $this->_view = new ErrorView( $this->_blogInfo );
                    $this->_view->setValue( 'message', "error_incorrect_category_id" );
                    $this->setCommonData();
                    return false;
                }
               
                // if everything went fine...
                $this->_categoryId = $category->getId();
            }
         else {
            // we don't do anything if the cateogry id is '0' or '-1'
            if( $this->_categoryId > 0 ) {
               $category = $categories->getCategory( $this->_categoryId, $this->_blogInfo->getId());
               if( !$category ) {
                  $this->_view = new ErrorView( $this->_blogInfo );
                  $this->_view->setValue( 'message', "error_incorrect_category_id" );
                  $this->setCommonData();
                  return false;
               }
            }
         }
         
         // export the category object in case it is needed
            if( isset($category) )
                $this->_view->setValue( "category", $category );         
         

            $users = new Users();

            // if we got a user user id, then we should first look up this id
            // user in the database and see if it exists
            if( $this->_userId > 0) {
                $user = $users->getUserInfoFromId( $this->_userName );
                if( !$user ) {
                    $this->_view = new ErrorView( $this->_blogInfo );
                    $this->_view->setValue( 'message', 'error_incorrect_user_id' );
                    $this->setCommonData();
                    return false;
                }
            }

            // if we got a user name instead of a user id, then we
            // should first look up this user in the database and see if
            // it exists
            if( $this->_userName ) {
                $user = $users->getUserInfoFromUsername( $this->_userName );
                if( !$user ) {
                    $this->_view = new ErrorView( $this->_blogInfo );
                    $this->_view->setValue( 'message', 'error_incorrect_user_id' );
                    $this->setCommonData();
                    return false;
                }
               
                // if everything went fine...
                $this->_userId = $user->getId();
            }

            // export the owner. The owner information should get from blogInfo directly
            $this->_view->setValue( "owner", $this->_blogInfo->getOwnerInfo() );
         
            $t = new Timestamp();
            $todayTimestamp = $t->getTimestamp();
         
            // amount of posts that we have to show, but keeping in mind that when browsing a
            // category or specific date, we should show *all* of them
           
         /* if( $this->_date > 0 || $this->_categoryId > 0 ) {
                $this->_postAmount = -1;
                // also, inform the template that we're showing them all!
                $this->_view->setValue( 'showAll', true );
            }
            else { */
                $this->_postAmount = $blogSettings->getValue( 'show_posts_max' );
                $this->_view->setValue( 'showAll', false );
            /* } */
         
            //
            // :KLUDGE:
            // the more things we add here to filter, the more complicated this function
            // gets... look at this call and look at how many parameters it needs!! 傷心
            //
         
         if( ($blogSettings->getValue( 'show_future_posts_in_calendar')) && ( $this->_date > -1 )) {
            // if posts in the future are to be shown, we shouldn't set a maximum date
            $blogArticles = $this->articles->getBlogArticles( $blogId,
                                                  $this->_date,
                                                  $this->_postAmount,
                                                  $this->_categoryId,
                                                  POST_STATUS_PUBLISHED,
                                                  $this->_userId ,
                                                  0,  // no maxdate
                                                   '', // current search terms
                                                   $this->_page);
            $numPosts = $this->articles->getNumBlogArticles( $blogId,
                                                  $this->_date,
                                                  $this->_postAmount,
                                                  $this->_categoryId,
                                                  POST_STATUS_PUBLISHED,
                                                  $this->_userId ,
                                                  0,  // no maxdate
                                                   '', // current search terms
                                                   $this->_page);
                                                 
                                                
         }
         else {
            $blogArticles = $this->articles->getBlogArticles( $blogId,
                                                  $this->_date,
                                                  $this->_postAmount,
                                                  $this->_categoryId,
                                                  POST_STATUS_PUBLISHED,
                                                  $this->_userId,
                                                  $todayTimestamp,
                                                   '', // current search terms
                                                   $this->_page );
            $numPosts = $this->articles->getNumBlogArticles( $blogId,
                                                  $this->_date,
                                                  $this->_postAmount,
                                                  $this->_categoryId,
                                                  POST_STATUS_PUBLISHED,
                                                  $this->_userId,
                                                  $todayTimestamp,
                                                   '', // current search terms
                                                   $this->_page );
         }

            // if we couldn't fetch the articles, send an error and quit
            if( count($blogArticles) == 0 ) {
               $this->_view = new ErrorView( $this->_blogInfo );
                $this->_view->setValue( 'message', 'error_fetching_articles' );
            }
            else {
               // otherwise, continue
                // the view will take care of cutting the post if we have the "show more"
                // feature enabled or not... we could do it here but I think that belongs
                // to the view since it is presentation stuff... It could also be handled
                // by the template but then it'd make the template a little bit more
                // complicated...
            
            // ---
            // before finishing, let's see if there's any plugin that would like to do
            // anything with the post that we just loaded
            // ---
            $pm =& PluginManager::getPluginManager();
            $pm->setBlogInfo( $this->_blogInfo );
            $pm->setUserInfo( $this->_userInfo );
            $result = $pm->notifyEvent( EVENT_POSTS_LOADED, Array( 'articles' => &$blogArticles ));
            $articles = Array();
            foreach( $blogArticles as $article ) {
               $postText = $article->getIntroText();
               $postExtendedText = $article->getExtendedText();
               $pm->notifyEvent( EVENT_TEXT_FILTER, Array( "text" => &$postText ));
               $pm->notifyEvent( EVENT_TEXT_FILTER, Array( "text" => &$postExtendedText ));
               $article->setIntroText( $postText );
               $article->setExtendedText( $postExtendedText );
               array_push( $articles, $article );
            }
            // add by FFS  (for show page)
            $blog = $this->_blogInfo;
            $blog_id = $blog->getId();
            
            $pager = new Pager( "?blogId=".$blog_id."&amp;page=",
                             $this->_page,
                        $numPosts,
                        $this->_postAmount );
            $this->_view->setValue( 'pager', $pager );
               $this->_view->setValue( 'posts', $articles );
            }

            $this->setCommonData();
            // save the information about the session for later
            $this->saveSession();

            return true;
        }
    }
?>

//*************************************************************************************
出现的问题:

页面cache不能刷新,所以点击分页下拉框,总是在原来的页面,不能跳转,把cache删除后点击分页下拉框则可以跳过去
9  開發 / 核心補強 / Re: 发表日志的文本输入框上方JS控件按钮中文化问题 於: 十一月 06, 2005, 10:12:09 上午

已转换为utf-8,不是显示为乱码,而是JS编辑功能条显示不了,JS提示的错误是 tooltips项为空,多刷新几次页面有时JS编辑功能条又正常
10  開發 / 核心補強 / Re: plog首页(index.php?blogId=X)文章有现成的分页处理吗? 於: 十一月 06, 2005, 10:05:10 上午
能否先提供一下解决思路,俺急用。

我已加的分页问题如下:
页面cache不能刷新,所以点击"下一页",总是在原来的页面,不能跳转,把cache删除后点击"下一页"则可以跳过去(:) 不知我把问题说明白了没有~?)
11  開發 / 核心補強 / plog首页(index.php?blogId=X)文章有现成的分页处理吗? 於: 十一月 05, 2005, 10:15:29 下午
plog首页(index.php?blogId=X)文章有现成的分页处理吗?
现在的首页是没有分页的。
12  開發 / 核心補強 / 发表日志的文本输入框上方JS控件按钮中文化问题 於: 十一月 05, 2005, 03:49:52 下午
发表日志的文本输入框上方JS控件按钮中文化问题:
把 js/htmlarea/lang/en.js
中 tooltips 项内容改为中文,会经常出错,大家又没有遇到这个问题,怎么解决的?
13  開發 / 外掛程式 / Re: 整合一个外部登录和plog登录遇到的问题 於: 十月 31, 2005, 10:43:34 上午
登录的问题在NBA23的帮助下得到解决,是由于外部登录页和plog中admin.php不在同一目录下原因。或者把外部登录页置于站点根目录也可以。

BTW:为什么会由于目录不同出现前面这问题?
14  開發 / 外掛程式 / 整合一个外部登录和plog登录遇到的问题 於: 十月 30, 2005, 10:52:21 下午
根据论坛中大家讨论的方法,写的外部登录程序如下:

<?php
    define('PLOG_CLASS_PATH','../../web/plog/');
    include_once( PLOG_CLASS_PATH."class/controller/admincontroller.class.php" );
    include_once( PLOG_CLASS_PATH."class/net/http/session/sessionmanager.class.php" );
    include_once( PLOG_CLASS_PATH."class/dao/userinfo.class.php" );
    include_once( PLOG_CLASS_PATH."class/dao/bloginfo.class.php" );

   $userName = $_REQUEST["user_name"];
   $userPassword = $_REQUEST["password"];


     // initialize the session
     SessionManager::init();
   
    // 產生一個新的 user 物件
    $users = new Users();
   
                                   if( $users->authenticateUser( $userName, $userPassword )) {
            
      // 取得 userInfo 物件 (透過正確的 username 與 password)
      $userInfo = $users->getUserInfo( $userName, $userPassword );
      // 取得使用者的 blog list
      $userBlogs = $users->getUsersBlogs( $userInfo->getId(), BLOG_STATUS_ACTIVE );
      // 用第一個 blog 來當作 blogID,並取得這個 blog ID 的 blogInfo
      $blogInfo = end( $userBlogs );
      // 取得 session
      //print_r($session = HttpVars::getSession());
      $session = HttpVars::getSession();
      
      $sessionInfo = $session["SessionInfo"];
      // 並且把資料寫入session
      $sessionInfo->setValue( "userInfo", $userInfo );
      $sessionInfo->setValue( "blogInfo", $blogInfo );
      $session["SessionInfo"] = $sessionInfo;
      
      HttpVars::setSession( $session );
            
      echo "<script language='Javascript'>";
      echo "location.href='../../web/plog/login.php';";
      echo "</script>";
      //header("location: ../../web/plog/login.php");
   }else{
      echo "用户名或密码有误!重新<a href='javascript:window.history.back()'>登录</a>";
   }

?>


从这个文件跳到plog的admin.php,出现的还是登录页面。在admin.php中print_r($_SESSION); ,发现数组值为空。

请问这是咋回事?
頁: [1]