Redirect duplicates
This commit is contained in:
parent
6c78479110
commit
0c20d35928
10
chant.php
10
chant.php
|
|
@ -15,6 +15,16 @@ if(!$c) {
|
||||||
die('Wrong id');
|
die('Wrong id');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($c['duplicateof'] > 0) {
|
||||||
|
header('HTTP/1.1 301 Moved Permanently');
|
||||||
|
header('Location: '.$_SERVER['PHP_SELF'].'?id='.$c['duplicateof']);
|
||||||
|
header('Connection: close');
|
||||||
|
} elseif($c['duplicateof']) {
|
||||||
|
header('HTTP/1.1 301 Moved Permanently');
|
||||||
|
header('Location: ./scores.php');
|
||||||
|
header('Connection: close');
|
||||||
|
}
|
||||||
|
|
||||||
$title = $c['incipit']?$c['incipit']:'░░'.$c['id'].'░░';
|
$title = $c['incipit']?$c['incipit']:'░░'.$c['id'].'░░';
|
||||||
$custom_header = <<<HEADER
|
$custom_header = <<<HEADER
|
||||||
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
|
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
|
||||||
|
|
|
||||||
9
feed.php
9
feed.php
|
|
@ -39,9 +39,11 @@ echo '<entry>
|
||||||
';
|
';
|
||||||
|
|
||||||
while($m = $req1->fetch_assoc()) {
|
while($m = $req1->fetch_assoc()) {
|
||||||
$user_info = get_userdata($m['user_id']);
|
$t = chant_from_id($m['chant_id']);
|
||||||
echo '<entry>
|
if($t) {
|
||||||
<title type="html">'.chant_from_id($m['chant_id'])[1].'</title>
|
$user_info = get_userdata($m['user_id']);
|
||||||
|
echo '<entry>
|
||||||
|
<title type="html">'.$t[1].'</title>
|
||||||
<link href="'.$dir.'chant.php?id='.$m['chant_id'].'" />
|
<link href="'.$dir.'chant.php?id='.$m['chant_id'].'" />
|
||||||
<summary>'.htmlspecialchars($m['comment']).'</summary>
|
<summary>'.htmlspecialchars($m['comment']).'</summary>
|
||||||
<updated>'.date(DATE_ATOM,$m['time']).'</updated>
|
<updated>'.date(DATE_ATOM,$m['time']).'</updated>
|
||||||
|
|
@ -51,6 +53,7 @@ while($m = $req1->fetch_assoc()) {
|
||||||
<id>'.$dir.'history.php?changeset='.$m['time'].'%7C'.$m['chant_id'].'%7C'.$m['user_id'].'</id>
|
<id>'.$dir.'history.php?changeset='.$m['time'].'%7C'.$m['chant_id'].'%7C'.$m['user_id'].'</id>
|
||||||
</entry>
|
</entry>
|
||||||
';
|
';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
echo '</feed>';
|
echo '</feed>';
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
-- phpMyAdmin SQL Dump
|
-- phpMyAdmin SQL Dump
|
||||||
-- version 5.1.0-rc2
|
-- version 5.1.0
|
||||||
-- https://www.phpmyadmin.net/
|
-- https://www.phpmyadmin.net/
|
||||||
--
|
--
|
||||||
-- Hôte : localhost
|
-- Hôte : localhost
|
||||||
-- Généré le : dim. 21 fév. 2021 à 19:10
|
-- Généré le : mer. 03 mars 2021 à 21:48
|
||||||
-- Version du serveur : 10.4.17-MariaDB-1:10.4.17+maria~xenial
|
-- Version du serveur : 10.4.17-MariaDB-1:10.4.17+maria~xenial
|
||||||
-- Version de PHP : 7.4.15
|
-- Version de PHP : 7.4.15
|
||||||
|
|
||||||
|
|
@ -67,7 +67,8 @@ CREATE TABLE `gregobase_chants` (
|
||||||
`gabc_verses` text COLLATE utf8_unicode_ci DEFAULT NULL,
|
`gabc_verses` text COLLATE utf8_unicode_ci DEFAULT NULL,
|
||||||
`tex_verses` text COLLATE utf8_unicode_ci DEFAULT NULL,
|
`tex_verses` text COLLATE utf8_unicode_ci DEFAULT NULL,
|
||||||
`remarks` text COLLATE utf8_unicode_ci DEFAULT NULL,
|
`remarks` text COLLATE utf8_unicode_ci DEFAULT NULL,
|
||||||
`copyrighted` tinyint(1) NOT NULL DEFAULT 0
|
`copyrighted` tinyint(1) NOT NULL DEFAULT 0,
|
||||||
|
`duplicateof` int(11) DEFAULT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||||
|
|
||||||
-- --------------------------------------------------------
|
-- --------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,9 @@ include('include/header.php');
|
||||||
echo "<h2>$title</h2>\n";
|
echo "<h2>$title</h2>\n";
|
||||||
|
|
||||||
if($l) {
|
if($l) {
|
||||||
$sql1 = 'SELECT * FROM '.db('chants').' WHERE `incipit` LIKE "'.$l.'%" ORDER BY incipit ASC';
|
$sql1 = 'SELECT * FROM '.db('chants').' WHERE `duplicateof` IS NULL AND `incipit` LIKE "'.$l.'%" ORDER BY incipit ASC';
|
||||||
} else {
|
} else {
|
||||||
$sql1 = 'SELECT * FROM '.db('chants')." WHERE `incipit` LIKE '' OR UPPER(incipit) REGEXP '^[^A-Zƌ].*' ORDER BY incipit ASC";
|
$sql1 = 'SELECT * FROM '.db('chants')." WHERE `duplicateof` IS NULL AND (`incipit` LIKE '' OR UPPER(incipit) REGEXP '^[^A-Zƌ].*') ORDER BY incipit ASC";
|
||||||
}
|
}
|
||||||
$req1 = $mysqli->query($sql1) or die('Erreur SQL !<br />'.$sql1.'<br />'.$mysqli->error);
|
$req1 = $mysqli->query($sql1) or die('Erreur SQL !<br />'.$sql1.'<br />'.$mysqli->error);
|
||||||
$chants = array();
|
$chants = array();
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,11 @@
|
||||||
|
|
||||||
function chant_from_id($c) {
|
function chant_from_id($c) {
|
||||||
global $mysqli;
|
global $mysqli;
|
||||||
$sql1 = 'SELECT `office-part`,incipit,gabc,version FROM '.db('chants').' WHERE id = '.$c;
|
$sql1 = 'SELECT `office-part`,incipit,gabc,version,duplicateof FROM '.db('chants').' WHERE id = '.$c;
|
||||||
$req1 = $mysqli->query($sql1) or die('Erreur SQL !<br />'.$sql1.'<br />'.$mysqli->error);
|
$req1 = $mysqli->query($sql1) or die('Erreur SQL !<br />'.$sql1.'<br />'.$mysqli->error);
|
||||||
$chants = array();
|
$chants = array();
|
||||||
$ch = $req1->fetch_assoc();
|
$ch = $req1->fetch_assoc();
|
||||||
|
if($ch['duplicateof']) return false;
|
||||||
return array($ch['office-part'], $ch['incipit'] > ''?$ch['incipit']:'░░'.$c.'░░', $ch['gabc'] > '', $ch['version']);
|
return array($ch['office-part'], $ch['incipit'] > ''?$ch['incipit']:'░░'.$c.'░░', $ch['gabc'] > '', $ch['version']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,13 +8,16 @@ $sql = 'SELECT * FROM '.db('pleasefix').' WHERE fixed = 0 ORDER BY `time`';
|
||||||
$req = $mysqli->query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.$mysqli->error);
|
$req = $mysqli->query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.$mysqli->error);
|
||||||
if($req->num_rows > 0) {
|
if($req->num_rows > 0) {
|
||||||
while($fix = $req->fetch_assoc()) {
|
while($fix = $req->fetch_assoc()) {
|
||||||
echo '<h4><a href="chant.php?id='.$fix['chant_id'].'">'.format_incipit(chant_from_id($fix['chant_id'])[1])."</a></h4>\n";
|
$t = chant_from_id($fix['chant_id']);
|
||||||
echo "<p><i>".nl2br(htmlspecialchars($fix['pleasefix'])).'</i> <span class="version"> (Reported on '.date("Y-m-d",$fix['time']);
|
if($t) {
|
||||||
if($fix['user_id']) {
|
echo '<h4><a href="chant.php?id='.$fix['chant_id'].'">'.format_incipit($t[1])."</a></h4>\n";
|
||||||
$user_info = get_userdata($fix['user_id']);
|
echo "<p><i>".nl2br(htmlspecialchars($fix['pleasefix'])).'</i> <span class="version"> (Reported on '.date("Y-m-d",$fix['time']);
|
||||||
echo ' by '.$user_info->display_name;
|
if($fix['user_id']) {
|
||||||
|
$user_info = get_userdata($fix['user_id']);
|
||||||
|
echo ' by '.$user_info->display_name;
|
||||||
|
}
|
||||||
|
echo ")</span></p>\n";
|
||||||
}
|
}
|
||||||
echo ")</span></p>\n";
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
echo "<p>No problem reported</p>\n";
|
echo "<p>No problem reported</p>\n";
|
||||||
|
|
|
||||||
|
|
@ -71,8 +71,11 @@ foreach($mod as $d => $ml) {
|
||||||
echo $d;
|
echo $d;
|
||||||
echo "<ul>\n";
|
echo "<ul>\n";
|
||||||
foreach($ml as $m) {
|
foreach($ml as $m) {
|
||||||
echo '<li><a href="chant.php?id='.$m['chant_id'].'">'.format_incipit(chant_from_id($m['chant_id'])[1])."</a><br />\n";
|
$t = chant_from_id($m['chant_id']);
|
||||||
echo "<i>".htmlspecialchars($m['comment'])."</i></li>\n";
|
if($t) {
|
||||||
|
echo '<li><a href="chant.php?id='.$m['chant_id'].'">'.format_incipit($t[1])."</a><br />\n";
|
||||||
|
echo "<i>".htmlspecialchars($m['comment'])."</i></li>\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
echo "</ul><br />\n";
|
echo "</ul><br />\n";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
28
source.php
28
source.php
|
|
@ -52,13 +52,15 @@ if(array_key_exists('images', $_GET) && $_GET['images'] == '1') {
|
||||||
$ch = $chants[$p];
|
$ch = $chants[$p];
|
||||||
foreach($ch as $c) {
|
foreach($ch as $c) {
|
||||||
$t = chant_from_id($c[0]);
|
$t = chant_from_id($c[0]);
|
||||||
echo '<li class="usage-marker '.$t[0].'">';
|
if($t) {
|
||||||
if($t[2]) {
|
echo '<li class="usage-marker '.$t[0].'">';
|
||||||
echo '<a href="chant.php?id='.$c[0].'">'.format_incipit($t[1])."</a>";
|
if($t[2]) {
|
||||||
} else {
|
echo '<a href="chant.php?id='.$c[0].'">'.format_incipit($t[1])."</a>";
|
||||||
echo '<span class="todo">'.format_incipit($t[1]).'</span> (<a href="chant_edit.php?id='.$c[0].'">TODO</a>)';
|
} else {
|
||||||
|
echo '<span class="todo">'.format_incipit($t[1]).'</span> (<a href="chant_edit.php?id='.$c[0].'">TODO</a>)';
|
||||||
|
}
|
||||||
|
echo "</li>\n";
|
||||||
}
|
}
|
||||||
echo "</li>\n";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo '<li class="add-chant"><a href="chant_edit.php?source='.$s.'&page='.$p.'">Add chant</a></li>'."\n";
|
echo '<li class="add-chant"><a href="chant_edit.php?source='.$s.'&page='.$p.'">Add chant</a></li>'."\n";
|
||||||
|
|
@ -89,13 +91,15 @@ if(array_key_exists('images', $_GET) && $_GET['images'] == '1') {
|
||||||
unset($chants[$p]);
|
unset($chants[$p]);
|
||||||
foreach($ch as $c) {
|
foreach($ch as $c) {
|
||||||
$t = chant_from_id($c[0]);
|
$t = chant_from_id($c[0]);
|
||||||
echo '<li class="usage-marker '.$t[0].'">';
|
if($t) {
|
||||||
if($t[2]) {
|
echo '<li class="usage-marker '.$t[0].'">';
|
||||||
echo '<a href="chant.php?id='.$c[0].'">'.format_incipit($t[1])."</a>";
|
if($t[2]) {
|
||||||
} else {
|
echo '<a href="chant.php?id='.$c[0].'">'.format_incipit($t[1])."</a>";
|
||||||
echo '<span class="todo">'.format_incipit($t[1]).'</span>';
|
} else {
|
||||||
|
echo '<span class="todo">'.format_incipit($t[1]).'</span>';
|
||||||
|
}
|
||||||
|
echo "</li>\n";
|
||||||
}
|
}
|
||||||
echo "</li>\n";
|
|
||||||
}
|
}
|
||||||
echo "</ul>\n";
|
echo "</ul>\n";
|
||||||
echo "</td></tr>\n";
|
echo "</td></tr>\n";
|
||||||
|
|
|
||||||
|
|
@ -22,9 +22,12 @@ foreach($mod as $d => $ml) {
|
||||||
echo "<h4>".$d."</h4>\n";
|
echo "<h4>".$d."</h4>\n";
|
||||||
echo "<ul>\n";
|
echo "<ul>\n";
|
||||||
foreach($ml as $m) {
|
foreach($ml as $m) {
|
||||||
$user_info = get_userdata($m['user_id']);
|
$t = chant_from_id($m['chant_id']);
|
||||||
echo "<li>".' <a href="chant.php?id='.$m['chant_id'].'">'.format_incipit(chant_from_id($m['chant_id'])[1])."</a><br />\n";
|
if($t) {
|
||||||
echo "<i>".htmlspecialchars($m['comment']).'</i> <span class="version">('.$user_info->display_name.")</span></li>\n";
|
$user_info = get_userdata($m['user_id']);
|
||||||
|
echo "<li>".' <a href="chant.php?id='.$m['chant_id'].'">'.format_incipit($t[1])."</a><br />\n";
|
||||||
|
echo "<i>".htmlspecialchars($m['comment']).'</i>'.($u > ''?"":' <span class="version">(<a href="'.$_SERVER['PHP_SELF'].'?user='.$m['user_id'].'">'.$user_info->display_name."</a>)</span>")."</li>\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
echo "</ul>\n";
|
echo "</ul>\n";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ if(!array_key_exists($id,$txt['usage'])) {
|
||||||
$title = 'Usage - '.$txt['usage'][$id];
|
$title = 'Usage - '.$txt['usage'][$id];
|
||||||
include('include/header.php');
|
include('include/header.php');
|
||||||
echo "<h2>$title</h2>\n";
|
echo "<h2>$title</h2>\n";
|
||||||
$sql1 = 'SELECT * FROM '.db('chants').' WHERE `office-part` = "'.$id.'" ORDER BY incipit ASC';
|
$sql1 = 'SELECT * FROM '.db('chants').' WHERE `duplicateof` IS NULL AND `office-part` = "'.$id.'" ORDER BY incipit ASC';
|
||||||
$req1 = $mysqli->query($sql1) or die('Erreur SQL !<br />'.$sql1.'<br />'.$mysqli->error);
|
$req1 = $mysqli->query($sql1) or die('Erreur SQL !<br />'.$sql1.'<br />'.$mysqli->error);
|
||||||
$chants = array();
|
$chants = array();
|
||||||
while($c = $req1->fetch_assoc()) {
|
while($c = $req1->fetch_assoc()) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue