pragmaMx Support Forum

Archive => veraltete bzw. unsupportete Systeme und Module => Alt Archive => PHPNuke 5.2-6.0 & VKP 5.5 => Thema gestartet von: Melissengeist am 23 Mai 2002, 14:39:04

Titel: Plant jemand ein Sitemap-Modul für VKP 5.5?
Beitrag von: Melissengeist am 23 Mai 2002, 14:39:04
Hi zusammen,

plant jemand ein Site-Map Modul fürs VKP 5.5 oder hat es sowas in der Art schonmal für eine andere Nukeversion gegeben?

Viele Grüße
Melissengeist[Bearbeitet am: 23/5/2002 von Melissengeist]
Titel: Re: Plant jemand ein Sitemap-Modul für VKP 5.5?
Beitrag von: Jochen am 23 Mai 2002, 18:28:36
Also ich hab das schon mal auf einer der tausenden Nukepages, auf denen ich war, schon mal gesehen. Aber wo das war weiß ich nicht mehr. Also Download gabs das aber noch nirgends.
Titel: Re: Plant jemand ein Sitemap-Modul für VKP 5.5?
Beitrag von: Sven am 23 Mai 2002, 18:49:09
Habe eines gefunden. Aber läuft bei mir net richtig. Mal schauen. Wer es ausprobieren will, kann es  unter http://www.it-fragen.info/downloads/Site_Mapper.zip runterladen und testen.
Titel: Re: Plant jemand ein Sitemap-Modul für VKP 5.5?
Beitrag von: jogi24 am 23 Mai 2002, 22:48:33
hi
site-mapper ??

was soll dieses teil denn tun,
helft doch mal en nuker auf die sprünge.
:( :( :(
Titel: Re: Plant jemand ein Sitemap-Modul für VKP 5.5?
Beitrag von: Sven am 23 Mai 2002, 23:28:17
hi,

ne Sitemap ist im Prinzip ein komplett Verzeichnis deiner Seite. Das tolle Teil will nur bei mir komischerweise immer den Localhost nehmen :). Ich knöpfe es mir mal vor.
Titel: Re: Plant jemand ein Sitemap-Modul für VKP 5.5?
Beitrag von: jogi24 am 23 Mai 2002, 23:40:26
hi
in den script musst du deine URL angeben.

suche mal im script nach localhost.

bei mir kommen aber trotzdem fehler.

er giebt mir zwar die url und die ip aus, das wars dann aber

 ;) ;)
Titel: Re: Plant jemand ein Sitemap-Modul für VKP 5.5?
Beitrag von: Jochen am 24 Mai 2002, 14:02:14
Vielleicht kennt ja einer von euch noch eine funktionierende Version?
Titel: Re: Plant jemand ein Sitemap-Modul für VKP 5.5?
Beitrag von: Sven am 25 Mai 2002, 08:55:25
Hi@ Jogi24
habe ich schon gemacht. Das Teil nimmt immer noch localhost. Na ja. Mal in Ruhe anschauen.
Titel: Re: Plant jemand ein Sitemap-Modul für VKP 5.5?
Beitrag von: henne am 04 Juni 2002, 10:06:39
du brauchst nur in dieser zeile:

 if (!isset($url))      $url  = "deine url/";

deine Url angeben und dann funktioniert das modul

siehe:
http://www.windowshelpdesk.de/modules.php?name=Site_Mapper

ciao henne
Titel: Re: Plant jemand ein Sitemap-Modul für VKP 5.5?
Beitrag von: Sven am 04 Juni 2002, 10:49:33
Hi,

Manchmal siehr man halt den Wald vor lauter Bäumen nicht ;). Hast recht, den Punkt da unten hatte ich übersehen. Funzt also das Teil.
Titel: Re: Plant jemand ein Sitemap-Modul für VKP 5.5?
Beitrag von: Schaum am 15 Januar 2003, 17:35:26
hallo,
ich habe localhost überall entfernt finde aber trotzdem nicht den Fehler!
 Ich bekomme immer wieder diesen Fehler:

Falsche URL. It must begin with http://www.mailhilfe.de


Zitat<html>
<head>
<title> SITEMAPPER a PHP script to create WEB site maps Copyright (C) 2001 Earl C. Terwilliger</title>
<meta name="Copyright" contents="Copyright (C) 2001 Earl C. Terwilliger earlt@agent-source.com">
<meta name="Description" contents="PHP script">
</head>
<?php
if (!eregi("modules.php",$PHP_SELF))
   die ("You can't access this file directly...");
include ("header.php");
$index=1;
$ModName = basename( dirname( __FILE__ ) );

/*************************************************

SITEMAPPER.PHP Version: 1.1
Copyright (c): 2001 Earl C. Terwilliger all rights reserved

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.

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.

If you would like a copy of the GNU General Public License
write to the:

Free Software Foundation, Inc.
59 Temple Place - Suite 330
Boston, MA  02111-1307
USA

To get the latest version of this program, point your
browser to:

http://www.agent-source.com/sitemapper

or contact the author at:

earlt@agent-source.com

*************************************************/

 function get_headers($host, $path = "/")
 {
  $fp = fsockopen ("$host", 80, &$errno, &$errstr) or die("Socket Open Error: $errno  Reason: $errstr");
  fputs($fp,"GET $path HTTP/1.0\n\n");
  while (!$end) {
    $line = fgets($fp, 2048);
    if (trim($line) == "") $end = true;
    printf("%s<br>\n",$line);
  }
  fclose($fp);
  printf("<hr>\n");
 }
 function get_url_page($url)
 {
   static $contents = "";
   static $prev_url = "";
   if ($url == $prev_url) return $contents;
   $contents = @file($url);
   if (empty($contents)) $contents = @file($url);
   $prev_url = $url;
   return $contents;
 }
 function list_url_page($fcontents) {
   while (list ($line_num, $line) = each ($fcontents)) {
      printf("<b>Line %s:</b> %s <br>\n",$line_num,htmlspecialchars($line));
   }
 }
 function url_page_links($fcontents) {
   $contents = implode("", $fcontents);
   preg_match_all("|href=\"?([^\"' >]+)|i", $contents, $arrayoflinks);
   return $arrayoflinks;
 }
 function make_url($url,$link) {
   global $host;
   $purl = parse_url($url);
   $path = $purl[path];

   $u = "http://www.mailhilfe.de/".$host;

   if (!isset($path)) {
     if (substr($link,0,1) == "/") $u .= $link;
     else                          $u .= "/".$link;
     return $u;
   }
   
   $p = explode("/",$path);
   array_pop($p);
   array_shift($p);
   $c = count($p);

   $l = explode("/",$link);
   $d = count($l);
   for($e=0;$e<$d;++$e) {
      if ($l[$e] == "..") --$c;
   }

   if ($c > 0) for($e=0;$e<$c;++$e) $u .= "/".$p[$e];
   
   if ($d == 0) {
     if (substr($link,0,1) == "/") $u .= $link;
     else                          $u .= "/".$link;
     return $u;
   }

   for($e=0;$e<$d;++$e) {
      if (substr($l[$e],0,1) == ".") continue;
      $u .= "/".$l[$e];
   }
   return $u;
 }
 function parse_links($url,$links) {
   global $host;
   global $mp;
   global $pages;
   global $mpages;
   while(list(,$link) = each($links[1])) {
       if (substr($link,0,1) == "\\")     continue;
       if (substr($link,0,1) == "#")      continue;
       if (substr($link,0,4) == "http")   {
           printf(" <a href=\"%s\">%s</a><br>\n",$link,$link);        
           continue;
       }
       if (substr($link,0,6) == "mailto") continue;
       if (substr($link,0,7) == "sitemap") continue;
       $nurl = make_url($url,$link);
       if ((substr($nurl,-3) == "htm")  ||
           (substr($nurl,-4) == "html") ||
           (substr($nurl,-3) == "php")) {
               if (!check_link($nurl)) {
                 $p = get_url_page($nurl);
                 if (empty($p)) {
                     $mpages[] = $nurl;
                     $mp += 1;
                     printf(" <a name=\"MPage%d\">%s</a><br>\n",$mp,$nurl);
                     printf(" |__Unable to retrieve this page ...<br>\n");
                     continue;
                 }
                 else $pages[] = $nurl;
               }
       }
       printf(" <a href=\"%s\">%s</a><br>\n",$nurl,$nurl);
   }
 }
 function index_page($url) {
   global $host;
   global $pc;
   global $list;
   printf("<br><a name=\"Page%d\">%s</a><br>\n",$pc+1,$url);
   printf("<a href=\"%s\">%s</a><br>\n",$url,$url);
   $p = get_url_page($url);
   if (empty($p)) {
       printf("|__Unable to retrieve this page ...<br>\n");
       return 0;
   }
   if ($list) list_url_page($p);
   $links = url_page_links($p);
   parse_links($url,$links);
 }
 function check_link($entry) {
    global $pages;
    reset($pages);
    while(list(,$link) = each($pages)) {
        if($entry == $link) return 1;
    }
    return 0;
 }
 if (!isset($list))     $list = 0;
 if (!isset($url))      $url  = "http://www.mailhilfe.de/";
 if (!isset($headers))  $headers = 1;
 if (substr($url,0,7) != "http://www.mailhilfe.de/") {
     printf("<br>Falsche URL. It must begin with http://www.mailhilfe.de <br>\n");
     exit();
 }
 $purl = parse_url($url);
 $host = $purl[host];
 printf("<center>Site Map: <a href=\"%s\">%s</a>    IP: %s</center><br><hr>\n",$url,$url,gethostbyname($host));
 $pages[] = $url;
 $mpages[] = "";
 $mp = 0;
 array_pop($mpages);
 if ($headers) get_headers($host);
 $pc = 0;
 while(1) {
   $url = $pages[$pc];
   if(empty($url)) break;
   index_page($url);
   flush();
   $pc += 1;
 }
 $pc = count($pages);
 printf("<br><br>.... %03d Seiten Indexed ....<br><br>\n",$pc);
 reset($pages);
 $pc = 0;
 while($pages[$pc]) {
    $link = $pages[$pc];
    printf("<a href=\"#Page%d\">%03d</a> <a href=\"%s\">%s</a><br>\n",$pc+1,$pc+1,$link,$link);
    ++$pc;
 }
 $mp = count($mpages);
 printf("<br><br>.... %03d Pages Missing [Broken Links] ....<br><br>\n",$mp);
 reset($mpages);
 $mp = 0;
 while($mpages[$mp]) {
    $link = $mpages[$mp];
    printf("<a href=\"#MPage%d\">%03d</a> <a href=\"%s\">%s</a><br>\n",$mp+1,$mp+1,$link,$link);
    ++$mp;
 }
?>

<?php
include ("footer.php");
?>



was habe ich übersehen?
Titel: Re: Plant jemand ein Sitemap-Modul für VKP 5.5?
Beitrag von: jubilee am 15 Januar 2003, 18:17:06
Hallo !
 
Zitatif (substr($url,0,7) != "http://www.mailhilfe.de/") {
printf("Falsche URL. It must begin with http://www.mailhilfe.de \n");
Das bedeutet, wenn Variable $url von Position 0 bis Position 7
ungleich http://www.mailhilfe.de ist, dann mit der Fehlermeldung
"Falsche URL. It must begin with http://www.mailhilfe.de " abbrechen.
nun von Position 0 bis Position 7 kann aber höchsten http:// drinstehen.
Also würde ich den Wert einmal anpassen  (substr($url,0,23)
 ;)
MfG
jubilee

[Editiert am 15/1/2003 von SiteAdmin jubilee]
Titel: Re: Plant jemand ein Sitemap-Modul für VKP 5.5?
Beitrag von: Schaum am 15 Januar 2003, 19:15:25
Danke für den Hinweis!
Allerdings muß die Zeile so aussehen:
 
Zitatif (substr($url,0,7) != "http://") {
printf("<br>Falsche URL. It must begin with http://www.mailhilfe.de <br>\n");

 

also ohne www.mailhilfe.de
Danke :P
Titel: Re: Plant jemand ein Sitemap-Modul für VKP 5.5?
Beitrag von: jubilee am 15 Januar 2003, 19:18:25
Naja, kommt halt drauf an wie Du das einsetzen willst.
Auf jeden Fall lag der Fehler in  dieser Routine.
MfG
jubilee
Titel: Re: Plant jemand ein Sitemap-Modul für VKP 5.5?
Beitrag von: Schaum am 15 Januar 2003, 19:40:24
So jetzt habe ich mir das Ergebnis des Moduls mal angesehen...
Kannst du mir vielleicht sagen was ich wie ändern muß, damit nicht die Links angezeigt werden, sondern die Überschriften der Artikel!
So das ein Besucher auch gleich weiß was sich dahinter verbirgt.

 :redhead:
Titel: Re: Plant jemand ein Sitemap-Modul für VKP 5.5?
Beitrag von: jubilee am 15 Januar 2003, 20:03:24
Nunja, das wird schwierig.
Ich denke,
dafür müsste man das komplette Modul umbauen, damit es die Seiten so parst wie Du es möchtest.
MfG
jubilee
Titel: Re: Plant jemand ein Sitemap-Modul für VKP 5.5?
Beitrag von: Schaum am 15 Januar 2003, 20:08:23
schade ich dachte müßte nur einen entsprechenden Befehl zusetzen....