Dockerized Loreak Asmatezen

This commit is contained in:
Luca 2022-11-09 19:19:30 +00:00
commit 9eda728c73
1069 changed files with 16636 additions and 0 deletions

43
Dockerfile Normal file
View File

@ -0,0 +1,43 @@
FROM debian:bullseye-slim
ARG PASSWORD
ENV PASSWORD $PASSWORD
RUN echo $PASSWORD
RUN apt update && apt -y upgrade
RUN apt -y install apt-transport-https lsb-release ca-certificates curl gnupg && \
curl https://packages.sury.org/php/apt.gpg | apt-key add - && \
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list && \
apt update
RUN apt install -y \
apache2 libapache2-mod-php5.6 \
php5.6-gd php5.6-curl php5.6-mcrypt php5.6-imagick php5.6-json php5.6-xsl php5.6-mysql php5.6-apcu php5.6-common
RUN a2enmod proxy*
RUN a2enmod rewrite
RUN rm -rf /var/www/html/*
COPY data/ /var/www/html/
RUN sed -i "s/1234567890/$PASSWORD/" /var/www/html/inc/conexion.php
RUN chown -R www-data:www-data /var/www/
#COPY config/default.conf /etc/apache2/sites-available/000-default.conf
#ENTRYPOINT ["/usr/sbin/apache2", "-k", "start"]
#ENV APACHE_RUN_USER www-data
#ENV APACHE_RUN_GROUP www-data
#ENV APACHE_LOG_DIR /var/log/apache2
EXPOSE 80
CMD apachectl -D FOREGROUND

11
README.md Normal file
View File

@ -0,0 +1,11 @@
# Loreak Azmatzen
Zumalakarregi Museoak, CristinaEnea Fundazioarekin eta Bolognako Museo Civico del Risorgimentorekin elkarlanean, ondorengo erakusketa aurkezten du.
Loreak asmatzen: Naturzale europarrak Euskal Herrian. Petit de Meurville Pietro Bubani
Euskal Herrian XIX. mende erdian bi landare zale egokitu ziren. Pietro Bubani, italiar botanikoa, bizitza Piriniotako landareak jaso eta aztertzen eman zuena, gurean 1841 eta 1879 artean zenbait ibilbide egin zituena, beti ere bere herbarioarentzat landareak jasotzeko helburuz. Eta Didier Petit de Meurville, 1857.etik aurrera Frantziako kontsula Donostian, bere zaletasunen artean pintura eta landareekiko maitasuna elkartu zituena, zeinen emaitza Gipuzkoako florari eskainitako hiru album izan ziren.
Bi pertsonaiak denbora eta espazioan batera egokitzeak eta bien landareekiko maitasuna uztartzeak erakusketa hau antolatzeko bidea eman digu. Bertan gure XIX. mendeko flora zientzia eta artearen aldetik aztertzeko beta izan dugu, bidebatez garai hartako gure herriaren egoera aipatu eta Pirinioen inguruan sortutako , bai ikertzeko zein gozatzeko interesaren aipua ere egin dugu.
https://www.loreakazmaten.eus/

877
config/schema.sql Normal file

File diff suppressed because one or more lines are too long

13
data/README Normal file
View File

@ -0,0 +1,13 @@
LOREAK AZMATZEN
Esta página web recoge la coincidencia a mediados del siglo XIX en el País Vasco de dos amantes de las plantas. Pietro Bubani botánico italiano que dedicó su vida a recoger y analizar la flora de los Pirineos, realizando diversos itinerarios por nuestro país entre 1841 y 1879, siempre con el objetivo de recoger plantas para su extraordinario herbario. Y Didier Petit de Meurville, cónsul francés en San Sebastián a partir de 1857, que unía entre sus aficiones la pintura y el amor a las plantas, lo que dio como resultado la elaboración de tres álbumes dedicados a la flora de Gipuzkoa.
La coincidencia de ambos en el tiempo y el espacio unida a su interés por las plantas nos a dado pie a realizar esta exposición y esta web en las que analizamos nuestra flora decimonónica desde los puntos de vista científico y artístico, al tiempo que damos a conocer el contexto histórico y el interés por el estudio y el disfrute de los Pirineos que se desarrollará de manera destacada en esta misma época. Además de la presentación de estos temas centrales en esta web encontrarás diversos materiales complementarios como una base de datos sobre la flora de Gipuzkoa o los trabajos de contextualización histórica sobre Italia en el siglo XIX de Otello Sangiorgi y Fiorenza Tarozzi, del Museo Civico del Risorgimento y la Università degli Studi di Bologna, respectivamente.
MANTAINER
lrullo@audio-lab.org
LICENCE
Creative Common By-SA-NC
COPYRIGHT
Museo Zumalakarregi / Fundación Cristina Enea / Museo Civico del Risorgimento

467
data/css/estilos.css Normal file
View File

@ -0,0 +1,467 @@
@charset "utf-8";
/*-----------------------------------------------------------------------------
Loreak asmatzen: Naturalistas europeos en el País Vasco Style Sheet http://direccion.com
version: 1.0
date: 2009 7 7
author: Overalia
email: masinfo@overalia.com
website: http://www.overalia.com
-----------------------------------------------------------------------------*/
/* ---------------------------------------------------- */
/* Reset
/* ---------------------------------------------------- */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-size: 100%;
vertical-align: baseline;
background: transparent;
}
::selection {background:#26710d;color:#FFFFFF;}
::-moz-selection {background:#26710d;color:#FFFFFF;}
body {
line-height: 1;
font: 12px "Trebuchet MS", sans-serif;
background:#45981c url("../images/bg.png") no-repeat center top;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
/* remember to define focus styles! */
:focus {
outline: 0;
}
/* remember to highlight inserts somehow! */
ins {
text-decoration: none;
}
del {
text-decoration: line-through;
}
/* tables still need 'cellspacing="0"' in the markup */
table {
border-collapse: collapse;
border-spacing: 0;
}
/* ---------------------------------------------------- */
/* Elementos
/* ---------------------------------------------------- */
h1 {
font-size:2em;
text-align:left;
color:#005A00;
padding:0 0 0 0;
margin:10px 0 0 165px;
width:562px;
height:119px;
text-indent:-9999px;
}
h1#eu {background:transparent url("../images/h1_eu.png") no-repeat left top;}
h1#es {background:transparent url("../images/h1_es.png") no-repeat left top;}
h1#it {background:transparent url("../images/h1_it.png") no-repeat left top;}
h2 {
color:#004a00;
font-size:1.7em;
}
h3 {
color:#26710d;
font-size:1.4em;
padding:0.7em 0 0.7em 0;
clear:both;
}
h3.planta {clear:none;}
p {
padding-bottom:0.7em;
}
/* ---------------------------------------------------- */
/* Divs
/* ---------------------------------------------------- */
#mother {
width:994px;
min-height: 1px;
height: auto !important;
height:1px;
margin:0 auto;
}
#container_head {
width:994px;
margin:0 auto;
background:transparent url("../images/shadow.png") repeat-y left top;clear:both;float:left;
}
#container {
width:994px;
min-height: 1px;
height: auto !important;
height:1px;
float:left;
clear:both;
margin:0 auto;
background:transparent url("../images/shadow.png") repeat-y left top;
}
#container_footer {
width:994px;
height:23px;
margin:0 auto;
background:transparent url("../images/shadow-footer.png") no-repeat left top;clear:both;float:left;
}
#wrapper {
width:960px;
min-height:530px;
height:auto;
float:left;
margin:0 0 0 17px;
padding:10px 0 20px 0px;
background:#015a00 url("../images/couple.png") no-repeat left bottom;
}
#cl_left {
width:236px;
min-height: 1px;
height: auto !important;
height:1px;
float:left;
background:transparent url("../images/enredaderas.png") no-repeat 4px top;
position:relative;
left:-20px;
}
#main {
width:715px;
min-height: 1px;
height: auto !important;
height:1px;
float:right;
margin-right:8px;
}
#main_in_top {
background:transparent url("../images/main-in-top.jpg") no-repeat left top;
width:685px;
height:44px;
padding:17px 15px 0 15px;
float:left;
}
#main_in {
background:transparent url("../images/main-in.jpg") repeat-y left top;
width:685px;
min-height: 1px;
height: auto !important;
height:1px;
color:#516844;
padding:0 20px 15px 15px;
float:left;
}
#main_in_bottom {
background:transparent url("../images/main-in-bottom.jpg") no-repeat left top;width:715px;
height:14px;
float:left;
}
/* ---------------------------------------------------- */
/* /inc/header
/* ---------------------------------------------------- */
#header_lv1 {
width:960px;
height:22px;
margin:0 auto;
clear:both;
background-color:#2f7a00;
border-bottom:1px solid #FFF;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:0.9em;
}
ul#menusup {
padding:4px 0 0 0;
float:left;
}
ul#idioma {
padding:4px 9px 0 0;
float:right;
}
ul#menusup li, ul#idioma li{
display:inline;
float:left;
border-right:1px solid #FFF;
margin:0;
padding:0 6px;
color:white;
}
ul#menusup li a, ul#menusup li a:link, ul#menusup li a:active, ul#idioma li a, ul#idioma li a:link, ul#idioma li a:active {color:#FFF;text-decoration:none;}
ul#menusup li a:hover, ul#idioma li a:hover {border-bottom:1px solid #FFF;}
ul#menusup li.no, ul#idioma li.no {border-right:none;}
#header_img1 {
clear:both;
width:960px;
height:155px;
margin:0 auto;
padding-top:10px;
background:transparent url("../images/header_1.jpg") no-repeat left top;
position:relative;
}
/* ---------------------------------------------------- */
/* /inc/footer
/* ---------------------------------------------------- */
#footer {
width:960px;
height:23px;
margin:0 auto;
background-color:#2f7a00;
clear:both;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:0.9em;
}
#footer_txt {
float:left;
padding:4px 0 0 15px;
color:#FFF;
}
Link Visited Hover active
#footer_txt a, #footer_txt a:link, #footer_txt a:visited {color:#FFF;text-decoration:none;}
#footer_txt a:hover, #footer_txt a:active {border-bottom:1px solid #FFF;}
/* ---------------------------------------------------- */
/* Clases
/* ---------------------------------------------------- */
.fleft {float:left;}
.fright {float:right;}
.clear {clear:both;}
.frame {
width:295px;
height:372px;
margin:0 0.5em 0.5em 0;
padding:7px 0 0 8px;
float:left;
background:transparent url("../images/vertical-frame.jpg") no-repeat left top;
}
.frame span {display:block;float:left;margin:1em 0 0 0;}
.frame_bio {
width:267px;
height:253px;
margin:0 0 0.5em 0.5em;
padding:5px 0 0 6px;
float:right;
background:transparent url("../images/frame-bio.jpg") no-repeat left top;
}
/* El dl quedo sin uso */
dl {width:370px;float:right;padding-top:2em;}
dl dt {float:left;width:150px;margin-bottom:0.5em;}
dl dd {float:left;width:220px;margin-bottom:0.5em;}
dl dd.horizon {float:left;clear:left;width:370px;}
dl.std {width:685px;float:none;padding-top:0em;}
dl.std dt {float:left;width:685px;clear:both;margin-bottom:0.3em;}
dl.std dd {float:left;width:685px;margin-bottom:1em;}
dl.std dd p {padding-left:2em;}
.imgl {border:2px solid #26710d;float:left;margin:0 5px 5px 0;}
.imgr {border:2px solid #26710d;float:right;margin:0 0 5px 5px;}
.flash {width:544px;height:420px;margin:1em auto 2em auto;}
.youtube {
width:425px;
height;344px;
margin:1em auto 1em auto;
}
/* ---------------------------------------------------- */
/* Listas
/* ---------------------------------------------------- */
ul.photos {
display:block;
padding-bottom:0.7em;
}
ul.photos li {
width:107px;
height:180px;
float:left;
padding:0 7px 7px 0;
background:transparent url("../images/li_bg.jpg") no-repeat left top;
}
ul.photos li img {
padding:5px 0 0 6px;
}
ul.photos li span {
display:block;
float:left;
margin:10px 0 0 0;
font-size:0.9em;
}
ul.photos2 {
display:block;
padding-bottom:0.7em;
}
ul.photos2 li {
width:208px;
height:81px;
float:left;
padding:0 7px 7px 0;
background:transparent url("../images/frame-h.jpg") no-repeat left top;
}
ul.photos2 li.vertical {
width:96px;
height:132px;
float:left;
padding:0 7px 7px 0;
background:transparent url("../images/frame-v.jpg") no-repeat left top;
}
ul.photos2 li img {
padding:5px 0 0 6px;
}
ul.photos2 li span {
display:block;
float:left;
margin:10px 0 0 0;
font-size:0.9em;
}
.separador {
clear:both;
width:500px;
height:1px;
float:left;
margin:1.5em 0 1.5em 0;
}
/* ---------------------------------------------------- */
/* Menu
/* ---------------------------------------------------- */
ul#menu {margin:0 0 20px 25px;float:left;}
ul#menu li {width:230px;}
ul#menu li a, ul#menu li a:link, ul#menu li a:visited {color:#FFF;text-decoration:none;}
ul#menu li a:hover, ul#menu li a:active {color:#8E1A47;}
ul#menu li a {
font-weight:bold;
width:210px;
height:21px;
display:block;
padding:4px 0 0 20px;
background:transparent url("../images/menu_middle.jpg") no-repeat left top;
}
ul#menu li a:hover {background-position:0 -25px;}
ul#menu li a.top {
height:23px;
padding-top:8px;
background:transparent url("../images/menu_top.jpg") no-repeat left top;
}
ul#menu li a.top:hover {background-position:0 -31px;}
ul#menu li a.bottom{
height:33px;
background:transparent url("../images/menu_bottom.jpg") no-repeat left top;
}
ul#menu li a.bottom:hover {background-position:0 -37px;}
ul#menu li a.big{
height:42px;
background:transparent url("../images/menu_middleg.jpg") no-repeat left top;
}
ul#menu li a.big:hover {background-position:0 -46px;}
ul#menu li a.arriba, ul#menu li a.normal, ul#menu li a.grande, ul#menu li a.abajo {color:#8E1A47;}
ul#menu li .arriba {height:23px;padding-top:8px;background:transparent url("../images/menu_top.jpg") no-repeat left top; background-position:0 -31px;}
ul#menu li a.arriba:hover {height:23px;padding-top:8px;background-position:0 -31px;}
ul#menu li .normal {background-position:0 -25px;}
ul#menu li .grande {height:42px;background:transparent url("../images/menu_middleg.jpg") no-repeat left top;background-position:0 -46px;}
ul#menu li a.grande:hover {background-position:0 -46px;}
ul#menu li .abajo {height:33px;background:transparent url("../images/menu_bottom.jpg") no-repeat left top;background-position:0 -37px;}
ul#menu li a.abajo:hover {background-position:0 -37px;}
ul#menu li ul li a, ul#menu li ul li a.big {
padding-left:40px;
width:190px;
}
ul#menu li ul li ul li a {text-indent:30px;}
ul#menu li ul li a.big {width:180px;padding-right:10px;}
ul.enlaces {margin:2em 0 0 1.5em;}
ul.enlaces {margin:2em 0 0 1.5em;}
ul.enlaces li ul {margin:0 0 0 2em;padding:0.5em 0 0 0;}
ul.detail {margin:1.5em 0 0 1.5em;float:left;}
ul.enlaces li, ul.detail li {list-style-type:square;padding-bottom:0.5em;}
ul.logo{margin:2em 0 0 0em;}
ul.logo li {
float:left;
margin:0 8px 8px 8px;
}
ul#logomenu {
margin:0 0 30px 80px;
}
ul#logomenu li {
width:147px;
}
/* ---------------------------------------------------- */
/* Photos
/* ---------------------------------------------------- */
.description {
width:685px;
float:left;
margin:0 0 2em 0;
clear:both;
background:transparent url("../images/line-h.jpg") no-repeat center bottom;
}
.description p {padding-top:10px;}
.no {background:none;}
.photo_frame {
width:216px;
min-height: 200px;
height: auto !important;
height:200px;
float:left;
background:transparent url("../images/line.jpg") no-repeat right top;
margin:1em 17px 1em 0;
}
.photo_frame3 {
width:216px;
min-height: 200px;
height: auto !important;
height:200px;
float:left;
background:none;
margin:1em 0 1em 0;
}
.photo_framecon {
width:216px;
min-height: 200px;
height: auto !important;
height:200px;
float:left;
clear:both;
background:none;
margin:1em 0 1em 0;
}
.photo_image {
width:198px;
height:117px;
float:left;
background:transparent url("../images/frame_m.jpg") no-repeat left top;
padding:6px 0 0 6px;
}
.photo_frame span, .photo_frame3 span, .photo_framecon span {
display:block;
float:left;
padding-right:10px;
font-size:0.9em;
}
/* ---------------------------------------------------- */
/* Links
/* ---------------------------------------------------- */
#main_in a, #main_in a:link, #main_in a:visited, #main_in a.pdf, #main_in a.pdf:link, #main_in a.pdf:visited {font-weight:bold;color:#26710d;}
#main_in a:hover, #main_in a:active, #main_in a.pdf:hover, #main_in a.pdf:active {text-decoration:none;}
#main_in a.pdf, #main_in a.pdf:link, #main_in a.pdf:visited {
background:transparent url("../images/pdf.jpg") no-repeat left center;
padding:7px 0 5px 36px;}

431
data/css/style.css Normal file
View File

@ -0,0 +1,431 @@
html, body, div, span,
h1, h2, h3, h4, h5, h6, p,
a, em, img, strong,
ol, ul, li,
table, tr, th, td,
form {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-size: 100%;
background: transparent;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
input, button{
overflow: visible;
}
html {
overflow: auto;
}
html, body {
height: 100%;
min-height: 100%;
}
body {
font: normal 12px 'Segoe UI', Tahoma, Verdana, Arial, Helvetica, sans-serif;
line-height: 1.2;
color: #1e2022;
text-align: center;
background: #fcfcfc;
}
p {
padding: 0 0 10px;
}
ul {
padding: 0 0 0 16px;
}
li {
padding: 0 0 8px;
}
a {
text-decoration: none;
color: #005ace;
}
a:hover {
text-decoration: underline;
color: #39f;
}
.clear { display: inline-block; }
.clear:after {
content: ".";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
* html .clear { height: 1%; }
.clear { display: block; }
.none,
.hidden {
display: none;
}
.page {
position: relative;
width: 100%;
min-width: 750px;
min-height: 100%;
}
* html .page {
height: 100%;
}
.page .header {
border-bottom: 1px solid #0f0f14;
width: 100%;
height: 49px;
text-align: left;
background: #363b47 url('../img/common/top_bg.gif') 0 0 repeat-x;
}
.page .header .company-logo {
float: right;
display: block;
margin: 5px 10px 0 0;
width: 115px;
height: 38px;
overflow: hidden;
text-indent: -9999px;
background: transparent url('../img/common/def_parallels_logo.gif') 0 0 no-repeat;
}
.page .header .header-area {
height: 49px;
}
.page .header h1 {
float: left;
width: 156px;
height: 49px;
text-align: left;
}
.page .header h1 a {
display: block;
width: 210px;
height: 49px;
overflow: hidden;
text-indent: -9999px;
background: url('../img/common/def_plesk_logo.gif') no-repeat;
}
.page .header .header-text {
float: right;
font-size: 11px;
}
.page .header .header-text a {
float: left;
margin: 11px 13px 0 0;
color: #f1f1f1;
text-decoration: none;
font-size: 11px;
}
.page .header .header-text a.txt-banner {
margin-right: 10px;
}
.page .header .header-text a strong {
font-weight: normal;
}
.page .header .header-text a.top-copyright {
text-align: right;
}
.wrapper {
margin: 0 auto;
padding: 40px 0 80px;
width: 734px;
text-align: left;
}
.wrapper .container {
border: 1px solid #b8c1d0;
margin-bottom: 12px;
padding: 6px;
background: #fff;
}
.wrapper .content {
background: #fff url('../img/common/content_bg.gif') 0 0 repeat-y;
}
.wrapper .content .description {
padding: 0 15px 0 190px;
min-height: 229px;
font-size: 12px;
background: transparent url('../img/common/banner.jpg') 0 0 no-repeat;
}
* html .wrapper .content .description {
height: 229px;
}
.wrapper .content h2 {
margin: 0 0 10px;
padding: 10px 0 3px;
font-size: 18px;
font-weight: normal;
color: #039;
}
.wrapper .content .hr {
border-top: 1px solid #8b919f;
margin-top: 5px;
padding-top: 5px;
}
.wrapper .promo,
.wrapper .test-pages {
margin-bottom: 12px;
}
.promo .block-area,
.test-pages .block-area {
border: 1px solid #b8c1d0;
background: #fff;
}
.wrapper .promo h3,
.wrapper .test-pages h3 {
padding: 0 0 6px;
font-size: 12px;
font-weight: normal;
color: #039;
}
.wrapper .test-pages p {
padding: 10px;
}
.wrapper .two-col .test-pages,
.wrapper .two-col .promo {
float: left;
width: 362px;
}
.wrapper .two-col .promo {
margin-left: 10px;
}
.promo .promo-block {
margin: 10px 10px 0;
}
.promo .promo-block a.box {
float: left;
margin: 0 0 0 -105px;
}
.promo .promo-block div {
border-bottom: 1px solid #ebebeb;
margin-bottom: 10px;
padding: 0 0 10px 105px;
}
.promo .promo-block h4 {
font-size: 20px;
padding: 4px 0 8px;
}
.promo .promo-block h4 span {
display: block;
margin-bottom: -5px;
font-size: 14px;
font-weight: normal;
}
.promo .promo-block h4 a {
text-decoration: none;
color: #1e2022;
}
.promo .promo-block a.more {
padding: 2px 0 3px 24px;
line-height: 19px;
font-size: 12px;
font-weight: bold;
color: #616161;
background: transparent url('../img/common/arrow.gif') 0 0 no-repeat;
}
.promo .promo-block h4 a:hover,
.promo .promo-block a.more:hover {
text-decoration: none;
color: #39f;
}
.promo ul {
margin: 0 10px 5px;
padding: 0 0 0 16px;
}
.promo ul li {
padding-bottom: 5px;
}
.page .footer {
position: absolute;
left: 0;
bottom: 0;
border-top: 1px solid #9db6c5;
width: 100%;
min-width: 300px;
height: 69px;
background: #f1fbfe url('../img/common/footer_bg.gif') 0 0 repeat-x;
}
.page .footer-area {
height: 69px;
font-size: 11px;
text-align: left;
color: #000;
background: url('../img/common/footer_right_bg.png') 100% 0 no-repeat;
}
.page .footer a {
color: #06c;
text-decoration: none;
}
.page .footer a:hover {
color: #39f;
text-decoration: underline;
}
.page .footer .description {
margin: 0;
padding: 8px 10px 0;
}
.icons-area {
padding: 0 0 0 15px;
}
.icon {
display: -moz-inline-box;
display: inline-block;
overflow: visible;
border: 0;
margin: 0 5px 12px 0;
height: 32px;
font: normal 11px 'Segoe UI', Tahoma, Verdana, Arial, Helvetica, sans-serif;
text-decoration: none;
vertical-align: top;
color: #000;
background-color: transparent;
background-position: 0 0;
background-repeat: no-repeat;
}
.icon:hover {
text-decoration: none;
color: #000;
}
.icon span {
display: block;
padding: 0 0 0 38px;
height: 32px;
width: 70px;
line-height: 32px;
cursor: pointer;
}
#asp { background-image: url('../img/glyph/btn_asp_bg.gif'); }
#aspnet { background-image: url('../img/glyph/btn_aspdotnet_bg.gif'); }
#coldfusion { background-image: url('../img/glyph/btn_coldfusion_bg.gif'); }
#perl { background-image: url('../img/glyph/btn_perl_bg.gif'); }
#php { background-image: url('../img/glyph/btn_php_bg.gif'); }
#python { background-image: url('../img/glyph/btn_python_bg.gif'); }
#ssi { background-image: url('../img/glyph/btn_ssi_bg.gif'); }
#fcgi { background-image: url('../img/glyph/btn_fast_cgi_bg.gif'); }
#miva { background-image: url('../img/glyph/btn_miva_bg.gif'); }
.test {
width: 680px;
}
.test .pathbar {
color: #7b7b7b;
}
.test .pathbar a {
text-decoration: underline;
color: #7b7b7b;
}
.test .pathbar a:hover {
color: #39f;
}
.test h2 {
margin: 10px 0;
font-size: 17px;
font-weight: normal;
}
.test .tab-content {
border: 1px solid #8b919f;
padding: 10px;
}
fieldset {
border: 1px solid #b8c1d0;
margin: 0;
padding: 0 10px 10px;
}
legend {
margin: 0;
padding: 0 2px 5px;
vertical-align: middle;
font-weight: bold;
color: #002c61;
}
.form-fields {
padding-top: 6px;
}
.formFields {
margin: 5px 0;
}
.formFields,
.formFields input,
.formFields select,
.formFields textarea {
font: normal 11px 'Segoe UI', Tahoma, Verdana, Arial, Helvetica, sans-serif;
}
.formFields td.name {
padding: 0 10px 10px 0;
width: 200px;
vertical-align: top;
font-weight: bold;
}
.buttonsContainer {
margin-top: 10px;
text-align: right;
}
.buttonsContainer .commonButton {
display: inline;
margin-left: 14px;
}
.buttonsContainer .commonButton span {
display: none;
}
.buttonsContainer .commonButton button {
border: 0;
width: 91px;
height: 21px;
text-align: center;
white-space: nowrap;
cursor: pointer;
font: normal 11px 'Segoe UI', Tahoma, Verdana, Arial, Helvetica, sans-serif;
background: transparent url('../img/glyph/btn_bg.gif') 0 0 no-repeat;
}
.commonButton button[disabled] {
color: #999;
background-image: url('../img/glyph/btn_bg-disabled.gif');
}
#bid-ok button {
padding-left: 8px;
background-image: url('../img/glyph/btn_ok_bg.gif');
}
.commonButton button:hover {
background-position: 0 -21px;
}
.commonButton button[disabled]:hover {
background-position: 0 0;
}
.testRelults#testFailed {
border: 1px solid #ccc;
margin: 0 0 10px;
padding: 10px 10px 10px 32px;
background: #fde9e5 url('../img/icons/fail.gif') 10px 11px no-repeat;
}
.testRelults#testSuccessful {
border: 1px solid #ccc;
margin: 0 0 10px;
padding: 10px 32px;
background: #bff7b4 url('../img/icons/success.gif') 10px 11px no-repeat;
}
.testResult {
font-weight: bold;
}
.test-data {
text-align: left;
}
.test-data table {
border-collapse: collapse;
margin-bottom: 10px;
width: 100%;
color: #000;
background-color: white;
}
.test-data table th,
.test-data table td {
padding: 4px 6px;
}
.test-data tr.subhead {
background-color: #ccc;
}
.test-data th.alt {
color: white;
background-color: black;
}
.test-data tr.alt {
background-color: #eee;
}

49
data/css/tabs.css Normal file
View File

@ -0,0 +1,49 @@
#tabs {
float: none;
margin-bottom: -1px;
padding: 0 14px;
position: relative;
width: auto;
line-height: normal;
white-space: nowrap;
background: none;
}
#tabs ul {
margin: 0;
padding: 0;
list-style: none;
}
#tabs li {
display: -moz-inline-box;
display: inline-block;
border: 1px solid #7f828b;
margin-left: -3px;
padding: 0;
vertical-align: bottom;
}
#tabs li a,
#tabs li a:hover {
display: block;
padding: 0 0 0 1px;
text-decoration: none;
color: #000;
background: #e9e9e9 url('../img/icons/tabs/tabs_bg.png') 0 0 no-repeat;
}
#tabs li a span {
display: block;
padding: 0 5px 0 4px;
height: 17px;
line-height: 17px;
cursor: pointer;
background: url('../img/icons/tabs/tabs_bg.png') 100% 0 no-repeat;
}
#tabs #current {
border-bottom: 1px solid #fcfcfc;
margin: 0 -1px 0 -4px;
}
*:first-child+html #tabs #current { margin: 0 -1px; }
* html #tabs #current { margin: 0 -1px; }
#tabs #current span {
padding: 1px 5px;
background: #fcfcfc;
}

View File

@ -0,0 +1,3 @@
<?php
include_once("includes/idioma.php");
include_once("../web/accesibilidad.php"); ?>

3
data/es/actividades.php Normal file
View File

@ -0,0 +1,3 @@
<?php
include_once("includes/idioma.php");
include_once("../web/actividades.php"); ?>

View File

@ -0,0 +1,3 @@
<?php
include_once("includes/idioma.php");
include_once("../web/agradecimientos.php"); ?>

View File

@ -0,0 +1,3 @@
<?php
include_once("includes/idioma.php");
include_once("../web/biografia-didier-petit-de-meurville.php"); ?>

View File

@ -0,0 +1,3 @@
<?php
include_once("includes/idioma.php");
include_once("../web/biografia-pietro-bubani.php"); ?>

3
data/es/biografias.php Normal file
View File

@ -0,0 +1,3 @@
<?php
include_once("includes/idioma.php");
include_once("../web/biografias.php"); ?>

View File

@ -0,0 +1,3 @@
<?php
include_once("includes/idioma.php");
include_once("../web/contextualziacion.php"); ?>

3
data/es/creditos.php Normal file
View File

@ -0,0 +1,3 @@
<?php
include_once("includes/idioma.php");
include_once("../web/creditos.php"); ?>

View File

@ -0,0 +1,3 @@
<?php
include_once("includes/idioma.php");
include_once("../web/descripcion-plantas.php"); ?>

View File

@ -0,0 +1,3 @@
<?php
include_once("includes/idioma.php");
include_once("../web/detalle-planta.php"); ?>

View File

@ -0,0 +1,3 @@
<?php
include_once("includes/idioma.php");
include_once("../web/excursiones-bubani-pais-vasco.php"); ?>

3
data/es/flora.php Normal file
View File

@ -0,0 +1,3 @@
<?php
include_once("includes/idioma.php");
include_once("../web/flora.php"); ?>

3
data/es/fotografias.php Normal file
View File

@ -0,0 +1,3 @@
<?php
include_once("includes/idioma.php");
include_once("../web/fotografias.php"); ?>

View File

@ -0,0 +1,3 @@
<?php
include_once("includes/idioma.php");
include_once("../web/habitat-listado.php"); ?>

3
data/es/habitat.php Normal file
View File

@ -0,0 +1,3 @@
<?php
include_once("includes/idioma.php");
include_once("../web/habitat.php"); ?>

View File

@ -0,0 +1,3 @@
<?php
$idioma = "es";
?>

3
data/es/index.php Normal file
View File

@ -0,0 +1,3 @@
<?php
include_once("includes/idioma.php");
include_once("../web/index.php"); ?>

3
data/es/lugar-fechas.php Normal file
View File

@ -0,0 +1,3 @@
<?php
include_once("includes/idioma.php");
include_once("../web/lugar-fechas.php"); ?>

3
data/es/mapa-web.php Normal file
View File

@ -0,0 +1,3 @@
<?php
include_once("includes/idioma.php");
include_once("../web/mapa-web.php"); ?>

View File

@ -0,0 +1,3 @@
<?php
include_once("includes/idioma.php");
include_once("../web/opiniones-bubani-sobre-pais-vasco.php"); ?>

3
data/es/pirineos.php Normal file
View File

@ -0,0 +1,3 @@
<?php
include_once("includes/idioma.php");
include_once("../web/pirineos.php"); ?>

View File

@ -0,0 +1,3 @@
<?php
include_once("includes/idioma.php");
include_once("../web/accesibilidad.php"); ?>

3
data/eu/actividades.php Normal file
View File

@ -0,0 +1,3 @@
<?php
include_once("includes/idioma.php");
include_once("../web/actividades.php"); ?>

View File

@ -0,0 +1,3 @@
<?php
include_once("includes/idioma.php");
include_once("../web/agradecimientos.php"); ?>

View File

@ -0,0 +1,3 @@
<?php
include_once("includes/idioma.php");
include_once("../web/biografia-didier-petit-de-meurville.php"); ?>

View File

@ -0,0 +1,3 @@
<?php
include_once("includes/idioma.php");
include_once("../web/biografia-pietro-bubani.php"); ?>

3
data/eu/biografias.php Normal file
View File

@ -0,0 +1,3 @@
<?php
include_once("includes/idioma.php");
include_once("../web/biografias.php"); ?>

View File

@ -0,0 +1,3 @@
<?php
include_once("includes/idioma.php");
include_once("../web/contextualziacion.php"); ?>

3
data/eu/creditos.php Normal file
View File

@ -0,0 +1,3 @@
<?php
include_once("includes/idioma.php");
include_once("../web/creditos.php"); ?>

View File

@ -0,0 +1,3 @@
<?php
include_once("includes/idioma.php");
include_once("../web/descripcion-plantas.php"); ?>

View File

@ -0,0 +1,3 @@
<?php
include_once("includes/idioma.php");
include_once("../web/detalle-planta.php"); ?>

View File

@ -0,0 +1,3 @@
<?php
include_once("includes/idioma.php");
include_once("../web/excursiones-bubani-pais-vasco.php"); ?>

3
data/eu/flora.php Normal file
View File

@ -0,0 +1,3 @@
<?php
include_once("includes/idioma.php");
include_once("../web/flora.php"); ?>

3
data/eu/fotografias.php Normal file
View File

@ -0,0 +1,3 @@
<?php
include_once("includes/idioma.php");
include_once("../web/fotografias.php"); ?>

View File

@ -0,0 +1,3 @@
<?php
include_once("includes/idioma.php");
include_once("../web/habitat-listado.php"); ?>

3
data/eu/habitat.php Normal file
View File

@ -0,0 +1,3 @@
<?php
include_once("includes/idioma.php");
include_once("../web/habitat.php"); ?>

View File

@ -0,0 +1,3 @@
<?php
$idioma = "eu";
?>

3
data/eu/index.php Normal file
View File

@ -0,0 +1,3 @@
<?php
include_once("includes/idioma.php");
include_once("../web/index.php"); ?>

3
data/eu/lugar-fechas.php Normal file
View File

@ -0,0 +1,3 @@
<?php
include_once("includes/idioma.php");
include_once("../web/lugar-fechas.php"); ?>

3
data/eu/mapa-web.php Normal file
View File

@ -0,0 +1,3 @@
<?php
include_once("includes/idioma.php");
include_once("../web/mapa-web.php"); ?>

View File

@ -0,0 +1,3 @@
<?php
include_once("includes/idioma.php");
include_once("../web/opiniones-bubani-sobre-pais-vasco.php"); ?>

3
data/eu/pirineos.php Normal file
View File

@ -0,0 +1,3 @@
<?php
include_once("includes/idioma.php");
include_once("../web/pirineos.php"); ?>

BIN
data/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

121
data/flash/flash.php Normal file
View File

@ -0,0 +1,121 @@
<?php
require_once('getid3.php');
function embed($swf, $width=-1, $height=-1, $flashvars=''){
$swf = explode('.', $swf);
array_pop($swf);
$swf = implode('.', $swf);
if($width == -1 || $height == -1)
list($width, $height) = getimagesize($swf.'.swf');
echo "<script language='javascript'>\n";
echo " 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',\n";
echo " 'width', '$width',\n";
echo " 'height', '$height',\n";
echo " 'src', 'x',\n";
echo " 'quality', 'high',\n";
echo " 'pluginspage', 'http://www.macromedia.com/go/getflashplayer',\n";
echo " 'align', 'middle',\n";
echo " 'play', 'true',\n";
echo " 'loop', 'true',\n";
echo " 'scale', 'showall',\n";
echo " 'FlashVars', '$flashvars',\n";
echo " 'allowFullScreen', 'true',\n";
echo " 'movie', '$swf'\n";
echo " }\n";
echo "</script>\n";
echo "<noscript>\n";
echo " <object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' width='$width' height='$height' align='middle'>\n";
echo " <param name='allowFullScreen' value='true'>\n";
echo " <param name='movie' value='$swf.swf?$flashvars' /><param name='quality' value='high' /><embed src='$swf.swf?$flashvars' width='$width' height='$height' align='middle' allowFullScreen='true' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer'>\n";
echo " </object>\n";
echo "</noscript>\n";
}
function getflvsize($flv){
$getID3 = new getID3;
$fileinfo = $getID3->analyze($flv);
if(!($fileinfo['meta']['onMetaData']['width'] && $fileinfo['meta']['onMetaData']['height']))
return false;
$width = $fileinfo['meta']['onMetaData']['width'];
$height = $fileinfo['meta']['onMetaData']['height'];
return array($width, $height);
}
function flvheader(){
static $once=true;
if($once){
if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE'))
echo "<script src='../js/AC_RunActiveContent.js' language='javascript'></script>";
else
echo "<script charset='ISO-8859-1' src='rac.js' language='javascript'></script>";
}
$once = false;
}
function flvstring($movie, $width=-1, $height=-1, $fgcolor='', $bgcolor='', $autoplay=false, $autoload=true, $autorewind=true, $volume=70, $loop=false, $mute=false, $muteonly=false, $clickurl='', $clicktarget=''){
if(!file_exists($movie))
return "Movie not found.";
if($width == -1 || $height == -1)
list($width, $height) = getflvsize($movie);
$height += 40;
$retval = '';
$options = array();
if($fgcolor && $fgcolor !== '' && $fgcolor !== 'default')
$options[] = "fgcolor=$fgcolor";
if($bgcolor && $bgcolor !== '' && $bgcolor !== 'default')
$options[] = "bgcolor=$bgcolor";
if($autoplay && $autoplay !== '' && $autoplay !== 'default')
$options[] = 'autoplay=on';
if(!$autoload)
$options[] = 'autoload=off';
if(!$autorewind)
$options[] = 'autorewind=off';
if($volume && $volume !== '' && $volume !== 'default')
$options[] = "volume=$volume";
if($loop && $loop !== '' && $loop !== 'default')
$options[] = 'loop=on';
if($mute && $mute !== '' && $mute !== 'default')
$options[] = 'mute=on';
if($muteonly && $muteonly !== '' && $mute !== 'default')
$options[] = 'muteonly=on';
if($clicktarget)
$options[] = "clicktarget=$clicktarget";
if($clickurl)
$options[] = "clickurl=$clickurl";
$options = implode('&', $options);
if(strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE'))
$retval = "<!-- saved from url=(0013)about:internet -->\n";
$retval .= "<script language='javascript'>\n";
$retval .= " var src = 'player';\n";
$retval .= " if(!DetectFlashVer(9, 0, 0) && DetectFlashVer(8, 0, 0))\n";
$retval .= " src = 'player8';\n";
$retval .= " AC_FL_RunContent('codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0', 'width', $width, 'height', $height, 'src', src, 'pluginspage', 'http://www.macromedia.com/go/getflashplayer', 'id', 'flvPlayer', 'allowFullScreen', 'true', 'movie', src, 'FlashVars','movie=$movie&$options');\n";
$retval .= "</script>\n";
$retval .= "<noscript>\n";
$retval .= "<object width='$width' height='$height' id='flvPlayer'>\n";
$retval .= " <param name='allowFullScreen' value='true'>\n";
$retval .= " <param name='movie' value='player.swf?movie=$movie&$options'>\n";
$retval .= " <embed src='player.swf?movie=$movie&$options' width='$width' height='$height' allowFullScreen='true' type='application/x-shockwave-flash'>\n";
$retval .= "</object>\n";
$retval .= "</noscript>\n";
return $retval;
}
function flv($movie, $width=-1, $height=-1, $fgcolor='', $bgcolor='', $autoplay=false, $autoload=true, $autorewind=true, $volume=70, $loop=false, $mute=false, $muteonly=false, $clickurl='', $clicktarget=''){
echo flvstring($movie, $width, $height, $fgcolor, $bgcolor, $autoplay, $autoload, $autorewind, $volume, $loop, $mute, $muteonly, $clickurl, $clicktarget);
}
?>

1323
data/flash/getid3.lib.php Normal file

File diff suppressed because it is too large Load Diff

1261
data/flash/getid3.php Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,497 @@
<?php
/////////////////////////////////////////////////////////////////
/// getID3() by James Heinrich <info@getid3.org> //
// available at http://getid3.sourceforge.net //
// or http://www.getid3.org //
// //
// FLV module by Seth Kaufman <seth@whirl-i-gig.com> //
// //
// * version 0.1 (26 June 2005) //
// //
// minor modifications by James Heinrich <info@getid3.org> //
// * version 0.1.1 (15 July 2005) //
// //
// Support for On2 VP6 codec and meta information by //
// Steve Webster <steve.webster@featurecreep.com> //
// * version 0.2 (22 February 2006) //
// //
// Modified to not read entire file into memory //
// by James Heinrich <info@getid3.org> //
// * version 0.3 (15 June 2006) //
// //
/////////////////////////////////////////////////////////////////
// //
// module.audio-video.flv.php //
// module for analyzing Shockwave Flash Video files //
// dependencies: NONE //
// ///
/////////////////////////////////////////////////////////////////
define('GETID3_FLV_TAG_AUDIO', 8);
define('GETID3_FLV_TAG_VIDEO', 9);
define('GETID3_FLV_TAG_META', 18);
define('GETID3_FLV_VIDEO_H263', 2);
define('GETID3_FLV_VIDEO_SCREEN', 3);
define('GETID3_FLV_VIDEO_VP6', 4);
class getid3_flv
{
function getid3_flv(&$fd, &$ThisFileInfo, $ReturnAllTagData=false) {
fseek($fd, $ThisFileInfo['avdataoffset'], SEEK_SET);
$FLVdataLength = $ThisFileInfo['avdataend'] - $ThisFileInfo['avdataoffset'];
$FLVheader = fread($fd, 5);
$ThisFileInfo['fileformat'] = 'flv';
$ThisFileInfo['flv']['header']['signature'] = substr($FLVheader, 0, 3);
$ThisFileInfo['flv']['header']['version'] = getid3_lib::BigEndian2Int(substr($FLVheader, 3, 1));
$TypeFlags = getid3_lib::BigEndian2Int(substr($FLVheader, 4, 1));
if ($ThisFileInfo['flv']['header']['signature'] != 'FLV') {
$ThisFileInfo['error'][] = 'Expecting "FLV" at offset '.$ThisFileInfo['avdataoffset'].', found "'.$ThisFileInfo['flv']['header']['signature'].'"';
unset($ThisFileInfo['flv']);
unset($ThisFileInfo['fileformat']);
return false;
}
$ThisFileInfo['flv']['header']['hasAudio'] = (bool) ($TypeFlags & 0x04);
$ThisFileInfo['flv']['header']['hasVideo'] = (bool) ($TypeFlags & 0x01);
$FrameSizeDataLength = getid3_lib::BigEndian2Int(fread($fd, 4));
$FLVheaderFrameLength = 9;
if ($FrameSizeDataLength > $FLVheaderFrameLength) {
fseek($fd, $FrameSizeDataLength - $FLVheaderFrameLength, SEEK_CUR);
}
$Duration = 0;
while ((ftell($fd) + 1) < $ThisFileInfo['avdataend']) {
//if (!$ThisFileInfo['flv']['header']['hasAudio'] || isset($ThisFileInfo['flv']['audio']['audioFormat'])) {
// if (!$ThisFileInfo['flv']['header']['hasVideo'] || isset($ThisFileInfo['flv']['video']['videoCodec'])) {
// break;
// }
//}
$ThisTagHeader = fread($fd, 16);
$PreviousTagLength = getid3_lib::BigEndian2Int(substr($ThisTagHeader, 0, 4));
$TagType = getid3_lib::BigEndian2Int(substr($ThisTagHeader, 4, 1));
$DataLength = getid3_lib::BigEndian2Int(substr($ThisTagHeader, 5, 3));
$Timestamp = getid3_lib::BigEndian2Int(substr($ThisTagHeader, 8, 3));
$LastHeaderByte = getid3_lib::BigEndian2Int(substr($ThisTagHeader, 15, 1));
$NextOffset = ftell($fd) - 1 + $DataLength;
switch ($TagType) {
case GETID3_FLV_TAG_AUDIO:
if (!isset($ThisFileInfo['flv']['audio']['audioFormat'])) {
$ThisFileInfo['flv']['audio']['audioFormat'] = $LastHeaderByte & 0x07;
$ThisFileInfo['flv']['audio']['audioRate'] = ($LastHeaderByte & 0x30) / 0x10;
$ThisFileInfo['flv']['audio']['audioSampleSize'] = ($LastHeaderByte & 0x40) / 0x40;
$ThisFileInfo['flv']['audio']['audioType'] = ($LastHeaderByte & 0x80) / 0x80;
}
break;
case GETID3_FLV_TAG_VIDEO:
if (!isset($ThisFileInfo['flv']['video']['videoCodec'])) {
$ThisFileInfo['flv']['video']['videoCodec'] = $LastHeaderByte & 0x07;
$FLVvideoHeader = fread($fd, 11);
if ($ThisFileInfo['flv']['video']['videoCodec'] != GETID3_FLV_VIDEO_VP6) {
$PictureSizeType = (getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 3, 2))) >> 7;
$PictureSizeType = $PictureSizeType & 0x0007;
$ThisFileInfo['flv']['header']['videoSizeType'] = $PictureSizeType;
switch ($PictureSizeType) {
case 0:
$PictureSizeEnc = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 5, 2));
$PictureSizeEnc <<= 1;
$ThisFileInfo['video']['resolution_x'] = ($PictureSizeEnc & 0xFF00) >> 8;
$PictureSizeEnc = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 6, 2));
$PictureSizeEnc <<= 1;
$ThisFileInfo['video']['resolution_y'] = ($PictureSizeEnc & 0xFF00) >> 8;
break;
case 1:
$PictureSizeEnc = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 5, 4));
$PictureSizeEnc <<= 1;
$ThisFileInfo['video']['resolution_x'] = ($PictureSizeEnc & 0xFFFF0000) >> 16;
$PictureSizeEnc = getid3_lib::BigEndian2Int(substr($FLVvideoHeader, 7, 4));
$PictureSizeEnc <<= 1;
$ThisFileInfo['video']['resolution_y'] = ($PictureSizeEnc & 0xFFFF0000) >> 16;
break;
case 2:
$ThisFileInfo['video']['resolution_x'] = 352;
$ThisFileInfo['video']['resolution_y'] = 288;
break;
case 3:
$ThisFileInfo['video']['resolution_x'] = 176;
$ThisFileInfo['video']['resolution_y'] = 144;
break;
case 4:
$ThisFileInfo['video']['resolution_x'] = 128;
$ThisFileInfo['video']['resolution_y'] = 96;
break;
case 5:
$ThisFileInfo['video']['resolution_x'] = 320;
$ThisFileInfo['video']['resolution_y'] = 240;
break;
case 6:
$ThisFileInfo['video']['resolution_x'] = 160;
$ThisFileInfo['video']['resolution_y'] = 120;
break;
default:
$ThisFileInfo['video']['resolution_x'] = 0;
$ThisFileInfo['video']['resolution_y'] = 0;
break;
}
}
}
break;
// Meta tag
case GETID3_FLV_TAG_META:
fseek($fd, -1, SEEK_CUR);
$reader = new AMFReader(new AMFStream(fread($fd, $DataLength)));
$eventName = $reader->readData();
$ThisFileInfo['meta'][$eventName] = $reader->readData();
unset($reader);
$ThisFileInfo['video']['frame_rate'] = $ThisFileInfo['meta']['onMetaData']['framerate'];
$ThisFileInfo['video']['resolution_x'] = $ThisFileInfo['meta']['onMetaData']['width'];
$ThisFileInfo['video']['resolution_y'] = $ThisFileInfo['meta']['onMetaData']['height'];
break;
default:
// noop
break;
}
if ($Timestamp > $Duration) {
$Duration = $Timestamp;
}
fseek($fd, $NextOffset, SEEK_SET);
}
$ThisFileInfo['playtime_seconds'] = $Duration / 1000;
$ThisFileInfo['bitrate'] = ($ThisFileInfo['avdataend'] - $ThisFileInfo['avdataoffset']) / $ThisFileInfo['playtime_seconds'];
if ($ThisFileInfo['flv']['header']['hasAudio']) {
$ThisFileInfo['audio']['codec'] = $this->FLVaudioFormat($ThisFileInfo['flv']['audio']['audioFormat']);
$ThisFileInfo['audio']['sample_rate'] = $this->FLVaudioRate($ThisFileInfo['flv']['audio']['audioRate']);
$ThisFileInfo['audio']['bits_per_sample'] = $this->FLVaudioBitDepth($ThisFileInfo['flv']['audio']['audioSampleSize']);
$ThisFileInfo['audio']['channels'] = $ThisFileInfo['flv']['audio']['audioType'] + 1; // 0=mono,1=stereo
$ThisFileInfo['audio']['lossless'] = ($ThisFileInfo['flv']['audio']['audioFormat'] ? false : true); // 0=uncompressed
$ThisFileInfo['audio']['dataformat'] = 'flv';
}
if (@$ThisFileInfo['flv']['header']['hasVideo']) {
$ThisFileInfo['video']['codec'] = $this->FLVvideoCodec($ThisFileInfo['flv']['video']['videoCodec']);
$ThisFileInfo['video']['dataformat'] = 'flv';
$ThisFileInfo['video']['lossless'] = false;
}
return true;
}
function FLVaudioFormat($id) {
$FLVaudioFormat = array(
0 => 'uncompressed',
1 => 'ADPCM',
2 => 'mp3',
5 => 'Nellymoser 8kHz mono',
6 => 'Nellymoser',
);
return (@$FLVaudioFormat[$id] ? @$FLVaudioFormat[$id] : false);
}
function FLVaudioRate($id) {
$FLVaudioRate = array(
0 => 5500,
1 => 11025,
2 => 22050,
3 => 44100,
);
return (@$FLVaudioRate[$id] ? @$FLVaudioRate[$id] : false);
}
function FLVaudioBitDepth($id) {
$FLVaudioBitDepth = array(
0 => 8,
1 => 16,
);
return (@$FLVaudioBitDepth[$id] ? @$FLVaudioBitDepth[$id] : false);
}
function FLVvideoCodec($id) {
$FLVvideoCodec = array(
GETID3_FLV_VIDEO_H263 => 'Sorenson H.263',
GETID3_FLV_VIDEO_SCREEN => 'Screen video',
GETID3_FLV_VIDEO_VP6 => 'On2 VP6',
);
return (@$FLVvideoCodec[$id] ? @$FLVvideoCodec[$id] : false);
}
}
class AMFStream {
var $bytes;
var $pos;
function AMFStream(&$bytes) {
$this->bytes =& $bytes;
$this->pos = 0;
}
function readByte() {
return getid3_lib::BigEndian2Int(substr($this->bytes, $this->pos++, 1));
}
function readInt() {
return ($this->readByte() << 8) + $this->readByte();
}
function readLong() {
return ($this->readByte() << 24) + ($this->readByte() << 16) + ($this->readByte() << 8) + $this->readByte();
}
function readDouble() {
return getid3_lib::BigEndian2Float($this->read(8));
}
function readUTF() {
$length = $this->readInt();
return $this->read($length);
}
function readLongUTF() {
$length = $this->readLong();
return $this->read($length);
}
function read($length) {
$val = substr($this->bytes, $this->pos, $length);
$this->pos += $length;
return $val;
}
function peekByte() {
$pos = $this->pos;
$val = $this->readByte();
$this->pos = $pos;
return $val;
}
function peekInt() {
$pos = $this->pos;
$val = $this->readInt();
$this->pos = $pos;
return $val;
}
function peekLong() {
$pos = $this->pos;
$val = $this->readLong();
$this->pos = $pos;
return $val;
}
function peekDouble() {
$pos = $this->pos;
$val = $this->readDouble();
$this->pos = $pos;
return $val;
}
function peekUTF() {
$pos = $this->pos;
$val = $this->readUTF();
$this->pos = $pos;
return $val;
}
function peekLongUTF() {
$pos = $this->pos;
$val = $this->readLongUTF();
$this->pos = $pos;
return $val;
}
}
class AMFReader {
var $stream;
function AMFReader(&$stream) {
$this->stream =& $stream;
}
function readData() {
$value = null;
$type = $this->stream->readByte();
switch($type) {
// Double
case 0:
$value = $this->readDouble();
break;
// Boolean
case 1:
$value = $this->readBoolean();
break;
// String
case 2:
$value = $this->readString();
break;
// Object
case 3:
$value = $this->readObject();
break;
// null
case 6:
return null;
break;
// Mixed array
case 8:
$value = $this->readMixedArray();
break;
// Array
case 10:
$value = $this->readArray();
break;
// Date
case 11:
$value = $this->readDate();
break;
// Long string
case 13:
$value = $this->readLongString();
break;
// XML (handled as string)
case 15:
$value = $this->readXML();
break;
// Typed object (handled as object)
case 16:
$value = $this->readTypedObject();
break;
// Long string
default:
$value = '(unknown or unsupported data type)';
break;
}
return $value;
}
function readDouble() {
return $this->stream->readDouble();
}
function readBoolean() {
return $this->stream->readByte() == 1;
}
function readString() {
return $this->stream->readUTF();
}
function readObject() {
// Get highest numerical index - ignored
$highestIndex = $this->stream->readLong();
$data = array();
while ($key = $this->stream->readUTF()) {
// Mixed array record ends with empty string (0x00 0x00) and 0x09
if (($key == '') && ($this->stream->peekByte() == 0x09)) {
// Consume byte
$this->stream->readByte();
break;
}
$data[$key] = $this->readData();
}
return $data;
}
function readMixedArray() {
// Get highest numerical index - ignored
$highestIndex = $this->stream->readLong();
$data = array();
while ($key = $this->stream->readUTF()) {
// Mixed array record ends with empty string (0x00 0x00) and 0x09
if (($key == '') && ($this->stream->peekByte() == 0x09)) {
// Consume byte
$this->stream->readByte();
break;
}
if (is_numeric($key)) {
$key = (float) $key;
}
$data[$key] = $this->readData();
}
return $data;
}
function readArray() {
$length = $this->stream->readLong();
$data = array();
for ($i = 0; $i < count($length); $i++) {
$data[] = $this->readData();
}
return $data;
}
function readDate() {
$timestamp = $this->stream->readDouble();
$timezone = $this->stream->readInt();
return $timestamp;
}
function readLongString() {
return $this->stream->readLongUTF();
}
function readXML() {
return $this->stream->readLongUTF();
}
function readTypedObject() {
$className = $this->stream->readUTF();
return $this->readObject();
}
}
?>

View File

@ -0,0 +1,153 @@
<?php
/////////////////////////////////////////////////////////////////
/// getID3() by James Heinrich <info@getid3.org> //
// available at http://getid3.sourceforge.net //
// or http://www.getid3.org //
/////////////////////////////////////////////////////////////////
// See readme.txt for more details //
/////////////////////////////////////////////////////////////////
// //
// module.audio-video.swf.php //
// module for analyzing Shockwave Flash files //
// dependencies: NONE //
// ///
/////////////////////////////////////////////////////////////////
class getid3_swf
{
function getid3_swf(&$fd, &$ThisFileInfo, $ReturnAllTagData=false) {
$ThisFileInfo['fileformat'] = 'swf';
$ThisFileInfo['video']['dataformat'] = 'swf';
// http://www.openswf.org/spec/SWFfileformat.html
fseek($fd, $ThisFileInfo['avdataoffset'], SEEK_SET);
//echo 'reading '.($ThisFileInfo['avdataend'] - $ThisFileInfo['avdataoffset']).' bytes<br>';
$SWFfileData = fread($fd, $ThisFileInfo['avdataend'] - $ThisFileInfo['avdataoffset']); // 8 + 2 + 2 + max(9) bytes NOT including Frame_Size RECT data
$ThisFileInfo['swf']['header']['signature'] = substr($SWFfileData, 0, 3);
switch ($ThisFileInfo['swf']['header']['signature']) {
case 'FWS':
$ThisFileInfo['swf']['header']['compressed'] = false;
break;
case 'CWS':
$ThisFileInfo['swf']['header']['compressed'] = true;
break;
default:
$ThisFileInfo['error'][] = 'Expecting "FWS" or "CWS" at offset '.$ThisFileInfo['avdataoffset'].', found "'.$ThisFileInfo['swf']['header']['signature'].'"';
unset($ThisFileInfo['swf']);
unset($ThisFileInfo['fileformat']);
return false;
break;
}
$ThisFileInfo['swf']['header']['version'] = getid3_lib::LittleEndian2Int(substr($SWFfileData, 3, 1));
$ThisFileInfo['swf']['header']['length'] = getid3_lib::LittleEndian2Int(substr($SWFfileData, 4, 4));
//echo '1<br>';
if ($ThisFileInfo['swf']['header']['compressed']) {
//echo '2<br>';
// $foo = substr($SWFfileData, 8, 4096);
// echo '['.strlen($foo).']<br>';
// $fee = gzuncompress($foo);
// echo '('.strlen($fee).')<br>';
//return false;
//echo '<br>time: '.time().'<br>';
//return false;
if ($UncompressedFileData = gzuncompress(substr($SWFfileData, 8))) {
//echo '3<br>';
$SWFfileData = substr($SWFfileData, 0, 8).$UncompressedFileData;
} else {
//echo '4<br>';
$ThisFileInfo['error'][] = 'Error decompressing compressed SWF data';
return false;
}
}
$FrameSizeBitsPerValue = (ord(substr($SWFfileData, 8, 1)) & 0xF8) >> 3;
$FrameSizeDataLength = ceil((5 + (4 * $FrameSizeBitsPerValue)) / 8);
$FrameSizeDataString = str_pad(decbin(ord(substr($SWFfileData, 8, 1)) & 0x07), 3, '0', STR_PAD_LEFT);
for ($i = 1; $i < $FrameSizeDataLength; $i++) {
$FrameSizeDataString .= str_pad(decbin(ord(substr($SWFfileData, 8 + $i, 1))), 8, '0', STR_PAD_LEFT);
}
list($X1, $X2, $Y1, $Y2) = explode("\n", wordwrap($FrameSizeDataString, $FrameSizeBitsPerValue, "\n", 1));
$ThisFileInfo['swf']['header']['frame_width'] = getid3_lib::Bin2Dec($X2);
$ThisFileInfo['swf']['header']['frame_height'] = getid3_lib::Bin2Dec($Y2);
// http://www-lehre.informatik.uni-osnabrueck.de/~fbstark/diplom/docs/swf/Flash_Uncovered.htm
// Next in the header is the frame rate, which is kind of weird.
// It is supposed to be stored as a 16bit integer, but the first byte
// (or last depending on how you look at it) is completely ignored.
// Example: 0x000C -> 0x0C -> 12 So the frame rate is 12 fps.
// Byte at (8 + $FrameSizeDataLength) is always zero and ignored
$ThisFileInfo['swf']['header']['frame_rate'] = getid3_lib::LittleEndian2Int(substr($SWFfileData, 9 + $FrameSizeDataLength, 1));
$ThisFileInfo['swf']['header']['frame_count'] = getid3_lib::LittleEndian2Int(substr($SWFfileData, 10 + $FrameSizeDataLength, 2));
$ThisFileInfo['video']['frame_rate'] = $ThisFileInfo['swf']['header']['frame_rate'];
$ThisFileInfo['video']['resolution_x'] = intval(round($ThisFileInfo['swf']['header']['frame_width'] / 20));
$ThisFileInfo['video']['resolution_y'] = intval(round($ThisFileInfo['swf']['header']['frame_height'] / 20));
$ThisFileInfo['video']['pixel_aspect_ratio'] = (float) 1;
if (($ThisFileInfo['swf']['header']['frame_count'] > 0) && ($ThisFileInfo['swf']['header']['frame_rate'] > 0)) {
$ThisFileInfo['playtime_seconds'] = $ThisFileInfo['swf']['header']['frame_count'] / $ThisFileInfo['swf']['header']['frame_rate'];
}
// SWF tags
$CurrentOffset = 12 + $FrameSizeDataLength;
$SWFdataLength = strlen($SWFfileData);
while ($CurrentOffset < $SWFdataLength) {
$TagIDTagLength = getid3_lib::LittleEndian2Int(substr($SWFfileData, $CurrentOffset, 2));
$TagID = ($TagIDTagLength & 0xFFFC) >> 6;
$TagLength = ($TagIDTagLength & 0x003F);
$CurrentOffset += 2;
if ($TagLength == 0x3F) {
$TagLength = getid3_lib::LittleEndian2Int(substr($SWFfileData, $CurrentOffset, 4));
$CurrentOffset += 4;
}
unset($TagData);
$TagData['offset'] = $CurrentOffset;
$TagData['size'] = $TagLength;
$TagData['id'] = $TagID;
$TagData['data'] = substr($SWFfileData, $CurrentOffset, $TagLength);
switch ($TagID) {
case 0: // end of movie
break 2;
case 9: // Set background color
//$ThisFileInfo['swf']['tags'][] = $TagData;
$ThisFileInfo['swf']['bgcolor'] = strtoupper(str_pad(dechex(getid3_lib::BigEndian2Int($TagData['data'])), 6, '0', STR_PAD_LEFT));
break;
default:
if ($ReturnAllTagData) {
$ThisFileInfo['swf']['tags'][] = $TagData;
}
break;
}
$CurrentOffset += $TagLength;
}
return true;
}
}
?>

View File

@ -0,0 +1,284 @@
<?php
/////////////////////////////////////////////////////////////////
/// getID3() by James Heinrich <info@getid3.org> //
// available at http://getid3.sourceforge.net //
// or http://www.getid3.org //
/////////////////////////////////////////////////////////////////
// See readme.txt for more details //
/////////////////////////////////////////////////////////////////
// //
// module.tag.apetag.php //
// module for analyzing APE tags //
// dependencies: NONE //
// ///
/////////////////////////////////////////////////////////////////
class getid3_apetag
{
function getid3_apetag(&$fd, &$ThisFileInfo, $overrideendoffset=0) {
$id3v1tagsize = 128;
$apetagheadersize = 32;
$lyrics3tagsize = 10;
if ($overrideendoffset == 0) {
fseek($fd, 0 - $id3v1tagsize - $apetagheadersize - $lyrics3tagsize, SEEK_END);
$APEfooterID3v1 = fread($fd, $id3v1tagsize + $apetagheadersize + $lyrics3tagsize);
//if (preg_match('/APETAGEX.{24}TAG.{125}$/i', $APEfooterID3v1)) {
if (substr($APEfooterID3v1, strlen($APEfooterID3v1) - $id3v1tagsize - $apetagheadersize, 8) == 'APETAGEX') {
// APE tag found before ID3v1
$ThisFileInfo['ape']['tag_offset_end'] = $ThisFileInfo['filesize'] - $id3v1tagsize;
//} elseif (preg_match('/APETAGEX.{24}$/i', $APEfooterID3v1)) {
} elseif (substr($APEfooterID3v1, strlen($APEfooterID3v1) - $apetagheadersize, 8) == 'APETAGEX') {
// APE tag found, no ID3v1
$ThisFileInfo['ape']['tag_offset_end'] = $ThisFileInfo['filesize'];
}
} else {
fseek($fd, $overrideendoffset - $apetagheadersize, SEEK_SET);
if (fread($fd, 8) == 'APETAGEX') {
$ThisFileInfo['ape']['tag_offset_end'] = $overrideendoffset;
}
}
if (!isset($ThisFileInfo['ape']['tag_offset_end'])) {
// APE tag not found
unset($ThisFileInfo['ape']);
return false;
}
// shortcut
$thisfile_ape = &$ThisFileInfo['ape'];
fseek($fd, $thisfile_ape['tag_offset_end'] - $apetagheadersize, SEEK_SET);
$APEfooterData = fread($fd, 32);
if (!($thisfile_ape['footer'] = $this->parseAPEheaderFooter($APEfooterData))) {
$ThisFileInfo['error'][] = 'Error parsing APE footer at offset '.$thisfile_ape['tag_offset_end'];
return false;
}
if (isset($thisfile_ape['footer']['flags']['header']) && $thisfile_ape['footer']['flags']['header']) {
fseek($fd, $thisfile_ape['tag_offset_end'] - $thisfile_ape['footer']['raw']['tagsize'] - $apetagheadersize, SEEK_SET);
$thisfile_ape['tag_offset_start'] = ftell($fd);
$APEtagData = fread($fd, $thisfile_ape['footer']['raw']['tagsize'] + $apetagheadersize);
} else {
$thisfile_ape['tag_offset_start'] = $thisfile_ape['tag_offset_end'] - $thisfile_ape['footer']['raw']['tagsize'];
fseek($fd, $thisfile_ape['tag_offset_start'], SEEK_SET);
$APEtagData = fread($fd, $thisfile_ape['footer']['raw']['tagsize']);
}
$ThisFileInfo['avdataend'] = $thisfile_ape['tag_offset_start'];
if (isset($ThisFileInfo['id3v1']['tag_offset_start']) && ($ThisFileInfo['id3v1']['tag_offset_start'] < $thisfile_ape['tag_offset_end'])) {
$ThisFileInfo['warning'][] = 'ID3v1 tag information ignored since it appears to be a false synch in APEtag data';
unset($ThisFileInfo['id3v1']);
foreach ($ThisFileInfo['warning'] as $key => $value) {
if ($value == 'Some ID3v1 fields do not use NULL characters for padding') {
unset($ThisFileInfo['warning'][$key]);
sort($ThisFileInfo['warning']);
break;
}
}
}
$offset = 0;
if (isset($thisfile_ape['footer']['flags']['header']) && $thisfile_ape['footer']['flags']['header']) {
if ($thisfile_ape['header'] = $this->parseAPEheaderFooter(substr($APEtagData, 0, $apetagheadersize))) {
$offset += $apetagheadersize;
} else {
$ThisFileInfo['error'][] = 'Error parsing APE header at offset '.$thisfile_ape['tag_offset_start'];
return false;
}
}
// shortcut
$ThisFileInfo['replay_gain'] = array();
$thisfile_replaygain = &$ThisFileInfo['replay_gain'];
for ($i = 0; $i < $thisfile_ape['footer']['raw']['tag_items']; $i++) {
$value_size = getid3_lib::LittleEndian2Int(substr($APEtagData, $offset, 4));
$offset += 4;
$item_flags = getid3_lib::LittleEndian2Int(substr($APEtagData, $offset, 4));
$offset += 4;
if (strstr(substr($APEtagData, $offset), "\x00") === false) {
$ThisFileInfo['error'][] = 'Cannot find null-byte (0x00) seperator between ItemKey #'.$i.' and value. ItemKey starts '.$offset.' bytes into the APE tag, at file offset '.($thisfile_ape['tag_offset_start'] + $offset);
return false;
}
$ItemKeyLength = strpos($APEtagData, "\x00", $offset) - $offset;
$item_key = strtolower(substr($APEtagData, $offset, $ItemKeyLength));
// shortcut
$thisfile_ape['items'][$item_key] = array();
$thisfile_ape_items_current = &$thisfile_ape['items'][$item_key];
$offset += ($ItemKeyLength + 1); // skip 0x00 terminator
$thisfile_ape_items_current['data'] = substr($APEtagData, $offset, $value_size);
$offset += $value_size;
$thisfile_ape_items_current['flags'] = $this->parseAPEtagFlags($item_flags);
switch ($thisfile_ape_items_current['flags']['item_contents_raw']) {
case 0: // UTF-8
case 3: // Locator (URL, filename, etc), UTF-8 encoded
$thisfile_ape_items_current['data'] = explode("\x00", trim($thisfile_ape_items_current['data']));
break;
default: // binary data
break;
}
switch (strtolower($item_key)) {
case 'replaygain_track_gain':
$thisfile_replaygain['track']['adjustment'] = (float) str_replace(',', '.', $thisfile_ape_items_current['data'][0]); // float casting will see "0,95" as zero!
$thisfile_replaygain['track']['originator'] = 'unspecified';
break;
case 'replaygain_track_peak':
$thisfile_replaygain['track']['peak'] = (float) str_replace(',', '.', $thisfile_ape_items_current['data'][0]); // float casting will see "0,95" as zero!
$thisfile_replaygain['track']['originator'] = 'unspecified';
if ($thisfile_replaygain['track']['peak'] <= 0) {
$ThisFileInfo['warning'][] = 'ReplayGain Track peak from APEtag appears invalid: '.$thisfile_replaygain['track']['peak'].' (original value = "'.$thisfile_ape_items_current['data'][0].'")';
}
break;
case 'replaygain_album_gain':
$thisfile_replaygain['album']['adjustment'] = (float) str_replace(',', '.', $thisfile_ape_items_current['data'][0]); // float casting will see "0,95" as zero!
$thisfile_replaygain['album']['originator'] = 'unspecified';
break;
case 'replaygain_album_peak':
$thisfile_replaygain['album']['peak'] = (float) str_replace(',', '.', $thisfile_ape_items_current['data'][0]); // float casting will see "0,95" as zero!
$thisfile_replaygain['album']['originator'] = 'unspecified';
if ($thisfile_replaygain['album']['peak'] <= 0) {
$ThisFileInfo['warning'][] = 'ReplayGain Album peak from APEtag appears invalid: '.$thisfile_replaygain['album']['peak'].' (original value = "'.$thisfile_ape_items_current['data'][0].'")';
}
break;
case 'mp3gain_undo':
list($mp3gain_undo_left, $mp3gain_undo_right, $mp3gain_undo_wrap) = explode(',', $thisfile_ape_items_current['data'][0]);
$thisfile_replaygain['mp3gain']['undo_left'] = intval($mp3gain_undo_left);
$thisfile_replaygain['mp3gain']['undo_right'] = intval($mp3gain_undo_right);
$thisfile_replaygain['mp3gain']['undo_wrap'] = (($mp3gain_undo_wrap == 'Y') ? true : false);
break;
case 'mp3gain_minmax':
list($mp3gain_globalgain_min, $mp3gain_globalgain_max) = explode(',', $thisfile_ape_items_current['data'][0]);
$thisfile_replaygain['mp3gain']['globalgain_track_min'] = intval($mp3gain_globalgain_min);
$thisfile_replaygain['mp3gain']['globalgain_track_max'] = intval($mp3gain_globalgain_max);
break;
case 'mp3gain_album_minmax':
list($mp3gain_globalgain_album_min, $mp3gain_globalgain_album_max) = explode(',', $thisfile_ape_items_current['data'][0]);
$thisfile_replaygain['mp3gain']['globalgain_album_min'] = intval($mp3gain_globalgain_album_min);
$thisfile_replaygain['mp3gain']['globalgain_album_max'] = intval($mp3gain_globalgain_album_max);
break;
case 'tracknumber':
foreach ($thisfile_ape_items_current['data'] as $comment) {
$thisfile_ape['comments']['track'][] = $comment;
}
break;
default:
foreach ($thisfile_ape_items_current['data'] as $comment) {
$thisfile_ape['comments'][strtolower($item_key)][] = $comment;
}
break;
}
}
if (empty($thisfile_replaygain)) {
unset($ThisFileInfo['replay_gain']);
}
return true;
}
function parseAPEheaderFooter($APEheaderFooterData) {
// http://www.uni-jena.de/~pfk/mpp/sv8/apeheader.html
// shortcut
$headerfooterinfo['raw'] = array();
$headerfooterinfo_raw = &$headerfooterinfo['raw'];
$headerfooterinfo_raw['footer_tag'] = substr($APEheaderFooterData, 0, 8);
if ($headerfooterinfo_raw['footer_tag'] != 'APETAGEX') {
return false;
}
$headerfooterinfo_raw['version'] = getid3_lib::LittleEndian2Int(substr($APEheaderFooterData, 8, 4));
$headerfooterinfo_raw['tagsize'] = getid3_lib::LittleEndian2Int(substr($APEheaderFooterData, 12, 4));
$headerfooterinfo_raw['tag_items'] = getid3_lib::LittleEndian2Int(substr($APEheaderFooterData, 16, 4));
$headerfooterinfo_raw['global_flags'] = getid3_lib::LittleEndian2Int(substr($APEheaderFooterData, 20, 4));
$headerfooterinfo_raw['reserved'] = substr($APEheaderFooterData, 24, 8);
$headerfooterinfo['tag_version'] = $headerfooterinfo_raw['version'] / 1000;
if ($headerfooterinfo['tag_version'] >= 2) {
$headerfooterinfo['flags'] = $this->parseAPEtagFlags($headerfooterinfo_raw['global_flags']);
}
return $headerfooterinfo;
}
function parseAPEtagFlags($rawflagint) {
// "Note: APE Tags 1.0 do not use any of the APE Tag flags.
// All are set to zero on creation and ignored on reading."
// http://www.uni-jena.de/~pfk/mpp/sv8/apetagflags.html
$flags['header'] = (bool) ($rawflagint & 0x80000000);
$flags['footer'] = (bool) ($rawflagint & 0x40000000);
$flags['this_is_header'] = (bool) ($rawflagint & 0x20000000);
$flags['item_contents_raw'] = ($rawflagint & 0x00000006) >> 1;
$flags['read_only'] = (bool) ($rawflagint & 0x00000001);
$flags['item_contents'] = $this->APEcontentTypeFlagLookup($flags['item_contents_raw']);
return $flags;
}
function APEcontentTypeFlagLookup($contenttypeid) {
static $APEcontentTypeFlagLookup = array(
0 => 'utf-8',
1 => 'binary',
2 => 'external',
3 => 'reserved'
);
return (isset($APEcontentTypeFlagLookup[$contenttypeid]) ? $APEcontentTypeFlagLookup[$contenttypeid] : 'invalid');
}
function APEtagItemIsUTF8Lookup($itemkey) {
static $APEtagItemIsUTF8Lookup = array(
'title',
'subtitle',
'artist',
'album',
'debut album',
'publisher',
'conductor',
'track',
'composer',
'comment',
'copyright',
'publicationright',
'file',
'year',
'record date',
'record location',
'genre',
'media',
'related',
'isrc',
'abstract',
'language',
'bibliography'
);
return in_array(strtolower($itemkey), $APEtagItemIsUTF8Lookup);
}
}
?>

View File

@ -0,0 +1,356 @@
<?php
/////////////////////////////////////////////////////////////////
/// getID3() by James Heinrich <info@getid3.org> //
// available at http://getid3.sourceforge.net //
// or http://www.getid3.org //
/////////////////////////////////////////////////////////////////
// See readme.txt for more details //
/////////////////////////////////////////////////////////////////
// //
// module.tag.id3v1.php //
// module for analyzing ID3v1 tags //
// dependencies: NONE //
// ///
/////////////////////////////////////////////////////////////////
class getid3_id3v1
{
function getid3_id3v1(&$fd, &$ThisFileInfo) {
fseek($fd, -256, SEEK_END);
$preid3v1 = fread($fd, 128);
$id3v1tag = fread($fd, 128);
if (substr($id3v1tag, 0, 3) == 'TAG') {
$ThisFileInfo['avdataend'] = $ThisFileInfo['filesize'] - 128;
$ParsedID3v1['title'] = $this->cutfield(substr($id3v1tag, 3, 30));
$ParsedID3v1['artist'] = $this->cutfield(substr($id3v1tag, 33, 30));
$ParsedID3v1['album'] = $this->cutfield(substr($id3v1tag, 63, 30));
$ParsedID3v1['year'] = $this->cutfield(substr($id3v1tag, 93, 4));
$ParsedID3v1['comment'] = substr($id3v1tag, 97, 30); // can't remove nulls yet, track detection depends on them
$ParsedID3v1['genreid'] = ord(substr($id3v1tag, 127, 1));
// If second-last byte of comment field is null and last byte of comment field is non-null
// then this is ID3v1.1 and the comment field is 28 bytes long and the 30th byte is the track number
if (($id3v1tag{125} === "\x00") && ($id3v1tag{126} !== "\x00")) {
$ParsedID3v1['track'] = ord(substr($ParsedID3v1['comment'], 29, 1));
$ParsedID3v1['comment'] = substr($ParsedID3v1['comment'], 0, 28);
}
$ParsedID3v1['comment'] = $this->cutfield($ParsedID3v1['comment']);
$ParsedID3v1['genre'] = $this->LookupGenreName($ParsedID3v1['genreid']);
if (!empty($ParsedID3v1['genre'])) {
unset($ParsedID3v1['genreid']);
}
if (empty($ParsedID3v1['genre']) || (@$ParsedID3v1['genre'] == 'Unknown')) {
unset($ParsedID3v1['genre']);
}
foreach ($ParsedID3v1 as $key => $value) {
$ParsedID3v1['comments'][$key][0] = $value;
}
// ID3v1 data is supposed to be padded with NULL characters, but some taggers pad with spaces
$GoodFormatID3v1tag = $this->GenerateID3v1Tag(
$ParsedID3v1['title'],
$ParsedID3v1['artist'],
$ParsedID3v1['album'],
$ParsedID3v1['year'],
$this->LookupGenreID(@$ParsedID3v1['genre']),
$ParsedID3v1['comment'],
@$ParsedID3v1['track']);
$ParsedID3v1['padding_valid'] = true;
if ($id3v1tag !== $GoodFormatID3v1tag) {
$ParsedID3v1['padding_valid'] = false;
$ThisFileInfo['warning'][] = 'Some ID3v1 fields do not use NULL characters for padding';
}
$ParsedID3v1['tag_offset_end'] = $ThisFileInfo['filesize'];
$ParsedID3v1['tag_offset_start'] = $ParsedID3v1['tag_offset_end'] - 128;
$ThisFileInfo['id3v1'] = $ParsedID3v1;
}
if (substr($preid3v1, 0, 3) == 'TAG') {
// The way iTunes handles tags is, well, brain-damaged.
// It completely ignores v1 if ID3v2 is present.
// This goes as far as adding a new v1 tag *even if there already is one*
// A suspected double-ID3v1 tag has been detected, but it could be that
// the "TAG" identifier is a legitimate part of an APE or Lyrics3 tag
if (substr($preid3v1, 96, 8) == 'APETAGEX') {
// an APE tag footer was found before the last ID3v1, assume false "TAG" synch
} elseif (substr($preid3v1, 119, 6) == 'LYRICS') {
// a Lyrics3 tag footer was found before the last ID3v1, assume false "TAG" synch
} else {
// APE and Lyrics3 footers not found - assume double ID3v1
$ThisFileInfo['warning'][] = 'Duplicate ID3v1 tag detected - this has been known to happen with iTunes';
$ThisFileInfo['avdataend'] -= 128;
}
}
return true;
}
function cutfield($str) {
return trim(substr($str, 0, strcspn($str, "\x00")));
}
function ArrayOfGenres($allowSCMPXextended=false) {
static $GenreLookup = array(
0 => 'Blues',
1 => 'Classic Rock',
2 => 'Country',
3 => 'Dance',
4 => 'Disco',
5 => 'Funk',
6 => 'Grunge',
7 => 'Hip-Hop',
8 => 'Jazz',
9 => 'Metal',
10 => 'New Age',
11 => 'Oldies',
12 => 'Other',
13 => 'Pop',
14 => 'R&B',
15 => 'Rap',
16 => 'Reggae',
17 => 'Rock',
18 => 'Techno',
19 => 'Industrial',
20 => 'Alternative',
21 => 'Ska',
22 => 'Death Metal',
23 => 'Pranks',
24 => 'Soundtrack',
25 => 'Euro-Techno',
26 => 'Ambient',
27 => 'Trip-Hop',
28 => 'Vocal',
29 => 'Jazz+Funk',
30 => 'Fusion',
31 => 'Trance',
32 => 'Classical',
33 => 'Instrumental',
34 => 'Acid',
35 => 'House',
36 => 'Game',
37 => 'Sound Clip',
38 => 'Gospel',
39 => 'Noise',
40 => 'Alt. Rock',
41 => 'Bass',
42 => 'Soul',
43 => 'Punk',
44 => 'Space',
45 => 'Meditative',
46 => 'Instrumental Pop',
47 => 'Instrumental Rock',
48 => 'Ethnic',
49 => 'Gothic',
50 => 'Darkwave',
51 => 'Techno-Industrial',
52 => 'Electronic',
53 => 'Pop-Folk',
54 => 'Eurodance',
55 => 'Dream',
56 => 'Southern Rock',
57 => 'Comedy',
58 => 'Cult',
59 => 'Gangsta Rap',
60 => 'Top 40',
61 => 'Christian Rap',
62 => 'Pop/Funk',
63 => 'Jungle',
64 => 'Native American',
65 => 'Cabaret',
66 => 'New Wave',
67 => 'Psychedelic',
68 => 'Rave',
69 => 'Showtunes',
70 => 'Trailer',
71 => 'Lo-Fi',
72 => 'Tribal',
73 => 'Acid Punk',
74 => 'Acid Jazz',
75 => 'Polka',
76 => 'Retro',
77 => 'Musical',
78 => 'Rock & Roll',
79 => 'Hard Rock',
80 => 'Folk',
81 => 'Folk/Rock',
82 => 'National Folk',
83 => 'Swing',
84 => 'Fast-Fusion',
85 => 'Bebob',
86 => 'Latin',
87 => 'Revival',
88 => 'Celtic',
89 => 'Bluegrass',
90 => 'Avantgarde',
91 => 'Gothic Rock',
92 => 'Progressive Rock',
93 => 'Psychedelic Rock',
94 => 'Symphonic Rock',
95 => 'Slow Rock',
96 => 'Big Band',
97 => 'Chorus',
98 => 'Easy Listening',
99 => 'Acoustic',
100 => 'Humour',
101 => 'Speech',
102 => 'Chanson',
103 => 'Opera',
104 => 'Chamber Music',
105 => 'Sonata',
106 => 'Symphony',
107 => 'Booty Bass',
108 => 'Primus',
109 => 'Porn Groove',
110 => 'Satire',
111 => 'Slow Jam',
112 => 'Club',
113 => 'Tango',
114 => 'Samba',
115 => 'Folklore',
116 => 'Ballad',
117 => 'Power Ballad',
118 => 'Rhythmic Soul',
119 => 'Freestyle',
120 => 'Duet',
121 => 'Punk Rock',
122 => 'Drum Solo',
123 => 'A Cappella',
124 => 'Euro-House',
125 => 'Dance Hall',
126 => 'Goa',
127 => 'Drum & Bass',
128 => 'Club-House',
129 => 'Hardcore',
130 => 'Terror',
131 => 'Indie',
132 => 'BritPop',
133 => 'Negerpunk',
134 => 'Polsk Punk',
135 => 'Beat',
136 => 'Christian Gangsta Rap',
137 => 'Heavy Metal',
138 => 'Black Metal',
139 => 'Crossover',
140 => 'Contemporary Christian',
141 => 'Christian Rock',
142 => 'Merengue',
143 => 'Salsa',
144 => 'Trash Metal',
145 => 'Anime',
146 => 'JPop',
147 => 'Synthpop',
255 => 'Unknown',
'CR' => 'Cover',
'RX' => 'Remix'
);
static $GenreLookupSCMPX = array();
if ($allowSCMPXextended && empty($GenreLookupSCMPX)) {
$GenreLookupSCMPX = $GenreLookup;
// http://www.geocities.co.jp/SiliconValley-Oakland/3664/alittle.html#GenreExtended
// Extended ID3v1 genres invented by SCMPX
// Note that 255 "Japanese Anime" conflicts with standard "Unknown"
$GenreLookupSCMPX[240] = 'Sacred';
$GenreLookupSCMPX[241] = 'Northern Europe';
$GenreLookupSCMPX[242] = 'Irish & Scottish';
$GenreLookupSCMPX[243] = 'Scotland';
$GenreLookupSCMPX[244] = 'Ethnic Europe';
$GenreLookupSCMPX[245] = 'Enka';
$GenreLookupSCMPX[246] = 'Children\'s Song';
$GenreLookupSCMPX[247] = 'Japanese Sky';
$GenreLookupSCMPX[248] = 'Japanese Heavy Rock';
$GenreLookupSCMPX[249] = 'Japanese Doom Rock';
$GenreLookupSCMPX[250] = 'Japanese J-POP';
$GenreLookupSCMPX[251] = 'Japanese Seiyu';
$GenreLookupSCMPX[252] = 'Japanese Ambient Techno';
$GenreLookupSCMPX[253] = 'Japanese Moemoe';
$GenreLookupSCMPX[254] = 'Japanese Tokusatsu';
//$GenreLookupSCMPX[255] = 'Japanese Anime';
}
return ($allowSCMPXextended ? $GenreLookupSCMPX : $GenreLookup);
}
function LookupGenreName($genreid, $allowSCMPXextended=true) {
switch ($genreid) {
case 'RX':
case 'CR':
break;
default:
$genreid = intval($genreid); // to handle 3 or '3' or '03'
break;
}
$GenreLookup = getid3_id3v1::ArrayOfGenres($allowSCMPXextended);
return (isset($GenreLookup[$genreid]) ? $GenreLookup[$genreid] : false);
}
function LookupGenreID($genre, $allowSCMPXextended=false) {
$GenreLookup = getid3_id3v1::ArrayOfGenres($allowSCMPXextended);
$LowerCaseNoSpaceSearchTerm = strtolower(str_replace(' ', '', $genre));
foreach ($GenreLookup as $key => $value) {
foreach ($GenreLookup as $key => $value) {
if (strtolower(str_replace(' ', '', $value)) == $LowerCaseNoSpaceSearchTerm) {
return $key;
}
}
return false;
}
return (isset($GenreLookup[$genreid]) ? $GenreLookup[$genreid] : false);
}
function StandardiseID3v1GenreName($OriginalGenre) {
if (($GenreID = getid3_id3v1::LookupGenreID($OriginalGenre)) !== false) {
return getid3_id3v1::LookupGenreName($GenreID);
}
return $OriginalGenre;
}
function GenerateID3v1Tag($title, $artist, $album, $year, $genreid, $comment, $track='') {
$ID3v1Tag = 'TAG';
$ID3v1Tag .= str_pad(trim(substr($title, 0, 30)), 30, "\x00", STR_PAD_RIGHT);
$ID3v1Tag .= str_pad(trim(substr($artist, 0, 30)), 30, "\x00", STR_PAD_RIGHT);
$ID3v1Tag .= str_pad(trim(substr($album, 0, 30)), 30, "\x00", STR_PAD_RIGHT);
$ID3v1Tag .= str_pad(trim(substr($year, 0, 4)), 4, "\x00", STR_PAD_LEFT);
if (!empty($track) && ($track > 0) && ($track <= 255)) {
$ID3v1Tag .= str_pad(trim(substr($comment, 0, 28)), 28, "\x00", STR_PAD_RIGHT);
$ID3v1Tag .= "\x00";
if (gettype($track) == 'string') {
$track = (int) $track;
}
$ID3v1Tag .= chr($track);
} else {
$ID3v1Tag .= str_pad(trim(substr($comment, 0, 30)), 30, "\x00", STR_PAD_RIGHT);
}
if (($genreid < 0) || ($genreid > 147)) {
$genreid = 255; // 'unknown' genre
}
switch (gettype($genreid)) {
case 'string':
case 'integer':
$ID3v1Tag .= chr(intval($genreid));
break;
default:
$ID3v1Tag .= chr(255); // 'unknown' genre
break;
}
return $ID3v1Tag;
}
}
?>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,271 @@
<?php
/////////////////////////////////////////////////////////////////
/// getID3() by James Heinrich <info@getid3.org> //
// available at http://getid3.sourceforge.net //
// or http://www.getid3.org //
/////////////////////////////////////////////////////////////////
// See readme.txt for more details //
/////////////////////////////////////////////////////////////////
/// //
// module.tag.lyrics3.php //
// module for analyzing Lyrics3 tags //
// dependencies: module.tag.apetag.php (optional) //
// ///
/////////////////////////////////////////////////////////////////
class getid3_lyrics3
{
function getid3_lyrics3(&$fd, &$ThisFileInfo) {
// http://www.volweb.cz/str/tags.htm
fseek($fd, (0 - 128 - 9 - 6), SEEK_END); // end - ID3v1 - LYRICSEND - [Lyrics3size]
$lyrics3_id3v1 = fread($fd, 128 + 9 + 6);
$lyrics3lsz = substr($lyrics3_id3v1, 0, 6); // Lyrics3size
$lyrics3end = substr($lyrics3_id3v1, 6, 9); // LYRICSEND or LYRICS200
$id3v1tag = substr($lyrics3_id3v1, 15, 128); // ID3v1
if ($lyrics3end == 'LYRICSEND') {
// Lyrics3v1, ID3v1, no APE
$lyrics3size = 5100;
$lyrics3offset = $ThisFileInfo['filesize'] - 128 - $lyrics3size;
$lyrics3version = 1;
} elseif ($lyrics3end == 'LYRICS200') {
// Lyrics3v2, ID3v1, no APE
// LSZ = lyrics + 'LYRICSBEGIN'; add 6-byte size field; add 'LYRICS200'
$lyrics3size = $lyrics3lsz + 6 + strlen('LYRICS200');
$lyrics3offset = $ThisFileInfo['filesize'] - 128 - $lyrics3size;
$lyrics3version = 2;
} elseif (substr(strrev($lyrics3_id3v1), 0, 9) == strrev('LYRICSEND')) {
// Lyrics3v1, no ID3v1, no APE
$lyrics3size = 5100;
$lyrics3offset = $ThisFileInfo['filesize'] - $lyrics3size;
$lyrics3version = 1;
$lyrics3offset = $ThisFileInfo['filesize'] - $lyrics3size;
} elseif (substr(strrev($lyrics3_id3v1), 0, 9) == strrev('LYRICS200')) {
// Lyrics3v2, no ID3v1, no APE
$lyrics3size = strrev(substr(strrev($lyrics3_id3v1), 9, 6)) + 6 + strlen('LYRICS200'); // LSZ = lyrics + 'LYRICSBEGIN'; add 6-byte size field; add 'LYRICS200'
$lyrics3offset = $ThisFileInfo['filesize'] - $lyrics3size;
$lyrics3version = 2;
} else {
if (isset($ThisFileInfo['ape']['tag_offset_start']) && ($ThisFileInfo['ape']['tag_offset_start'] > 15)) {
fseek($fd, $ThisFileInfo['ape']['tag_offset_start'] - 15, SEEK_SET);
$lyrics3lsz = fread($fd, 6);
$lyrics3end = fread($fd, 9);
if ($lyrics3end == 'LYRICSEND') {
// Lyrics3v1, APE, maybe ID3v1
$lyrics3size = 5100;
$lyrics3offset = $ThisFileInfo['ape']['tag_offset_start'] - $lyrics3size;
$ThisFileInfo['avdataend'] = $lyrics3offset;
$lyrics3version = 1;
$ThisFileInfo['warning'][] = 'APE tag located after Lyrics3, will probably break Lyrics3 compatability';
} elseif ($lyrics3end == 'LYRICS200') {
// Lyrics3v2, APE, maybe ID3v1
$lyrics3size = $lyrics3lsz + 6 + strlen('LYRICS200'); // LSZ = lyrics + 'LYRICSBEGIN'; add 6-byte size field; add 'LYRICS200'
$lyrics3offset = $ThisFileInfo['ape']['tag_offset_start'] - $lyrics3size;
$lyrics3version = 2;
$ThisFileInfo['warning'][] = 'APE tag located after Lyrics3, will probably break Lyrics3 compatability';
}
}
}
if (isset($lyrics3offset)) {
$ThisFileInfo['avdataend'] = $lyrics3offset;
$this->getLyrics3Data($ThisFileInfo, $fd, $lyrics3offset, $lyrics3version, $lyrics3size);
if (!isset($ThisFileInfo['ape'])) {
$GETID3_ERRORARRAY = &$ThisFileInfo['warning'];
if (getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.apetag.php', __FILE__, false)) {
$tag = new getid3_apetag($fd, $ThisFileInfo, $ThisFileInfo['lyrics3']['tag_offset_start']);
}
}
}
return true;
}
function getLyrics3Data(&$ThisFileInfo, &$fd, $endoffset, $version, $length) {
// http://www.volweb.cz/str/tags.htm
fseek($fd, $endoffset, SEEK_SET);
if ($length <= 0) {
return false;
}
$rawdata = fread($fd, $length);
if (substr($rawdata, 0, 11) != 'LYRICSBEGIN') {
if (strpos($rawdata, 'LYRICSBEGIN') !== false) {
$ThisFileInfo['warning'][] = '"LYRICSBEGIN" expected at '.$endoffset.' but actually found at '.($endoffset + strpos($rawdata, 'LYRICSBEGIN')).' - this is invalid for Lyrics3 v'.$version;
$ThisFileInfo['avdataend'] = $endoffset + strpos($rawdata, 'LYRICSBEGIN');
$ParsedLyrics3['tag_offset_start'] = $ThisFileInfo['avdataend'];
$rawdata = substr($rawdata, strpos($rawdata, 'LYRICSBEGIN'));
$length = strlen($rawdata);
} else {
$ThisFileInfo['error'][] = '"LYRICSBEGIN" expected at '.$endoffset.' but found "'.substr($rawdata, 0, 11).'" instead';
return false;
}
}
$ParsedLyrics3['raw']['lyrics3version'] = $version;
$ParsedLyrics3['raw']['lyrics3tagsize'] = $length;
$ParsedLyrics3['tag_offset_start'] = $endoffset;
$ParsedLyrics3['tag_offset_end'] = $endoffset + $length;
switch ($version) {
case 1:
if (substr($rawdata, strlen($rawdata) - 9, 9) == 'LYRICSEND') {
$ParsedLyrics3['raw']['LYR'] = trim(substr($rawdata, 11, strlen($rawdata) - 11 - 9));
$this->Lyrics3LyricsTimestampParse($ParsedLyrics3);
} else {
$ThisFileInfo['error'][] = '"LYRICSEND" expected at '.(ftell($fd) - 11 + $length - 9).' but found "'.substr($rawdata, strlen($rawdata) - 9, 9).'" instead';
return false;
}
break;
case 2:
if (substr($rawdata, strlen($rawdata) - 9, 9) == 'LYRICS200') {
$ParsedLyrics3['raw']['unparsed'] = substr($rawdata, 11, strlen($rawdata) - 11 - 9 - 6); // LYRICSBEGIN + LYRICS200 + LSZ
$rawdata = $ParsedLyrics3['raw']['unparsed'];
while (strlen($rawdata) > 0) {
$fieldname = substr($rawdata, 0, 3);
$fieldsize = (int) substr($rawdata, 3, 5);
$ParsedLyrics3['raw'][$fieldname] = substr($rawdata, 8, $fieldsize);
$rawdata = substr($rawdata, 3 + 5 + $fieldsize);
}
if (isset($ParsedLyrics3['raw']['IND'])) {
$i = 0;
$flagnames = array('lyrics', 'timestamps', 'inhibitrandom');
foreach ($flagnames as $flagname) {
if (strlen($ParsedLyrics3['raw']['IND']) > ++$i) {
$ParsedLyrics3['flags'][$flagname] = $this->IntString2Bool(substr($ParsedLyrics3['raw']['IND'], $i, 1));
}
}
}
$fieldnametranslation = array('ETT'=>'title', 'EAR'=>'artist', 'EAL'=>'album', 'INF'=>'comment', 'AUT'=>'author');
foreach ($fieldnametranslation as $key => $value) {
if (isset($ParsedLyrics3['raw'][$key])) {
$ParsedLyrics3['comments'][$value][] = trim($ParsedLyrics3['raw'][$key]);
}
}
if (isset($ParsedLyrics3['raw']['IMG'])) {
$imagestrings = explode("\r\n", $ParsedLyrics3['raw']['IMG']);
foreach ($imagestrings as $key => $imagestring) {
if (strpos($imagestring, '||') !== false) {
$imagearray = explode('||', $imagestring);
$ParsedLyrics3['images'][$key]['filename'] = $imagearray[0];
$ParsedLyrics3['images'][$key]['description'] = $imagearray[1];
$ParsedLyrics3['images'][$key]['timestamp'] = $this->Lyrics3Timestamp2Seconds($imagearray[2]);
}
}
}
if (isset($ParsedLyrics3['raw']['LYR'])) {
$this->Lyrics3LyricsTimestampParse($ParsedLyrics3);
}
} else {
$ThisFileInfo['error'][] = '"LYRICS200" expected at '.(ftell($fd) - 11 + $length - 9).' but found "'.substr($rawdata, strlen($rawdata) - 9, 9).'" instead';
return false;
}
break;
default:
$ThisFileInfo['error'][] = 'Cannot process Lyrics3 version '.$version.' (only v1 and v2)';
return false;
break;
}
if (isset($ThisFileInfo['id3v1']['tag_offset_start']) && ($ThisFileInfo['id3v1']['tag_offset_start'] < $ParsedLyrics3['tag_offset_end'])) {
$ThisFileInfo['warning'][] = 'ID3v1 tag information ignored since it appears to be a false synch in Lyrics3 tag data';
unset($ThisFileInfo['id3v1']);
foreach ($ThisFileInfo['warning'] as $key => $value) {
if ($value == 'Some ID3v1 fields do not use NULL characters for padding') {
unset($ThisFileInfo['warning'][$key]);
sort($ThisFileInfo['warning']);
break;
}
}
}
$ThisFileInfo['lyrics3'] = $ParsedLyrics3;
return true;
}
function Lyrics3Timestamp2Seconds($rawtimestamp) {
if (ereg('^\\[([0-9]{2}):([0-9]{2})\\]$', $rawtimestamp, $regs)) {
return (int) (($regs[1] * 60) + $regs[2]);
}
return false;
}
function Lyrics3LyricsTimestampParse(&$Lyrics3data) {
$lyricsarray = explode("\r\n", $Lyrics3data['raw']['LYR']);
foreach ($lyricsarray as $key => $lyricline) {
$regs = array();
unset($thislinetimestamps);
while (ereg('^(\\[[0-9]{2}:[0-9]{2}\\])', $lyricline, $regs)) {
$thislinetimestamps[] = $this->Lyrics3Timestamp2Seconds($regs[0]);
$lyricline = str_replace($regs[0], '', $lyricline);
}
$notimestamplyricsarray[$key] = $lyricline;
if (isset($thislinetimestamps) && is_array($thislinetimestamps)) {
sort($thislinetimestamps);
foreach ($thislinetimestamps as $timestampkey => $timestamp) {
if (isset($Lyrics3data['synchedlyrics'][$timestamp])) {
// timestamps only have a 1-second resolution, it's possible that multiple lines
// could have the same timestamp, if so, append
$Lyrics3data['synchedlyrics'][$timestamp] .= "\r\n".$lyricline;
} else {
$Lyrics3data['synchedlyrics'][$timestamp] = $lyricline;
}
}
}
}
$Lyrics3data['unsynchedlyrics'] = implode("\r\n", $notimestamplyricsarray);
if (isset($Lyrics3data['synchedlyrics']) && is_array($Lyrics3data['synchedlyrics'])) {
ksort($Lyrics3data['synchedlyrics']);
}
return true;
}
function IntString2Bool($char) {
if ($char == '1') {
return true;
} elseif ($char == '0') {
return false;
}
return null;
}
}
?>

228
data/flash/write.apetag.php Normal file
View File

@ -0,0 +1,228 @@
<?php
/////////////////////////////////////////////////////////////////
/// getID3() by James Heinrich <info@getid3.org> //
// available at http://getid3.sourceforge.net //
// or http://www.getid3.org //
/////////////////////////////////////////////////////////////////
// See readme.txt for more details //
/////////////////////////////////////////////////////////////////
// //
// write.apetag.php //
// module for writing APE tags //
// dependencies: module.tag.apetag.php //
// ///
/////////////////////////////////////////////////////////////////
getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.apetag.php', __FILE__, true);
class getid3_write_apetag
{
var $filename;
var $tag_data;
var $always_preserve_replaygain = true; // ReplayGain / MP3gain tags will be copied from old tag even if not passed in data
var $warnings = array(); // any non-critical errors will be stored here
var $errors = array(); // any critical errors will be stored here
function getid3_write_apetag() {
return true;
}
function WriteAPEtag() {
// NOTE: All data passed to this function must be UTF-8 format
$getID3 = new getID3;
$ThisFileInfo = $getID3->analyze($this->filename);
if (isset($ThisFileInfo['ape']['tag_offset_start']) && isset($ThisFileInfo['lyrics3']['tag_offset_end'])) {
if ($ThisFileInfo['ape']['tag_offset_start'] >= $ThisFileInfo['lyrics3']['tag_offset_end']) {
// Current APE tag between Lyrics3 and ID3v1/EOF
// This break Lyrics3 functionality
if (!$this->DeleteAPEtag()) {
return false;
}
$ThisFileInfo = $getID3->analyze($this->filename);
}
}
if ($this->always_preserve_replaygain) {
$ReplayGainTagsToPreserve = array('mp3gain_minmax', 'mp3gain_album_minmax', 'mp3gain_undo', 'replaygain_track_peak', 'replaygain_track_gain', 'replaygain_album_peak', 'replaygain_album_gain');
foreach ($ReplayGainTagsToPreserve as $rg_key) {
if (isset($ThisFileInfo['ape']['items'][strtolower($rg_key)]['data'][0]) && !isset($this->tag_data[strtoupper($rg_key)][0])) {
$this->tag_data[strtoupper($rg_key)][0] = $ThisFileInfo['ape']['items'][strtolower($rg_key)]['data'][0];
}
}
}
if ($APEtag = $this->GenerateAPEtag()) {
if ($fp = @fopen($this->filename, 'a+b')) {
$oldignoreuserabort = ignore_user_abort(true);
flock($fp, LOCK_EX);
$PostAPEdataOffset = $ThisFileInfo['avdataend'];
if (isset($ThisFileInfo['ape']['tag_offset_end'])) {
$PostAPEdataOffset = max($PostAPEdataOffset, $ThisFileInfo['ape']['tag_offset_end']);
}
if (isset($ThisFileInfo['lyrics3']['tag_offset_start'])) {
$PostAPEdataOffset = max($PostAPEdataOffset, $ThisFileInfo['lyrics3']['tag_offset_start']);
}
fseek($fp, $PostAPEdataOffset, SEEK_SET);
$PostAPEdata = '';
if ($ThisFileInfo['filesize'] > $PostAPEdataOffset) {
$PostAPEdata = fread($fp, $ThisFileInfo['filesize'] - $PostAPEdataOffset);
}
fseek($fp, $PostAPEdataOffset, SEEK_SET);
if (isset($ThisFileInfo['ape']['tag_offset_start'])) {
fseek($fp, $ThisFileInfo['ape']['tag_offset_start'], SEEK_SET);
}
ftruncate($fp, ftell($fp));
fwrite($fp, $APEtag, strlen($APEtag));
if (!empty($PostAPEdata)) {
fwrite($fp, $PostAPEdata, strlen($PostAPEdata));
}
flock($fp, LOCK_UN);
fclose($fp);
ignore_user_abort($oldignoreuserabort);
return true;
}
return false;
}
return false;
}
function DeleteAPEtag() {
$getID3 = new getID3;
$ThisFileInfo = $getID3->analyze($this->filename);
if (isset($ThisFileInfo['ape']['tag_offset_start']) && isset($ThisFileInfo['ape']['tag_offset_end'])) {
if ($fp = @fopen($this->filename, 'a+b')) {
flock($fp, LOCK_EX);
$oldignoreuserabort = ignore_user_abort(true);
fseek($fp, $ThisFileInfo['ape']['tag_offset_end'], SEEK_SET);
$DataAfterAPE = '';
if ($ThisFileInfo['filesize'] > $ThisFileInfo['ape']['tag_offset_end']) {
$DataAfterAPE = fread($fp, $ThisFileInfo['filesize'] - $ThisFileInfo['ape']['tag_offset_end']);
}
ftruncate($fp, $ThisFileInfo['ape']['tag_offset_start']);
fseek($fp, $ThisFileInfo['ape']['tag_offset_start'], SEEK_SET);
if (!empty($DataAfterAPE)) {
fwrite($fp, $DataAfterAPE, strlen($DataAfterAPE));
}
flock($fp, LOCK_UN);
fclose($fp);
ignore_user_abort($oldignoreuserabort);
return true;
}
return false;
}
return true;
}
function GenerateAPEtag() {
// NOTE: All data passed to this function must be UTF-8 format
$items = array();
if (!is_array($this->tag_data)) {
return false;
}
foreach ($this->tag_data as $key => $arrayofvalues) {
if (!is_array($arrayofvalues)) {
return false;
}
$valuestring = '';
foreach ($arrayofvalues as $value) {
$valuestring .= str_replace("\x00", '', $value)."\x00";
}
$valuestring = rtrim($valuestring, "\x00");
// Length of the assigned value in bytes
$tagitem = getid3_lib::LittleEndian2String(strlen($valuestring), 4);
//$tagitem .= $this->GenerateAPEtagFlags(true, true, false, 0, false);
$tagitem .= "\x00\x00\x00\x00";
$tagitem .= $this->CleanAPEtagItemKey($key)."\x00";
$tagitem .= $valuestring;
$items[] = $tagitem;
}
return $this->GenerateAPEtagHeaderFooter($items, true).implode('', $items).$this->GenerateAPEtagHeaderFooter($items, false);
}
function GenerateAPEtagHeaderFooter(&$items, $isheader=false) {
$tagdatalength = 0;
foreach ($items as $itemdata) {
$tagdatalength += strlen($itemdata);
}
$APEheader = 'APETAGEX';
$APEheader .= getid3_lib::LittleEndian2String(2000, 4);
$APEheader .= getid3_lib::LittleEndian2String(32 + $tagdatalength, 4);
$APEheader .= getid3_lib::LittleEndian2String(count($items), 4);
$APEheader .= $this->GenerateAPEtagFlags(true, true, $isheader, 0, false);
$APEheader .= str_repeat("\x00", 8);
return $APEheader;
}
function GenerateAPEtagFlags($header=true, $footer=true, $isheader=false, $encodingid=0, $readonly=false) {
$APEtagFlags = array_fill(0, 4, 0);
if ($header) {
$APEtagFlags[0] |= 0x80; // Tag contains a header
}
if (!$footer) {
$APEtagFlags[0] |= 0x40; // Tag contains no footer
}
if ($isheader) {
$APEtagFlags[0] |= 0x20; // This is the header, not the footer
}
// 0: Item contains text information coded in UTF-8
// 1: Item contains binary information °)
// 2: Item is a locator of external stored information °°)
// 3: reserved
$APEtagFlags[3] |= ($encodingid << 1);
if ($readonly) {
$APEtagFlags[3] |= 0x01; // Tag or Item is Read Only
}
return chr($APEtagFlags[3]).chr($APEtagFlags[2]).chr($APEtagFlags[1]).chr($APEtagFlags[0]);
}
function CleanAPEtagItemKey($itemkey) {
$itemkey = eregi_replace("[^\x20-\x7E]", '', $itemkey);
// http://www.personal.uni-jena.de/~pfk/mpp/sv8/apekey.html
switch (strtoupper($itemkey)) {
case 'EAN/UPC':
case 'ISBN':
case 'LC':
case 'ISRC':
$itemkey = strtoupper($itemkey);
break;
default:
$itemkey = ucwords($itemkey);
break;
}
return $itemkey;
}
}
?>

104
data/flash/write.id3v1.php Normal file
View File

@ -0,0 +1,104 @@
<?php
/////////////////////////////////////////////////////////////////
/// getID3() by James Heinrich <info@getid3.org> //
// available at http://getid3.sourceforge.net //
// or http://www.getid3.org //
/////////////////////////////////////////////////////////////////
// See readme.txt for more details //
/////////////////////////////////////////////////////////////////
// //
// write.id3v1.php //
// module for writing ID3v1 tags //
// dependencies: module.tag.id3v1.php //
// ///
/////////////////////////////////////////////////////////////////
getid3_lib::IncludeDependency(GETID3_INCLUDEPATH.'module.tag.id3v1.php', __FILE__, true);
class getid3_write_id3v1
{
var $filename;
var $tag_data;
var $warnings = array(); // any non-critical errors will be stored here
var $errors = array(); // any critical errors will be stored here
function getid3_write_id3v1() {
return true;
}
function WriteID3v1() {
// File MUST be writeable - CHMOD(646) at least
if (is_writeable($this->filename)) {
if ($fp_source = @fopen($this->filename, 'r+b')) {
fseek($fp_source, -128, SEEK_END);
if (fread($fp_source, 3) == 'TAG') {
fseek($fp_source, -128, SEEK_END); // overwrite existing ID3v1 tag
} else {
fseek($fp_source, 0, SEEK_END); // append new ID3v1 tag
}
$new_id3v1_tag_data = getid3_id3v1::GenerateID3v1Tag(
@$this->tag_data['title'],
@$this->tag_data['artist'],
@$this->tag_data['album'],
@$this->tag_data['year'],
@$this->tag_data['genreid'],
@$this->tag_data['comment'],
@$this->tag_data['track']);
fwrite($fp_source, $new_id3v1_tag_data, 128);
fclose($fp_source);
return true;
} else {
$this->errors[] = 'Could not open '.$this->filename.' mode "r+b"';
return false;
}
}
$this->errors[] = 'File is not writeable: '.$this->filename;
return false;
}
function FixID3v1Padding() {
// ID3v1 data is supposed to be padded with NULL characters, but some taggers incorrectly use spaces
// This function rewrites the ID3v1 tag with correct padding
// Initialize getID3 engine
$getID3 = new getID3;
$ThisFileInfo = $getID3->analyze($this->filename);
if (isset($ThisFileInfo['tags']['id3v1'])) {
foreach ($ThisFileInfo['tags']['id3v1'] as $key => $value) {
$id3v1data[$key] = implode(',', $value);
}
$this->tag_data = $id3v1data;
return $this->WriteID3v1();
}
return false;
}
function RemoveID3v1() {
// File MUST be writeable - CHMOD(646) at least
if (is_writeable($this->filename)) {
if ($fp_source = @fopen($this->filename, 'r+b')) {
fseek($fp_source, -128, SEEK_END);
if (fread($fp_source, 3) == 'TAG') {
ftruncate($fp_source, filesize($this->filename) - 128);
} else {
// no ID3v1 tag to begin with - do nothing
}
fclose($fp_source);
return true;
} else {
$this->errors[] = 'Could not open '.$this->filename.' mode "r+b"';
}
} else {
$this->errors[] = $this->filename.' is not writeable';
}
return false;
}
}
?>

2038
data/flash/write.id3v2.php Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
data/images/LOGODI-tx.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
data/images/Thumbs.db Normal file

Binary file not shown.

BIN
data/images/bg.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
data/images/bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 435 KiB

BIN
data/images/cc.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 B

BIN
data/images/cc.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 743 B

BIN
data/images/couple.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -0,0 +1 @@
Andoni||andoni@overalia.com

BIN
data/images/enredaderas.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -0,0 +1 @@
Andoni||andoni@overalia.com

BIN
data/images/frame-bio.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
data/images/frame-h.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1 @@
Andoni||andoni@overalia.com

BIN
data/images/frame-v.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 887 B

View File

@ -0,0 +1 @@
Andoni||andoni@overalia.com

BIN
data/images/frame.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

BIN
data/images/frame_m.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 765 B

BIN
data/images/gnet.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
data/images/h1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

BIN
data/images/h1_es.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

BIN
data/images/h1_eu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

BIN
data/images/h1_it.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

BIN
data/images/header_1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
data/images/li_bg.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 974 B

BIN
data/images/line-h.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 411 B

BIN
data/images/line.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
data/images/logo_ace.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

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