Bladeren bron

Merge branch 'WEB' into V1

Iñigo Valentin 9 jaren geleden
bovenliggende
commit
bb36cf3756
100 gewijzigde bestanden met toevoegingen van 1364 en 301 verwijderingen
  1. 1 0
      .gitignore
  2. 44 12
      sql/00_STRUCTURE.SQL
  3. 33 0
      sql/01_PERMISSIONS.SQL
  4. 314 0
      sql/02_DATA.SQL
  5. 7 0
      sql/README.md
  6. 8 0
      sql/__SETUP.SQL
  7. 0 17
      sql/dbusers-example.sql
  8. 0 30
      sql/text.sql
  9. 24 0
      utils/imagescaler
  10. 125 0
      www/.htaccess
  11. 152 20
      www/blog/index.php
  12. 8 7
      www/blog/post.php
  13. 0 72
      www/contact/index.php
  14. 67 0
      www/css/blog.css
  15. 22 0
      www/css/home.css
  16. 0 0
      www/css/m/blog.css
  17. 0 0
      www/css/m/profile.css
  18. 0 0
      www/css/m/project.css
  19. 16 0
      www/css/profile.css
  20. 111 0
      www/css/project.css
  21. 59 29
      www/css/ui.css
  22. 0 72
      www/cv/index.php
  23. 101 0
      www/error/403.php
  24. 101 0
      www/error/404.php
  25. 101 0
      www/error/500.php
  26. 11 7
      www/footer.php
  27. 43 20
      www/functions.php
  28. 9 9
      www/header.php
  29. 7 6
      www/help/index.php
  30. 0 0
      www/img/icon/profile.gif
  31. BIN
      www/img/icon/project.gif
  32. BIN
      www/img/icon/x1/blog.gif
  33. BIN
      www/img/icon/x1/home.gif
  34. BIN
      www/img/icon/x1/profile.gif
  35. BIN
      www/img/icon/x1/project.gif
  36. BIN
      www/img/icon/x1/projects.gif
  37. BIN
      www/img/icon/x2/blog.gif
  38. BIN
      www/img/icon/x2/home.gif
  39. BIN
      www/img/icon/x2/profile.gif
  40. BIN
      www/img/icon/x2/project.gif
  41. BIN
      www/img/icon/x2/projects.gif
  42. BIN
      www/img/icon/x3/blog.gif
  43. BIN
      www/img/icon/x3/home.gif
  44. BIN
      www/img/icon/x3/profile.gif
  45. BIN
      www/img/icon/x3/project.gif
  46. BIN
      www/img/icon/x3/projects.gif
  47. BIN
      www/img/icon/x4/blog.gif
  48. BIN
      www/img/icon/x4/home.gif
  49. BIN
      www/img/icon/x4/profile.gif
  50. BIN
      www/img/icon/x4/project.gif
  51. BIN
      www/img/icon/x4/projects.gif
  52. BIN
      www/img/icon/x5/blog.gif
  53. BIN
      www/img/icon/x5/home.gif
  54. BIN
      www/img/icon/x5/profile.gif
  55. BIN
      www/img/icon/x5/project.gif
  56. BIN
      www/img/icon/x5/projects.gif
  57. BIN
      www/img/icon/x6/blog.gif
  58. BIN
      www/img/icon/x6/home.gif
  59. BIN
      www/img/icon/x6/profile.gif
  60. BIN
      www/img/icon/x6/project.gif
  61. BIN
      www/img/icon/x6/projects.gif
  62. BIN
      www/img/lang/x1/en.gif
  63. BIN
      www/img/lang/x1/es.gif
  64. BIN
      www/img/lang/x1/eu.gif
  65. BIN
      www/img/lang/x2/en.gif
  66. BIN
      www/img/lang/x2/es.gif
  67. BIN
      www/img/lang/x2/eu.gif
  68. BIN
      www/img/lang/x3/en.gif
  69. BIN
      www/img/lang/x3/es.gif
  70. BIN
      www/img/lang/x3/eu.gif
  71. BIN
      www/img/lang/x4/en.gif
  72. BIN
      www/img/lang/x4/es.gif
  73. BIN
      www/img/lang/x4/eu.gif
  74. BIN
      www/img/lang/x5/en.gif
  75. BIN
      www/img/lang/x5/es.gif
  76. BIN
      www/img/lang/x5/eu.gif
  77. BIN
      www/img/lang/x6/en.gif
  78. BIN
      www/img/lang/x6/es.gif
  79. BIN
      www/img/lang/x6/eu.gif
  80. BIN
      www/img/license/CC-0.png
  81. BIN
      www/img/license/CC-BY-SA.png
  82. BIN
      www/img/license/GPLV3.png
  83. BIN
      www/img/license/icon/CC-0.png
  84. BIN
      www/img/license/icon/CC-BY-SA.png
  85. BIN
      www/img/license/icon/GPLV3.png
  86. BIN
      www/img/license/logo/CC-0.png
  87. BIN
      www/img/license/logo/CC-BY-SA.png
  88. BIN
      www/img/license/logo/GPLV3.png
  89. BIN
      www/img/license/x1/CC-0.png
  90. BIN
      www/img/license/x1/CC-BY-SA.png
  91. BIN
      www/img/license/x1/GPLV3.png
  92. BIN
      www/img/license/x2/CC-0.png
  93. BIN
      www/img/license/x2/CC-BY-SA.png
  94. BIN
      www/img/license/x2/GPLV3.png
  95. BIN
      www/img/license/x3/CC-0.png
  96. BIN
      www/img/license/x3/CC-BY-SA.png
  97. BIN
      www/img/license/x3/GPLV3.png
  98. BIN
      www/img/license/x4/CC-0.png
  99. BIN
      www/img/license/x4/CC-BY-SA.png
  100. BIN
      www/img/license/x4/GPLV3.png

+ 1 - 0
.gitignore

@@ -23,6 +23,7 @@ www-admin/redirect_s.php
 #SQL data
 sql/dbusers.sql
 sql/*row*.sql
+sql/CUSTOM_ROWS.SQL
 
 #Passwords file
 sql/dbpasswords.sql

+ 44 - 12
sql/setup.sql → sql/00_STRUCTURE.SQL

@@ -15,7 +15,8 @@ CREATE TABLE text (
     id       VARCHAR(32),
     lang     VARCHAR(2)     REFERENCES lang.code,
     section  VARCHAR(32),
-    text     VARCHAR(5000)  NOT NULL,
+    text     VARCHAR(5000),
+    file     VARCHAR(32),
     PRIMARY KEY(id, lang)
 );
 CREATE INDEX i_text ON text(id, lang);
@@ -83,6 +84,14 @@ CREATE TABLE post_comment (
     visit     INT            REFERENCES stat_visit.id
 );
 
+CREATE TABLE license (
+    id       VARCHAR(32)  PRIMARY KEY,
+    summary  VARCHAR(32)  NOT NULL     REFERENCES text.id,
+    legal    VARCHAR(32)  NOT NULL     REFERENCES text.id,
+    logo     VARCHAR(32),
+    icon     VARCHAR(32)
+);
+
 CREATE TABLE project_type (
     id       VARCHAR(1)   NOT NULL  PRIMARY KEY,
     title    VARCHAR(32)  NOT NULL  REFERENCES text.id,
@@ -90,16 +99,17 @@ CREATE TABLE project_type (
 );
 
 CREATE TABLE project (
-    id         INT           AUTO_INCREMENT  PRIMARY KEY,
+    id         INT           AUTO_INCREMENT         PRIMARY KEY,
     permalink  VARCHAR(300)  NOT NULL,
-    type       VARCHAR(1)    NOT NULL        REFERENCES project_type.id,
-    title      VARCHAR(32)   NOT NULL        REFERENCES text.id,
+    type       VARCHAR(1)    NOT NULL               REFERENCES project_type.id,
+    title      VARCHAR(32)   NOT NULL               REFERENCES text.id,
     logo       VARCHAR(32),
-    header     VARCHAR(32)   NOT NULL        REFERENCES text.id,
-    text       VARCHAR(32)   NOT NULL        REFERENCES text.id,
-    user       INT           NOT NULL        REFERENCES user.id,
-    visible    BOOLEAN       NOT NULL        DEFAULT 1,
-    comments   BOOLEAN       NOT NULL        DEFAULT 1
+    header     VARCHAR(32)   REFERENCES text.id,
+    text       VARCHAR(32)   REFERENCES text.id,
+    license    VARCHAR(32)   REFERENCES license.id,
+    user       INT           NOT NULL               REFERENCES user.id,
+    visible    BOOLEAN       NOT NULL               DEFAULT 1,
+    comments   BOOLEAN       NOT NULL               DEFAULT 1
 );
 
 CREATE TABLE project_version_type (
@@ -122,9 +132,10 @@ CREATE TABLE project_version (
 );
 
 CREATE TABLE project_url_type (
-    id       VARCHAR(1)   NOT NULL  PRIMARY KEY,
-    title    VARCHAR(32)  NOT NULL  REFERENCES text.id,
-    summary  VARCHAR(32)  NOT NULL  REFERENCES text.id
+    id       VARCHAR(1)   NOT NULL            PRIMARY KEY,
+    title    VARCHAR(32)  REFERENCES text.id,
+    summary  VARCHAR(32)  REFERENCES text.id,
+    logo     VARCHAR(32)
 );
 
 CREATE TABLE project_url (
@@ -160,6 +171,27 @@ CREATE TABLE project_comment (
     visit     INT            REFERENCES stat_visit.id
 );
 
+CREATE TABLE cv_category (
+    id        INT          AUTO_INCREMENT      PRIMARY KEY,
+    title     VARCHAR(32)  REFERENCES text.id,
+    summary   VARCHAR(32)  REFERENCES text.id,
+    visible   BOOLEAN      NOT NULL            DEFAULT 1,
+    priority  INT          NOT NULL            UNIQUE
+);
+
+CREATE TABLE cv_entry (
+    id               INT          AUTO_INCREMENT  PRIMARY KEY,
+    category         INT          NOT NULL        REFERENCES cv_category.id,
+    role             VARCHAR(32)  NOT NULL        REFERENCES text.id,
+    company          VARCHAR(64)  NOT NULL,
+    city             VARCHAR(32)  NOT NULL        REFERENCES text.id,
+    start            DATETIME     NOT NULL,
+    end              DATETIME,
+    date_precission  VARCHAR(1)   NOT NULL        DEFAULT 'M',
+    summary          VARCHAR(32)  NOT NULL        REFERENCES text.id,
+    visible          BOOLEAN      NOT NULL        DEFAULT 1
+);
+
 CREATE TABLE settings (
     name     VARCHAR(64)  PRIMARY KEY,
     value    VARCHAR(64)  NOT NULL,

+ 33 - 0
sql/01_PERMISSIONS.SQL

@@ -0,0 +1,33 @@
+-- Replace all instances of XXX with the external site db password (same one as in www/.htaccess).
+-- Uncomment all entries.
+
+--GRANT SELECT ON         iv.cv_category          TO 'ivext'@'localhost' IDENTIFIED BY 'XXX';
+--GRANT SELECT ON         iv.cv_entry             TO 'ivext'@'localhost' IDENTIFIED BY 'XXX';
+--GRANT SELECT ON         iv.lang                 TO 'ivext'@'localhost' IDENTIFIED BY 'XXX';
+--GRANT SELECT ON         iv.license              TO 'ivext'@'localhost' IDENTIFIED BY 'XXX';
+--GRANT SELECT ON         iv.text                 TO 'ivext'@'localhost' IDENTIFIED BY 'XXX';
+--GRANT SELECT ON         iv.user                 TO 'ivext'@'localhost' IDENTIFIED BY 'XXX';
+--GRANT SELECT ON         iv.post                 TO 'ivext'@'localhost' IDENTIFIED BY 'XXX';
+--GRANT SELECT ON         iv.post_tag             TO 'ivext'@'localhost' IDENTIFIED BY 'XXX';
+--GRANT SELECT ON         iv.post_image           TO 'ivext'@'localhost' IDENTIFIED BY 'XXX';
+--GRANT SELECT, INSERT ON iv.post_comment         TO 'ivext'@'localhost' IDENTIFIED BY 'XXX';
+--GRANT SELECT ON         iv.project              TO 'ivext'@'localhost' IDENTIFIED BY 'XXX';
+--GRANT SELECT ON         iv.project_type         TO 'ivext'@'localhost' IDENTIFIED BY 'XXX';
+--GRANT SELECT ON         iv.project_tag          TO 'ivext'@'localhost' IDENTIFIED BY 'XXX';
+--GRANT SELECT ON         iv.project_url          TO 'ivext'@'localhost' IDENTIFIED BY 'XXX';
+--GRANT SELECT ON         iv.project_url_type     TO 'ivext'@'localhost' IDENTIFIED BY 'XXX';
+--GRANT SELECT ON         iv.project_image        TO 'ivext'@'localhost' IDENTIFIED BY 'XXX';
+--GRANT SELECT ON         iv.project_tag          TO 'ivext'@'localhost' IDENTIFIED BY 'XXX';
+--GRANT SELECT ON         iv.project_version      TO 'ivext'@'localhost' IDENTIFIED BY 'XXX';
+--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';
+
+
+
+
+
+-- Replace YYY with the internal site db password (same one as in www-admin/.htaccess).
+-- Uncomment entry.
+
+--GRANT SELECT, INSERT, DELETE, UPDATE, SHOW VIEW ON iv.* TO 'ivint'@'localhost' IDENTIFIED BY 'YYY';

+ 314 - 0
sql/02_DATA.SQL

@@ -0,0 +1,314 @@
+-- AVAILABLE LANGUAGES
+INSERT INTO lang VALUES ('es', 'Castellano', '1');
+INSERT INTO lang VALUES ('en', 'English', '1');
+INSERT INTO lang VALUES ('eu', 'Euskara', '1');
+
+-- DATE ELEMENTS
+INSERT INTO text VALUES ('MONTH_01', 'es', 'DATE', 'enero', null);
+INSERT INTO text VALUES ('MONTH_01', 'en', 'DATE', 'January', null);
+INSERT INTO text VALUES ('MONTH_01', 'eu', 'DATE', 'urtarrila', null);
+INSERT INTO text VALUES ('MONTH_02', 'es', 'DATE', 'febrero', null);
+INSERT INTO text VALUES ('MONTH_02', 'en', 'DATE', 'February', null);
+INSERT INTO text VALUES ('MONTH_02', 'eu', 'DATE', 'otsaila', null);
+INSERT INTO text VALUES ('MONTH_03', 'es', 'DATE', 'marzo', null);
+INSERT INTO text VALUES ('MONTH_03', 'en', 'DATE', 'March', null);
+INSERT INTO text VALUES ('MONTH_03', 'eu', 'DATE', 'martxoa', null);
+INSERT INTO text VALUES ('MONTH_04', 'es', 'DATE', 'abril', null);
+INSERT INTO text VALUES ('MONTH_04', 'ee', 'DATE', 'April', null);
+INSERT INTO text VALUES ('MONTH_04', 'eu', 'DATE', 'apirila', null);
+INSERT INTO text VALUES ('MONTH_05', 'es', 'DATE', 'mayo', null);
+INSERT INTO text VALUES ('MONTH_05', 'ee', 'DATE', 'May', null);
+INSERT INTO text VALUES ('MONTH_05', 'eu', 'DATE', 'maiatza', null);
+INSERT INTO text VALUES ('MONTH_06', 'es', 'DATE', 'junio', null);
+INSERT INTO text VALUES ('MONTH_06', 'en', 'DATE', 'June', null);
+INSERT INTO text VALUES ('MONTH_06', 'eu', 'DATE', 'ekaina', null);
+INSERT INTO text VALUES ('MONTH_07', 'es', 'DATE', 'julio', null);
+INSERT INTO text VALUES ('MONTH_07', 'en', 'DATE', 'July', null);
+INSERT INTO text VALUES ('MONTH_07', 'eu', 'DATE', 'uztaila', null);
+INSERT INTO text VALUES ('MONTH_08', 'es', 'DATE', 'agosto', null);
+INSERT INTO text VALUES ('MONTH_08', 'en', 'DATE', 'August', null);
+INSERT INTO text VALUES ('MONTH_08', 'eu', 'DATE', 'abuztua', null);
+INSERT INTO text VALUES ('MONTH_09', 'es', 'DATE', 'septiembre', null);
+INSERT INTO text VALUES ('MONTH_09', 'en', 'DATE', 'September', null);
+INSERT INTO text VALUES ('MONTH_09', 'eu', 'DATE', 'iraila', null);
+INSERT INTO text VALUES ('MONTH_10', 'es', 'DATE', 'octubre', null);
+INSERT INTO text VALUES ('MONTH_10', 'en', 'DATE', 'October', null);
+INSERT INTO text VALUES ('MONTH_10', 'eu', 'DATE', 'urria', null);
+INSERT INTO text VALUES ('MONTH_11', 'es', 'DATE', 'noviembre', null);
+INSERT INTO text VALUES ('MONTH_11', 'en', 'DATE', 'november', null);
+INSERT INTO text VALUES ('MONTH_11', 'eu', 'DATE', 'azaroa', null);
+INSERT INTO text VALUES ('MONTH_12', 'es', 'DATE', 'diciembre', null);
+INSERT INTO text VALUES ('MONTH_12', 'en', 'DATE', 'December', null);
+INSERT INTO text VALUES ('MONTH_12', 'eu', 'DATE', 'abendua', null);
+INSERT INTO text VALUES ('DAY_1', 'es', 'DATE', 'lunes', null);
+INSERT INTO text VALUES ('DAY_1', 'en', 'DATE', 'Monday', null);
+INSERT INTO text VALUES ('DAY_1', 'eu', 'DATE', 'astelehena', null);
+INSERT INTO text VALUES ('DAY_2', 'es', 'DATE', 'martes', null);
+INSERT INTO text VALUES ('DAY_2', 'en', 'DATE', 'Tuesday', null);
+INSERT INTO text VALUES ('DAY_2', 'eu', 'DATE', 'asteartea', null);
+INSERT INTO text VALUES ('DAY_3', 'es', 'DATE', 'miércoles', null);
+INSERT INTO text VALUES ('DAY_3', 'en', 'DATE', 'Wednesday', null);
+INSERT INTO text VALUES ('DAY_3', 'eu', 'DATE', 'astezkena', null);
+INSERT INTO text VALUES ('DAY_4', 'es', 'DATE', 'jueves', null);
+INSERT INTO text VALUES ('DAY_4', 'en', 'DATE', 'Thursday', null);
+INSERT INTO text VALUES ('DAY_4', 'eu', 'DATE', 'osteguna', null);
+INSERT INTO text VALUES ('DAY_5', 'es', 'DATE', 'viernes', null);
+INSERT INTO text VALUES ('DAY_5', 'en', 'DATE', 'Friday', null);
+INSERT INTO text VALUES ('DAY_5', 'eu', 'DATE', 'ostirala', null);
+INSERT INTO text VALUES ('DAY_6', 'es', 'DATE', 'sábado', null);
+INSERT INTO text VALUES ('DAY_6', 'en', 'DATE', 'Saturday', null);
+INSERT INTO text VALUES ('DAY_6', 'eu', 'DATE', 'larunbata', null);
+INSERT INTO text VALUES ('DAY_7', 'es', 'DATE', 'domingo', null);
+INSERT INTO text VALUES ('DAY_7', 'en', 'DATE', 'Sunday', null);
+INSERT INTO text VALUES ('DAY_7', 'eu', 'DATE', 'igandea', null);
+
+
+-- TAGS
+INSERT INTO text VALUES ('TAG_JS',      'es', 'TAG', 'Javascript', null);
+INSERT INTO text VALUES ('TAG_JS',      'en', 'TAG', 'Javascript', null);
+INSERT INTO text VALUES ('TAG_JS',      'eu', 'TAG', 'Javascript', null);
+INSERT INTO text VALUES ('TAG_HTML5',   'es', 'TAG', 'HTML5', null);
+INSERT INTO text VALUES ('TAG_HTML5',   'en', 'TAG', 'HTML5', null);
+INSERT INTO text VALUES ('TAG_HTML5',   'eu', 'TAG', 'HTML5', null);
+INSERT INTO text VALUES ('TAG_ANDROID', 'es', 'TAG', 'Android', null);
+INSERT INTO text VALUES ('TAG_ANDROID', 'en', 'TAG', 'Android', null);
+INSERT INTO text VALUES ('TAG_ANDROID', 'eu', 'TAG', 'Android', null);
+INSERT INTO text VALUES ('TAG_IOS',     'es', 'TAG', 'iOS', null);
+INSERT INTO text VALUES ('TAG_IOS',     'en', 'TAG', 'iOS', null);
+INSERT INTO text VALUES ('TAG_IOS',     'eu', 'TAG', 'iOS', null);
+INSERT INTO text VALUES ('TAG_JAVA',    'es', 'TAG', 'Java', null);
+INSERT INTO text VALUES ('TAG_JAVA',    'en', 'TAG', 'Java', null);
+INSERT INTO text VALUES ('TAG_JAVA',    'eu', 'TAG', 'Java', null);
+INSERT INTO text VALUES ('TAG_SWIFT',   'es', 'TAG', 'Swift', null);
+INSERT INTO text VALUES ('TAG_SWIFT',   'en', 'TAG', 'Swift', null);
+INSERT INTO text VALUES ('TAG_SWIFT',   'eu', 'TAG', 'Swift', null);
+INSERT INTO text VALUES ('TAG_WEB',     'es', 'TAG', 'Web', null);
+INSERT INTO text VALUES ('TAG_WEB',     'en', 'TAG', 'Web', null);
+INSERT INTO text VALUES ('TAG_WEB',     'eu', 'TAG', 'Web', null);
+
+
+-- PAGE Header
+INSERT INTO text VALUES ('HEADER_HOME',     'es', 'HEADER', 'Inicio', null);
+INSERT INTO text VALUES ('HEADER_PROFILE',  'es', 'HEADER', 'Yo', null);
+INSERT INTO text VALUES ('HEADER_PROJECTS', 'es', 'HEADER', 'Proyectos', null);
+INSERT INTO text VALUES ('HEADER_BLOG',     'es', 'HEADER', 'Blog', null);
+INSERT INTO text VALUES ('HEADER_HOME',     'en', 'HEADER', 'Home', null);
+INSERT INTO text VALUES ('HEADER_PROFILE',  'en', 'HEADER', 'Me', null);
+INSERT INTO text VALUES ('HEADER_PROJECTS', 'en', 'HEADER', 'Projects', null);
+INSERT INTO text VALUES ('HEADER_BLOG',     'en', 'HEADER', 'Blog', null);
+INSERT INTO text VALUES ('HEADER_HOME',     'eu', 'HEADER', 'Hasiera', null);
+INSERT INTO text VALUES ('HEADER_PROFILE',  'eu', 'HEADER', 'Ni', null);
+INSERT INTO text VALUES ('HEADER_PROJECTS', 'eu', 'HEADER', 'Proiektuak', null);
+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_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_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_HELP',   'eu', 'FOOTER', 'Laguntza', null);
+
+
+-- PAGE project
+INSERT INTO text VALUES ('PROJECT_TITLE',           'es', 'PROJECT', 'Proyectos', null);
+INSERT INTO text VALUES ('PROJECT_TITLE',           'en', 'PROJECT', 'Projects', null);
+INSERT INTO text VALUES ('PROJECT_TITLE',           'eu', 'PROJECT', 'Projektuak', null);
+INSERT INTO text VALUES ('PROJECT_DESCRIPTION',     'es', 'PROJECT', '', null); --TODO
+INSERT INTO text VALUES ('PROJECT_DESCRIPTION',     'en', 'PROJECT', '', null); --TODO
+INSERT INTO text VALUES ('PROJECT_DESCRIPTION',     'eu', 'PROJECT', '', null); --TODO
+INSERT INTO text VALUES ('PROJECT_SEARCH',          'es', 'PROJECT', 'Buscar', null);
+INSERT INTO text VALUES ('PROJECT_SEARCH',          'en', 'PROJECT', 'Search', null);
+INSERT INTO text VALUES ('PROJECT_SEARCH',          'eu', 'PROJECT', 'Bilatu', null);
+INSERT INTO text VALUES ('PROJECT_SEARCH_ADVANCED', 'es', 'PROJECT', 'Búsqueda avanzada', null);
+INSERT INTO text VALUES ('PROJECT_SEARCH_ADVANCED', 'en', 'PROJECT', 'Advanced search', null);
+INSERT INTO text VALUES ('PROJECT_SEARCH_ADVANCED', 'eu', 'PROJECT', 'Búsqueda avanzada', null);
+INSERT INTO text VALUES ('PROJECT_SEARCH_TYPE',     'es', 'PROJECT', 'Tipo', null);
+INSERT INTO text VALUES ('PROJECT_SEARCH_TYPE',     'en', 'PROJECT', 'Project type', null);
+INSERT INTO text VALUES ('PROJECT_SEARCH_TYPE',     'eu', 'PROJECT', 'Tipu', null);
+INSERT INTO text VALUES ('PROJECT_SEARCH_LICENSE',  'es', 'PROJECT', 'Licencia', null);
+INSERT INTO text VALUES ('PROJECT_SEARCH_LICENSE',  'en', 'PROJECT', 'License', null);
+INSERT INTO text VALUES ('PROJECT_SEARCH_LICENSE',  'eu', 'PROJECT', 'Lizenzia', null);
+INSERT INTO text VALUES ('PROJECT_VERSION',         'es', 'PROJECT', 'Versión', null);
+INSERT INTO text VALUES ('PROJECT_VERSION',         'en', 'PROJECT', 'Version', null);
+INSERT INTO text VALUES ('PROJECT_VERSION',         'eu', 'PROJECT', 'Versión', null);
+INSERT INTO text VALUES ('PROJECT_CLOSE',           'es', 'PROJECT', 'Cerrar', null);
+INSERT INTO text VALUES ('PROJECT_CLOSE',           'en', 'PROJECT', 'Close', null);
+INSERT INTO text VALUES ('PROJECT_CLOSE',           'eu', 'PROJECT', 'Itxali', null);
+INSERT INTO text VALUES ('PROJECT_LICENSE_SUMMARY', 'es', 'PROJECT', 'En resumen:', null);
+INSERT INTO text VALUES ('PROJECT_LICENSE_SUMMARY', 'en', 'PROJECT', 'In a few words:', null);
+INSERT INTO text VALUES ('PROJECT_LICENSE_SUMMARY', 'eu', 'PROJECT', 'En resumen:', null);
+INSERT INTO text VALUES ('PROJECT_LICENSE_LEGAL',   'es', 'PROJECT', 'Texto completo:', null);
+INSERT INTO text VALUES ('PROJECT_LICENSE_LEGAL',   'en', 'PROJECT', 'Full legal text:', null);
+INSERT INTO text VALUES ('PROJECT_LICENSE_LEGAL',   'eu', 'PROJECT', 'Textu osoa:', null);
+
+
+-- 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);
+
+
+-- 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
+
+
+-- TABLE project_type
+INSERT INTO text VALUES ('PROJECT_TYPE_D',         'es', 'DB_PROJECT_TYPE', 'Desarrollo', null);
+INSERT INTO text VALUES ('PROJECT_TYPE_D',         'en', 'DB_PROJECT_TYPE', 'Development', null);
+INSERT INTO text VALUES ('PROJECT_TYPE_D',         'eu', 'DB_PROJECT_TYPE', 'Development', null);
+INSERT INTO text VALUES ('PROJECT_TYPE_D_SUMMARY', 'es', 'DB_PROJECT_TYPE', 'Desarrollo', null);
+INSERT INTO text VALUES ('PROJECT_TYPE_D_SUMMARY', 'en', 'DB_PROJECT_TYPE', 'Development', null);
+INSERT INTO text VALUES ('PROJECT_TYPE_D_SUMMARY', 'eu', 'DB_PROJECT_TYPE', 'Development', null);
+INSERT INTO text VALUES ('PROJECT_TYPE_S',         'es', 'DB_PROJECT_TYPE', 'Sistemas', null);
+INSERT INTO text VALUES ('PROJECT_TYPE_S',         'en', 'DB_PROJECT_TYPE', 'System', null);
+INSERT INTO text VALUES ('PROJECT_TYPE_S',         'eu', 'DB_PROJECT_TYPE', 'System', null);
+INSERT INTO text VALUES ('PROJECT_TYPE_S_SUMMARY', 'es', 'DB_PROJECT_TYPE', 'Sistemas', null);
+INSERT INTO text VALUES ('PROJECT_TYPE_S_SUMMARY', 'en', 'DB_PROJECT_TYPE', 'System', null);
+INSERT INTO text VALUES ('PROJECT_TYPE_S_SUMMARY', 'eu', 'DB_PROJECT_TYPE', 'System', null);
+INSERT INTO project_type VALUES ('D', 'PROJECT_TYPE_D', 'PROJECT_TYPE_D_SUMMARY');
+INSERT INTO project_type VALUES ('S', 'PROJECT_TYPE_S', 'PROJECT_TYPE_S_SUMMARY');
+
+
+-- TABLE project_url_type
+INSERT INTO text VALUES ('URL_TYPE_W',         'es', 'DB_URL_TYPE', 'Ver sitio web', null);
+INSERT INTO text VALUES ('URL_TYPE_W',         'en', 'DB_URL_TYPE', 'Go to web site', null);
+INSERT INTO text VALUES ('URL_TYPE_W',         'eu', 'DB_URL_TYPE', 'Horrialdera', null);
+INSERT INTO text VALUES ('URL_TYPE_W_SUMMARY', 'es', 'DB_URL_TYPE', 'Ver sitio wew de este proyecto en funcionamiento.', null);
+INSERT INTO text VALUES ('URL_TYPE_W_SUMMARY', 'en', 'DB_URL_TYPE', 'See production web site.', null);
+INSERT INTO text VALUES ('URL_TYPE_W_SUMMARY', 'eu', 'DB_URL_TYPE', 'Horrialdera.', null);
+INSERT INTO text VALUES ('URL_TYPE_P',         'es', 'DB_URL_TYPE', 'Google Play', null);
+INSERT INTO text VALUES ('URL_TYPE_P',         'en', 'DB_URL_TYPE', 'Google Play', null);
+INSERT INTO text VALUES ('URL_TYPE_P',         'eu', 'DB_URL_TYPE', 'Google Play', null);
+INSERT INTO text VALUES ('URL_TYPE_P_SUMMARY', 'es', 'DB_URL_TYPE', 'Ver app en Google Play.', null);
+INSERT INTO text VALUES ('URL_TYPE_P_SUMMARY', 'en', 'DB_URL_TYPE', 'See on Google Play.', null);
+INSERT INTO text VALUES ('URL_TYPE_P_SUMMARY', 'eu', 'DB_URL_TYPE', 'Google Play-n.', null);
+INSERT INTO text VALUES ('URL_TYPE_A',         'es', 'DB_URL_TYPE', 'App Store', null);
+INSERT INTO text VALUES ('URL_TYPE_A',         'en', 'DB_URL_TYPE', 'App Store', null);
+INSERT INTO text VALUES ('URL_TYPE_A',         'eu', 'DB_URL_TYPE', 'App Store', null);
+INSERT INTO text VALUES ('URL_TYPE_A_SUMMARY', 'es', 'DB_URL_TYPE', 'Ver app en App Store.', null);
+INSERT INTO text VALUES ('URL_TYPE_A_SUMMARY', 'en', 'DB_URL_TYPE', 'See on App Store.', null);
+INSERT INTO text VALUES ('URL_TYPE_A_SUMMARY', 'eu', 'DB_URL_TYPE', 'App Store-an.', null);
+INSERT INTO text VALUES ('URL_TYPE_G',         'es', 'DB_URL_TYPE', 'Github', null);
+INSERT INTO text VALUES ('URL_TYPE_G',         'en', 'DB_URL_TYPE', 'Github', null);
+INSERT INTO text VALUES ('URL_TYPE_G',         'eu', 'DB_URL_TYPE', 'Github', null);
+INSERT INTO text VALUES ('URL_TYPE_G_SUMMARY', 'es', 'DB_URL_TYPE', 'Ver código fuente en Github.', null);
+INSERT INTO text VALUES ('URL_TYPE_G_SUMMARY', 'en', 'DB_URL_TYPE', 'Checkout source code on Github.', null);
+INSERT INTO text VALUES ('URL_TYPE_G_SUMMARY', 'eu', 'DB_URL_TYPE', 'Kodea Github-n.', null);
+INSERT INTO text VALUES ('URL_TYPE_M',         'es', 'DB_URL_TYPE', 'Ver', null);
+INSERT INTO text VALUES ('URL_TYPE_M',         'en', 'DB_URL_TYPE', 'See', null);
+INSERT INTO text VALUES ('URL_TYPE_M',         'eu', 'DB_URL_TYPE', 'Ikusi', null);
+INSERT INTO text VALUES ('URL_TYPE_M_SUMMARY', 'es', 'DB_URL_TYPE', 'Ver', null);
+INSERT INTO text VALUES ('URL_TYPE_M_SUMMARY', 'en', 'DB_URL_TYPE', 'See', null);
+INSERT INTO text VALUES ('URL_TYPE_M_SUMMARY', 'eu', 'DB_URL_TYPE', 'Ikusi', null);
+INSERT INTO project_url_type VALUES ('E', null, null, null);
+INSERT INTO project_url_type VALUES ('W', 'URL_TYPE_W', 'URL_TYPE_W_SUMMARY', 'web.png');
+INSERT INTO project_url_type VALUES ('P', 'URL_TYPE_P', 'URL_TYPE_P_SUMMARY', 'googleplay.png');
+INSERT INTO project_url_type VALUES ('A', 'URL_TYPE_A', 'URL_TYPE_A_SUMMARY', 'appstore.png');
+INSERT INTO project_url_type VALUES ('G', 'URL_TYPE_G', 'URL_TYPE_G_SUMMARY', 'github.png');
+INSERT INTO project_url_type VALUES ('M', 'URL_TYPE_M', 'URL_TYPE_M_SUMMARY', 'misc.png');
+
+
+-- TABLE project_version_type
+INSERT INTO text VALUES ('VERSION_TYPE_ALPHA',         'es', 'VERSION_TYPE', 'Alfa', null);
+INSERT INTO text VALUES ('VERSION_TYPE_ALPHA',         'en', 'VERSION_TYPE', 'Alpha', null);
+INSERT INTO text VALUES ('VERSION_TYPE_ALPHA',         'eu', 'VERSION_TYPE', 'Alpha', null);
+INSERT INTO text VALUES ('VERSION_TYPE_ALPHA_SUMMARY', 'es', 'VERSION_TYPE', 'En sesarrollo. Inestable.', null);
+INSERT INTO text VALUES ('VERSION_TYPE_ALPHA_SUMMARY', 'en', 'VERSION_TYPE', 'In development. Unstable.', null);
+INSERT INTO text VALUES ('VERSION_TYPE_ALPHA_SUMMARY', 'eu', 'VERSION_TYPE', 'En desarrollo. Inestable', null);
+INSERT INTO text VALUES ('VERSION_TYPE_BETA',          'es', 'VERSION_TYPE', 'Beta', null);
+INSERT INTO text VALUES ('VERSION_TYPE_BETA',          'en', 'VERSION_TYPE', 'Beta', null);
+INSERT INTO text VALUES ('VERSION_TYPE_BETA',          'eu', 'VERSION_TYPE', 'Beta', null);
+INSERT INTO text VALUES ('VERSION_TYPE_BETA_SUMMARY',  'es', 'VERSION_TYPE', 'En pruebas. Parcialmente estable.', null);
+INSERT INTO text VALUES ('VERSION_TYPE_BETA_SUMMARY',  'en', 'VERSION_TYPE', 'Under testing. Stability not guaranteed.', null);
+INSERT INTO text VALUES ('VERSION_TYPE_BETA_SUMMARY',  'eu', 'VERSION_TYPE', 'En pruebas. Parcialmente estable.', null);
+INSERT INTO text VALUES ('VERSION_TYPE_PRO',           'es', 'VERSION_TYPE', 'Estable', null);
+INSERT INTO text VALUES ('VERSION_TYPE_PRO',           'en', 'VERSION_TYPE', 'Stable', null);
+INSERT INTO text VALUES ('VERSION_TYPE_PRO',           'eu', 'VERSION_TYPE', 'Estable', null);
+INSERT INTO text VALUES ('VERSION_TYPE_PRO_SUMMARY',   'es', 'VERSION_TYPE', 'Listo para uso en entorno de producción.', null);
+INSERT INTO text VALUES ('VERSION_TYPE_PRO_SUMMARY',   'en', 'VERSION_TYPE', 'Ready for production.', null);
+INSERT INTO text VALUES ('VERSION_TYPE_PRO_SUMMARY',   'eu', 'VERSION_TYPE', 'Listo para uso en entorno de producción.', null);
+INSERT INTO project_version_type VALUES ('A', 'VERSION_TYPE_ALPHA', 'VERSION_TYPE_ALPHA_SUMMARY', '#ff0000');
+INSERT INTO project_version_type VALUES ('B', 'VERSION_TYPE_BETA',  'VERSION_TYPE_BETA_SUMMARY',  '#ffaa00');
+INSERT INTO project_version_type VALUES ('P', 'VERSION_TYPE_PRO',   'VERSION_TYPE_PRO_SUMMARY',   '#00ff00');
+
+
+-- TABLE license
+INSERT INTO text VALUES ('LICENSE_CC-BY-SA_SUMMARY', 'es', 'LICENSE', null, 'LICENSE_CC-BY-SA_SUMMARY__ES');
+INSERT INTO text VALUES ('LICENSE_CC-BY-SA_SUMMARY', 'en', 'LICENSE', null, 'LICENSE_CC-BY-SA_SUMMARY__EN');
+INSERT INTO text VALUES ('LICENSE_CC-BY-SA_SUMMARY', 'eu', 'LICENSE', null, 'LICENSE_CC-BY-SA_SUMMARY__EU');
+INSERT INTO text VALUES ('LICENSE_CC-BY-SA',         'es', 'LICENSE', null, 'LICENSE_CC-BY-SA__ES');
+INSERT INTO text VALUES ('LICENSE_CC-BY-SA',         'en', 'LICENSE', null, 'LICENSE_CC-BY-SA__EN');
+INSERT INTO text VALUES ('LICENSE_CC-BY-SA',         'eu', 'LICENSE', null, 'LICENSE_CC-BY-SA__EU');
+INSERT INTO text VALUES ('LICENSE_GPLV3_SUMMARY',    'es', 'LICENSE', null, 'LICENSE_GPLV3_SUMMARY__ES');
+INSERT INTO text VALUES ('LICENSE_GPLV3_SUMMARY',    'en', 'LICENSE', null, 'LICENSE_GPLV3_SUMMARY__EN');
+INSERT INTO text VALUES ('LICENSE_GPLV3_SUMMARY',    'eu', 'LICENSE', null, 'LICENSE_GPLV3_SUMMARY__EU');
+INSERT INTO text VALUES ('LICENSE_GPLV3',            'es', 'LICENSE', null, 'LICENSE_GPLV3__ES');
+INSERT INTO text VALUES ('LICENSE_GPLV3',            'en', 'LICENSE', null, 'LICENSE_GPLV3__EN');
+INSERT INTO text VALUES ('LICENSE_GPLV3',            'eu', 'LICENSE', null, 'LICENSE_GPLV3__EU');
+INSERT INTO license VALUES ('CC-BY-SA', 'LICENSE_CC-BY-SA_SUMMARY', 'LICENSE_CC-BY-SA', 'CC-BY-SA.png', 'CC-BY-SA.png');
+INSERT INTO license VALUES ('GPLv3',    'LICENSE_GPLV3_SUMMARY',    'LICENSE_GPLV3',    'GPLV3.png',    'GPLV3.png');
+
+
+-- TABLE cv_category
+INSERT INTO text VALUES ('CV_CATEGORY_WORK',             'es', 'DB_CV', 'Experiencia', null);
+INSERT INTO text VALUES ('CV_CATEGORY_WORK',             'en', 'DB_CV', 'Experience', null);
+INSERT INTO text VALUES ('CV_CATEGORY_WORK',             'eu', 'DB_CV', 'Experiencia', null);
+INSERT INTO text VALUES ('CV_CATEGORY_EDUCATION',        'es', 'DB_CV', 'Formación', null);
+INSERT INTO text VALUES ('CV_CATEGORY_EDUCATION',        'en', 'DB_CV', 'Hezkuntza', null);
+INSERT INTO text VALUES ('CV_CATEGORY_EDUCATION',        'eu', 'DB_CV', 'Education', null);
+INSERT INTO text VALUES ('CV_CATEGORY_PROJECTS',         'es', 'DB_CV', 'Otros proyectos', null);
+INSERT INTO text VALUES ('CV_CATEGORY_PROJECTS',         'en', 'DB_CV', 'Other projects', null);
+INSERT INTO text VALUES ('CV_CATEGORY_PROJECTS',         'eu', 'DB_CV', 'Beste projecktuak', null);
+INSERT INTO text VALUES ('CV_CATEGORY_PROJECTS_SUMMARY', 'es', 'DB_CV', 'Proyectos de software eralizados por cuenta propia', null);
+INSERT INTO text VALUES ('CV_CATEGORY_PROJECTS_SUMMARY', 'en', 'DB_CV', 'Proyectos de software eralizados por cuenta propia', null);
+INSERT INTO text VALUES ('CV_CATEGORY_PROJECTS_SUMMARY', 'eu', 'DB_CV', 'Proyectos de software eralizados por cuenta propia', null);
+INSERT INTO text VALUES ('CV_CATEGORY_OTHER',            'es', 'DB_CV', 'Otra experiencia laboral', null);
+INSERT INTO text VALUES ('CV_CATEGORY_OTHER',            'en', 'DB_CV', 'Otra experiencia laboral', null);
+INSERT INTO text VALUES ('CV_CATEGORY_OTHER',            'eu', 'DB_CV', 'Otra experiencia laboral', null);
+INSERT INTO text VALUES ('CV_CATEGORY_OTHER_SUMMARY',    'es', 'DB_CV', 'Experiencia laboral fuera del ámbito de IT', null);
+INSERT INTO text VALUES ('CV_CATEGORY_OTHER_SUMMARY',    'en', 'DB_CV', 'Experiencia laboral fuera del ámbito de IT', null);
+INSERT INTO text VALUES ('CV_CATEGORY_OTHER_SUMMARY',    'eu', 'DB_CV', 'Experiencia laboral fuera del ámbito de IT', null);
+INSERT INTO cv_category VALUES (1, 'CV_CATEGORY_WORK',      null,                          1 , 1);
+INSERT INTO cv_category VALUES (2, 'CV_CATEGORY_EDUCATION', null,                          1 , 3);
+INSERT INTO cv_category VALUES (3, 'CV_CATEGORY_PROJECTS', 'CV_CATEGORY_PROJECTS_SUMMARY', 0 , 2);
+INSERT INTO cv_category VALUES (4, 'CV_CATEGORY_OTHER',    'CV_CATEGORY_OTHER_SUMMARY',    1 , 4);
+
+
+-- ADD MORE ROWS AS YOU SEE FIT:

+ 7 - 0
sql/README.md

@@ -0,0 +1,7 @@
+To create de database:
+
+1) Edit the file 01_STRUCTURE.SQL. Replace both passwords with two of your own. Uncomment all GRANT entries.
+
+2) Modify the file 02_DATA.SQL at will to fit your needs.
+
+3) Run the __SETUP.SQL script.

+ 8 - 0
sql/__SETUP.SQL

@@ -0,0 +1,8 @@
+-- DB structure.
+SOURCE 00_STRUCTURE.SQL;
+
+-- DB permissions. Entries are commented by default.
+SOURCE 01_PERMISSIONS.SQL;
+
+-- Initial data.
+SOURCE 02_DATA.SQL;

+ 0 - 17
sql/dbusers-example.sql

@@ -1,17 +0,0 @@
--- Replace all instances of  XXX with the external site db password
-GRANT SELECT ON iv.lang TO 'ivext'@'localhost' IDENTIFIED BY 'XXX';
-GRANT SELECT ON iv.text TO 'ivext'@'localhost' IDENTIFIED BY 'XXX';
-GRANT SELECT ON iv.user TO 'ivext'@'localhost' IDENTIFIED BY 'XXX';
-GRANT SELECT ON iv.post TO 'ivext'@'localhost' IDENTIFIED BY 'XXX';
-GRANT SELECT ON iv.post_tag TO 'ivext'@'localhost' IDENTIFIED BY 'XXX';
-GRANT SELECT ON iv.post_image TO 'ivext'@'localhost' IDENTIFIED BY 'XXX';
-GRANT SELECT, INSERT ON iv.post_comment TO 'ivext'@'localhost' IDENTIFIED BY 'XXX';
-GRANT SELECT ON iv.project TO 'ivext'@'localhost' IDENTIFIED BY 'XXX';
-GRANT SELECT ON iv.project_url TO 'ivext'@'localhost' IDENTIFIED BY 'XXX';
-GRANT SELECT ON iv.project_image TO 'ivext'@'localhost' IDENTIFIED BY 'XXX';
-GRANT SELECT ON iv.project_tag 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';
-
---Replace YYY with the internal site db password
-GRANT SELECT, INSERT, DELETE, UPDATE, SHOW VIEW ON iv.* TO 'ivint'@'localhost' IDENTIFIED BY 'YYY';

+ 0 - 30
sql/text.sql

@@ -1,30 +0,0 @@
--- AVAILABLE LANGUAGES
-INSERT INTO lang VALUES ('es', 'Castellano', '1');
-INSERT INTO lang VALUES ('en', 'English', '1');
-INSERT INTO lang VALUES ('eu', 'Euskara', '1');
-
--- HEADER
-INSERT INTO text VALUES ('HEADER_HOME',     'es', 'HEADER', 'Inicio');
-INSERT INTO text VALUES ('HEADER_ME',       'es', 'HEADER', 'Yo');
-INSERT INTO text VALUES ('HEADER_PROJECTS', 'es', 'HEADER', 'Proyectos');
-INSERT INTO text VALUES ('HEADER_BLOG',     'es', 'HEADER', 'Blog');
-INSERT INTO text VALUES ('HEADER_HOME',     'en', 'HEADER', 'Home');
-INSERT INTO text VALUES ('HEADER_ME',       'en', 'HEADER', 'Me');
-INSERT INTO text VALUES ('HEADER_PROJECTS', 'en', 'HEADER', 'Projects');
-INSERT INTO text VALUES ('HEADER_BLOG',     'en', 'HEADER', 'Blog');
-INSERT INTO text VALUES ('HEADER_HOME',     'eu', 'HEADER', 'Hasiera');
-INSERT INTO text VALUES ('HEADER_ME',       'eu', 'HEADER', 'Ni');
-INSERT INTO text VALUES ('HEADER_PROJECTS', 'eu', 'HEADER', 'Proiektuak');
-INSERT INTO text VALUES ('HEADER_BLOG',     'eu', 'HEADER', 'Blog');
-
-
--- FOOTER
-INSERT INTO text VALUES ('FOOTER_FOLLOW', 'es', 'FOOTER', 'Sígueme');
-INSERT INTO text VALUES ('FOOTER_COPY',   'es', 'FOOTER', 'Copyright Iñigo Valentin 2014 - 2017');
-INSERT INTO text VALUES ('FOOTER_HELP',   'es', 'FOOTER', 'Ayuda');
-INSERT INTO text VALUES ('FOOTER_FOLLOW', 'en', 'FOOTER', 'Follow me');
-INSERT INTO text VALUES ('FOOTER_COPY',   'en', 'FOOTER', 'Copyright Iñigo Valentin 2014 - 2017');
-INSERT INTO text VALUES ('FOOTER_HELP',   'en', 'FOOTER', 'Help');
-INSERT INTO text VALUES ('FOOTER_FOLLOW', 'eu', 'FOOTER', 'Jarraitu');
-INSERT INTO text VALUES ('FOOTER_COPY',   'eu', 'FOOTER', 'Copyright Iñigo Valentin 2014 - 2017');
-INSERT INTO text VALUES ('FOOTER_HELP',   'eu', 'FOOTER', 'Laguntza');

+ 24 - 0
utils/imagescaler

@@ -0,0 +1,24 @@
+#!/bin/bash
+for folder in www/img/*; do
+	if [[ -d $folder ]]; then
+		for file in $folder/*; do
+			if [[ -f $file ]]; then
+				echo $file;
+				for i in {1..32}; do
+					if [ -d $folder/x$i ]; then
+						d=$((i*33))
+						convert "$file" -resize ${d}x${d}  $folder/x$i/${file:${#folder}+1:100}
+					fi
+				done
+			fi
+		done
+	fi
+done;
+
+#for file in *.jpg;do
+#    convert "$file" -resize 800x800  "view/$file"
+#    convert "$file" -resize 600x600  "preview/$file"
+#    convert "$file" -resize 340x340  "miniature/$file"
+#    convert "$file" -resize 180x180  "thumb/$file"
+#done
+

+ 125 - 0
www/.htaccess

@@ -0,0 +1,125 @@
+Options -MultiViews
+
+
+
+#
+# REWRITE
+#
+# Used to: create nice urls, force https, and hav the site multilanguage.
+#
+<IfModule mod_rewrite.c>
+	RewriteEngine On
+	RewriteBase /
+
+	# Force https
+	RewriteCond %{HTTPS} !=on
+	RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
+
+	# Add final slash.
+	RewriteRule ^([a-zA-Z]{2})$ $1/ [R=301]
+
+	# For files, remove the last /
+	RewriteCond %{REQUEST_URI} ^/([a-zA-Z]{2}/)?(.{3,})/$
+	RewriteCond %{DOCUMENT_ROOT}/%2 !-d
+	RewriteCond %{REQUEST_URI} /$
+	RewriteRule ^(.{3,})/$ $1 [R=301]
+
+	# For sections, add the last /
+	RewriteCond %{REQUEST_URI} ^/([a-zA-Z]{2}/)?(.{3,})$
+	RewriteCond %{DOCUMENT_ROOT}/%2 -d
+	RewriteCond %{REQUEST_URI} !/$
+	RewriteRule ^(.{3,})$ $1/ [R=301]
+
+	# Hide the 'index.php'
+	RewriteRule ^(.*)index\.php?$ $1 [L,R=301]
+
+	# Remove page extensions
+	RewriteCond %{THE_REQUEST} ^GET\ (.*)\.(php|html)([#?][^\ ]*)?\ HTTP
+	RewriteRule ^(.*)\.(php|html)$ $1 [R=301]
+
+	# Redirect permalinks.
+        RewriteRule ^project/([A-Z\-a-z0-9]{3,}+)[\/]?$ /project/project.php?permalink=$1 [NC]
+        RewriteRule ^blog/([A-Z\-a-z0-9]{3,}+)[\/]?$ /blog/post.php?permalink=$1 [NC]
+        RewriteRule ^help[\/]?$ /help/index.php [NC]
+        RewriteRule ^(perfil|xprofile|profila)[\/]?$ /profile/index.php [NC]
+
+        # PHP to xml.
+        RewriteRule ^sitemap.xml$ /sitemap.php [NC]
+        RewriteRule ^imgmap.xml$ /sitemap-image.php [NC]
+        RewriteRule ^rss.xml$ /rss.php
+
+	# Language as GET param.
+	RewriteCond %{REQUEST_FILENAME} !-d
+	RewriteCond %{REQUEST_FILENAME} !-f
+	RewriteCond %{REQUEST_URI} ^/([a-zA-Z]{2})(/(.*))?$
+	RewriteRule ^([a-zA-Z]{2})(/(.*))?$ $3?lang=$1 [L,QSA]
+
+	# Add .php extension when needed. TODO: Actualy used?
+	RewriteCond %{REQUEST_FILENAME} !-d
+	RewriteCond %{REQUEST_FILENAME} !-f
+	RewriteCond %{REQUEST_FILENAME}.php -f
+	RewriteRule ^(.*)$ $1\.php [L]
+
+</ifModule>
+
+
+#
+# EXPIRES
+#
+# Used to: control the cache times of the different files on the server.
+#
+<IfModule mod_expires.c>
+        ExpiresActive on
+	ExpiresDefault "access plus 2 days"
+        ExpiresByType application/javascript "access plus 6 days"
+        ExpiresByType image/x-ico "access plus 12 days"
+        ExpiresByType image/jpg "access plus 12 days"
+        ExpiresByType image/jpeg "access plus 12 days"
+        ExpiresByType image/gif "access plus 12 days"
+        ExpiresByType image/png "access plus 12 days"
+        ExpiresByType video/mkv "access plus 12 days"
+        ExpiresByType text/css "access plus 6 days"
+        ExpiresByType text/plain "access plus 6 days"
+</IfModule>
+
+
+#
+# HEADERS
+#
+# Used to: control the cache times of the different files on the client.
+#
+<ifModule mod_headers.c>
+	<filesMatch "\.(ico|jpe?g|png|gif|swf)$">
+		Header set Cache-Control "max-age=864000, public, must-revalidate"
+	</filesMatch>
+	<filesMatch "\.(css)$">
+		Header set Cache-Control "max-age=864000, public, must-revalidate"
+	</filesMatch>
+	<filesMatch "\.(js)$">
+		Header set Cache-Control "max-age=864000, private, must-revalidate"
+	</filesMatch>
+	<filesMatch "\.(x?html?|php)$">
+		Header set Cache-Control "max-age=86400, private, must-revalidate"
+	</filesMatch>
+</ifModule>
+
+<ifModule mod_deflate.c>
+	AddOutputFilterByType DEFLATE text/html text/xml text/css text/plain
+	AddOutputFilterByType DEFLATE image/x-icon
+	AddOutputFilterByType DEFLATE image/svg+xml application/xhtml+xml application/xml
+	AddOutputFilterByType DEFLATE application/rdf+xml application/rss+xml application/atom+xml
+	AddOutputFilterByType DEFLATE text/javascript application/javascript application/x-javascript application/json
+	AddOutputFilterByType DEFLATE application/x-font-ttf application/x-font-otf
+	AddOutputFilterByType DEFLATE font/truetype font/opentype
+</ifModule>
+
+#
+# ERROR
+#
+# Used to: redirect to nice error pages.
+#
+ErrorDocument 403 /error/403.php
+ErrorDocument 404 /error/404.php
+ErrorDocument 500 /error/500.php
+
+

+ 152 - 20
www/blog/index.php

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

+ 8 - 7
www/blog/post.php

@@ -1,12 +1,13 @@
 <?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();
+    $lserver = $server . "/" . $lang;
     $cur_section = "";
     $cur_entry = "";
 ?>
@@ -17,7 +18,7 @@
         <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>
-        <link rel='shortcut icon' href='<?=$server?>/img/logo/favicon.ico'/>
+        <link rel='shortcut icon' href='<?=$lserver?>/img/logo/favicon.ico'/>
         <!-- CSS files -->
         <style>
 <?php
@@ -39,12 +40,12 @@
 ?>
         </script>
         <!-- Meta tags -->
-        <link rel='canonical' href='<?=$server?>'/>
-        <link rel='author' href='<?=$server?>'/>
-        <link rel='publisher' href='<?=$server?>'/>
+        <link rel='canonical' href='<?=$lserver?>'/>
+        <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='<?=$server?>'/>
+        <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'/>
@@ -54,7 +55,7 @@
         <meta name='twitter:title' content='I&ntilde;igo Valentin'/>
         <meta name='twitter:description' content=''/>
         <meta name='twitter:image' content=''/>
-        <meta name='twitter:url' content='<?=$server?>'/>
+        <meta name='twitter:url' content='<?=$lserver?>'/>
         <meta name='robots' content='index follow'/>
     </head>
     <body>

+ 0 - 72
www/contact/index.php

@@ -1,72 +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();
-    $cur_section = "";
-    $cur_entry = "";
-?>
-<!DOCTYPE html>
-<html>
-    <head>
-        <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>
-        <link rel='shortcut icon' href='<?=$server?>/img/logo/favicon.ico'/>
-        <!-- CSS files -->
-        <style>
-<?php
-            include $doc_root . "css/ui.css";
-            include $doc_root . "css/home.css";
-?>
-        </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";
-?>
-        </style>
-        <!-- Script files -->
-        <script type='text/javascript'>
-<?php
-            include $doc_root . "script/ui.js";
-?>
-        </script>
-        <!-- Meta tags -->
-        <link rel='canonical' href='<?=$server?>'/>
-        <link rel='author' href='<?=$server?>'/>
-        <link rel='publisher' href='<?=$server?>'/>
-        <meta name='description' content=''/>
-        <meta property='og:title' content='I&ntilde;igo Valentin'/>
-        <meta property='og:url' content='<?=$server?>'/>
-        <meta property='og:description' content=''/>
-        <meta property='og:image' content=''/>
-        <meta property='og:site_name' content='I&ntilde;igo Valentin'/>
-        <meta property='og:type' content='website'/>
-        <meta property='og:locale' content='<?=$lang?>'/>
-        <meta name='twitter:card' content='summary'/>
-        <meta name='twitter:title' content='I&ntilde;igo Valentin'/>
-        <meta name='twitter:description' content=''/>
-        <meta name='twitter:image' content=''/>
-        <meta name='twitter:url' content='<?=$server?>'/>
-        <meta name='robots' content='index follow'/>
-    </head>
-    <body>
-<?php
-        include $doc_root . "header.php";
-?>
-        <div id='content'>
-
-        </div> <!-- #content -->
-<?php
-        include $doc_root . "footer.php";
-        stats($con, $cur_section, $cur_entry);
-?>
-    </body>
-</html>

+ 67 - 0
www/css/blog.css

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

+ 22 - 0
www/css/home.css

@@ -6,3 +6,25 @@ div#logo{
 div#logo img{
     max-height: 7em;
 }
+
+div#content{
+    display: table;
+}
+
+div#content div#content_row{
+    display: table-row;
+}
+
+div#content div#content_row div.content_cell{
+    display: table-cell;
+    vertical-align: top;
+    margin:1em;
+}
+
+div#content div#content_row div#content_cell_profile{
+    width: 30%;
+}
+
+div#content div#content_row div#content_cell_content{
+    width: 70%;
+}

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


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


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


+ 16 - 0
www/css/profile.css

@@ -0,0 +1,16 @@
+div.cv_entry{
+    
+}
+
+div.role{
+    border-radius: 0.3em;
+    border-left: 0.1em solid #000000;
+    padding: 0.5em;
+}
+
+div.role h4{
+}
+
+div.role h5{
+    font-style: italic;
+}

+ 111 - 0
www/css/project.css

@@ -0,0 +1,111 @@
+/* Common elements */
+span.version_type{
+    padding: 0.05em;
+    border 0.1em solid #444444;
+    border-radius: 0.2em;
+}
+
+
+/* Projects main page */
+div#right_column div#advanced_search{
+    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#content_cell_main{
+    width: 80%;
+}
+
+div#content_cell_right{
+    width: 20%;
+}
+
+div#main_column{
+    padding: 1em;
+}
+
+div#main_column div.iframe_container{
+    width: 100%;
+    text-align: center;
+}
+
+div#main_column iframe.project_embed{
+    background-color: #ffffff;
+    border-radius: 0.8em;
+    border: 0.1em solid #110022;
+    max-width: 90%;
+    max-height: 70em;
+}
+
+div#right_column{
+    padding: 1em;
+    transition: all .3s ease-in-out;
+}
+
+div#right_column div.url{
+    vertical-align: middle;
+}
+
+div#right_column div.url img{
+    width: 2em;
+    height: 2em;
+    vertical-align: middle;
+}
+
+div#right_column img#img_license{
+    max-height: 1.3em;
+}
+
+div#license{
+    display: none;
+    opacity: 0;
+    position: fixed;
+    transition: opacity .4s ease-in-out;
+    top: 3em;
+    left: 5em;
+    right: 5em;
+    bottom: 2em;
+}
+
+div#license h3 img.pointer{ /* Close icon*/
+    float: right;
+    height: 0.5em;
+    width: 0.5em;
+    margin-right: 1.2em;
+    margin-top: 0.2em;
+}
+
+div#license div.entry{
+    height: 30%;
+    margin: 0 0.5em 0.5em 0.5em;
+    overflow-y: scroll;
+}
+
+div#license div.entry h4{
+    margin: 0;
+}
+
+div#license div.entry div.license_text{
+    margin: 0;
+    
+}
+
+

+ 59 - 29
www/css/ui.css

@@ -2,7 +2,7 @@
  * Fonts used across the page     *
  **********************************/
 
-/* Font used for inputs */
+/* Font */
 @font-face {
     font-family: 'Nunito'; 
     src:  url('/fonts/Nunito-Regular.ttf'); 
@@ -27,10 +27,37 @@ a{
 }
 
 /* Elements fith bold font */
-span.bold{
+.bold{
     font-weight: bold;
 }
 
+.pointer {
+    cursor: pointer;
+}
+
+/* Hidden elements */
+.hidden{
+    display: none;
+}
+
+img.slider{
+    width: 1em;
+    height: 1em;
+    vertial-align: middle;
+    transition: all .3s ease-in-out;
+}
+
+div#cover{
+    display: none;
+    background-color: #000000bb;
+    opacity: 0;
+    transition: opacity .3s ease-in-out;
+    position: fixed;
+    top: 0;
+    left: 0;
+    right: 0;
+    bottom: 0;
+}
 
 
 /**********************************
@@ -55,7 +82,7 @@ nav#header{
     font-size: 110%;
 }
 
-/* Dummy <span> to use as vertical separator between links */
+/* Dummy span to use as vertical separator between links */
 nav#header span.link_separator{
     border-left: 0.077em solid rgba(200, 200, 200, .5);
 }
@@ -207,43 +234,46 @@ div#content{
     margin-bottom: 1.875em;
 }
 
-/* .lighted is a style-only class to make contrast against the dark background */
-.lighted{
+div.section{
+    margin: 0.5em;
     background-color: #898989;
     border: 0.063em solid #77777;
-    border-radius: 0.15em;
-  padding: 0.5em;
+    border-radius: 2.5em 2.5em 1em 1em;
+    padding: 0.2em;
     box-shadow: 0 0 0.75em #888888;
 }
 
-/* Style only class. Is the title of a .lighted element */
-.section_title{
-    font-size: 150%;
-    margin: 0.625em 0 0.438em 0.625em;
-    text-shadow: 0 0 0.75em #dddddd;
+div.section_no_title{
+    border-radius: 1em;
 }
 
-/* Style for the mathces in search results */
-span.result_counter{
-    margin-left: 1.2em;
-    margin-bottom: 0.5em;
+div.section h3.section_title{
     font-weight: bold;
-    font-style: italic;
+    color: #ccddff;
+    width: 100%;
+    text_align: left;
+    padding: 0.2em;
+    margin: 0;
+    text-shadow: 0 0 0.4em #000022;
+    font-size: 200%;
 }
 
 /* .entry is a style only class to show content. Must be allways children os a .lighted element */
-.entry{
-    transition: all .3s ease-in-out;
-    margin: 1% 0.438em 0 0.438em;
-    background-color: #cccccc;
-    border: 0.143em solid #555555;
-    border-radius: 0.314em;
+div.section div.entry{
+    background-color: #eeeeee;
+    border: 0.1em solid #555555;
+    border-radius: 0.6em;
     padding: 0.5em;
-    box-shadow: 0 0 0.5em #333333;
 }
 
-.entry:hover{
-    background-color: #eeeeee;
+
+
+/* Style for the mathces in search results */
+span.result_counter{
+    margin-left: 1.2em;
+    margin-bottom: 0.5em;
+    font-weight: bold;
+    font-style: italic;
 }
 
 /* Shown when no records on database */
@@ -530,7 +560,7 @@ table#pager td.pager_current{
     border: 0.077em solid #444444;
 }
 
-/* Dummy <td> that contains "..." */
+/* Dummy td that contains "..." */
 table#pager td.pager_ellipse{
     background-color: initial;
     border: initial;
@@ -559,7 +589,7 @@ span#span_download{
     display: none;
 }
 
-/* Hidden <div> to confirm downloading */
+/* Hidden div to confirm downloading */
 div.license{
     box-shadow: 0 0 1.2em rgba(120, 120, 120, 1);
     display: none;
@@ -575,7 +605,7 @@ div.license{
     border-radius: 1.250em;
 }
 
-/* <div> to dimm the screen */
+/* div to dimm the screen */
 #screen_cover{
     position: fixed;
     top: 0;

+ 0 - 72
www/cv/index.php

@@ -1,72 +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();
-    $cur_section = "";
-    $cur_entry = "";
-?>
-<!DOCTYPE html>
-<html>
-    <head>
-        <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>
-        <link rel='shortcut icon' href='<?=$server?>/img/logo/favicon.ico'/>
-        <!-- CSS files -->
-        <style>
-<?php
-            include $doc_root . "css/ui.css";
-            include $doc_root . "css/home.css";
-?>
-        </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";
-?>
-        </style>
-        <!-- Script files -->
-        <script type='text/javascript'>
-<?php
-            include $doc_root . "script/ui.js";
-?>
-        </script>
-        <!-- Meta tags -->
-        <link rel='canonical' href='<?=$server?>'/>
-        <link rel='author' href='<?=$server?>'/>
-        <link rel='publisher' href='<?=$server?>'/>
-        <meta name='description' content=''/>
-        <meta property='og:title' content='I&ntilde;igo Valentin'/>
-        <meta property='og:url' content='<?=$server?>'/>
-        <meta property='og:description' content=''/>
-        <meta property='og:image' content=''/>
-        <meta property='og:site_name' content='I&ntilde;igo Valentin'/>
-        <meta property='og:type' content='website'/>
-        <meta property='og:locale' content='<?=$lang?>'/>
-        <meta name='twitter:card' content='summary'/>
-        <meta name='twitter:title' content='I&ntilde;igo Valentin'/>
-        <meta name='twitter:description' content=''/>
-        <meta name='twitter:image' content=''/>
-        <meta name='twitter:url' content='<?=$server?>'/>
-        <meta name='robots' content='index follow'/>
-    </head>
-    <body>
-<?php
-        include $doc_root . "header.php";
-?>
-        <div id='content'>
-
-        </div> <!-- #content -->
-<?php
-        include $doc_root . "footer.php";
-        stats($con, $cur_section, $cur_entry);
-?>
-    </body>
-</html>

+ 101 - 0
www/error/403.php

@@ -0,0 +1,101 @@
+<?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>

+ 101 - 0
www/error/404.php

@@ -0,0 +1,101 @@
+<?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>

+ 101 - 0
www/error/500.php

@@ -0,0 +1,101 @@
+<?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>

+ 11 - 7
www/footer.php

@@ -4,21 +4,25 @@
         <tr>
             <td id='footer_left'>
                 <span id='footer_follow' class='desktop'><?=text($con, "FOOTER_FOLLOW", $lang);?></span>
-                <a title='Github' href='https://www.github.com/u/Seavenois'><img class='footer_social_icon' src='<?=$server?>/img/social/github.gif' alt='Github'/></a>
-                <a title='Facebook' href='https://www.facebook.com/ivalentin'><img class='footer_social_icon' src='<?=$server?>/img/social/facebook.gif' alt='Facebook'/></a>
-                <a title='Google+' href='https://plus.google.com/108048773942421710294/'><img class='footer_social_icon' src='<?=$server?>/img/social/googleplus.gif' alt='Google+'/></a>
-                <a title='RSS' href='<?=$server?>/feed/'><img class='footer_social_icon' src='<?=$server?>/img/social/rss.gif' alt='RSS'/></a>
+                <a title='Github' href='https://www.github.com/u/Seavenois'><img class='footer_social_icon' src='<?=$lserver?>/img/social/github.gif' alt='Github'/></a>
+                <a title='Facebook' href='https://www.facebook.com/ivalentin'><img class='footer_social_icon' src='<?=$lserver?>/img/social/facebook.gif' alt='Facebook'/></a>
+                <a title='Google+' href='https://plus.google.com/108048773942421710294/'><img class='footer_social_icon' src='<?=$lserver?>/img/social/googleplus.gif' alt='Google+'/></a>
+                <a title='RSS' href='<?=$lserver?>/feed/'><img class='footer_social_icon' src='<?=$lserver?>/img/social/rss.gif' alt='RSS'/></a>
             </td>
             <td id='footer_center'><?=text($con, "FOOTER_COPY", $lang);?></td>
             <td id='footer_right'>
-                <a href='<?=$server?>/help/'><?=text($con, "FOOTER_HELP", $lang);?></a>
+                <a href='<?=$lserver?>/help/'><?=text($con, "FOOTER_HELP", $lang);?></a>
                 <br/><br/>
 <?php
                 $q_lang = mysqli_query($con, "SELECT * FROM lang WHERE active = 1;");
                 while ($r = mysqli_fetch_array($q_lang)){
-                    // TODO: href
+                    $uri = $_SERVER["REQUEST_URI"];
+                    if (substr($uri, 3, 1) == '/'){
+                        $uri = substr($uri, 3);
+                    }
+                    $dest = $server . "/" . $r["code"] . $uri;
 ?>
-                    <a class='lang' href='#'><img src='<?=$server?>/img/lang/<?=$r["code"]?>.gif' alt='<?=$r['name']?>' /></a>
+                    <a class='lang' href='<?=$dest?>'><img src='<?=$lserver?>/img/lang/<?=$r["code"]?>.gif' alt='<?=$r['name']?>' /></a>
 <?php
                 }
 ?>

+ 43 - 20
www/functions.php

@@ -66,29 +66,46 @@
      *****************************************************/
     // TODO: Redo using database
     function select_language(){
-        //Try to read cookie.
-        header("Cache-control: private");
-        if (isSet($_COOKIE["lang"])){
-            $lang = $_COOKIE["lang"];
+
+        // Check for language in uri
+        $lang = substr($_SERVER['REQUEST_URI'], 1, 2);
+        if ($lang == "es" || $lang == "en" || $lang == "eu"){
+            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"){
+                header("Location: " . get_protocol() . $_SERVER["HTTP_HOST"] . "/" . $lang . $_SERVER["REQUEST_URI"]);
                 return $lang;
             }
-            else{
-                return "es";
-            }
-        }
 
-        //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"){
-                return "es";
+            // Try to read cookie.
+            header("Cache-control: private");
+            if (isSet($_COOKIE["lang"])){
+                $lang = $_COOKIE["lang"];
+                if ($lang == "es" || $lang == "en" || $lang == "eu"){
+                    header("Location: " . get_protocol() . $_SERVER["HTTP_HOST"] . "/" . $lang . $_SERVER["REQUEST_URI"]);
+                    return $lang;
+                }
             }
+
+            //If no cookie, select from client browser preferences.
             else{
-                return $langs[0];
+                $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"){
+                    header("Location: " . get_protocol() . $_SERVER["HTTP_HOST"] . "/" . $lang . $_SERVER["REQUEST_URI"]);
+                    return $lang;
+                }
             }
+
+            // If no method was succesfull, default language
+            $lang = "es";
+            header("Location: " . get_protocol() . $_SERVER["HTTP_HOST"] . "/" . $lang . $_SERVER["REQUEST_URI"]);
+            return $lang;
         }
     }
 
@@ -210,7 +227,8 @@
         $str = str_replace(" ", "-", $str);
         return $str;
     }
-    
+
+
     /*****************************************************
      * Retrieves a text fragment from the database.      *
      *                                                   *
@@ -221,9 +239,14 @@
      * @return: (string): Text.                          *
      *****************************************************/
     function text($con, $id, $lang){
-        error_log("SELECT text FROM text WHERE id = '$id' AND lang = '$lang';");
-        $q = mysqli_query($con, "SELECT text FROM text WHERE id = '$id' AND lang = '$lang';");
-        return mysqli_fetch_array($q)["text"];
+        $q = mysqli_query($con, "SELECT text, file FROM text WHERE id = '$id' AND lang = '$lang';");
+        $r = mysqli_fetch_array($q);
+        if (strlen($r["file"]) > 0){
+            return file_get_contents($_SERVER["DOCUMENT_ROOT"] . "string/" . $r["file"]);
+        }
+        else{
+            return $r["text"];
+        }
     }
 
 

+ 9 - 9
www/header.php

@@ -1,29 +1,29 @@
 <div id='header_parent'>
     <nav id='header'>
-        <a href='<?=$server?>/'>
+        <a href='<?=$lserver?>/'>
             <span class='header_container'>
-                <span class='header_icon_container'><img class='header_icon' alt='<?=text($con, "HEADER_HOME", $lang);?>' src='<?=$server?>/img/icon/home.gif'/></span>
+                <span class='header_icon_container'><img class='header_icon' alt='<?=text($con, "HEADER_HOME", $lang);?>' src='<?=$lserver?>/img/icon/home.gif'/></span>
                 <?=text($con, "HEADER_HOME", $lang);?>
             </span>
         </a>
         <span class='link_separator desktop'></span>
-        <a href='<?=$server?>/me/'>
+        <a href='<?=$lserver?>/profile/'>
             <span class='header_container'>
-                <span class='header_icon_container'><img class='header_icon' alt='<?=text($con, "HEADER_ME", $lang);?>' src='<?=$server?>/img/icon/me.gif'/></span>
-                <?=text($con, "HEADER_ME", $lang);?>
+                <span class='header_icon_container'><img class='header_icon' alt='<?=text($con, "HEADER_ME", $lang);?>' src='<?=$lserver?>/img/icon/profile.gif'/></span>
+                <?=text($con, "HEADER_PROFILE", $lang);?>
             </span>
         </a>
         <span class='link_separator desktop'></span>
-        <a href='<?=$server?>/projects/'>
+        <a href='<?=$lserver?>/project/'>
             <span class='header_container'>
-                <span class='header_icon_container'><img class='header_icon' alt='<?=text($con, "HEADER_PROJECTS", $lang);?>' src='<?=$server?>/img/icon/projects.gif'/></span>
+                <span class='header_icon_container'><img class='header_icon' alt='<?=text($con, "HEADER_PROJECTS", $lang);?>' src='<?=$lserver?>/img/icon/project.gif'/></span>
                 <?=text($con, "HEADER_PROJECTS", $lang);?>
             </span>
         </a>
         <span class='link_separator desktop'></span>
-        <a href='<?=$server?>/blog/'>
+        <a href='<?=$lserver?>/blog/'>
             <span class='header_container'>
-                <span class='header_icon_container'><img class='header_icon' alt='<?=text($con, "HEADER_BLOG", $lang);?>' src='<?=$server?>/img/icon/blog.gif'/></span>
+                <span class='header_icon_container'><img class='header_icon' alt='<?=text($con, "HEADER_BLOG", $lang);?>' src='<?=$lserver?>/img/icon/blog.gif'/></span>
                 <?=text($con, "HEADER_BLOG", $lang);?>
             </span>
         </a>

+ 7 - 6
www/help/index.php

@@ -7,6 +7,7 @@
     $con = start_db();
     $server = $proto . $http_host;
     $lang = select_language();
+    $lserver = $server . "/" . $lang;
     $cur_section = "";
     $cur_entry = "";
 ?>
@@ -17,7 +18,7 @@
         <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>
-        <link rel='shortcut icon' href='<?=$server?>/img/logo/favicon.ico'/>
+        <link rel='shortcut icon' href='<?=$lserver?>/img/logo/favicon.ico'/>
         <!-- CSS files -->
         <style>
 <?php
@@ -39,12 +40,12 @@
 ?>
         </script>
         <!-- Meta tags -->
-        <link rel='canonical' href='<?=$server?>'/>
-        <link rel='author' href='<?=$server?>'/>
-        <link rel='publisher' href='<?=$server?>'/>
+        <link rel='canonical' href='<?=$lserver?>'/>
+        <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='<?=$server?>'/>
+        <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'/>
@@ -54,7 +55,7 @@
         <meta name='twitter:title' content='I&ntilde;igo Valentin'/>
         <meta name='twitter:description' content=''/>
         <meta name='twitter:image' content=''/>
-        <meta name='twitter:url' content='<?=$server?>'/>
+        <meta name='twitter:url' content='<?=$lserver?>'/>
         <meta name='robots' content='index follow'/>
     </head>
     <body>

+ 0 - 0
www/img/icon/me.gif → www/img/icon/profile.gif


BIN
www/img/icon/project.gif


BIN
www/img/icon/x1/blog.gif


BIN
www/img/icon/x1/home.gif


BIN
www/img/icon/x1/profile.gif


BIN
www/img/icon/x1/project.gif


BIN
www/img/icon/x1/projects.gif


BIN
www/img/icon/x2/blog.gif


BIN
www/img/icon/x2/home.gif


BIN
www/img/icon/x2/profile.gif


BIN
www/img/icon/x2/project.gif


BIN
www/img/icon/x2/projects.gif


BIN
www/img/icon/x3/blog.gif


BIN
www/img/icon/x3/home.gif


BIN
www/img/icon/x3/profile.gif


BIN
www/img/icon/x3/project.gif


BIN
www/img/icon/x3/projects.gif


BIN
www/img/icon/x4/blog.gif


BIN
www/img/icon/x4/home.gif


BIN
www/img/icon/x4/profile.gif


BIN
www/img/icon/x4/project.gif


BIN
www/img/icon/x4/projects.gif


BIN
www/img/icon/x5/blog.gif


BIN
www/img/icon/x5/home.gif


BIN
www/img/icon/x5/profile.gif


BIN
www/img/icon/x5/project.gif


BIN
www/img/icon/x5/projects.gif


BIN
www/img/icon/x6/blog.gif


BIN
www/img/icon/x6/home.gif


BIN
www/img/icon/x6/profile.gif


BIN
www/img/icon/x6/project.gif


BIN
www/img/icon/x6/projects.gif


BIN
www/img/lang/x1/en.gif


BIN
www/img/lang/x1/es.gif


BIN
www/img/lang/x1/eu.gif


BIN
www/img/lang/x2/en.gif


BIN
www/img/lang/x2/es.gif


BIN
www/img/lang/x2/eu.gif


BIN
www/img/lang/x3/en.gif


BIN
www/img/lang/x3/es.gif


BIN
www/img/lang/x3/eu.gif


BIN
www/img/lang/x4/en.gif


BIN
www/img/lang/x4/es.gif


BIN
www/img/lang/x4/eu.gif


BIN
www/img/lang/x5/en.gif


BIN
www/img/lang/x5/es.gif


BIN
www/img/lang/x5/eu.gif


BIN
www/img/lang/x6/en.gif


BIN
www/img/lang/x6/es.gif


BIN
www/img/lang/x6/eu.gif


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


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


BIN
www/img/license/GPLV3.png


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


Some files were not shown because too many files changed in this diff