Просмотр исходного кода

Project and blog index pages started.

Iñigo Valentin 9 лет назад
Родитель
Сommit
6fe66fdc08

+ 56 - 0
sql/text.sql

@@ -31,6 +31,62 @@ INSERT INTO text VALUES ('FOOTER_HELP',   'eu', 'FOOTER', 'Laguntza');
 
 
 -- PROJECT
+INSERT INTO text VALUES ('PROJECT_TITLE', 'es', 'PROJECT', 'Proyectos');
+INSERT INTO text VALUES ('PROJECT_TITLE', 'en', 'PROJECT', 'Projects');
+INSERT INTO text VALUES ('PROJECT_TITLE', 'eu', 'PROJECT', 'Projektuak');
+INSERT INTO text VALUES ('PROJECT_DESCRIPTION', 'es', 'PROJECT', ''); --TODO
+INSERT INTO text VALUES ('PROJECT_DESCRIPTION', 'en', 'PROJECT', ''); --TODO
+INSERT INTO text VALUES ('PROJECT_DESCRIPTION', 'eu', 'PROJECT', ''); --TODO
+INSERT INTO text VALUES ('PROJECT_SEARCH', 'es', 'PROJECT', 'Buscar');
+INSERT INTO text VALUES ('PROJECT_SEARCH', 'en', 'PROJECT', 'Search');
+INSERT INTO text VALUES ('PROJECT_SEARCH', 'eu', 'PROJECT', 'Bilatu');
+INSERT INTO text VALUES ('PROJECT_SEARCH_ADVANCED', 'es', 'PROJECT', 'Búsqueda avanzada');
+INSERT INTO text VALUES ('PROJECT_SEARCH_ADVANCED', 'en', 'PROJECT', 'Advanced search');
+INSERT INTO text VALUES ('PROJECT_SEARCH_ADVANCED', 'eu', 'PROJECT', 'Búsqueda avanzada');
+INSERT INTO text VALUES ('PROJECT_SEARCH_TYPE', 'es', 'PROJECT', 'Tipo');
+INSERT INTO text VALUES ('PROJECT_SEARCH_TYPE', 'en', 'PROJECT', 'Project type');
+INSERT INTO text VALUES ('PROJECT_SEARCH_TYPE', 'eu', 'PROJECT', 'Tipu');
+INSERT INTO text VALUES ('PROJECT_SEARCH_LICENSE', 'es', 'PROJECT', 'Licencia');
+INSERT INTO text VALUES ('PROJECT_SEARCH_LICENSE', 'en', 'PROJECT', 'License');
+INSERT INTO text VALUES ('PROJECT_SEARCH_LICENSE', 'eu', 'PROJECT', 'Lizenzia');
 INSERT INTO text VALUES ('PROJECT_VERSION', 'es', 'PROJECT', 'Versión');
 INSERT INTO text VALUES ('PROJECT_VERSION', 'en', 'PROJECT', 'Version');
 INSERT INTO text VALUES ('PROJECT_VERSION', 'eu', 'PROJECT', 'Versión');
+
+
+-- BLOG
+INSERT INTO text VALUES ('BLOG_TITLE', 'es', 'BLOG', 'Blog');
+INSERT INTO text VALUES ('BLOG_TITLE', 'en', 'BLOG', 'Blog');
+INSERT INTO text VALUES ('BLOG_TITLE', 'eu', 'BLOG', 'Blog');
+INSERT INTO text VALUES ('BLOG_DESCRIPTION', 'es', 'BLOG', ''); --TODO
+INSERT INTO text VALUES ('BLOG_DESCRIPTION', 'en', 'BLOG', ''); --TODO
+INSERT INTO text VALUES ('BLOG_DESCRIPTION', 'eu', 'BLOG', ''); --TODO
+INSERT INTO text VALUES ('BLOG_MORE', 'es', 'BLOG', 'leer más');
+INSERT INTO text VALUES ('BLOG_MORE', 'en', 'BLOG', 'read more');
+INSERT INTO text VALUES ('BLOG_MORE', 'eu', 'BLOG', 'gehiago irakurri');
+INSERT INTO text VALUES ('BLOG_TAGS', 'es', 'BLOG', 'Tags');
+INSERT INTO text VALUES ('BLOG_TAGS', 'en', 'BLOG', 'Tags');
+INSERT INTO text VALUES ('BLOG_TAGS', 'eu', 'BLOG', 'Tags');
+INSERT INTO text VALUES ('BLOG_SEARCH', 'es', 'BLOG', 'Buscar');
+INSERT INTO text VALUES ('BLOG_SEARCH', 'en', 'BLOG', 'Search');
+INSERT INTO text VALUES ('BLOG_SEARCH', 'eu', 'BLOG', 'Bilatu');
+INSERT INTO text VALUES ('BLOG_TAG_CLOUD', 'es', 'BLOG', 'Nube de tags');
+INSERT INTO text VALUES ('BLOG_TAG_CLOUD', 'en', 'BLOG', 'Tag Cloud');
+INSERT INTO text VALUES ('BLOG_TAG_CLOUD', 'eu', 'BLOG', 'Tag Cloud');
+INSERT INTO text VALUES ('BLOG_COMMENTS', 'es', 'BLOG', 'Comentarios');
+INSERT INTO text VALUES ('BLOG_COMMENTS', 'en', 'BLOG', 'Comments');
+INSERT INTO text VALUES ('BLOG_COMMENTS', 'eu', 'BLOG', 'Comentarios');
+INSERT INTO text VALUES ('BLOG_COMMENTS_0', 'es', 'BLOG', 'No hay comentarios aún.');
+INSERT INTO text VALUES ('BLOG_COMMENTS_0', 'en', 'BLOG', 'No comments yet.');
+INSERT INTO text VALUES ('BLOG_COMMENTS_0', 'eu', 'BLOG', 'No hay comentarios aún.');
+INSERT INTO text VALUES ('BLOG_COMMENTS_1', 'es', 'BLOG', 'comentario.');
+INSERT INTO text VALUES ('BLOG_COMMENTS_1', 'en', 'BLOG', 'comment.');
+INSERT INTO text VALUES ('BLOG_COMMENTS_1', 'eu', 'BLOG', 'comantario.');
+INSERT INTO text VALUES ('BLOG_COMMENTS_X', 'es', 'BLOG', 'comentarios.');
+INSERT INTO text VALUES ('BLOG_COMMENTS_X', 'en', 'BLOG', 'comments.');
+INSERT INTO text VALUES ('BLOG_COMMENTS_X', 'eu', 'BLOG', 'comentarios.');
+
+
+
+
+<?=text($con, '', $$lang)?>

+ 148 - 17
www/blog/index.php

@@ -1,14 +1,15 @@
 <?php
     session_start();
     $http_host = $_SERVER["HTTP_HOST"];
-    $doc_root = $_SERVER["DOCUMENT_ROOT"]; 
+    $doc_root = $_SERVER["DOCUMENT_ROOT"];
     include $doc_root . "functions.php";
     $proto = get_protocol();
     $con = start_db();
     $server = $proto . $http_host;
     $lang = select_language();
-    $cur_section = "";
+    $cur_section = "blog";
     $cur_entry = "";
+
 ?>
 <!DOCTYPE html>
 <html>
@@ -16,45 +17,46 @@
         <meta content='text/html; charset=utf-8' http-equiv='content-type'/>
         <meta charset='utf-8'/>
         <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1'/>
-        <title>I&ntilde;igo Valentin</title>
+        <title><?=text($con, "BLOG_TITLE", $lang)?> - I&ntilde;igo Valentin</title>
         <link rel='shortcut icon' href='<?=$server?>/img/logo/favicon.ico'/>
         <!-- CSS files -->
         <style>
 <?php
             include $doc_root . "css/ui.css";
-            include $doc_root . "css/home.css";
+            include $doc_root . "css/blog.css";
 ?>
         </style>
         <!-- CSS for mobile version -->
         <style media='(max-width : 990px)'>
 <?php
             include $doc_root . "css/m/ui.css";
-            include $doc_root . "css/m/home.css";
+            include $doc_root . "css/m/blog.css";
 ?>
         </style>
         <!-- Script files -->
         <script type='text/javascript'>
 <?php
             include $doc_root . "script/ui.js";
+            include $doc_root . "script/blog.js";
 ?>
         </script>
         <!-- Meta tags -->
-        <link rel='canonical' href='<?=$server?>'/>
+        <link rel='canonical' href='<?=$server?>/blog/'/>
         <link rel='author' href='<?=$server?>'/>
         <link rel='publisher' href='<?=$server?>'/>
-        <meta name='description' content=''/>
-        <meta property='og:title' content='I&ntilde;igo Valentin'/>
-        <meta property='og:url' content='<?=$server?>'/>
-        <meta property='og:description' content=''/>
-        <meta property='og:image' content=''/>
+        <meta name='description' content='<?=text($con, "BLOG_DESCRIPTION", $lang)?>'/>
+        <meta property='og:title' content='<?=text($con, "BLOG_TITLE", $lang)?> - I&ntilde;igo Valentin'/>
+        <meta property='og:url' content='<?=$server?>/blog/'/>
+        <meta property='og:description' content='<?=text($con, "BLOG_DESCRIPTION", $lang)?>'/>
+        <meta property='og:image' content='<?=$server?>/img/logo/favicon.ico'/>
         <meta property='og:site_name' content='I&ntilde;igo Valentin'/>
         <meta property='og:type' content='website'/>
         <meta property='og:locale' content='<?=$lang?>'/>
         <meta name='twitter:card' content='summary'/>
-        <meta name='twitter:title' content='I&ntilde;igo Valentin'/>
-        <meta name='twitter:description' content=''/>
-        <meta name='twitter:image' content=''/>
-        <meta name='twitter:url' content='<?=$server?>'/>
+        <meta name='twitter:title' content='<?=text($con, "BLOG_TITLE", $lang)?> - I&ntilde;igo Valentin'/>
+        <meta name='twitter:description' content='<?=text($con, "BLOG_DESCRIPTION", $lang)?>'/>
+        <meta name='twitter:image' content='<?=$server?>/img/logo/favicon.ico'/>
+        <meta name='twitter:url' content='<?=$server?>/project/'/>
         <meta name='robots' content='index follow'/>
     </head>
     <body>
@@ -62,8 +64,137 @@
         include $doc_root . "header.php";
 ?>
         <div id='content'>
-
-        </div> <!-- #content -->
+            <div id='content_row'>
+                <div class='content_cell' id='content_cell_main'>
+                    <div id='main_column' class='section'>
+                        <h3 class='section_title'><?=text($con, "BLOG_TITLE", $lang)?></h3>
+<?php
+                            $q_blog = mysqli_query($con, "SELECT id, permalink, title, text, DATE_FORMAT(dtime, '%Y-%m-%dT%T') AS isodate, dtime, comments FROM post WHERE visible = 1 ORDER BY dtime DESC;");
+                            while($r_blog = mysqli_fetch_array($q_blog)){
+?>
+                                <div itemscope itemtype='http://schema.org/BlogPosting' class='entry blog_entry'>
+                                    <meta itemprop='inLanguage' content='<?=$lang?>'/>
+                                    <meta itemprop='datePublished dateModified' content='<?=$r_blog["isodate"]?>'/>
+                                    <meta itemprop='headline name' content='<?=text($con, $r_blog["title"], $lang)?>'/>
+                                    <meta itemprop='articleBody text' content='<?=text($con, $r_blog["text"], $lang)?>'/>
+                                    <meta itemprop='mainEntityOfPage' content='<?=$server?>'/>
+                                    <h3 class='entry_title'>
+                                        <a itemprop='url' href='<?=$server?>/blog/<?=$r_blog["permalink"]?>'><?=$r_blog["title"]?></a>
+                                    </h3>
+<?php
+                                    $q_image = mysqli_query($con, "SELECT image FROM post_image WHERE post = $r_blog[id] ORDER BY idx LIMIT 1;");
+                                    if (mysqli_num_rows($q_image) > 0){
+                                        $r_image = mysqli_fetch_array($q_image);
+?>
+                                        <div class='post_list_image_container'>
+                                            <a href='<?=$server?>/blog/<?=$r_blog["permalink"]?>'>
+                                                <meta itemprop='image' content='<?=$server?>/img/blog/view/<?=$r_image["image"]?>'/>
+                                                <img class='post_list_image alt='<?=$r_blog["title"]?>' src='<?=$server?>/img/blog/miniature/<?=$r_image["image"]?>'/>
+                                            </a>
+                                        </div>
+<?php
+                                    }
+?>
+                                    <p><?=cutText($r_blog["text"], 800, text($con, "BLOG_MORE", $lang), "$server/blog/$r_blog[permalink]/")?></p>
+                                    <hr/>
+                                    <table class='post_footer'>
+                                        <tr>
+<?php
+                                            // Tags (if any), date, and comment counter
+                                            $q_tag = mysqli_query($con, "SELECT tag FROM post_tag WHERE post= $r_blog[id];");
+                                            if (mysqli_num_rows($q_tag) > 0){
+                                                $tag_string = "<span class='tags desktop'>" . text($con, "BLOG_TAGS", $lang);
+                                                $tag_raw = "";
+                                                while ($r_tag = mysqli_fetch_array($q_tag)){
+                                                    $tag_string = $tag_string . "<a href='$proto$http_host/blog/search/tag/$r_tag[tag]'> " . text($con, $r_tag["tag"], $lang) . "</a>, ";
+                                                    $tag_raw = $tag_raw . "$r_tag[tag],";
+                                                }
+                                                $tag_string = substr($tag_string, 0, strlen($tag_string) - 2);
+                                                $tag_string = $tag_string . "</span>";
+                                                $tag_raw = substr($tag_raw, 0, strlen($tag_raw) - 1);
+?>
+                                                <meta itemprop='keywords' content='<?=$tag_raw?>'/>
+                                                <td>
+                                                    <span class='date'><?=format_date($r_blog["dtime"], $lang, false)?></span>
+                                                    &nbsp;&nbsp;&nbsp;<?=$tag_string?>
+                                                </td>
+<?php
+                                            }
+                                            else{
+?>
+                                                <td>
+                                                    <span class='date'><?=format_date($r_blog['dtime'], $lang, false)?></span>
+                                                </td>
+<?php
+                                            }
+                                            #Comment counter
+                                            if ($r_blog["comments"] == 1){
+                                                $q_comment = mysqli_query($con, "SELECT count(id) AS count FROM post_comment WHERE post = $r_blog[id] AND visible = 1;");
+                                                $r_comment = mysqli_fetch_array($q_comment);
+?>
+                                                <meta itemprop='commentCount interationCount' content='<?=$r_comment["count"]?>'/>
+                                                <td class='r_comment'>
+<?php
+                                                    if ($r_comment['count'] == 1){
+?>
+                                                        <span class='comment_counter'>1 <?=text($con, "BLOG_COMMENTS_1", $lang)?></span>
+<?php
+                                                    }
+                                                    else if ($r_comment['count'] == 0){
+?>
+                                                        <span class='comment_counter'><?=text($con, "BLOG_COMMENTS_0", $lang)?></span>
+<?php
+                                                    }
+                                                    else{
+?>
+                                                        <span class='comment_counter'>$<?=r_comment["count"]?> <?=text($con, "BLOG_COMMENTS_X", $lang)?></span>
+<?php
+                                                    }
+?>
+                                                </td>
+<?php
+                                            } // if ($r_blog["comments"] == 1)
+?>
+                                        </tr>
+                                    </table> <!-- .post_footer -->
+                                </div> <!-- .blog_entry -->
+                                </br>
+<?php
+                            } // while($r_blog = mysqli_fetch_array($q_blog))
+?>
+                    </div> <!-- #main_column -->
+                </div> <!-- #content_cell_main -->
+                <div class='content_cell'  id='content_cell_right'>
+                    <div class='section section_no_title' id='right_column'>
+                        <div class='entry'>
+                            <h4><?=text($con, "BLOG_SEARCH", $lang)?></h4>
+                            <div id='search_panel_inputs'>
+                                <form action='#' onSubmit='event.preventDefault();launchSearch("<?=$lng["search_field_all"]?>");'>
+                                    <input id='search_panel_input' class='search_element' type='text' name='query' placeholder='<?=text($con, "BLOG_SEARCH", $lang)?>'/>
+                                    <input id='search_panel_submit' class='search_element' type='submit' value='<?=text($con, "BLOG_SEARCH", $lang)?>'/>
+                                </form>
+                            </div>
+                        </div> <!-- .entry -->
+                        <div class='entry'>
+                            <h4><?=text($con, "BLOG_TAG_CLOUD", $lang)?></h4>
+<?php
+                            //Get the most used tag
+                            $q_max = mysqli_query($con, "SELECT max(count) AS max FROM (SELECT count(post) AS count FROM post_tag GROUP BY tag) AS t;");
+                            $r_max = mysqli_fetch_array($q_max);
+                                $max = $r_max["max"];
+                            $q_tag = mysqli_query($con, "SELECT tag, count(post) AS count FROM post_tag GROUP BY tag;");
+                            while($r_tag = mysqli_fetch_array($q_tag)){
+                                $size = round(60 + 100 * $r_tag['count'] / $max);
+?>
+                                <a href='<?=$server?>/blog/search/tag/<?=$r_tag["tag"]?>'>
+                                    <span style='font-size: <?=$size?>%'><?=text($con, $r_tag["tag"], $lang)?></span>
+                                </a>
+<?php
+                            }
+?>
+                        </div> <!-- .entry -->
+                    </div> <!-- #right_column -->
+                </div> <!-- #content -->
 <?php
         include $doc_root . "footer.php";
         stats($con, $cur_section, $cur_entry);

+ 67 - 0
www/css/blog.css

@@ -0,0 +1,67 @@
+/* Common elements */
+span.version_type{
+    padding: 0.05em;
+    border 0.1em solid #444444;
+    border-radius: 0.2em;
+}
+
+
+/* Projects main page */
+
+
+/* Project view page */
+
+div#content{
+    display: table;
+}
+
+div#content-row{
+    display: table-row;
+}
+
+div.content_cell{
+    display: table-cell;
+    padding: 1em;
+    vertical-align: top;
+}
+
+div#content_cell_main{
+    width: 80%;
+}
+
+div#content_cell_right{
+    width: 20%;
+}
+
+div#main_column{
+    padding: 1em;
+}
+
+div#main_column div.iframe_container{
+    width: 100%;
+    text-align: center;
+}
+
+div#main_column iframe.project_embed{
+    background-color: #ffffff;
+    border-radius: 0.8em;
+    border: 0.1em solid #110022;
+    max-width: 90%;
+    max-height: 70em;
+}
+
+div#right_column{
+    padding: 1em;
+    transition: all .3s ease-in-out;
+}
+
+div#right_column div.url{
+    vertical-align: middle;
+}
+
+div#right_column div.url img{
+    width: 2em;
+    height: 2em;
+    vertical-align: middle;
+}
+

+ 0 - 0
www/css/m/blog.css


+ 6 - 0
www/css/project.css

@@ -52,6 +52,7 @@ div#main_column iframe.project_embed{
 
 div#right_column{
     padding: 1em;
+    transition: all .3s ease-in-out;
 }
 
 div#right_column div.url{
@@ -64,3 +65,8 @@ div#right_column div.url img{
     vertical-align: middle;
 }
 
+div#right_column div#advanced_search{
+    transition: all .3s ease-in-out;
+    overflow: hidden;
+    height: 0;
+}

+ 26 - 27
www/css/ui.css

@@ -31,11 +31,21 @@ a{
     font-weight: bold;
 }
 
+.pointer {
+    cursor: pointer;
+}
+
 /* Hidden elements */
 .hidden{
     display: none;
 }
 
+img.slider{
+    width: 1em;
+    height: 1em;
+    vertial-align: middle;
+    transition: all .3s ease-in-out;
+}
 
 
 /**********************************
@@ -213,35 +223,39 @@ div#content{
 }
 
 div.section{
-    margin: 1em;
+    margin: 0.5em;
     background-color: #898989;
     border: 0.063em solid #77777;
-    border-radius: 0.15em;
-    padding: 0.5em;
+    border-radius: 2.5em 2.5em 1em 1em;
+    padding: 0.2em;
     box-shadow: 0 0 0.75em #888888;
 }
 
+div.section_no_title{
+    border-radius: 1em;
+}
+
 div.section h3.section_title{
     font-weight: bold;
     color: #ccddff;
     width: 100%;
     text_align: left;
-    padding: 0.2em 0em 0.1em 0em;
+    padding: 0.2em;
     margin: 0;
-    text-indent: 0.5em;
-    margin: 0.625em 0 0.438em 0.625em;
     text-shadow: 0 0 0.4em #000022;
     font-size: 200%;
 }
 
-
-/* Style only class. Is the title of a .lighted element */
-div.section h3.section_title_DELETEME{
-    font-size: 150%;
-    margin: 0.625em 0 0.438em 0.625em;
-    text-shadow: 0 0 0.75em #dddddd;
+/* .entry is a style only class to show content. Must be allways children os a .lighted element */
+div.section div.entry{
+    background-color: #eeeeee;
+    border: 0.1em solid #555555;
+    border-radius: 0.6em;
+    padding: 0.5em;
 }
 
+
+
 /* Style for the mathces in search results */
 span.result_counter{
     margin-left: 1.2em;
@@ -250,21 +264,6 @@ span.result_counter{
     font-style: italic;
 }
 
-/* .entry is a style only class to show content. Must be allways children os a .lighted element */
-div.section div.entry{
-    transition: all .3s ease-in-out;
-    margin: 1% 0.438em 0 0.438em;
-    background-color: #cccccc;
-    border: 0.143em solid #555555;
-    border-radius: 0.314em;
-    padding: 0.5em;
-    box-shadow: 0 0 0.5em #333333;
-}
-
-div.section div.entry:hover{
-    background-color: #eeeeee;
-}
-
 /* Shown when no records on database */
 div.unavailable{
     margin-left: 4em;

+ 0 - 1
www/functions.php

@@ -221,7 +221,6 @@
      * @return: (string): Text.                          *
      *****************************************************/
     function text($con, $id, $lang){
-        error_log("SELECT text FROM text WHERE id = '$id' AND lang = '$lang';");
         $q = mysqli_query($con, "SELECT text FROM text WHERE id = '$id' AND lang = '$lang';");
         return mysqli_fetch_array($q)["text"];
     }

BIN
www/img/license/GPLV3.png


BIN
www/img/license/icon/CC-0.png


BIN
www/img/license/icon/CC-BY-SA.png


BIN
www/img/license/icon/GPLV3.png


BIN
www/img/license/logo/CC-0.png


BIN
www/img/license/logo/CC-BY-SA.png


BIN
www/img/license/logo/GPLV3.png


BIN
www/img/misc/slid-close.png


BIN
www/img/misc/slid-down.png


BIN
www/img/misc/slid-left.png


BIN
www/img/misc/slid-menu.png


BIN
www/img/misc/slid-right.png


BIN
www/img/misc/slid-top.png


BIN
www/img/url/github.png


+ 85 - 15
www/project/index.php

@@ -1,14 +1,15 @@
 <?php
     session_start();
     $http_host = $_SERVER["HTTP_HOST"];
-    $doc_root = $_SERVER["DOCUMENT_ROOT"]; 
+    $doc_root = $_SERVER["DOCUMENT_ROOT"];
     include $doc_root . "functions.php";
     $proto = get_protocol();
     $con = start_db();
     $server = $proto . $http_host;
     $lang = select_language();
-    $cur_section = "";
+    $cur_section = "project";
     $cur_entry = "";
+
 ?>
 <!DOCTYPE html>
 <html>
@@ -16,45 +17,46 @@
         <meta content='text/html; charset=utf-8' http-equiv='content-type'/>
         <meta charset='utf-8'/>
         <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1'/>
-        <title>I&ntilde;igo Valentin</title>
+        <title><?=text($con, "PROJECT_TITLE", $lang)?> - I&ntilde;igo Valentin</title>
         <link rel='shortcut icon' href='<?=$server?>/img/logo/favicon.ico'/>
         <!-- CSS files -->
         <style>
 <?php
             include $doc_root . "css/ui.css";
-            include $doc_root . "css/home.css";
+            include $doc_root . "css/project.css";
 ?>
         </style>
         <!-- CSS for mobile version -->
         <style media='(max-width : 990px)'>
 <?php
             include $doc_root . "css/m/ui.css";
-            include $doc_root . "css/m/home.css";
+            include $doc_root . "css/m/project.css";
 ?>
         </style>
         <!-- Script files -->
         <script type='text/javascript'>
 <?php
             include $doc_root . "script/ui.js";
+            include $doc_root . "script/project.js";
 ?>
         </script>
         <!-- Meta tags -->
-        <link rel='canonical' href='<?=$server?>'/>
+        <link rel='canonical' href='<?=$server?>/project/'/>
         <link rel='author' href='<?=$server?>'/>
         <link rel='publisher' href='<?=$server?>'/>
-        <meta name='description' content=''/>
-        <meta property='og:title' content='I&ntilde;igo Valentin'/>
-        <meta property='og:url' content='<?=$server?>'/>
-        <meta property='og:description' content=''/>
-        <meta property='og:image' content=''/>
+        <meta name='description' content='<?=text($con, "PROJECT_DESCRIPTION", $lang)?>'/>
+        <meta property='og:title' content='<?=text($con, "PROJECT_TITLE", $lang)?> - I&ntilde;igo Valentin'/>
+        <meta property='og:url' content='<?=$server?>/project/'/>
+        <meta property='og:description' content='<?=text($con, "PROJECT_DESCRIPTION", $lang)?>'/>
+        <meta property='og:image' content='<?=$server?>/img/logo/favicon.ico'/>
         <meta property='og:site_name' content='I&ntilde;igo Valentin'/>
         <meta property='og:type' content='website'/>
         <meta property='og:locale' content='<?=$lang?>'/>
         <meta name='twitter:card' content='summary'/>
-        <meta name='twitter:title' content='I&ntilde;igo Valentin'/>
-        <meta name='twitter:description' content=''/>
-        <meta name='twitter:image' content=''/>
-        <meta name='twitter:url' content='<?=$server?>'/>
+        <meta name='twitter:title' content='<?=text($con, "PROJECT_TITLE", $lang)?> - I&ntilde;igo Valentin'/>
+        <meta name='twitter:description' content='<?=text($con, "PROJECT_DESCRIPTION", $lang)?>'/>
+        <meta name='twitter:image' content='<?=$server?>/img/logo/favicon.ico'/>
+        <meta name='twitter:url' content='<?=$server?>/project/'/>
         <meta name='robots' content='index follow'/>
     </head>
     <body>
@@ -62,9 +64,77 @@
         include $doc_root . "header.php";
 ?>
         <div id='content'>
+            <div id='content_row'>
+                <div class='content_cell' id='content_cell_main'>
+                    <div class='section' id='main_column'>
+                        <h3 class='section_title'><?=text($con, "PROJECT_TITLE", $lang)?></h3>
+<?php
+                        $q_project = mysqli_query($con, "SELECT id, permalink, type, title, logo, header, license, (SELECT dtime FROM project_version WHERE project = p.id AND visible = 1 ORDER BY dtime desc LIMIT 1) AS modified FROM project p WHERE visible = 1 ORDER BY modified DESC;");
+                        while ($r_project = mysqli_fetch_array($q_project)){
+?>
+                            <div class='entry project_row'>
+                                <h4><?=text($con, $r_project["title"], $lang)?></h4>
+<?php
+                                if (strlen($r_project["logo"]) > 0){
+?>
+                                    <img title='<?=text($con, $r_project["title"], $lang)?>' src='<?=$server?>/img/project/logo/<?=$r_project["logo"]?>'/>
+<?php
+                                }
+?>
+                                <?=text($con, $r_project["header"], $lang)?>
+                            </div> <!-- .entry -->
+<?php
+                        }
+?>
+                    </div> <!-- #main_column -->
+                </div> <!-- #content_cell_main -->
+                <div class='content_cell'  id='content_cell_right'>
+                    <div class='section section_no_title' id='right_column'>
+                        <div class='entry'>
+                            <input type='text' placeholder='<?=text($con, "PROJECT_SEARCH", $lang)?>' name='text'/>
+                            <input type='hidden' id='advanced_search_indicator' value='0'/>
+                            <div class='pointer' onClick='showAdvancedSearch();'>
+                                <img class='slider' id='advanced_search_slider' src='<?=$server?>/img/misc/slid-right.png'/>
+                                <?=text($con, "PROJECT_SEARCH_ADVANCED", $lang)?>
+                            </div>
+                            <div id='advanced_search'>
+                                <?=text($con, "PROJECT_SEARCH_TYPE", $lang)?>
+<?php
+                                $q_type = mysqli_query($con, "SELECT id, title FROM project_type;");
+                                while ($r_type = mysqli_fetch_array($q_type)){
+?>
+                                    <br/>
+                                    <label>
+                                        <input type='checkbox' name='type_<?=$r_type["id"]?>' checked/>
+                                        <?=text($con, $r_type["title"], $lang)?>
+                                    </lable>
+<?php
+                                }
+?>
+                                <br/><br/>
+                                <?=text($con, "PROJECT_SEARCH_LICENSE", $lang)?>
+<?php
+                                $q_license = mysqli_query($con, "SELECT id FROM license;");
+                                while ($r_license = mysqli_fetch_array($q_license)){
+?>
+                                    <br/>
+                                    <label>
+                                        <input type='checkbox' name='type_<?=$r_license["id"]?>' checked/>
+                                        <?=$r_license["id"]?>
+                                    </lable>
+<?php
+                                }
+?>
+                            </div>
 
+                        </div> <!-- .entry -->
+                    </div> <!-- #right_column -->
+                </div> <!-- #content_cell_right -->
+            </div> <!-- #content_row -->
         </div> <!-- #content -->
 <?php
+
+        //Footer
         include $doc_root . "footer.php";
         stats($con, $cur_section, $cur_entry);
 ?>

+ 7 - 6
www/project/project.php

@@ -1,14 +1,12 @@
 <?php
     session_start();
     $http_host = $_SERVER["HTTP_HOST"];
-    $doc_root = $_SERVER["DOCUMENT_ROOT"]; 
+    $doc_root = $_SERVER["DOCUMENT_ROOT"];
     include $doc_root . "functions.php";
     $proto = get_protocol();
     $con = start_db();
     $server = $proto . $http_host;
     $lang = select_language();
-    $cur_section = "";
-    $cur_entry = "";
 
     // Get project data
     $permalink = mysqli_real_escape_string($con, $_GET["permalink"]);
@@ -19,8 +17,12 @@
     }
     $r_project = mysqli_fetch_array($q_project);
     $id = $r_project["id"];
+
     $title = text($con, $r_project["title"], $lang);
     $summary = text($con, $r_project["header"], $lang);
+
+    $cur_section = "project";
+    $cur_entry = $id;
 ?>
 <!DOCTYPE html>
 <html>
@@ -115,7 +117,6 @@
                         <div class='entry'>
                             <h4><?=$summary?></h4>
 <?php
-                            error_log("SELECT * FROM project_url WHERE type = 'E' AND project = $id;");
                             $q_embed = mysqli_query($con, "SELECT * FROM project_url WHERE type = 'E' AND project = $id;");
                             while ($r_embed = mysqli_fetch_array($q_embed)){
 ?>
@@ -127,10 +128,10 @@
                             }
 ?>
                         </div> <!-- .entry -->
-                    </div> <!-- #middle_column -->
+                    </div> <!-- #main_column -->
                 </div> <!-- #content_cell_main -->
                 <div class='content_cell'  id='content_cell_right'>
-                    <div class='section' id='right_column'>
+                    <div class='section section_no_title' id='right_column'>
                         <div class='entry'>
 <?php
                             $q_url = mysqli_query($con, "SELECT url, title, summary, logo FROM project_url, project_url_type WHERE project_url_type.id = project_url.type AND project = $id AND type <> 'E';");

+ 0 - 0
www/script/blog.js


+ 20 - 0
www/script/project.js

@@ -7,3 +7,23 @@ function resizeIframe(obj) {
     obj.style.height = (obj.contentWindow.document.body.scrollHeight + 100) + 'px';
     obj.style.width = (obj.contentWindow.document.body.scrollWidth + 100) + 'px';
 }
+
+
+function showAdvancedSearch() {
+    indicator = document.getElementById('advanced_search_indicator');
+    slid = document.getElementById('advanced_search_slider');
+    cont = document.getElementById('advanced_search');
+
+    if (indicator.value == 1){
+        // Advanced search show. Hide it.
+        indicator.value = 0;
+        slid.src = '/img/misc/slid-right.png';
+        cont.style.height = '0px';
+    }
+    else if (indicator.value ==0){
+        // Advanced search hidden. Show it.
+        indicator.value = 1;
+        slid.src = '/img/misc/slid-down.png';
+        cont.style.height = 'auto';
+    }
+}