From 091bef8b84ef03cbe9afea7407298063991047d2 Mon Sep 17 00:00:00 2001 From: Diego Najar Date: Wed, 17 Jan 2018 23:09:12 +0100 Subject: [PATCH] Init --- .gitignore | 2 + config.php | 135 ++++++++++++++++++++++++++++++++++++++++++++ css/bludit.css | 67 ++++++++++++++++++++++ img/bludit-logo.svg | 13 +++++ img/favicon.png | Bin 0 -> 1290 bytes index.php | 26 +++++++++ languages/de.json | 26 +++++++++ languages/en.json | 26 +++++++++ languages/es.json | 26 +++++++++ metadata | 1 + php/footer.php | 33 +++++++++++ php/head.php | 80 ++++++++++++++++++++++++++ php/home.php | 38 +++++++++++++ php/item.php | 92 ++++++++++++++++++++++++++++++ php/topnavbar.php | 21 +++++++ 15 files changed, 586 insertions(+) create mode 100644 .gitignore create mode 100644 config.php create mode 100755 css/bludit.css create mode 100644 img/bludit-logo.svg create mode 100644 img/favicon.png create mode 100644 index.php create mode 100644 languages/de.json create mode 100644 languages/en.json create mode 100644 languages/es.json create mode 160000 metadata create mode 100644 php/footer.php create mode 100644 php/head.php create mode 100644 php/home.php create mode 100644 php/item.php create mode 100644 php/topnavbar.php diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b0437cd --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +metadata/* +.DS_Store diff --git a/config.php b/config.php new file mode 100644 index 0000000..8323e02 --- /dev/null +++ b/config.php @@ -0,0 +1,135 @@ +getExtension()=='json') { + $json = file_get_contents($file); + $data = json_decode($json, true); + $item = buildItem($data, pathinfo($file, PATHINFO_FILENAME)); + array_push($tmp, $item); + } + } + // Sort by date + usort($tmp, "sortByDate"); + return $tmp; +} + +function getItem($filename) { + $metadataFile = PATH_METADATA.$filename.DS.'metadata.json'; + + if (!file_exists($metadataFile)) { + return false; + } + + $json = file_get_contents($metadataFile); + $data = json_decode($json, true); + $item = buildItem($data, $filename); + + return $item; +} + +function sortByDate($a, $b) { + if ($a['release_date'] == $b['release_date']) { + return 0; + } + return ($a['release_date'] > $b['release_date']) ? -1 : 1; +} + +function sanitize($string) { + $string = str_replace(' ', '-', $string); + return preg_replace('/[^A-Za-z0-9\-]/', '', $string); +} + +// Language passed via $_GET['l'] +$currentLanguage = 'en'; +$acceptedLanguages = array('en', 'de', 'es'); +if (isset($_GET['l'])) { + if (in_array($_GET['l'], $acceptedLanguages)) { + $currentLanguage = $_GET['l']; + } +} + +$json = file_get_contents(PATH_ROOT.'languages'.DS.$currentLanguage.'.json'); +$languageArray = json_decode($json, true); + +// Top bar links +if ($currentLanguage !== "en") { + $_topbar = array( + 'documentation'=>'https://docs.bludit.com/'.$currentLanguage.'/', + 'themes'=>'https://themes.bludit.com/'.$currentLanguage.'/', + 'plugins'=>'https://plugins.bludit.com/'.$currentLanguage.'/', + 'pro'=>'https://pro.bludit.com/'.$currentLanguage.'/', + 'website'=>DOMAIN.'/'.$currentLanguage.'/' + ); +} else { + $_topbar = array( + 'documentation'=>'https://docs.bludit.com', + 'themes'=>'https://themes.bludit.com', + 'plugins'=>'https://plugins.bludit.com', + 'pro'=>'https://pro.bludit.com', + 'website'=>DOMAIN + ); +} + +// Items and Item passed via $_GET['item'] +$_items = false; +$_item = false; +$_whereAmI = 'home'; + +if (!empty($_GET['item'])) { + $itemName = sanitize($_GET['item']); + $_item = getItem($itemName); + $_whereAmI = 'item'; + if ($_item===false) { + header("HTTP/1.0 404 Not Found"); + exit; + } +} else { + $_items = getItems(); + $_whereAmI = 'home'; +} diff --git a/css/bludit.css b/css/bludit.css new file mode 100755 index 0000000..db5e9a7 --- /dev/null +++ b/css/bludit.css @@ -0,0 +1,67 @@ +body { + padding-top: 54px; + font-family: 'Open Sans', sans-serif; + background: #f1f1f1; +} + +@media (min-width: 992px) { + body { + padding-top: 56px; + } +} + +a { + color: #333; +} + +.item { + margin-bottom: 80px; + padding-right: 45px; + padding-left: 45px; +} + +.card-title { + font-weight: normal; + text-transform: uppercase; +} + +.card-subtitle { + font-size: 0.9em; + color: #888; +} + +.nav-link { + font-size: 0.8em; + text-transform: uppercase; +} + +footer { + font-size: 0.8em; +} + +ul.features { + font-size: 0.9em; +} + +ul.features > li { + margin-bottom: 10px; +} + +a.author-social { + font-size: 1.5em; + color: #888; + margin-right: 5px; +} + +a.author-social:hover { + color: #555; +} + +.btn { + padding: 5px 13px; + background: linear-gradient(to bottom,#90a4ae 0,#78909c 100%); +} + +.btn-primary { + background: linear-gradient(to bottom,#42a5f5 0,#2196f3 100%); +} \ No newline at end of file diff --git a/img/bludit-logo.svg b/img/bludit-logo.svg new file mode 100644 index 0000000..183e0ff --- /dev/null +++ b/img/bludit-logo.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/img/favicon.png b/img/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..833dc421f91d3063ea8eeff760a45b4dc010e481 GIT binary patch literal 1290 zcmV+l1@-!gP)9TY!^pOGJM zVxcN_tk&Q_6n{aa`tTENsnOh9*3o+#ZIWx`ZMe^;ci*$u*=wzRjsf~n4WI=;4S;L? z^!PFiZ%E$)kPo02K+hZU<4Vy3kP6_6D_Sg;zk|VG`j_s49sss~uDiP%y}fL}m+yie zfI;%FC<+=I8!~TwfPaei zO)LO{f3}~+38J{Tm}~N%)fgKST{9Yu0a=!R13((b0W?PXCKdpGFuJm`f})}#9336O z<#KV2HUKOVEmrgM^Cel9Lq4C+6qXdRbFl!>a^2)#4TC|XbN76Xp4&{D76Fg|Wbyx! zBxTLd&tq(C4AS%_Z|Sc8k8hSP$tmoP!|h8D}aH`%}sc{Ua=Ud;LcK0Q?a$R zB^Kunv$C?pJN_h9t*xyhkHMccH5{UmwG#^ft8S_y)ZKQJ1lo6Ua`G+|3S~xeg02mn zPUpAB$H&I^0&qASN+1xJc#jKMQ_ygDcqrP-c8-sa3kq6VS~O~+fg?=?1qFQF1Yj&) z8!}&5kvbsPoC9CsDi#JqqSCGBPUte!nRvCkK0bdr)mj z5S5jcSX^9;3V@)~(rAA%3E9o~0GLds+lGdQ5A^f%48Xv^fY|l3vNb?de?>)wD6q4$ zqZOh%*4Eb6o@YgT001be3#?Wvg25oJuEgoA?hNXrq(18E>O>AHW5<}gySpm@m6n$N z;C8!ziH8DCx0TV+QE?KMl$3~K4u?ZLCnqOjt?)@XI5>#x>}>IbLLr==p9_j=YinV* z+nN3kfFIp%cb^I*mIefX2xo!#mXs707HSiZf4jWA#Kpyhc<=Z7(b3U?goFeP4GpOP zRM5*FkEcwm6IDS^^Ihuz^QeX9=4Ra9-XbL>MeL3oGXjAC&d$!X<+%H{wleo~@{mt>rdBBimSvW+cWPN=dv$M0px+aqeWo2Ts0&IFZ zZ*@;$wOZ3+0^pfmRaKRu&h=>B3U56%F)=ZL<>lr7rFV68AvZTy`@5nj<9Z#Kx7+Pi zH#aviNAcUKHHl-v=E;4fOZ-i*8XjX0tgQz@;7lF$w7cy5V(D^$QCNLSz<; z<;Ck*A`DN|10b{q;1g#*3#vg-JQs{cBW7l1ke8PiHvmOZuHFJb12H!@hwAF;@H1W% zZE9*ldwctP0PMaMK&shnUQbF&`pBc1cBI9^!{_q}zSU4EpbdwIhsELbI%HX{e=7jt zBF+U0i#HxpK>pRBQ`~O1_B$tKXJ@CdVP9V#oKEM9`fR_)d4 zt4>c(`@LSTK(Vy6#NRa#_4V~AFE9VoX0y3joG;=9pe{xrv?%Y59EV(t*K<1N=-}Ys z>-+orp8 + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/languages/de.json b/languages/de.json new file mode 100644 index 0000000..b88205e --- /dev/null +++ b/languages/de.json @@ -0,0 +1,26 @@ +{ + "head-title": "Plugins | Bludit", + "head-description": "Erweitere die Funktionalität von Bludit mit einmaligen Plugins. HTML-Editoren, CSS-Anpassung, RSS-Feed, Sitemap, Open Graph, Twitter Cards und mehr.", + "little-description-paragraph1": "Erweitere die Funktionalität von Bludit mit einmaligen Plugins", + "add-new-plugin": "Add New Plugin", + + "demo": "Demo", + "documentation": "Dokumentation", + "themes": "Themes", + "plugins": "Plugins", + "donations": "Spenden", + "donate": "Spenden", + "download": "Download", + "search": "Suche", + "live-demo": "Live Demo", + "free-download": "Free Download", + "more-information": "More information", + "made-by": "Made by", + "support-forum": "Support Forum", + "support-chat": "Support Chat", + "description": "Description", + "features": "Features", + "last-update": "Last update", + "author": "Author", + "buy": "Buy" +} \ No newline at end of file diff --git a/languages/en.json b/languages/en.json new file mode 100644 index 0000000..e2ce178 --- /dev/null +++ b/languages/en.json @@ -0,0 +1,26 @@ +{ + "head-title": "Plugins | Bludit", + "head-description": "Extend Bludit functionality with amazing plugins. Social networks, HTML Editors, Customize CSS, RSS Feed, Sitemap, Open Graph, Twitter Cards, and more.", + "little-description-paragraph1": "Extend Bludit functionality with amazing plugins", + "add-new-plugin": "Add New Plugin", + + "demo": "Demo", + "documentation": "Documentation", + "themes": "Themes", + "plugins": "Plugins", + "donations": "Donaciones", + "donate": "Donate", + "download": "Download", + "search": "Search", + "live-demo": "Live Demo", + "free-download": "Free Download", + "more-information": "More information", + "made-by": "Made by", + "support-forum": "Support Forum", + "support-chat": "Support Chat", + "description": "Description", + "features": "Features", + "last-update": "Last update", + "author": "Author", + "buy": "Buy" +} \ No newline at end of file diff --git a/languages/es.json b/languages/es.json new file mode 100644 index 0000000..9750b45 --- /dev/null +++ b/languages/es.json @@ -0,0 +1,26 @@ +{ + "head-title": "Plugins | Bludit", + "head-description": "Amplíe la funcionalidad de Bludit con increíbles plugins. Redes sociales, editores HTML, RSS Feed, Sitemap, Open Graph, Twitter Cards, y mucho más.", + "little-description-paragraph1": "Amplíe las funcionalidades de Bludit con increíbles plugins", + "add-new-plugin": "Add New Plugin", + + "demo": "Demo", + "documentation": "Documentation", + "themes": "Themes", + "plugins": "Plugins", + "donations": "Donaciones", + "donate": "Donate", + "download": "Download", + "search": "Search", + "live-demo": "Live Demo", + "free-download": "Free Download", + "more-information": "More information", + "made-by": "Made by", + "support-forum": "Support Forum", + "support-chat": "Support Chat", + "description": "Description", + "features": "Features", + "last-update": "Last update", + "author": "Author", + "buy": "Buy" +} \ No newline at end of file diff --git a/metadata b/metadata new file mode 160000 index 0000000..330541f --- /dev/null +++ b/metadata @@ -0,0 +1 @@ +Subproject commit 330541f82f15306904edd7330bea147b791b9494 diff --git a/php/footer.php b/php/footer.php new file mode 100644 index 0000000..31f322a --- /dev/null +++ b/php/footer.php @@ -0,0 +1,33 @@ + + \ No newline at end of file diff --git a/php/head.php b/php/head.php new file mode 100644 index 0000000..53fc432 --- /dev/null +++ b/php/head.php @@ -0,0 +1,80 @@ + + + + + + + + '.$_item['name'].' - '.l('head title', false).''.PHP_EOL; + echo ''.PHP_EOL; + } else { + echo ''.l('head title', false).''.PHP_EOL; + echo ''.PHP_EOL; + } + ?> + + + + + + + + '.PHP_EOL; + echo ''.PHP_EOL; + echo ''.PHP_EOL; + } else { + echo ''.PHP_EOL; + echo ''.PHP_EOL; + echo ''.PHP_EOL; + } + ?> + + + + + + + '.PHP_EOL; + echo ''.PHP_EOL; + echo ''.PHP_EOL; + echo ''.PHP_EOL; + } else { + echo ''.PHP_EOL; + echo ''.PHP_EOL; + echo ''.PHP_EOL; + echo ''.PHP_EOL; + } + ?> + + + + + + + + + + '.PHP_EOL; + } + ?> + + + + + + diff --git a/php/home.php b/php/home.php new file mode 100644 index 0000000..c051e55 --- /dev/null +++ b/php/home.php @@ -0,0 +1,38 @@ + + +
+ + +

+ +
+ + + +
+
+ +
+

+
+

+ '.l('Live Demo',false).''.PHP_EOL; + } + + if ($item['price_usd']>0) { + echo ' '.l('Buy',false).' $'.$item['price_usd'].''.PHP_EOL; + } else { + echo ' '.l('Free Download',false).''.PHP_EOL; + } + ?> +
+
+
+ + + +
+ +
\ No newline at end of file diff --git a/php/item.php b/php/item.php new file mode 100644 index 0000000..7bd5812 --- /dev/null +++ b/php/item.php @@ -0,0 +1,92 @@ + +
+
+ +
+ +

+ +

+ +
+ Responsive image +
+ +
+

+

+
+ +
+

+
    + '.$feature.''; + } + } + ?> +
+
+ +
+

+ +
+ +
+

+ '.PHP_EOL; + } + if (!empty($_item['author_twitter'])) { + echo''.PHP_EOL; + } + if (!empty($_item['author_github'])) { + echo''.PHP_EOL; + } + if (!empty($_item['author_youtube'])) { + echo''.PHP_EOL; + } + if (!empty($_item['author_reddit'])) { + echo''.PHP_EOL; + } + if (!empty($_item['author_pinterest'])) { + echo''.PHP_EOL; + } + if (!empty($_item['author_flickr'])) { + echo''.PHP_EOL; + } + if (!empty($_item['author_google_plus'])) { + echo''.PHP_EOL; + } + if (!empty($_item['author_vk'])) { + echo''.PHP_EOL; + } + + ?> +
+ +
+ '.l('Live Demo',false).''.PHP_EOL; + } + + if ($_item['price_usd']>0) { + echo ' '.l('Buy',false).' $'.$_item['price_usd'].''.PHP_EOL; + } else { + echo ' '.l('Free Download',false).''.PHP_EOL; + } + + if (!empty($_item['information_url'])) { + echo ' '.l('More information',false).''.PHP_EOL; + } + ?> +
+ +
+
+
\ No newline at end of file diff --git a/php/topnavbar.php b/php/topnavbar.php new file mode 100644 index 0000000..825d668 --- /dev/null +++ b/php/topnavbar.php @@ -0,0 +1,21 @@ + + \ No newline at end of file