Server Help

Non-Subspace Related Coding - PHP-based File Browser

Cerium - Sun Mar 26, 2006 12:48 pm
Post subject: PHP-based File Browser
Ok, Ive competely ripped this apart and recoded it...

The new script is a fully customizable file browser. It can do everything it did before, except the protocol can now be changed, and the portion of the script which builds content based on user selection is now done through plugins.
The html is virtually the same, so its still 100% valid xhtml strict. The javascript has been touched up so it works in FF as well as IE and Opera.
The display framework can now be easily modified to embed the script into existing pages by changing the write_html_header and write_html_footer functions.
A fully functional version is up at http://hybrid.shanky.com/misc/cfb for those of you who want to see what it looks like now, which isnt that much different.

The only 'issue' I have yet to resolve is with the file images. I didnt change out the windows media circle image for files, so it may look a bit odd when you have html files with that icon. The 'img/file.png' image can be swapped out for a more generic 16x16px icon if desired.

As of right now I dont have any plugins completed, but I will upload those as I get around to finishing the mms and zip plugins. Others I will leave up to you guys.


Also, BDAltWins: I still hate you and I still want you to die.
D1st0rt - Sun Mar 26, 2006 2:46 pm
Post subject:
You don't have any Armin Van Buuren or Toby Emerson? Should probably get on that.
BDwinsAlt - Sun Mar 26, 2006 5:51 pm
Post subject:
When i click a link it takes me to a lan ip. Might wanna fix that.
Cerium - Sun Mar 26, 2006 8:41 pm
Post subject:
...

Are you sure? Really?
BDwinsAlt - Mon Mar 27, 2006 5:21 pm
Post subject:
On your site it shows this link for mp3s.
"mms://192.168.0.1/music/mp3s"

On the download it shows the same, so I know it can be configured.
Cyan~Fire - Mon Mar 27, 2006 5:45 pm
Post subject:
Well, just look at the header:
Code: Show/Hide
<span class="header">mms://192.168.0.1/</span>

Cerium - Mon Mar 27, 2006 6:02 pm
Post subject:
I was being sarcastic in my last post. Im well aware it points to a lan IP -- ITS A DEMO!

I understand hes trying to be all helpful and accepted and what not, but for christs sake, theres a goddamn red and white banner explaining that none of the links will work.


Hell, the only reason I even provided the demo is because I dont expect a lot of people to know what MMS is, or what a publishing point is. In reality, this is nothing more than a glorified file-browser aimed for use with a specific server application. I figured maybe some people on here would be interested in the script so they could employ/improve similar features on their own websites. In no way did I intend people to think I was providing a streaming media service with MGBs/Shankys bandwidth.
BDwinsAlt - Mon Mar 27, 2006 8:27 pm
Post subject:
Since when do people take time to read the directions? We click and go. You could show a demo that works :lol:
Cerium - Mon Mar 27, 2006 10:20 pm
Post subject:
And you could step infront of a moving truck, ass.

MGB, I would appreciate it if you deleted all of the posts after distorts, please and thank you.
Mine GO BOOM - Mon Mar 27, 2006 11:36 pm
Post subject:
Cerium wrote:
In no way did I intend people to think I was providing a streaming media service with MGBs/Shankys bandwidth.

Actually, for the domain shanky.com for the month of march, we only use 16% of the allowed bandwidth. We still have around 90 gig worth of bandwidth if you'd like to host a couple of small media files.

Cerium wrote:
MGB, I would appreciate it if you deleted all of the posts after distorts, please and thank you.

Sad part is, I did the same thing. People do just randomly click on things without reading. I at least looked at the link's URLs and knew it wasn't going to work, and figured it was intentional.
Mine GO BOOM - Mon Mar 27, 2006 11:40 pm
Post subject:
Play Selected goes to misc/cpl/index.php which doesn't exist on the demo. Clear selected doesn't do anything. This was all testing on an old version of Firefox. Build ID: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4 ID:2005051112
Maverick - Tue Mar 28, 2006 1:18 am
Post subject:
BDWinsAlt you are a moron.

Cerium, can you explain what MMS exactly is, what its purpose is (etc etc) and how this neat looking script fits in? icon_smile.gif
Oh it can also be used for file browsing (should have read that before icon_redface.gif) but that is neat biggrin.gif
Cerium - Tue Mar 28, 2006 9:59 am
Post subject:
Well in short, MMS is a protocol for on-demand streaming audio. I dont know the exact details on how the backend works, but in WMP you can fast forward/rewind/etc as if all of the media files are on your machine. The only downside is that in WMP it displays the entire playlist as a single entry, and the name of that entry changes when you press forward/back -- hence the need for this script.

The script is simply a file browser that has the default (hard coded, in this case) protocol set to 'mms'. If someone wanted, you could easily modify it to use http or ftp, and then change the ext filter to something like .exe|.html and youd have yourself a standard file browser. Infact, Ill add the protocol and form action params to the config.php file so you can use it as a file browser without having to modify the script.

MGB, even though youve given the goahead on the media, youd need an mms server to actually serve the content. If youre running on a win 2k3 server you can install Windows Media Services, but thats entirely up to you if you want to do that -- I simply dont have the bandwidth to do so myself.
Also, Ill download FF later today and check what part of the JS it doesnt like.
Cerium - Tue Mar 28, 2006 2:10 pm
Post subject:
Ok, updates for this stupid script:

1) I found and fixed the JS issues in FF. FF's version of the getElementsByTag function is rather retarded. On the bright side, the new method is probably faster anyway.

2) The script is no longer limited to the mms protocol. Infact, most of the configuration got changed, and this can now be used for virtually anything.

3) Any php5 specific code has been either removed, or isolated to a point where the basic functionality exists on any system running php4 or newer.

4) I removed the default 'playlist builder' and replaced it with a dynamic plugin system. User-defined plugins can be designed to build content based on the user selections. The plugins are php5 specific, and the feature is disabled on systems running older php versions.

5) The html has been broken up into 4 sections to make integrating this script into existing pages considerably easier.


Thats about it. Ill post examples and tutorials for the plugin system later.
Cyan~Fire - Tue Mar 28, 2006 3:43 pm
Post subject:
Can you make it space out the html a bit?
Cerium - Wed Mar 29, 2006 2:18 pm
Post subject:
Why?
Cyan~Fire - Wed Mar 29, 2006 3:40 pm
Post subject:
So it's easier to read. Why obfuscate it?
Cerium - Wed Mar 29, 2006 3:48 pm
Post subject:
Because adding inline formation is an unecessary pain in the ass. The function that does the bulk of the work is called recursively, so to add any kind of proper tabbing would require another global variable, and a bit more code.

Realisticly, most people wont even look at that, so long as its functioning.
Cyan~Fire - Wed Mar 29, 2006 5:38 pm
Post subject:
What about just a newline after every tag? I'm not talking about tabbing.
Cerium - Wed Mar 29, 2006 5:44 pm
Post subject:
I still dont really see the point.
Cyan~Fire - Thu Mar 30, 2006 4:40 pm
Post subject:
What's the point of open source? So people can see how you did something.

It's only a minor change, and it doesn't hurt anything.
Cerium - Thu Mar 30, 2006 6:00 pm
Post subject:
Its not the same as byte code or asm. If someone wants to do what youre talking about, they can do a simple find and replace on the source. Replace all instances of '>' with '>\n'.
Its still open source. You can download the script as-is and see how I did everything. Infact, you can make the addition to the script the same way I described above.

As Ive said like three times now, I dont really see the point. HTML never feels obfuscated to me, and seeing large blocks of script-generated html spaning across a single line is not uncommon. Personally, I think you should get used to seeing it. Especially if you enjoy looking at the source of pages which are generated by one of the billions of CMSs out there.
SamHughes - Fri Mar 31, 2006 12:19 pm
Post subject:
Cyan~Fire, just get HTML Tidy or any other decency program; problem solved.
Cyan~Fire - Fri Mar 31, 2006 3:47 pm
Post subject:
Whatever. There's nothing I can do against plain stubbornness.
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group