Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - raybob

Pages: 1 2 [3] 4
31
Programmers corner / PHP in HFS
« on: March 22, 2012, 02:56:33 AM »
Made it possible!  It's not hard at all when you have a function to control command-line PHP and capture output  :)

See the template on the right and the resulting output in Mozilla on the left.

Unfortunately you have to use $args to pass variables into command line PHP, and running it like this clearly removes the possibility of running SMF or something.

Change "C:\program files\FHFS\php-bin\php.exe" in the script below to your correct PHP path, and place it under [request] in hfs.events.

Code: [Select]
{.set|php|{:{.if|{.exists|$1.php.}|{:{.exec|"C:\program files\FHFS\php-bin\php.exe" -n -f "C:\Program Files\FHFS\$1.php" $2|out=out.}:}|{:{.exec|"C:\program files\FHFS\php-bin\php.exe" -n -r "$1"|out=out.}:}.}{.^out.}:}.} {.comment| PHP FUNCTION $1 IS SCRIPT FILENAME OR DIRECT COMMANDS, $2 IS ARGUMENTS TO PASS IF SCRIPT FILE .}


32
Bug reports / User Notes Whitespace
« on: March 19, 2012, 04:40:56 AM »
Constant use of {.set account|n|notes key=a=b.} seems to fill up the user notes with huge amounts of whitespace.

Can someone else see if this happens to them also?

33
Programmers corner / Cool way to store data
« on: February 29, 2012, 04:02:31 AM »
This is used in FHFS... just thought I'd post it here since it can be extremely useful.

These functions just create simple files that store database-like values and can be retrieved at any time, on any page, with easy to use functions.  It functions somewhat like user-notes, except these values are global, not just for one user, and are stored in a separate file.

Put these under [request] in hfs.events:

Code: [Select]
{.set|loaddb|{:{.for each|value|{.replace|;|{.no pipe||.}|{.load|$1.db.}.}|{:{.if|{.^value.}|{:{.set table|$1|{.^value.}.}:}.}:}.}:}.}
{.set|writedb|{:{.^loaddb|$1.}{.save|$1.db|{.replace|$2={.from table|$1|$2.};||{.load|$1.db.}.}.}{.append|$1.db|$2=$3; .}{.^loaddb|$1.}:}.}
{.set|delkey|{:{.^loaddb|$1.}{.save|$1.db|{.replace|$2={.from table|$1|$2.};||{.load|$1.db.}.}.}{.^loaddb|$1.}:}.}

You use {.^loaddb|A.} to initialize a database for use, once per page, {.^writedb|A|B|C.} to write a new key or overwrite and old one, {.^delkey|A|B.} to delete a key and its value, and {.from table|A|B.} to expand to a value.

So if you want to write a value, you'd put in

Code: [Select]
{.^writedb|databasename|keyname|value.}

At the beginning of each page, before you can use {.from table.} to get a value, you must first load the database into memory, either using {.^loaddb|databasename.} or else {.^writedb.} which automatically loads the database, writes to it, and then reloads the new values.

So to call a value from a DB file, you might use something like:

Code: [Select]
{.^loaddb|databasename.}
{.from table|databasename|keyname|value.}

And then to delete a key, you would use

Code: [Select]
{.^delkey|databasename|keyname.}

For me, reading a db with 1000 keys took around 0.37 seconds consistently.  So it works pretty quickly.  

-- Raybob  :)

34
HFS ~ HTTP File Server / new events section or possible bug
« on: October 30, 2011, 10:23:31 PM »
(I realize now this should be in bugs section...)

Rejetto in hfs.events can you make a section called [upload] or something similar where macros are executed before an upload starts?  For example, the following code under [request] does NOT stop an upload from occuring:

Code: [Select]
{.if|{.count substring|multipart/form-data|{.header|Content-Type.}.}|{:{.disconnect.}:}.}

I get this in the log:
Code: [Select]
if|1|{:{.disconnect.}{.break.}:}
    {.disconnect.}{.break.}
disconnect
    <div class=macroerror>macro error: disconnect<br>not supported or illegal parameters</div>
break

35
FHFS / An HFS Software Bundle made by Me
« on: October 28, 2011, 09:13:03 PM »
So today I decided to take an hour and hastily cram some code from my website into a cool little software package I call 'FHFS' or FTP/HTTP File Server.  Basically it takes HFS, combines it with FileZilla, and adds a ton more features.  I plan to improve on it a lot sometime and make it more different than my website and I kinda rushed putting it together (the logo was made in MS Paint in 2 minutes), but before I start a website for it or whatever, I'm going to put it here so you guys can download it and tell me what you think :)  It's based on portions of simplified code of what you would find at http://www.filesplat.com/  If you read the code you will see a lot of parts that don't connect or don't make sense and that's because I rushed through making things work as well as that I have several half-finished projects on my website.

I've implemented lots of cool things like account creation, FTP, Thumbnails, MP3 streaming, folder size, user preferences, LOG OUT BUTTON, email support, contact form, etc., so hopefully you guys will like it...

Let me know what you think!   ;D  I might make this into an open-source project.

http://www.filesplat.com/FHFS/FHFS-b4.exe (beta 4)

36
HFS ~ HTTP File Server / Download Accelerator Prevention
« on: October 04, 2011, 08:48:22 PM »
When HFS is set to prevent Download Accelerators, it responds with a 503 - Overload.  Can you make a way to have these events not show in the log?  At the same time I do want to see other not-served requests, such as 403s and 404s.  Reason I ask is because ~95% of my hits in the past 2 days were refused because they were duplicates from download managers.  Obviously this makes my log very difficult to read.

Thanks,
Ray

37
Bug reports / hang on upload
« on: September 21, 2011, 12:04:21 AM »
Even though the [upload-results] section is not really used in the new template, if you remove it or the content under it, HFS will hang on uploads.  Once the upload reaches 100%, the HFS connection status will be stuck on 'thinking' for about a minute and the user's upload will not complete.

38
HFS ~ HTTP File Server / blocking extensions
« on: September 17, 2011, 05:32:42 PM »
Is there a way to make it so that files with the extension .html or .html aren't blocked from being uploaded?

39
Bug reports / {.for each.} exception
« on: September 01, 2011, 07:18:25 PM »
I'm trying to use HFS to compile an XML file.  Everything works fine except that the command {.for each.} appears to not be working.  I've boiled down my code as much as possible, yet it still doesn't work.  I don't see any errors in my code, although there very well might be.

For debugging purposes I've attached the macro log, in which it states an exception and to report the bug.  According to the log everything processes fine until it gets to the extremely basic {.for each.} command and then it just doesn't process it.

Is it possible that you can't use {.for each.} inside {.save.}, or is this a bug in HFS itself ?

40
HFS ~ HTTP File Server / Macros to serve HTTP status codes
« on: August 17, 2011, 01:43:21 AM »
Can you create a macro command to directly serve different HTTP codes to the user, for example something like {.if| I want to give this user a deny-403 code |{:{.serve|403.}:}.}

Reason I ask is because in certain cases I want to direct a user to the deny page but using {.redirect|/~deny.} will confuse search engines and browsers into thinking that the page exists and is accessible but got temporarily moved....  This would also be useful for serving a 307 code since using {.redirect.} only constitutes a temporary redirect, not a permanent one.

Thanks!

41
HFS ~ HTTP File Server / deny versus not found
« on: July 14, 2011, 12:23:34 AM »
1) When trying to hotlink to a folder/file that is under a protected directory and that doesn't exist, you are directed to the ~not found page.  Ex., a user tries to get /test/test2/ , while test2 doesn't exist and they don't have permission to access the folder test.

2) When trying to hotlink to a folder/file that is under a protected directory and that does exist, you are directed to the ~login page.  Ex., a user tires to get /test/test3/ , and is denied because they can't access the root folder /test/

The only flaw with this is that users are able to verify the existence of folders/files, even if they don't have access to them.

Personally, I think it would be more secure to make it so that both scenarios end in the same result, being redirected to ~deny rather than login or not found, this way a user can't verify that an actual file exists.

If you can't make this happen by default can you at least add an option for it?  Or is there already some way to do it already?

42
HFS ~ HTTP File Server / Size of folders
« on: July 05, 2011, 11:48:43 PM »
Would there be any way to implement a native way to get the size of folders?

Both so that A) would display the size of both folders and files on the panel and B) so that the {.filesize.} macro would work with folders also - ex. {.filesize|C:\test\.}


43
Bug reports / true statement showing false
« on: June 22, 2011, 08:02:53 PM »
I may be doing something wrong but in the [folder] section, there's a little issue.

If I put in %number-folders% and {.add|{.count|folder level.}|1.}, in the lowest folder row the numbers will be the same, looking something like this:



And yet, when I put in the statement {.=|%number-folders%|{.add|{.count|folder level.}|1.}.} it always comes out false even in a row where the two numbers are equal.

44
HFS ~ HTTP File Server / diff tpl with {.set item.}
« on: June 21, 2011, 04:00:48 AM »
One essential function missing from {.set item.} is the ability to change the item's diff tpl in HFS.

This really would be extremely useful.

For example:  {.set item|folder|diff tpl=C:\template.tpl.}

Could you add this to this next build please?

Thanks,
Raybob

45
HFS ~ HTTP File Server / New limit parameter
« on: May 04, 2011, 01:05:33 AM »
Can you add in the next build an option in the Limits section for max simultaneous uploads from one address, please?  Even though HFS only uploads one file at a time, some people have been opening up multiple tabs and trying to upload 4 files at a time, which slows things down as well as screws up how their upload progress is displayed.

Pages: 1 2 [3] 4