mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2025-01-11 07:27:58 +00:00
add multiple identicon drivers support, add icon field settings, make icons display optional
This commit is contained in:
parent
edf9149654
commit
6bffa1c6b9
@ -72,6 +72,12 @@ define('MODERATOR_IP_LIST', (array)
|
|||||||
// User
|
// User
|
||||||
define('USER_DEFAULT_APPROVED', false);
|
define('USER_DEFAULT_APPROVED', false);
|
||||||
|
|
||||||
|
define('USER_AUTO_APPROVE_ON_MAGNET_APPROVE', false);
|
||||||
|
define('USER_AUTO_APPROVE_ON_COMMENT_APPROVE', false);
|
||||||
|
|
||||||
|
define('USER_DEFAULT_IDENTICON', 'jidenticon'); // jidenticon|false
|
||||||
|
define('USER_IDENTICON_FIELD', 'address'); // address|userId|...
|
||||||
|
|
||||||
// Magnet
|
// Magnet
|
||||||
define('MAGNET_DEFAULT_APPROVED', USER_DEFAULT_APPROVED);
|
define('MAGNET_DEFAULT_APPROVED', USER_DEFAULT_APPROVED);
|
||||||
define('MAGNET_DEFAULT_PUBLIC', false);
|
define('MAGNET_DEFAULT_PUBLIC', false);
|
||||||
|
@ -31,7 +31,7 @@ switch (isset($_GET['target']) ? urldecode($_GET['target']) : false)
|
|||||||
|
|
||||||
switch (isset($_GET['toggle']) ? $_GET['toggle'] : false)
|
switch (isset($_GET['toggle']) ? $_GET['toggle'] : false)
|
||||||
{
|
{
|
||||||
case 'identicon':
|
case 'jidenticon':
|
||||||
|
|
||||||
// Yggdrasil connections only
|
// Yggdrasil connections only
|
||||||
if (!preg_match(YGGDRASIL_URL_REGEX, $_SERVER['REMOTE_ADDR']))
|
if (!preg_match(YGGDRASIL_URL_REGEX, $_SERVER['REMOTE_ADDR']))
|
||||||
@ -62,7 +62,7 @@ switch (isset($_GET['target']) ? urldecode($_GET['target']) : false)
|
|||||||
|
|
||||||
$icon = new Jdenticon\Identicon();
|
$icon = new Jdenticon\Identicon();
|
||||||
|
|
||||||
$icon->setValue($user->address);
|
$icon->setValue($user->{USER_IDENTICON_FIELD});
|
||||||
$icon->setSize(empty($_GET['size']) ? 100 : (int) $_GET['size']);
|
$icon->setSize(empty($_GET['size']) ? 100 : (int) $_GET['size']);
|
||||||
$icon->setStyle(
|
$icon->setStyle(
|
||||||
[
|
[
|
||||||
|
@ -418,11 +418,14 @@ echo '<?xml version="1.0" encoding="UTF-8"?>' . PHP_EOL ?>
|
|||||||
<div class="margin-b-16">
|
<div class="margin-b-16">
|
||||||
<?php echo nl2br(htmlentities($magnetComment->value)) ?>
|
<?php echo nl2br(htmlentities($magnetComment->value)) ?>
|
||||||
</div>
|
</div>
|
||||||
<img class="float-left margin-r-4"
|
<?php if (USER_DEFAULT_IDENTICON) { ?>
|
||||||
alt=""
|
<img class="float-left margin-r-4"
|
||||||
src="<?php echo sprintf('%s/action.php?target=profile&toggle=identicon&userId=%s&size=16',
|
alt=""
|
||||||
WEBSITE_URL,
|
src="<?php echo sprintf('%s/action.php?target=profile&toggle=%s&userId=%s&size=16',
|
||||||
$magnetComment->userId) ?>" />
|
WEBSITE_URL,
|
||||||
|
USER_DEFAULT_IDENTICON,
|
||||||
|
$magnetComment->userId) ?>" />
|
||||||
|
<?php } ?>
|
||||||
<sup>
|
<sup>
|
||||||
<?php echo Time::ago((int) $magnetComment->timeAdded) ?>
|
<?php echo Time::ago((int) $magnetComment->timeAdded) ?>
|
||||||
</sup>
|
</sup>
|
||||||
|
Loading…
Reference in New Issue
Block a user