Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 6 additions & 18 deletions SSI.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,34 +33,22 @@
*/
$ssi_on_error_method = false;

/**
* Don't do john didley if the forum's been shut down completely.
*/
/** Don't do john didley if the forum's been shut down completely. */
// $ssi_maintenance_off = false;

/**
* Define a theme for SSI (integer)
*/
/** Define a theme for SSI (integer) */
// $ssi_theme = 0;

/**
* An array of layers to use.
*/
/** An array of layers to use. */
// $ssi_layers = array();

/**
* Gzip output? (because it must be boolean and true, this can't be hacked.)
*/
/** Gzip output? (because it must be boolean and true, this can't be hacked.) */
// $ssi_gzip = false;

/**
* Should we ban from SSI as well?
*/
/** Should we ban from SSI as well? */
// $ssi_ban = false;

/**
* Do we allow guests in here?
*/
/** Do we allow guests in here? */
// $ssi_guest_access = false;

// We are in ElkArte, but from the side-entrance.
Expand Down
7 changes: 6 additions & 1 deletion sources/ElkArte/BBC/ParserWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,13 @@ public static function instance(): ParserWrapper

/**
* ParserWrapper constructor.
*
* `public` allows creating a fresh instance of the parser wrapper when needed, this
* avoids reliance on the singleton for sensitive contexts / where addons need to grab their
* own instance of the parser. BUT 99.9% of the time you should be using the
* singleton ParserWrapper::instance()
*/
private function __construct()
public function __construct()
{

}
Expand Down
21 changes: 17 additions & 4 deletions sources/ElkArte/Controller/Xml.php
Original file line number Diff line number Diff line change
Expand Up @@ -931,14 +931,27 @@ public function action_videoembed(): void
$videoID = 0;
}

// Right now only one site, but a fetch based on site is the idea
// A fetch based on site
if (!empty($videoID) && !empty($site))
{
require_once(SUBSDIR . '/Package.subs.php');
$data = fetch_web_data('https://api.x.com/1.1/statuses/oembed.json?id=' . $videoID);
if ($data !== false)
$url = '';
if ($site === 'twitter')
{
$context['json_data'] = trim($data);
$url = 'https://api.x.com/1.1/statuses/oembed.json?id=' . $videoID;
}
elseif ($site === 'tiktok')
{
$url = 'https://www.tiktok.com/oembed?url=' . $videoID;
}

if (!empty($url))
{
$data = fetch_web_data($url);
if ($data !== false)
{
$context['json_data'] = trim($data);
}
}
}
}
Expand Down
12 changes: 3 additions & 9 deletions sources/ElkArte/Packages/Packages.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,8 @@ public function action_index()
'flush' => [$this, 'action_flush'],
'examine' => [$this, 'action_examine'],
'showoperations' => [$this, 'action_showoperations'],
// The following two belong to PackageServers,
// for UI's sake moved here at least temporarily
'servers' => [
'controller' => PackageServers::class,
'function' => 'action_list'],
'upload' => [
'controller' => PackageServers::class,
'function' => 'action_upload'],
'servers' => ['controller' => PackageServers::class, 'function' => 'action_list'],
'upload' => ['controller' => PackageServers::class, 'function' => 'action_upload'],
];

// Set up action/subaction stuff.
Expand Down Expand Up @@ -1420,7 +1414,7 @@ public function list_packages($start, $items_per_page, $sort, $params)
}
elseif ($checkEmulate)
{
if (($checkEmulate === 0 || $checkEmulate === FORUM_VERSION) && isset($_SESSION['version_emulate']))
if (($checkEmulate === FORUM_VERSION) && isset($_SESSION['version_emulate']))
{
unset($_SESSION['version_emulate']);
}
Expand Down
6 changes: 5 additions & 1 deletion sources/ElkArte/Profile/ProfileOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,11 @@ public function action_themepick(): void
* What it does:
*
* - Uses the Themes template. (pick sub template.)
* - Accessed with ?action=admin;area=themes;sa=pick.
* - Accessed with ?action=admin;area=themes;sa=pick and ?action=profile;area=pick
* - Requires the profile_extra_any permission.
* - Allows the user to pick a theme from a list of those that are available.
* - Saves the theme and variant in the session.
* - Requires JavaScript enabled.
* - Allows previewing of the theme and variants
*/
public function action_pick(): void
Expand Down
76 changes: 41 additions & 35 deletions sources/ElkArte/Themes/Theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -447,25 +447,29 @@ public function autoEmbedVideo(): void
loadJavascriptFile('elk_jquery_embed.js', ['defer' => true]);

$this->addInlineJavascript('
const oEmbedtext = ({
embed_limit : ' . (empty($modSettings['video_embed_limit']) ? 25 : $modSettings['video_embed_limit']) . ',
preview_image : ' . JavaScriptEscape($txt['preview_image']) . ',
ctp_video : ' . JavaScriptEscape($txt['ctp_video']) . ',
hide_video : ' . JavaScriptEscape($txt['hide_video']) . ',
youtube : ' . JavaScriptEscape($txt['youtube']) . ',
vimeo : ' . JavaScriptEscape($txt['vimeo']) . ',
dailymotion : ' . JavaScriptEscape($txt['dailymotion']) . ',
tiktok : ' . JavaScriptEscape($txt['tiktok']) . ',
twitter : ' . JavaScriptEscape($txt['twitter']) . ',
facebook : ' . JavaScriptEscape($txt['facebook']) . ',
instagram : ' . JavaScriptEscape($txt['instagram']) . ',
});
document.addEventListener("DOMContentLoaded", () => {
if ($.isFunction($.fn.linkifyvideo))
{
$().linkifyvideo(oEmbedtext);
}
});', true);
if (typeof oEmbedtext === "undefined") {
var oEmbedtext = ({
embed_limit : ' . (empty($modSettings['video_embed_limit']) ? 25 : $modSettings['video_embed_limit']) . ',
preview_image : ' . JavaScriptEscape($txt['preview_image']) . ',
ctp_video : ' . JavaScriptEscape($txt['ctp_video']) . ',
hide_video : ' . JavaScriptEscape($txt['hide_video']) . ',
youtube : ' . JavaScriptEscape($txt['youtube']) . ',
vimeo : ' . JavaScriptEscape($txt['vimeo']) . ',
dailymotion : ' . JavaScriptEscape($txt['dailymotion']) . ',
tiktok : ' . JavaScriptEscape($txt['tiktok']) . ',
twitter : ' . JavaScriptEscape($txt['twitter']) . ',
facebook : ' . JavaScriptEscape($txt['facebook']) . ',
instagram : ' . JavaScriptEscape($txt['instagram']) . ',
});

document.addEventListener("DOMContentLoaded", () => {
if ($.isFunction($.fn.linkifyvideo))
{
$().linkifyvideo(oEmbedtext);
}
});
}
', true);
}
}

Expand Down Expand Up @@ -602,22 +606,24 @@ public function relativeTimes(): void
{
loadJavascriptFile('elk_relativeTime.js', ['defer' => true]);
$this->addInlineJavascript('
const oRttime = ({
referenceTime : ' . forum_time() * 1000 . ',
now : ' . JavaScriptEscape($txt['rt_now']) . ',
minute : ' . JavaScriptEscape($txt['rt_minute']) . ',
minutes : ' . JavaScriptEscape($txt['rt_minutes']) . ',
hour : ' . JavaScriptEscape($txt['rt_hour']) . ',
hours : ' . JavaScriptEscape($txt['rt_hours']) . ',
day : ' . JavaScriptEscape($txt['rt_day']) . ',
days : ' . JavaScriptEscape($txt['rt_days']) . ',
week : ' . JavaScriptEscape($txt['rt_week']) . ',
weeks : ' . JavaScriptEscape($txt['rt_weeks']) . ',
month : ' . JavaScriptEscape($txt['rt_month']) . ',
months : ' . JavaScriptEscape($txt['rt_months']) . ',
year : ' . JavaScriptEscape($txt['rt_year']) . ',
years : ' . JavaScriptEscape($txt['rt_years']) . ',
});
if (typeof oRttime === "undefined") {
var oRttime = ({
referenceTime : ' . forum_time() * 1000 . ',
now : ' . JavaScriptEscape($txt['rt_now']) . ',
minute : ' . JavaScriptEscape($txt['rt_minute']) . ',
minutes : ' . JavaScriptEscape($txt['rt_minutes']) . ',
hour : ' . JavaScriptEscape($txt['rt_hour']) . ',
hours : ' . JavaScriptEscape($txt['rt_hours']) . ',
day : ' . JavaScriptEscape($txt['rt_day']) . ',
days : ' . JavaScriptEscape($txt['rt_days']) . ',
week : ' . JavaScriptEscape($txt['rt_week']) . ',
weeks : ' . JavaScriptEscape($txt['rt_weeks']) . ',
month : ' . JavaScriptEscape($txt['rt_month']) . ',
months : ' . JavaScriptEscape($txt['rt_months']) . ',
year : ' . JavaScriptEscape($txt['rt_year']) . ',
years : ' . JavaScriptEscape($txt['rt_years']) . ',
});
}
document.addEventListener("DOMContentLoaded", () => {updateRelativeTime();});', true);

$context['using_relative_time'] = true;
Expand Down
2 changes: 2 additions & 0 deletions sources/subs/Themes.subs.php
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ function ($row) use (&$variant_preferences) {
// Needed to trick ThemeLoader, so we can get variant names
HttpReq::instance()->post->th = true;

$old_theme_instance = $context['theme_instance'] ?? null;
foreach ($available_themes as $id_theme => $theme_data)
{
// Don't try to load the forum or board default theme's data... it doesn't have any!
Expand Down Expand Up @@ -511,6 +512,7 @@ function ($row) use (&$variant_preferences) {
}

// Then return it.
$context['theme_instance'] = $old_theme_instance;
new ThemeLoader($current_theme, true);

return [$available_themes, $guest_theme];
Expand Down
6 changes: 1 addition & 5 deletions themes/default/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -1780,7 +1780,7 @@ a.bbc_link {
outline: none;
}

.breadcumb .crumb a {
.breadcrumb .crumb > a {
display: block;
overflow: hidden;
}
Expand Down Expand Up @@ -1812,10 +1812,6 @@ a.bbc_link {
padding: 0;
}

.breadcrumb > .crumb > a {
padding: 0.8rem 0;
}

/* No arrow after the last link */
.breadcrumb .crumb:last-child::after {
content: none;
Expand Down
Loading
Loading