summaryrefslogtreecommitdiff
path: root/example/templates/transc/articles.html.php
blob: d52658c4165cdde1b9cb161711b4652ec2f85029 (plain)
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<?php $transcompile_fx = function($ste)
{
	$outputstack = array('');
	$outputstack_i = 0;
	$outputstack[$outputstack_i] .= $ste->load("custom_tags.tpl");
	$outputstack[$outputstack_i] .= $ste->load("master.html");
	$blockname_4feb57c8eb53c0_39108239 = "content";
	$ste->blocks['4feb57c8eb54f8.57715029'] = array_pop($outputstack);
	$ste->blockorder[] = '4feb57c8eb54f8.57715029';
	$outputstack = array('');
	$outputstack_i = 0;
	$outputstack[$outputstack_i] .= "<h2>Some Articles</h2>\n\t";
	$parameters_4feb57c8eb55d1_49937129 = array();
	$parameters_4feb57c8eb55d1_49937129['array'] = "articles";
	$parameters_4feb57c8eb55d1_49937129['value'] = "article";
	$parameters_4feb57c8eb55d1_49937129['max'] = "3";
	$parameters_4feb57c8eb55d1_49937129['counter'] = "i";
	$outputstack[$outputstack_i] .= $ste->call_tag('foreach_limit', $parameters_4feb57c8eb55d1_49937129, function($ste)
	{
		$outputstack = array('');
		$outputstack_i = 0;
		$outputstack[$outputstack_i] .= "<h3>";
		$parameters_4feb57c8eb59c3_59434363 = array();
		$outputstack[$outputstack_i] .= $ste->call_tag('uppercase', $parameters_4feb57c8eb59c3_59434363, function($ste)
		{
			$outputstack = array('');
			$outputstack_i = 0;
			$parameters_4feb57c8eb5a98_71645476 = array();
			$outputstack[$outputstack_i] .= $ste->call_tag('escape', $parameters_4feb57c8eb5a98_71645476, function($ste)
			{
				$outputstack = array('');
				$outputstack_i = 0;
				$outputstack[$outputstack_i] .= @$ste->vars["article"]["title"];
				return array_pop($outputstack);
			});
			return array_pop($outputstack);
		});
		$outputstack[$outputstack_i] .= "</h3>\n\t\t<div class=\"author\">Author: ";
		$parameters_4feb57c8eb5f92_71020272 = array();
		$outputstack[$outputstack_i] .= $ste->call_tag('escape', $parameters_4feb57c8eb5f92_71020272, function($ste)
		{
			$outputstack = array('');
			$outputstack_i = 0;
			$outputstack[$outputstack_i] .= @$ste->vars["article"]["author"];
			return array_pop($outputstack);
		});
		$outputstack[$outputstack_i] .= "</div>\n\t\t<div class=\"date\">";
		$parameters_4feb57c8eb62b8_11002450 = array();
		$parameters_4feb57c8eb62b8_11002450['timestamp'] = @$ste->vars["article"]["timestamp"];
		$outputstack[$outputstack_i] .= $ste->call_tag('date', $parameters_4feb57c8eb62b8_11002450, function($ste)
		{
			$outputstack = array('');
			$outputstack_i = 0;
			$outputstack[$outputstack_i] .= "%d. %h. %Y, %H:%M:%S";
			return array_pop($outputstack);
		});
		$outputstack[$outputstack_i] .= "</div>\n\t\t<div class=\"article_content\">\n\t\t\t";
		$outputstack[] = "";
		$outputstack_i++;
		$outputstack[$outputstack_i] .= (($ste->get_var_by_name("i")) == ("0")) ? 'yes' : '';
		$outputstack_i--;
		if($ste->evalbool(array_pop($outputstack)))
		{
			$outputstack[$outputstack_i] .= "\n\t\t\t\t\t" . @$ste->vars["article"]["full"];
			
		}
		else
		{
			$outputstack[$outputstack_i] .= "\n\t\t\t\t\t" . @$ste->vars["article"]["excerpt"];
			
		}
		$outputstack[$outputstack_i] .= "</div>\n\t\t<hr />\n\t";
		return array_pop($outputstack);
	});
	$outputstack[] = '';
	$outputstack_i++;
	$parameters_4feb57c8eb72f3_12728934 = array();
	$parameters_4feb57c8eb72f3_12728934['array'] = "articles";
	$outputstack[$outputstack_i] .= $ste->call_tag('arraylen', $parameters_4feb57c8eb72f3_12728934, function($ste) { return ''; });
	$outputstack_i--;
	$ste->set_var_by_name("articles_n", array_pop($outputstack));
	$outputstack[] = "";
	$outputstack_i++;
	$outputstack[$outputstack_i] .= ((@$ste->vars["articles_n"]) > ("3")) ? 'yes' : '';
	$outputstack_i--;
	if($ste->evalbool(array_pop($outputstack)))
	{
		$outputstack[$outputstack_i] .= "<p>There are <a href=\"#\">more articles</a>.</p>\n\t\t";
		
	}
	$outputstack[$outputstack_i] .= "<h2>Some more useless demo stuff...</h2>\n\t\t<h3>Counting from 10 to 0...</h3>\n\t\t<p>but take only the even ones and multiply by 5...</p>\n\t\t";
	$forloop_4feb57c8eb7965_88913250_start = "10";
	$forloop_4feb57c8eb7965_88913250_stop = "0";
	$forloop_4feb57c8eb7965_88913250_countername = "i";
	for($forloop_4feb57c8eb7965_88913250_counter = $forloop_4feb57c8eb7965_88913250_start; $forloop_4feb57c8eb7965_88913250_counter >= $forloop_4feb57c8eb7965_88913250_stop; $forloop_4feb57c8eb7965_88913250_counter += -1)
		{
		try
		{
				$ste->set_var_by_name($forloop_4feb57c8eb7965_88913250_countername, $forloop_4feb57c8eb7965_88913250_counter);
				$outputstack[] = "";
				$outputstack_i++;
				$outputstack[] = '';
				$outputstack_i++;
				$outputstack[$outputstack_i] .= @$ste->vars["i"];
				$outputstack_i--;
				$tmp_even = array_pop($outputstack);
				$outputstack[$outputstack_i] .= (is_numeric($tmp_even) and ($tmp_even % 2 == 0)) ? 'yes' : '';
				$outputstack_i--;
				if($ste->evalbool(array_pop($outputstack)))
				{
					$outputstack[] = '';
					$outputstack_i++;
					$outputstack[$outputstack_i] .= @$ste->vars["i"] . " * 5";
					$outputstack_i--;
					$outputstack[$outputstack_i] .= $ste->calc(array_pop($outputstack));
					$outputstack[$outputstack_i] .= "<br />\n\t\t\t\t";
					
				}
				
		}
		catch(\ste\BreakException $e) { break; }
		catch(\ste\ContinueException $e) { continue; }
		
		}
		
	$outputstack[$outputstack_i] .= "<h3>Repeat some text...</h3>\n\t\t";
	$parameters_4feb57c8eb86f4_27000372 = array();
	$parameters_4feb57c8eb86f4_27000372['n'] = "10";
	$outputstack[$outputstack_i] .= $ste->call_tag('repeat', $parameters_4feb57c8eb86f4_27000372, function($ste)
	{
		$outputstack = array('');
		$outputstack_i = 0;
		$outputstack[$outputstack_i] .= "<p>Bla</p>\n\t\t";
		return array_pop($outputstack);
	});
	$outputstack[$outputstack_i] .= "<h3>Get a variable's content dynamically</h3>\n\t\t";
	$outputstack[$outputstack_i] .= $ste->get_var_by_name(@$ste->vars["foo"] . "[" . @$ste->vars["bar"] . "]");$outputstack[$outputstack_i] .= "<h3>We will call ste:repeat with a non-numerical value for n here to see the handling of a RuntimeError</h3>\n\t\t";
	$parameters_4feb57c8eb8be8_11772552 = array();
	$parameters_4feb57c8eb8be8_11772552['n'] = "lol";
	$outputstack[$outputstack_i] .= $ste->call_tag('repeat', $parameters_4feb57c8eb8be8_11772552, function($ste)
	{
		$outputstack = array('');
		$outputstack_i = 0;
		$outputstack[$outputstack_i] .= "<p>Bla</p>\n\t\t";
		return array_pop($outputstack);
	});
	$parameters_4feb57c8eb8e64_48510077 = array();
	$parameters_4feb57c8eb8e64_48510077['array'] = "hai";
	$parameters_4feb57c8eb8e64_48510077['delim'] = ",";
	$outputstack[$outputstack_i] .= $ste->call_tag('split', $parameters_4feb57c8eb8e64_48510077, function($ste)
	{
		$outputstack = array('');
		$outputstack_i = 0;
		$outputstack[$outputstack_i] .= "a,b,c,d,e";
		return array_pop($outputstack);
	});
	$parameters_4feb57c8eb91f2_76021324 = array();
	$parameters_4feb57c8eb91f2_76021324['array'] = "hai";
	$outputstack[$outputstack_i] .= $ste->call_tag('join', $parameters_4feb57c8eb91f2_76021324, function($ste)
	{
		$outputstack = array('');
		$outputstack_i = 0;
		$outputstack[$outputstack_i] .= "<br />";
		return array_pop($outputstack);
	});
	$ste->blocks[$blockname_4feb57c8eb53c0_39108239] = array_pop($outputstack);
	if(array_search($blockname_4feb57c8eb53c0_39108239, $ste->blockorder) === FALSE)
		$ste->blockorder[] = $blockname_4feb57c8eb53c0_39108239;
	$outputstack = array('');
	$outputstack_i = 0;
	return array_pop($outputstack);
}; ?>