Menu

[r21]: / src / functions / functions.cs  Maximize  Restore  History

Download this file

81 lines (65 with data), 2.1 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# function: fieldreplace
#
# create a php string with database fields from between [[]] tokens
# function: multiply
#
# create code to search fields between [[]] tokens
#set getvars=''
#set data_connection=0
#function doreplace str fid fnr
#set result=str
#match str with \([^[]*\)\[\([^[]*\)\[\([^]]*\)\]\([^]]*\)\]\(.*\) into front,before,name,after,back
#if before<>'' or after<>''
#set getvars=getvars ^ ' if ($sql->data[F' ^ fid ^ '_' ^ string_of_int fnr ^']==\'\') {$' ^ name ^ '_' ^ fid ^ '=\'\';} else {$' ^ name ^ '_' ^ fid ^ '=\'' ^ before ^ '\'.htmlspecialchars($sql->data[F' ^ fid ^ '_' ^ string_of_int fnr ^']).\'' ^ after ^ '\';};\n'
#else
#set getvars=getvars ^ ' $' ^ name ^ '_' ^ fid ^ '=htmlspecialchars($sql->data[F' ^ fid ^ '_' ^ string_of_int fnr ^']);\n'
#end
#set result=front ^ '$' ^ name ^ '_' ^ fid ^ doreplace back fid (fnr+1)
#end
#set doreplace=result
#end
#function fieldreplace str fid
#set result=''
#set getvars=''
#match str with \([^[]*\)\[\([^[]*\)\[\([^]]*\)\]\([^]]*\)\]\(.*\)
#set result=doreplace str fid 1
#end
#if result=''
#set result=str
#end
#set fieldreplace=result
#end
#function queryvars table str fnr snr
#set result=''
#match str with \([^[]*\)\[\([^[]*\)\[\([^]]*\)\]\([^]]*\)\]\(.*\) into front,before,name,after,back
#if table<>''
#set result=table ^ '.'
#else
#set result=''
#end
#set result=result ^ name ^ ' as F' ^ fnr ^ '_' ^ string_of_var snr
#set next=queryvars table back fnr (snr+1)
#if next<>''
#set result=result ^ ', ' ^next
#end
#end
#set queryvars=result
#end
#function domultiply table str action
#set result=''
#match str with \([^[]*\)\[\([^[]*\)\[\([^]]*\)\]\([^]]*\)\]\(.*\) into front,before,name,after,back
#set next=domultiply table back action
#set result=table ^ '.' ^ name ^ action ^ (if next='' then '' else 'OR ' ^ next)
#end
#set domultiply=result
#end
#function multiply table str action
#set result=''
#match str with \([^[]*\)\[\([^[]*\)\[\([^]]*\)\]\([^]]*\)\]\(.*\)
#set result=domultiply table str action
#end
#if result=''
#set result=str ^ action
#end
#set multiply=result
#end
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.