Iñigo Valentin 8 жил өмнө
parent
commit
5f58515474
57 өөрчлөгдсөн 1704 нэмэгдсэн , 694 устгасан
  1. 1 3
      .gitignore
  2. 25 14
      sql/00_STRUCTURE.SQL
  3. 3 0
      sql/01_PERMISSIONS.SQL
  4. 243 39
      sql/02_DATA.SQL
  5. 5 3
      www/.htaccess
  6. 101 60
      www/blog/index.php
  7. 328 19
      www/blog/post.php
  8. 219 34
      www/css/blog.css
  9. 43 0
      www/css/error.css
  10. 56 0
      www/css/home.css
  11. 0 0
      www/css/m/error.css
  12. 22 0
      www/css/m/home.css
  13. 22 0
      www/css/m/project.css
  14. 64 0
      www/css/m/ui.css
  15. 207 17
      www/css/project.css
  16. 59 98
      www/css/ui.css
  17. 91 0
      www/error.php
  18. 0 101
      www/error/403.php
  19. 0 101
      www/error/404.php
  20. 0 101
      www/error/500.php
  21. 2 2
      www/footer.php
  22. 46 10
      www/functions.php
  23. 6 6
      www/help/index.php
  24. BIN
      www/img/social/github.png
  25. 0 0
      www/img/social/google.gif
  26. BIN
      www/img/social/telegram.gif
  27. BIN
      www/img/social/vkontakte.gif
  28. BIN
      www/img/social/x1/github.png
  29. BIN
      www/img/social/x1/google.gif
  30. BIN
      www/img/social/x1/telegram.gif
  31. BIN
      www/img/social/x1/vkontakte.gif
  32. BIN
      www/img/social/x2/github.png
  33. BIN
      www/img/social/x2/google.gif
  34. BIN
      www/img/social/x2/telegram.gif
  35. BIN
      www/img/social/x2/vkontakte.gif
  36. BIN
      www/img/social/x3/github.png
  37. BIN
      www/img/social/x3/google.gif
  38. BIN
      www/img/social/x3/telegram.gif
  39. BIN
      www/img/social/x3/vkontakte.gif
  40. BIN
      www/img/social/x4/github.png
  41. BIN
      www/img/social/x4/google.gif
  42. BIN
      www/img/social/x4/telegram.gif
  43. BIN
      www/img/social/x4/vkontakte.gif
  44. BIN
      www/img/social/x5/github.png
  45. BIN
      www/img/social/x5/google.gif
  46. BIN
      www/img/social/x5/telegram.gif
  47. BIN
      www/img/social/x5/vkontakte.gif
  48. BIN
      www/img/social/x6/github.png
  49. BIN
      www/img/social/x6/google.gif
  50. BIN
      www/img/social/x6/telegram.gif
  51. BIN
      www/img/social/x6/vkontakte.gif
  52. 90 49
      www/index.php
  53. 13 13
      www/profile/index.php
  54. 10 9
      www/project/index.php
  55. 32 13
      www/project/project.php
  56. 2 2
      www/rss.php
  57. 14 0
      www/script/blog.js

+ 1 - 3
.gitignore

@@ -21,12 +21,10 @@ remoteadmin
 www-admin/redirect_s.php
 
 #SQL data
-sql/dbusers.sql
-sql/*row*.sql
 sql/CUSTOM_ROWS.SQL
+sql/DEBUG_ROWS.SQL
 
 #Passwords file
-sql/dbpasswords.sql
 www/.htpasswd
 www-admin/.htpasswd
 www/.htaccess_local

+ 25 - 14
sql/00_STRUCTURE.SQL

@@ -52,7 +52,17 @@ CREATE TABLE social(
     id       INT           AUTO_INCREMENT  PRIMARY KEY,
     idx      INT           NOT NULL        UNIQUE,
     visible  BOOLEAN       NOT NULL        DEFAULT 1,
-    title    VARCHAR(32)   NOT NULL        REFERENCES text.id,
+    title    VARCHAR(32)   NOT NULL        UNIQUE       REFERENCES text.id,
+    icon     VARCHAR(16)   NOT NULL,
+    url      VARCHAR(256)  NOT NULL
+);
+
+CREATE TABLE share(
+    id       INT           AUTO_INCREMENT      PRIMARY KEY,
+    idx      INT           NOT NULL            UNIQUE,
+    visible  BOOLEAN       NOT NULL            DEFAULT 1,
+    title    VARCHAR(32)   NOT NULL            UNIQUE       REFERENCES text.id,
+    text     VARCHAR(32)   REFERENCES text.id,
     icon     VARCHAR(16)   NOT NULL,
     url      VARCHAR(256)  NOT NULL
 );
@@ -75,10 +85,10 @@ CREATE TABLE post_tag (
 );
 
 CREATE TABLE post_image (
-    id      INT           NOT NULL,
-    post    INT           NOT NULL  REFERENCES post.id,
-    image   VARCHAR(200)  NOT NULL,
-    PRIMARY KEY(id, post)
+    id     INT           AUTO_INCREMENT  PRIMARY KEY,
+    post   INT           NOT NULL        REFERENCES post.id,
+    idx    INT           NOT NULL,
+    image  VARCHAR(200)  NOT NULL
 );
 
 CREATE TABLE post_comment (
@@ -148,17 +158,17 @@ CREATE TABLE project_url_type (
 );
 
 CREATE TABLE project_url (
-    project  INT            NOT NULL  REFERENCES project.id,
-    type     VARCHAR(1)     NOT NULL  REFERENCES project_url_type,
-    url      VARCHAR(1024)  NOT NULL,
-    PRIMARY KEY (project, type)
+    id       INT            AUTO_INCREMENT  PRIMARY KEY,
+    project  INT            NOT NULL        REFERENCES project.id,
+    type     VARCHAR(1)     NOT NULL        REFERENCES project_url_type,
+    url      VARCHAR(1024)  NOT NULL
 );
 
 CREATE TABLE project_image (
-    id       INT           NOT NULL,
-    project  INT           NOT NULL  REFERENCES project.id,
-    image    VARCHAR(200)  NOT NULL,
-    PRIMARY KEY(id, project)
+    id       INT           AUTO_INCREMENT  PRIMARY KEY,
+    project  INT           NOT NULL        REFERENCES project.id,
+    idx      INT           NOT NULL,
+    image    VARCHAR(200)  NOT NULL
 );
 
 CREATE TABLE project_tag (
@@ -213,7 +223,8 @@ CREATE TABLE stat_visit (
     ip       VARCHAR(50),
     uagent   VARCHAR(400),
     os       VARCHAR(150),
-    browser  VARCHAR(150)
+    browser  VARCHAR(150),
+    dtime    TIMESTAMP     NOT NULL  DEFAULT now()
 );
 
 CREATE TABLE stat_view (

+ 3 - 0
sql/01_PERMISSIONS.SQL

@@ -22,6 +22,9 @@
 --GRANT SELECT ON         iv.project_version_type TO 'ivext'@'localhost' IDENTIFIED BY 'XXX';
 --GRANT SELECT, INSERT ON iv.project_comment      TO 'ivext'@'localhost' IDENTIFIED BY 'XXX';
 --GRANT SELECT ON         iv.settings             TO 'ivext'@'localhost' IDENTIFIED BY 'XXX';
+--GRANT SELECT ON         iv.share                TO 'ivext'@'localhost' IDENTIFIED BY 'XXX';
+--GRANT SELECT, INSERT ON iv.stat_view            TO 'ivext'@'localhost' IDENTIFIED BY 'XXX';
+--GRANT SELECT, INSERT ON iv.stat_visit           TO 'ivext'@'localhost' IDENTIFIED BY 'XXX';
 --GRANT SELECT ON         iv.social               TO 'ivext'@'localhost' IDENTIFIED BY 'XXX';
 
 

+ 243 - 39
sql/02_DATA.SQL

@@ -97,6 +97,49 @@ INSERT INTO text VALUES ('SOCIAL_LINKEDIN', 'es', 'SOCIAL', 'LinkedIn', null);
 INSERT INTO text VALUES ('SOCIAL_LINKEDIN', 'en', 'SOCIAL', 'LinkedIn', null);
 INSERT INTO text VALUES ('SOCIAL_LINKEDIN', 'eu', 'SOCIAL', 'LinkedIn', null);
 
+-- SHARE
+INSERT INTO text VALUES ('SHARE_FACEBOOK', 'es', 'SHARE', 'Facebook', null);
+INSERT INTO text VALUES ('SHARE_FACEBOOK', 'en', 'SHARE', 'Facebook', null);
+INSERT INTO text VALUES ('SHARE_FACEBOOK', 'eu', 'SHARE', 'Facebook', null);
+INSERT INTO text VALUES ('SHARE_TWITTER', 'es', 'SHARE', 'Twitter', null);
+INSERT INTO text VALUES ('SHARE_TWITTER', 'en', 'SHARE', 'Twitter', null);
+INSERT INTO text VALUES ('SHARE_TWITTER', 'eu', 'SHARE', 'Twitter', null);
+INSERT INTO text VALUES ('SHARE_GOOGLE', 'es', 'SHARE', 'Google +', null);
+INSERT INTO text VALUES ('SHARE_GOOGLE', 'en', 'SHARE', 'Google +', null);
+INSERT INTO text VALUES ('SHARE_GOOGLE', 'eu', 'SHARE', 'Google +', null);
+INSERT INTO text VALUES ('SHARE_TELEGRAM', 'es', 'SHARE', 'Telegram', null);
+INSERT INTO text VALUES ('SHARE_TELEGRAM', 'en', 'SHARE', 'Telegram', null);
+INSERT INTO text VALUES ('SHARE_TELEGRAM', 'eu', 'SHARE', 'Telegram', null);
+INSERT INTO text VALUES ('SHARE_LINKEDIN', 'es', 'SHARE', 'LinkedIn', null);
+INSERT INTO text VALUES ('SHARE_LINKEDIN', 'en', 'SHARE', 'LinkedIn', null);
+INSERT INTO text VALUES ('SHARE_LINKEDIN', 'eu', 'SHARE', 'LinkedIn', null);
+INSERT INTO text VALUES ('SHARE_VKONTAKTE', 'es', 'SHARE', 'VKontakte', null);
+INSERT INTO text VALUES ('SHARE_VKONTAKTE', 'en', 'SHARE', 'VKontakte', null);
+INSERT INTO text VALUES ('SHARE_VKONTAKTE', 'eu', 'SHARE', 'VKontakte', null);
+INSERT INTO text VALUES ('SHARE_FACEBOOK_DESC', 'es', 'SHARE', 'Publicar en Facebook', null);
+INSERT INTO text VALUES ('SHARE_FACEBOOK_DESC', 'en', 'SHARE', 'Share on Facebook', null);
+INSERT INTO text VALUES ('SHARE_FACEBOOK_DESC', 'eu', 'SHARE', 'Facebook', null);
+INSERT INTO text VALUES ('SHARE_TWITTER_DESC', 'es', 'SHARE', 'Publicar en Twitter', null);
+INSERT INTO text VALUES ('SHARE_TWITTER_DESC', 'en', 'SHARE', 'Share on Twitter', null);
+INSERT INTO text VALUES ('SHARE_TWITTER_DESC', 'eu', 'SHARE', 'Twitter', null);
+INSERT INTO text VALUES ('SHARE_GOOGLE_DESC', 'es', 'SHARE', 'Publicar en Google +', null);
+INSERT INTO text VALUES ('SHARE_GOOGLE_DESC', 'en', 'SHARE', 'Share on Google +', null);
+INSERT INTO text VALUES ('SHARE_GOOGLE_DESC', 'eu', 'SHARE', 'Google +', null);
+INSERT INTO text VALUES ('SHARE_TELEGRAM_DESC', 'es', 'SHARE', 'Publicar en Telegram', null);
+INSERT INTO text VALUES ('SHARE_TELEGRAM_DESC', 'en', 'SHARE', 'Share on Telegram', null);
+INSERT INTO text VALUES ('SHARE_TELEGRAM_DESC', 'eu', 'SHARE', 'Telegram', null);
+INSERT INTO text VALUES ('SHARE_LINKEDIN_DESC', 'es', 'SHARE', 'Publicar en LinkedIn', null);
+INSERT INTO text VALUES ('SHARE_LINKEDIN_DESC', 'en', 'SHARE', 'Share on LinkedIn', null);
+INSERT INTO text VALUES ('SHARE_LINKEDIN_DESC', 'eu', 'SHARE', 'LinkedIn', null);
+INSERT INTO text VALUES ('SHARE_VKONTAKTE_DESC', 'es', 'SHARE', 'Publicar en VKontakte', null);
+INSERT INTO text VALUES ('SHARE_VKONTAKTE_DESC', 'en', 'SHARE', 'Share on VKontakte', null);
+INSERT INTO text VALUES ('SHARE_VKONTAKTE_DESC', 'eu', 'SHARE', 'VKontakte', null);
+INSERT INTO share VALUES (1, 1, 1, 'SHARE_FACEBOOK', 'SHARE_FACEBOOK_DESC', 'facebook.gif', 'https://www.facebook.com/sharer/sharer.php?u=');
+INSERT INTO share VALUES (2, 2, 1, 'SHARE_TWITTER', 'SHARE_TWITTER_DESC', 'twitter.gif', 'https://twitter.com/share?url=');
+INSERT INTO share VALUES (3, 3, 1, 'SHARE_GOOGLE', 'SHARE_GOOGLE_DESC', 'google.gif', 'https://plus.google.com/share?url=');
+INSERT INTO share VALUES (4, 4, 1, 'SHARE_TELEGRAM', 'SHARE_TELEGRAM_DESC', 'telegramn.gif', 'https://t.me/share/url?url=');
+INSERT INTO share VALUES (5, 5, 1, 'SHARE_LINKEDIN', 'SHARE_LINKEDIN_DESC', 'linkedin.gif', 'https://www.linkedin.com/shareArticle?mini=true&url=');
+INSERT INTO share VALUES (6, 6, 1, 'SHARE_VKONTAKTE', 'SHARE_VKONTAKTE_DESC', 'vkontakte.gif', 'http://vk.com/share.php?url=');
 
 -- TAGS
 INSERT INTO text VALUES ('TAG_JS',      'es', 'TAG', 'Javascript', null);
@@ -139,16 +182,25 @@ INSERT INTO text VALUES ('HEADER_BLOG',     'eu', 'HEADER', 'Blog', null);
 
 -- PAGE footer
 INSERT INTO text VALUES ('FOOTER_FOLLOW', 'es', 'FOOTER', 'Sígueme', null);
-INSERT INTO text VALUES ('FOOTER_COPY',   'es', 'FOOTER', 'Copyright Iñigo Valentin 2014 - 2017', null);
+INSERT INTO text VALUES ('FOOTER_COPY',   'es', 'FOOTER', 'Copyright Iñigo Valentin 2014 - #YEAR#', null);
 INSERT INTO text VALUES ('FOOTER_HELP',   'es', 'FOOTER', 'Ayuda', null);
 INSERT INTO text VALUES ('FOOTER_FOLLOW', 'en', 'FOOTER', 'Follow me', null);
-INSERT INTO text VALUES ('FOOTER_COPY',   'en', 'FOOTER', 'Copyright Iñigo Valentin 2014 - 2017', null);
+INSERT INTO text VALUES ('FOOTER_COPY',   'en', 'FOOTER', 'Copyright Iñigo Valentin 2014 - #YEAR#', null);
 INSERT INTO text VALUES ('FOOTER_HELP',   'en', 'FOOTER', 'Help', null);
 INSERT INTO text VALUES ('FOOTER_FOLLOW', 'eu', 'FOOTER', 'Jarraitu', null);
-INSERT INTO text VALUES ('FOOTER_COPY',   'eu', 'FOOTER', 'Copyright Iñigo Valentin 2014 - 2017', null);
+INSERT INTO text VALUES ('FOOTER_COPY',   'eu', 'FOOTER', 'Copyright Iñigo Valentin 2014 - #YEAR#', null);
 INSERT INTO text VALUES ('FOOTER_HELP',   'eu', 'FOOTER', 'Laguntza', null);
 
 
+-- PAGE index
+INSERT INTO text VALUES ('INDEX_LATEST_PROJECTS', 'es', 'INDEX', 'Últimos proyectos', null);
+INSERT INTO text VALUES ('INDEX_LATEST_PROJECTS', 'en', 'INDEX', 'Latest projects', null);
+INSERT INTO text VALUES ('INDEX_LATEST_PROJECTS', 'eu', 'INDEX', 'Asken projektuak', null);
+INSERT INTO text VALUES ('INDEX_LATEST_POSTS', 'es', 'INDEX', 'Últimos posts', null);
+INSERT INTO text VALUES ('INDEX_LATEST_POSTS', 'en', 'INDEX', 'Latest posts', null);
+INSERT INTO text VALUES ('INDEX_LATEST_POSTS', 'eu', 'INDEX', 'Asken postak', null);
+
+
 -- PAGE project
 INSERT INTO text VALUES ('PROJECT_TITLE',           'es', 'PROJECT', 'Proyectos', null);
 INSERT INTO text VALUES ('PROJECT_TITLE',           'en', 'PROJECT', 'Projects', null);
@@ -183,45 +235,186 @@ INSERT INTO text VALUES ('PROJECT_LICENSE_LEGAL',   'eu', 'PROJECT', 'Textu osoa
 
 
 -- PAGE blog
-INSERT INTO text VALUES ('BLOG_TITLE',       'es', 'BLOG', 'Blog', null);
-INSERT INTO text VALUES ('BLOG_TITLE',       'en', 'BLOG', 'Blog', null);
-INSERT INTO text VALUES ('BLOG_TITLE',       'eu', 'BLOG', 'Blog', null);
-INSERT INTO text VALUES ('BLOG_DESCRIPTION', 'es', 'BLOG', '', null); --TODO
-INSERT INTO text VALUES ('BLOG_DESCRIPTION', 'en', 'BLOG', '', null); --TODO
-INSERT INTO text VALUES ('BLOG_DESCRIPTION', 'eu', 'BLOG', '', null); --TODO
-INSERT INTO text VALUES ('BLOG_MORE',        'es', 'BLOG', 'leer más', null);
-INSERT INTO text VALUES ('BLOG_MORE',        'en', 'BLOG', 'read more', null);
-INSERT INTO text VALUES ('BLOG_MORE',        'eu', 'BLOG', 'gehiago irakurri', null);
-INSERT INTO text VALUES ('BLOG_TAGS',        'es', 'BLOG', 'Tags', null);
-INSERT INTO text VALUES ('BLOG_TAGS',        'en', 'BLOG', 'Tags', null);
-INSERT INTO text VALUES ('BLOG_TAGS',        'eu', 'BLOG', 'Tags', null);
-INSERT INTO text VALUES ('BLOG_SEARCH',      'es', 'BLOG', 'Buscar', null);
-INSERT INTO text VALUES ('BLOG_SEARCH',      'en', 'BLOG', 'Search', null);
-INSERT INTO text VALUES ('BLOG_SEARCH',      'eu', 'BLOG', 'Bilatu', null);
-INSERT INTO text VALUES ('BLOG_TAG_CLOUD',   'es', 'BLOG', 'Nube de tags', null);
-INSERT INTO text VALUES ('BLOG_TAG_CLOUD',   'en', 'BLOG', 'Tag Cloud', null);
-INSERT INTO text VALUES ('BLOG_TAG_CLOUD',   'eu', 'BLOG', 'Tag Cloud', null);
-INSERT INTO text VALUES ('BLOG_COMMENTS',    'es', 'BLOG', 'Comentarios', null);
-INSERT INTO text VALUES ('BLOG_COMMENTS',    'en', 'BLOG', 'Comments', null);
-INSERT INTO text VALUES ('BLOG_COMMENTS',    'eu', 'BLOG', 'Comentarios', null);
-INSERT INTO text VALUES ('BLOG_COMMENTS_0',  'es', 'BLOG', 'No hay comentarios aún.', null);
-INSERT INTO text VALUES ('BLOG_COMMENTS_0',  'en', 'BLOG', 'No comments yet.', null);
-INSERT INTO text VALUES ('BLOG_COMMENTS_0',  'eu', 'BLOG', 'No hay comentarios aún.', null);
-INSERT INTO text VALUES ('BLOG_COMMENTS_1',  'es', 'BLOG', 'comentario.', null);
-INSERT INTO text VALUES ('BLOG_COMMENTS_1',  'en', 'BLOG', 'comment.', null);
-INSERT INTO text VALUES ('BLOG_COMMENTS_1',  'eu', 'BLOG', 'comantario.', null);
-INSERT INTO text VALUES ('BLOG_COMMENTS_X',  'es', 'BLOG', 'comentarios.', null);
-INSERT INTO text VALUES ('BLOG_COMMENTS_X',  'en', 'BLOG', 'comments.', null);
-INSERT INTO text VALUES ('BLOG_COMMENTS_X',  'eu', 'BLOG', 'comentarios.', null);
+INSERT INTO text VALUES ('BLOG_TITLE',         'es', 'BLOG', 'Blog', null);
+INSERT INTO text VALUES ('BLOG_TITLE',         'en', 'BLOG', 'Blog', null);
+INSERT INTO text VALUES ('BLOG_TITLE',         'eu', 'BLOG', 'Blog', null);
+INSERT INTO text VALUES ('BLOG_DESCRIPTION',   'es', 'BLOG', '', null); --TODO
+INSERT INTO text VALUES ('BLOG_DESCRIPTION',   'en', 'BLOG', '', null); --TODO
+INSERT INTO text VALUES ('BLOG_DESCRIPTION',   'eu', 'BLOG', '', null); --TODO
+INSERT INTO text VALUES ('BLOG_MORE',          'es', 'BLOG', 'leer más', null);
+INSERT INTO text VALUES ('BLOG_MORE',          'en', 'BLOG', 'read more', null);
+INSERT INTO text VALUES ('BLOG_MORE',          'eu', 'BLOG', 'gehiago irakurri', null);
+INSERT INTO text VALUES ('BLOG_TAGS',          'es', 'BLOG', 'Tags', null);
+INSERT INTO text VALUES ('BLOG_TAGS',          'en', 'BLOG', 'Tags', null);
+INSERT INTO text VALUES ('BLOG_TAGS',          'eu', 'BLOG', 'Tags', null);
+INSERT INTO text VALUES ('BLOG_SEARCH',        'es', 'BLOG', 'Buscar', null);
+INSERT INTO text VALUES ('BLOG_SEARCH',        'en', 'BLOG', 'Search', null);
+INSERT INTO text VALUES ('BLOG_SEARCH',        'eu', 'BLOG', 'Bilatu', null);
+INSERT INTO text VALUES ('BLOG_DETAILS',       'es', 'BLOG', 'Detalles', null);
+INSERT INTO text VALUES ('BLOG_DETAILS',       'en', 'BLOG', 'Details', null);
+INSERT INTO text VALUES ('BLOG_DETAILS',       'eu', 'BLOG', 'Xehentasunak', null);
+INSERT INTO text VALUES ('BLOG_ARCHIVE',       'es', 'BLOG', 'Archivo', null);
+INSERT INTO text VALUES ('BLOG_ARCHIVE',       'en', 'BLOG', 'Archive', null);
+INSERT INTO text VALUES ('BLOG_ARCHIVE',       'eu', 'BLOG', 'Archibo', null);
+INSERT INTO text VALUES ('BLOG_RELATED',       'es', 'BLOG', 'Posts relacionados', null);
+INSERT INTO text VALUES ('BLOG_RELATED',       'en', 'BLOG', 'Related posts', null);
+INSERT INTO text VALUES ('BLOG_RELATED',       'eu', 'BLOG', 'Harramenak', null);
+INSERT INTO text VALUES ('BLOG_SHARE',         'es', 'BLOG', 'Comparte este post', null);
+INSERT INTO text VALUES ('BLOG_SHARE',         'en', 'BLOG', 'Shate this post', null);
+INSERT INTO text VALUES ('BLOG_SHARE',         'eu', 'BLOG', 'Banatu', null);
+INSERT INTO text VALUES ('BLOG_TAG_CLOUD',     'es', 'BLOG', 'Nube de tags', null);
+INSERT INTO text VALUES ('BLOG_TAG_CLOUD',     'en', 'BLOG', 'Tag Cloud', null);
+INSERT INTO text VALUES ('BLOG_TAG_CLOUD',     'eu', 'BLOG', 'Tag Cloud', null);
+INSERT INTO text VALUES ('BLOG_COMMENTS',      'es', 'BLOG', 'Comentarios', null);
+INSERT INTO text VALUES ('BLOG_COMMENTS',      'en', 'BLOG', 'Comments', null);
+INSERT INTO text VALUES ('BLOG_COMMENTS',      'eu', 'BLOG', 'Comentarios', null);
+INSERT INTO text VALUES ('BLOG_COMMENTS_0',    'es', 'BLOG', 'No hay comentarios aún.', null);
+INSERT INTO text VALUES ('BLOG_COMMENTS_0',    'en', 'BLOG', 'No comments yet.', null);
+INSERT INTO text VALUES ('BLOG_COMMENTS_0',    'eu', 'BLOG', 'No hay comentarios aún.', null);
+INSERT INTO text VALUES ('BLOG_COMMENTS_1',    'es', 'BLOG', 'comentario.', null);
+INSERT INTO text VALUES ('BLOG_COMMENTS_1',    'en', 'BLOG', 'comment.', null);
+INSERT INTO text VALUES ('BLOG_COMMENTS_1',    'eu', 'BLOG', 'comantario.', null);
+INSERT INTO text VALUES ('BLOG_COMMENTS_X',    'es', 'BLOG', 'comentarios.', null);
+INSERT INTO text VALUES ('BLOG_COMMENTS_X',    'en', 'BLOG', 'comments.', null);
+INSERT INTO text VALUES ('BLOG_COMMENTS_X',    'eu', 'BLOG', 'comentarios.', null);
+INSERT INTO text VALUES ('BLOG_COMMENTS_YOUR', 'es', 'BLOG', 'Tu comentario...', null);
+INSERT INTO text VALUES ('BLOG_COMMENTS_YOUR', 'en', 'BLOG', 'Your comment...', null);
+INSERT INTO text VALUES ('BLOG_COMMENTS_YOUR', 'eu', 'BLOG', 'Tu comentario...', null);
 
 
 -- PAGE profile
-INSERT INTO text VALUES ('PROFILE_TITLE',       'es', 'PROFILE', 'Yo', null);
-INSERT INTO text VALUES ('PROFILE_TITLE',       'en', 'PROFILE', 'Me', null);
-INSERT INTO text VALUES ('PROFILE_TITLE',       'eu', 'PROFILE', 'Ni', null);
-INSERT INTO text VALUES ('PROFILE_DESCRIPTION', 'es', 'PROFILE', 'Sobre mí', null); --TODO
-INSERT INTO text VALUES ('PROFILE_DESCRIPTION', 'en', 'PROFILE', 'About me', null); --TODO
-INSERT INTO text VALUES ('PROFILE_DESCRIPTION', 'eu', 'PROFILE', 'Niri buruz', null); --TODO
+INSERT INTO text VALUES ('PROFILE_TITLE',            'es', 'PROFILE', 'Yo', null);
+INSERT INTO text VALUES ('PROFILE_TITLE',            'en', 'PROFILE', 'Me', null);
+INSERT INTO text VALUES ('PROFILE_TITLE',            'eu', 'PROFILE', 'Ni', null);
+INSERT INTO text VALUES ('PROFILE_DESCRIPTION',      'es', 'PROFILE', 'Sobre mí', null);
+INSERT INTO text VALUES ('PROFILE_DESCRIPTION',      'en', 'PROFILE', 'About me', null);
+INSERT INTO text VALUES ('PROFILE_DESCRIPTION',      'eu', 'PROFILE', 'Niri buruz', null);
+INSERT INTO text VALUES ('PROFILE_DOWNLOAD_CURRENT', 'es', 'PROFILE', 'Descargar en castellano', null);
+INSERT INTO text VALUES ('PROFILE_DOWNLOAD_CURRENT', 'en', 'PROFILE', 'Download in english', null);
+INSERT INTO text VALUES ('PROFILE_DOWNLOAD_CURRENT', 'eu', 'PROFILE', 'Euzkaraz deskargatu', null);
+INSERT INTO text VALUES ('PROFILE_DOWNLOAD_OTHER',   'es', 'PROFILE', 'Descargar en otros idiomas', null);
+INSERT INTO text VALUES ('PROFILE_DOWNLOAD_OTHER',   'en', 'PROFILE', 'Download in other languages', null);
+INSERT INTO text VALUES ('PROFILE_DOWNLOAD_OTHER',   'eu', 'PROFILE', 'Beste hizkuntzetan deskargatu', null);
+
+
+-- PAGE error
+INSERT INTO text VALUES ('ERROR_TITLE',           'es', 'ERROR', 'Error', null);
+INSERT INTO text VALUES ('ERROR_TITLE',           'en', 'ERROR', 'Error', null);
+INSERT INTO text VALUES ('ERROR_TITLE',           'eu', 'ERROR', 'Errorea', null);
+INSERT INTO text VALUES ('ERROR_ERROR',           'es', 'ERROR', 'ERROR', null);
+INSERT INTO text VALUES ('ERROR_ERROR',           'en', 'ERROR', 'ERROR', null);
+INSERT INTO text VALUES ('ERROR_ERROR',           'eu', 'ERROR', 'ERROR', null);
+INSERT INTO text VALUES ('ERROR_CODE',            'es', 'ERROR', 'CODE', null);
+INSERT INTO text VALUES ('ERROR_CODE',            'en', 'ERROR', 'CODE', null);
+INSERT INTO text VALUES ('ERROR_CODE',            'eu', 'ERROR', 'CODE', null);
+INSERT INTO text VALUES ('ERROR_400_TITLE',       'es', 'ERROR', 'Bad request', null);
+INSERT INTO text VALUES ('ERROR_400_TITLE',       'en', 'ERROR', 'Bad request', null);
+INSERT INTO text VALUES ('ERROR_400_TITLE',       'eu', 'ERROR', 'Bad request', null);
+INSERT INTO text VALUES ('ERROR_400_DESCRIPTION', 'es', 'ERROR', 'La solicitud se ha recibido con errores... y no se como responder.', null);
+INSERT INTO text VALUES ('ERROR_400_DESCRIPTION', 'en', 'ERROR', 'This server doesnt understand your request.', null);
+INSERT INTO text VALUES ('ERROR_400_DESCRIPTION', 'eu', 'ERROR', 'La solicitud se ha recibido con errores... y no se como responder.', null);
+INSERT INTO text VALUES ('ERROR_400_SOLUTION',    'es', 'ERROR', 'Prueba una solución:', null);
+INSERT INTO text VALUES ('ERROR_400_SOLUTION',    'en', 'ERROR', 'Try a solution:', null);
+INSERT INTO text VALUES ('ERROR_400_SOLUTION',    'eu', 'ERROR', 'Prueba una solución:', null);
+INSERT INTO text VALUES ('ERROR_400_SOLUTION_0',  'es', 'ERROR', 'Volver a la página anterior', null);
+INSERT INTO text VALUES ('ERROR_400_SOLUTION_0',  'en', 'ERROR', 'Go to the previous page', null);
+INSERT INTO text VALUES ('ERROR_400_SOLUTION_0',  'eu', 'ERROR', 'Volver a la página anterior', null);
+INSERT INTO text VALUES ('ERROR_400_SOLUTION_1',  'es', 'ERROR', 'Ir a la pá principal', null);
+INSERT INTO text VALUES ('ERROR_400_SOLUTION_1',  'en', 'ERROR', 'Go to the main page', null);
+INSERT INTO text VALUES ('ERROR_400_SOLUTION_1',  'eu', 'ERROR', 'Ir a la pá principal', null);
+INSERT INTO text VALUES ('ERROR_400_SOLUTION_2',  'es', 'ERROR', 'Ver vídeos de gatitos en Youtube', null);
+INSERT INTO text VALUES ('ERROR_400_SOLUTION_2',  'en', 'ERROR', 'Watch cute cat videos in Youtube', null);
+INSERT INTO text VALUES ('ERROR_400_SOLUTION_2',  'eu', 'ERROR', 'Ver vídeos de gatitos en Youtube', null);
+INSERT INTO text VALUES ('ERROR_401_TITLE',       'es', 'ERROR', 'Sin autorización', null);
+INSERT INTO text VALUES ('ERROR_401_TITLE',       'en', 'ERROR', 'Unauthorized', null);
+INSERT INTO text VALUES ('ERROR_401_TITLE',       'eu', 'ERROR', 'Sin autorización', null);
+INSERT INTO text VALUES ('ERROR_401_DESCRIPTION', 'es', 'ERROR', 'Estás intentando ver algo que no debes. No soy muy de prohibir, así que lo m&aacutes probable es que sea algo momentaneo.', null);
+INSERT INTO text VALUES ('ERROR_401_DESCRIPTION', 'en', 'ERROR', 'You are trying to see something you are not supposed to.', null);
+INSERT INTO text VALUES ('ERROR_401_DESCRIPTION', 'eu', 'ERROR', 'Estás intentando ver algo que no debes. No soy muy de prohibir, así que lo m&aacutes probable es que sea algo momentaneo.', null);
+INSERT INTO text VALUES ('ERROR_401_SOLUTION',    'es', 'ERROR', 'Prueba una solución:', null);
+INSERT INTO text VALUES ('ERROR_401_SOLUTION',    'en', 'ERROR', 'Try a solution:', null);
+INSERT INTO text VALUES ('ERROR_401_SOLUTION',    'eu', 'ERROR', 'Prueba una solución:', null);
+INSERT INTO text VALUES ('ERROR_401_SOLUTION_0',  'es', 'ERROR', 'Volver a la página anterior', null);
+INSERT INTO text VALUES ('ERROR_401_SOLUTION_0',  'en', 'ERROR', 'Go to the previous page', null);
+INSERT INTO text VALUES ('ERROR_401_SOLUTION_0',  'eu', 'ERROR', 'Volver a la página anterior', null);
+INSERT INTO text VALUES ('ERROR_401_SOLUTION_1',  'es', 'ERROR', 'Ir a la pá principal', null);
+INSERT INTO text VALUES ('ERROR_401_SOLUTION_1',  'en', 'ERROR', 'Go to the main page', null);
+INSERT INTO text VALUES ('ERROR_401_SOLUTION_1',  'eu', 'ERROR', 'Ir a la pá principal', null);
+INSERT INTO text VALUES ('ERROR_401_SOLUTION_2',  'es', 'ERROR', 'Ver vídeos de gatitos en Youtube', null);
+INSERT INTO text VALUES ('ERROR_401_SOLUTION_2',  'en', 'ERROR', 'Watch cute cat videos in Youtube', null);
+INSERT INTO text VALUES ('ERROR_401_SOLUTION_2',  'eu', 'ERROR', 'Ver vídeos de gatitos en Youtube', null);
+INSERT INTO text VALUES ('ERROR_403_TITLE',       'es', 'ERROR', 'Prohibido', null);
+INSERT INTO text VALUES ('ERROR_403_TITLE',       'en', 'ERROR', 'Forbidden', null);
+INSERT INTO text VALUES ('ERROR_403_TITLE',       'eu', 'ERROR', 'Debekatuta', null);
+INSERT INTO text VALUES ('ERROR_403_DESCRIPTION', 'es', 'ERROR', 'Estás intentando ver algo que no debes. No soy muy de prohibir, así que lo m&aacutes probable es que sea algo momentaneo.', null);
+INSERT INTO text VALUES ('ERROR_403_DESCRIPTION', 'en', 'ERROR', 'You are trying to see something you are not supposed to.', null);
+INSERT INTO text VALUES ('ERROR_403_DESCRIPTION', 'eu', 'ERROR', 'Estás intentando ver algo que no debes. No soy muy de prohibir, así que lo m&aacutes probable es que sea algo momentaneo.', null);
+INSERT INTO text VALUES ('ERROR_403_SOLUTION',    'es', 'ERROR', 'Prueba una solución:', null);
+INSERT INTO text VALUES ('ERROR_403_SOLUTION',    'en', 'ERROR', 'Try a solution:', null);
+INSERT INTO text VALUES ('ERROR_403_SOLUTION',    'eu', 'ERROR', 'Prueba una solución:', null);
+INSERT INTO text VALUES ('ERROR_403_SOLUTION_0',  'es', 'ERROR', 'Volver a la página anterior', null);
+INSERT INTO text VALUES ('ERROR_403_SOLUTION_0',  'en', 'ERROR', 'Go to the previous page', null);
+INSERT INTO text VALUES ('ERROR_403_SOLUTION_0',  'eu', 'ERROR', 'Volver a la página anterior', null);
+INSERT INTO text VALUES ('ERROR_403_SOLUTION_1',  'es', 'ERROR', 'Ir a la pá principal', null);
+INSERT INTO text VALUES ('ERROR_403_SOLUTION_1',  'en', 'ERROR', 'Go to the main page', null);
+INSERT INTO text VALUES ('ERROR_403_SOLUTION_1',  'eu', 'ERROR', 'Ir a la pá principal', null);
+INSERT INTO text VALUES ('ERROR_403_SOLUTION_2',  'es', 'ERROR', 'Ver vídeos de gatitos en Youtube', null);
+INSERT INTO text VALUES ('ERROR_403_SOLUTION_2',  'en', 'ERROR', 'Watch cute cat videos in Youtube', null);
+INSERT INTO text VALUES ('ERROR_403_SOLUTION_2',  'eu', 'ERROR', 'Ver vídeos de gatitos en Youtube', null);
+INSERT INTO text VALUES ('ERROR_404_TITLE',       'es', 'ERROR', 'No enconrtado', null);
+INSERT INTO text VALUES ('ERROR_404_TITLE',       'en', 'ERROR', 'Not found', null);
+INSERT INTO text VALUES ('ERROR_404_TITLE',       'eu', 'ERROR', 'No enconrtado', null);
+INSERT INTO text VALUES ('ERROR_404_DESCRIPTION', 'es', 'ERROR', 'La página que buscas no existe en este universo. Inténtalo en uno diferente.', null);
+INSERT INTO text VALUES ('ERROR_404_DESCRIPTION', 'en', 'ERROR', 'Sorry. The page you are looking for doesn't exist in this universe. Try in an alternate one.', null);
+INSERT INTO text VALUES ('ERROR_404_DESCRIPTION', 'eu', 'ERROR', 'La página que buscas no existe en este universo. Inténtalo en uno diferente.', null);
+INSERT INTO text VALUES ('ERROR_404_SOLUTION',    'es', 'ERROR', 'Prueba una solución:', null);
+INSERT INTO text VALUES ('ERROR_404_SOLUTION',    'en', 'ERROR', 'Try a solution:', null);
+INSERT INTO text VALUES ('ERROR_404_SOLUTION',    'eu', 'ERROR', 'Prueba una solución:', null);
+INSERT INTO text VALUES ('ERROR_404_SOLUTION_0',  'es', 'ERROR', 'Volver a la página anterior', null);
+INSERT INTO text VALUES ('ERROR_404_SOLUTION_0',  'en', 'ERROR', 'Go to the previous page', null);
+INSERT INTO text VALUES ('ERROR_404_SOLUTION_0',  'eu', 'ERROR', 'Volver a la página anterior', null);
+INSERT INTO text VALUES ('ERROR_404_SOLUTION_1',  'es', 'ERROR', 'Ir a la pá principal', null);
+INSERT INTO text VALUES ('ERROR_404_SOLUTION_1',  'en', 'ERROR', 'Go to the main page', null);
+INSERT INTO text VALUES ('ERROR_404_SOLUTION_1',  'eu', 'ERROR', 'Ir a la pá principal', null);
+INSERT INTO text VALUES ('ERROR_404_SOLUTION_2',  'es', 'ERROR', 'Ver vídeos de gatitos en Youtube', null);
+INSERT INTO text VALUES ('ERROR_404_SOLUTION_2',  'en', 'ERROR', 'Watch cute cat videos in Youtube', null);
+INSERT INTO text VALUES ('ERROR_404_SOLUTION_2',  'eu', 'ERROR', 'Ver vídeos de gatitos en Youtube', null);
+INSERT INTO text VALUES ('ERROR_500_TITLE',       'es', 'ERROR', 'Error del servidor', null);
+INSERT INTO text VALUES ('ERROR_500_TITLE',       'en', 'ERROR', 'Server error', null);
+INSERT INTO text VALUES ('ERROR_500_TITLE',       'eu', 'ERROR', 'Errorea serbidorean', null);
+INSERT INTO text VALUES ('ERROR_500_DESCRIPTION', 'es', 'ERROR', 'La he liado parda. El fallo está en mi lado, pero no te preocupes, ahorá mismo el informático estará sudando tinta gorda para arreglarlo.', null);
+INSERT INTO text VALUES ('ERROR_500_DESCRIPTION', 'en', 'ERROR', 'This one is on me: I've messed something up. Sorry! I'm probably trying to fix it right now.', null);
+INSERT INTO text VALUES ('ERROR_500_DESCRIPTION', 'eu', 'ERROR', 'La he liado parda. El fallo está en mi lado, pero no te preocupes, ahorá mismo el informático estará sudando tinta gorda para arreglarlo.', null);
+INSERT INTO text VALUES ('ERROR_500_SOLUTION',    'es', 'ERROR', 'Prueba una solución:', null);
+INSERT INTO text VALUES ('ERROR_500_SOLUTION',    'en', 'ERROR', 'Try a solution:', null);
+INSERT INTO text VALUES ('ERROR_500_SOLUTION',    'eu', 'ERROR', 'Prueba una solución:', null);
+INSERT INTO text VALUES ('ERROR_500_SOLUTION_0',  'es', 'ERROR', 'Volver a la página anterior', null);
+INSERT INTO text VALUES ('ERROR_500_SOLUTION_0',  'en', 'ERROR', 'Go to the previous page', null);
+INSERT INTO text VALUES ('ERROR_500_SOLUTION_0',  'eu', 'ERROR', 'Volver a la página anterior', null);
+INSERT INTO text VALUES ('ERROR_500_SOLUTION_1',  'es', 'ERROR', 'Ir a la pá principal', null);
+INSERT INTO text VALUES ('ERROR_500_SOLUTION_1',  'en', 'ERROR', 'Go to the main page', null);
+INSERT INTO text VALUES ('ERROR_500_SOLUTION_1',  'eu', 'ERROR', 'Ir a la pá principal', null);
+INSERT INTO text VALUES ('ERROR_500_SOLUTION_2',  'es', 'ERROR', 'Ver vídeos de gatitos en Youtube', null);
+INSERT INTO text VALUES ('ERROR_500_SOLUTION_2',  'en', 'ERROR', 'Watch cute cat videos in Youtube', null);
+INSERT INTO text VALUES ('ERROR_500_SOLUTION_2',  'eu', 'ERROR', 'Ver vídeos de gatitos en Youtube', null);
+INSERT INTO text VALUES ('ERROR_XXX_TITLE',       'es', 'ERROR', 'Error inesperado', null);
+INSERT INTO text VALUES ('ERROR_XXX_TITLE',       'en', 'ERROR', 'Unexpected error', null);
+INSERT INTO text VALUES ('ERROR_XXX_TITLE',       'eu', 'ERROR', 'Error inesperado', null);
+INSERT INTO text VALUES ('ERROR_XXX_DESCRIPTION', 'es', 'ERROR', 'Algo ha ido mal...', null);
+INSERT INTO text VALUES ('ERROR_XXX_DESCRIPTION', 'en', 'ERROR', 'Something went wrong...', null);
+INSERT INTO text VALUES ('ERROR_XXX_DESCRIPTION', 'eu', 'ERROR', 'Algo ha ido mal...', null);
+INSERT INTO text VALUES ('ERROR_XXX_SOLUTION',    'es', 'ERROR', 'Prueba una solución:', null);
+INSERT INTO text VALUES ('ERROR_XXX_SOLUTION',    'en', 'ERROR', 'Try a solution:', null);
+INSERT INTO text VALUES ('ERROR_XXX_SOLUTION',    'eu', 'ERROR', 'Prueba una solución:', null);
+INSERT INTO text VALUES ('ERROR_XXX_SOLUTION_0',  'es', 'ERROR', 'Volver a la página anterior', null);
+INSERT INTO text VALUES ('ERROR_XXX_SOLUTION_0',  'en', 'ERROR', 'Go to the previous page', null);
+INSERT INTO text VALUES ('ERROR_XXX_SOLUTION_0',  'eu', 'ERROR', 'Volver a la página anterior', null);
+INSERT INTO text VALUES ('ERROR_XXX_SOLUTION_1',  'es', 'ERROR', 'Ir a la pá principal', null);
+INSERT INTO text VALUES ('ERROR_XXX_SOLUTION_1',  'en', 'ERROR', 'Go to the main page', null);
+INSERT INTO text VALUES ('ERROR_XXX_SOLUTION_1',  'eu', 'ERROR', 'Ir a la pá principal', null);
+INSERT INTO text VALUES ('ERROR_XXX_SOLUTION_2',  'es', 'ERROR', 'Ver vídeos de gatitos en Youtube', null);
+INSERT INTO text VALUES ('ERROR_XXX_SOLUTION_2',  'en', 'ERROR', 'Watch cute cat videos in Youtube', null);
+INSERT INTO text VALUES ('ERROR_XXX_SOLUTION_2',  'eu', 'ERROR', 'Ver vídeos de gatitos en Youtube', null);
 
 
 -- TABLE project_type
@@ -346,4 +539,15 @@ INSERT INTO cv_category VALUES (3, 'CV_CATEGORY_PROJECTS', 'CV_CATEGORY_PROJECTS
 INSERT INTO cv_category VALUES (4, 'CV_CATEGORY_OTHER',    'CV_CATEGORY_OTHER_SUMMARY',    1 , 4);
 
 
+-- To be filled before installing
+INSERT INTO text VALUES ('USER_NAME', 'es', 'USER', '', null);
+INSERT INTO text VALUES ('USER_NAME', 'en', 'USER', '', null);
+INSERT INTO text VALUES ('USER_NAME', 'eu', 'USER', '', null);
+INSERT INTO text VALUES ('USER_TAGLINE', 'es', 'USER', '', null);
+INSERT INTO text VALUES ('USER_TAGLINE', 'en', 'USER', '', null);
+INSERT INTO text VALUES ('USER_TAGLINE', 'eu', 'USER', '', null);
+INSERT INTO text VALUES ('USER_BIO', 'es', 'USER', '', null);
+INSERT INTO text VALUES ('USER_BIO', 'en', 'USER', '', null);
+INSERT INTO text VALUES ('USER_BIO', 'eu', 'USER', '', null);
+
 -- ADD MORE ROWS AS YOU SEE FIT:

+ 5 - 3
www/.htaccess

@@ -118,8 +118,10 @@ Options -MultiViews
 #
 # Used to: redirect to nice error pages.
 #
-ErrorDocument 403 /error/403.php
-ErrorDocument 404 /error/404.php
-ErrorDocument 500 /error/500.php
+ErrorDocument 400 /error.php
+ErrorDocument 401 /error.php
+ErrorDocument 403 /error.php
+ErrorDocument 404 /error.php
+ErrorDocument 500 /error.php
 
 

+ 101 - 60
www/blog/index.php

@@ -1,12 +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();
+    $lang = select_language($con);
     $lserver = $server . "/" . $lang;
     $cur_section = "blog";
     $cur_entry = "";
@@ -18,7 +18,7 @@
         <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><?=text($con, "BLOG_TITLE", $lang)?> - I&ntilde;igo Valentin</title>
+        <title><?=text($con, "BLOG_TITLE", $lang)?> - <?=text($con, "USER_NAME", $lang);?></title>
         <link rel='shortcut icon' href='<?=$lserver?>/img/logo/favicon.ico'/>
         <!-- CSS files -->
         <style>
@@ -46,15 +46,15 @@
         <link rel='author' href='<?=$lserver?>'/>
         <link rel='publisher' href='<?=$lserver?>'/>
         <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:title' content='<?=text($con, "BLOG_TITLE", $lang)?> - <?=text($con, "USER_NAME", $lang);?>'/>
         <meta property='og:url' content='<?=$lserver?>/blog/'/>
         <meta property='og:description' content='<?=text($con, "BLOG_DESCRIPTION", $lang)?>'/>
         <meta property='og:image' content='<?=$lserver?>/img/logo/favicon.ico'/>
-        <meta property='og:site_name' content='I&ntilde;igo Valentin'/>
+        <meta property='og:site_name' content='<?=text($con, "USER_NAME", $lang);?>'/>
         <meta property='og:type' content='website'/>
         <meta property='og:locale' content='<?=$lang?>'/>
         <meta name='twitter:card' content='summary'/>
-        <meta name='twitter:title' content='<?=text($con, "BLOG_TITLE", $lang)?> - I&ntilde;igo Valentin'/>
+        <meta name='twitter:title' content='<?=text($con, "BLOG_TITLE", $lang)?> - <?=text($con, "USER_NAME", $lang);?>'/>
         <meta name='twitter:description' content='<?=text($con, "BLOG_DESCRIPTION", $lang)?>'/>
         <meta name='twitter:image' content='<?=$lserver?>/img/logo/favicon.ico'/>
         <meta name='twitter:url' content='<?=$lserver?>/project/'/>
@@ -67,7 +67,7 @@
         <div id='content'>
             <div id='content_row'>
                 <div class='content_cell' id='content_cell_main'>
-                    <div id='main_column' class='section'>
+                    <div id='post_list' 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;");
@@ -80,7 +80,7 @@
                                     <meta itemprop='articleBody text' content='<?=text($con, $r_blog["text"], $lang)?>'/>
                                     <meta itemprop='mainEntityOfPage' content='<?=$lserver?>'/>
                                     <h3 class='entry_title'>
-                                        <a itemprop='url' href='<?=$lserver?>/blog/<?=$r_blog["permalink"]?>'><?=$r_blog["title"]?></a>
+                                        <a itemprop='url' href='<?=$lserver?>/blog/<?=$r_blog["permalink"]?>'><?=text($con, $r_blog["title"], $lang)?></a>
                                     </h3>
 <?php
                                     $q_image = mysqli_query($con, "SELECT image FROM post_image WHERE post = $r_blog[id] ORDER BY idx LIMIT 1;");
@@ -89,52 +89,28 @@
 ?>
                                         <div class='post_list_image_container'>
                                             <a href='<?=$lserver?>/blog/<?=$r_blog["permalink"]?>'>
-                                                <meta itemprop='image' content='<?=$lserver?>/img/blog/view/<?=$r_image["image"]?>'/>
-                                                <img class='post_list_image alt='<?=$r_blog["title"]?>' src='<?=$lserver?>/img/blog/miniature/<?=$r_image["image"]?>'/>
+                                                <meta itemprop='image' content='<?=$lserver?>/img/blog/x4/<?=$r_image["image"]?>'/>
+                                                <img class='post_list_image' alt='<?=$r_blog["title"]?>' src='<?=$lserver?>/img/blog/x2/<?=$r_image["image"]?>'/>
                                             </a>
                                         </div>
 <?php
                                     }
 ?>
-                                    <p><?=cutText($r_blog["text"], 800, text($con, "BLOG_MORE", $lang), "$lserver/blog/$r_blog[permalink]/")?></p>
+                                    <p><?=cut_text(text($con, $r_blog["text"], $lang), 200, text($con, "BLOG_MORE", $lang), "$lserver/blog/$r_blog[permalink]/")?></p>
                                     <hr/>
-                                    <table class='post_footer'>
+                                    <table class='post_list_footer'>
                                         <tr>
+                                            <td class='date'>
+                                                <span class='date'><?=format_date($r_blog['dtime'], $lang, false)?></span>
+                                            </td>
 <?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;");
+                                                $q_comment = mysqli_query($con, "SELECT count(id) AS count FROM post_comment WHERE post = $r_blog[id] AND approved = 1;");
                                                 $r_comment = mysqli_fetch_array($q_comment);
 ?>
                                                 <meta itemprop='commentCount interationCount' content='<?=$r_comment["count"]?>'/>
-                                                <td class='r_comment'>
+                                                <td class='comment_counter'>
 <?php
                                                     if ($r_comment['count'] == 1){
 ?>
@@ -148,7 +124,7 @@
                                                     }
                                                     else{
 ?>
-                                                        <span class='comment_counter'>$<?=r_comment["count"]?> <?=text($con, "BLOG_COMMENTS_X", $lang)?></span>
+                                                        <span class='comment_counter'><?=$r_comment["count"]?> <?=text($con, "BLOG_COMMENTS_X", $lang)?></span>
 <?php
                                                     }
 ?>
@@ -157,7 +133,26 @@
                                             } // if ($r_blog["comments"] == 1)
 ?>
                                         </tr>
-                                    </table> <!-- .post_footer -->
+                                    </table> <!-- .post_list_footer -->
+<?php
+                                    // Tags
+                                    $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'>" . 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?>'/>
+                                        <?=$tag_string?>
+<?php
+                                    }
+?>
                                 </div> <!-- .blog_entry -->
                                 </br>
 <?php
@@ -166,8 +161,9 @@
                     </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'>
+                    <div class='section' id='info'>
+                        <h3 class='section_title'><?=text($con, "BLOG_DETAILS", $lang)?></h3>
+                        <div id='info_search' class='entry'>
                             <h4><?=text($con, "BLOG_SEARCH", $lang)?></h4>
                             <div id='search_panel_inputs'>
                                 <form action='#' onSubmit='event.preventDefault();launchSearch("<?=$lng["search_field_all"]?>");'>
@@ -175,27 +171,72 @@
                                     <input id='search_panel_submit' class='search_element' type='submit' value='<?=text($con, "BLOG_SEARCH", $lang)?>'/>
                                 </form>
                             </div>
-                        </div> <!-- .entry -->
-                        <div class='entry'>
+                        </div> <!-- #info_search -->
+                        <hr/>
+                        <div id='info_tag_cloud' class='entry'>
                             <h4><?=text($con, "BLOG_TAG_CLOUD", $lang)?></h4>
+                            <div id='cloud'>
 <?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);
+                                //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);
+                                $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='<?=$lserver?>/blog/search/tag/<?=$r_tag["tag"]?>'>
+                                        <span style='font-size: <?=$size?>%'><?=text($con, $r_tag["tag"], $lang)?></span>
+                                    </a>
+<?php
+                                }
+?>
+                            </div>
+                        </div> <!-- #info_tag_cloud -->
+                        <hr/>
+                        <div id='info_all' class='entry'>
+                            <h4><?=text($con, "BLOG_ARCHIVE", $lang)?></h4>
+<?php
+                            $q_year = mysqli_query($con, "SELECT year(dtime) AS year FROM post WHERE visible = 1 GROUP BY year(dtime) ORDER BY year DESC;");
+                            while($r_year = mysqli_fetch_array($q_year)){
+?>
+                                <div class='year pointer' onClick='toggleElement("year_<?=$r_year["year"]?>");'>
+                                    <img class='slider' id='slid_year_<?=$r_year["year"]?>' src='<?=$server?>/img/misc/slid-right.png' alt='<?=$r_year["year"]?>'/>
+                                    <span class='fake_a'><?=$r_year["year"]?></span>
+                                </div>
+                                <div class='list_year pointer' id='list_year_<?=$r_year["year"]?>'>
+<?php
+                                    $q_month = mysqli_query($con, "SELECT month(dtime) AS month FROM post WHERE visible = 1 AND year(dtime) = $r_year[year] GROUP BY month(dtime) ORDER BY month DESC;");
+                                    while($r_month = mysqli_fetch_array($q_month)){
+?>
+                                        <div class='month pointer' onClick='toggleElement("month_<?=$r_year["year"]?>_<?=$r_month["month"]?>");'>
+                                            <img class='slider' id='slid_month_<?=$r_year["year"]?>_<?=$r_month["month"]?>' src='<?=$server?>/img/misc/slid-right.png' alt='<?=$r_month["month"]?>'/>
+                                            <span class='fake_a'><?=ucfirst(text($con, "MONTH_" . str_pad($r_month["month"], 2, "0", STR_PAD_LEFT), $lang))?></span>
+                                        </div>
+                                        <ul id='list_month_<?=$r_year["year"]?>_<?=$r_month["month"]?>' class='post_list'>
+<?php
+                                            $q_title = mysqli_query($con, "SELECT id, permalink, title FROM post WHERE visible = 1 AND year(dtime) = $r_year[year] AND month(dtime) = '$r_month[month]' ORDER BY dtime DESC;");
+                                            while($r_title = mysqli_fetch_array($q_title)){
+?>
+                                                <li>
+                                                    <a href='<?=$lserver?>/blog/<?=$r_title["permalink"]?>'><?=text($con, $r_title["title"], $lang)?></a>
+                                                </li>
+<?php
+                                            }
+?>
+                                        </ul>
+<?php
+                                    }
 ?>
-                                <a href='<?=$lserver?>/blog/search/tag/<?=$r_tag["tag"]?>'>
-                                    <span style='font-size: <?=$size?>%'><?=text($con, $r_tag["tag"], $lang)?></span>
-                                </a>
+                                </div> <!-- #list_year_<?=$r_year["year"]?> -->
 <?php
-                            }
+                            } //while($r_year = mysqli_fetch_array($q_year))
 ?>
-                        </div> <!-- .entry -->
-                    </div> <!-- #right_column -->
-                </div> <!-- #content -->
+                        </div> <!-- #info_all -->
+                    </div> <!-- #info -->
+                </div> <!-- .content_cell -->
+             </div> <!-- #content_row -->
+         </div> <!-- #content -->
 <?php
         include $doc_root . "footer.php";
         stats($con, $cur_section, $cur_entry);

+ 328 - 19
www/blog/post.php

@@ -1,15 +1,35 @@
 <?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();
+    $lang = select_language($con);
     $lserver = $server . "/" . $lang;
-    $cur_section = "";
-    $cur_entry = "";
+
+    // Get post data
+    $permalink = mysqli_real_escape_string($con, $_GET["permalink"]);
+    $q_post = mysqli_query($con, "SELECT * FROM post WHERE permalink = '$permalink' AND visible = 1;");
+    if (mysqli_num_rows($q_post) == 0){
+        header("Location: $lserver/blog/");
+        exit(-1);
+    }
+    $r_post = mysqli_fetch_array($q_post);
+    $id = $r_post["id"];
+    $title = text($con, $r_post["title"], $lang);
+    $text = text($con, $r_post["text"], $lang);
+
+    $cur_section = "blog";
+    $cur_entry = $id;
+
+    // First image (if any)
+    $image = "";
+    $q_image = mysqli_query($con, "SELECT image FROM post_image WHERE post = $id ORDER BY idx LIMIT 1");
+    if (mysqli_num_rows($q_image) > 0){
+        $image = mysqli_fetch_array($q_image)["image"];
+    }
 ?>
 <!DOCTYPE html>
 <html>
@@ -17,45 +37,67 @@
         <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><?=$title?> - <?=text($con, "USER_NAME", $lang);?></title>
         <link rel='shortcut icon' href='<?=$lserver?>/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='<?=$lserver?>'/>
+        <link rel='canonical' href='<?=$lserver?>/blog/<?=$permalink?>'/>
         <link rel='author' href='<?=$lserver?>'/>
         <link rel='publisher' href='<?=$lserver?>'/>
-        <meta name='description' content=''/>
-        <meta property='og:title' content='I&ntilde;igo Valentin'/>
-        <meta property='og:url' content='<?=$lserver?>'/>
-        <meta property='og:description' content=''/>
-        <meta property='og:image' content=''/>
-        <meta property='og:site_name' content='I&ntilde;igo Valentin'/>
+        <meta name='description' content='<?=$text?>'/>
+        <meta property='og:title' content='<?=$title?> - <?=text($con, "USER_NAME", $lang);?>'/>
+        <meta property='og:url' content='<?=$lserver?>/blog/<?=$permalink?>'/>
+        <meta property='og:description' content='<?=$text?>'/>
+<?php
+        if (strlen($image) == 0){
+?>
+            <meta property="og:image" content="<?=$lserver?>/img/logo/x3/favicon.ico"/>
+<?php
+        }
+        else{
+?>
+            <meta property="og:image" content="<?=$lserver?>/img/blog/x3/<?=$image?>"/>
+<?php
+        }
+?>
+        <meta property='og:site_name' content='<?=text($con, "USER_NAME", $lang);?>'/>
         <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='<?=$lserver?>'/>
+        <meta name='twitter:title' content='<?=$title?> - <?=text($con, "USER_NAME", $lang);?>'/>
+        <meta name='twitter:description' content='<?=$text?>'/>
+<?php
+        if (strlen($image) == 0){
+?>
+            <meta property="twitter:image" content="<?=$lserver?>/img/logo/x3/favicon.ico"/>
+<?php
+        }
+        else{
+?>
+            <meta property="twitter:image" content="<?=$lserver?>/img/blog/x3/<?=$image?>"/>
+<?php
+        }
+?>        <meta name='twitter:url' content='<?=$lserver?>/blog/<?=$permalink?>'/>
         <meta name='robots' content='index follow'/>
     </head>
     <body>
@@ -63,7 +105,274 @@
         include $doc_root . "header.php";
 ?>
         <div id='content'>
-
+            <div id='content_row'>
+                <div id='content_cell_post' class='content_cell'>
+                    <div class='section' id='post'>
+                        <h3 class='section_title'><?=$title?></h3>
+                        <div class='entry'>
+<?php
+                            if (strlen($image) > 0){
+?>
+                                <img id='post_main_image' src='<?=$lserver?>/img/blog/x6/<?=$image?>' alt='<?=$title?>' title='<?=$title?>' />
+<?php
+                            }
+?>
+                            <?=$text?>
+<?php
+                            $q_image = mysqli_query($con, "SELECT image FROM post_image WHERE post = $id ORDER BY idx OFFSET 1");
+                            if (mysqli_num_rows($q_image) > 0){
+?>
+                                <div id='image_reel'>
+<?php
+                                    while ($r_image = mysqli_fetch_array($q_image)){
+?>
+                                        <img src='<?=$lserver?>/img/blog/x6/<?=$r_image["image"]?>' alt='<?=$title?>' title='<?=$title?>' />
+<?php
+                                    }
+?>
+                                </div> <!-- #image_reel -->
+<?php
+                            }
+?>
+                            <hr/>
+<?php
+                            #Comments
+                            if ($r_post["comments"] == 1){
+                                $q_comment = mysqli_query($con, "SELECT id, post, DATE_FORMAT(dtime, '%Y-%m-%dT%T') AS cdate, DATE_FORMAT(dtime,'%b %d, %Y - %H:%i') AS dtime, user, username, text FROM post_comment WHERE post = $id;");
+                                $count = mysqli_num_rows($q_comment);
+                                if ($count == 1){
+?>
+                                    <span class='comment_counter'>1 <?=text($con, "BLOG_COMMENTS_1", $lang)?></span>
+<?php
+                                }
+                                else if ($count == 0){
+?>
+                                    <span class='comment_counter'><?=text($con, "BLOG_COMMENTS_0", $lang)?></span>
+<?php
+                                }
+                                else{
+?>
+                                    <span class='comment_counter'><?=$count?> <?=text($con, "BLOG_COMMENTS_X", $lang)?></span>
+<?php
+                                }
+                                while ($r_comment = mysqli_fetch_array($q_comment)){
+                                    $user = $r_comment["username"];
+                                    $user_string = $user;
+                                    if (strlen($user) == 0){
+                                        $user = mysqli_fetch_array(mysqli_query($con, "SELECT concat(fname, concat(' ', lname)) AS name FROM user WHERE id = $r_comment[user];"))["name"];
+                                        $user_string = "<span class='comment_user_registered'>$user</span>";
+                                    }
+?>
+                                    <div itemprop='comment' itemscope itemtype='http://schema.org/UserComments' id='comment_<?=$r_comment["id"]?>' class='comment'>
+                                        <h4  class='comment_user'><?=$user_string?></h4>
+                                        <meta itemprop='creator' content='<?=$user?>'>
+                                        <span class='comment_date date'>
+                                            <time itemprop='commentTime' datetime='<?=$r_comment["cdate"]?>'>
+                                            <?=$r_comment["dtime"]?>
+                                        </span>
+                                        <p itemprop='commentText' class='comment_text'><?=$r_comment["text"]?></p>
+                                    </div>
+<?php
+                                }
+                                //Comment form
+?>
+                                <div class='comment' id='comment_new'>
+                                    <textarea id='new_comment_text' name='text' maxlength='1800' onfocus='showCommentIdentification();' placeholder='<?=text($con, "BLOG_COMMENTS_YOUR", $lang)?>'></textarea>
+                                    <div id='identification_form'>
+                                        <br/>
+                                        <input id='new_comment_user' name='user' maxlength='50' type='text' placeholder='<?text($con, "COMMENT_YOUR_NAME", $lang)?>'/>
+                                        <input type='button' value='<?text($con, "COMMENT_PUBLISH", $lang)?>'/>
+                                    </div>
+                                </div>
+<?php
+                            }
+                            else{
+?>
+                                <h4><?text($con, "COMMENT_CLOSED_POST", $lang)?></h4>
+<?php
+                            }
+?>
+                        </div> <!-- .entry -->
+                    </div> <!-- .section -->
+                </div> <!-- .content_cell -->
+                <div id='content_cell_info' class='content_cell'>
+                    <div class='section' id='info'>
+                        <h3 class='section_title'><?=text($con, "BLOG_DETAILS", $lang)?></h3>
+                        <div id="info_date" class='entry'>
+                            <span class='date'><?=format_date($r_post["dtime"], $lang)?></span>
+                        </div>
+                        <hr/>
+                        <div id="info_share" class='entry'>
+                            <h4><?=text($con, "BLOG_SHARE", $lang)?></h4>
+                            <div id='social'>
+<?php
+                                $q_share = mysqli_query($con, "SELECT id FROM share WHERE visible = 1 ORDER BY idx;");
+                                while ($r_share = mysqli_fetch_array($q_share)){
+?>
+                                    <?=share_link($con, $r_share["id"], $lserver, "$server/blog/$permalink", $lang)?>
+<?php
+                                }
+?>
+                            </div> <!-- #social -->
+                        </div> <!-- #info_share -->
+                        <hr/>
+<?php
+                        $q_tag = mysqli_query($con, "SELECT tag FROM post_tag WHERE post = $id;");
+                        if (mysqli_num_rows($q_tag) > 0){
+?>
+                            <div id="info_tags" class='entry'>
+<?php
+                                $tag_string = "<span id='tags'>" . text($con, "BLOG_TAGS", $lang) . ": ";
+                                $tag_raw = "";
+                                while ($r_tag = mysqli_fetch_array($q_tag)){
+                                    $tag_string = $tag_string . "<a href='$lserver/blog/search/tag/$r_tag[tag]'>$r_tag[tag]</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);
+?>
+                                <span class='tags'><?=$tag_string?></span>
+                                <meta itemprop='keywords' content='<?=$tag_raw?>'/>
+                            </div> <!-- #info_tags -->
+                            <hr/>
+<?php
+                        } // if (mysqli_num_rows($q_tag) > 0)
+?>
+<?php
+                        // Previous / next
+                        $q_prev = mysqli_query($con, "SELECT id, permalink, title FROM post WHERE id <> $id AND dtime <= '$r_post[dtime]' ORDER BY dtime DESC LIMIT 1;");
+                        $q_next = mysqli_query($con, "SELECT id, permalink, title FROM post WHERE id <> $id AND dtime >= '$r_post[dtime]' ORDER BY dtime LIMIT 1;");
+                        if (mysqli_num_rows($q_prev) > 0 || mysqli_num_rows($q_next) > 0){
+?>
+                            <div id='info_prev_next' class='entry'>
+                                <table id='prev_next'>
+                                    <tr>
+                                        <td id='prev'>
+<?php
+                                            if (mysqli_num_rows($q_prev) > 0){
+                                                $r_prev = mysqli_fetch_array($q_prev);
+?>
+                                                <a href='<?=$lserver?>/blog/<?=$r_prev["permalink"]?>'>
+                                                    <span class='info'>Previous post:</span>
+                                                    <br/>
+                                                    <span class='title'><?=text($con, $r_prev["title"], $lang)?></span>
+                                                </a>
+<?php
+                                            }
+?>
+                                        </td>
+                                        <td id='next'>
+<?php
+                                            if (mysqli_num_rows($q_next) > 0){
+                                                $r_next = mysqli_fetch_array($q_next);
+?>
+                                                <a href='<?=$lserver?>/blog/<?=$r_next["permalink"]?>'>
+                                                    <span class='info'>Next post:</span>
+                                                    <br/>
+                                                    <span class='title'><?=text($con, $r_next["title"], $lang)?></span>
+                                                </a>
+<?php
+                                            }
+?>
+                                        </td>
+                                    </tr>
+                                </table>
+                            </div> <!-- #info_prev_next -->
+                            <hr/>
+<?php
+                        } //  if (mysqli_num_rows($q_prev) > 0 || mysqli_num_rows($q_next) > 0)
+?>
+                        <div id='info_related' class='entry'>
+                            <h4><?=text($con, "BLOG_RELATED", $lang)?></h4>
+                            <ul>
+<?php
+                                // TODO: Truly select related
+                                $q_related = mysqli_query($con, "SELECT permalink, title FROM post WHERE id <> $id ORDER BY rand() LIMIT 3;");
+                                while($r_related = mysqli_fetch_array($q_related)){
+?>
+                                    <li>
+                                        <a href='<?=$lserver?>/blog/<?=$r_related["permalink"]?>'><?=text($con, $r_related["title"], $lang)?></a>
+                                    </li>
+<?php
+                                }
+?>
+                            </ul>
+                        </div>
+                        <hr/>
+                        <div id='info_search' 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> <!-- #info_search -->
+                        <hr/>
+                        <div id='info_tag_cloud' class='entry'>
+                            <h4><?=text($con, "BLOG_TAG_CLOUD", $lang)?></h4>
+                            <div id='cloud'>
+<?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='<?=$lserver?>/blog/search/tag/<?=$r_tag["tag"]?>'>
+                                        <span style='font-size: <?=$size?>%'><?=text($con, $r_tag["tag"], $lang)?></span>
+                                    </a>
+<?php
+                                }
+?>
+                            </div>
+                        </div> <!-- #info_tag_cloud -->
+                        <hr/>
+                        <div id='info_all' class='entry'>
+                            <h4><?=text($con, "BLOG_ARCHIVE", $lang)?></h4>
+<?php
+                            $q_year = mysqli_query($con, "SELECT year(dtime) AS year FROM post WHERE visible = 1 GROUP BY year(dtime) ORDER BY year DESC;");
+                            while($r_year = mysqli_fetch_array($q_year)){
+?>
+                                <div class='year pointer' onClick='toggleElement("year_<?=$r_year["year"]?>");'>
+                                    <img class='slider' id='slid_year_<?=$r_year["year"]?>' src='<?=$server?>/img/misc/slid-right.png' alt='<?=$r_year["year"]?>'/>
+                                    <span class='fake_a'><?=$r_year["year"]?></span>
+                                </div>
+                                <div class='list_year pointer' id='list_year_<?=$r_year["year"]?>'>
+<?php
+                                    $q_month = mysqli_query($con, "SELECT month(dtime) AS month FROM post WHERE visible = 1 AND year(dtime) = $r_year[year] GROUP BY month(dtime) ORDER BY month DESC;");
+                                    while($r_month = mysqli_fetch_array($q_month)){
+?>
+                                        <div class='month pointer' onClick='toggleElement("month_<?=$r_year["year"]?>_<?=$r_month["month"]?>");'>
+                                            <img class='slider' id='slid_month_<?=$r_year["year"]?>_<?=$r_month["month"]?>' src='<?=$server?>/img/misc/slid-right.png' alt='<?=$r_month["month"]?>'/>
+                                            <span class='fake_a'><?=ucfirst(text($con, "MONTH_" . str_pad($r_month["month"], 2, "0", STR_PAD_LEFT), $lang))?></span>
+                                        </div>
+                                        <ul id='list_month_<?=$r_year["year"]?>_<?=$r_month["month"]?>' class='post_list'>
+<?php
+                                            $q_title = mysqli_query($con, "SELECT id, permalink, title FROM post WHERE visible = 1 AND year(dtime) = $r_year[year] AND month(dtime) = '$r_month[month]' ORDER BY dtime DESC;");
+                                            while($r_title = mysqli_fetch_array($q_title)){
+?>
+                                                <li>
+                                                    <a href='<?=$lserver?>/blog/<?=$r_title["permalink"]?>'><?=text($con, $r_title["title"], $lang)?></a>
+                                                </li>
+<?php
+                                            }
+?>
+                                        </ul>
+<?php
+                                    }
+?>
+                                </div> <!-- #list_year_<?=$r_year["year"]?> -->
+<?php
+                            } //while($r_year = mysqli_fetch_array($q_year))
+?>
+                        </div> <!-- #info_all -->
+                    </div> <!-- #info -->
+                </div> <!-- .content-cell -->
+            </div> <!-- #content-row -->
         </div> <!-- #content -->
 <?php
         include $doc_root . "footer.php";

+ 219 - 34
www/css/blog.css

@@ -1,62 +1,247 @@
-/* Common elements */
-span.version_type{
-    padding: 0.05em;
-    border 0.1em solid #444444;
-    border-radius: 0.2em;
+/****************************************
+ * Pages layout.                        *
+ ****************************************/
+div#content{
+    display: table;
 }
 
+div#content div#content_row{
+    display: table-row;
+}
 
-/* Projects main page */
+div#content div#content_row div.content_cell{
+    padding: 1em;
+    display: table-cell;
+    vertical-align: top;
+}
 
+div#content div#content_row div#content_cell_main{
+    width: 75%;
+}
 
-/* Project view page */
+div#content div#content_row div#content_cell_info{
+    /* Post info container. */
+    width: 25%;
+    min-width: 8em;
+    max-width: 20em;
+}
 
-div#content{
-    display: table;
+
+/****************************************
+ * Right panel.                         *
+ ****************************************/
+div#info hr{
+    margin: 0 5% 0 5%;
+    opacity: 0.3;
 }
 
-div#content-row{
-    display: table-row;
+div#info h4{
+    margin-top: 0.2em;
+    margin-bottom: 0.2em;
 }
 
-div.content_cell{
-    display: table-cell;
-    padding: 1em;
-    vertical-align: top;
+div#info div.entry{
+    margin: 0.2em;
 }
 
-div#content_cell_main{
-    width: 80%;
+div#info div#info_date{
+    /* Date of the post. */
+    text-align: center;
+    font-style: italic;
+    font-size: 70%;
+    opacity: 80%;
 }
 
-div#content_cell_right{
-    width: 20%;
+div#info div#info_share{
+    /* Share icons. */
 }
 
-div#main_column div.iframe_container{
-    width: 100%;
+div#info div#info_share div#social{
     text-align: center;
 }
 
-div#main_column iframe.project_embed{
-    background-color: #ffffff;
-    border-radius: 0.8em;
-    border: 0.1em solid #110022;
+div#info div#info_tags{
+    /* Post tages. */
+    font-size: 80%;
+    opacity: 90%;
+}
+
+div#info div#info_prev_next{
+    /* Previous / next post. */
+}
+
+div#info div#info_prev_next table#prev_next{
+    /* Previous/next posts links. */
+    border-collapse: collapse;
+    margin: 0 auto 0 auto;
+}
+
+div#info div#info_prev_next table#prev_next td{
+    width: 50%;
+    padding: 0.5em;
+}
+
+div#info div#info_prev_next table#prev_next td#prev{
+    border-right: 0.03em solid #00440088;
+    margin-right: 0.5em;
+    text-align: right;
+}
+
+div#info div#info_prev_next table#prev_next td#next{
+    border-left: 0.03em solid #00440088;
+    margin-left: 0.5em;
+    text-align: left;
+}
+
+div#info div#info_prev_next table#prev_next td span.info{
+    font-size: 80%;
+}
+
+div#info div#info_prev_next table#prev_next td span.title{
+    font-weight: bold;
+}
+
+div#info div#info_related{
+    /* Related posts. */
+}
+
+div#info div#info_related ul{
+    margin: 0 0 0 0.6em;
+    padding-left: 0.7em;
+}
+
+div#info div#info_related ul li{
+    margin: 0;
+}
+
+div#info div#info_search{
+    /* Post search form. */
+}
+
+div#info div#info_search input#search_panel_input{
+    display: inline-block;
+    width: 60%;
+}
+
+div#info div#info_search input#search_panel_submit{
+    display: inline-block;
+    width: 30%;
+}
+
+div#info div#info_tag_cloud{
+    /* Tag cloud. */
+}
+
+div#info div#info_tag_cloud div#cloud{
+    text-align: center;
+}
+
+div#info div#info_all{
+    /* Post archive. */
+    margin-right: 0;
+    padding-right: 0;
+}
+
+div#info_all div.list_year{
+    /* Year list in the archive.*/
+    margin-left: 1em;
+    max-height: 0em;
+    overflow-y: hidden;
+    transition: max-height 0.6s ease-in-out;
+}
+
+div#info_all ul.post_list{
+    margin-top: 0em;
+    margin-bottom: 0em;
+    max-height: 0em;
+    overflow-y: hidden;
+    transition: max-height 0.6s ease-in-out;
+}
+
+div#info_all ul.post_list li{
+    padding: 0.2em 0 0 0;
+}
+
+div#info_all div.post_list_image_container{
+    text-align: center;
+}
+
+div#info_all img.post_list_image{
+    float: center;
+    max-width: 15em;
     max-width: 90%;
-    max-height: 70em;
+    max-height: 9em;
+    margin: 0.5em 1em 0 0.5em;
+    border: 0.15em solid #333333;
+    border-radius: 0.2em;
+    box-shadow: 0 0 0.5em #111111;
 }
 
-div#right_column{
-    transition: all .3s ease-in-out;
+
+/****************************************
+ * Blog main page.                      *
+ ****************************************/
+div#post_list img.post_list_image{
+    float: left;
+    background-color: #ffffff;
+    border: 0.1em solid #003300;
+    border-radius: 0.3em;
+    margin: 0 0.7em 0.7em 0.7em;
+    max-width: 5em;
+    max-height: 3em;
 }
 
-div#right_column div.url{
-    vertical-align: middle;
+div#post_list table.post_list_footer{
+    font-size: 80%;
+    width: 100%;
 }
 
-div#right_column div.url img{
-    width: 2em;
-    height: 2em;
-    vertical-align: middle;
+div#post_list table.post_list_footer td.comment_counter{
+    font-style: italic;
+    text-align: right;
 }
 
+div#post_list span.tags{
+    font-size: 80%;
+    font-style: italic;
+}
+
+
+/****************************************
+ * Post view page.                      *
+ ****************************************/
+div#content_cell_post{
+    /* Post and comments container. */
+    width: 75%;
+}
+
+div#post img#post_main_image{
+    /* Post main image. */
+    display: block;
+    max-height: 11em;
+    margin: 0.5em auto 1em auto;
+    border: 0.1em solid #003400;
+    border-radius: 0.5em;
+    background-color: #ffffff;
+}
+
+div#post div#image_reel{
+    /* Post secondary images container. */
+    overflow-x: scroll;
+    border: 0.1em solid #003400;
+    border-radius: 0.3em;
+    height: 7em;
+    background-color: #334433;
+    padding: 0.5em;
+}
+
+div#post div#image_reel img{
+    /* Secondary images of the post. */
+    vertical-align: middle;
+    max-height: 5em;
+    max-width: 7em;
+    border: 0.2em solid #003400;
+    border-radius: 0.1em;
+    margin: 0.5em;
+    background-color: #ffffff;
+}

+ 43 - 0
www/css/error.css

@@ -0,0 +1,43 @@
+div.section{
+    width: 60%;
+    min-width: 20em;
+    max-width: 80em;
+    margin: auto;
+}
+
+table#error_header{
+    width: 80%;
+    margin: 2em auto 2em auto;
+}
+
+table#error_header td{
+    width: 50%;
+}
+
+table#error_code{
+    display: inline-block;
+    margin-left: 10%;
+    border: 0.1em solid #000011;
+    border-radius: 1em;
+    padding: 0.5em 0 0.5em 0;
+    background-color: #1e9957;
+    filter: drop-shadow(0 0 0.4em #002200);
+    color: #ffffff;
+}
+
+td#error_number{
+    font-size: 300%;
+    border-right: 0.063em solid #000000;
+    padding-right: 0.5em;
+    padding-left: 0.2em;
+}
+td#error_tag{
+    font-size: 110%;
+    padding-left: 1.2em;
+    padding-right: 1em;
+}
+div#error_message{
+    width: 80%;
+    margin: 0 10% 1em 10%;
+    margin-bottom: 4em;
+}

+ 56 - 0
www/css/home.css

@@ -28,3 +28,59 @@ div#content div#content_row div#content_cell_profile{
 div#content div#content_row div#content_cell_content{
     width: 70%;
 }
+
+/* Profile section */
+div#content_cell_profile img{
+    position: relative;
+    max-width: 8em;
+    max-height: 8em;
+    border-radius: 1.2em;
+    margin: 0.5em;
+    border: 0.1em solid #000000;
+    vertical-align: top;
+    z-index: 2;
+}
+
+div#content_cell_profile span#tagline{
+    display: inline-block;
+    padding-top: 0.5em;
+    margin-left: -1em;
+    padding-left: 1em;
+    padding-right: 0.5em;
+    border-bottom: 0.1em solid #000000;
+    border-bottom-right-radius: 0.3em;
+    z-index: 1;
+}
+
+/* Projects section */
+div#projects_section img.project_list_image{
+    float: left;
+    background-color: #ffffff;
+    border: 0.1em solid #003300;
+    border-radius: 0.3em;
+    margin: 0 0.5em 0.5em 0.5em;
+    max-width: 5em;
+    max-height: 3em;
+}
+
+
+/* Blog section */
+div#blog_section img.post_list_image{
+    float: left;
+    background-color: #ffffff;
+    border: 0.1em solid #003300;
+    border-radius: 0.3em;
+    margin: 0 0.5em 0.5em 0.5em;
+    max-width: 5em;
+    max-height: 3em;
+}
+
+div#blog_section table.post_list_footer{
+    font-size: 80%;
+    width: 100%;
+}
+
+div#blog_section table.post_list_footer td.comment_counter{
+    font-style: italic;
+    text-align: right;
+}

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


+ 22 - 0
www/css/m/home.css

@@ -0,0 +1,22 @@
+div#content {
+    display: initial;
+}
+
+div#content div#content_row{
+    display: initial;
+    margin: 0;
+    padding: 0;
+}
+
+div#content div#content_row div.content_cell{
+    display: initial;
+    margin: 0;
+}
+
+div#content div#content_row div#content_cell_profile{
+    width: initial;
+}
+
+div#content div#content_row div#content_cell_content{
+    width: initial;
+}

+ 22 - 0
www/css/m/project.css

@@ -0,0 +1,22 @@
+div#content {
+    display: initial;
+}
+
+div#content div#content_row{
+    display: initial;
+    margin: 0;
+    padding: 0;
+}
+
+div#content div#content_row div.content_cell{
+    display: initial;
+    margin: 0;
+}
+
+div#content div#content_row div#content_cell_main{
+    width: initial;
+}
+
+div#content div#content_row div#content_cell_right{
+    width: initial;
+}

+ 64 - 0
www/css/m/ui.css

@@ -0,0 +1,64 @@
+.desktop{
+    display: none;
+}
+
+.mobile{
+    display: initial !important;
+}
+
+nav#header span.header_container {
+    min-width: 2em;
+    margin-right: 0.2em;
+    margin-left: 0.2em;
+    padding-left: 0.2em;
+    padding-top: 0.3em;
+    padding-bottom: 0.3em;
+    padding-right: 0.2em;
+}
+
+nav#header span.header_container:hover {
+    border: 0.06em solid #ffffff00;
+    background-color: #ffffff00;
+}
+
+nav#header img.header_icon{
+    opacity: 1;
+    width: 1.2em;
+    height: 1.2em;
+}
+
+hr#header_separator{
+    width: 90%;
+    margin-top: 1em;
+    margin-bottom: 1em;
+}
+
+div#footer table#footer_table{
+    width: 95%;
+}
+
+div#footer img.footer_social_icon{
+    width: 2em;
+    margin: 0.2em;
+}
+
+div#footer a.lang img{
+    height: 1.5em;
+    margin: 0.2em;
+    border-radius: 0.1em;
+    border: 0.1em solid #555555;
+    box-shadow: 0 0 0 #dde;
+}
+
+div#footer a.lang img:hover{
+    box-shadow: 0 0 0 #111;
+}
+
+div.section{
+    margin: 1em;
+}
+
+div.section div.entry_list{
+    background-color: #efffef;
+    border: 0.1em solid #aaffaaff;
+}

+ 207 - 17
www/css/project.css

@@ -1,41 +1,228 @@
+/****************************************
+ * Pages layout.                        *
+ ****************************************/
+div#content{
+    display: table;
+}
+
+div#content div#content_row{
+    display: table-row;
+}
+
+div#content div#content_row div.content_cell{
+    display: table-cell;
+    padding: 1em;
+    vertical-align: top;
+}
+
+div#content_cell_main{
+    width: 75%;
+}
+
+div#content div#content_row div#content_cell_info{
+    /* Project info container. */
+    width: 25%;
+    min-width: 8em;
+    max-width: 20em;
+}
+
+
+/****************************************
+ * Right panel.                         *
+ ****************************************/
+div#info hr{
+    margin: 0 5% 0 5%;
+    opacity: 0.3;
+}
+
+div#info h4{
+    margin-top: 0.2em;
+    margin-bottom: 0.2em;
+}
+
+div#info div.entry{
+    margin: 0.2em;
+}
+
+div#info div#info_date{
+    /* Date of the post. */
+    text-align: center;
+    font-style: italic;
+    font-size: 70%;
+    opacity: 80%;
+}
+
+div#info div#info_share{
+    /* Share icons. */
+}
+
+div#info div#info_share div#social{
+    text-align: center;
+}
+
+div#info div#info_tags{
+    /* Post tages. */
+    font-size: 80%;
+    opacity: 90%;
+}
+
+div#info div#info_prev_next{
+    /* Previous / next post. */
+}
+
+div#info div#info_prev_next table#prev_next{
+    /* Previous/next posts links. */
+    border-collapse: collapse;
+    margin: 0 auto 0 auto;
+}
+
+div#info div#info_prev_next table#prev_next td{
+    width: 50%;
+    padding: 0.5em;
+}
+
+div#info div#info_prev_next table#prev_next td#prev{
+    border-right: 0.03em solid #00440088;
+    margin-right: 0.5em;
+    text-align: right;
+}
+
+div#info div#info_prev_next table#prev_next td#next{
+    border-left: 0.03em solid #00440088;
+    margin-left: 0.5em;
+    text-align: left;
+}
+
+div#info div#info_prev_next table#prev_next td span.info{
+    font-size: 80%;
+}
+
+div#info div#info_prev_next table#prev_next td span.title{
+    font-weight: bold;
+}
+
+div#info div#info_related{
+    /* Related posts. */
+}
+
+div#info div#info_related ul{
+    margin: 0 0 0 0.6em;
+    padding-left: 0.7em;
+}
+
+div#info div#info_related ul li{
+    margin: 0;
+}
+
+div#info div#info_search{
+    /* Post search form. */
+}
+
+div#info div#info_search input#search_panel_input{
+    display: inline-block;
+    width: 60%;
+}
+
+div#info div#info_search input#search_panel_submit{
+    display: inline-block;
+    width: 30%;
+}
+
+div#info div#info_tag_cloud{
+    /* Tag cloud. */
+}
+
+div#info div#info_tag_cloud div#cloud{
+    text-align: center;
+}
+
+div#info div#info_all{
+    /* Post archive. */
+    margin-right: 0;
+    padding-right: 0;
+}
+
+div#info_all div.list_year{
+    /* Year list in the archive.*/
+    margin-left: 1em;
+    max-height: 0em;
+    overflow-y: hidden;
+    transition: max-height 0.6s ease-in-out;
+}
+
+div#info_all ul.post_list{
+    margin-top: 0em;
+    margin-bottom: 0em;
+    max-height: 0em;
+    overflow-y: hidden;
+    transition: max-height 0.6s ease-in-out;
+}
+
+div#info_all ul.post_list li{
+    padding: 0.2em 0 0 0;
+}
+
+div#info_all div.post_list_image_container{
+    text-align: center;
+}
+
+div#info_all img.post_list_image{
+    float: center;
+    max-width: 15em;
+    max-width: 90%;
+    max-height: 9em;
+    margin: 0.5em 1em 0 0.5em;
+    border: 0.15em solid #333333;
+    border-radius: 0.2em;
+    box-shadow: 0 0 0.5em #111111;
+}
+
+
 /* Common elements */
 span.version_type{
     padding: 0.05em;
     border 0.1em solid #444444;
     border-radius: 0.2em;
+    font-size: 85%;
+    font-family: monospace; 
+    font-weight: bold;
 }
 
 
 /* Projects main page */
 div#right_column div#advanced_search{
+    margin: 0.6em 0.1em 0.5em 0.1em;
     transition: all .3s ease-in-out;
     overflow: hidden;
     height: 0;
 }
 
-
 /* 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#main_column div#image_reel{
+    text-align: center;
+    width: 80%;
+    margin: 1em auto 1em auto;
+    border: 0.3em solid #000000;
+    border-radius: 0.3em;
+    padding: 0.5em;
+    background-color: #556655;
+    overflow-x: auto;
 }
 
-div#content_cell_main{
-    width: 80%;
+div#main_column div#image_reel table{
+    margin: 0 auto 0 auto;
 }
 
-div#content_cell_right{
-    width: 20%;
+div#main_column div#image_reel img{
+    display: inline-block;
+    border: 0.1em solid #000000;
+    border-radius: 0.1em;
+    background-color: #000000;
+    vertical-align: middle;
+    max-height: 6em;
+    max-width: 6em;
 }
 
 div#main_column div.iframe_container{
@@ -57,6 +244,8 @@ div#right_column{
 
 div#right_column div.url{
     vertical-align: middle;
+    font-size: 70%;
+    margin-bottom: 0.3em;
 }
 
 div#right_column div.url img{
@@ -66,7 +255,8 @@ div#right_column div.url img{
 }
 
 div#right_column img#img_license{
-    max-height: 1.3em;
+    max-height: 2.3em;
+    text-align: center;
 }
 
 div#license{

+ 59 - 98
www/css/ui.css

@@ -8,6 +8,20 @@
     src:  url('/fonts/Nunito-Regular.ttf'); 
 }
 
+/**********************************
+ * Elements that are solely for   *
+ * the desktop or mobile          *
+ * version.                       *
+ **********************************/
+
+.desktop{
+    display: initial;
+}
+
+.mobile{
+    display: none;
+}
+
 /**********************************
  * Styles to be applied across    *
  * all the site for all the       *
@@ -26,6 +40,13 @@ a{
     text-decoration: none;
 }
 
+.fake_a{
+    color: #555555;
+    text-shadow: 0 0 0.5em #7777ff;
+    text-decoration: none;
+}
+
+
 /* Elements fith bold font */
 .bold{
     font-weight: bold;
@@ -109,14 +130,14 @@ nav#header span.header_container {
     display: inline-block;
     position: relative;
     transition: all .3s ease-in-out;
-    box-shadow: 0 0 0.063em rgba(0, 0, 0, 0);
-    border: rgba(0,0,0,0) solid 0.063em;
+    box-shadow: 0 0 0.063em #ffffff00;
+    border: 0.06em solid #ffffff00;
     border-radius: 0.5em;
 }
 
 nav#header span.header_container:hover {
-    border: rgba(255, 255, 255, 0.5) solid 0.063em;
-    background-color: rgba(255, 255, 255, 0.2);
+    border: 0.06em solid #ffffff88;
+    background-color: #ffffff33;
 }
 
 /* Contains the icon for each entry */
@@ -127,14 +148,14 @@ nav#header span.header_icon_container{
 
 /* Icon for each entry of the header */
 nav#header img.header_icon{
-    opacity: 0.1;
+    opacity: 0.3;
     width: 1.563em;
     height: 1.563em;
     vertical-align: middle;
     transition: opacity 0.4s ease-in-out;
 }
 nav#header span.header_container:hover img.header_icon{
-    opacity: 0.9;
+    opacity: 1;
 }
 
 
@@ -182,7 +203,7 @@ div#footer hr#footer_separator{
 /* Left area of the footer */
 div#footer td#footer_left{
     width: 33%;
-    text-align: left;
+    text-align: center;
 }
 
 /* Middle area of the footer */
@@ -201,6 +222,9 @@ div#footer td#footer_right{
 div#footer img.footer_social_icon{
     width: 1.875em;
     vertical-align: middle;
+    background-color: #ffffff;
+    border: 0.1em solid #ffffff;
+    border-radius: 0.3em;
 }
 
 div#footer a.lang img{
@@ -313,8 +337,8 @@ div.unavailable{
 
 /* Icons for sharing page in a social network */
 img.social_icon{
-    width: 4.286em;
-    height: 4.286em;
+    width: 3em;
+    height: 3em;
 }
 
 /* Elements that should have the cursor as pointer */
@@ -458,20 +482,25 @@ div#identification_form{
 
 /* Contain a comment, with the details and the text */
 div.comment{
-    background-color: #cccccc;
-    border: 0.143em solid #777777;
-    border-radius: 0.314em;
+    background-color: #efffef;
+    border: 0.1em solid #aaffaa;
+    border-radius: 0.3em;
     padding: 0.5em;
-    margin: 0.714em 0.625em 0.714em 0.625em;
-    box-shadow: 0 0 0.750em #444444;
+    margin: 0.5em;
 }
 
 /* User who posted the coment */
-h4.comment_user{
+div.comment h4.comment_user{
     margin-top: 0.417em;
     margin-bottom: 0;
 }
 
+div.comment h4.comment_user span.comment_user_registered{
+    font-weight: bold;
+    font-size: 110%;
+    color: #005500;
+}
+
 /* Style for the comment's images */
 img.comment_image{
     border: 0.077em solid black;
@@ -540,92 +569,24 @@ img#new_comment_image_preview{
 }
 
 
-
 /**********************************
- * Styles for the pager, present  *
- * in blog, tutorials, etc        *
+ * Styles for the social buttons. *
  **********************************/
 
-/* A table containing the pager */
-table#pager{
-    margin-left: auto;
-    margin-right: auto;
-    border-spacing: 0.625em
-}
-
-/* Each cell in the pager */
-table#pager td{
-    font-weight: bold;
-    color: #cccccc;
-    background-color: #bbbbbb;
-    border: 0.077em solid #666666;
-    border-radius: 0.231em;
-    padding: 0.5em 0.625em 0.5em 0.625em;
-    text-shadow: 0 0 0.75em #000000;
-}
-
-/* The current page */
-table#pager td.pager_current{
-    background-color: #666666;
-    border: 0.077em solid #444444;
-}
-
-/* Dummy td that contains "..." */
-table#pager td.pager_ellipse{
-    background-color: initial;
-    border: initial;
-}
-
-
-
-/**********************************
- * Styles for social sharing icon *
- **********************************/
-
-/* Icons for social media */
-img.share_icon{
-    width: 1.875em;
-    vertical-align: middle;
-}
-
-
-
-/**********************************
- * Styles for downloads           *
- **********************************/
-
-/* Dummy span for download count */
-span#span_download{
-    display: none;
-}
-
-/* Hidden div to confirm downloading */
-div.license{
-    box-shadow: 0 0 1.2em rgba(120, 120, 120, 1);
-    display: none;
-    position: fixed;
-    top: 30%;
-    left: 25%;
-    width: 40%;
-    opacity: 0;
-    z-index: 1001;
-    padding: 0.625em;
-    background-color: #333333;
-    border: 0.150em solid #111111;
-    border-radius: 1.250em;
+a.share img.share{
+    display: inline-block;
+    vertical-align: top;
+    overflow: hidden;
+    width: 1.6em;
+    height: 1.6em;
+    border: 0.1em solid #003300;
+    border-radius: 2em;
+    box-shadow: 0 0 0.3em #005500;
+    margin: 0.2em;
+    transition: all .3s ease-in-out;
 }
 
-/* div to dimm the screen */
-#screen_cover{
-    position: fixed;
-    top: 0;
-    left: 0;
-    background-color: black;
-    display: none;
-    width: 100%;
-    height: 100%;
-    opacity: 0;
-    transition: all .9s ease-in-out;
-    z-index: 1000;
+a.share img.share:hover{
+    box-shadow: 0 0 0.7em #005500;
+    border-radius: 0.7em;
 }
-

+ 91 - 0
www/error.php

@@ -0,0 +1,91 @@
+<?php
+    session_start();
+    $http_host = $_SERVER["HTTP_HOST"];
+    $doc_root = $_SERVER["DOCUMENT_ROOT"] . "/";
+    include $doc_root . "functions.php";
+    $proto = get_protocol();
+    $con = start_db();
+    $server = $proto . $http_host;
+    $lang = select_language($con);
+    $lserver = $server . "/" . $lang;
+    $cur_section = "error";
+    $cur_entry = http_response_code();
+    $error = $cur_entry;
+    if (!in-array($error, array("400", "401", "403", "404", "500")){
+        $error = "XXX";
+    }
+?>
+<!DOCTYPE html>
+<html>
+    <head>
+        <meta content='text/html; charset=windows-1252' http-equiv='content-type'/>
+        <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1'>
+        <title><?=text($con, "ERROR_TITLE", $lang);?> - <?=text($con, "USER_NAME", $lang);?></title>
+        <link rel='shortcut icon' href='<?=$lserver?>/img/logo/favicon.ico'>
+                <!-- CSS files -->
+        <style>
+<?php
+            include $doc_root . "css/ui.css";
+            include $doc_root . "css/error.css";
+?>
+        </style>
+        <!-- CSS for mobile version -->
+        <style media="(max-width : 990px)">
+<?php
+            include $doc_root . "css/m/ui.css";
+            include $doc_root . "css/m/error.css";
+?>
+        </style>
+        <meta name="robots" content="noindex follow"/>
+    </head>
+    <body>
+<?php
+        include $doc_root . "header.php";
+?>
+        <div class='section' >
+            <h3 class='section_title'><?=text($con, "ERROR_ERROR", $lang)?></h3>
+            <table id='error_header'>
+                <tr>
+                    <td>
+                        <table id='error_code' class='entry'>
+                            <tr>
+                                <td id='error_number'>
+                                    404
+                                </td>
+                                <td id='error_tag'>
+                                    <?=text($con, "ERROR_ERROR", $lang);?>
+                                    <br/>
+                                    <?=text($con, "ERROR_CODE", $lang);?>
+                                </td>
+                            <tr>
+                        </table>
+                    </td>
+                    <td>
+                        <h2><?=text($con, "ERROR_" . $error . "_TITLE", $lang);?></h2>
+                    </td>
+                </tr>
+            </table>
+            <div id='error_message' class='entry'>
+                <?=text($con, "ERROR_" . $error . "_DESCRIPTION", $lang);?>
+                <br/><br/>
+                <?=text($con, "ERROR_" . $error . "_SOLUTION", $lang);?>
+                <ul>
+                    <li>
+                        <a href='javascript: location.reload();'><?=text($con, "ERROR_" . $error . "_SOLUTION_0", $lang);?></a>
+                    </li>
+                    <li>
+                        <a href='javascript: history.go(-1);'><?=text($con, "ERROR_" . $error . "_SOLUTION_1", $lang);?></a>
+                    </li>
+                    <li>
+                        <a href='<?=$lserver?>/'><?=text($con, "ERROR_" . $error . "_SOLUTION_2", $lang);?></a>
+                    </li>
+                </ul>
+            </div> <!-- #error_message -->
+        </div> <!-- .section -->
+<?php
+        include $doc_root . "footer.php";
+        stats($con, $cur_section, $cur_entry);
+        http_response_code($cur_entry);
+?>
+    </body>
+</html>

+ 0 - 101
www/error/403.php

@@ -1,101 +0,0 @@
-<?php
-    session_start();
-    $http_host = $_SERVER["HTTP_HOST"];
-    $doc_root = $_SERVER["DOCUMENT_ROOT"]; 
-    include $doc_root . "functions.php";
-    $proto = get_protocol();
-    $con = start_db();
-    $server = $proto . $http_host;
-    $lang = select_language();
-    $lserver = $server . "/" . $lang;
-    $cur_section = "error";
-    $cur_entry = "403";
-?>
-<!DOCTYPE html>
-<html>
-    <head>
-        <meta content='text/html; charset=windows-1252' http-equiv='content-type'/>
-        <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1'>
-        <title>Error - I&ntilde;igo Valentin</title>
-        <link rel='shortcut icon' href='<?=$lserver?>/img/logo/favicon.ico'>
-        <!-- CSS files -->
-        <link rel='stylesheet' type='text/css' href='/css/ui.css'/>
-        <style>
-            table#error-code{
-                margin-top:        5em;
-                margin-left:     10%;
-            }
-            td#error-number{
-                font-size:        300%;
-                border-right:    0.063em solid #000000;
-                padding-right:    1.875em;
-                padding-left:    1.250em;
-            }
-            td#error-tag{
-                font-size:        110%;
-                padding-left:    1.750em;
-                padding-right:    1.250em;
-            }
-            div#error-message{
-                width:            80%;
-                margin-left:    10%;
-            }
-            @media (max-width: 990px){
-                table#error-code{
-                    width:            90%;
-                    margin-left:    auto;
-                    margin-right:    auto;
-                    margin-top:        0;
-                    margin-bottom:    0;
-                }
-                div#error-message{
-                    width:            90%;
-                    margin-left:    auto;
-                    margin-right:    auto;
-                    margin-top:        0;
-                    margin-bottom:    0;
-                }
-            }
-        </style>
-        <meta name="robots" content="noindex follow"/>
-    </head>
-    <body>
-<?php
-        include $doc_root . "header.php";
-?>
-        <div class='section section_no_title' >
-            <table id='error-code' class='entry'>
-                <tr>
-                    <td id='error-number'>
-                        403
-                    </td>
-                    <td id='error-tag'>
-                        ERROR<br/>CODE
-                    </td>
-                <tr>
-            </table>
-            <br/><br/><br/><br/>
-            <div id='error-message' class='entry'>
-                <h2>Forbidden</h2>
-                This means you are trying to view something you are not allowed to, security wise.
-                <br/><br/>
-                Try a solution:
-                <ul>
-                    <li>
-                        <a href='javascript: location.reload();'>Try again.</a>
-                    </li>
-                    <li>
-                        <a href='javascript: history.go(-1);'>Go to the previous page.</a>
-                    </li>
-                    <li>
-                        <a href='<?=$lserver?>/'>Go to the main page</a>
-                    </li>
-                </ul>
-            </div> <!-- #error_message -->
-        </div> <!-- .section -->
-<?php
-        include $doc_root . "footer.php";
-        stats($con, $cur_section, $cur_entry);
-?>
-    </body>
-</html>

+ 0 - 101
www/error/404.php

@@ -1,101 +0,0 @@
-<?php
-    session_start();
-    $http_host = $_SERVER["HTTP_HOST"];
-    $doc_root = $_SERVER["DOCUMENT_ROOT"]; 
-    include $doc_root . "functions.php";
-    $proto = get_protocol();
-    $con = start_db();
-    $server = $proto . $http_host;
-    $lang = select_language();
-    $lserver = $server . "/" . $lang;
-    $cur_section = "error";
-    $cur_entry = "404";
-?>
-<!DOCTYPE html>
-<html>
-    <head>
-        <meta content='text/html; charset=windows-1252' http-equiv='content-type'/>
-        <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1'>
-        <title>Error - I&ntilde;igo Valentin</title>
-        <link rel='shortcut icon' href='<?=$lserver?>/img/logo/favicon.ico'>
-        <!-- CSS files -->
-        <link rel='stylesheet' type='text/css' href='/css/ui.css'/>
-        <style>
-            table#error-code{
-                margin-top:        5em;
-                margin-left:     10%;
-            }
-            td#error-number{
-                font-size:        300%;
-                border-right:    0.063em solid #000000;
-                padding-right:    1.875em;
-                padding-left:    1.250em;
-            }
-            td#error-tag{
-                font-size:        110%;
-                padding-left:    1.750em;
-                padding-right:    1.250em;
-            }
-            div#error-message{
-                width:            80%;
-                margin-left:    10%;
-            }
-            @media (max-width: 990px){
-                table#error-code{
-                    width:            90%;
-                    margin-left:    auto;
-                    margin-right:    auto;
-                    margin-top:        0;
-                    margin-bottom:    0;
-                }
-                div#error-message{
-                    width:            90%;
-                    margin-left:    auto;
-                    margin-right:    auto;
-                    margin-top:        0;
-                    margin-bottom:    0;
-                }
-            }
-        </style>
-        <meta name="robots" content="noindex follow"/>
-    </head>
-    <body>
-<?php
-        include $doc_root . "header.php";
-?>
-        <div class='section section_no_title' >
-            <table id='error-code' class='entry'>
-                <tr>
-                    <td id='error-number'>
-                        404
-                    </td>
-                    <td id='error-tag'>
-                        ERROR<br/>CODE
-                    </td>
-                <tr>
-            </table>
-            <br/><br/><br/><br/>
-            <div id='error-message' class='entry'>
-                <h2>Not Found</h2>
-                This means that, either you are looking for something that doesn't exist or that we missed something.
-                <br/><br/>
-                Try a solution:
-                <ul>
-                    <li>
-                        <a href='javascript: location.reload();'>Try again.</a>
-                    </li>
-                    <li>
-                        <a href='javascript: history.go(-1);'>Go to the previous page.</a>
-                    </li>
-                    <li>
-                        <a href='<?=$lserver?>/'>Go to the main page</a>
-                    </li>
-                </ul>
-            </div> <!-- #error_message -->
-        </div> <!-- .section -->
-<?php
-        include $doc_root . "footer.php";
-        stats($con, $cur_section, $cur_entry);
-?>
-    </body>
-</html>

+ 0 - 101
www/error/500.php

@@ -1,101 +0,0 @@
-<?php
-    session_start();
-    $http_host = $_SERVER["HTTP_HOST"];
-    $doc_root = $_SERVER["DOCUMENT_ROOT"];
-    include $doc_root . "functions.php";
-    $proto = get_protocol();
-    $con = start_db();
-    $server = $proto . $http_host;
-    $lang = select_language();
-    $lserver = $server . "/" . $lang;
-    $cur_section = "error";
-    $cur_entry = "500";
-?>
-<!DOCTYPE html>
-<html>
-    <head>
-        <meta content='text/html; charset=windows-1252' http-equiv='content-type'/>
-        <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1'>
-        <title>Error - I&ntilde;igo Valentin</title>
-        <link rel='shortcut icon' href='<?=$lserver?>/img/logo/favicon.ico'>
-        <!-- CSS files -->
-        <link rel='stylesheet' type='text/css' href='/css/ui.css'/>
-        <style>
-            table#error-code{
-                margin-top:        5em;
-                margin-left:     10%;
-            }
-            td#error-number{
-                font-size:        300%;
-                border-right:    0.063em solid #000000;
-                padding-right:    1.875em;
-                padding-left:    1.250em;
-            }
-            td#error-tag{
-                font-size:        110%;
-                padding-left:    1.750em;
-                padding-right:    1.250em;
-            }
-            div#error-message{
-                width:            80%;
-                margin-left:    10%;
-            }
-            @media (max-width: 990px){
-                table#error-code{
-                    width:            90%;
-                    margin-left:    auto;
-                    margin-right:    auto;
-                    margin-top:        0;
-                    margin-bottom:    0;
-                }
-                div#error-message{
-                    width:            90%;
-                    margin-left:    auto;
-                    margin-right:    auto;
-                    margin-top:        0;
-                    margin-bottom:    0;
-                }
-            }
-        </style>
-        <meta name="robots" content="noindex follow"/>
-    </head>
-    <body>
-<?php
-        include $doc_root . "header.php";
-?>
-        <div class='section section_no_title' >
-            <table id='error-code' class='entry'>
-                <tr>
-                    <td id='error-number'>
-                        500
-                    </td>
-                    <td id='error-tag'>
-                        ERROR<br/>CODE
-                    </td>
-                <tr>
-            </table>
-            <br/><br/><br/><br/>
-            <div id='error-message' class='entry'>
-               <h2>Internal Server Error</h2>
-                We messed up. Something is wrong with the server right now, and hopefully it will be fixed soon.
-                <br/><br/>
-                Try a solution:
-                <ul>
-                    <li>
-                        <a href='javascript: location.reload();'>Try again.</a>
-                    </li>
-                    <li>
-                        <a href='javascript: history.go(-1);'>Go to the previous page.</a>
-                    </li>
-                    <li>
-                        <a href='<?=$lserver?>/'>Go to the main page</a>
-                    </li>
-                </ul>
-            </div> <!-- #error_message -->
-        </div> <!-- .section -->
-<?php
-        include $doc_root . "footer.php";
-        stats($con, $cur_section, $cur_entry);
-?>
-    </body>
-</html>

+ 2 - 2
www/footer.php

@@ -3,7 +3,7 @@
     <table id='footer_table'>
         <tr>
             <td id='footer_left'>
-                <span id='footer_follow' class='desktop'><?=text($con, "FOOTER_FOLLOW", $lang);?></span>
+                <span id='footer_follow' class='desktop'><?=text($con, "FOOTER_FOLLOW", $lang);?><br/></span>
 <?php
                 $q_social = mysqli_query($con, "SELECT title, icon, url FROM social WHERE visible = 1 ORDER BY idx;");
                 while ($r_social = mysqli_fetch_array($q_social)){
@@ -15,7 +15,7 @@
                 }
 ?>
             </td>
-            <td id='footer_center'><?=text($con, "FOOTER_COPY", $lang);?></td>
+            <td id='footer_center'><?=str_replace("#YEAR#", date("Y"), text($con, "FOOTER_COPY", $lang));?></td>
             <td id='footer_right'>
                 <a href='<?=$lserver?>/help/'><?=text($con, "FOOTER_HELP", $lang);?></a>
                 <br/><br/>

+ 46 - 10
www/functions.php

@@ -62,21 +62,29 @@
      * be displayed inf the page. Several methods are    *
      * used: cookie detection, and browser language      *
      * preferences.                                      *
+     * @params:                                          *
+     *    con (Mysql connection): Connection handler.    *
      * @return: (string): Language code.                 *
      *****************************************************/
-    // TODO: Redo using database
-    function select_language(){
+    function select_language($con){
+
+        // Get available languages from db
+        $available_languages = array();
+        $q_lang = mysqli_query($con, "SELECT code FROM lang WHERE active = 1;");
+        while ($r_lang = mysqli_fetch_array($q_lang)){
+            array_push($available_languages, $r_lang["code"]);
+        }
 
         // Check for language in uri
-        $lang = substr($_SERVER['REQUEST_URI'], 1, 2);
-        if ($lang == "es" || $lang == "en" || $lang == "eu"){
+        $lang = substr($_SERVER["REQUEST_URI"], 1, 2);
+        if (in_array($lang, $available_languages)){
             return $lang;
         }
         else{
             // Language is not in url. Find it out and redirect
             // Is passed on the URL?
             $lang = $_GET["lang"];
-            if ($lang == "es" || $lang == "en" || $lang == "eu"){
+            if (in_array($lang, $available_languages)){
                 header("Location: " . get_protocol() . $_SERVER["HTTP_HOST"] . "/" . $lang . $_SERVER["REQUEST_URI"]);
                 return $lang;
             }
@@ -85,7 +93,7 @@
             header("Cache-control: private");
             if (isSet($_COOKIE["lang"])){
                 $lang = $_COOKIE["lang"];
-                if ($lang == "es" || $lang == "en" || $lang == "eu"){
+                if (in_array($lang, $available_languages)){
                     header("Location: " . get_protocol() . $_SERVER["HTTP_HOST"] . "/" . $lang . $_SERVER["REQUEST_URI"]);
                     return $lang;
                 }
@@ -93,17 +101,16 @@
 
             //If no cookie, select from client browser preferences.
             else{
-                $available_languages = array("en", "eu", "es");
                 $langs = prefered_language($available_languages, $_SERVER["HTTP_ACCEPT_LANGUAGE"]);
                 $lang = $langs[0];
-                if ($lang == "es" || $lang == "en" || $lang == "eu"){
+                if (in_array($lang, $available_languages)){
                     header("Location: " . get_protocol() . $_SERVER["HTTP_HOST"] . "/" . $lang . $_SERVER["REQUEST_URI"]);
                     return $lang;
                 }
             }
 
             // If no method was succesfull, default language
-            $lang = "es";
+            $lang = $available_languages[0];
             header("Location: " . get_protocol() . $_SERVER["HTTP_HOST"] . "/" . $lang . $_SERVER["REQUEST_URI"]);
             return $lang;
         }
@@ -228,6 +235,35 @@
         return $str;
     }
 
+    /*****************************************************
+     * Generates a "Share" link for a network.           *
+     *                                                   *
+     * @params:                                          *
+     *    con (Mysql connection): Connection handler.    *
+     *    network (int): Social network ID.              *
+     *    server: (string): Server name. Can be empty.   *
+     *    url: (string): URL to be shared.               *
+     *    lang: (string): Language code (two letters).   *
+     * @return: (string): URL-valid string.              *
+     *****************************************************/
+    function share_link($con, $network, $server, $url, $lang){
+        if (strlen($url) == 0){
+            return "";
+        }
+        $out = "<a class='share' target='_blank' ";
+        $q_network = mysqli_query($con, "SELECT url, icon, title, text FROM share WHERE visible = 1 AND id = $network;");
+        if (mysqli_num_rows($q_network) == 0){
+            return "";
+        }
+        else{
+            $r_network = mysqli_fetch_array($q_network);
+            $out = $out . "href='" . $r_network["url"] . htmlspecialchars($url) . "' title='" . text($con, $r_network["text"], $lang) . "'>";
+            $out = $out . "<img class='share' src='" . $server . "/img/social/x1/" . $r_network["icon"] . "' alt='" . text($con, $r_network["text"], $lang) . "' title='" . text($con, $r_network["text"], $lang) . "' />";
+            $out = $out . "</a>";
+            return $out;
+        }
+    }
+
 
     /*****************************************************
      * Retrieves a text fragment from the database.      *
@@ -407,7 +443,7 @@
         }
 
         //Look for a visit with the same IP in the last 30 mins.
-        $q = mysqli_query($con, "SELECT stat_visit.id AS visitid FROM stat_view, stat_visit WHERE visit = stat_visit.id AND dtime > DATE_SUB(now(), INTERVAL 30 MINUTE) AND ip = '$ip' AND uagent = '$uagent';");
+        $q = mysqli_query($con, "SELECT stat_visit.id AS visitid FROM stat_view, stat_visit WHERE visit = stat_visit.id AND stat_view.dtime > DATE_SUB(now(), INTERVAL 30 MINUTE) AND ip = '$ip' AND uagent = '$uagent';");
         if (mysqli_num_rows($q) == 0){
             mysqli_query($con, "INSERT INTO stat_visit (ip, uagent, os, browser) VALUES ('$ip', '$uagent', '$os', '$browser');");
             $q = mysqli_query($con, "SELECT stat_visit.id AS visitid FROM stat_visit WHERE ip = '$ip' AND uagent = '$uagent' ORDER BY stat_visit.id DESC LIMIT 1;");

+ 6 - 6
www/help/index.php

@@ -1,12 +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();
+    $lang = select_language($con);
     $lserver = $server . "/" . $lang;
     $cur_section = "";
     $cur_entry = "";
@@ -17,7 +17,7 @@
         <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, "USER_NAME", $lang);?></title>
         <link rel='shortcut icon' href='<?=$lserver?>/img/logo/favicon.ico'/>
         <!-- CSS files -->
         <style>
@@ -44,15 +44,15 @@
         <link rel='author' href='<?=$lserver?>'/>
         <link rel='publisher' href='<?=$lserver?>'/>
         <meta name='description' content=''/>
-        <meta property='og:title' content='I&ntilde;igo Valentin'/>
+        <meta property='og:title' content='<?=text($con, "USER_NAME", $lang);?>'/>
         <meta property='og:url' content='<?=$lserver?>'/>
         <meta property='og:description' content=''/>
         <meta property='og:image' content=''/>
-        <meta property='og:site_name' content='I&ntilde;igo Valentin'/>
+        <meta property='og:site_name' content='<?=text($con, "USER_NAME", $lang);?>'/>
         <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:title' content='<?=text($con, "USER_NAME", $lang);?>'/>
         <meta name='twitter:description' content=''/>
         <meta name='twitter:image' content=''/>
         <meta name='twitter:url' content='<?=$lserver?>'/>

BIN
www/img/social/github.png


+ 0 - 0
www/img/social/googleplus.gif → www/img/social/google.gif


BIN
www/img/social/telegram.gif


BIN
www/img/social/vkontakte.gif


BIN
www/img/social/x1/github.png


BIN
www/img/social/x1/google.gif


BIN
www/img/social/x1/telegram.gif


BIN
www/img/social/x1/vkontakte.gif


BIN
www/img/social/x2/github.png


BIN
www/img/social/x2/google.gif


BIN
www/img/social/x2/telegram.gif


BIN
www/img/social/x2/vkontakte.gif


BIN
www/img/social/x3/github.png


BIN
www/img/social/x3/google.gif


BIN
www/img/social/x3/telegram.gif


BIN
www/img/social/x3/vkontakte.gif


BIN
www/img/social/x4/github.png


BIN
www/img/social/x4/google.gif


BIN
www/img/social/x4/telegram.gif


BIN
www/img/social/x4/vkontakte.gif


BIN
www/img/social/x5/github.png


BIN
www/img/social/x5/google.gif


BIN
www/img/social/x5/telegram.gif


BIN
www/img/social/x5/vkontakte.gif


BIN
www/img/social/x6/github.png


BIN
www/img/social/x6/google.gif


BIN
www/img/social/x6/telegram.gif


BIN
www/img/social/x6/vkontakte.gif


+ 90 - 49
www/index.php

@@ -1,12 +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();
+    $lang = select_language($con);
     $lserver = $server . "/" . $lang;
     $cur_section = "";
     $cur_entry = "";
@@ -17,7 +17,7 @@
         <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, "USER_NAME", $lang);?></title>
         <link rel='shortcut icon' href='<?=$lserver?>/img/logo/x2/favicon.ico'/>
         <!-- CSS files -->
         <style>
@@ -44,15 +44,15 @@
         <link rel='author' href='<?=$lserver?>'/>
         <link rel='publisher' href='<?=$lserver?>'/>
         <meta name='description' content=''/>
-        <meta property='og:title' content='I&ntilde;igo Valentin'/>
+        <meta property='og:title' content='<?=text($con, "USER_NAME", $lang);?>'/>
         <meta property='og:url' content='<?=$lserver?>'/>
         <meta property='og:description' content=''/>
         <meta property='og:image' content='<?=$lserver?>/img/logo/x3/favicon.ico''/>
-        <meta property='og:site_name' content='I&ntilde;igo Valentin'/>
+        <meta property='og:site_name' content='<?=text($con, "USER_NAME", $lang);?>'/>
         <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:title' content='<?=text($con, "USER_NAME", $lang);?>'/>
         <meta name='twitter:description' content=''/>
         <meta name='twitter:image' content='<?=$lserver?>/img/logo/x3/favicon.ico''/>
         <meta name='twitter:url' content='<?=$lserver?>'/>
@@ -60,7 +60,7 @@
     </head>
     <body>
         <div id='logo'>
-            <img id='logo' src='<?=$lserver?>/img/logo/x6/inigovalentin.png' alt='I&ntilde;igo Valentin'/>
+            <img id='logo' src='<?=$lserver?>/img/logo/x6/inigovalentin.png' alt='<?=text($con, "USER_NAME", $lang);?>'/>
         </div>
 <?php
         include $doc_root . "header.php";
@@ -69,73 +69,114 @@
             <div id='content_row'>
                 <div class='content_cell' id='content_cell_profile'>
                     <div class='section'>
-                        <h3 class='section_title'>I&ntilde;igo Valentin</h3>
+                        <h3 class='section_title'><?=text($con, "USER_NAME", $lang);?></h3>
                         <div class='entry'>
-                            <img id='profile' src='<?=$lserver?>/img/profile/x16/preview/0.png' alt='I&ntilde;igo Valentin' title='I&ntilde;igo Valentin' />
+                            <img id='profile' src='<?=$lserver?>/img/profile/x6/0.png' alt='<?=text($con, "USER_NAME", $lang);?>' title='<?=text($con, "USER_NAME", $lang);?>' />
+                            <span id='tagline'><?=text($con, "USER_TAGLINE", $lang);?></span>
                         </div> <!-- .entry -->
                     </div> <!-- .section -->
                 </div> <!-- #content_cell_profile -->
                 <div class='content_cell' id='content_cell_content'>
-                    <div class='section'>
-                        <h3 class='section_title'>TR#Ultimos proyectos</h3>
+                    <div class='section' id='projects_section'>
+                        <h3 class='section_title'><?=text($con, "INDEX_LATEST_PROJECTS", $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 LIMIT 3;");
                         while ($r_project = mysqli_fetch_array($q_project)){
 ?>
-                            <a href='<?=$lserver?>/project/<?=$r_project["permalink"]?>'>
-                                <div class='entry entry_list project_row'>
-                                    <table>
-                                        <tr>
+                            <div class='entry entry_list project_row'>
+                                <table>
+                                    <tr>
 <?php
-                                            if (strlen($r_project["logo"]) > 0){
+                                        if (strlen($r_project["logo"]) > 0){
 ?>
-                                                <td>
-                                                    <img alt='<?=text($con, $r_project["title"], $lang)?>' title='<?=text($con, $r_project["title"], $lang)?>' src='<?=$lserver?>/img/project/x2/<?=$r_project["logo"]?>'/>
-                                                </td>
+                                            <td>
+                                                <a title='<?=text($con, $r_project["title"], $lang)?>' href='<?=$lserver?>/project/<?=$r_project["permalink"]?>'>
+                                                    <img clsass='project_list_image' alt='<?=text($con, $r_project["title"], $lang)?>' title='<?=text($con, $r_project["title"], $lang)?>' src='<?=$lserver?>/img/project/x2/<?=$r_project["logo"]?>'/>
+                                                </a>
+                                            </td>
 <?php
-                                            }
+                                        }
 ?>
-                                            <td>
+                                        <td>
+                                            <a title='<?=text($con, $r_project["title"], $lang)?>' href='<?=$lserver?>/project/<?=$r_project["permalink"]?>'>
                                                 <h4><?=text($con, $r_project["title"], $lang)?></h4>
-                                                <?=text($con, $r_project["header"], $lang)?>
-                                            </td>
-                                        </tr>
-                                    </table>
-                                </div> <!-- .entry -->
-                            </a>
+                                            </a>                                                <?=text($con, $r_project["header"], $lang)?>
+                                        </td>
+                                    </tr>
+                                </table>
+                            </div> <!-- .entry -->
 <?php
                         }
 ?>
                     </div> <!-- .section -->
-                    <div class='section'>
-                        <h3 class='section_title'>TR#Ultimos posts</h3>
+                    <div class='section' id='blog_section'>
+                        <h3 class='section_title'><?=text($con, 'INDEX_LATEST_POSTS', $lang)?></h3>
 <?php
-                        $q_blog = mysqli_query($con, "SELECT * FROM post WHERE visible = 1 ORDER BY dtime DESC LIMIT 2;");
-                        while ($r_blog = mysqli_fetch_array($q_blog)){
-                            $q_image = mysqli_query($con, "SELECT * FROM post_image WHERE post = $r_blog[id] ORDER BY id LIMIT 1;");
+                        $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 LIMIT 2;");
+                        while($r_blog = mysqli_fetch_array($q_blog)){
 ?>
-                            <a href='<?=$lserver?>/blog/<?=$r_blog["permalink"]?>'>
-                                <div class='entry entr_list blog_row'>
-                                    <table>
-                                        <tr>
+                            <div itemscope itemtype='http://schema.org/BlogPosting' class='entry entry_list 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='<?=$lserver?>'/>
+                                <h3 class='entry_title'>
+                                    <a itemprop='url' href='<?=$lserver?>/blog/<?=$r_blog["permalink"]?>'><?=text($con, $r_blog["title"], $lang)?></a>
+                                </h3>
 <?php
-                                            if (mysqli_num_rows($q_image) > 0){
-                                                $r_image = mysqli_fetch_array($q_image);
+                                $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);
 ?>
-                                                <td>
-                                                    <img alt='<?=text($con, $r_blog["title"], $lang)?>' title='<?=text($con, $r_blog["title"], $lang)?>' src='<?=$lserver?>/img/blog/x2/<?=$r_image["image"]?>'/>
-                                                </td>
+                                    <div class='post_list_image_container'>
+                                        <a href='<?=$lserver?>/blog/<?=$r_blog["permalink"]?>'>
+                                            <meta itemprop='image' content='<?=$lserver?>/img/blog/x4/<?=$r_image["image"]?>'/>
+                                            <img class='post_list_image' alt='<?=$r_blog["title"]?>' src='<?=$lserver?>/img/blog/x2/<?=$r_image["image"]?>'/>
+                                        </a>
+                                    </div>
 <?php
-                                            }
+                                }
+?>
+                                <p><?=cut_text(text($con, $r_blog["text"], $lang), 150, text($con, "BLOG_MORE", $lang), "$lserver/blog/$r_blog[permalink]/")?></p>
+                                <hr/>
+                                <table class='post_list_footer'>
+                                    <tr>
+                                        <td class='date'>
+                                            <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 approved = 1;");
+                                            $r_comment = mysqli_fetch_array($q_comment);
+?>
+                                            <meta itemprop='commentCount interationCount' content='<?=$r_comment["count"]?>'/>
+                                            <td class='comment_counter'>
+<?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>
-                                                <h4><?=text($con, $r_blog["title"], $lang)?></h4>
-                                                <?=cut_text(text($con, $r_project["header"], $lang), 165, "TR#Leer mas", $lserver . "/blog/" . $r_blog["permalink"])?>
                                             </td>
-                                        </tr>
-                                    </table>
-                                </div> <!-- .entry -->
-                            </a>
+<?php
+                                        } // if ($r_blog["comments"] == 1)
+?>
+                                    </tr>
+                                </table> <!-- .post_list_footer -->
+                            </div> <!-- .blog_entry -->
 <?php
                         }
 ?>

+ 13 - 13
www/profile/index.php

@@ -1,12 +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();
+    $lang = select_language($con);
     $lserver = $server . "/" . $lang;
     $cur_section = "me";
     $cur_entry = "";
@@ -17,7 +17,7 @@
         <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><?=text($con, "PROFILE_TITLE", $lang)?> - I&ntilde;igo Valentin</title>
+        <title><?=text($con, "PROFILE_TITLE", $lang)?> - <?=text($con, "USER_NAME", $lang);?></title>
         <link rel='shortcut icon' href='<?=$lserver?>/img/logo/x2/favicon.ico'/>
         <!-- CSS files -->
         <style>
@@ -45,15 +45,15 @@
         <link rel='author' href='<?=$lserver?>'/>
         <link rel='publisher' href='<?=$lserver?>'/>
         <meta name='description' content='<?=text($con, "PROFILE_DESCRIPTION", $lang)?>'/>
-        <meta property='og:title' content='<?=text($con, "PROFILE_TITLE", $lang)?> - I&ntilde;igo Valentin'/>
+        <meta property='og:title' content='<?=text($con, "PROFILE_TITLE", $lang)?> - <?=text($con, "USER_NAME", $lang);?>'/>
         <meta property='og:url' content='<?=$lserver?>/me'/>
         <meta property='og:description' content='<?=text($con, "PROFILE_DESCRIPTION", $lang)?>'/>
         <meta property='og:image' content='<?=$lserver?>/img/logo/x3/favicon.ico'/>
-        <meta property='og:site_name' content='I&ntilde;igo Valentin'/>
+        <meta property='og:site_name' content='<?=text($con, "USER_NAME", $lang);?>'/>
         <meta property='og:type' content='website'/>
         <meta property='og:locale' content='<?=$lang?>'/>
         <meta name='twitter:card' content='summary'/>
-        <meta name='twitter:title' content='<?=text($con, "PROFILE_TITLE", $lang)?> - I&ntilde;igo Valentin'/>
+        <meta name='twitter:title' content='<?=text($con, "PROFILE_TITLE", $lang)?> - <?=text($con, "USER_NAME", $lang);?>'/>
         <meta name='twitter:description' content='<?=text($con, "PROFILE_DESCRIPTION", $lang)?>'/>
         <meta name='twitter:image' content='<?=$lserver?>/img/logo/x3/favicon.ico'/>
         <meta name='twitter:url' content='<?=$lserver?>'/>
@@ -65,27 +65,27 @@
 ?>
         <div id='content'>
             <div class='section section_no_title'>
-                <h3 id='name' class='section_title'>I&ntilde;igo Valentin</h3>
+                <h3 id='name' class='section_title'><?=text($con, "USER_NAME", $lang);?></h3>
                 <div class='entry' id='profile'>
                     <div class='table_row'>
                         <div class='table_cell'>
-                            <img id='profile' src='<?=$lserver?>/img/profile/x16/0.png' alt='I&ntilde;igo Valentin' title='I&ntilde;igo Valentin' />
+                            <img id='profile' src='<?=$lserver?>/img/profile/x16/0.png' alt='<?=text($con, "USER_NAME", $lang);?>' title='<?=text($con, "USER_NAME", $lang);?>' />
                         </div> <!-- .table_cell -->
                         <div class='table_cell'>
-                            <h4 id='tagline'>TR#Developer</h4>
-                            <p id='bio'>TR#Bio</p>
+                            <h4 id='tagline'><?=text($con, "USER_TAGLINE", $lang);?></h4>
+                            <p id='bio'><?=text($con, "USER_BIO", $lang);?></p>
                         </div> <!-- .table_cell -->
                     </div> <!-- .table_row -->
                 </div> <!-- #profile -->
             </div> <!-- .section -->
             <div class='section'>
-                <h3 class='section_title'>TR#Curriculum Vitae</h3>
+                <h3 class='section_title'><?=text($con, "PROFILE_CV", $lang);?></h3>
                 <ul class='cv_download'>
                     <li>
-                        <a target='_blank' href='TODO' title='I&ntilde;igo Valentin - TR#Curriculum Vitae'>TR#Download in currlang</a>
+                        <a target='_blank' href='TODO' title='<?=text($con, "USER_NAME", $lang);?> - <?=text($con, "PROFILE_CV", $lang);?>'><?=text($con, "PROFILE_DOWNLOAD_CURRENT", $lang);?></a>
                     </li>
                     <li>
-                        <a href='TODO' title='TR#Curriculum Vitae - Other languages'>TR#Download in other languages</a>
+                        <a href='TODO' title='<?=text($con, "PROFILE_CV_DOWNLOAD_LANG", $lang);?>'><?=text($con, "PROFILE_DOWNLOAD_OTHER", $lang);?></a>
                     </li>
                 </ul>
 <?php

+ 10 - 9
www/project/index.php

@@ -1,12 +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();
+    $lang = select_language($con);
     $lserver = $server . "/" . $lang;
     $cur_section = "project";
     $cur_entry = "";
@@ -17,7 +17,7 @@
     <head>
         <meta content='text/html; charset=utf-8' http-equiv='content-type'/>
         <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1'/>
-        <title><?=text($con, "PROJECT_TITLE", $lang)?> - I&ntilde;igo Valentin</title>
+        <title><?=text($con, "PROJECT_TITLE", $lang)?> - <?=text($con, "USER_NAME", $lang);?></title>
         <link rel='shortcut icon' href='<?=$lserver?>/img/logo/x2/favicon.ico'/>
         <!-- CSS files -->
         <style>
@@ -45,15 +45,15 @@
         <link rel='author' href='<?=$lserver?>'/>
         <link rel='publisher' href='<?=$lserver?>'/>
         <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:title' content='<?=text($con, "PROJECT_TITLE", $lang)?> - <?=text($con, "USER_NAME", $lang);?>'/>
         <meta property='og:url' content='<?=$lserver?>/project/'/>
         <meta property='og:description' content='<?=text($con, "PROJECT_DESCRIPTION", $lang)?>'/>
         <meta property='og:image' content='<?=$lserver?>/img/logo/x3/favicon.ico'/>
-        <meta property='og:site_name' content='I&ntilde;igo Valentin'/>
+        <meta property='og:site_name' content='<?=text($con, "USER_NAME", $lang);?>'/>
         <meta property='og:type' content='website'/>
         <meta property='og:locale' content='<?=$lang?>'/>
         <meta name='twitter:card' content='summary'/>
-        <meta name='twitter:title' content='<?=text($con, "PROJECT_TITLE", $lang)?> - I&ntilde;igo Valentin'/>
+        <meta name='twitter:title' content='<?=text($con, "PROJECT_TITLE", $lang)?> - <?=text($con, "USER_NAME", $lang);?>'/>
         <meta name='twitter:description' content='<?=text($con, "PROJECT_DESCRIPTION", $lang)?>'/>
         <meta name='twitter:image' content='<?=$lserver?>/img/logo/x3/favicon.ico'/>
         <meta name='twitter:url' content='<?=$lserver?>/project/'/>
@@ -98,8 +98,9 @@
 ?>
                     </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='content_cell'  id='content_cell_info'>
+                    <div class='section' id='right_column'>
+                        <h3 class='section_title'><?=text($con, "PROJECT_SEARCH", $lang)?></h3>
                         <div class='entry'>
                             <input type='text' placeholder='<?=text($con, "PROJECT_SEARCH", $lang)?>' name='text'/>
                             <input type='hidden' id='advanced_search_indicator' value='0'/>
@@ -139,7 +140,7 @@
 
                         </div> <!-- .entry -->
                     </div> <!-- #right_column -->
-                </div> <!-- #content_cell_right -->
+                </div> <!-- #content_cell_info -->
             </div> <!-- #content_row -->
         </div> <!-- #content -->
 <?php

+ 32 - 13
www/project/project.php

@@ -1,12 +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();
+    $lang = select_language($con);
     $lserver = $server . "/" . $lang;
 
     // Get project data
@@ -30,7 +30,7 @@
     <head>
         <meta content="text/html; charset=utf-8" http-equiv="content-type"/>
         <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1"/>
-        <title><?=$title?> - I&ntilde;igo Valentin</title>
+        <title><?=$title?> - <?=text($con, "USER_NAME", $lang);?></title>
 <?php
         if (strlen($r_project["logo"]) > 0){
 ?>
@@ -69,11 +69,11 @@
         <link rel="author" href="<?=$lserver?>"/>
         <link rel="publisher" href="<?=$lserver?>"/>
         <meta name="description" content="<?=$summary?>"/>
-        <meta property="og:title" content="<?=$title?> - I&ntilde;igo Valentin"/>
+        <meta property="og:title" content="<?=$title?> - <?=text($con, "USER_NAME", $lang);?>"/>
         <meta property="og:url" content="<?=$lserver?>/project/<?=$r_project["permalink"]?>"/>
         <meta property="og:description" content="<?=$summary?>"/>
 <?php
-        if (strlen($r_project["logo"]) > 0){
+        if (strlen($r_project["logo"]) == 0){
 ?>
             <meta property="og:image" content="<?=$lserver?>/img/logo/x3/favicon.ico"/>
 <?php
@@ -84,14 +84,14 @@
 <?php
         }
 ?>
-        <meta property="og:site_name" content="I&ntilde;igo Valentin"/>
+        <meta property="og:site_name" content="<?=text($con, "USER_NAME", $lang);?>"/>
         <meta property="og:type" content="website"/>
         <meta property="og:locale" content="<?=$lang?>"/>
         <meta name="twitter:card" content="summary"/>
-        <meta name="twitter:title" content="<?=$title?> - I&ntilde;igo Valentin"/>
+        <meta name="twitter:title" content="<?=$title?> - <?=text($con, "USER_NAME", $lang);?>"/>
         <meta name="twitter:description" content="<?=$summary?>"/>
 <?php
-        if (strlen($r_project["logo"]) > 0){
+        if (strlen($r_project["logo"]) == 0){
 ?>
             <meta name="twitter:image" content="<?=$lserver?>/img/logo/x3/favicon.ico"/>
 <?php
@@ -117,8 +117,27 @@
                         <div class='entry'>
                             <h4><?=$summary?></h4>
                             <?=text($con, $r_project["text"], $lang)?>
-                            <!-- TODO: Images -->
 <?php
+                            $q_image = mysqli_query($con, "SELECT * FROM project_image WHERE project = $id ORDER BY idx");
+                            if (mysqli_num_rows($q_image) > 0){
+?>
+                                <div id='image_reel'>
+                                    <table>
+                                        <tr>
+<?php
+                                            while ($r_image = mysqli_fetch_array($q_image)){
+?>
+                                                <td>
+                                                    <img title='<?=$title?>' alt='<?=$title?>' src='<?=$lserver?>/img/project/x4/<?=$r_image["image"]?>'/>
+                                                </td>
+<?php
+                                            } // while ($r_image = mysqli_fetch_array($q_image))
+?>
+                                        </tr>
+                                    </table>
+                                </div> <!-- #image_reel -->
+<?php
+                            } // if (mysqli_num_rows($q_image) > 0)
                             $q_embed = mysqli_query($con, "SELECT * FROM project_url WHERE type = 'E' AND project = $id;");
                             while ($r_embed = mysqli_fetch_array($q_embed)){
 ?>
@@ -132,8 +151,9 @@
                         </div> <!-- .entry -->
                     </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='content_cell'  id='content_cell_info'>
+                    <div class='section' id='right_column'>
+                        <h3 class='section_title'><?=text($con, "PROJECT_DETAILS", $lang);?></h3>
                         <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';");
@@ -175,7 +195,7 @@
                             </span>
                         </div>
                     </div> <!-- #right_column -->
-                </div> <!-- #content_cell_right -->
+                </div> <!-- #content_cell_info -->
             </div> <!-- #content_row -->
             <div id='cover'>
             </div> <!-- #cover -->
@@ -192,7 +212,6 @@
                     <h4><?=text($con, "PROJECT_LICENSE_LEGAL", $lang)?></h4>
                     <div id='license_legal' class='license_text'><?=text($con, $r_license["legal"], $lang)?></div>
                 </div>
-            
             </div> <!-- #license -->
         </div> <!-- #content -->
 <?php

+ 2 - 2
www/rss.php

@@ -2,12 +2,12 @@
     header('Content-type: application/xml');
     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();
+    $lang = select_language($con);
     $lserver = $server . "/" . $lang;
     $cur_section = "";
     $cur_entry = "";

+ 14 - 0
www/script/blog.js

@@ -0,0 +1,14 @@
+
+function toggleElement(name){
+    if (document.getElementById("list_" + name).clientHeight > 0){
+        document.getElementById("list_" + name).style.maxHeight = '0em';
+        setTimeout(function(){document.getElementById('slid_' + name).src = '/img/misc/slid-right.png';}, 500);
+    }
+    else{
+        document.getElementById("list_" + name).style.maxHeight = '90em';
+        setTimeout(function(){document.getElementById('slid_' + name).src = '/img/misc/slid-down.png';}, 500);
+    }
+    document.getElementById('slid_' + name).style.opacity = '0';
+    setTimeout(function(){document.getElementById('slid_' + name).style.opacity = '1';}, 500);
+}
+