Sidebar funcional al index
This commit is contained in:
pare
48ece92e40
commit
815fcd03c8
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Svg Vector Icons : http://www.onlinewebfonts.com/icon -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 1000 1000" enable-background="new 0 0 1000 1000" xml:space="preserve">
|
||||
<metadata> Svg Vector Icons : http://www.onlinewebfonts.com/icon </metadata>
|
||||
<g><path d="M900.9,205.7V84.2C556,84.2,503.1,197.8,500,205.1c-3.1-7.4-56-120.9-400.9-120.9v121.5C71,204,41.4,203,10,203v626.3c0,0,270.9-29.3,405.5,42c22.8,12.1,47.3,44.2,84.6,44.4c37.2,0.2,61.8-32.3,84.7-44.5c134.6-71.3,405.3-42,405.3-42V203C958.6,203,929,204,900.9,205.7z M469.3,787.9c-94.3-54-234.4-63.7-321.5-63.7c-1.4,0-2.8,0-4.1,0V129.4c264,8.3,313.1,89.2,315.5,93.5l10.2,24.3L469.3,787.9L469.3,787.9z M856.3,724.2c-1.3,0-2.7,0-4.1,0c-87.8,0-229.3,9.8-323.5,64.9v-537l12.2-29.2c2.3-4.1,51.3-85.2,315.5-93.5V724.2z" fill='white'/></g>
|
||||
</svg>
|
Desprès Amplada: | Alçada: | Mida: 1.0 KiB |
Archivo binario no mostrado.
Desprès Amplada: | Alçada: | Mida: 483 B |
136
index.php
136
index.php
|
@ -17,11 +17,12 @@
|
|||
$context = stream_context_create($opts);
|
||||
$rss = file_get_contents($feedURL, false, $context);
|
||||
$parser = new SimpleXMLElement($rss);
|
||||
echo "<ul class='newsSide'>";
|
||||
echo "<ul class='newsSide' style='list-style:url(\"/icones/llibre.png\")'>";
|
||||
$i = 0;
|
||||
|
||||
foreach ($parser->channel->item as $feedItem) {
|
||||
$i++;
|
||||
echo "<li><a class='skipIcon' href='$feedItem->link' title='$feedItem->title'>" . $feedItem->title . "</a></li>";
|
||||
echo "<li ><a class='skipIcon' href='$feedItem->link' title='$feedItem->title'>" . $feedItem->title . "</a></li>";
|
||||
if($i >= 5) break;
|
||||
}
|
||||
echo "</ul>";
|
||||
|
@ -42,78 +43,85 @@
|
|||
<?=$site['site_name']?>
|
||||
</h1>
|
||||
<p><?=$site['site_short']?></p>
|
||||
<div id="search">🔍<input type="text" id='searchText' value="" placeholder="Busca..." /></div>
|
||||
|
||||
</div>
|
||||
<div class="container indexContainer">
|
||||
<dl>
|
||||
<?php
|
||||
<div id='superContainer'>
|
||||
<div class="container indexContainer">
|
||||
<dl>
|
||||
<?php
|
||||
|
||||
while($row = $query->fetchArray()){
|
||||
$tagsQuery = "SELECT articles.article_id as art_id, tags.tag_id, tags.tag_name as tagname, article_tags.tag from articles, article_tags, tags WHERE art_id = ".$row['article_id']." AND art_id = article_tags.article and tags.tag_id = article_tags.tag";
|
||||
$queryTags = $db->query($tagsQuery);
|
||||
while($row = $query->fetchArray()){
|
||||
$tagsQuery = "SELECT articles.article_id as art_id, tags.tag_id, tags.tag_name as tagname, article_tags.tag from articles, article_tags, tags WHERE art_id = ".$row['article_id']." AND art_id = article_tags.article and tags.tag_id = article_tags.tag";
|
||||
$queryTags = $db->query($tagsQuery);
|
||||
|
||||
$langQuery = "SELECT languages.name, languages.iso_639_1 AS iso FROM languages,articles WHERE articles.article_id=".$row['article_id']." AND articles.article_lang =iso";
|
||||
$langQuery = "SELECT languages.name, languages.iso_639_1 AS iso FROM languages,articles WHERE articles.article_id=".$row['article_id']." AND articles.article_lang =iso";
|
||||
|
||||
$queryLang = $db->query($langQuery);
|
||||
$lang = $queryLang->fetchArray();
|
||||
$queryLang = $db->query($langQuery);
|
||||
$lang = $queryLang->fetchArray();
|
||||
|
||||
$typeQuery = "SELECT articles.article_type, article_types.type, article_types.explanation FROM article_types,articles WHERE articles.article_id=".$row['article_id']." AND articles.article_type = article_types.id";
|
||||
$typeQuery = "SELECT articles.article_type, article_types.type, article_types.explanation FROM article_types,articles WHERE articles.article_id=".$row['article_id']." AND articles.article_type = article_types.id";
|
||||
|
||||
$queryType = $db->query($typeQuery);
|
||||
$type = $queryType->fetchArray();
|
||||
echo "<dt class='" . $type['type'] . "'><h3 style='display:inline'><a href='/article/".$row['article_id']."'>".$row['article_title']."</a></h3> · <small>publicat el ".strftime('%A, %e %B %Y (%R)', $row['article_timestamp'])."</small></dt><dd><div class='" . $type['type'] . " contents'>". $Parsedown->text($row['article_content']);
|
||||
|
||||
if($type['type']!="Note") {
|
||||
echo "<div class='gradient'><div class='buttonReadMore'><a class='inherit' href='/article/".$row['article_id']."'><span class='icon'>⊕</span> Expandir post</a></div></div>";
|
||||
$queryType = $db->query($typeQuery);
|
||||
$type = $queryType->fetchArray();
|
||||
echo "<dt class='" . $type['type'] . "'><h3 style='display:inline'><a href='/article/".$row['article_id']."'>".$row['article_title']."</a></h3> · <small>publicat el ".strftime('%A, %e %B %Y (%R)', $row['article_timestamp'])."</small></dt><dd><div class='" . $type['type'] . " contents'>". $Parsedown->text($row['article_content']);
|
||||
|
||||
if($type['type']!="Note") {
|
||||
echo "<div class='gradient'><div class='buttonReadMore'><a class='inherit' href='/article/".$row['article_id']."'><span class='icon'>⊕</span> Expandir post</a></div></div>";
|
||||
}
|
||||
echo "</div><hr><small><abbr title='Idioma: ".$lang['name']."'><span class='langTag'><span class='noCursive'>🌐 ".$lang['name']."</span></span></abbr></small>
|
||||
<small><abbr title='Tipus de document: ".$type['type']."\n".$type['explanation']."'><span class='langTag'><span class='noCursive'>📄 ".$type['type']."</span></span></abbr></small>
|
||||
<small>";
|
||||
|
||||
while($rowTags = $queryTags->fetchArray()){
|
||||
echo "<span class='tag'><a class='inherit' href='/tag/".$rowTags['tag_id']."'>" . $rowTags['tagname'] . "</a></span>";
|
||||
}
|
||||
|
||||
echo "</small><br /></dd>";
|
||||
}
|
||||
echo "</div><hr><small><abbr title='Idioma: ".$lang['name']."'><span class='langTag'><span class='noCursive'>🌐 ".$lang['name']."</span></span></abbr></small>
|
||||
<small><abbr title='Tipus de document: ".$type['type']."\n".$type['explanation']."'><span class='langTag'><span class='noCursive'>📄 ".$type['type']."</span></span></abbr></small>
|
||||
<small>";
|
||||
?>
|
||||
</dl>
|
||||
<div id='sidebar'>
|
||||
<div id="search"><input type="text" id='searchText' value="" placeholder="🔎 Busca..." /></div>
|
||||
<h3>Tags</h3>
|
||||
<ul style='list-style:none'>
|
||||
<?php
|
||||
$sel = 'SELECT tag_id, tag_name, count(articles.article_id) as "count", max(articles.article_timestamp) as last_date FROM tags, articles, article_tags WHERE tags.tag_id = article_tags.tag and article_tags.article = articles.article_id group by tag_name order by count desc';
|
||||
$tagsList = $db->query($sel);
|
||||
while($row = $tagsList->fetchArray()){
|
||||
echo "<li><small><span class='tag'><a class='inherit' href='/tag/".$row['tag_id']."'>" . $row['tag_name'] . "</a></span><br /> " .$row['count']. " articles, l'últim de ". strftime('%a, %d/%m/%Y (%R)', $row['last_date']). " </small></li>";
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
<h3>Bookwyrm feed</h3>
|
||||
<?php
|
||||
XMLParser("https://bookwyrm.social/user/Hermes/rss");
|
||||
?>
|
||||
<h3>RSS</h3>
|
||||
<img src='https://xenoteca.digital/icones/rss.png' class='rssIcon' width='30px' height='30px'>
|
||||
<ul style='list-style-type:none;'><li><a class='skipIcon' rel='alternate' type='application/rss+xml' title='RSS General' href='https://xenoteca.digital/rss.php'>Sindicació als posts de la Xenoteca</a></li>
|
||||
<?php if(isset($tagNameRow['tag_name'])) {
|
||||
echo "\t\t<li><a class='skipIcon' rel='alternate' type='application/rss+xml' title='RSS per tag ".$tagNameRow['tag_name']."' href='https://xenoteca.digital/rss.php?tag=".$tagNameRow['tag_name']."'>Sindicació al tag #".$tagNameRow['tag_name']."</a></li>\n";
|
||||
|
||||
while($rowTags = $queryTags->fetchArray()){
|
||||
echo "<span class='tag'><a class='inherit' href='/tag/".$rowTags['tag_id']."'>" . $rowTags['tagname'] . "</a></span>";
|
||||
}
|
||||
|
||||
echo "</small><br /></dd>";
|
||||
}
|
||||
?>
|
||||
</dl>
|
||||
</div>
|
||||
<div id='sidebar'>
|
||||
<h3>Bookwyrm feed</h3>
|
||||
<?php
|
||||
XMLParser("https://bookwyrm.social/user/Hermes/rss");
|
||||
?>
|
||||
} ?></ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id='footer'>
|
||||
<h3>RSS</h3>
|
||||
<img src='https://xenoteca.digital/icones/rss.png' class='rssIcon' width='30px' height='30px'>
|
||||
<ul style='list-style-type:none;'><li><a class='skipIcon' rel='alternate' type='application/rss+xml' title='RSS General' href='https://xenoteca.digital/rss.php'>Sindicació als posts de la Xenoteca</a></li>
|
||||
<?php if(isset($tagNameRow['tag_name'])) {
|
||||
echo "\t\t<li><a class='skipIcon' rel='alternate' type='application/rss+xml' title='RSS per tag ".$tagNameRow['tag_name']."' href='https://xenoteca.digital/rss.php?tag=".$tagNameRow['tag_name']."'>Sindicació al tag #".$tagNameRow['tag_name']."</a></li>\n";
|
||||
|
||||
} ?></ul><br />
|
||||
<h3>Tags</h3>
|
||||
<?php
|
||||
$sel = 'SELECT tag_id, tag_name, count(articles.article_id) as "count", max(articles.article_timestamp) as last_date FROM tags, articles, article_tags WHERE tags.tag_id = article_tags.tag and article_tags.article = articles.article_id group by tag_name order by count desc';
|
||||
$tagsList = $db->query($sel);
|
||||
while($row = $tagsList->fetchArray()){
|
||||
echo "<li><small><span class='tag'><a class='inherit' href='/tag/".$row['tag_id']."'>" . $row['tag_name'] . "</a></span>: " .$row['count']. " articles, l'últim publicat el ". strftime('%A, %e %B %Y (%R)', $row['last_date']). " </small></li>";
|
||||
}
|
||||
?>
|
||||
<h3 style='clear:both'>IndieWeb SignIn:</h3>
|
||||
<ul>
|
||||
<?php
|
||||
|
||||
$iwQuery = "SELECT * FROM indieweb_places";
|
||||
$iwR = $db->query($iwQuery);
|
||||
<div id='superFooter'>
|
||||
<div id='footer'>
|
||||
<h3 style='clear:both'>IndieWeb SignIn:</h3>
|
||||
<ul>
|
||||
<?php
|
||||
|
||||
while ($row = $iwR->fetchArray()) {
|
||||
echo "<li><a href='".$row['url']."' rel='me'><strong>".$row['social']."</strong></a>: ". $row['caption'] ."</li>";
|
||||
}
|
||||
|
||||
?>
|
||||
</ul>
|
||||
$iwQuery = "SELECT * FROM indieweb_places";
|
||||
$iwR = $db->query($iwQuery);
|
||||
|
||||
while ($row = $iwR->fetchArray()) {
|
||||
echo "<li><a href='".$row['url']."' rel='me'><strong>".$row['social']."</strong></a>: ". $row['caption'] ."</li>";
|
||||
}
|
||||
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
|
|
@ -4,17 +4,4 @@ $("a[href^='http']").not('.skipIcon').each(function() {
|
|||
"padding-left": "22px",
|
||||
"background-size":"20px"
|
||||
});
|
||||
});
|
||||
$(document).ready(function() {
|
||||
$("#search").mouseover(function () {
|
||||
$("#searchText").show().focus();
|
||||
});
|
||||
$("#searchText").blur(function () {
|
||||
$("#searchText").hide();
|
||||
});
|
||||
$('#searchText').keyup(function (e) {
|
||||
if (e.keyCode == 13) {
|
||||
document.location.href = "/search/" + $(this).val();
|
||||
}
|
||||
});
|
||||
});
|
|
@ -15,9 +15,18 @@ small {
|
|||
color: lightgrey;
|
||||
}
|
||||
|
||||
.container>dl{
|
||||
max-width:70%;
|
||||
}
|
||||
.container {
|
||||
max-width:90%;
|
||||
position:relative;
|
||||
}
|
||||
#sidebar {
|
||||
position:absolute;
|
||||
top:0px;
|
||||
right:0%;
|
||||
width:25%;
|
||||
}
|
||||
.container p {
|
||||
text-align:justify;
|
||||
text-indent:2em;
|
||||
|
@ -87,14 +96,15 @@ line-height:1.25;
|
|||
position:relative;
|
||||
top:1px;
|
||||
}
|
||||
|
||||
#search{
|
||||
float:right;
|
||||
cursor:pointer;
|
||||
input {
|
||||
padding:5px;
|
||||
}
|
||||
li {
|
||||
margin-top:10px;
|
||||
}
|
||||
#footer {
|
||||
position:absolute;
|
||||
top:50px;
|
||||
right:50px;
|
||||
}
|
||||
#searchText {
|
||||
display:none;
|
||||
}
|
||||
#superFooter, #superContainer {
|
||||
position:relative;
|
||||
}
|
|
@ -199,4 +199,4 @@ btnLogin {
|
|||
margin:7%;
|
||||
min-width:100px;
|
||||
min-height:25px;
|
||||
}
|
||||
}
|
||||
|
|
Carregant…
Referencia en una nova incidència