关于编码的问题 iconv('utf-8', 'gb2312', $string);还不明白就查看php手册里的详细函数介绍 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Call to undefined function: iconv() <?php/*** @version $Id: mod_latest_topics_ipb.php,v 1.2 2005/07/25 06:49:01 mamhoo Exp $* @package Mamhoo* @copyright (C) mamhoo.com* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL*//*Module desc : Show specific forum's latest topics or all latest topics of IPB 1.3 , 2.0.x . Params: count : Topics Count, default value is 5 addon_tableprefix : IPB Table Prefix, default value is 'ibf_' addon_url : IPB Forum URL, use either reletive URL or absolute URL, defaulte value is 'addons/ipb/' category_id : IPB Forum ID,input the forum category id ( table forums' id field ), leave blank will show topics from all forumsAuthor: Mamhoo, [email protected]Url : http://www.mamhoo.com*/defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );$count = intval( $params->get( 'count', 5 ) );$ipb_tableprefix = $params->get( 'addon_tableprefix', "ibf_" );$ipb_url = $params->get( 'addon_url', "addons/ipb/" );$ipb_category_id = $params->get( 'category_id', -1 );$ipb_forums_table = $ipb_tableprefix . "forums";$ipb_topic_table = $ipb_tableprefix . "topics";$ids = null;if ( $ipb_category_id > -1) { // get the forums id of the specific category id $query=" SELECT id FROM $ipb_forums_table WHERE parent_id = $ipb_category_id "; $database->setQuery($query); $ids = $database->loadResultArray(); if ( !empty( $ids ) ) { $ids = implode( ",", $ids ); }}// get the latest topics, limit by $count$query = "SELECT tid, title, views FROM $ipb_topic_table ";if ( !empty( $ids ) ) { $query .= " WHERE forum_id IN ( $ids ) ";}$query .= " ORDER BY start_date DESC LIMIT 0, $count ";$database->setQuery($query);$rows =$database->loadObjectList();if ( $rows ) { // Output echo '<ul>'; foreach( $rows as $row ) { $title = $row->title; $tid = $row->tid; $topic_url= $ipb_url . "index.php?showtopic=".$tid; echo '<li><a href="'.$topic_url.'" target=_blank>' . $title . '</a></li>'; } echo '</ul>';}?>原来的代码是这样的要怎么修改才能转码啊 哪位大虾指点一下啊我不大熟悉这方面的东西 看来是调 $title 然后输出吧你先配置好 iconv 函数吧。不知道你的php版本是多少假如 iconv 函数能用的话 可以这么写$title = iconv('utf-8', 'gb2312', $title);如果 iconv 函数用不了自己写一个 utf8 转 gb2312 的类,或函数。 看来你的环境不支持iconv函数,你用的是虚拟空间?还是你自己的服务器?php的版本是多少? 是虚拟主机PHP版本是4.3.11 php 怎么生成jar文件呢? 散分了 关于上传文件的几个方法 做虚拟主机php.ini文件要怎么设置? php+mysql????? 大家帮忙看一段程序 从别的网址连接到我的网站,怎么在我的网站上判断连接过来的网址? 请教宇凡---关于提取html文件原代码 比较两种php调用Java对象的方法 我的这个读取与写入统计txt哪里有问题? php如何做批量处理? 会用mail()函数的来帮帮忙
/**
* @version $Id: mod_latest_topics_ipb.php,v 1.2 2005/07/25 06:49:01 mamhoo Exp $
* @package Mamhoo
* @copyright (C) mamhoo.com
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*//*
Module desc : Show specific forum's latest topics or all latest topics of IPB 1.3 , 2.0.x .
Params:
count : Topics Count, default value is 5
addon_tableprefix : IPB Table Prefix, default value is 'ibf_'
addon_url : IPB Forum URL, use either reletive URL or absolute URL, defaulte value is 'addons/ipb/'
category_id : IPB Forum ID,input the forum category id ( table forums' id field ), leave blank will show topics from all forums
Author: Mamhoo, [email protected]
Url : http://www.mamhoo.com
*/defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
$count = intval( $params->get( 'count', 5 ) );
$ipb_tableprefix = $params->get( 'addon_tableprefix', "ibf_" );
$ipb_url = $params->get( 'addon_url', "addons/ipb/" );
$ipb_category_id = $params->get( 'category_id', -1 );$ipb_forums_table = $ipb_tableprefix . "forums";
$ipb_topic_table = $ipb_tableprefix . "topics";$ids = null;
if ( $ipb_category_id > -1) {
// get the forums id of the specific category id
$query=" SELECT id FROM $ipb_forums_table WHERE parent_id = $ipb_category_id ";
$database->setQuery($query);
$ids = $database->loadResultArray();
if ( !empty( $ids ) ) {
$ids = implode( ",", $ids );
}
}// get the latest topics, limit by $count
$query = "SELECT tid, title, views FROM $ipb_topic_table ";
if ( !empty( $ids ) ) {
$query .= " WHERE forum_id IN ( $ids ) ";
}
$query .= " ORDER BY start_date DESC LIMIT 0, $count ";
$database->setQuery($query);
$rows =$database->loadObjectList();
if ( $rows ) {
// Output
echo '<ul>';
foreach( $rows as $row ) {
$title = $row->title;
$tid = $row->tid;
$topic_url= $ipb_url . "index.php?showtopic=".$tid;
echo '<li><a href="'.$topic_url.'" target=_blank>' . $title . '</a></li>';
}
echo '</ul>';
}
?>
原来的代码是这样的
要怎么修改才能转码啊
哪位大虾指点一下啊
我不大熟悉这方面的东西
PHP版本是4.3.11