Skip to content
This repository has been archived by the owner on Apr 16, 2022. It is now read-only.

Commit

Permalink
ADDED: download_file script
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Bernard committed Jan 4, 2007
1 parent bd6a70c commit d10e52b
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
5 changes: 5 additions & 0 deletions web/ryzom_com/Ryzom/skins/ryzom/checkDate.zsql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<dtml-comment>
arguments:data file
connection_id: rsweb_atys_zope
</dtml-comment>
select * from dl_stats where date = <dtml-sqlvar date type="string"> and file = <dtml-sqlvar file type="string">
18 changes: 18 additions & 0 deletions web/ryzom_com/Ryzom/skins/ryzom/download_file.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Script (Python) "testpy"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=file
##title=
##
date = context.Date()[:10]
try:
result = context.checkDate(date=date,file=file)
if len(result) == 0:
context.insertDate(date=date,file=file)
context.incremente_dl(date=date,file=file)
except:
pass
container.REQUEST.RESPONSE.redirect(file)
5 changes: 5 additions & 0 deletions web/ryzom_com/Ryzom/skins/ryzom/incremente_dl.zsql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<dtml-comment>
arguments:data file
connection_id: rsweb_atys_zope
</dtml-comment>
update dl_stats set counter = counter + 1 where date = <dtml-sqlvar date type="string"> and file = <dtml-sqlvar file type="string">
5 changes: 5 additions & 0 deletions web/ryzom_com/Ryzom/skins/ryzom/insertDate.zsql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<dtml-comment>
arguments:data file
connection_id: rsweb_atys_zope
</dtml-comment>
insert into dl_stats (date,file,counter) values (<dtml-sqlvar date type="string">,<dtml-sqlvar file type="string">, 0)

0 comments on commit d10e52b

Please sign in to comment.