Skip to content
Open
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
2 changes: 1 addition & 1 deletion config.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php

include 'title.php';
return [
// https://www.potterapi.com/login/ sitesinden kayıt olun ve $ işareti ile başlayan api anahtarını tek tırnakların içerisine yapıştırın:
'api_key' => '$2a$10$UL7Usqkb3s/o8PPz.ZOxxe3JJtOKObSTkaxqdeONfjp4RhKdMDQuS',
Expand Down
3 changes: 2 additions & 1 deletion footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
All Rights Reserved
</div>
</footer>

<!-- Sweet alert 2 JavaScript -->
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@9"></script>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
Expand Down
2 changes: 1 addition & 1 deletion header.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">

<title><?php echo getTitle() ?></title>
<title><?php echo $title; ?></title>
</head>
<body class="bg-light">
6 changes: 3 additions & 3 deletions houses.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function getTitle()

foreach ($decodedHouses as $decode) {
$house = new House();

try {
$house->setId($decode['_id'])
->setName($decode['name'])
Expand All @@ -26,12 +26,12 @@ function getTitle()
} catch (WrongIdTypeException $typeException) {
die($typeException->getMessage());
}

$house->headOfHouse = $decode['headOfHouse'] ?? null;
$house->mascot = $decode['mascot'] ?? null;
$house->houseGhost = $decode['houseGhost'] ?? null;
$house->school = $decode['school'] ?? null;

$houseDetails[] = $house;
}

Expand Down
7 changes: 2 additions & 5 deletions spells.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

$config = include 'config.php';

function getTitle()
{
return 'Büyüler';
}
$title = pageTitle::getTitle('Büyüler');

$spells = file_get_contents("https://www.potterapi.com/v1/spells?key={$config['api_key']}");

Expand Down Expand Up @@ -37,7 +34,7 @@ function getTitle()

<section class="jumbotron text-center pt-5 mb-5 bg-white">
<div class="container">
<h1 class="jumbotron-heading"><?php echo getTitle(); ?></h1>
<h1 class="jumbotron-heading"><?php echo $title; ?></h1>
</div>
</section>

Expand Down
9 changes: 9 additions & 0 deletions title.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php
class pageTitle{
public static $title;
public static function getTitle($title = "Potterhead ⚡"){
self::$title = $title;
return $title;
}
}
?>