PageRenderTime 57ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/dev.php

https://gitlab.com/drucquerkellan/justdelete.me
PHP | 387 lines | 348 code | 34 blank | 5 comment | 27 complexity | fe0b6aba7af0c5db47f863ab67eae35d MD5 | raw file
  1. <?php
  2. $sites = json_decode(file_get_contents('sites.json'));
  3. usort($sites, function($a, $b) {
  4. $a = strtolower($a->name);
  5. $b = strtolower($b->name);
  6. if ($a < $b) return -1;
  7. if ($a > $b) return 1;
  8. return 0;
  9. });
  10. // For testing
  11. if ( ! isset($contributors))
  12. {
  13. $contributors = "";
  14. }
  15. if (isset($_GET['lang']))
  16. {
  17. $lang = $_GET['lang'];
  18. // For Right-To-Left Languages
  19. $rtl = ($lang == "fa" || $lang == "ar") ? true : false;
  20. }
  21. // For testing
  22. if ( !isset($lang))
  23. {
  24. $lang = "en";
  25. $rtl = false;
  26. }
  27. if ( !isset($full_name))
  28. {
  29. $full_name = "English";
  30. }
  31. $definitions = json_decode(file_get_contents('trans/site/'.$lang.'.json'));
  32. // var_dump($definitions);
  33. // die;
  34. $title = $definitions->title;
  35. $description = $definitions->description;
  36. $difficulty = $definitions->difficulty;
  37. $difficulty_easy = $definitions->difficulty_easy;
  38. $difficulty_medium = $definitions->difficulty_medium;
  39. $difficulty_hard = $definitions->difficulty_hard;
  40. $difficulty_impossible = $definitions->difficulty_impossible;
  41. $tagline = $definitions->tagline;
  42. $noinfo = $definitions->noinfo;
  43. $showinfo = $definitions->showinfo;
  44. $hideinfo = $definitions->hideinfo;
  45. $whatisthis = $definitions->whatisthis;
  46. $whatisthis1 = $definitions->whatisthis1;
  47. $whatisthis2 = $definitions->whatisthis2;
  48. $whatisthis3 = $definitions->whatisthis3;
  49. $guide = $definitions->guide;
  50. $guideexplanations = $definitions->guideexplanations;
  51. $guideeasy = $definitions->guideeasy;
  52. $guidemedium = $definitions->guidemedium;
  53. $guidehard = $definitions->guidehard;
  54. $guideimpossible = $definitions->guideimpossible;
  55. $translationcontrib = $definitions->translationcontrib;
  56. $morecontrib = $definitions->morecontrib;
  57. $viewcontrib = $definitions->viewcontrib;
  58. $extensionguide = $definitions->extensionguide;
  59. $extension = $definitions->extension;
  60. $extensionp1 = $definitions->extensionp1;
  61. $extensionp2 = $definitions->extensionp2;
  62. $extensionp3 = $definitions->extensionp3;
  63. $extensionl1 = $definitions->extensionl1;
  64. $extensionl2 = $definitions->extensionl2;
  65. $extensionl3 = $definitions->extensionl3;
  66. $extensionl4 = $definitions->extensionl4;
  67. $banner = $definitions->banner;
  68. $footer = $definitions->footer;
  69. $help_translate = $definitions->help;
  70. $donate = $definitions->donate;
  71. $sendmail = $definitions->sendmail;
  72. $submit = $definitions->submit;
  73. $popular = $definitions->popular;
  74. if ($lang == "en")
  75. {
  76. $note_lang = "notes";
  77. }
  78. else
  79. {
  80. $note_lang = "notes_" . $lang;
  81. }
  82. $homepage = true;
  83. ?>
  84. <?php include('inc/header.php'); ?>
  85. <div class="search">
  86. <div class="search-container">
  87. <input type="text" id="search">
  88. <a href="#">search</a>
  89. </div>
  90. <div class="sort-container">
  91. <button class="popular"><?php echo $popular; ?></button>
  92. <button data-dropdown="#dropdown-2" class="az-sort">A - Z</button>
  93. <button data-dropdown="#dropdown-3" class="diff-sort"><?php echo $difficulty; ?></button>
  94. <button class="reset">reset</button>
  95. </div>
  96. </div>
  97. <section class="main">
  98. <section class="adsense">
  99. <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
  100. <!-- JDM -->
  101. <ins class="adsbygoogle"
  102. style="display:inline-block;width:728px;height:90px"
  103. data-ad-client="ca-pub-9778304973218149"
  104. data-ad-slot="6251902116"></ins>
  105. <script>
  106. (adsbygoogle = window.adsbygoogle || []).push({});
  107. </script>
  108. </section>
  109. <section class="sites" id="sites">
  110. <p class="no-results">Can't find what you're looking for? <a href='http://github.com/rmlewisuk/justdelete.me'>Help make justdelete.me better</a>.</p>
  111. <!-- // FIRST FOR EACH -->
  112. <?php foreach ($sites as $site) : ?><section class="site-block <?php echo $site->difficulty; ?>">
  113. <a class="site-header" href="<?php echo $site->url; ?>">
  114. <?php echo $site->name; ?>
  115. </a>
  116. <p class="site-difficulty">
  117. <?php echo eval('return $difficulty_' . $site->difficulty . ';'); ?>
  118. </p>
  119. <?php if (isset($site->$note_lang)) : ?>
  120. <div class="tooltip-content">
  121. <?php echo $site->$note_lang;
  122. if (isset($site->email))
  123. {
  124. echo '<br><a href="mailto:' . $site->email . '?Subject=Account%20Deletion%20Request&body=Please%20delete%20my%20account,%20my%20username%20is%20 XXXXXX">' . $sendmail . ' &raquo;</a>';
  125. }
  126. ?>
  127. </div>
  128. <a href="#" class="tooltip-toggle contains-info"><?php echo $showinfo ?></a>
  129. <?php elseif (isset($site->notes)) : ?>
  130. <div class="tooltip-content">
  131. <?php echo $site->notes;
  132. if (isset($site->email))
  133. {
  134. echo '<br><a href="mailto:' . $site->email . '?Subject=Account%20Deletion%20Request&body=Please%20delete%20my%20account,%20my%20username%20is%20 XXXXX">' . $sendmail . ' &raquo;</a>';
  135. }
  136. ?>
  137. </div>
  138. <a href="#" class="tooltip-toggle contains-info"><?php echo $showinfo ?></a>
  139. <?php else : ?>
  140. <p class="tooltip-toggle"><?php echo $noinfo ?></p>
  141. <?php endif; ?>
  142. <?php if (isset($site->meta)) : ?>
  143. <span class="meta"><?php echo $site->meta; ?></span>
  144. <?php endif; ?>
  145. </section><?php endforeach; ?>
  146. </section>
  147. </section>
  148. <span id="about">about anchor</span>
  149. <section class="adsense">
  150. <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
  151. <!-- JDM -->
  152. <ins class="adsbygoogle"
  153. style="display:inline-block;width:728px;height:90px"
  154. data-ad-client="ca-pub-9778304973218149"
  155. data-ad-slot="6251902116"></ins>
  156. <script>
  157. (adsbygoogle = window.adsbygoogle || []).push({});
  158. </script>
  159. </section>
  160. <section class="info-block about">
  161. <div class="info-container">
  162. <div class="info-block-half">
  163. <h2><?php echo $whatisthis ?></h2>
  164. <p><?php echo $whatisthis1 ?></p>
  165. <p><?php echo $whatisthis2 ?></p>
  166. <p><a target="_blank" href="https://docs.google.com/a/therobb.com/forms/d/1mhr3vaTni5U8PvOdp_NvQ6vKBxNTmJTeKP3VWRuioCE/viewform"><?php echo $submit ?> &raquo;</a></p>
  167. <ul>
  168. <li><a href="http://robblewis.me/just-delete-me?utm_source=JustDeleteMe&amp;utm_medium=link&amp;utm_campaign=Just+Delete+Me" target="_blank">Read the announcement blog post &raquo;</a></li>
  169. <li><a href="http://robblewis.me/24-hours-of-just-delete-me/" target="_blank">See the first-day stats &raquo;</a></li>
  170. <li><a href="http://thetechtailor.com/justdeleteme" target="_blank">Listen to an interview with Robb on The Tech Tailor podcast &raquo;</a></li>
  171. <li><a href="http://robblewis.me/just-delete-me-one-million-page-views/">One Million Page Views &raquo;</a></li>
  172. </ul>
  173. <p><a href="https://twitter.com/justdeletedotme" class="twitter-follow-button" data-show-count="false" data-size="large">Follow @justdeletedotme</a></p>
  174. </div><div class="info-block-half">
  175. <h2><?php echo $guide ?></h2>
  176. <p><?php echo $guideexplanations ?></p>
  177. <ul>
  178. <li><?php echo $guideeasy ?></li>
  179. <li><?php echo $guidemedium ?></li>
  180. <li><?php echo $guidehard ?></li>
  181. <li><?php echo $guideimpossible ?></li>
  182. </ul>
  183. <p><?php echo $donate; ?></p>
  184. <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
  185. <input type="hidden" name="cmd" value="_s-xclick">
  186. <input type="hidden" name="hosted_button_id" value="E9VLGMSJ3R4Q4">
  187. <input type="image" src="https://www.paypalobjects.com/en_GB/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="PayPal – The safer, easier way to pay online.">
  188. <img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">
  189. </form>
  190. </div>
  191. </div>
  192. </section>
  193. <section class="info-block contributors">
  194. <div class="info-container">
  195. <div class="info-block-half">
  196. <h2><?php echo $translationcontrib; ?></h2>
  197. <ul class="contributors translate">
  198. <li class="ar"><a href="https://github.com/adahhane">Dahhane Ayyoub</a></li>
  199. <li class="cat"><a href="https://github.com/rockbdn">JP Queralt (+ Español)</a></li>
  200. <li class="de"><a href="http://www.erbloggt.de/">Konstantin Hinrichs</a></li>
  201. <li class="de"><a href="http://www.floriankeller.de/">Florian Keller</a></li>
  202. <li class="fa"><a href="https://github.com/Arasteh">Mahmoud Arasteh Nasab</a></li>
  203. <li class="fa"><a href="https://github.com/MHM5000">Mohammad Hossein Mojtahedi</a></li>
  204. <li class="fr"><a href="https://github.com/buzzb0x">Ethan Ohayon</a></li>
  205. <li class="fr"><a href="https://github.com/p1rox">Armand Vignat</a></li>
  206. <li class="id"><a href="https://github.com/rafeyu">Ramdziana Feri Y</a></li>
  207. <li class="it"><a href="https://github.com/LorenzoRogai">Lorenzo Rogai</a></li>
  208. <li class="nl"><a href="https://github.com/mprins">Mark Prins</a></li>
  209. <li class="pt_br"><a href="https://github.com/mkbu95">Matheus Macabu</a></li>
  210. <li class="ro"><a href="https://github.com/teofilcojocariu">Teofil Cojocariu</a></li>
  211. <li class="ru"><a href="https://github.com/morozd">morozd</a></li>
  212. <li class="tr"><a href="https://github.com/MarioErmando">Erman Sayın</a></li>
  213. <li class="vi"><a href="https://github.com/giangnb">Giang Nguyen</a></li>
  214. <li class="zh-cn"><a href="https://github.com/Jonwei">Joe Shen</a></li>
  215. <li class="zh-tw"><a href="https://github.com/CalvertYang">Calvert</a></li>
  216. <li class="pl"><a href="https://github.com/Halamix2">Piotr Halama</a></li>
  217. </ul>
  218. </div><div class="info-block-half">
  219. <h2><?php echo $morecontrib; ?></h2>
  220. <?php echo $contributors; ?>
  221. <p><br/><a href='http://github.com/rmlewisuk/justdelete.me/contributors'><?php echo $viewcontrib; ?> &raquo;</a></p>
  222. </ul>
  223. </div>
  224. </div>
  225. </section>
  226. <div class="banner-block">
  227. <div class="banner-content">
  228. <div class="banner-block-half">
  229. <h2><?php echo $extension ?></h2>
  230. <p><?php echo $extensionp1 ?></p>
  231. <p><?php echo $extensionp2 ?></p>
  232. <p><?php echo $extensionp3 ?></p>
  233. </div><div class="banner-block-half">
  234. <h2><?php echo $extensionguide; ?></h2>
  235. <ul>
  236. <li><?php echo $extensionl1 ?></li>
  237. <li><?php echo $extensionl2 ?></li>
  238. <li><?php echo $extensionl3 ?></li>
  239. <li><?php echo $extensionl4 ?></li>
  240. </ul>
  241. </div>
  242. </div>
  243. <div class="banner-block-extension"></div>
  244. </div>
  245. <section class="info-block">
  246. <div class="info-container">
  247. <footer>
  248. <span><?php echo $footer ?></span>
  249. <div class="share-buttons<?php echo ($rtl) ? ' share-buttons-rtl' : '' ; ?>" id="share buttons">
  250. <!-- Twitter -->
  251. <a href="https://twitter.com/share" class="twitter-share-button" data-url="http://justdelete.me">Tweet</a>
  252. <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
  253. <!-- Facebook -->
  254. <div class="fb-like" data-href="http://justdelete.me" data-width="450" data-colorscheme="dark" data-layout="button_count" data-show-faces="false" data-send="false"></div>
  255. </div>
  256. </footer>
  257. </div>
  258. </section>
  259. <script type="text/javascript">
  260. $('.contains-info').click(function(e) {
  261. e.preventDefault();
  262. if ($(this).prev().hasClass('toggled')) {
  263. if ($(this).hasClass('text-toggled')) {
  264. $(this).html("<?php echo $showinfo ?>").removeClass('text-toggled');
  265. } else {
  266. $(this).html("<?php echo $showinfo ?>").removeClass('text-toggled');
  267. }
  268. $(this).prev().slideToggle().removeClass('toggled');
  269. } else {
  270. $('.toggled').next().html("<?php echo $showinfo ?>");
  271. $('.toggled').slideToggle().removeClass('toggled');
  272. $(this).prev().slideToggle().addClass('toggled');
  273. $(this).html("<?php echo $hideinfo ?>").addClass('text-toggled');
  274. }
  275. });
  276. </script>
  277. <div id="dropdown-1" class="dropdown dropdown-tip has-icons">
  278. <ul class="dropdown-menu">
  279. <li class="en"><a href="/">English</a></li>
  280. <li class="it"><a href="it.html">Italiano</a></li>
  281. <li class="de"><a href="de.html">Deutsch</a></li>
  282. <li class="fr"><a href="fr.html">Français</a></li>
  283. <li class="nl"><a href="nl.html">Nederlands</a></li>
  284. <li class="es"><a href="es.html">Español</a></li>
  285. <li class="cat"><a href="cat.html">Català</a></li>
  286. <li class="pt_br"><a href="pt_br.html">Português</a></li>
  287. <li class="ru"><a href="ru.html">Pусский</a></li>
  288. <li class="vi"><a href="vi.html">Tiếng Việt</a></li>
  289. <li class="tr"><a href="tr.html">Türk</a></li>
  290. <li class="ar"><a href="ar.html">العربية</a></li>
  291. <li class="fa"><a href="fa.html">فارسی</a></li>
  292. <li class="zh-cn"><a href="zh-cn.html">中国的</a></li>
  293. <li class="zh-tw"><a href="zh-tw.html">正體中文</a></li>
  294. <li class="id"><a href="id.html">Indonesia</a></li>
  295. <li class="ro"><a href="ro.html">Român</a></li>
  296. <li class="pl"><a href="pl.html">Polski</a></li>
  297. <li class="dropdown-divider"></li>
  298. <li class="help"><a target="_blank" href="https://github.com/rmlewisuk/justdelete.me/issues/164"><?php echo $help_translate; ?></a></li>
  299. </ul>
  300. </div>
  301. <div id="dropdown-2" class="dropdown dropdown-tip">
  302. <ul class="dropdown-menu ltr">
  303. <span class="alpha-sort">
  304. <li><a href="#">a</a></li>
  305. <li><a href="#">b</a></li>
  306. <li><a href="#">c</a></li>
  307. <li><a href="#">d</a></li>
  308. <li><a href="#">e</a></li>
  309. <li><a href="#">f</a></li>
  310. <li><a href="#">g</a></li>
  311. <li><a href="#">h</a></li>
  312. <li><a href="#">i</a></li>
  313. <li><a href="#">j</a></li>
  314. <li><a href="#">k</a></li>
  315. <li><a href="#">l</a></li>
  316. <li><a href="#">m</a></li>
  317. <li><a href="#">n</a></li>
  318. <li><a href="#">o</a></li>
  319. <li><a href="#">p</a></li>
  320. <li><a href="#">q</a></li>
  321. <li><a href="#">r</a></li>
  322. <li><a href="#">s</a></li>
  323. <li><a href="#">t</a></li>
  324. <li><a href="#">u</a></li>
  325. <li><a href="#">v</a></li>
  326. <li><a href="#">w</a></li>
  327. <li><a href="#">x</a></li>
  328. <li><a href="#">y</a></li>
  329. <li><a href="#">z</a></li>
  330. </span>
  331. </ul>
  332. </div>
  333. <div id="dropdown-3" class="dropdown dropdown-tip">
  334. <ul class="dropdown-menu">
  335. <span class="diff-sort">
  336. <?php
  337. if ($lang != "zh-tw" && $lang != "zh-cn") {
  338. ?>
  339. <li><a href="#"><?php echo ucfirst($difficulty_easy); ?></a></li>
  340. <li><a href="#"><?php echo ucfirst($difficulty_medium); ?></a></li>
  341. <li><a href="#"><?php echo ucfirst($difficulty_hard); ?></a></li>
  342. <li><a href="#"><?php echo ucfirst($difficulty_impossible); ?></a></li>
  343. <?php } else { ?>
  344. <li><a href="#"><?php echo $difficulty_easy; ?></a></li>
  345. <li><a href="#"><?php echo $difficulty_medium; ?></a></li>
  346. <li><a href="#"><?php echo $difficulty_hard; ?></a></li>
  347. <li><a href="#"><?php echo $difficulty_impossible; ?></a></li>
  348. <?php } ?>
  349. </span>
  350. </ul>
  351. </div>
  352. </body>
  353. </html>