-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.php
243 lines (232 loc) · 9.88 KB
/
index.php
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
<?php
require_once 'welcome/lang.php';
require_once 'welcome/vendor/autoload.php';
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Error\SyntaxError;
use Twig\Loader\FilesystemLoader;
// Class declarations
class Project {
public string $id;
public string $icon;
public string $name;
public string $desc;
public array $anchors;
public string $microType;
public string $os;
public string $category;
function __construct(
string $id, string $icon, array $anchors, string $microType, string $os, string $category, bool $archived
) {
global $l, $sp;
$this->id = $id;
$this->icon = $icon;
$this->name = $sp[$id . 'Name'][$l];
$this->desc = $sp[$id . 'Desc'][$l];
if ($archived) $this->desc .= $sp['archived'][$l];
$this->anchors = $anchors;
$this->microType = $microType;
$this->os = $os;
$this->category = $category;
}
}
class Link {
public string $href;
public string $title;
public ?string $name;
public ?string $icon;
public ?string $microType;
function __construct(
string $href, string $title = "", ?string $name = null, ?string $icon = null, ?string $microType = null
) {
$this->href = $href;
$this->title = $title;
$this->name = $name;
$this->icon = $icon;
$this->microType = $microType;
}
}
// Choose the language
global $langs, $s, $sp;
$l = 0;
$LANG = 'fa';
$getHl = $_GET['hl'] ?? $LANG;
for ($i = 0; $i < count($langs); $i++)
if ($getHl == $langs[$i]['id']) {
$LANG = $getHl;
$l = $i;
}
// Process the current page: Main
$social = array(
new Link("https://github.com/fulcrum6378", "fulcrum6378 (Mahdi Parastesh)", icon: "github"),
new Link("https://codeberg.org/fulcrum6378", "Mahdi Parastesh - Codeberg.org", icon: "codeberg"),
/*new Link("https://play.google.com/store/apps/dev?id=8797895762316770334",
"Android Apps by Mahdi Parastesh on Google Play", icon: "google_play"),*/
new Link("https://www.linkedin.com/in/fulcrum6378/", "Mahdi Parastesh | LinkedIn", icon: "linkedin"),
new Link("https://stackoverflow.com/users/10728785/mahdi-parastesh",
"User Mahdi Parastesh - Stack Overflow", icon: "stackoverflow"),
new Link("https://t.me/Fulcrum6378", "Telegram: Contact @Fulcrum6378", icon: "telegram"),
/*new Link("https://www.instagram.com/fulcrum6378/",
"Mahdi Parastesh (@fulcrum6378) • Instagram photos and videos", icon: "instagram"),*/
/*new Link("https://x.com/fulcrum6378",
"Mahdi Parastesh (@fulcrum6378) / X", icon: "twitter"),*/
);
$sexbook_pos = 2;
$projects = array(
new Project('tx', "telexporter",
array(
new Link("https://cafebazaar.ir/app/ir.mahdiparastesh.telexporter",
title: $sp['bazaarDesc'][$l], name: $sp['bazaar'][$l], microType: "installUrl"),
new Link("https://myket.ir/app/ir.mahdiparastesh.telexporter",
title: $sp['myketDesc'][$l], name: $sp['myket'][$l], microType: "installUrl"),
),
"MobileApplication", "Android", "Tools", false,
),
new Project('fr', "fortuna",
array(
new Link("https://github.com/fulcrum6378/fortuna",
name: $sp['androidKotlin'][$l], microType: "url"),
new Link("https://play.google.com/store/apps/details?id=ir.mahdiparastesh.fortuna.gregorian",
name: $sp['googlePlay'][$l], microType: "installUrl"),
new Link("https://github.com/fulcrum6378/fortuna_flutter",
name: $sp['flutter'][$l], microType: "url"),
/*new Link("https://fortuna.mahdiparastesh.ir/",
name: $sp['websiteDemo'][$l], microType: "sameAs"),*/
new Link("https://mahdiparastesh.ir/welcome/privacy/fortuna.html",
name: $sp['privacy'][$l], microType: "publishingPrinciples"),
),
"SoftwareApplication", "Android, Web, iOS", "Philosophy, Lifestyle, Events, Health",
false,
),
new Project("md", "mcdtp",
array(
new Link("https://github.com/fulcrum6378/mcdtp",
name: $sp['androidJava'][$l], microType: "url")
),
"MobileApplication", "Android", "Tools", false,
),
new Project("hc", "homechat",
array(
new Link("https://github.com/fulcrum6378/homechat",
name: $sp['androidKotlin'][$l], microType: "url")
),
"MobileApplication", "Android", "Communication, Social, LAN, Network", true,
),
new Project("m4", "mergen_iv",
array(
new Link("https://github.com/fulcrum6378/mergen_android",
name: $sp['androidC++'][$l], microType: "sameAs"),
new Link("https://github.com/fulcrum6378/mergen4bsd",
name: $sp['softwareC++'][$l], microType: "sameAs"),
new Link("https://github.com/fulcrum6378/mergen_linux",
name: $sp['linuxC++'][$l], microType: "sameAs"),
new Link("https://github.com/fulcrum6378/mycv",
name: $sp['softwarePython'][$l], microType: "sameAs"),
),
"SoftwareApplication", "Android, FreeBSD, Linux", "AI, Logic, Robot", true,
),
new Project('it', "instatools",
array(),
"MobileApplication", "Android", "Tools, Personalisation", true,
),
new Project("m3", "mergen",
array(
new Link("https://github.com/fulcrum6378/mergen_server",
name: $sp['serverPython'][$l], microType: "sameAs"),
new Link("https://github.com/fulcrum6378/mergen_client",
name: $sp['androidKotlin'][$l], microType: "url"),
),
"SoftwareApplication", "Android, Windows, Linux, macOS",
"Artificial Intelligence, AI, Logic, NLP", true,
),
new Project("sm", "saam",
array(
new Link("https://github.com/fulcrum6378/saam",
name: $sp['softwarePython'][$l], microType: "sameAs"),
),
"WebApplication", "Windows", "Finance, Business, Tools", true,
),
new Project("m2", "mergen_iii",
array(
new Link("https://github.com/fulcrum6378/pronouncer",
name: $sp['serverPython'][$l], microType: "sameAs"),
new Link("https://github.com/fulcrum6378/mergen_client",
name: $sp['androidKotlin'][$l], microType: "url"),
),
"SoftwareApplication", "Android, Windows, Linux, macOS",
"Artificial Intelligence, AI, Logic, NLP", true,
),
new Project("m1", "mergen",
array(
new Link("https://github.com/fulcrum6378/mergen_server",
name: $sp['softwarePython'][$l], microType: "sameAs"),
),
"SoftwareApplication", "Android, Windows, Linux, macOS",
"Artificial Intelligence, AI, Logic, NLP", true,
),
new Project("ft", "friend_tracker",
array(
new Link("https://github.com/fulcrum6378/friend_tracker",
name: $sp['androidJava'][$l], microType: "sameAs"),
),
"MobileApplication", "Android", "Maps & Navigation, Communication, Social", true,
),
new Project("mg", "migratio",
array(
new Link("https://play.google.com/store/apps/details?id=ir.mahdiparastesh.migratio",
name: $sp['googlePlay'][$l], microType: "installUrl"),
/*new Link("https://migratio.mahdiparastesh.ir/",
name: $sp['website'][$l], microType: "sameAs"),*/
new Link("https://cafebazaar.ir/app/ir.mahdiparastesh.migratio",
title: $sp['bazaarDesc'][$l], name: $sp['bazaar'][$l], microType: "installUrl"),
new Link("https://myket.ir/app/ir.mahdiparastesh.migratio",
title: $sp['myketDesc'][$l], name: $sp['myket'][$l], microType: "installUrl"),
new Link("https://apkpure.com/p/ir.mahdiparastesh.migratio",
title: $sp['apkPureDesc'][$l], name: $sp['apkPure'][$l], microType: "installUrl"),
new Link("https://github.com/fulcrum6378/migratio_android",
name: $sp['androidKotlin'][$l], microType: "url"),
new Link("https://github.com/fulcrum6378/migratio",
name: $sp['wpTheme'][$l], microType: "url"),
new Link("https://mahdiparastesh.ir/welcome/privacy/migratio.html",
name: $sp['privacy'][$l], microType: "publishingPrinciples"),
),
"SoftwareApplication", "Android, Web", "Tools, Travel, Migration", true,
),
);
if (isset($_GET["fk"]) && $_GET["fk"] == "1") array_splice($projects, $sexbook_pos, 0, array(
new Project("sx", "sexbook",
array(
new Link("https://play.google.com/store/apps/details?id=ir.mahdiparastesh.sexbook",
name: $sp['googlePlay'][$l], microType: "installUrl"),
new Link("https://apkpure.com/p/ir.mahdiparastesh.sexbook",
title: $sp['apkPureDesc'][$l], name: $sp['apkPure'][$l], microType: "installUrl"),
new Link("https://mahdiparastesh.ir/welcome/privacy/sexbook.html",
name: $sp['privacy'][$l], microType: "publishingPrinciples"),
),
"MobileApplication", "Android", "Lifestyle, Events, Dating", false,
)
));
// Collect the required data for the templates
$data = array(
'LANGS' => $langs,
'LANG' => $LANG,
'ROOT' => '/welcome',
'PAGE' => 'main',
'SOCIAL' => $social,
'PROJECTS' => $projects,
);
foreach ($s as $key => $value) $data[$key] = $value[$l];
// Render the template using Twig
try {
echo (new Environment(new FilesystemLoader(["welcome"])))->render('temp.html', $data);
} catch (LoaderError|SyntaxError|RuntimeError $e) {
echo "Twig render error:\n" . $e->getMessage();
}
/*TODO:
* Masonry doesn't render in RTL properly
* Add an arrow near the flag of UK and minimise the flags
*
* Notes:
* In case of SVG error, add ' version="1.1"' to the SVG tag and turn "img/png" to "image/png".
*/