默认效果是 ,作者一行, 日期一行.
现在更改为: 作者,日期, 点击数为一行.
修改方法:
content.html.php
790行左右. [搜索 Writes Author name]
将 function Author 及 function CreateDate两个函数替换为下面的:
/**
* Writes Author name
*/
function Author( &$row, &$params ) { //hack by Autoit
}
/**
* Writes Create Date
*/
function CreateDate( &$row, &$params ) { //hack by Autoit
$create_date = null;
if ( intval( $row->created ) != 0 ) {
$create_date = mosFormatDate( $row->created );
}
?>
<span class="small">
<?php
if ( ( $params->get( 'author' ) ) && ( $row->author != '' ) ) {
echo '<img src="../images/author.gif" align="top" alt="Author"/>'
. _WRITTEN_BY . ' '.( $row->created_by_alias ? $row->created_by_alias : $row->author ) .' | ' ; }
if ( $params->get( 'createdate' ) ) {
echo '<img src="../images/date.gif" align="top" alt="Date"/> Date:' . $create_date .' | ' ; }?>
<img src="../images/view.gif" align="top" alt="View Count"/> View: <?php echo $row->hits; ?>
</span>
<?php
}
/** 然后把author.gif,date.gif,view.gif小图片下到你的 /images/下面就ok了!
效果就是排为一行...
注: 如果上面 View的值一直为 0 的话,
将 content.php 1750 行的
$row->hits = 0;
改为:
//$row->hits = 0; //by Autoit
如果你还想把下面的 "单元-分类" 也显示在一行的话,那么这样做:
大概在754行[我的改过了,所以不是很准,但可以根据下面的搜索]
/**
* Writes Section
*/
function Section( &$row, &$params ) {
if ( $params->get( 'section' ) ) {
?>
<span>
<?php
echo $row->section;
// writes dash between section & Category Name when both are active
if ( $params->get( 'category' ) ) {
echo ' - ';
}
?>
</span>
<?php
}
}
/**
* Writes Category
*/
function Category( &$row, &$params ) {
if ( $params->get( 'category' ) ) {
?>
<span>
<?php
echo $row->category;
?>
</span>
<?php
}
}替换为:
/**
* Writes Section
*/
function Section( &$row, &$params ) {
}
/**
* Writes Category
*/
function Category( &$row, &$params ) {
} 然后把此文章第一段里的:
<?php
}
/** 替换为:
<?php if ( $params->get( 'section' ) ) {?>
<span> | <img src="../images/sc.gif" align="top" alt="section & Category "/>
<?php
echo $row->section;
// writes dash between section & Category Name when both are active
if ( $params->get( 'category' ) ) {
echo ' - ';
}
?>
</span>
<?php } if ( $params->get( 'category' ) ) {
?>
<span>
<?php
echo $row->category;
?>
</span>
<?php
}
}
/** 然后把找个sc.gif小图片放到你的 /images/下面就ok了!
当然上面的<span>可以删减掉.,.让代码更少些...
如果你的站点使用 blog 方式浏览的话. 那么还需要改:
function showBlogSection [content.php 630 行附近] 这段
在他下面大概65行左右的:
// Main data query
$query = "SELECT a.id, a.title, a.title_alias,
替换为:
// Main data query
$query = "SELECT a.id, a.title, a.title_alias, a.hits,
这样在你blog浏览的时候, views 就不会为空了.
End.