Results 1 to 2 of 2

Thread: Anyone know how...

  1. #1
    Join Date
    Dec 2004
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post Anyone know how...

    Hi,

    I have a site with alot of pages and I would like to find a script that would allow me to post a code in the links box and be able to add or remove links without having to do it page by page.Like with a admin part or similar.Any help is most greatly appreciated

    Kind regards

    Mav

  2. #2
    Join Date
    Aug 2006
    Posts
    239
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    include "links.inc"?

    But seriously, if there files are scattered across countless directories, it will be much more difficult.

    Gona take some time to write that, but you could use this:
    Code:
    $dir_handle = opendir("$pwd");
    
    $f = 1; $d = 1
    			
    for ($x = 1; $x < 900; $x++) {
    	$element = readdir($dir_handle);
    	if (($element) && ($element != ".") && ($element != "..") {
    		if (is_dir("$pwd/$element")) {
    			$dirs[$d] = $element;
    			$d++;
    		} else if (strpos("$element", ".htm") !== false) {
    			$files[$f] = array("name" => "$element", "title");
    			$tmpcontent = file_get_contents("$pwd/$element");
    			$tmptitle = substr($tmpcontent, stripos($tmpcontent, "<title>"), stripos($tmpcontent, "</title>"));
    			if ($tmptitle == "") $tmptitle = $element;
    			$files[$f][title] = $tmptitle;
    			unset($tmptitle, $tmpcontent);
    			$f++;
    		}
    	}
    }
    
    if (sizeof($dirs) > 0) {
    	sort($dirs);
    	reset($dirs);
    }
    
    if (sizeof($files) > 0) {
    	sort($files);
    	reset($files);
    }
    To be continued.
    Last edited by ItsMeOnly; 08-11-2006 at 12:30 AM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •