Merge branch 'dev' into nomadic

This commit is contained in:
Mike Macgirvin 2024-05-20 17:37:43 +10:00
commit 2fbd7309ba
12 changed files with 955 additions and 918 deletions

View file

@ -1,9 +1,9 @@
Creating Addons
===============
So you want to make $Projectname do something it doesn't already do. There are lots of ways. But let's learn how to write an addon.
So you want to make $sitename do something it doesn't already do. There are lots of ways. But let's learn how to write an addon.
In your $Projectname folder/directory, you will probably see a sub-directory called 'addon'. If you don't have one already, go ahead and create it.
In your $sitename folder/directory, you will probably see a sub-directory called 'addon'. If you don't have one already, go ahead and create it.
[code]
mkdir addon
[/code]
@ -52,7 +52,7 @@ In our case, we'll call them randplace_load() and randplace_unload(), as that is
Next we'll talk about [b]hooks[/b], which are essentially event handlers. There are a lot of these, and they each have a name. What we normally do is use the addonname_load() function to register a "handler function" for any hooks you are interested in. Then when any of the corresponding events occur, your code will be called. These are all called with one argument, which is often an array of data or information that is specific to that hook or event. In order to change any information in that array, you must indicate in your handler function that the argument variable is to be passed "by reference". You can do this with '&$variable_name'.
We register hook handlers with the 'Code\Extend\Hook::register()' function. It typically takes 3 arguments. The first is the name of the hook we wish to catch, the second is the filename of the file to find our handler function (relative to the base of your $Projectname installation), and the third is the function name of your handler function. Then we'll use 'Code\Extend\Route::register()' to define a "controller" or web page. This requires two arguments. The first is the name of the file we wish to provide the controller logic and the second is the name of the webpage path where we want our controller to answer web requests. By convention we use addon/addonname/Mod_something.php as the filename and in this case the page will be found at https://{yoursite}/something. So let's create our randplace_load() function right now.
We register hook handlers with the 'Code\Extend\Hook::register()' function. It typically takes 3 arguments. The first is the name of the hook we wish to catch, the second is the filename of the file to find our handler function (relative to the base of your $sitename installation), and the third is the function name of your handler function. Then we'll use 'Code\Extend\Route::register()' to define a "controller" or web page. This requires two arguments. The first is the name of the file we wish to provide the controller logic and the second is the name of the webpage path where we want our controller to answer web requests. By convention we use addon/addonname/Mod_something.php as the filename and in this case the page will be found at https://{yoursite}/something. So let's create our randplace_load() function right now.
[code]
function randplace_load() {

View file

@ -81,7 +81,7 @@ This will select the theme named "suckerberg" and select the "pas
[/code]
The condensed notation isn't part of Comanche itself but is recognised by $Projectname platform as a theme specifier.
The condensed notation isn't part of Comanche itself but is recognised by the internal theme code as a theme specifier.
[b]Regions[/b]
Each region has a name, as noted above. You will specify the region of interest using a 'region' tag, which includes the name. Any content you wish placed in this region should be placed between the opening region tag and the closing tag.

View file

@ -201,7 +201,8 @@ in some text [/nobb][/td]
[/table]
<h3>$Projectname specific codes</h3>
<h3>Platform specific codes</h3>
These codes may not work correctly with other fediverse-enabled software.
[table]
[tbody]

View file

@ -930,7 +930,7 @@ function contact_block()
$shown = get_pconfig(App::$profile['uid'], 'system', 'display_friend_count');
if ($shown === false) {
$shown = 25;
$shown = 24;
}
if ($shown == 0) {
return;

View file

@ -226,7 +226,10 @@ function t($s, $ctx = '')
function translate_projectname($s)
{
if (str_contains($s, 'rojectname')) {
return str_replace([ '$projectname','$Projectname' ], [ System::get_project_name(), ucfirst(System::get_project_name()) ], $s);
$s = str_replace([ '$projectname','$Projectname' ], [ System::get_project_name(), ucfirst(System::get_project_name()) ], $s);
}
if (str_contains($s, 'itename')) {
$s = str_replace([ '$sitename','$Sitename' ], [ System::get_site_name(), ucfirst(System::get_site_name()) ], $s);
}
return $s;
}

View file

@ -525,6 +525,7 @@ function check_deliver_permissions($uid, $arr)
$willNotSend = ids_to_array($r,'xchan');
// Find actors accepting our posts
$r = q("select * from abconfig where chan = %d and cat = 'system' and k = 'their_perms' and v like '%%send_stream%%'",
intval($uid)
);
@ -533,7 +534,25 @@ function check_deliver_permissions($uid, $arr)
// Filter the recipient list accordingly.
if ($arr) {
foreach ($arr as $x) {
if (in_array($x, $theyAccept) && ! in_array($x, $willNotSend)) {
$accepting = $deliverable = false;
if (in_array($x, $theyAccept)) {
$accepting = true;
}
if (!in_array($x,$willNotSend)) {
$deliverable = true;
}
if ($deliverable && !$accepting) {
// Groups don't generally provide send_stream permission as they aren't really following you,
// but they do allow you to send them group targeted posts.
$r = q("select xchan_hash from xchan where xchan_hash = '%s' and xchan_type = %d ",
dbesc($x),
intval(XCHAN_TYPE_GROUP)
);
if ($r) {
$result[] = $x;
}
}
if ($deliverable && $accepting) {
$result[] = $x;
}
}

View file

@ -133,6 +133,10 @@ class ThreadItem
}
}
if ($item['item_restrict'] & 1) {
$privacy_warning = true;
$lock = t('This comment was sent as a direct (private) message but the conversation has a different privacy expectation and any replies to it may be seen by others. Discretion advised.');
}
if ($item['item_restrict'] & 2) {

View file

@ -39,7 +39,7 @@ class Help extends Controller
$o .= '<li><a href="help/' . (($path) ? $path . '/' : '') . $fname . '" >' . ucwords(str_replace('_', ' ', notags($fname))) . '</a><br>'
. '<b><i>' . 'help/' . (($path) ? $path . '/' : '') . $fname . '</i></b><br>'
. '...' . str_replace('$Projectname', System::get_platform_name(), $rr['text']) . '...<br><br></li>';
. '...' . str_replace(['$sitename', '$Projectname'], [System::get_site_name(), System::get_project_name()], $rr['text']) . '...<br><br></li>';
}
$o .= '</ul>';
$o .= '</div>';
@ -135,7 +135,7 @@ class Help extends Controller
}
return replace_macros(Theme::get_template('help.tpl'), [
'$title' => t('$Projectname Documentation'),
'$title' => t('$sitename Documentation'),
'$tocHeading' => t('Contents'),
'$content' => $content,
'$heading' => $heading,

File diff suppressed because it is too large Load diff

View file

@ -1,2 +1,2 @@
<?php
define ('STD_VERSION', '24.05.13');
define ('STD_VERSION', '24.05.19');

View file

@ -1,6 +1,6 @@
name: Fresh
description: 'A Fresh new look for Streams.'
version: 'Version: 0.20'
version: 'Version: 0.24'
credits: 'Development provided by: <a href="https://www.knthost.com/streams">K&T Host - (www.knthost.com)</a>'
author: 'K&T Host'
maintainer:

View file

@ -313,6 +313,9 @@ nav .acpopup {
background: none;
color: $link_color;
}
.wall-item-lock .text-warning {
color: $danger !important;
}
.menu-img-1, .menu-img-2, .menu-img-3 {
margin-right: 5px;
border-radius: $radius;
@ -1280,8 +1283,6 @@ img.mail-conv-sender-photo {
/* misc items */
.spinner.s, .spinner.m, .spinner.l {
width: 48px;
height: 48px;
border-radius: 50%;
display: inline-block;
border-top: 3px solid $primary;
@ -1291,8 +1292,7 @@ img.mail-conv-sender-photo {
border-bottom: none;
border-left: none;
position: initial;
margin-left: 48%
}
}
@keyframes rotation {
0% {
transform: rotate(0deg);
@ -1300,7 +1300,16 @@ img.mail-conv-sender-photo {
100% {
transform: rotate(360deg);
}
}
}
.spinner.l, .spinner.m {
width: 50px;
height: 50px;
margin-left: 48%;
}
.spinner.s {
width: 30px;
height: 30px;
margin-left: 0%;
}
.acl-button-hide, .acl-button-show {
float: right;