rejetto forum

Software => HFS ~ HTTP File Server => HTML & templates => Topic started by: bmartino1 on June 27, 2014, 08:25:16 PM

Title: create special download links (Http:/xxx.xxx.xxx.xxx/file?#)
Post by: bmartino1 on June 27, 2014, 08:25:16 PM
Just curious if anyone has setup or started doing something that might enable a count.. (No i don't need a count, jsut want to see if there is a way to add too it...

ie
I have a download link a Http:/xxx.xxx.xxx.xxx/file

I want to program a way so when a "guest/user" clicks to access the file that the webpage goes to:
Http:/xxx.xxx.xxx.xxx/file?1

then the next time a user goes to it:
Http:/xxx.xxx.xxx.xxx/file?2

And continually going up...
-----------------------------------------------------------------------

Possible using VBA with a code like:

(---
Sub URL()

Dim URL As String
Dim count as interger
Dim urlpath as string

URL = "http://xxx.xxx.xxx.xxx/file?"

--
count code code
---

urlpath = URL + count ...etc...
---)

---------------------------------------------------
Just curious if anyone may have a solution to it or have a programmed idea on how to "html web code it"

as i haven't started searching on it...

-----
If it can't be done with programming in a website, then i can see it being a option in hfs:
IE:
(It could be a program serve things that can be implemented) i can see an option in the  hfs menu item being "add a ?# to download links".....
-----

Any Thoughts or ideas?
Title: Re: create special download links (Http:/xxx.xxx.xxx.xxx/file?#)
Post by: rejetto on June 28, 2014, 08:34:39 PM
i don't understand if you want to make this in hfs
Title: Re: create special download links (Http:/xxx.xxx.xxx.xxx/file?#)
Post by: bmartino1 on June 29, 2014, 04:27:21 PM
rejetto, i don't think it should be hard code-ed into HFS, it was just a though...

----
I'm just experimenting with code and wanted to see if "any one out there" had set up somethings similar...

in the end, i have found that i would have to make a vbs script that when a client clicks the web link to launch the script and spit them to the url path with the "?####" which is okay, but not what i was trying to do...

As HFS has a "count/hits" i just wanted to add that to which folder are being targeted, ie clients are hit the server to access this path, and since i'm not always at home , i wanted to add that into the url path so if i go to the page a ie "http://xxx.xxx\file?3" meaning this file/site has been seen 2 time in the past either by me or other website guests...
-----

at first i was trying to incorporate the vbs script into the website itself, but html can't substitute the string values that i need...

thank you for responding though
Title: Re: create special download links (Http:/xxx.xxx.xxx.xxx/file?#)
Post by: bmartino1 on June 29, 2014, 04:38:20 PM
what i'm trying to do:
hfs hosting a site
click a link:
file

which hfs is http serving via http at example path:
http:/xxx.xxx.xxx.xxx/file

when the user clicks on that link i want to add secondary data so they see and access the path via
http:/xxx.xxx.xxx.xxx/file?0001

then the next user who clicks on the link  sees:
http:/xxx.xxx.xxx.xxx/file?0002

and so forth etc... etc....
Title: Re: create special download links (Http:/xxx.xxx.xxx.xxx/file?#)
Post by: rejetto on June 29, 2014, 08:47:15 PM
this is easily be done changing the template.
you already have a counter, and is %item-dl-count%

so, for the [file] you have to change
<a href="%item-url%">

in
<a href="%item-url%?%item-dl-count%">


I tested this solution (using default template) by right clicking on the root, properties, diff template, and pasting this
Code: [Select]
[file|private]
<tr class='{.if|{.mod|{.count|row.}|2.}|even.}'><td>
        <input type='checkbox' class='selector' name='selection' value="%item-url%" {.if not|{.or|{.get|can delete.}|{.get|can access.}|{.get|can archive item.}.}|disabled='disabled'.} />
{.if|{.get|is new.}|<span class='flag'>&nbsp;NEW&nbsp;</span>.}
{.if not|{.get|can access.}|<img src='/~img_lock'>.}
<a href="%item-url%?%item-dl-count%"><img src="%item-icon%"> %item-name%</a>
{.if| {.length|{.?search.}.} |{:{.123 if 2|<div class='item-folder'>{.!item folder.} |{.breadcrumbs|{:<a href="%bread-url%">%bread-name%/</a>:}|from={.count substring|/|%folder%.}/breadcrumbs.}|</div>.}:} .}
{.123 if 2|<div class='comment'>|{.commentNL|%item-comment%.}|</div>.}
<td>%item-size%B<td>%item-modified%<td>%item-dl-count%
Title: Re: create special download links (Http:/xxx.xxx.xxx.xxx/file?#)
Post by: bmartino1 on June 30, 2014, 06:01:24 AM
thank you rejetto, this is perfect for what i was trying to do and so much easier than the vbs scripts!
:)