Merge branch 'dev' of /home/macgirvin/z into dev

This commit is contained in:
nobody 2020-09-15 18:03:54 -07:00
commit 9e08e3d336
18 changed files with 3493 additions and 3143 deletions

View file

@ -174,27 +174,10 @@ class Poller {
}
}
if($dirmode == DIRECTORY_MODE_SECONDARY || $dirmode == DIRECTORY_MODE_PRIMARY) {
$r = q("SELECT u.ud_addr, u.ud_id, u.ud_last FROM updates AS u INNER JOIN (SELECT ud_addr, max(ud_id) AS ud_id FROM updates WHERE ( ud_flags & %d ) = 0 AND ud_addr != '' AND ( ud_last <= '%s' OR ud_last > %s - INTERVAL %s ) GROUP BY ud_addr) AS s ON s.ud_id = u.ud_id ",
intval(UPDATE_FLAGS_UPDATED),
dbesc(NULL_DATE),
db_utcnow(), db_quoteinterval('7 DAY')
);
if($r) {
foreach($r as $rr) {
// If they didn't respond when we attempted before, back off to once a day
// After 7 days we won't bother anymore
if($rr['ud_last'] > NULL_DATE)
if($rr['ud_last'] > datetime_convert('UTC','UTC', 'now - 1 day'))
continue;
Run::Summon(array('Onedirsync',$rr['ud_id']));
if($interval)
@time_sleep_until(microtime(true) + (float) $interval);
}
}
}
// migrate a few photos - eventually we'll migrate them all but without killing somebody's site
// trying to do them all at once
migrate_xchan_photos(5);
set_config('system','lastpoll',datetime_convert());

View file

@ -422,25 +422,29 @@ class Libprofile {
if(App::$profile['gender']) $profile['gender'] = array( t('Gender:'), App::$profile['gender'] );
$ob_hash = get_observer_hash();
if($ob_hash && perm_is_allowed(App::$profile['profile_uid'],$ob_hash,'post_like')) {
$profile['canlike'] = true;
$profile['likethis'] = t('Like this channel');
$profile['profile_guid'] = App::$profile['profile_guid'];
}
$likers = q("select liker, xchan.* from likes left join xchan on liker = xchan_hash where channel_id = %d and target_type = '%s' and verb = '%s'",
intval(App::$profile['profile_uid']),
dbesc(ACTIVITY_OBJ_PROFILE),
dbesc(ACTIVITY_LIKE)
);
$profile['likers'] = array();
$profile['like_count'] = count($likers);
$profile['like_button_label'] = tt('Like','Likes',$profile['like_count'],'noun');
if($likers) {
foreach($likers as $l)
$profile['likers'][] = array('name' => $l['xchan_name'],'photo' => zid($l['xchan_photo_s']), 'url' => zid($l['xchan_url']));
}
$ob_hash = get_observer_hash();
// this may not work at all any more, but definitely won't work correctly if the liked profile belongs to a group
// comment out until we are able to look at it much closer
// if($ob_hash && perm_is_allowed(App::$profile['profile_uid'],$ob_hash,'post_like')) {
// $profile['canlike'] = true;
// $profile['likethis'] = t('Like this channel');
// $profile['profile_guid'] = App::$profile['profile_guid'];
// }
// $likers = q("select liker, xchan.* from likes left join xchan on liker = xchan_hash where channel_id = %d and target_type = '%s' and verb = '%s'",
// intval(App::$profile['profile_uid']),
// dbesc(ACTIVITY_OBJ_PROFILE),
// dbesc(ACTIVITY_LIKE)
// );
// $profile['likers'] = array();
// $profile['like_count'] = count($likers);
// $profile['like_button_label'] = tt('Like','Likes',$profile['like_count'],'noun');
// if($likers) {
// foreach($likers as $l)
// $profile['likers'][] = array('name' => $l['xchan_name'],'photo' => zid($l['xchan_photo_s']), 'url' => zid($l['xchan_url']));
// }
if((App::$profile['dob']) && (App::$profile['dob'] != '0000-00-00')) {

View file

@ -729,7 +729,7 @@ class Libzot {
}
if ($r) {
if ($arr['photo'] && array_key_exists('updated',$arr['photo']) && $r[0]['xchan_photo_date'] != $arr['photo']['updated']) {
if ($arr['photo'] && array_key_exists('updated',$arr['photo']) && $arr['photo']['updated'] > $r[0]['xchan_photo_date']) {
$import_photos = true;
}
@ -888,8 +888,11 @@ class Libzot {
dbesc($xchan_hash)
);
if ($local) {
$ph = z_fetch_url($arr['photo']['url'], true);
if ($ph['success']) {
$ph = false;
if (strpos($arr['photo']['url'], z_root()) === false) {
$ph = z_fetch_url($arr['photo']['url'], true);
}
if ($ph && $ph['success']) {
$hash = import_channel_photo($ph['body'], $arr['photo']['type'], $local[0]['channel_account_id'], $local[0]['channel_id']);
if ($hash) {

View file

@ -8,28 +8,47 @@
namespace Zotlabs\Module;
use App;
use Zotlabs\Web\Controller;
use Zotlabs\Web\SubModule;
use Zotlabs\Lib\Config;
require_once('include/account.php');
/**
* @brief Admin area.
*
*/
class Admin extends \Zotlabs\Web\Controller {
class Admin extends Controller {
private $sm = null;
function __construct() {
$this->sm = new \Zotlabs\Web\SubModule();
$this->sm = new SubModule();
}
function post(){
logger('admin_post', LOGGER_DEBUG);
function init() {
if(! is_site_admin()) {
logger('admin_init', LOGGER_DEBUG);
if (! is_site_admin()) {
return;
}
if (argc() > 1) {
$this->sm->call('init');
}
}
function post() {
logger('admin_post', LOGGER_DEBUG);
if (! is_site_admin()) {
return;
}
if (argc() > 1) {
$this->sm->call('post');
}
@ -45,7 +64,7 @@ class Admin extends \Zotlabs\Web\Controller {
logger('admin_content', LOGGER_DEBUG);
if(! is_site_admin()) {
if (! is_site_admin()) {
return login(false);
}
@ -57,9 +76,9 @@ class Admin extends \Zotlabs\Web\Controller {
$o = '';
if(argc() > 1) {
if (argc() > 1) {
$o = $this->sm->call('get');
if($o === false) {
if ($o === false) {
notice( t('Item not found.') );
}
}
@ -67,9 +86,10 @@ class Admin extends \Zotlabs\Web\Controller {
$o = $this->admin_page_summary();
}
if(is_ajax()) {
if (is_ajax()) {
echo $o;
killme();
// this is probably redundant
return '';
}
else {
@ -83,10 +103,11 @@ class Admin extends \Zotlabs\Web\Controller {
*
* @return string HTML from parsed admin_summary.tpl
*/
function admin_page_summary() {
// list total user accounts, expirations etc.
$accounts = array();
$accounts = [];
$r = q("SELECT COUNT(CASE WHEN account_id > 0 THEN 1 ELSE NULL END) AS total, COUNT(CASE WHEN account_expires > %s THEN 1 ELSE NULL END) AS expiring, COUNT(CASE WHEN account_expires < %s AND account_expires > '%s' THEN 1 ELSE NULL END) AS expired, COUNT(CASE WHEN (account_flags & %d)>0 THEN 1 ELSE NULL END) AS blocked FROM account",
db_utcnow(),
db_utcnow(),
@ -94,10 +115,10 @@ class Admin extends \Zotlabs\Web\Controller {
intval(ACCOUNT_BLOCKED)
);
if ($r) {
$accounts['total'] = array('label' => t('Accounts'), 'val' => $r[0]['total']);
$accounts['blocked'] = array('label' => t('Blocked accounts'), 'val' => $r[0]['blocked']);
$accounts['expired'] = array('label' => t('Expired accounts'), 'val' => $r[0]['expired']);
$accounts['expiring'] = array('label' => t('Expiring accounts'), 'val' => $r[0]['expiring']);
$accounts['total'] = [ 'label' => t('Accounts'), 'val' => $r[0]['total'] ];
$accounts['blocked'] = [ 'label' => t('Blocked accounts'), 'val' => $r[0]['blocked'] ];
$accounts['expired'] = [ 'label' => t('Expired accounts'), 'val' => $r[0]['expired'] ];
$accounts['expiring'] = [ 'label' => t('Expiring accounts'), 'val' => $r[0]['expiring'] ];
}
// pending registrations
@ -112,21 +133,29 @@ class Admin extends \Zotlabs\Web\Controller {
$channels = array();
$r = q("SELECT COUNT(*) AS total, COUNT(CASE WHEN channel_primary = 1 THEN 1 ELSE NULL END) AS main, COUNT(CASE WHEN channel_primary = 0 THEN 1 ELSE NULL END) AS clones FROM channel WHERE channel_removed = 0 and channel_system = 0");
if ($r) {
$channels['total'] = array('label' => t('Channels'), 'val' => $r[0]['total']);
$channels['main'] = array('label' => t('Primary'), 'val' => $r[0]['main']);
$channels['clones'] = array('label' => t('Clones'), 'val' => $r[0]['clones']);
$channels['total'] = [ 'label' => t('Channels'), 'val' => $r[0]['total'] ];
$channels['main'] = [ 'label' => t('Primary'), 'val' => $r[0]['main'] ];
$channels['clones'] = [ 'label' => t('Clones'), 'val' => $r[0]['clones'] ];
}
// We can do better, but this is a quick queue status
$r = q("SELECT COUNT(outq_delivered) AS total FROM outq WHERE outq_delivered = 0");
$queue = (($r) ? $r[0]['total'] : 0);
$queues = array( 'label' => t('Message queues'), 'queue' => $queue );
$queues = [ 'label' => t('Message queues'), 'queue' => $queue ];
// If no plugins active return 0, otherwise list of plugin names
$plugins = (count(\App::$plugins) == 0) ? count(\App::$plugins) : \App::$plugins;
$plugins = [];
if(is_array($plugins))
if (is_array(App::$plugins) && App::$plugins) {
foreach (App::$plugins as $p) {
if ($p) {
$plugins[] = $p;
}
}
sort($plugins);
}
else {
$plugins = 0;
}
// Could be extended to provide also other alerts to the admin
@ -134,29 +163,28 @@ class Admin extends \Zotlabs\Web\Controller {
$upgrade = EMPTY_STR;
if((! defined('PLATFORM_ARCHITECTURE')) || (PLATFORM_ARCHITECTURE === 'red')) {
if((! defined('PLATFORM_ARCHITECTURE')) || (PLATFORM_ARCHITECTURE === 'zap')) {
$vrelease = get_repository_version('release');
$vdev = get_repository_version('dev');
$upgrade = ((version_compare(STD_VERSION,$vrelease) < 0) ? t('Your software should be updated') : '');
}
$t = get_markup_template('admin_summary.tpl');
return replace_macros($t, array(
return replace_macros($t, [
'$title' => t('Administration'),
'$page' => t('Summary'),
'$adminalertmsg' => $alertmsg,
'$queues' => $queues,
'$accounts' => array( t('Registered accounts'), $accounts),
'$pending' => array( t('Pending registrations'), $pending),
'$channels' => array( t('Registered channels'), $channels),
'$plugins' => array( t('Active addons'), $plugins ),
'$version' => array( t('Version'), STD_VERSION),
'$vmaster' => array( t('Repository version (release)'), $vrelease),
'$vdev' => array( t('Repository version (dev)'), $vdev),
'$accounts' => [ t('Registered accounts'), $accounts ],
'$pending' => [ t('Pending registrations'), $pending ],
'$channels' => [ t('Registered channels'), $channels ],
'$plugins' => (($plugins) ? [ t('Active addons'), $plugins ] : EMPTY_STR),
'$version' => [ t('Version'), STD_VERSION ],
'$vmaster' => [ t('Repository version (release)'), $vrelease ],
'$vdev' => [ t('Repository version (dev)'), $vdev ],
'$upgrade' => $upgrade,
'$build' => get_config('system', 'db_version')
));
'$build' => Config::Get('system', 'db_version')
]);
}
}

View file

@ -133,23 +133,26 @@ class Channel extends Controller {
// Run Libprofile::load() here to make sure the theme is set before
// we start loading content
Libprofile::load($which,$profile);
Libprofile::load($which,$profile);
App::$meta->set('og:title', $channel['channel_name']);
App::$meta->set('og:image', $channel['xchan_photo_l']);
App::$meta->set('og:type','webpage');
App::$meta->set('og:url', channel_url($channel));
if(App::$profile['about'] && perm_is_allowed($channel['channel_id'],get_observer_hash(),'view_profile')) {
App::$meta->set('og:description', App::$profile['about']);
}
else {
App::$meta->set('og:description', sprintf( t('This is the home page of %s.'), $channel['channel_name']));
if (! $_REQUEST['mid']) {
App::$meta->set('og:title', $channel['channel_name']);
App::$meta->set('og:image', $channel['xchan_photo_l']);
App::$meta->set('og:type','webpage');
App::$meta->set('og:url:secure_url', channel_url($channel));
if(App::$profile['about'] && perm_is_allowed($channel['channel_id'],get_observer_hash(),'view_profile')) {
App::$meta->set('og:description', App::$profile['about']);
}
else {
App::$meta->set('og:description', sprintf( t('This is the home page of %s.'), $channel['channel_name']));
}
}
}
function get($update = 0, $load = false) {
$noscript_content = get_config('system', 'noscript_content', '1');
@ -542,8 +545,64 @@ class Channel extends Controller {
}
if($mid)
// We reset $channel so that info can be obtained for unlogged visitors
$channel = channelx_by_n(App::$profile['profile_uid']);
if ($_REQUEST['mid']) {
if(preg_match("/\[[zi]mg(.*?)\]([^\[]+)/is", $items[0]['body'], $matches)) {
$ogimage = $matches[2];
// Will we use og:image:type someday? We keep this just in case
// $ogimagetype = guess_image_type($ogimage);
}
// some work on post content to generate a description
// almost fully based on work done on Hubzilla by Max Kostikov
$ogdesc = $items[0]['body'];
$ogdesc = str_replace("#^[", "[", $ogdesc);
$ogdesc = bbcode($ogdesc, [ 'tryoembed' => false ]);
$ogdesc = trim(html2plain($ogdesc, 0, true));
$ogdesc = html_entity_decode($ogdesc, ENT_QUOTES, 'UTF-8');
// remove all URLs
$ogdesc = preg_replace("/https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,\@]+/", "", $ogdesc);
// shorten description
$ogdesc = substr($ogdesc, 0, 300);
$ogdesc = str_replace("\n", " ", $ogdesc);
while (strpos($ogdesc, " ") !== false)
$ogdesc = str_replace(" ", " ", $ogdesc);
$ogdesc = (strlen($ogdesc) < 298 ? $ogdesc : rtrim(substr($ogdesc, 0, strrpos($ogdesc, " ")), "?.,:;!-") . "...");
// we can now start loading content
if (! empty($items[0]['title'])) {
App::$meta->set('og:title', $items[0]['title']);
}
else {
App::$meta->set('og:title', $channel['channel_name']);
}
if (! empty($ogimage)) {
App::$meta->set('og:image', $ogimage);
}
else {
App::$meta->set('og:image', $channel['xchan_photo_l']);
}
App::$meta->set('og:type', 'article');
App::$meta->set('og:url:secure_url', channel_url($channel));
if (! empty($ogdesc)) {
App::$meta->set('og:description', $ogdesc);
}
else {
App::$meta->set('og:description', sprintf( t('This post was published on the home page of %s.'), $channel['channel_name']));
}
}
if ($mid) {
$o .= '<div id="content-complete"></div>';
}
return $o;
}

View file

@ -430,7 +430,7 @@ class Directory extends Controller {
else {
$maxheight = 94;
$dirtitle = (($globaldir) ? t('Network Directory (channels known to this site)') : t('Local Directory'));
$dirtitle = (($globaldir) ? t('Directory') : t('Local Directory'));
$o .= "<script> var page_query = '" . escape_tags(urlencode($_GET['req'])) . "'; var extra_args = '" . extra_query_args() . "' ; divmore_height = " . intval($maxheight) . "; </script>";
$o .= replace_macros($tpl, [

View file

@ -335,6 +335,56 @@ class Display extends Controller {
$items = array();
}
foreach ($items as $item) {
if ($item['mid'] === $item_hash) {
if(preg_match("/\[[zi]mg(.*?)\]([^\[]+)/is", $item['body'], $matches)) {
$ogimage = $matches[2];
// Will we use og:image:type someday? We keep this just in case
// $ogimagetype = guess_image_type($ogimage);
}
// some work on post content to generate a description
// almost fully based on work done on Hubzilla by Max Kostikov
$ogdesc = $item['body'];
$ogdesc = bbcode($ogdesc, [ 'export' => true ]);
$ogdesc = trim(html2plain($ogdesc, 0, true));
$ogdesc = html_entity_decode($ogdesc, ENT_QUOTES, 'UTF-8');
// remove all URLs
$ogdesc = preg_replace("/https?\:\/\/[a-zA-Z0-9\:\/\-\?\&\;\.\=\_\~\#\%\$\!\+\,\@]+/", "", $ogdesc);
// shorten description
$ogdesc = substr($ogdesc, 0, 300);
$ogdesc = str_replace("\n", " ", $ogdesc);
while (strpos($ogdesc, " ") !== false)
$ogdesc = str_replace(" ", " ", $ogdesc);
$ogdesc = (strlen($ogdesc) < 298 ? $ogdesc : rtrim(substr($ogdesc, 0, strrpos($ogdesc, " ")), "?.,:;!-") . "...");
// we can now start loading content
if ($item['title']) {
App::$meta->set('og:title', $item['title']);
}
else {
App::$meta->set('og:title', ((System::get_site_name()) ? escape_tags(System::get_site_name()) : System::get_platform_name()));
}
if (isset($ogimage)) {
App::$meta->set('og:image', $ogimage);
}
else {
App::$meta->set('og:image', System::get_site_icon());
}
App::$meta->set('og:type', 'article');
App::$meta->set('og:url:secure_url', $item['llink']);
if ($ogdesc) {
App::$meta->set('og:description', $ogdesc);
}
}
}
switch($module_format) {
case 'html':

View file

@ -303,7 +303,7 @@ class Inbox extends Controller {
break;
}
case 'Leave':
if ($AS->obj && array_key_exists('type', $AS->obj) && $AS->obj['type'] === 'Group') {
if ($AS->obj && is_array($AS->obj) && array_key_exists('type', $AS->obj) && $AS->obj['type'] === 'Group') {
// do unfollow activity
Activity::unfollow($channel,$AS);
break;

View file

@ -9,7 +9,7 @@ class Sites extends \Zotlabs\Web\Controller {
$sql_extra = (($_REQUEST['project']) ? " and site_project = '" . escape_tags(protect_sprintf($_REQUEST['project'])) . "' " : "");
$desc = t('This page provides information about related projects and websites that are currently known to this system. These are a small fraction of the thousands of affiliated fediverse websites.');
$desc = t('This page provides information about related projects and websites that are currently known to this system. These are a small fraction of the thousands of websites and dozens of projects and providers which make up the fediverse.');
$j = [];

View file

@ -12,25 +12,61 @@ class HttpMeta {
$this->vars = [];
$this->og = [];
$this->ogproperties = [];
}
function set($property,$value) {
//Set Meta Value
// Mode:
// 0 = Default - set if no value currently exists
// 1 = Overwrite - replace existing value(s)
// 2 = Multi - append to the array of values
function set($property,$value,$mode=0) {
$ogallowsmulti = ['image','audio','video'];
if (strpos($property,'og:') === 0) {
$this->og[$property] = $value;
}
else {
$count = 0;
foreach ($this->og as $ogk => $ogdata) {
if (strpos($ogdata['property'],$property) === 0) {
if ($mode == 1) {
unset($this->og[$ogk]);
unset($this->ogproperties[$property]);
}
elseif ($mode == 0) {
return;
}
elseif ($value == $ogdata['value']) {
return;
}
else {
$count++;
}
}
}
if ($value !== null) {
//mode = 1 with value === null will delete the property entirely.
$components = explode(':',$property);
$ogp=$components[1];
if (!$count || in_array($ogp,$ogallowsmulti)) {
$this->og[]=['property'=>$property,'value'=>$value];
$this->ogproperties[$property] = $property;
}
}
} else {
$this->vars[$property] = $value;
}
}
function check_required() {
if (
($this->og)
&& array_key_exists('og:title',$this->og)
&& array_key_exists('og:type', $this->og)
&& array_key_exists('og:image',$this->og)
&& array_key_exists('og:url', $this->og)
in_array('og:title',$this->ogproperties)
&& in_array('og:type', $this->ogproperties)
&& (in_array('og:image',$this->ogproperties)
|| in_array('og:image:url',$this->ogproperties))
&& (array_key_exists('og:url', $this->ogproperties)
|| array_key_exists('og:url:secure_url', $this->ogproperties))
&& array_key_exists('og:description', $this->ogproperties)
) {
return true;
}
@ -39,7 +75,11 @@ class HttpMeta {
function get_field($field) {
if (strpos($field,'og:') === 0) {
$arr = $this->og;
foreach ($this->og as $ogdata) {
if (strpos($ogdata['property'],$field) === 0) {
$arr[$field][] = $ogdata['value'];
}
}
}
else {
$arr = $this->vars;
@ -61,8 +101,8 @@ class HttpMeta {
}
}
if ($this->check_required()) {
foreach ($this->og as $k => $v) {
$o .= '<meta property="' . htmlspecialchars($k,ENT_COMPAT,'UTF-8',false) . '" content="' . htmlspecialchars($v,ENT_COMPAT,'UTF-8',false) . '" />' . "\r\n" ;
foreach ($this->og as $ogdata) {
$o .= '<meta property="' . htmlspecialchars($ogdata['property'],ENT_COMPAT,'UTF-8',false) . '" content="' . htmlspecialchars($ogdata['value'],ENT_COMPAT,'UTF-8',false) . '" />' . "\r\n" ;
}
}
if ($o) {
@ -71,4 +111,4 @@ class HttpMeta {
return $o;
}
}
}

View file

@ -31,6 +31,7 @@ class Findpeople {
'$suggest' => t('Channel Suggestions'),
'$similar' => '', // FIXME and uncomment when mod/match working // t('Similar Interests'),
'$random' => '', // t('Random Profile'),
'$sites' => t('Affiliated sites'),
'$inv' => '', // t('Invite Friends'),
'$advanced_search' => $advanced_search,
'$advanced_hint' => "\r\n" . t('Advanced example: name=fred and country=iceland'),

View file

@ -16,7 +16,7 @@ use Zotlabs\Daemon\Run;
* @brief This file defines some global constants and includes the central App class.
*/
define ( 'STD_VERSION', '20.09.10' );
define ( 'STD_VERSION', '20.09.15' );
define ( 'ZOT_REVISION', '6.0' );
define ( 'DB_UPDATE_VERSION', 1242 );

View file

@ -10,7 +10,7 @@ use Zotlabs\Lib\Queue;
use Zotlabs\Lib\System;
use Zotlabs\Lib\Keyutils;
use Zotlabs\Daemon\Run;
use Runminds\HTML5;
/**
* @file include/network.php

View file

@ -500,8 +500,17 @@ function import_channel_photo($photo, $type, $aid, $uid) {
logger('Importing channel photo for ' . $uid, LOGGER_DEBUG);
$r = q("select resource_id from photo where uid = %d and photo_usage = 1 and imgscale = 4",
intval($uid)
);
if ($r) {
$hash = $r[0]['resource_id'];
}
else {
$hash = photo_new_resource();
}
$photo_failure = false;
$hash = photo_new_resource();
$filename = $hash;
$img = photo_factory($photo, $type);

View file

@ -298,9 +298,37 @@ function xchan_change_key($oldx,$newx,$data) {
}
function migrate_xchan_photos($limit = 100) {
$r = q("select xchan_photo_l, xchan_hash, photo.xchan, photo.resource_id from photo left join xchan on photo.xchan = xchan_hash where photo.xchan != '' and uid = 0 and imgscale = 4 and photo_usage = 2 and xchan_photo_l like ('%s') limit %d",
dbesc(z_root() . '/photo/%'),
intval($limit)
);
if ($r) {
foreach ($r as $rv) {
logger('migrating xchan_photo for ' . $rv['xchan_hash']);
$photos = import_remote_xchan_photo($rv['xchan_photo_l'], $rv['xchan_hash']);
if ($photos) {
$r = q("update xchan set xchan_photo_l = '%s', xchan_photo_m = '%s', xchan_photo_s = '%s', xchan_photo_mimetype = '%s'
where xchan_hash = '%s'",
dbesc($photos[0]),
dbesc($photos[1]),
dbesc($photos[2]),
dbesc($photos[3]),
dbesc($rv['xchan_hash'])
);
}
}
}
}
function cleanup_xchan_photos() {
$r = q("select photo.xchan, photo.resource_id from photo left join xchan on photo.xchan = xchan_hash where photo.xchan != '' and uid = 0 and imgscale = 4 and photo_usage = 2 and xchan_photo_l like ('%s') limit 200",
$r = q("select photo.xchan, photo.resource_id from photo left join xchan on photo.xchan = xchan_hash where photo.xchan != '' and uid = 0 and imgscale = 4 and photo_usage = 2 and xchan_photo_l like ('%s') limit 500",
dbesc(z_root() . '/xp/%')
);
if ($r) {

File diff suppressed because it is too large Load diff

View file

@ -22,7 +22,7 @@
<dt>{{$channels.0}}</dt>
<dd>{{foreach from=$channels.1 item=ch name=chan}}<span title="{{$ch.label}}">{{$ch.val}} {{$ch.label}}</span>{{if !$smarty.foreach.chan.last}} / {{/if}}{{/foreach}}</dd>
</dl>
{{if $plugins.1}}
{{if $plugins}}
<dl>
<dt>{{$plugins.0}}</dt>
<dd>

View file

@ -11,6 +11,7 @@
<ul class="nav nav-pills flex-column">
{{if $similar}}<li class="nav-item"><a class="nav-link" href="match" >{{$similar}}</a></li>{{/if}}
{{if $loggedin}}<li class="nav-item"><a class="nav-link" href="directory?f=&suggest=1" >{{$suggest}}</a></li>{{/if}}
{{if $sites}}<li class="nav-item"><a class="nav-link" href="sites" >{{$sites}}</a></li>{{/if}}
<li class="nav-item"><a class="nav-link" href="randprof" >{{$random}}</a></li>
{{if $loggedin}}{{if $inv}}<li class="nav-item"><a class="nav-link" href="invite" >{{$inv}}</a></li>{{/if}}{{/if}}
</ul>