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.


Messages - ledufe

Pages: 1 2 3 [4] 5 6 ... 18
46
by the way, here is the code that i used to make this work

this is the first section of my hfs template, with 2 easy changes
Code: [Select]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
  <style type="text/css">
  %style%
  </style>
  <title>HFS %folder%</title>
  <link rel="shortcut icon" href="favicon.ico" />
</head>
<body>
%login-link%
%loggedin%
%upload-link%
<div id=folderlabel>folder</div>
<div id=folder>%folder%</div>
<div id=body>
%folder-comment%
%up%
%files%
</div>
<div id=footer>
<a href="http://www.rejetto.com/hfs/">HttpFileServer %version%</a>
<br />Servertime: %timestamp%
<br />Uptime: %uptime%
<br />Build-time: %build-time%
</div>
<div>
<form action="http://ledufe.no-ip.info/hfs/hfs-stats.php" method="post">
<input type=hidden name=hfsuserip value="%ip%">
<input type=hidden name=hfsusername value="%user%">
<input type=hidden name=hfsurl value="http://%host%%encoded-folder%">
<input type=hidden name=hfstime value="%timestamp%">
<input name=senddata type=submit value="Send Data to php">
</form>
<div>
<iframe name="HFS-PHP-Status-TRACKER" frameborder="1" width="auto" height="auto" marginheight="1" src="http://ledufe.no-ip.info/hfs/hfs-stats3.php" scrolling="auto"></iframe>
</body>
</html>

right after the footer part of the section, i added a hidden form wich will pass the info to the php+mysql, please note that in the form i call the file hfs-stats.php as action, here bellow is the content of the file:

Code: [Select]
<?php
echo "User IP: " $_POST["hfsuserip"];
echo 
"<br>User Logged: " $_POST["hfsusername"];
echo 
"<br>URL: " $_POST["hfsurl"];
echo 
"<br>Time: " $_POST["hfstime"];
echo 
"<br>Data Provided by LeDuFe HFS-Server.";
$username "SQLUSERNAME";
$password "SQLPASSWORD";
$hostname "localhost";
$f_ip $_POST["hfsuserip"];
$f_username $_POST["hfsusername"];
$f_url $_POST["hfsurl"];
$f_time $_POST["hfstime"];
$dbh mysql_connect($hostname$username$password
or die("Unable to connect to mysql");
print 
"<br>connected to mysql server<br>";
$selected mysql_select_db("hfs",$dbh
or die("Could not select HFS-DB");
if (
mysql_query("insert into hfs_track (hfs_userip, hfs_username, hfs_url, hfs_time) VALUES ('$f_ip', '$f_username', '$f_url', '$f_time')")) {
  print 
"successfully inserted record<br><a href='hfs-stats2.php'>Show Results</a><br><a href='#'' onclick='history.go(-1);return false;'>Back to HFS</a>";
}
else {
  print "Failed to insert record";
}
mysql_close($dbh);
?>

and created a iframe with the results the file hfs-stats2.php here the content of the file:

Code: [Select]
<html>
<meta http-equiv="refresh" content="30">
<head>
<title>HFS PHP+MYSQL STATS                -    BY LeDuFe :-P</title>
  </head>
<body>

<?php
$username 
"SQLUSERNAME";
$password "SQLPASSWORD";
$hostname "localhost";
$dbh mysql_connect($hostname$username$password
or die("Unable to connect to mysql");
print 
"<br>HFS-Server PHP+MySQL Statistics - Auto-Refresh every 30 seconds<br>";
echo 
date("d/m/Y h:i:sa"time());
print 
"<br><br>";
$selected mysql_select_db("hfs",$dbh
or die("Could not select HFS-DB");
$query  "SELECT hfs_userip, hfs_username, hfs_url, hfs_time FROM hfs_track WHERE hfs_time<'hfs_time' ORDER BY hfs_username, hfs_userip, hfs_time";
$result mysql_query($query);
echo 
"<table>";
echo 
"<th>User IP Adress";
echo 
"<th>Logged Username";
echo 
"<th>URL";
echo 
"<th>Time";
while(
$row mysql_fetch_array($resultMYSQL_ASSOC))
{
    echo  
 
"<tr><td align=left>".
 
"IP :{$row['hfs_userip']}".
 
"<td align=left>".
 
"USER NAME : {$row['hfs_username']}.
 
"<td align=left>".
 
"URL : {$row['hfs_url']}.
 
"<td align=left>".
 
"TIME : {$row['hfs_time']}";
}
echo 
"</table>";
mysql_close($dbh);
?>



</body>
</html>

and of course there is a database to store this info for future use os just to store the stats and access, but the possibilities are huge

47
HFS ~ HTTP File Server / Re: reset the counter in the tray icon
« on: March 11, 2007, 02:50:51 PM »
 :'(
sorry for my mistake

48
how many time can we count until we could considerer the user inactive or supose that he is offline(since the hfs does not support the logou yet)???

and about the code above

i was thinking

if we are going to show only the current logged users or "every" users online(if the user is not logged we shall call it a guest)

and to show it we could use ajax inside the php to auto update/increment the code without the refresh function


49
HFS ~ HTTP File Server / Re: reset the counter in the tray icon
« on: March 11, 2007, 08:34:06 AM »
inside the hfs (the main hfs windows, not the page generated :-p )
on the right part of the window, THE LOG WINDOW
do right click and then hit "clear"

50
well this sollution does not "display current user in your hfs server using php" but it show to us that this might work
i could manage to get some info from a page generated by hfs using a hidden form and store this info into a mysql database,
this must be no big deal to some users, but it was a pain in @#$ to make this work, and it is still not working as much as i want, it must become a better component to any apache server with mysql, it will be good even when hfs support php...

well i passed some values into a form to a php page, that show the info, and post it into the db, and also created a page to show the info stored, but to make it be more usefull i puted it into a iframe on the hfs, and i was thinking that this could be the start of the admi page of the hfs.... lol, it give me more ideas....

i made some progress here, not much beauty, but at least is functional...
http://ledufe.no-ip.info/hfs/
this is my apache server page on port 80 (also i have instaled and configured my mysql to store the data)
wich will fowarded you to my hfs server on port 2222

inside my hfs (last version with default template and a small hidden form to pass some info that i want from the user inside my hfs, like ip, and username...)

hit the button  "Send DATA TO PHP"
you will be fowarded to a php page that recieved the data from the html form of the hfs and the data that will be stored will be showed and will give you two choices, to see the status or to get back to hfs
you will see on the iframe on the botton of the hfs that your info has been stored inside a mysql db beeing showed by a php page that auto refresh it self every 30 seconds(all this is external, and also im much new bee in php to make this beauty ) i wish that when the hfs support php and mysql i would be much more good than this, but this at least works...

i will comment the code to post it here later....

[attachment deleted by admin]

51
i guess that is possible to do

inside the template of the hfs we add a external file using this iframe:

Code: [Select]
<iframe name="HFS_Check" frameborder="0" width="150" height="300" marginheight="0" src="http://ledufe.no-ip.info/check.php" scrolling="AUTO"></iframe>
and inside the loggedin section we add the call to the check.php again but here it pass the username and its ip as a parameter

Code: [Select]
<script type="text/javascript" src="http://ledufe.no-ip.info/check.php?userip=%ip%&username=%user%"></script>
note the call of the php file just to show inside it the ajax part of the page that will auto update it self with the user names and maybe their ip adress :-)

inside the file check.php we have 3 sections:
the part of the code that will read the parameter and put it inside a raw text file or mysql database
the part that will read the data source(the raw text or the mysqldb)
the part that will auto update itself with ajax or actionscript/flash

also there is a hard way, that i guess it would be using the parse of the php to GET/READ the username of the user logged...
these are just ideas..i will test it and post here my progress


52
HFS ~ HTTP File Server / Re: how to check is HFS online using php?
« on: February 28, 2007, 01:19:54 AM »
in parts - hahah

to dardarlt

thanks, im glad that it worked for you.... and also, im not getting this warning becouse of my php.ini config, in mine im using like this

Code: [Select]
error_reporting  =  E_ALL
instead the normal/original one:

Code: [Select]
error_reporting = E_ALL & ~E_NOTICE
to the Giant Eagle
about the javascript code is
Code: [Select]
<script type="text/javascript" language="javascript">

    var http_request = false;

    function makeRequest(url) {

        http_request = false;

        if (window.XMLHttpRequest) { // Mozilla, Safari,...
            http_request = new XMLHttpRequest();
            if (http_request.overrideMimeType) {
                http_request.overrideMimeType('text/xml');
                // See note below about this line
            }
        } else if (window.ActiveXObject) { // IE
            try {
                http_request = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                    http_request = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {}
            }
        }

        if (!http_request) {
            alert('Giving up :( Cannot create an XMLHTTP instance');
            return false;
        }
        http_request.onreadystatechange = alertContents;
        http_request.open('GET', url, true);
        http_request.send(null);

    }

    function alertContents() {

        if (http_request.readyState == 4) {
            if (http_request.status == 200) {
                alert(http_request.responseText);
            } else {
                alert('There was a problem with the request.');
            }
        }

    }
</script>
<span
    style="cursor: pointer; text-decoration: underline"
    onclick="makeRequest('test.html')">
        Make a request
</span>

the onlydrawback to the javascript it is that he looks for a specific file somewhere in the hfs filesystem in this case it looks to a file called test.html

well i don´t know much of javascript, but that_stevens_guy and flyns are very good with js, im getting the way with php now...

if you need some of my help or just to talk about codes and some tech stuffs, let me know....
bye...

53
HFS ~ HTTP File Server / Re: how to check is HFS online using php?
« on: February 27, 2007, 12:56:36 PM »
well, hi guys! im slowly getting back to my old life with some free time, and lately im playing with php, and saw this question, in php i create a small status window in php wich tells me if my pages/web-services are running ok.
my hfs at home i check with this code
Code: [Select]
<?php
if(fsockopen('ledufe.no-ip.info'2222$errno$errstr5) !== false)
{
      echo 
'HFS' " Online!";
}
else
{
      echo 
'HFS' " Offline!";
}
?>

hope it helps

i also got a way to do this in javascript using xmlhttp request, and it works too, but since there are so many paranoics people that dont trust in javascript, i prefer to not use it...

54
HTML & templates / Re: template editor
« on: February 13, 2007, 09:40:17 AM »
i guess this is becouse you don´t have the .NET framework 2.0 in your windows...

55
HTML & templates / Re: Slide Menu In Ur HFS..
« on: January 23, 2007, 01:30:34 AM »
very good....
you made it with javascript
i found one that use a .swf file that "plays" every kind of images and use no script, just a swf file that search a xml file(that can be generated by a filelist.tpl file on the root of the hfs) with the right formating on the structure on it...

but your solution is more clean and does not broke the .m3u file(the one that we call using ~list.m3u)....

thanks, but i still guess that the flash is more usable and trustable (also looks more beauty), but the javascript give to us more usability...

56
HTML & templates / Re: HFS-TEMPLATE-BUILDER
« on: January 23, 2007, 01:07:08 AM »
hfs tb C#

[attachment deleted by admin]

57
HTML & templates / Re: HFS-TEMPLATE-BUILDER
« on: January 23, 2007, 01:06:34 AM »
hfs tb lua part4

[attachment deleted by admin]

58
HTML & templates / Re: HFS-TEMPLATE-BUILDER
« on: January 23, 2007, 01:05:59 AM »
hfs tb lua part3

[attachment deleted by admin]

59
HTML & templates / Re: HFS-TEMPLATE-BUILDER
« on: January 23, 2007, 01:05:16 AM »
hfs tb lua part2

[attachment deleted by admin]

60
HTML & templates / Re: HFS-TEMPLATE-BUILDER
« on: January 23, 2007, 01:04:30 AM »
hfs tb lua part1

[attachment deleted by admin]

Pages: 1 2 3 [4] 5 6 ... 18