mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Privileges
* add individual pages and corresponding articles * yes the sql-update was forgotten
This commit is contained in:
@@ -44,9 +44,10 @@ class Lang
|
||||
foreach ($lang as $k => $v)
|
||||
self::$$k = $v;
|
||||
|
||||
// *cough* .. reuse-hack
|
||||
// *cough* .. reuse-hacks (because copy-pastaing text for 5 locales sucks)
|
||||
self::$item['cat'][2] = [self::$item['cat'][2], self::$spell['weaponSubClass']];
|
||||
self::$item['cat'][2][1][14] .= ' ('.self::$item['cat'][2][0].')';
|
||||
self::$main['moreTitles']['privilege'] = self::$privileges['_privileges'];
|
||||
}
|
||||
|
||||
public static function __callStatic($prop, $args)
|
||||
|
||||
@@ -152,9 +152,6 @@ $lang = array(
|
||||
'commenting-and-you' => "Wie man Kommentare schreibt", 'modelviewer' => "Modellviewer", 'screenshots-tips-tricks' => "Screenshots: Tipps & Tricks",
|
||||
'stat-weighting' => "Gewichtung von Werten", 'talent-calculator' => "Talentrechner", 'item-comparison' => "Gegenstandsvergleich",
|
||||
'profiler' => "Profiler", 'markup-guide' => "Markup Guide"
|
||||
),
|
||||
'privilege' => array(
|
||||
|
||||
)
|
||||
)
|
||||
),
|
||||
@@ -520,6 +517,7 @@ $lang = array(
|
||||
'privilege' => "Privileg",
|
||||
'privileges' => "Privilegien",
|
||||
'requiredRep' => "Benötigter Ruf",
|
||||
'reqPoints' => "Dieses Privileg benötigt <b>%s</b> Rufpunkte.",
|
||||
'_privileges' => array(
|
||||
null, "Kommentare einsenden", "Webseitenexterne Links einsenden", null,
|
||||
"Kein CAPTCHA", "Kommentarbewertungen zählen mehr", null, null,
|
||||
|
||||
@@ -147,9 +147,6 @@ $lang = array(
|
||||
'commenting-and-you' => "Commenting and You", 'modelviewer' => "Model Viewer", 'screenshots-tips-tricks' => "Screenshots: Tips & Tricks",
|
||||
'stat-weighting' => "Stat Weighting", 'talent-calculator' => "Talent Calculator", 'item-comparison' => "Item Comparison",
|
||||
'profiler' => "Profiler", 'markup-guide' => "Markup Guide"
|
||||
),
|
||||
'privilege' => array(
|
||||
|
||||
)
|
||||
)
|
||||
),
|
||||
@@ -515,6 +512,7 @@ $lang = array(
|
||||
'privilege' => "Privilege",
|
||||
'privileges' => "Privileges",
|
||||
'requiredRep' => "Reputation Required",
|
||||
'reqPoints' => "This privilege requires <b>%s</b> reputation points.",
|
||||
'_privileges' => array(
|
||||
null, "Post comments", "Post external links", null,
|
||||
"No CAPTCHAs", "Comment votes worth more", null, null,
|
||||
|
||||
@@ -152,9 +152,6 @@ $lang = array(
|
||||
'commenting-and-you' => "Los comentarios y tú", 'modelviewer' => "Visualizador de modelos", 'screenshots-tips-tricks' => "Capturas de pantalla: Sugerencias y trucos",
|
||||
'stat-weighting' => "Medición de atributos", 'talent-calculator' => "Calculadora de talentos", 'item-comparison' => "Comparación de objetos",
|
||||
'profiler' => "Perfiles", 'markup-guide' => "Margen de Guia"
|
||||
),
|
||||
'privilege' => array(
|
||||
|
||||
)
|
||||
)
|
||||
),
|
||||
@@ -521,6 +518,7 @@ $lang = array(
|
||||
'privilege' => "Privilegio",
|
||||
'privileges' => "Privilegios",
|
||||
'requiredRep' => "Reputación requerida",
|
||||
'reqPoints' => "Este privilegio necesita <b>%s</b> puntos de reputación.",
|
||||
'_privileges' => array(
|
||||
null, "Escribir comentarios", "Escribir enlaces externos", null,
|
||||
"Sin CAPTCHAs", "Los votos de comentario valen más", null, null,
|
||||
|
||||
@@ -152,9 +152,6 @@ $lang = array(
|
||||
'commenting-and-you' => "Le guide du commentaire", 'modelviewer' => "Visionneuse 3D", 'screenshots-tips-tricks' => "Captures d'écran : Trucs et astuces",
|
||||
'stat-weighting' => "Échelles de valeurs", 'talent-calculator' => "Calculateur de talents", 'item-comparison' => "Comparaison d'objets",
|
||||
'profiler' => "Profiler", 'markup-guide' => "Markup Guide"
|
||||
),
|
||||
'privilege' => array(
|
||||
|
||||
)
|
||||
)
|
||||
),
|
||||
@@ -520,6 +517,7 @@ $lang = array(
|
||||
'privilege' => "Privilège",
|
||||
'privileges' => "Privilèges",
|
||||
'requiredRep' => "Réputation Requise",
|
||||
'reqPoints' => "Ce privilège requiert <b>%s</b> points de réputation.",
|
||||
'_privileges' => array(
|
||||
null, "Poster des commentaires", "Poster des liens externes", null,
|
||||
"Pas de CAPTCHA", "Les votes des commentaires ont plus de valeur",null, null,
|
||||
|
||||
@@ -152,9 +152,6 @@ $lang = array(
|
||||
'commenting-and-you' => "Комментарии и Вы", 'modelviewer' => "3D просмотр", 'screenshots-tips-tricks' => "Скриншоты: Секреты мастерства",
|
||||
'stat-weighting' => "Значимость характеристик", 'talent-calculator' => "Расчёт талантов", 'item-comparison' => "Сравнение предметов",
|
||||
'profiler' => "Профили персонажей", 'markup-guide' => "Markup Guide"
|
||||
),
|
||||
'privilege' => array(
|
||||
|
||||
)
|
||||
)
|
||||
),
|
||||
@@ -520,6 +517,7 @@ $lang = array(
|
||||
'privilege' => "Привилегия",
|
||||
'privileges' => "Привилегии",
|
||||
'requiredRep' => "Необходима репутация",
|
||||
'reqPoints' => "Для этой привилегии требуется <b>%s</b> очков репутации.",
|
||||
'_privileges' => array(
|
||||
null, "Оставлять комментарии", "Оставлять внешние ссылки", null,
|
||||
"Нет CAPTCHA", "Более сильные голоса", null, null,
|
||||
|
||||
125
pages/more.php
125
pages/more.php
@@ -10,13 +10,30 @@ if (!defined('AOWOW_REVISION'))
|
||||
|
||||
class MorePage extends GenericPage
|
||||
{
|
||||
protected $tpl = 'list-page-generic';
|
||||
protected $path = [];
|
||||
protected $tabId = 0;
|
||||
protected $mode = CACHE_TYPE_NONE;
|
||||
protected $js = ['swfobject.js'];
|
||||
protected $tpl = 'list-page-generic';
|
||||
protected $path = [];
|
||||
protected $tabId = 0;
|
||||
protected $mode = CACHE_TYPE_NONE;
|
||||
protected $js = ['swfobject.js'];
|
||||
|
||||
private $validPages = array( // [tabId, path[, subPaths]]
|
||||
private $page = [];
|
||||
private $req2priv = array(
|
||||
1 => CFG_REP_REQ_COMMENT, // write comments
|
||||
2 => 0, // NYI post external links
|
||||
4 => 0, // NYI no captcha
|
||||
5 => CFG_REP_REQ_SUPERVOTE, // votes count for more
|
||||
9 => CFG_REP_REQ_VOTEMORE_BASE, // more votes per day
|
||||
10 => CFG_REP_REQ_UPVOTE, // can upvote
|
||||
11 => CFG_REP_REQ_DOWNVOTE, // can downvote
|
||||
12 => CFG_REP_REQ_REPLY, // can reply
|
||||
13 => 0, // avatar border [NYI: checked by js, avatars not in use]
|
||||
14 => 0, // avatar border [NYI: checked by js, avatars not in use]
|
||||
15 => 0, // avatar border [NYI: checked by js, avatars not in use]
|
||||
16 => 0, // avatar border [NYI: checked by js, avatars not in use]
|
||||
17 => CFG_REP_REQ_PREMIUM // premium status
|
||||
);
|
||||
|
||||
private $validPages = array( // [tabId, path[, subPaths]]
|
||||
'whats-new' => [2, [2, 7]],
|
||||
'searchbox' => [2, [2, 16]],
|
||||
'tooltips' => [2, [2, 10]],
|
||||
@@ -25,7 +42,7 @@ class MorePage extends GenericPage
|
||||
'searchplugins' => [2, [2, 8]],
|
||||
'help' => [2, [2, 13], ['commenting-and-you', 'modelviewer', 'screenshots-tips-tricks', 'stat-weighting', 'talent-calculator', 'item-comparison', 'profiler', 'markup-guide', 'markup-guide-ext']],
|
||||
'reputation' => [1, [3, 10]],
|
||||
'privilege' => [1, [3, 10], [1, 2, 5, 9, 10, 11, 12, 13, 14, 15, 16]],
|
||||
'privilege' => [1, [3, 10], [1, 2, 4, 5, 9, 10, 11, 12, 13, 14, 15, 16, 17]],
|
||||
'privileges' => [1, [3, 10, 0]],
|
||||
);
|
||||
|
||||
@@ -40,20 +57,21 @@ class MorePage extends GenericPage
|
||||
|
||||
$this->tab = $pageData[0];
|
||||
$this->path = $pageData[1];
|
||||
$this->page = [$pageCall, $subPage];
|
||||
|
||||
if ($subPage && isset($pageData[2]))
|
||||
{
|
||||
$subPath = array_search($subPage, $pageData[2]);
|
||||
if (!$subPath)
|
||||
$exists = array_search($subPage, $pageData[2]);
|
||||
if ($exists === false)
|
||||
$this->error();
|
||||
|
||||
if (is_numeric($subPath))
|
||||
$this->path[] = $subPath;
|
||||
if (is_numeric($subPage))
|
||||
$this->articleUrl = $pageCall.'='.$subPage;
|
||||
else
|
||||
$this->path[] = $subPage;
|
||||
$this->articleUrl = $subPage;
|
||||
|
||||
$this->articleUrl = $subPage;
|
||||
$this->name = Lang::main('moreTitles', $pageCall, $subPage);
|
||||
$this->path[] = $subPage;
|
||||
$this->name = Lang::main('moreTitles', $pageCall, $subPage);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -63,20 +81,46 @@ class MorePage extends GenericPage
|
||||
}
|
||||
else
|
||||
$this->error();
|
||||
|
||||
// order by requirement ASC
|
||||
asort($this->req2priv);
|
||||
}
|
||||
|
||||
protected function generateContent()
|
||||
{
|
||||
if ($this->articleUrl == 'reputation')
|
||||
$this->handleReputationPage();
|
||||
else if ($this->articleUrl == 'privileges')
|
||||
$this->handlePrivilegesPage();
|
||||
switch ($this->page[0])
|
||||
{
|
||||
case 'reputation':
|
||||
$this->handleReputationPage();
|
||||
return;
|
||||
case 'privileges':
|
||||
$this->handlePrivilegesPage();
|
||||
return;
|
||||
case 'privilege':
|
||||
$this->tpl = 'privilege';
|
||||
$this->privReqPoints = sprintf(Lang::privileges('reqPoints'), Lang::nf($this->req2priv[$this->page[1]]));
|
||||
return;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
protected function postArticle()
|
||||
{
|
||||
if ($this->articleUrl == 'reputation')
|
||||
$this->handleReputationArticle();
|
||||
if ($this->page[0] != 'reputation' &&
|
||||
$this->page[0] != 'privileges' &&
|
||||
$this->page[0] != 'privilege')
|
||||
return;
|
||||
|
||||
$txt = &$this->article['text'];
|
||||
$consts = get_defined_constants(true);
|
||||
foreach ($consts['user'] as $k => $v)
|
||||
{
|
||||
if (strstr($k, 'CFG_REP_'))
|
||||
$txt = str_replace($k, Lang::nf($v), $txt);
|
||||
else if ($k == 'CFG_USER_MAX_VOTES' || $k == 'CFG_BOARD_URL')
|
||||
$txt = str_replace($k, $v, $txt);
|
||||
}
|
||||
}
|
||||
|
||||
protected function generatePath() { }
|
||||
@@ -106,45 +150,18 @@ class MorePage extends GenericPage
|
||||
}
|
||||
}
|
||||
|
||||
private function handleReputationArticle()
|
||||
{
|
||||
$txt = &$this->article['text'];
|
||||
|
||||
$consts = get_defined_constants(true);
|
||||
foreach ($consts['user'] as $k => $v)
|
||||
if (strstr($k, 'CFG_REP_'))
|
||||
$txt = str_replace($k, Lang::nf($v), $txt);
|
||||
}
|
||||
|
||||
private function handlePrivilegesPage()
|
||||
{
|
||||
$this->tpl = 'privileges';
|
||||
$this->privileges = [];
|
||||
|
||||
$req2priv = array(
|
||||
1 => CFG_REP_REQ_COMMENT, // write comments
|
||||
// 2 => CFG_REP_REQ_XXX, // post external links
|
||||
// 4 => CFG_REP_REQ_XXX, // no captcha
|
||||
5 => CFG_REP_REQ_SUPERVOTE, // votes count for more
|
||||
9 => CFG_REP_REQ_VOTEMORE_BASE, // more votes per day
|
||||
10 => CFG_REP_REQ_UPVOTE, // can upvote
|
||||
11 => CFG_REP_REQ_DOWNVOTE, // can downvote
|
||||
12 => CFG_REP_REQ_REPLY, // can reply
|
||||
// 13 => CFG_REP_REQ_XXX, // avatar border [NYI: checked by js, avatars not in use]
|
||||
// 14 => CFG_REP_REQ_XXX, // avatar border [NYI: checked by js, avatars not in use]
|
||||
// 15 => CFG_REP_REQ_XXX, // avatar border [NYI: checked by js, avatars not in use]
|
||||
// 16 => CFG_REP_REQ_XXX, // avatar border [NYI: checked by js, avatars not in use]
|
||||
17 => CFG_REP_REQ_PREMIUM // premium status
|
||||
);
|
||||
|
||||
asort($req2priv);
|
||||
|
||||
foreach ($req2priv as $id => $val)
|
||||
$this->privileges[$id] = array(
|
||||
User::getReputation() >= $val,
|
||||
Lang::privileges('_privileges', $id),
|
||||
$val
|
||||
);
|
||||
foreach ($this->req2priv as $id => $val)
|
||||
if ($val)
|
||||
$this->privileges[$id] = array(
|
||||
User::getReputation() >= $val,
|
||||
Lang::privileges('_privileges', $id),
|
||||
$val
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
1
setup/updates/1490028370_01.sql
Normal file
1
setup/updates/1490028370_01.sql
Normal file
@@ -0,0 +1 @@
|
||||
UPDATE `aowow_dbversion` SET `sql` = CONCAT(IFNULL(`sql`, ''), ' achievement quests quests_startend source spell');
|
||||
14
setup/updates/1490049258_01.sql
Normal file
14
setup/updates/1490049258_01.sql
Normal file
@@ -0,0 +1,14 @@
|
||||
REPLACE INTO `aowow_articles` (`type`, `typeId`, `locale`, `url`, `editAccess`, `article`, `quickInfo`) VALUES
|
||||
(NULL, NULL, 0, 'privilege=1', 2, '[h3]Reputation required for posting comments?[/h3]\nThe very first privilege you can earn is the ability to post comments. Because this privilege requires only CFG_REP_REQ_COMMENT reputation, it is earned soon upon registering an account (which awards CFG_REP_REWARD_REGISTER reputation)! Keep this in mind if you\'ve recently registered to post on a contest thread.\n\n[h3]How do I post a comment?[/h3]\nOnce you have earned the ability to post comments, it\'s easy to do! Got some interesting information about an item? Strategies for earning an achievement or killing a boss? These are just a few examples of what could make a quality comment here!\n\nSimply visit any database page that you wish to leave a comment on and scroll down to the \'Contribute\' section. In the \'Add your comment\' tab, you can easily write and format your database comment. You can use our handy formatting buttons to improve the visual quality of your post, and easily add database links using the \'Links\' menu and entering database entry IDs. Once you\'re done, simply click the \'Submit\' button below and voila!\n\n[h3]Comment rating and you![/h3]\nAll comments made on database pages are subject to our rating system. This allows users who have reached the appropriate reputation level to upvote and downvote comments based on their quality. Making quality comments will earn you website reputation each time it has been upvoted, but make a poor quality comment and you may end up losing reputation if it is downvoted!\n\nFor more information on commenting, be sure to check out our handy [url=?help=commenting-and-you]Commenting and You[/url] guide in the website help section!', NULL),
|
||||
(NULL, NULL, 0, 'privilege=2', 2, '[h3]Posting External Links[/h3]\nOne of the first privileges allowed to users is the ability to post external links on the site. This will allow you to link to relevant information found on other websites from our database as well as in our forums. You can also add a link to your user profile, such as to your guild website or personal blog. Users without the appropriate reputation level will have their links filtered automatically, to help prevent spammers and malicious links from being posted on our website.\n\n[h3]Posting Policy[/h3]\nPlease be aware that some URLs may still be filtered out by our moderation team, as they made be deemed inappropriate or advertising. If you are uncertain whether or not a link will be considered advertisement, please do not hesitate to contact our Feedback team with any questions!\n', NULL),
|
||||
(NULL, NULL, 0, 'privilege=4', 2, '[h3]No CAPTCHAs[/h3]\nAh, CAPTCHAS. Love \'em or hate \'em, they\'re often a necessary evil for popular websites which allow any sort of user contribution. Here, we use [url=https://www.google.com/recaptcha/intro/index.html]ReCAPTCHA[/url] which helps thwart bots and spammers from abusing our forum and comment systems. Unfortunately, this also creates a minor inconvenience for our more active users, who are still occasionally asked to input a CAPTCHA despite long since establishing themselves as a legitimate member of the community. Well, not anymore! Users who reach the appropriate reputation level will no longer have to enter CAPTCHAs anywhere on the site!\n', NULL),
|
||||
(NULL, NULL, 0, 'privilege=5', 2, '[h3]Comment rating value increase[/h3]\nWhen you have reached a higher reputation level, your contributions to the site will raise in value! As a more trusted member of our community, your comment ratings will now have an increased weight and, as a result, have a greater effect on the total rating of a comment! Your vote contribution are doubled, so each of upvote will count as two votes (and each of your downvotes as two, as well)! This will allow higher reputation users to have more of an effect on considering quality of a comment, raising quality comments higher and lowering poor comments faster.\n', NULL),
|
||||
(NULL, NULL, 0, 'privilege=9', 2, '[h3]More votes per day[/h3]\nWe have a daily cap for comment votes set to CFG_USER_MAX_VOTES.\n\nThis privilege instantly increases the cap by 1, and then increases the cap by an additional 1 point for each CFG_REP_REQ_VOTEMORE_ADD reputation you have above CFG_REP_REQ_VOTEMORE_BASE.\n', NULL),
|
||||
(NULL, NULL, 0, 'privilege=10', 2, '[h3]Upvoting Comments[/h3]\nDid you find a comment particularly insightful or laugh out loud funny? Upvote it then! Upvoting is a way of giving props to those who truly contribute. From small guides to witty jokes, if a comment has enhanced your user experience, you should remember to upvote it.\n\nThe higher amount of upvotes a comment has, the higher up on the page it is. This way the community can help determine what comments are worth reading by sending some upvotes their way.\n\n[h3]Upvoting Policy[/h3]\nYou should not use upvotes to reward your friends or withhold upvotes to punish users you dislike. These are bannable offenses and you will probably lose your ability to upvote if we catch you doing it.\n', NULL),
|
||||
(NULL, NULL, 0, 'privilege=11', 2, '[h3]Downvoting Comments[/h3]\nDid you find a comment that was out of date, irrelevant, or otherwise less than useful? Downvote it then! Downvoting is a way of removing the clutter from the database and ensuring our comments are up to date. Downvotes remove an upvote--and if a comment has too many downvotes, it can even become a negative comment which appear at the end of an article rather than the beginning. \n\n[h3]Downvoting Policy[/h3]\nYou should not use downvotes to punish users you dislike nor should you downvote in quick succession. Try to use downvotes only to help us out, leaving personal bias out of it. If you abuse downvotes either by making too many in a short time frame or targeting a specific user, you may be warned and in some cases banned.\n', NULL),
|
||||
(NULL, NULL, 0, 'privilege=12', 2, '[h3]Replying to a Comment[/h3]\nYou can reply to comments easily and quickly with the new commenting system. All you have to do is leave a reply on an existing comment for this to work.\n\nA reply is best used to illustrate alternatives to a comment, highlight its accuracy, or expand on a joke. For example, if someone says an item drops from a certain boss but you know it does not, you could reply to explain it doesn\'t; it\'s likely people will find your comment helpful so they don\'t waste time trying to get the item from that NPC.\n\nPlease be aware that you should not use comments like forum threads for discussion.\n', NULL),
|
||||
(NULL, NULL, 0, 'privilege=13', 2, 'Your avatar on the [url=CFG_BOARD_URL]Forums[/url] has an uncommon-quality green border.', NULL),
|
||||
(NULL, NULL, 0, 'privilege=14', 2, 'Your avatar on the [url=CFG_BOARD_URL]Forums[/url] has a rare-quality blue border.', NULL),
|
||||
(NULL, NULL, 0, 'privilege=15', 2, 'Your avatar on the [url=CFG_BOARD_URL]Forums[/url] has an epic-quality purple border.', NULL),
|
||||
(NULL, NULL, 0, 'privilege=16', 2, 'Your avatar on the [url=CFG_BOARD_URL]Forums[/url] has a legendary-quality orange border.', NULL),
|
||||
(NULL, NULL, 0, 'privilege=17', 2, '[img src=STATIC_URL/images/premium/user-badge.png border=0 float=right]Unlock [url=HOST_URL/?premium]AoWoW Premium[/url] status for free.\n\nAs a Premium user, you can access a variety of perks:\n[ul]\n[li]Images in tooltips[/li]\n[li]Additional avatar borders[/li]\n[li]And much more![/li][/ul]\n\n', NULL);
|
||||
Reference in New Issue
Block a user