1
noo-b
mydownloads and search engine ?
  • 2010/3/17 3:13

  • noo-b

  • Just can't stay away

  • Posts: 456

  • Since: 2007/10/23


mydownload 1.6 XOOPS 2.4.4

in search engine google and yahoo

it index the brokenfile.php instead of the download link singlefile.php

search result link
xxxxxxxxxxxmodules/mydownloads/brokenfile.php?lid=18
xxxxxxxxxxxmodules/mydownloads/brokenfile.php?lid=34
xxxxxxxxxxxmodules/mydownloads/brokenfile.php?lid=66

you can copy this to google search box to see


allinurl:modules/mydownloads/brokenfile.php


how to fix this ?


thiss the brokenfile.php

// $Id: brokenfile.php,v 1.10 2004/12/26 19:11:55 [url=http://xoopscube.jp/userinfo.php?uid=1]Onokazu[/url] Exp $
//  ------------------------------------------------------------------------ //
//                XOOPS - PHP Content Management System                      //
//                    Copyright (c) 2000 XOOPS.org                           //
//                                                    //
// ------------------------------------------------------------------------- //
//  This program is free software; you can redistribute it and/or modify     //
//  it under the terms of the GNU General Public License as published by     //
//  the Free Software Foundation; either version 2 of the License, or        //
//  (at your option) any later version.                                      //
//                                                                           //
//  You may not change or alter any portion of this comment or credits       //
//  of supporting developers from this source code or any supporting         //
//  source code which is considered copyrighted (c) material of the          //
//  original comment or credit authors.                                      //
//                                                                           //
//  This program is distributed in the hope that it will be useful,          //
//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //

include 'header.php';
$myts =& MyTextSanitizer::getInstance(); // MyTextSanitizer object
$categories mydownloads_MygetItemIds();

if (!empty(
$_POST['submit'])) {
    if (empty(
$xoopsUser)) {
        
$sender 0;
    } else {
        
$sender $xoopsUser->getVar('uid');
    }
    
$ip getenv('REMOTE_ADDR');
    
$lid intval($_POST['lid']);
    
$result $xoopsDB->query('SELECT cid FROM '.$xoopsDB->prefix('mydownloads_downloads').' WHERE lid='.$lid);
    if(
$result) {
        
$myrow $xoopsDB->fetchArray($result);
        if(!
in_array($myrow['cid'], $categories)) {
            
redirect_header(XOOPS_URL2_NOPERM);
            exit();
        }
    } else {
        exit();
    }
    if ( 
$sender != ) {
        
// Check if REG user is trying to report twice.
        
$result $xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix('mydownloads_broken')." WHERE lid=$lid AND sender=$sender");
        list (
$count)=$xoopsDB->fetchRow($result);
        if ( 
$count ) {
            
redirect_header("index.php",2,_MD_ALREADYREPORTED);
            exit();
        }
    } else {
        
// Check if the sender is trying to vote more than once.
        
$result=$xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix("mydownloads_broken")." WHERE lid=$lid AND ip = '$ip'");
        list (
$count)=$xoopsDB->fetchRow($result);
        if ( 
$count ) {
            
redirect_header("index.php",2,_MD_ALREADYREPORTED);
            exit();
        }
    }
    
$newid $xoopsDB->genId($xoopsDB->prefix('mydownloads_broken')."_reportid_seq");
    
$sql sprintf("INSERT INTO %s (reportid, lid, sender, ip) VALUES (%u, %u, %u, '%s')"$xoopsDB->prefix("mydownloads_broken"), $newid$lid$sender$ip);
    
$xoopsDB->query($sql) or exit();
    
$tags = array();
    
$tags['BROKENREPORTS_URL'] = XOOPS_URL '/modules/' $xoopsModule->getVar('dirname') . '/admin/index.php?op=listBrokenDownloads';
    
$notification_handler =& xoops_gethandler('notification');
    
$notification_handler->triggerEvent('global'0'file_broken'$tags);
    
redirect_header("index.php",2,_MD_THANKSFORINFO);
    exit();
} else {
    
$xoopsOption['template_main'] = 'mydownloads_brokenfile.html';
    include 
XOOPS_ROOT_PATH.'/header.php';
    
// Hack made by Hervé Thouzard (http://www.herve-thouzard.com)
    
$lid intval($_GET['lid']);
    
$sql="SELECT l.title, l.cid, t.description FROM ".$xoopsDB->prefix('mydownloads_downloads')." l, ".$xoopsDB->prefix("mydownloads_text")." t WHERE l.lid=".$lid." and l.lid=t.lid";
    
$result $xoopsDB->query($sql);
    
$myrow $xoopsDB->fetchArray($result);
    if(!
in_array($myrow['cid'], $categories)) {
        
redirect_header(XOOPS_URL2_NOPERM);
        exit();        
    }
    
mydownloads_create_page_title($myrow['title'], _MD_REPORTBROKEN);
    
mydownloads_create_meta_description($myrow['title'].' - '._MD_REPORTBROKEN);
    
mydownloads_create_meta_keywords($myrow['description']);
    
// End Hack
    
$xoopsTpl->assign('module_name'$xoopsModule->getVar('name'));
    
$xoopsTpl->assign('lang_reportbroken'_MD_REPORTBROKEN);
    
$xoopsTpl->assign('file_id'intval($_GET['lid']));
    
$xoopsTpl->assign('lang_thanksforhelp'_MD_THANKSFORHELP);
    
$xoopsTpl->assign('lang_forsecurity'_MD_FORSECURITY);
    
$xoopsTpl->assign('lang_cancel'_MD_CANCEL);
    include_once 
XOOPS_ROOT_PATH.'/footer.php';
}
?>



broken file template

<br /><br />

<
p align="center">
    <
a href="<{$xoops_url}>/modules/mydownloads/index.php"><img src="<{$xoops_url}>/modules/mydownloads/images/logo-en.gif" alt="" border="0" />a>
p>
<
br /><br /><br />

<
div align='center'>
  <
h4><{$lang_reportbroken}>h4>
  <
form action="brokenfile.php" method="post">
    <
input type="hidden" name="lid" value="<{$file_id}>" /><{$lang_thanksforhelp}><br /><{$lang_forsecurity}><br /><br /><input type="submit" name="submit" value="<{$lang_reportbroken}>" />&nbsp;<input type=button value="<{$lang_cancel}>" onclick="javascript:history.go(-1)" />
  form>
div>
<
br />

Login

Who's Online

329 user(s) are online (221 user(s) are browsing Support Forums)


Members: 0


Guests: 329


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits