Skip to content

Commit

Permalink
Merge pull request #696 from PennyDreadfulMTG/more
Browse files Browse the repository at this point in the history
Avoid broken images for series with no logo uploaded
  • Loading branch information
bakert authored Aug 29, 2024
2 parents 711a43f + d64d393 commit 23a1da9
Show file tree
Hide file tree
Showing 72 changed files with 1,386 additions and 1,691 deletions.
4 changes: 4 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ Setup:

Tests:
$ vendor/bin/phpunit -v tests/

Lint:
$ vendor/bin/phpcs --standard=PSR12 --runtime-set testVersion 8.1 --ignore=vendor .
$ vendor/bin/phpcbf --standard=PSR12 --runtime-set testVersion 8.1 --ignore=vendor . # autofix
5 changes: 3 additions & 2 deletions gatherling/action.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
function update_cta() {
function update_cta()
{

$.get("action.php", function(data) {
$.get("action.php", function (data) {
$("#action").html(data)
});
}
Expand Down
1 change: 0 additions & 1 deletion gatherling/action.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use Gatherling\Series;

require_once 'lib.php';
session_start();
$player = Player::getSessionPlayer();
if (!is_null($player)) {
$message = null;
Expand Down
2 changes: 0 additions & 2 deletions gatherling/admin/clean_decks.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

require '../lib.php';

session_start();

$some_admin = Player::getSessionPlayer();
if (!is_null($some_admin)) {
if (!$some_admin->isSuper()) {
Expand Down
2 changes: 0 additions & 2 deletions gatherling/admin/removeDecks.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

require 'lib.php';

session_start();

$some_admin = Player::getSessionPlayer();
if (!$some_admin->isSuper()) {
header('Location: gatherling.php');
Expand Down
1 change: 0 additions & 1 deletion gatherling/admin/update-decks.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

// Need to be logged in as admin before you can even try this.

session_start();
$some_admin = Player::getSessionPlayer();

if (!$some_admin->isSuper()) {
Expand Down
1 change: 0 additions & 1 deletion gatherling/admin/updateDecks.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php

session_start();
require_once '../lib.php';

$some_admin = Player::getSessionPlayer();
Expand Down
3 changes: 1 addition & 2 deletions gatherling/admincp.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

include 'lib.php';
include 'lib_form_helper.php';
session_start();

$hasError = false;
$errormsg = '';
Expand Down Expand Up @@ -254,7 +253,7 @@ function handleActions()
if ($series->authCheck(Player::loginName())) {
$series->name = $newseries;
$series->active = $newactive;
$series->start_time = $newtime.':00';
$series->start_time = $newtime . ':00';
$series->start_day = $newday;
$series->prereg_default = $prereg;
$series->save();
Expand Down
12 changes: 6 additions & 6 deletions gatherling/analyticstracking.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
var _gaq = _gaq || [];
<?php
include_once 'lib.php';
global $CONFIG;
$account = '';
if (array_key_exists('analytics_account', $CONFIG)) {
$account = $CONFIG['analytics_account'];
}
echo "_gaq.push(['_setAccount', '$account']);";
global $CONFIG;
$account = '';
if (array_key_exists('analytics_account', $CONFIG)) {
$account = $CONFIG['analytics_account'];
}
echo "_gaq.push(['_setAccount', '$account']);";
?>

_gaq.push(['_trackPageview']);
Expand Down
1 change: 0 additions & 1 deletion gatherling/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

require_once 'lib.php';
require_once 'api_lib.php';
session_start();

$action = '';
if (isset($_REQUEST['action'])) {
Expand Down
137 changes: 68 additions & 69 deletions gatherling/archetype.php
Original file line number Diff line number Diff line change
@@ -1,135 +1,134 @@
<?php
include 'lib.php';
include 'config.php';
session_start();
print_header('Archetype Descriptions');
// TODO: This file is called from function deckForm and function deckRegisterForm of deck.php. Need to add $_POST
// passing of to and from this file of (name, archetype, maindeck, sideboard, and comments fields) so that players
// do not loose their progress during deck entry.
//
// Also need to populate this page with data from the archetypes table in the database. Name would be the heading
// and description field would go between the <p>
?>
include 'lib.php';
include 'config.php';
print_header('Archetype Descriptions');
// TODO: This file is called from function deckForm and function deckRegisterForm of deck.php. Need to add $_POST
// passing of to and from this file of (name, archetype, maindeck, sideboard, and comments fields) so that players
// do not loose their progress during deck entry.
//
// Also need to populate this page with data from the archetypes table in the database. Name would be the heading
// and description field would go between the <p>
?>

<div class="grid_10 suffix_1 prefix_1">

<div class ="gatherling_news box">
<center><h3>Aggro</h3></center>
<p>
Aggro (short for "aggressive") decks attempt to reduce their opponents from 20 life to 0 life
as quickly as possible, rather than emphasize a long-term game plan. Aggro decks focus on
converting their cards into damage; they prefer to engage in a tempo-based race rather than a
card advantage-based attrition war. Aggro generally relies upon creatures as a cumulative source
of damage. While strategically simple, aggro decks can quickly overwhelm unprepared opponents
and proceed to eke out the last bit of damage they need to end the game. Aggro decks also generally
Aggro (short for "aggressive") decks attempt to reduce their opponents from 20 life to 0 life
as quickly as possible, rather than emphasize a long-term game plan. Aggro decks focus on
converting their cards into damage; they prefer to engage in a tempo-based race rather than a
card advantage-based attrition war. Aggro generally relies upon creatures as a cumulative source
of damage. While strategically simple, aggro decks can quickly overwhelm unprepared opponents
and proceed to eke out the last bit of damage they need to end the game. Aggro decks also generally
have access to disruptive elements, which can inhibit the opponent's attempts to respond.
</p>
</div>
</p>
</div>

<div class ="gatherling_news box">
<center><h3>Combo</h3></center>
<p>
Combo decks utilize the interaction of two or more cards (a "combination") to create a powerful effect
that either wins the game immediately or creates a situation that subsequently leads to a win. The term
"combo" can also describe a deck built around resolving a single powerful spell such as Tooth and Nail
to create the same kind of insurmountable advantage. Combo decks value power, consistency, and speed:
the combo should be strong enough to win, the deck should be reliable enough to produce the combo on a
Combo decks utilize the interaction of two or more cards (a "combination") to create a powerful effect
that either wins the game immediately or creates a situation that subsequently leads to a win. The term
"combo" can also describe a deck built around resolving a single powerful spell such as Tooth and Nail
to create the same kind of insurmountable advantage. Combo decks value power, consistency, and speed:
the combo should be strong enough to win, the deck should be reliable enough to produce the combo on a
regular basis, and the deck should be able to use the combo fast enough to win before the opponent.
</p>
</div>

<div class="gatherling_news box">
<center><h3>Control</h3></center>
<p>
Control decks avoid racing and attempt to slow the game down by executing an attrition plan. These decks
attempt to accumulate resource advantage, contain threats, and run opponents out of options. The primary
Control decks avoid racing and attempt to slow the game down by executing an attrition plan. These decks
attempt to accumulate resource advantage, contain threats, and run opponents out of options. The primary
strength of control decks is their ability to devalue the opponent’s cards. They do this in four ways:
</p>
<ol>
<li>
Erasing threats at a reduced cost. Given the opportunity, Control decks can gain card advantage by
answering multiple threats with one spell, stopping expensive threats with cheaper spells, and
Erasing threats at a reduced cost. Given the opportunity, Control decks can gain card advantage by
answering multiple threats with one spell, stopping expensive threats with cheaper spells, and
drawing multiple cards or forcing the opponent to discard multiple cards with one spell.
</li>
<li>
Not playing threats to be answered. By playing few proactive spells of their own, control decks gain
Not playing threats to be answered. By playing few proactive spells of their own, control decks gain
virtual card advantage by reducing the usefulness of opposing removal cards.
</li>
<li>
Disrupting synergies. Even if control decks do not deal with every threat directly, they can leave
out whichever ones stand poorly on their own; e.g., a creature enchantment which will never need
Disrupting synergies. Even if control decks do not deal with every threat directly, they can leave
out whichever ones stand poorly on their own; e.g., a creature enchantment which will never need
attention if all enemy creatures are quickly removed.
</li>
<li>
Dragging the game out past opposing preparations. An opponent's faster, efficient cards will become
Dragging the game out past opposing preparations. An opponent's faster, efficient cards will become
less effective over time.
</li>
</ol>
<p>
Often control decks end the game with the very same threats midrange or ramp decks use (see below). The
difference is that they're not focused on getting those threats out as soon as they possibly can.
Instead, they use them to mop up a game they've already secured and stabilized. Alternatively, the large
threat itself can be used as a tool to stabilize, either by virtue of its size or its ability to remove
Often control decks end the game with the very same threats midrange or ramp decks use (see below). The
difference is that they're not focused on getting those threats out as soon as they possibly can.
Instead, they use them to mop up a game they've already secured and stabilized. Alternatively, the large
threat itself can be used as a tool to stabilize, either by virtue of its size or its ability to remove
threats.
</p>
</div>

<div class ="gatherling_news box">
<center><h3>Aggro-combo</h3></center>
<p>
Aggro-combo is a hybrid archetype that employs aggressive creature strategies along with some combination
of cards that can win in "combo" fashion with one big turn. For instance, Ravager Affinity decks that
include Disciple of the Vault can win by attacking with creatures and also with a combo finish of
Aggro-combo is a hybrid archetype that employs aggressive creature strategies along with some combination
of cards that can win in "combo" fashion with one big turn. For instance, Ravager Affinity decks that
include Disciple of the Vault can win by attacking with creatures and also with a combo finish of
sacrificing multiple artifacts to Arcbound Ravager and killing the opponent with Disciple triggers.
</p>
</div>
</div>

<div class ="gatherling_news box">
<center><h3>Aggro-control</h3></center>
<p>
Aggro-control is a hybrid archetype that contains both aggressive creatures and control elements.
These decks attempt to deploy quick threats while protecting them with light permission and disruption
long enough to win. These are frequently referred to as "tempo" strategies, as their control elements
are often more temporary; for instance, they may return opposing creatures to their owners' hands
Aggro-control is a hybrid archetype that contains both aggressive creatures and control elements.
These decks attempt to deploy quick threats while protecting them with light permission and disruption
long enough to win. These are frequently referred to as "tempo" strategies, as their control elements
are often more temporary; for instance, they may return opposing creatures to their owners' hands
rather than remove them entirely.
</p>
</div>
</div>

<div class ="gatherling_news box">
<center><h3>Combo-control</h3></center>
<p>
Control-Combo is a control deck with a combo finisher that it can spring quickly if need be. A notable
subtype of Control-Combo is "prison," which institutes control through resource denial (usually via a
Control-Combo is a control deck with a combo finisher that it can spring quickly if need be. A notable
subtype of Control-Combo is "prison," which institutes control through resource denial (usually via a
combo).
</p>
</div>
</div>

<div class ="gatherling_news box">
<center><h3>Midrange</h3></center>
<p>
Midrange tends to feature one-drops with abilities (e.g., Llanowar Elf) and early threats that are more
defined by their resilience than their raw size, speed, and power. These decks tend to be a turn slower
than the aggro decks, although still reasonably fast, and oftentimes use Planeswalkers to generate
advantage on the battlefield. They will sometimes use a few reactive cards to deal with key threats, but
tend to be at a disadvantage if they draw too many of this type of card and are unable to develop their
board. Some midrange decks trend toward the aggressive end of the spectrum, and others toward control.
What they hold in common is their focus on accumulating advantage on the battlefield itself, as opposed
to gaining an advantage in raw resources (having a 4/4 versus a 2/1, as opposed to having two cards in
Midrange tends to feature one-drops with abilities (e.g., Llanowar Elf) and early threats that are more
defined by their resilience than their raw size, speed, and power. These decks tend to be a turn slower
than the aggro decks, although still reasonably fast, and oftentimes use Planeswalkers to generate
advantage on the battlefield. They will sometimes use a few reactive cards to deal with key threats, but
tend to be at a disadvantage if they draw too many of this type of card and are unable to develop their
board. Some midrange decks trend toward the aggressive end of the spectrum, and others toward control.
What they hold in common is their focus on accumulating advantage on the battlefield itself, as opposed
to gaining an advantage in raw resources (having a 4/4 versus a 2/1, as opposed to having two cards in
hand versus a single card, for example).
</p>
</div>
</div>

<div class ="gatherling_news box">
<center><h3>Ramp</h3></center>
<p>
Ramp decks tend to spend their early turns developing their mana advantage instead of deploying threats
to the board in an attempt to play larger more powerful mana-advantage spells (often spells that have an
X in the casting cost). In order to be successful the card that provides the win condition needs to have
a greater return than several smaller spells that can be played faster. Ramp decks rely upon one or two
Ramp decks tend to spend their early turns developing their mana advantage instead of deploying threats
to the board in an attempt to play larger more powerful mana-advantage spells (often spells that have an
X in the casting cost). In order to be successful the card that provides the win condition needs to have
a greater return than several smaller spells that can be played faster. Ramp decks rely upon one or two
threats to do a lot of work for them.
</p>
</div>
</div>

</div>

<?php print_footer(); ?>
<?php print_footer(); ?>
11 changes: 4 additions & 7 deletions gatherling/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
use Gatherling\Player;
use Wohali\OAuth2\Client\Provider\Exception\DiscordIdentityProviderException;

require_once __DIR__.'/lib.php';
require __DIR__.'/authlib.php';

session_start();
require_once __DIR__ . '/lib.php';
require __DIR__ . '/authlib.php';

global $CONFIG;
global $provider;
Expand Down Expand Up @@ -64,7 +62,6 @@
unset($_SESSION['oauth2state']);
exit('Failed CSRF check. Please try again, or disable any browser extensions that might be causing issues.');
} else {

// Step 2. Get an access token using the provided authorization code
$token = $provider->getAccessToken('authorization_code', [
'code' => $_GET['code'],
Expand All @@ -84,7 +81,7 @@ function send_to_discord($scope = null)
$options = ['scope' => $scope];
$authUrl = $provider->getAuthorizationUrl($options);
$_SESSION['oauth2state'] = $provider->getState();
header('Location: '.$authUrl);
header('Location: ' . $authUrl);
}

/**
Expand Down Expand Up @@ -180,6 +177,6 @@ function prompt_link_account($user)
</div> <!-- gatherling_main -->
</div> <!-- grid 10 pre 1 suff 1 -->

<?php
<?php
print_footer();
}
2 changes: 0 additions & 2 deletions gatherling/authdebug.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<?php

session_start();

require_once __DIR__.'/lib.php';
require __DIR__.'/authlib.php';

Expand Down
1 change: 0 additions & 1 deletion gatherling/bannedplayer.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
use Gatherling\Player;

require_once 'lib.php';
session_start();
$player = Player::getSessionPlayer();

print_header('You have been banned');
Expand Down
Loading

0 comments on commit 23a1da9

Please sign in to comment.