Jump to content


Photo

Changing some code in index.php


  • Please log in to reply
5 replies to this topic

#1 mas123

mas123

    Junior Member

  • Member
  • Pip
  • 11 posts
  • Gender:Male
  • Main OS: Windows 8

Posted 22 August 2011 - 04:29 AM

thanks for unformserver team,
I suggest to change the php code of the index.php in the root of the server to the one attached to this post.
to display the server projects(folders) and server php files.
the changes is to put this code after line 86
<tr><td colspan="3" style="text-align: center;"><h2>Server Projects</h2></td></tr><?php $n = 0;
foreach (scandir("./") as $file){
	if (is_dir($file) && !in_array($file, array(".", "..", "css", "images"))){
		$n++;
		echo ($n % 2 == 0 ? "<td>$n - <a href='" . $file . "' target='_blank'>" . $file . "</a></td></tr>" : "<tr><td>$n - <a href='" . $file . "' target='_blank'>" . $file . "</a></td><td></td>");
	}
}
echo ($n == 0 ? "<tr><td style='color: red;' colspan='3'>There is no folders in the server root.</td></tr>" : ($n % 2 == 0 ? "" : "<td></td></tr>"));?>
   <tr><td colspan="3" style="text-align: center;"><h2>Server Php Files</h2></td></tr><?php $n = 0;
foreach (scandir("./") as $file){
	if (strtolower(strrchr($file, '.'))==".php" ){
		$n++;
		echo ($n % 2 == 0 ? "<td>$n - <a href='" . $file . "' target='_blank'>" . $file . "</a></td></tr>" : "<tr><td>$n - <a href='" . $file . "' target='_blank'>" . $file . "</a></td><td></td>");
	}
}
echo ($n == 0 ? "<tr><td style='color: red;' colspan='3'>There is no Php Files in the server root.</td></tr>" : ($n % 2 == 0 ? "" : "<td></td></tr>"));?>
hope to be good for you.
M.A.S

Attached Files



#2 BobS

BobS

    Project Helper

  • Super Moderator
  • PipPipPip
  • 334 posts
  • Location:Santiago Chile
  • Interests:Retiring, computer systems, system design, model railroads....
  • Wiki ID: BobS
  • Main OS: Windows 7

Posted 05 December 2011 - 09:44 AM

Thanks mas123!

This was a good idea. I had seen similar action in another WAMP and had thought of swiping the code.
A modified version of your code is now in 8-Coral www\index.php, and I wanted to give you credit for inspiring it.

Regards,
BobS

#3 traxxus

traxxus

    Member

  • Member
  • PipPip
  • 80 posts
  • Location:Switzerland
  • Main OS: Windows 7

Posted 10 January 2012 - 06:13 AM

HI

I don't know is this an bug or volitional. If you open the index.php page remotely (not from localhost) the design disappears:

Attached File  10_01_2012_12_10_21.png   21.19KB   54 downloads

#4 traxxus

traxxus

    Member

  • Member
  • PipPip
  • 80 posts
  • Location:Switzerland
  • Main OS: Windows 7

Posted 17 January 2012 - 04:33 AM

Ok since 8.1.0RC2 this problem is fixed. Thanks.

#5 BobS

BobS

    Project Helper

  • Super Moderator
  • PipPipPip
  • 334 posts
  • Location:Santiago Chile
  • Interests:Retiring, computer systems, system design, model railroads....
  • Wiki ID: BobS
  • Main OS: Windows 7

Posted 17 January 2012 - 07:47 AM

It was resolved by copying the CSS and images back to the www folder. Since there were two .htaccess files restricting access, the us_splash copy would disallow access to the css/images, while the www would allow the text.

Regards.
BobS

#6 seoinheritx

seoinheritx

    Junior Member

  • Member
  • Pip
  • 13 posts
  • SourceForge ID1
  • Wiki ID: 2
  • IRC Nickname: seoinheritx
  • Main OS: Windows Vista

Posted 31 January 2012 - 01:44 AM

If its necessary to change the coding style and add the necessary function in it.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users