关于 wfdownloads 的 Headers already sent 错误... [技术论坛 - 使用问答]

正在浏览:   1 名游客


 到底部   前一个主题   下一个主题  [无发表权] 请登录或者注册



关于 wfdownloads 的 Headers already sent 错误...
高级会员
注册日期:
2004/11/25 22:59
所属群组:
注册会员
帖子: 110
等级: 9; EXP: 50
HP : 0 / 212
MP : 36 / 927
离线

下载的时候 显示 Headers already sent ..
有人遇到吗?
具体怎么解决?

2005/3/12 13:30
应用扩展 工具箱


Re: 关于 wfdownloads 的 Headers already sent 错误...
高级会员
注册日期:
2004/11/25 22:59
所属群组:
注册会员
帖子: 110
等级: 9; EXP: 50
HP : 0 / 212
MP : 36 / 927
离线

已解决:
打开 visit.php, 找到:

if (!headers_sent())
        {
            echo 
"
            <h4><img src='" 
XOOPS_URL "/modules/wfdownloads/images/icon/downloads.gif' align='middle' alt='' /> " _MD_WFD_DOWNINPROGRESS "</h4>n
            <div>" 
_MD_WFD_DOWNSTARTINSEC "</div><br />n
            <div>" 
_MD_WFD_DOWNNOTSTART "n
            <a href='$url' target='_blank'>" 
_MD_WFD_CLICKHERE "</a>.n
            </div>n"
;

            if (!empty(
$url))
            {
                
header("Cache-Control: no-store, no-cache, must-revalidate");
                
header("Cache-Control: post-check=0, pre-check=0"false); 
                
// HTTP/1.0
                
header("Pragma: no-cache"); 
                
// Date in the past
                
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); 
                
// always modified
                
header("Last-Modified: " gmdate("D, d M Y H:i:s") . " GMT");
                
header("Refresh: 3; url=$url");
            } 
            else
            {
                include 
XOOPS_ROOT_PATH '/header.php';
                echo 
"<br /><div align='center'>" wfd_imageheader() . "</div>";
                
reportBroken($lid);
            } 
        } else {
            die(
"Headers already sent"); 
        }


更改为:

echo "
  <h4><img src='" 
XOOPS_URL "/modules/wfdownloads/images/icon/downloads.gif' align='middle' alt='' /> " _MD_WFD_DOWNINPROGRESS "</h4>n
  <div>" 
_MD_WFD_DOWNSTARTINSEC "</div><br />n
  <div>" 
_MD_WFD_DOWNNOTSTART "n
  <a href='$url' target='_blank'>" 
_MD_WFD_CLICKHERE "</a>.n
  </div>n"
;

  if (!empty(
$url))
            {
                
header("Cache-Control: no-store, no-cache, must-revalidate");
                
header("Cache-Control: post-check=0, pre-check=0"false); 
                
// HTTP/1.0
                
header("Pragma: no-cache"); 
                
// Date in the past
                
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); 
                
// always modified
                
header("Last-Modified: " gmdate("D, d M Y H:i:s") . " GMT");
                
// header("Refresh: 3; url=$url");
    
echo "<meta http-equiv="refresh" content="3;url=$url">rn";
            } 
            else
            {
                include 
XOOPS_ROOT_PATH '/header.php';
                echo 
"<br /><div align='center'>" wfd_imageheader() . "</div>";
                
reportBroken($lid);
            }


具体见: http://www.wf-projects.com/modules/ipboard/index.php?showtopic=284&st=20&#entry2781


顺便修正 topten.php, 更改所有内容为:
<?php
/**
 * $Id: topten.php v 1.0.3 06 july 2004 Liquid Exp $
 * Module: WF-Downloads
 * Version: v2.0.5a
 * Release Date: 26 july 2004
 * Author: WF-Sections
 * Licence: GNU
 */

include 'header.php';
include_once 
XOOPS_ROOT_PATH '/class/xoopstree.php';

global 
$xoopsDB$xoopsUser;

$mytree = new XoopsTree($xoopsDB -> prefix('wfdownloads_cat'), "cid""pid");
$xoopsOption['template_main'] = 'wfdownloads_topten.html';

$groups = (is_object($xoopsUser)) ? $xoopsUser -> getGroups() : XOOPS_GROUP_ANONYMOUS;
$module_id $xoopsModule -> getVar('mid');
$gperm_handler = & xoops_gethandler('groupperm');

include 
XOOPS_ROOT_PATH '/header.php';

$action_array = array('hit' => 0'rate' => 1);
$list_array = array('hits''rating');
$lang_array = array(_MD_WFD_HITS_MD_WFD_RATING);

$sort = (isset($_GET['list']) && in_array($_GET['list'], $action_array)) ? $_GET['list'] : 'rate';
$hit $action_array[$sort];
$sortDB $list_array[$hit];

$catarray['imageheader'] = wfd_imageheader();
$catarray['letters'] = wfd_letters();
$catarray['toolbar'] = wfd_toolbar();
$xoopsTpl -> assign('catarray'$catarray);

$arr = array();
$result $xoopsDB -> query("SELECT cid, title FROM " $xoopsDB -> prefix('wfdownloads_cat') . " WHERE pid=0");

$e 0;
$rankings = array();
while (list(
$cid$ctitle) = $xoopsDB -> fetchRow($result))
{
    if (
$gperm_handler -> checkRight('WFDownCatPerm'$cid $groups$module_id))
    {
        
$query "SELECT lid, cid, title, hits, rating, votes, platform FROM " $xoopsDB -> prefix('wfdownloads_downloads') . " WHERE published > 0 AND published <= " time() . " AND (expired = 0 OR expired > " time() . ") AND offline = 0 AND (cid=$cid";
        
$arr $mytree -> getAllChildId($cid);
        for(
$i 0;$i count($arr);$i++)
        {
            
$query .= " or cid=" $arr[$i] . "";
        } 
        
$query .= ") order by " $sortDB " DESC";
        
$result2 $xoopsDB -> query($query100);
        
$filecount $xoopsDB -> getRowsNum($result2);

        if (
$filecount 0)
        {
            
$rankings[$e]['title'] = $myts -> htmlSpecialChars($ctitle);
            
$rank 1;

            while (list(
$did$dcid$dtitle$hits$rating$votes) = $xoopsDB -> fetchRow($result2))
            {
                if (
$gperm_handler -> checkRight('WFDownFilePerm'$did$groups$xoopsModule -> getVar('mid')))
                {
                    
$catpath $mytree -> getPathFromId($dcid"title");
                    
$catpath basename($catpath);

                    
$dtitle $myts -> htmlSpecialChars($dtitle);
                    
//if ($catpath != $ctitle)
                    //{
                    //    $dtitle = $myts -> htmlSpecialChars($ctitle); //. $ctitle;
                    //} 

                    
$rankings[$e]['file'][] = array('id' => $did'cid' => $dcid'rank' => $rank'title' => $dtitle'category' => $catpath'hits' => $hits'rating' => number_format($rating2), 'votes' => $votes);
                    
$rank++;
                } 
            } 
            
$e++;
        } 
    } 


$xoopsTpl -> assign('lang_sortby' $lang_array[$this]);



$xoopsTpl -> assign('rankings'$rankings);
include 
XOOPS_ROOT_PATH '/footer.php';

include 
'footer.php';

?>

2005/3/12 14:10
应用扩展 工具箱


Re: 关于 wfdownloads 的 Headers already sent 错误...
Support Team
注册日期:
2004/9/22 16:33
来自 中国郑州
所属群组:
注册会员
帖子: 104
等级: 9; EXP: 20
HP : 0 / 205
MP : 34 / 1001
离线
呵呵
还真没有遇到过

2005/3/13 21:27
_________________
Open in new window

小小油灯,点燃心灵,心理评论,心灵之约,四季爱情,爱情36计
应用扩展 工具箱


Re: 关于 wfdownloads 的 Headers already sent 错误...
中级会员
注册日期:
2005/5/3 22:39
所属群组:
注册会员
帖子: 53
等级: 6; EXP: 12
HP : 0 / 128
MP : 17 / 395
离线
是什么造成的?
为什么会开始好而忽然出问题?

2005/6/3 10:35
应用扩展 工具箱



 回顶部   前一个主题   下一个主题

 [无发表权] 请登录或者注册


可以查看帖子.
不可发帖.
不可回复.
不可编辑自己的帖子.
不可删除自己的帖子.
不可发起投票调查.
不可在投票调查中投票.
不可上传附件.
不可不经审核直接发帖.

[高级搜索]