Compare commits

...

8 Commits
v1 ... master

Author SHA1 Message Date
Lucas a28b7ceea8 Actualizar 'README.md' 2021-04-20 23:57:54 +00:00
Lucas b6a2c7562f Actualizar 'index.php' 2021-04-11 15:43:55 +00:00
Lucas 5f1b5bed16 Actualizar 'index.php' 2021-04-10 22:29:19 +00:00
Lucas ed88a4952b Actualizar 'index.php' 2021-04-10 22:28:33 +00:00
Lucas 6381967f93 RSS feed added to the Index 2021-04-10 22:17:00 +00:00
Lucas 3455b93b6f Now your blog can have a description + changed things 2021-04-10 22:15:19 +00:00
Lucas b5e182f037 Actualizar 'blog_config.php' 2021-04-10 21:59:56 +00:00
Lucas 6b6920e1d1 RSS feed added 2021-04-10 21:58:19 +00:00
3 changed files with 31 additions and 9 deletions

View File

@ -6,7 +6,7 @@
2. Upload to a PHP server
3. Edit "blog_config.php"
4. Enjoy!
## Use
## Post
1. Open "blog_config.php" in a editor
2. Put a "," on the last publication (the post at the bottom of the document)
3. Add something like:
@ -16,4 +16,6 @@
"Hello!", // Title
"Lorem Ipsum" // Body
]
```
```
## Delete
To delete an article just leave in blank the three sections of the thing you want to delete.

View File

@ -1,5 +1,6 @@
<?php // Settings
$title="Blog"; // Obligatory!!! Put the name of your blog here
$description=""; // A description
$website=""; // Include protocol (ex. https://example.com)
$custom_css=""; // Put the url of your custom css
$utterances=''; // Get it on https://utteranc.es. Please use the "Issue title contains page URL"

View File

@ -1,21 +1,40 @@
<?php include "blog_config.php";
if($custom_css!=False){if(file_exists($custom_css)){$custom_css="<link rel='stylesheet' href='$custom_css'>";}else{$custom_css="";}}else{$custom_css="";}
$style="body{text-align:center;font-family:monospace;}p{font-size:large;}a#logo{color:black;text-decoration:none;}.notlogo{margin:5px 0 0 0;}#article{text-align:left;margin:1px 30%;font-size:large;}@media screen and (max-width: 600px){#article{margin:1px 10%;}}footer{margin:1em 0 0 0;}";
$style="body{text-align:center;font-family:monospace;}p{font-size:large;}a#logo{color:black;text-decoration:none;}.notlogo{margin:25px 0px;}#article{text-align:left;margin:1px 30%;font-size:large;}@media screen and (max-width: 600px){#article{margin:1px 10%;}}footer{margin:1em 0 0 0;}";
$footer="</div><footer>pwd by <a href='https://tildegit.org/lucas/tildeweblogs'>~weblogs</a></footer></body></html>";
if(isset($_GET["p"])){
function notfound($errno, $errstr){die("Error!\nPost not found");}
set_error_handler("notfound");
header("Content-type: text/html");
$post=$_GET["p"]-1;
echo "<!DOCTYPE html><html><head><!--~weblogs v1--><meta name='viewport' content='width=device-width,initial-scale=1'><title>".$posts[$post][1]." | $title</title><style>$style</style>$custom_css</head><body><a id='logo' href='?'><h1>$title</h1></a><div class='notlogo'>";
if(strpos($posts[$post][1],"\n")){$html_log=str_replace("\n","<br>",$posts[$post][2]);}else{$html_log=$posts[$post][1];}
echo "<h2>".$posts[$post][1]."</h2>Published on ".$posts[$post][0]."<br><br><div id='article'>$html_log</div>";
echo "<!DOCTYPE html><html><head><!--~weblogs v1.1.1--><meta name='viewport' content='width=device-width,initial-scale=1'><title>".$posts[$post][1]." | $title</title><style>$style</style>$custom_css</head><body><a id='logo' href='?'><h1>$title</h1></a><div class='notlogo'>";
if(strpos($posts[$post][2],"\n")){$html_log=str_replace("\n","<br>",$posts[$post][2]);}else{$html_log=$posts[$post][2];}
echo "<h1>".$posts[$post][1]."</h1>".$posts[$post][0]."<br><br><div id='article'>$html_log</div>";
if($utterances!=False){echo "<br>$utterances";}
echo $footer;
}else{
}elseif(isset($_GET["rss"])){
header("Content-type: application/rss+xml");
$aaa = str_replace("?rss", "", $_SERVER["REQUEST_URI"]);
$eee = "http://$_SERVER[HTTP_HOST]$aaa"; ?>
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title><?php echo $title ?></title>
<?php if($description!=False){echo"<description>$description</description>\n";} ?>
<link><?php echo $eee ?></link>
<?php $a = count($posts) -1; $ao = 0; $next = $a + 1;
while($ao < count($posts)){
if(strpos($posts[$a][2],"\n")){$html_log=str_replace("\n","<br>",$posts[$a][2]);}else{$html_log=$posts[$a][2];}
echo "<item>\n<title>".$posts[$a][1]."</title>\n<link>$eee?p=$next</link>\n<guid>$eee?p=$next</guid>\n<description><![CDATA[".$html_log."]]></description>\n</item>\n";
$a--; $ao++; $next--;
} ?>
</channel>
</rss>
<?php }else{
header("Content-type: text/html");
if($website!=False){$website="<p><a href='$website'>Website</a></p>";}else{$website="";}
echo "<!DOCTYPE html><html><head><meta name='viewport' content='width=device-width,initial-scale=1'><title>$title</title><style>$style</style>$custom_css</head><body><a id='logo' href='?'><h1>$title</h1></a>$website<div class='notlogo'>";
if($website!=False){$website="<a href='$website'>Website</a> - ";}else{$website="";}
if($description!=False){$description="<p>$description</p>";}
echo "<!DOCTYPE html><html><head><meta name='viewport' content='width=device-width,initial-scale=1'><title>$title</title><style>$style</style>$custom_css</head><body><a id='logo' href='?'><h1>$title</h1></a>$description$website<a href='?rss'>RSS Feed</a><br><div class='notlogo'>";
$a=count($posts)-1;$ao=0;$next=$a+1;
while($ao < count($posts)){
echo "<p><b><a href='?p=$next'>".$posts[$a][1]."</a></b> ".$posts[$a][0]."</p>";