Author Topic: create special download links (Http:/xxx.xxx.xxx.xxx/file?#)  (Read 77202 times)

0 Members and 1 Guest are viewing this topic.

Offline bmartino1

  • Tireless poster
  • ****
  • Posts: 797
  • I'm only trying to help i mean no offense.
    • View Profile
    • none - google translate
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?
« Last Edit: June 27, 2014, 08:40:11 PM by bmartino1 »
I'm only trying to help i mean no offense.
thank you for your time and patience,
Bmartino1

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12904
    • View Profile
Re: create special download links (Http:/xxx.xxx.xxx.xxx/file?#)
« Reply #1 on: June 28, 2014, 08:34:39 PM »
i don't understand if you want to make this in hfs

Offline bmartino1

  • Tireless poster
  • ****
  • Posts: 797
  • I'm only trying to help i mean no offense.
    • View Profile
    • none - google translate
Re: create special download links (Http:/xxx.xxx.xxx.xxx/file?#)
« Reply #2 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
I'm only trying to help i mean no offense.
thank you for your time and patience,
Bmartino1

Offline bmartino1

  • Tireless poster
  • ****
  • Posts: 797
  • I'm only trying to help i mean no offense.
    • View Profile
    • none - google translate
Re: create special download links (Http:/xxx.xxx.xxx.xxx/file?#)
« Reply #3 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....
I'm only trying to help i mean no offense.
thank you for your time and patience,
Bmartino1

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12904
    • View Profile
Re: create special download links (Http:/xxx.xxx.xxx.xxx/file?#)
« Reply #4 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%

Follow members gave a thank to your post:


Offline bmartino1

  • Tireless poster
  • ****
  • Posts: 797
  • I'm only trying to help i mean no offense.
    • View Profile
    • none - google translate
Re: create special download links (Http:/xxx.xxx.xxx.xxx/file?#)
« Reply #5 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!
:)
I'm only trying to help i mean no offense.
thank you for your time and patience,
Bmartino1