Added i18n (french)

This commit is contained in:
Samuel Ortion 2021-04-20 17:05:13 +02:00
parent 7e2c6c122c
commit 1e4ae8b19e
60 changed files with 2615 additions and 367 deletions

View File

@ -4,29 +4,9 @@ ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
session_start();
$root = realpath($_SERVER["DOCUMENT_ROOT"]);
require "$root/database/credentials.php";
// Connect the database
try {
$db = new PDO("mysql:host=$host;dbname=$database;charset=utf8",
$user,
$password,
array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
));
} catch (Exception $e) {
die("Error : ".$e->getMessage());
}
if (isset($_GET['record'])) {
$req = $db->prepare('SELECT id, recordist_name, file_name, license, species, sound_type, date, time FROM `records` WHERE id=:id');
$req->execute(array(
"id"=>$_GET['record']
));
} else {
$req = $db->prepare('SELECT id, recordist_name, file_name, license, species, sound_type, date, time FROM `records` ORDER BY date DESC, time DESC LIMIT 1');
$req->execute();
}
$data = $req->fetch();
$lang = isset($_COOKIE['lang']) ? $_COOKIE['lang'] : 'en';
require("$root/lang/gettext.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
@ -44,12 +24,12 @@ include("$root/analytics/owa.php");
<?php include("$root/menu.php");?>
<?php include("$root/header.php");?>
<section>
<h2>About</h2>
<p>Chiro-Canto is an online bat sound sharing set of tools, inspired by <a href="https://xeno-canto.org">Xeno-Canto</a>.</p>
<h3>Author</h3>
<p>This website is developped with &#9829; by Samuel ORTION, a juvenile <em>Geekus biologicus</em>.</p>
<h3>Source code</h3>
<p>This project is available under the GNU Affero GPL v3 license at <a href="https://forge.ortion.xyz/Chiro-Canto/chiro-canto">https://forge.ortion.xyz/Chiro-Canto/chiro-canto</a>.</p>
<h2><?=_('About')?></h2>
<p><?=_('Chiro-Canto is an online bat sound sharing set of tools, inspired by <a href="https://xeno-canto.org">Xeno-Canto</a>.')?></p>
<h3><?=_('Author')?></h3>
<p><?=_('This website is developped with &#9829; by Samuel ORTION, a juvenile <em>Geekus biologicus</em>.')?></p>
<h3><?=_('Source code')?></h3>
<p><?=_('This project is available under the GNU Affero GPL v3 license at <a href="https://forge.ortion.xyz/Chiro-Canto/chiro-canto">https://forge.ortion.xyz/Chiro-Canto/chiro-canto</a>.')?></p>
</section>
<?php include("$root/footer.php");?>
</body>

View File

@ -5,6 +5,8 @@ error_reporting(E_ALL);
$root = realpath($_SERVER["DOCUMENT_ROOT"]);
include("$root/vendor/erusev/parsedown/Parsedown.php");
$Parsedown = new Parsedown();
$lang = isset($_COOKIE['lang']) ? $_COOKIE['lang'] : 'en';
require("$root/lang/$lang/lang.php");
?>
<!DOCTYPE html>
<html lang="en">

View File

@ -8,7 +8,7 @@ ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
include("$root/vendor/erusev/parsedown/Parsedown.php");
$Parsedown = new Parsedown();
require("$root/lang/gettext.php");
function archive() {
global $root;
$results = array();

View File

@ -23,7 +23,7 @@ include("$root/analytics/owa.php");
<?php include("$root/menu.php");?>
<?php include("$root/header.php");?>
<section>
<h2>All Articles</h2>
<h2><?=_('All Articles')?></h2>
<?php if (isset($results['error'])) { ?>
<div class="error"><?php echo $results['error'] ?></div>
<?php }
@ -32,8 +32,8 @@ include("$root/analytics/owa.php");
<?php } ?>
<table>
<tr>
<th>Publication Date</th>
<th>Article</th>
<th><?=('Publication Date')?></th>
<th><?=_('Article')?></th>
</tr>
<?php foreach($results['articles'] as $article) { ?>
<tr>
@ -44,8 +44,8 @@ include("$root/analytics/owa.php");
</tr>
<?php } ?>
</table>
<p><a href="admin.php?action=new">New article</a></p>
<p><a href="./">Return to Homepage</a></p>
<p><a href="admin.php?action=new"><?=_('New article')?></a></p>
<p><a href="./"><?=_('Return to Homepage')?></a></p>
</section>
<?php include("$root/footer.php");?>

View File

@ -2,5 +2,5 @@
<h3><?php echo htmlspecialchars($results['articles'][0]->title)?></h3>
<div><?php echo $Parsedown->text(htmlspecialchars($results['articles'][0]->summary))?></div>
<div><?php echo $Parsedown->text(htmlspecialchars($results['articles'][0]->content))?></div>
<p class="pub-date">Published on <?php echo date('j F Y', $results['articles'][0]->publication_date)?></p>
<p><a href="./">Return to Homepage</a></p>
<p class="pub-date"><?=_('Published on ')?><?php echo date('j F Y', $results['articles'][0]->publication_date)?></p>
<p><a href="./"><?=_('Return to Homepage')?></a></p>

3
public/auth/index.php Normal file
View File

@ -0,0 +1,3 @@
<?php
header('Location: login');
?>

View File

@ -4,7 +4,7 @@ ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$root = realpath($_SERVER["DOCUMENT_ROOT"]);
require("$root/lang/gettext.php");
?>
<!DOCTYPE html>
@ -13,7 +13,7 @@ $root = realpath($_SERVER["DOCUMENT_ROOT"]);
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login | Chiro - Canto</title>
<title><?=_('Login')?> | Chiro - Canto</title>
<link rel="stylesheet" type="text/css" href="/styles/style.css">
</head>
<?php
@ -24,15 +24,16 @@ include("$root/analytics/owa.php");
<?php include("$root/menu.php");?>
<?php include("$root/header.php");?>
<section>
<h2>Login</h2>
<h2><?=_('Login')?></h2>
<?=(isset($_SESSION['error_msg']) and ! $_SESSION['error_msg'] == "" ) ? '<div class="error">'.$_SESSION['error_msg'].'</div>' : ""?>
<form action="login.php" method="post">
<label for="username">Username*</label>
<input id="username" type="text" name="username" placeholder="Enter your username.." required>
<label for="username"><?=_('Username')?>*</label>
<input id="username" type="text" name="username" placeholder="<?=_('Enter your username..')?>" required>
<label for="password">Password*</label>
<input type="password" name="password" id="password" placeholder="Enter your password.." required>
<input type="submit" name="submit" value="submit"><input type="reset" name="reset" value="reset">
<input type="password" name="password" id="password" placeholder="<?=_('Enter your password..')?>" required>
<input type="submit" name="submit" value="<?=_('submit')?>"><input type="reset" name="reset" value="<?=_('reset')?>">
</form>
<a href="/auth/register"><?=_('Not yet registered ?')?></a>
</section>
<?php include("$root/footer.php");?>
</body>

View File

@ -46,16 +46,16 @@ if (isset($_POST['submit']))
$username = $_POST['username'];
} else
{
$_SESSION['error_msg'] .= "You did not enter a proper username.\n";
$_SESSION['error_msg'] .= _('You did not enter a proper username.').'\n';
}
if (isset($_POST['password'])) {
$password = $_POST['password'];
} else {
$_SESSION['error_msg'] .= "You did not enter a proper password.\n";
$_SESSION['error_msg'] .= _('You did not enter a proper password.').'\n';
}
} else
{
$_SESSION['error_msg'] .= "You did not submit the register form.\n";
$_SESSION['error_msg'] .= _('You did not submit the register form.');
}
if ($_SESSION['error_msg'] == "")
@ -67,11 +67,11 @@ if ($_SESSION['error_msg'] == "")
$_SESSION['username'] = $username;
header('Location: '."/");
} else {
$_SESSION['error_msg'] = "Incorrect password, please try again.\n";
$_SESSION['error_msg'] = _('Incorrect password, please try again.').'\n';
header('Location: '."../../auth/login");
}
} else
{
// header('Location: '."../../auth/login");
header('Location: '."../../auth/login");
}
?>

View File

@ -4,6 +4,7 @@ ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$root = realpath($_SERVER["DOCUMENT_ROOT"]);
require("$root/lang/gettext.php");
?>
@ -13,7 +14,7 @@ $root = realpath($_SERVER["DOCUMENT_ROOT"]);
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Register | Chiro - Canto</title>
<title><?=_('Register')?> | Chiro - Canto</title>
<link rel="stylesheet" type="text/css" href="/styles/style.css">
</head>
<?php
@ -24,23 +25,24 @@ include("$root/analytics/owa.php");
<?php include("$root/menu.php");?>
<?php include("$root/header.php");?>
<section>
<h2>Register</h2>
<h2><?=_('Register')?></h2>
<?=(isset($_SESSION['error_msg']) and ! $_SESSION['error_msg'] == "") ? '<div class="error">'.$_SESSION['error_msg'].'</div>' : ""?>
<form action="register.php" method="post">
<label for="firstname">First Name*</label>
<label for="firstname"><?=_('First Name')?>*</label>
<input id="firstname" type="text" name="firstname" placeholder="John" required>
<label for="lastname">Last Name*</label>
<label for="lastname"><?=_('Last Name')?>*</label>
<input id="lastname" type="text" name="lastname" placeholder="Doe" required>
<label for="username">Username*</label>
<label for="username"><?=_('Username')?>*</label>
<input id="username" type="text" name="username" placeholder="jojo" required>
<label for="password">Password*</label>
<label for="password"><?=_('Password')?>*</label>
<input type="password" name="password" id="password" placeholder="************" required>
<label for="email">Your email*</label>
<label for="email"><?=_('Your email')?>*</label>
<input type="email" name="email" id="email" placeholder="john.doe@example.com" required>
<label for="website">Your website (optional)</label>
<label for="website"><?=_('Your website (optional)')?></label>
<input type="url" name="website" id="website" placeholder="https://example.com">
<input type="submit" name="submit" value="submit"><input type="reset" name="reset" value="reset">
<input type="submit" name="submit" value="<?=_('submit')?>"><input type="reset" name="reset" value="<?=_('reset')?>">
</form>
<a href="/auth/login"><?=_('Already registered ?')?></a>
</section>
<?php include("$root/footer.php");?>
</body>

View File

@ -38,38 +38,38 @@ if (isset($_POST['submit']))
$fname = $_POST['firstname'];
} else
{
$_SESSION['error_msg'] .= "You did not enter a proper first name.\n";
$_SESSION['error_msg'] .= _('You did not enter a proper first name.').'\n';
}
if (isset($_POST['lastname']))
{
$lname = $_POST['lastname'];
} else
{
$_SESSION['error_msg'] .= "You did not enter a proper last name.\n";
$_SESSION['error_msg'] .= _('You did not enter a proper last name.');
}
if (isset($_POST['username']))
{
$username = $_POST['username'];
} else
{
$_SESSION['error_msg'] .= "You did not enter a proper username.\n";
$_SESSION['error_msg'] .= _('You did not enter a proper username.').'\n';
}
if (isset($_POST['email']))
{
$email = $_POST['email'];
} else
{
$_SESSION['error_msg'] .= "You did not enter a proper email address.\n";
$_SESSION['error_msg'] .= _('You did not enter a proper email address.').'\n';
}
$website = isset($_POST['website']) ? $_POST['website'] : "";
if (isset($_POST['password'])) {
$password_hash = password_hash($_POST['password'], PASSWORD_DEFAULT);
} else {
$_SESSION['error_msg'] .= "You did not enter a proper password.\n";
$_SESSION['error_msg'] .= _('You did not enter a proper password.').'\n';
}
} else
{
$_SESSION['error_msg'] .= "You did not submit the register form.\n";
$_SESSION['error_msg'] .= _('You did not submit the register form.').'\n';
}
if ($_SESSION['error_msg'] == "")

View File

@ -1,5 +1,6 @@
<?php
$root = realpath($_SERVER["DOCUMENT_ROOT"]);
require("$root/lang/gettext.php");
?>
<!DOCTYPE html>
<html lang="en">
@ -18,28 +19,28 @@ include("$root/analytics/matomo.php");
<?php include("$root/menu.php"); ?>
<?php include("$root/header.php"); ?>
<section>
<h2>Contact</h2>
<h2><?=_('Contact')?></h2>
<article>
<form action="sendmail.php" method="post">
<label for="fname">First Name*</label>
<input type="text" id="fname" name="firstname" placeholder="Your first name.." required><br>
<label for="fname"><?=_('First Name')?>*</label>
<input type="text" id="fname" name="firstname" placeholder="<?=_('Your first name..')?>" required><br>
<label for="lname">Last Name*</label>
<input type="text" id="lname" name="lastname" placeholder="Your last name.." required><br>
<label for="lname"><?=_('Last Name')?>*</label>
<input type="text" id="lname" name="lastname" placeholder="<?=_('Your last name..')?>" required><br>
<label for="email">Email*</label>
<input type="email" id="email" name="email" placeholder="Your email.." required><br>
<label for="email"><?=_('Email')?>*</label>
<input type="email" id="email" name="email" placeholder="<?=_('Your email..')?>" required><br>
<label for="website">Website</label>
<input type="url" id="website" name="website" placeholder="Your website.."><br>
<label for="website"><?=_('Website')?></label>
<input type="url" id="website" name="website" placeholder="<?=_('Your website..')?>"><br>
<label for="subject">Subject*</label>
<input type="text" id="subject" name="subject" placeholder="Your subject.." required><br>
<label for="subject"><?=_('Subject')?>*</label>
<input type="text" id="subject" name="subject" placeholder="<?=_('Your subject..')?>" required><br>
<label for="message">Message*</label>
<textarea id="message" name="message" placeholder="Write something.." required style="height:200px"></textarea><br>
<label for="message"><?=_('Message')?>*</label>
<textarea id="message" name="message" placeholder="<?=_('Write something..')?>" required style="height:200px"></textarea><br>
<input type="submit" value="Submit"><input type="reset" value="Reset">
<input type="submit" value="<?=_('submit')?>"><input type="reset" value="<?=_('reset')?>">
</form>
</article>
</section>

View File

@ -21,27 +21,27 @@ if (isset($_POST)) {
if (isset($_POST['firstname'])) {
$fname = $_POST['firstname'];
} else {
$error_msg .= "You have not entered a proper first name.\n";
$error_msg .= _('You have not entered a proper first name.').'\n';
}
if (isset($_POST['lastname'])) {
$lname = $_POST['lastname'];
} else {
$error_msg .= "You have not entered a proper last name.\n";
$error_msg .= _('You have not entered a proper last name.').'\n';
}
if (isset($_POST['email'])) {
$email = $_POST['email'];
} else {
$error_msg .= "You have not entered a proper email address.\n";
$error_msg .= _('You have not entered a proper email address.').'\n';
}
if (isset($_POST['subject'])) {
$subject = $_POST['subject'];
} else {
$error_msg .= "You have not entered a proper subject.\n";
$error_msg .= _('You have not entered a proper subject.').'\n';
}
if (isset($_POST['message'])) {
$message = $_POST['message'];
} else {
$error_msg .= "You have not entered a proper message.\n";
$error_msg .= _('You have not entered a proper message.').'\n';
}
}
@ -82,7 +82,7 @@ try {
$mail->send();
$mail->smtpClose();
echo 'Message has been sent';
echo _('Message has been sent');
} catch (Exception $e) {
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
echo _('Message could not be sent. Mailer Error: ') + $mail->ErrorInfo;
}

View File

@ -4,6 +4,8 @@ ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$root = realpath($_SERVER["DOCUMENT_ROOT"]);
$lang = isset($_COOKIE['lang']) ? $_COOKIE['lang'] : 'en';
require("$root/lang/gettext.php");
require "$root/database/credentials.php";
// Connect the database
try {
@ -36,7 +38,7 @@ $result = $req->fetchAll();
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Discussion | Chiro - Canto</title>
<title><?=_('Discussion')?> | Chiro - Canto</title>
<link rel="stylesheet" type="text/css" href="/styles/style.css">
</head>
<?php
@ -47,8 +49,8 @@ include("$root/analytics/matomo.php");
<?php include("$root/menu.php");?>
<?php include("$root/header.php");?>
<section>
<h2>Discussion</h2>
<h3>New messages</h3>
<h2><?=_('Discussion')?></h2>
<h3><?=_('New messages')?></h3>
<ul>
<?php
$no_msg = true;
@ -71,15 +73,15 @@ include("$root/analytics/matomo.php");
}
}
if ($no_msg) {
echo "No message received.\n";
echo _('No message received.').'\n';
}
?>
</ul>
<h3>Send a message</h3>
<h3><?_('Send a message')?></h3>
<form action="messages" method="get">
<label for="author">Addressee</label>
<label for="author"><?=_('Addressee')?></label>
<input type="text" name="author" id="author">
<input type="submit" value="Send">
<input type="submit" value="<?=_('Send')?>">
</form>
</section>
<?php include("$root/footer.php");?>

View File

@ -5,6 +5,7 @@ ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$root = realpath($_SERVER["DOCUMENT_ROOT"]);
require("$root/lang/gettext.php");
require "$root/database/credentials.php";
// Connect the database
try {
@ -25,7 +26,7 @@ if (isset($_SESSION['username'])) {
$sender_id = $data['id'];
}
} else {
$_SESSION['error_msg'] = "You must be logged in to receive an send message.";
$_SESSION['error_msg'] = _('You must be logged in to receive or send messages.');
header('Location: /auth/login');
}
if (isset($_GET['author'])) {
@ -72,7 +73,7 @@ include("$root/analytics/matomo.php");
<?php include("$root/menu.php");?>
<?php include("$root/header.php");?>
<section>
<h2>Discussion</h2>
<h2><?=_('Discussion')?></h2>
<div class="messages">
<div class="author">
<?=$addressee?>
@ -108,8 +109,8 @@ include("$root/analytics/matomo.php");
<form action="sendmessage.php" method="post">
<input type="hidden" name="message_by" value="<?=$user_id?>">
<input type="hidden" name="message_to" value="<?=$_GET['author']?>">
<input type="text" name="message_content" id="message_content" placeholder="Enter your message..">
<input type="submit" name="submit" value="Send">
<input type="text" name="message_content" id="message_content" placeholder="<?=_('Enter your message..')?>">
<input type="submit" name="submit" value="<?=_('Send')?>">
</form>
<?php
}

View File

@ -33,16 +33,16 @@ if (isset($_POST['submit'])) {
if (isset($_POST['message_by'])) {
$message_by = $_POST['message_by'];
} else {
$_SESSION['error_msg'] .= "Error: No message author.\n";
$_SESSION['error_msg'] .= _('Error: No message author').'\n';
}
if (isset($_POST['message_to'])) {
$message_to = $_POST['message_to'];
} else {
$_SESSION['error_msg'] .= "Error: No message destinator.\n";
$_SESSION['error_msg'] .= _('Error: No message destinator').'\n';
} if (isset($_POST['message_content'])) {
$message_content = $_POST['message_content'];
} else {
$_SESSION['error_msg'] .= "Error: No message content.\n";
$_SESSION['error_msg'] .= _('Error: No message content').'\n';
}
if (isset($_SESSION['error_msg']) and $_SESSION['error_msg'] != "") {

View File

@ -4,6 +4,8 @@ ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$root = realpath($_SERVER["DOCUMENT_ROOT"]);
$lang = isset($_COOKIE['lang']) ? $_COOKIE['lang'] : 'en';
require("$root/lang/$lang/lang.php");
?>
<!DOCTYPE html>
<html lang="en">
@ -24,7 +26,7 @@ include("$root/analytics/matomo.php");
<section>
<h2>GUANO v1.0</h2>
<?=isset($_SESSION['error_msg']) and $_SESSION['error_msg'] != "" ? '<div class="error">'.$_SESSION['error_msg'].'</div>' : "";?>
<a href="/articles">about GUANO</a>
<a href="/articles"><?=_('about GUANO')?></a>
<article id="guano">
<?php
require "$root/database/credentials.php";
@ -50,7 +52,7 @@ if (isset($_GET['record'])) {
if ($data = $req->fetch()) {
} else {
$_SESSION['error_msg'] = "Can't fetch data.";
$_SESSION['error_msg'] = _("Can't fetch data.");
}
?>
GUANO|Version: 1.0<br><br>

View File

@ -4,6 +4,7 @@ ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$root = realpath($_SERVER["DOCUMENT_ROOT"]);
require("$root/lang/gettext.php");
?>
<!DOCTYPE html>
<html lang="en">
@ -11,7 +12,7 @@ $root = realpath($_SERVER["DOCUMENT_ROOT"]);
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Explore | Chiro - Canto</title>
<title><?=_('Explore')?> | Chiro - Canto</title>
<link rel="stylesheet" type="text/css" href="/styles/style.css">
</head>
<?php
@ -22,7 +23,7 @@ include("$root/analytics/matomo.php");
<?php include("$root/menu.php");?>
<?php include("$root/header.php");?>
<section>
<h2>Explore</h2>
<h2><?=_('Explore')?></h2>
<div class="explore wrapper">
<div class="list">
<a href="/explore/list"><img src="/media/icons/list.png" alt="list"></a>

View File

@ -4,6 +4,7 @@ ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
session_start();
$root = realpath($_SERVER["DOCUMENT_ROOT"]);
require("$root/lang/gettext.php");
require "$root/database/credentials.php";
// Connect the database
try {
@ -25,7 +26,7 @@ $result = $req->fetchAll();
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Explore | Chiro - Canto</title>
<title><?_('Explore')?> | Chiro - Canto</title>
<link rel="stylesheet" type="text/css" href="/styles/style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
@ -37,17 +38,17 @@ include("$root/analytics/owa.php");
<?php include("$root/menu.php");?>
<?php include("$root/header.php");?>
<section>
<h2>Explore</h2>
<h3>Recording List</h3>
<h2><?=_('Explore')?></h2>
<h3><?=_('Recording List')?></h3>
<table id="list">
<thead>
<tr>
<th>Datetime</th>
<th>Species</th>
<th>File Name</th>
<th>Author</th>
<th>License</th>
<th>Audio</th>
<th><?=_('Datetime')?></th>
<th><?=_('Species')?></th>
<th><?=_('File Name')?></th>
<th><?=_('Author')?></th>
<th><?=_('License')?></th>
<th><?=_('Audio')?></th>
</tr>
</thead>
<tbody>
@ -68,9 +69,9 @@ include("$root/analytics/owa.php");
<td>
<a href="/explore/spectrograms/?record=<?=$row['id']?>"><?=$row['file_name']?></a>
<a href="/storage/records/<?=$row['file_name']?>" title="Download file"><i class="fa fa-download" aria-hidden="true"></i></a>
<a href="/larynx/?record=<?=$row['id']?>" title="Open with Larynx"><img src="/media/icons/wave.svg" alt="spectro analysis"></a>
<a href="/explore/guano?record=<?=$row['id']?>" title="See GUANO metadata"><img src="/media/icons/data.png" alt="database search"></a>
<a href="/explore/record/edit/?id=<?=$row['id']?>" title="Edit record metadata"><i class="fa fa-edit " ></i></a>
<a href="/larynx/?record=<?=$row['id']?>" title="<?=_('Open with Larynx')?>"><img src="/media/icons/wave.svg" alt="spectro analysis"></a>
<a href="/explore/guano?record=<?=$row['id']?>" title="<?=_('See GUANO metadata')?>"><img src="/media/icons/data.png" alt="database search"></a>
<a href="/explore/record/edit/?id=<?=$row['id']?>" title="<?=_('Edit record metadata')?>"><i class="fa fa-edit " ></i></a>
</td>
<td><?=$username?></td>
<td><?=$row['license']?></td>

View File

@ -5,6 +5,7 @@ ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$root = realpath($_SERVER["DOCUMENT_ROOT"]);
require("$root/lang/gettext.php");
require "$root/database/credentials.php";
// Connect the database
try {
@ -26,7 +27,7 @@ $result = $req->fetchAll();
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Explore | Chiro - Canto</title>
<title><?=_('Explore')?> | Chiro - Canto</title>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css"
integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A=="
crossorigin=""/>
@ -44,8 +45,8 @@ include("$root/analytics/matomo.php");
<?php include("$root/menu.php");?>
<?php include("$root/header.php");?>
<section>
<h3>Explore</h3>
<h4>Record Map</h4>
<h><?=_('Explore')?></h3>
<h4><?=_('Record Map')?></h4>
<div id="map"></div>
</section>
<?php include("$root/footer.php");?>

View File

@ -4,6 +4,7 @@ ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$root = realpath($_SERVER["DOCUMENT_ROOT"]);
require("$root/lang/gettext.php");
require "$root/database/credentials.php";
// Connect the database
try {
@ -37,7 +38,7 @@ include("$root/analytics/matomo.php");
<?php include("$root/menu.php");?>
<?php include("$root/header.php");?>
<section>
<h3>Mystery recording</h3>
<h3><?=_('Mystery recording')?></h3>
<?php
foreach ($result as $row)
{
@ -45,7 +46,7 @@ foreach ($result as $row)
<div class="sound">
<h3><?=$row['file_name']?></h3>
<h4><em><?=$row['species']?></em></h4>
<p>Recorded on <?=$row['date']?> at <?=$row['time']?></p>
<p><?=_('Recorded on ')?><?=$row['date']?> <?=_('at')?> <?=$row['time']?></p>
<?php
if (file_exists($root."/storage/spectrograms/".$row['file_name'].'.png'))
{

View File

@ -5,6 +5,8 @@ ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$root = realpath($_SERVER["DOCUMENT_ROOT"]);
$lang = isset($_COOKIE['lang']) ? $_COOKIE['lang'] : 'en';
require("$root/lang/$lang/lang.php");
require "$root/database/credentials.php";
// Connect the database
try {
@ -28,7 +30,7 @@ if ($data = $req->fetch())
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Explore | Chiro - Canto</title>
<title><?=_('Explore')?> | Chiro - Canto</title>
<link rel="stylesheet" type="text/css" href="/styles/style.css">
</head>
<?php
@ -38,16 +40,16 @@ include("$root/analytics/matomo.php");
<?php include("$root/menu.php");?>
<?php include("$root/header.php");?>
<section>
<h3>Explore</h3>
<h4>Random Record</h4>
<h3><?=_('Explore')?></h3>
<h4><?=_('Random Record')?></h4>
<table>
<thead>
<tr>
<th>Species</th>
<th>File Name</th>
<th>Author</th>
<th>License</th>
<th>Audio</th>
<th><?=_('Species')?></th>
<th><?=_('File name')?></th>
<th><?=_('Author')?></th>
<th><?=_('License')?></th>
<th><?=_('Audio')?></th>
</tr>
</thead>
<tbody>
@ -60,7 +62,7 @@ include("$root/analytics/matomo.php");
</tr>
</tbody>
</table>
<p>Click on the file name to go to the spectrogram view.</p>
<p><?=_('Click on the file name to go to the spectrogram view.')?></p>
</section>
<?php include("$root/footer.php");?>
</body>

View File

@ -5,6 +5,8 @@ error_reporting(E_ALL);
session_start();
session_reset();
$root = realpath($_SERVER["DOCUMENT_ROOT"]);
$lang = isset($_COOKIE['lang']) ? $_COOKIE['lang'] : 'en';
require("$root/lang/$lang/lang.php");
require "$root/database/credentials.php";
// Connect the database
try {
@ -24,7 +26,7 @@ if (isset($_GET['id'])){
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Edit | Chiro - Canto</title>
<title><?=_('Edit')?> | Chiro - Canto</title>
<link rel="stylesheet" type="text/css" href="/styles/style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
@ -36,7 +38,7 @@ if (isset($_GET['id'])){
<?php include("$root/menu.php");?>
<?php include("$root/header.php");?>
<section>
<h2>Edit</h2>
<h2><?=_('Edit')?></h2>
<?php
$req = $db->prepare('SELECT * FROM records WHERE id=:id');
$req->execute(array(
@ -46,32 +48,32 @@ if (isset($_GET['id'])){
?>
<form action="update.php" method="post">
<label for="file_name">File Name*</label>
<label for="file_name"><?=_('File Name')?>*</label>
<input type="text" id="file_name"value="<?=$data['file_name']?>" readonly>
<label for="coordinates">Coordinates*</label>
<label for="coordinates"><?=_('Coordinates')?>*</label>
<input type="text" id="coordinates" value="<?=$data['lat']?>, <?=$data['lng']?>" readonly>
<label for="date">Date*</label>
<label for="date"><?=_('Date')?>*</label>
<input type="date" name="date" id="date" value="<?=$data['date']?>">
<label for="time">Time*</label>
<label for="time"><?=_('Time')?>*</label>
<input type="time" name="time" id="time" value="<?=$data['time']?>">
<label for="recordist-name">Recordist Name*</label>
<label for="recordist-name"><?=_('Recordist Name')?>*</label>
<input type="text" name="recordist-name" id="recordist-name" value="<?=$data['recordist_name']?>" required>
<label for="species">Species*</label>
<label for="species"><?=_('Species')?>*</label>
<input type="text" name="species" id="species" value="<?=$data['species']?>">
<label for="subpsecies">Subspecies</label>
<input type="text" name="subpseices" id="subspecies" value="<?=$data['subspecies']?>">
<label for="subpsecies"><?=_('Subspecies')?></label>
<input type="text" name="subspecies" id="subspecies" value="<?=$data['subspecies']?>">
<label for="make">Recorder Manufacturer</label>
<label for="make"><?=_('Recorder Manufacturer')?></label>
<input type="text" name="make" id="make" value="<?=$data['make']?>">
<label for="model">Recorder Model</label>
<label for="model"><?=_('Recorder Model')?></label>
<input type="text" name="model" id="model" value="<?=$data['model']?>">
<label for="serial">Recorder Serial Number</label>
<label for="serial"><?=_('Recorder Serial Number')?></label>
<input type="text" name="serial" id="serial" value="<?=$data['serial']?>">
</form>
<?php
} else {
$_SESSION['error_msg'] = "Can't fetch information on record with id '".$_GET['id']."'.";
$_SESSION['error_msg'] = _("Can't fetch information on record with id") . "'".$_GET['id']."'";
}
echo $_SESSION['error_msg'];
?>

View File

@ -4,6 +4,8 @@ ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$root = realpath($_SERVER["DOCUMENT_ROOT"]);
$lang = isset($_COOKIE['lang']) ? $_COOKIE['lang'] : 'en';
require("$root/lang/$lang/lang.php");
?>
<!DOCTYPE html>
<html lang="en">
@ -11,7 +13,7 @@ $root = realpath($_SERVER["DOCUMENT_ROOT"]);
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Explore | Chiro - Canto</title>
<title><?=_('Explore')?> | Chiro - Canto</title>
<link rel="stylesheet" type="text/css" href="/styles/style.css">
</head>
<?php
@ -22,7 +24,7 @@ include("$root/analytics/owa.php");
<?php include("$root/menu.php");?>
<?php include("$root/header.php");?>
<section>
<h3>Record</h3>
<h3><?=_('Record')?></h3>
<?php
require "$root/database/credentials.php";
// Connect the database
@ -50,7 +52,7 @@ include("$root/analytics/owa.php");
<div class="sound">
<h3><?=$data['file_name']?></h3>
<h4><em><?=$data['species']?></em></h4>
<p>Recorded on <?=$data['date']?> at <?=$data['time']?></p>
<p><?=_('Recorded on')?> <?=$data['date']?> <?=_('at')?> <?=$data['time']?></p>
<?php
if (file_exists($root."/storage/spectrograms/".$data['file_name'].'.png'))
{
@ -65,7 +67,7 @@ include("$root/analytics/owa.php");
</div>
<?php
} else {
echo "Can't find the record associated with this id, please try again.";
echo _("Can't find the record associated with this id, please try again.");
}?>
</section>
<?php include("$root/footer.php");?>

View File

@ -4,30 +4,16 @@ ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$root = realpath($_SERVER["DOCUMENT_ROOT"]);
// require "$root/database/credentials.php";
// // Connect the database
// try {
// $db = new PDO("mysql:host=$host;dbname=$database;charset=utf8",
// $user,
// $password,
// array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
// ));
// } catch (Exception $e) {
// die("Error : ".$e->getMessage());
// }
// $req = $db->prepare('SELECT id, recordist_name, file_name, license, species, sound_type, date, time FROM `records` WHERE species="unknown" ORDER BY `entry_timestamp` ASC LIMIT 1');
// $req->execute();
// $result = $req->fetchAll();
$lang = isset($_COOKIE['lang']) ? $_COOKIE['lang'] : 'en';
require("$root/lang/gettext.php");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Explore | Chiro - Canto</title>
<title><?=_('Explore')?> | Chiro - Canto</title>
<link rel="stylesheet" type="text/css" href="/styles/style.css">
</head>
<?php
@ -38,20 +24,20 @@ include("$root/analytics/owa.php");
<?php include("$root/menu.php");?>
<?php include("$root/header.php");?>
<section>
<h3>Explore</h3>
<h4>Multicriteria recordings Search</h4>
<h3><?=_('Explore')?></h3>
<h4><?=_('Multicriteria recordings Search')?></h4>
<form action="searchrecord.php" method="post">
<label for="species">Species name</label>
<label for="species"><?=_('Species name')?></label>
<input type="text" name="species" id="species">
<label for="subspecies">Subspecies name</label>
<label for="subspecies"><?=_('Subspecies name')?></label>
<input type="text" name="subspecies" id="subspecies">
<label for="recordist">Recordist name</label>
<label for="recordist"><?=_('Recordist name')?></label>
<input type="text" name="recordist" id="recordist">
<label for="date-after">After date</label>
<label for="date-after"><?=_('After date')?></label>
<input type="text" name="date-after" id="date-after" placeholder="YYYY-MM-DD">
<label for="date-before">Before date</label>
<label for="date-before"><?=_('Befora date')?></label>
<input type="text" name="date-before" id="date-before" placeholder="YYYY-MM-DD">
<label for="in-remarks">Keyword(s) in remarks (comma separated)</label>
<label for="in-remarks"><?=_('Keyword(s) in remarks (comma separated)')?></label>
<input type="text" name="keywords" id="in-remarks">
<input type="submit" name="submit" value="Search"><input type="reset">
</form>

View File

@ -5,6 +5,8 @@ ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$root = realpath($_SERVER["DOCUMENT_ROOT"]);
$lang = isset($_COOKIE['lang']) ? $_COOKIE['lang'] : 'en';
require("$root/lang/$lang/lang.php");
require "$root/database/credentials.php";
// Connect the database
try {
@ -97,7 +99,7 @@ if ($_SESSION['error_msg'] == "") {
}
}
} else {
$_SESSION['error_msg'] .= "You did not enter any query.\n";
$_SESSION['error_msg'] .= _("You did not enter any query.").'\n';
header("Location: /explore/search");
}
@ -112,15 +114,15 @@ if ($_SESSION['error_msg'] == "") {
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Explore | Chiro - Canto</title>
<title><?=_('Explore')?> | Chiro - Canto</title>
<link rel="stylesheet" type="text/css" href="/styles/style.css">
</head>
<body>
<?php include("$root/menu.php");?>
<?php include("$root/header.php");?>
<section>
<h3>Explore</h3>
<h4>Search Results</h4>
<h3><?=_('Explore')?></h3>
<h4><?=_('Search results')?></h4>
<?php
// echo $sql;
$req = $db->prepare($sql);
@ -128,16 +130,16 @@ if ($_SESSION['error_msg'] == "") {
$result = $req->fetchAll();
// print_r($sql);
if (empty($result)) {
echo "No result for this query, please try again.\n";
echo _("No result for this query, please try again.").'\n';
} else {
?>
<table>
<thead>
<tr>
<th>File name</th>
<th>Author</th>
<th>License</th>
<th>Date</th>
<th><?=_('File name')?></th>
<th><?=_('Author')?></th>
<th><?=_('License')?></th>
<th><?=_('Datetime')?></th>
</tr>
</thead>
<tbody>

View File

@ -4,6 +4,8 @@ ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$root = realpath($_SERVER["DOCUMENT_ROOT"]);
$lang = isset($_COOKIE['lang']) ? $_COOKIE['lang'] : 'en';
require("$root/lang/$lang/lang.php");
require "$root/database/credentials.php";
// Connect the database
try {
@ -33,7 +35,7 @@ $data = $req->fetch();
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Explore | Chiro - Canto</title>
<title><?=_('Explore')?> | Chiro - Canto</title>
<link rel="stylesheet" type="text/css" href="/styles/style.css">
</head>
<?php
@ -44,13 +46,13 @@ include("$root/analytics/matomo.php");
<?php include("$root/menu.php");?>
<?php include("$root/header.php");?>
<section>
<h3>Spectrograms</h3>
<h3><?=_('Spectrograms')?></h3>
<?php
?>
<div class="sound">
<h3><?=$data['file_name']?></h3>
<h4><em><?=$data['species']?></em></h4>
<p>Recorded on <?=$data['date']?> at <?=$data['time']?></p>
<p><?=_('Recorded on')?> <?=$data['date']?> at <?=$data['time']?></p>
<?php
if (file_exists($root."/storage/spectrograms/".$data['file_name'].'.png'))
{

View File

@ -4,6 +4,8 @@ ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
$root = realpath($_SERVER["DOCUMENT_ROOT"]);
$lang = isset($_COOKIE['lang']) ? $_COOKIE['lang'] : 'en';
require("$root/lang/gettext.php");
require "$root/database/credentials.php";
// Connect the database
try {
@ -26,7 +28,7 @@ $result = $req->fetchAll();
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Explore | Chiro - Canto</title>
<title><?=_('Explore')?> | Chiro - Canto</title>
<link rel="stylesheet" type="text/css" href="/styles/style.css">
</head>
<?php
@ -36,20 +38,20 @@ include("$root/analytics/matomo.php");
<body>
<?php include("$root/menu.php");?>
<?php include("$root/header.php");?>
<h3>Chiroptera Taxa</h3>
<p>These taxa come from INPN TAXREF v14.0.</p>
<h3><?=_('Taxa')?></h3>
<p><?=_('These taxa come from INPN TAXREF v14.0.')?></p>
<table>
<thead>
<tr>
<th>Kingdom</th>
<th>Phylum</th>
<th>Class</th>
<th>Order</th>
<th>Family</th>
<th>Subfamily</th>
<th>Tribu</th>
<th>Genus</th>
<th>Species</th>
<th><?=_('Kingdom')?></th>
<th><?=_('Phylum')?></th>
<th><?=_('Class')?></th>
<th><?=_('Order')?></th>
<th><?=_('Family')?></th>
<th><?=_('Subfamily')?></th>
<th><?=_('Tribu')?></th>
<th><?=_('Genus')?></th>
<th><?=_('Species')?></th>
</tr>
</thead>
<tbody>