* handle backlink in Page instead of Util
 * update event/holiday link
This commit is contained in:
Sarjuuk
2024-02-05 20:57:29 +01:00
parent 6958efcd0f
commit ba53a5c760
7 changed files with 12 additions and 7 deletions

View File

@@ -11,6 +11,10 @@ define('E_AOWOW', E_ALL & ~(E_DEPRECATED | E_USER_DEPRECATED | E
define('JSON_AOWOW_POWER', JSON_PRETTY_PRINT | JSON_NUMERIC_CHECK | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
define('FILTER_FLAG_STRIP_AOWOW', FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_HIGH | FILTER_FLAG_STRIP_BACKTICK);
// as of 01.01.2024 https://www.wowhead.com/wotlk/de/spell=40120/{seo}
// https://www.wowhead.com/wotlk/es/search=vuelo
define('WOWHEAD_LINK', 'https://www.wowhead.com/wotlk/%s/%s=%s');
define('MIME_TYPE_TEXT', 'Content-Type: text/plain; charset=utf-8');
define('MIME_TYPE_XML', 'Content-Type: text/xml; charset=utf-8');
define('MIME_TYPE_JSON', 'Content-Type: application/x-javascript; charset=utf-8');

View File

@@ -270,8 +270,6 @@ if (!CLI)
$_ = explode('=', $str, 2);
$pageCall = $_[0];
$pageParam = $_[1] ?? '';
Util::$wowheadLink = 'https://www.wowhead.com/wotlk/'.(User::$localeId ? Util::$subDomains[User::$localeId].'/' : '').$str;
}
else if (!empty($AoWoWconf['aowow']))
Lang::load(LOCALE_EN);

View File

@@ -468,7 +468,7 @@ abstract class Util
);
public static $subDomains = array(
'www', null, 'fr', 'de', 'cn', null, 'es', null, 'ru'
'en', null, 'fr', 'de', 'cn', null, 'es', null, 'ru'
);
public static $regions = array(
@@ -547,7 +547,6 @@ abstract class Util
);
public static $tcEncoding = '0zMcmVokRsaqbdrfwihuGINALpTjnyxtgevElBCDFHJKOPQSUWXYZ123456789';
public static $wowheadLink = '';
private static $notes = [];
public static function addNote(int $uGroupMask, string $str) : void

View File

@@ -300,7 +300,7 @@ class EventPage extends GenericPage
else
{
if ($this->hId)
Util::$wowheadLink = 'http://'.Util::$subDomains[User::$localeId].'.wowhead.com/event='.$this->hId;
$this->wowheadLink = sprintf(WOWHEAD_LINK, Util::$subDomains[User::$localeId], 'event', $this->hId);
/********************/
/* finalize infobox */

View File

@@ -175,6 +175,8 @@ class GenericPage
protected $mode = CACHE_TYPE_NONE;
// protected $contribute; // defined in __construct()
protected $wowheadLink = 'https://wowhead.com/';
protected $jsGlobals = [];
protected $lvData = [];
protected $title = [CFG_NAME]; // for title-Element
@@ -302,6 +304,8 @@ class GenericPage
$this->gFavorites = User::getFavorites();
$this->pageTemplate['pageName'] = strtolower($pageCall);
$this->wowheadLink = sprintf(WOWHEAD_LINK, Util::$subDomains[User::$localeId], $pageCall, $pageParam);
if (!$this->isValidPage())
$this->error();
}

View File

@@ -2,7 +2,7 @@
// link to wowhead
if (isset($this->redButtons[BUTTON_WOWHEAD])):
if ($this->redButtons[BUTTON_WOWHEAD]):
echo '<a href="'.Util::$wowheadLink.'" rel="np" class="button-red"><em><b><i>Wowhead</i></b><span>Wowhead</span></em></a>';
echo '<a href="'.$this->wowheadLink.'" rel="np" class="button-red"><em><b><i>Wowhead</i></b><span>Wowhead</span></em></a>';
else:
echo '<a href="javascript:;" class="button-red button-red-disabled"><em><b><i>Wowhead</i></b><span>Wowhead</span></em></a>';
endif;

View File

@@ -11,7 +11,7 @@ $this->brick('pageTemplate');
?>
<div class="text">
<a href="<?php echo Util::$wowheadLink; ?>" class="button-red"><em><b><i>Wowhead</i></b><span>Wowhead</span></em></a>
<a href="<?=$this->wowheadLink; ?>" class="button-red"><em><b><i>Wowhead</i></b><span>Wowhead</span></em></a>
<?php
if ($this->lvTabs):
echo ' <h1>'.Lang::main('foundResult').' <i>'.Util::htmlEscape($this->search).'</i>';