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 = [
'js/module/post.js', 'js/module/post.js',
'js/module/feed.js', 'js/module/feed.js',
'js/module/following.js', 'js/module/following.js',
'js/follow.js', 'js/people.js',
]; ];
// Auto-following // Auto-following
@ -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 @@
<div class="moduleMenu" id="moduleMenu"> <div class="moduleMenu" id="moduleMenu">
<a class="item" href="/" title="<?php echo _('Home') ?>"> <a class="item" href="/" title="<?php echo _('Home') ?>">
<i class="bi bi-house"></i> <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> <i class="bi bi-person"></i>
<span></span> <span></span>
</a><a class="item" href="#todo" title="<?php echo _('Bookmarks') ?>"> </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_'])) {
case 'logout': case 'logout':
require(PROJECT_DIR . '/application/controller/logout.php'); require(PROJECT_DIR . '/application/controller/logout.php');
break; break;
/*
case 'follow':
require(PROJECT_DIR . '/application/controller/follow.php');
break;
*/
case 'register': case 'register':
require(PROJECT_DIR . '/application/controller/register.php'); require(PROJECT_DIR . '/application/controller/register.php');
break; break;
@ -101,8 +96,8 @@ if (isset($_GET['_route_'])) {
switch (true) { switch (true) {
// Pages // Pages
case preg_match('|^follow[/\w_]?|i', $_GET['_route_']): case preg_match('|^people[/\w_]?|i', $_GET['_route_']):
require(PROJECT_DIR . '/application/controller/follow.php'); require(PROJECT_DIR . '/application/controller/people.php');
break; break;
// 404 // 404

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

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

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

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

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

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

2
src/system/helper/format.php

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

Loading…
Cancel
Save