列出文章
|
頁: 1 [2] 3
|
16
|
支援 / 安裝與設定 / Re: 资源中心失效了?
|
於: 一月 26, 2006, 02:33:40 下午
|
谢谢james... 我是试验lifetype的时候自己创建了很多用户,发表了一些测试文章..觉得比较乱,就用wizard.php重建了数据库...现在用户的资源中心都会出错... ...不知道哪里有问题了... 春节快乐...
|
|
|
17
|
支援 / 安裝與設定 / 资源中心失效了?
|
於: 一月 25, 2006, 11:47:16 下午
|
今天数据库出了点问题, 把lifetype的数据库重新建立了一下(使用wizard.php, 和重新安装一样)...现在发现所有用户的资源中心都不能用了, 会出现 "该博客中无可用文件夹" 的错误信息, 在管理界面的"新建资源","新建资源文件夹","资源列表"都工作正常...里面也有内容...不知道什么地方出错了...请指点...谢谢!
|
|
|
22
|
開發 / 模版設計 / Re: 如何將個人圖像寫入模版?
|
於: 一月 11, 2006, 11:45:27 下午
|
hi,markwu 你好, 我的lifetype是1.0.2版本,也遇到了这个问题... 我试验了你的方法, 如果只在panel.template中加入 {if $owner->hasPicture()} {assign var=picture value=$owner->getPicture()} <img src="{$url->resourcePreviewLink($picture)}" alt="{$owner->getUsername()}" /> {/if}
在首页是正常的,但是进入其他页面,如comment,还是会出错的, 但是在前面加入 {assign var=owner value=$blog->getOwnerInfo()} 就好了, 好像是文件没有完全包含进来
|
|
|
23
|
開發 / 核心補強 / Re: 请教如何在summary中加入自己的内容?
|
於: 一月 09, 2006, 05:11:31 下午
|
:-D谢谢les, 是我没有注意大小写的问题... op="InfoHelp" 就ok了...感谢 另外, 我如果有4,5个这样的页面的话就需要把这个步骤重复4,5遍吧? 复制4,5个.class.php文件, 然后生成4,5个template文件吧...
|
|
|
24
|
開發 / 模版設計 / Re: 在summary页面中如何单独控制 foreach 循环的数量?
|
於: 一月 09, 2006, 02:55:15 下午
|
谢谢les的回复... 先放上最原始的方法,直接修改参数...以后熟悉了以后可以加在管理面板中 在 calss/summary/action/summarydefaultaction.class.php中修改summary界面中的显示数目: 使用具体数值替代$this->_numPosts
"最新开通的博客": 第46行: $recentBlogs = $stats->getRecentBlogs( $this->_numPosts );
"最新发表的文章": $recentPosts = $stats->getRecentArticles( $this->_numPosts, $registerTopic, $registerText );
"最活跃的博客": $activeBlogs = $stats->getMostActiveBlogs( 2);
"评论最多的博客": $commentedPosts = $stats->getMostCommentedArticles( $this->_numPosts, $registerTopic, $registerText );
"阅读最多的文章": $readestBlogs = $stats->getMostReadArticles( 5, $registerTopic, $registerText );
|
|
|
25
|
開發 / 核心補強 / Re: 请教如何在summary中加入自己的内容?
|
於: 一月 08, 2006, 11:32:55 下午
|
hi, les 谢谢你的回复, 我根据你的提示修改了一下, 但是还是看不到相应的页面...可能有些地方我没有正确修改吧...下面是我修改的一些代码: infohelpaction.class.php class InfoHelpAction extends SummaryAction {
var $_numPosts;
function InfoHelpAction( $actionInfo, $request ) { $this->SummaryAction( $actionInfo, $request ); $this->_numPosts = $this->_config->getValue( "summary_page_show_max" ); }
/** * Loads the posts and shows them. */ function perform() { $this->_view = new SummaryCachedView( "infohelp", Array( "summary" => "infohelp", "locale" => $this->_locale->getLocaleCode()));
summary.php添加了一行: $_actionMap["InfoHelp"] = "InfoHelpAction";
|
|
|
26
|
開發 / 核心補強 / Re: 请教如何在summary中加入自己的内容?
|
於: 一月 08, 2006, 07:22:20 下午
|
谢谢les.. , 下面是我修改的一些文件的源码 class/summary/action/infohelpaction.class.php(由summarydefaultaction.class.php复制) <?php
include_once( PLOG_CLASS_PATH."class/summary/action/summaryaction.class.php" ); include_once( PLOG_CLASS_PATH."class/summary/dao/summarystats.class.php" ); include_once( PLOG_CLASS_PATH."class/data/timestamp.class.php" ); include_once( PLOG_CLASS_PATH."class/dao/blogs.class.php" ); include_once( PLOG_CLASS_PATH."class/logger/LogUtil.php" );
/** * This is the one and only default action. It simply fetches all the most recent * posts from the database and shows them. The default locale is the one specified * in the configuration file and the amount of posts shown in this page is also * configurable through the config file. */ class SummaryDefaultAction extends SummaryAction {
var $_numPosts;
function SummaryDefaultAction( $actionInfo, $request ) { $this->SummaryAction( $actionInfo, $request ); $this->_numPosts = $this->_config->getValue( "summary_page_show_max" ); }
/** * Loads the posts and shows them. */ function perform() { $this->_view = new SummaryCachedView( "[b][color=Red]infohelp[/color][/b]", Array( "summary" => "[b][color=Red]infohelp[/color][/b]", "locale" => $this->_locale->getLocaleCode())); if( $this->_view->isCached()) { // if the view is already cached... move along! nothing to see here return true; } $blogs = new Blogs(); $stats = new SummaryStats();
// load the posts, filtering out all those registration messages... $registerTopic = $this->_locale->tr( "register_default_article_topic" ); $registerText = $this->_locale->tr( "register_default_article_text" ); $recentPosts = $stats->getRecentArticles( $this->_numPosts, $registerTopic, $registerText ); // get all the blogs $siteBlogs = $blogs->getAllBlogs( true ); $recentBlogs = $stats->getRecentBlogs( $this->_numPosts );
$activeBlogs = $stats->getMostActiveBlogs( $this->_numPosts); $commentedPosts = $stats->getMostCommentedArticles( $this->_numPosts, $registerTopic, $registerText ); $readestBlogs = $stats->getMostReadArticles( $this->_numPosts, $registerTopic, $registerText );
// export all these things to the view $this->_view->setValue( "posts", $recentPosts ); $this->_view->setValue( "recentBlogs", $recentBlogs ); $this->_view->setValue( "activeBlogs", $activeBlogs ); $this->_view->setValue( "commentedPosts", $commentedPosts ); $this->_view->setValue( "readestBlogs", $readestBlogs ); $this->_view->setValue( "blogs", $siteBlogs ); // // :KLUDGE: // we just need a random blog so... we'll get one :) // $randomBlog = array_pop($siteBlogs); $url = $randomBlog->getBlogRequestGenerator(); $this->_view->setValue( "url", $url ); $this->setCommonData();
return true; } } ?>
templates/summary/infohelp.template(由index.template复制) {include file="summary/header.template" selected="index"}
<div id="column-left"> <div id="summary_login"> <form id="loginForm" method="post" action="admin.php"> <fieldset class="inputField" > <h4>{$locale->tr("login")}</h4> <div id="login_bg"> <div class="field"> <label for="userName">{$locale->tr("username")}</label> <input type="text" tabindex="10" name="userName" id="userName" value="" maxlength="50" /> </div> <div class="field"> <label for="userPassword">{$locale->tr("password")}</label> <input type="password" tabindex="11" name="userPassword" id="userPassword" maxlength="50" /> </div> <input type="submit" class="button" name="Login" value="{$locale->tr("login")}" tabindex="12" id="login"/> <input type="hidden" name="op" value="Login" /> <span style="float:right; margin-top:-20px;"><a href="?op=resetPasswordForm">{$locale->tr("password_forgotten")}</a></span> </div> </fieldset> </form> </div> <div id="newblogs"> <h4>{$locale->tr("summary_newest_blogs")}</h4> <ul class="itemList"> {foreach from=$recentBlogs item=blog} {assign var="url" value=$blog->getBlogRequestGenerator()} {** remove this if you're having problems with blogs in encondings other than iso-8859-1 **} <li class="item"><a href="{$url->blogLink()}" title="{$blog->getBlog()|strip_tags}">{$blog->getBlog()|strip_tags|truncate:30:"..."}</a></li> {/foreach} </ul> </div> <div id="links"> <h4>{$locale->tr("summary_links")}</h4> <ul> <li><a href="http://www.revefrance.com/bbs" target="_blank">a</a></li> <li><a href="http://www.revefrance.com" target="_blank">b</a></li> <li><a href="http://www.revefrance.com" target="_blank">c</a></li> <li><a href="http://www.revefrance.com" target="_blank">d</a></li> </ul> </div> <!--<div id="links"> <h4>{$locale->tr("summary_statistics")}</h4> <ul> <li><a href="http://www.revefrance.com/bbs" target="_blank">a</a></li> <li><a href="http://www.revefrance.com" target="_blank">f</a></li> <li><a href="http://www.revefrance.com" target="_blank">e</a></li> <li><a href="http://www.revefrance.com" target="_blank">w</a></li> </ul> </div>--> </div>
<div id="maincolumn"> <div id="intro"> <div id="intro_title"> <div id="fp_left"><img src="imgs/fp_left.jpg" /></div> <div id="title">{$locale->tr("summary_welcome")}</div> <div id="fp_right"><img src="imgs/fp_right.jpg" /></div> </div> <div id="intro_text"> 欢迎欢迎,热烈欢迎... You should place here whatever welcome message you would like your users to see. Or remove this one completely and rearrange the whole page. Or something :) Take a look at templates/summary, that is where all template files that make up this page are stored. You are free to change them in any way you like. </div> </div> <div id="help">Our help information put here...</div> <div id="privacy" style="display:none;">{include file="summary/info_privacy.template"}</div> <div id="statement" style="display:none;">{include file="summary/info_statement.template"}</div> <div id="aboutus" style="display:none;">{include file="summary/info_aboutus.template"}</div> <div id="contact" style="display:none;">{include file="summary/info_contact.template"}</div> <div id="help" style="display:none;">{include file="summary/info_help.template"}</div> <script src="js/ui/info.js" type="text/javascript"></script> </div>
<div id="column-right"> <form id="searchForm" method="post" action="."> <fieldset class="inputField"> <div id="search_title"><img src="imgs/new/search.gif" width="16" height="16" />{$locale->tr("summary_search_blogs")}</div> <div id="search_box"> <div class="field"> <label for="searchTerms">{$locale->tr("search_terms")}</label><br /> <input type="text" tabindex="20" name="searchTerms" id="searchTerms" value="" /> </div> <input type="hidden" name="op" value="summarySearch" /> <input type="submit" class="button" name="summarySearch" value="{$locale->tr("search")}" tabindex="21" id="summarysearch"/> </div> </fieldset> </form> <div id="mab_title">{$locale->tr("summary_most_active_blogs")}</div> <ul class="itemList"> {foreach from=$activeBlogs item=blog} {assign var="url" value=$blog->getBlogRequestGenerator()} <li class="item"><a href="{$url->blogLink()}" title="{$blog->getBlog()|strip_tags}">{$blog->getBlog()|strip_tags|truncate:23:"..."}</a></li> {/foreach} </ul>
<div id="mca_title">{$locale->tr("summary_most_commented_articles")} {if $commentedPosts} <a href="{$url->getRssUrl()}?summary=1&type=mostcommented" > <img src="{$url->getUrl("/imgs/rss_logo_small.gif")}" alt="RSS"/></a> {/if} </div> {foreach name=commented from=$commentedPosts item=post} {if $smarty.foreach.commented.first} <ul class="itemList"> {/if} {assign var="blog" value=$post->getBlogInfo()} {assign var="url" value=$blog->getBlogRequestGenerator()} <li class="item"> <a href="{$url->postPermalink($post)}" title="{$post->getTopic()|strip_tags}">{$post->getTopic()|strip_tags|truncate:18:"..."} ({$post->getTotalComments()})</a><br /> </li> {if $smarty.foreach.commented.last} </ul> {/if} {/foreach}
<div id="mra_title">{$locale->tr("summary_most_read_articles")} {if $readestBlogs} <a href="{$url->getRssUrl()}?summary=1&type=mostread"> <img src="{$url->getUrl("/imgs/rss_logo_small.gif")}" alt="RSS" /></a> {/if} </div> {foreach name=readest from=$readestBlogs item=post} {if $smarty.foreach.readest.first} <ul class="itemList"> {/if} {assign var="blog" value=$post->getBlogInfo()} {assign var="url" value=$blog->getBlogRequestGenerator()} <li class="item"> <a href="{$url->postPermalink($post)}" title="{$post->getTopic()|strip_tags}">{$post->getTopic()|strip_tags|truncate:17:"..."} ({$post->getNumReads()})</a><br /> </li> {if $smarty.foreach.readest.last} </ul> {/if} {/foreach} </div> </div><br /> {include file="summary/footer.template"}
上面就是2个修改的文件...谢谢各位...
|
|
|
27
|
開發 / 核心補強 / Re: 请教如何在summary中加入自己的内容?
|
於: 一月 08, 2006, 02:09:10 下午
|
谢谢 les的回复... 我用你提供的步骤试验了一下, 没有成功.. ...不知道哪里有问题.. 还有就是用 http://BLOG-URL/summary.php?op=infohelp 来访问,还是使用 http://BLOG-URL/summary.php?op=display&page=infohelp 来访问呢? 我使用 op=infohelp 一直显示的是summary页面, 使用 op=display&page=infohelp 能显示出infohelp.template的内容,但是其他部份还是显示不出来... 谢谢!
|
|
|
28
|
開發 / 模版設計 / 在summary页面中如何单独控制 foreach 循环的数量?
|
於: 一月 07, 2006, 10:11:32 下午
|
在"管理设置"中可以在"汇总设置" 设置summary_page_show_max 在summary页面中显示的项目数, 但是这个项目数控制着"最新开通的博客","最近发表的文章","最活跃的博客","评论最多的文章","阅读最多的文章" 这些内容的数目, 不知道怎样能将这些内容的显示数量进行单独控制呢? 比如显示 10 个"最新开通的博客", 5个"阅读最多的文章"...这样就可以协调一下summary的页面结构了...谢谢指点!
|
|
|
29
|
開發 / 核心補強 / Re: utf-8下的字符串截取问题?能否自行添加截取函数?
|
於: 一月 07, 2006, 09:57:52 下午
|
参考了一些文章, 发现这个是smarty的问题, 对utf-8编码的中文截取不支持, 找了一个可以截取utf8中文的函数,替换掉了class/template/smarty/plugins/modifier.truncate.php 文件里面的truncate函数, 就可以了 还有个问题, 就是用来替换的这个函数比较简单, 不能对英文根据单词截取.. ..希望有高手能完善一下...
|
|
|
|
|
|