Browse Source

rename section

main
ghost 3 years ago
parent
commit
365347cc7c
  1. 4
      src/application/controller/people.php
  2. 2
      src/application/view/common/module/menu.phtml
  3. 0
      src/application/view/people.phtml
  4. 9
      src/bootstrap.php
  5. 6
      src/public/js/module/feed.js
  6. 4
      src/public/js/module/following.js
  7. 4
      src/public/js/people.js
  8. 2
      src/system/helper/format.php

4
src/application/controller/follow.php → src/application/controller/people.php

@ -20,7 +20,7 @@ $metaScripts = [ @@ -20,7 +20,7 @@ $metaScripts = [
'js/module/post.js',
'js/module/feed.js',
'js/module/following.js',
'js/follow.js',
'js/people.js',
];
// Auto-following
@ -33,4 +33,4 @@ if (isset($_GET['_route_'])) { @@ -33,4 +33,4 @@ if (isset($_GET['_route_'])) {
}
}
require(PROJECT_DIR . '/application/view/follow.phtml');
require(PROJECT_DIR . '/application/view/people.phtml');

2
src/application/view/common/module/menu.phtml

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
<div class="moduleMenu" id="moduleMenu">
<a class="item" href="/" title="<?php echo _('Home') ?>">
<i class="bi bi-house"></i>
</a><a class="item" href="follow" title="<?php echo _('Follow') ?>">
</a><a class="item" href="people" title="<?php echo _('People') ?>">
<i class="bi bi-person"></i>
<span></span>
</a><a class="item" href="#todo" title="<?php echo _('Bookmarks') ?>">

0
src/application/view/follow.phtml → src/application/view/people.phtml

9
src/bootstrap.php

@ -63,11 +63,6 @@ if (isset($_GET['_route_'])) { @@ -63,11 +63,6 @@ if (isset($_GET['_route_'])) {
case 'logout':
require(PROJECT_DIR . '/application/controller/logout.php');
break;
/*
case 'follow':
require(PROJECT_DIR . '/application/controller/follow.php');
break;
*/
case 'register':
require(PROJECT_DIR . '/application/controller/register.php');
break;
@ -101,8 +96,8 @@ if (isset($_GET['_route_'])) { @@ -101,8 +96,8 @@ if (isset($_GET['_route_'])) {
switch (true) {
// Pages
case preg_match('|^follow[/\w_]?|i', $_GET['_route_']):
require(PROJECT_DIR . '/application/controller/follow.php');
case preg_match('|^people[/\w_]?|i', $_GET['_route_']):
require(PROJECT_DIR . '/application/controller/people.php');
break;
// 404

6
src/public/js/module/feed.js

@ -14,7 +14,7 @@ var ModuleFeed = { @@ -14,7 +14,7 @@ var ModuleFeed = {
'class': 'info'
}).append(
$('<a/>', {
'href': 'follow/' + reTwist.userName
'href': 'people/' + reTwist.userName
}).append(reTwist.userName)
).append(
$('<span/>', {
@ -34,7 +34,7 @@ var ModuleFeed = { @@ -34,7 +34,7 @@ var ModuleFeed = {
'class': 'avatar'
}).append(
$('<a/>', {
'href': 'follow/' + userName
'href': 'people/' + userName
}).append(
$('<img/>', {
'src': '/api/image?hash=' + userName,
@ -50,7 +50,7 @@ var ModuleFeed = { @@ -50,7 +50,7 @@ var ModuleFeed = {
'class': 'info'
}).append(
$('<a/>', {
'href': 'follow/' + userName
'href': 'people/' + userName
}).append(userName)
).append(
$('<span/>', {

4
src/public/js/module/following.js

@ -11,7 +11,7 @@ var ModuleFollowing = { @@ -11,7 +11,7 @@ var ModuleFollowing = {
'class': 'avatar'
}).append(
$('<a/>', {
'href': 'follow/' + userName
'href': 'people/' + userName
}).append(
$('<img/>', {
'src': '/api/image?hash=' + userName,
@ -24,7 +24,7 @@ var ModuleFollowing = { @@ -24,7 +24,7 @@ var ModuleFollowing = {
'class': 'info'
}).append(
$('<a/>', {
'href': 'follow/' + userName
'href': 'people/' + userName
}).append(userName)
)
).append(

4
src/public/js/follow.js → src/public/js/people.js

@ -1,13 +1,13 @@ @@ -1,13 +1,13 @@
$(document).ready(function() {
// Init modules
ModuleMenu.init('follow');
ModuleMenu.init('people');
ModuleFollowing.load('#moduleFollowing', true);
ModuleFeed.load('#moduleFeed', true);
// Event listeners
$(document).on('ModuleFollowing.unFollow:success', function(/*event, response*/) {
ModuleMenu.init('follow');
ModuleMenu.init('people');
ModuleFollowing.load('#moduleFollowing', true);
ModuleFeed.load('#moduleFeed', true);
});

2
src/system/helper/format.php

@ -48,7 +48,7 @@ class Format { @@ -48,7 +48,7 @@ class Format {
public static function post(string $text) {
$text = preg_replace("|@([a-zA-Z0-9_]+)|i", "<a href=\"follow/$1\">@$1</a>", $text);
$text = preg_replace("|@([a-zA-Z0-9_]+)|i", "<a href=\"people/$1\">@$1</a>", $text);
$text = preg_replace("|((https?://)?([\d\w\.-]+\.[\w\.]{2,6})[^\s\]\[\<\>]*/?)|i", "<a href=\"$1\" target=\"_blank\">$3</a>", $text);
$text = nl2br($text);

Loading…
Cancel
Save