Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <HTML>
- <HEAD>
- <META charset="UTF-8">
- </HEAD>
- <BODY>
- <PRE>
- <?php
- // Connect to the database
- $link = mysqli_connect('localhost', 'username', 'password', 'database');
- if (!$link)
- die("Brak połączenia z bazą danych");
- mysqli_set_charset($link, 'utf8');
- // Get number of records
- $query = "
- SELECT
- COUNT(*) as number
- FROM
- StajniaCustom
- WHERE
- ID NOT IN (SELECT ID FROM StajniaRemoved)
- ";
- $result = mysqli_query($link, $query);
- if (!$result)
- {
- echo mysql_errno($link);
- mysqli_close($link);
- exit;
- };
- $row = mysqli_fetch_assoc($result);
- $numberOfMaps = $row["number"];
- mysqli_free_result($result);
- echo <<<koniec
- Dodatkowych map jest $numberOfMaps i łatwo się pogubić. Celem tej listy jest szybkie przypomnienie co jest czym żeby móc głosować świadomie.
- [url=http://imgur.com/a/kI28J/layout/horizontal]Alternatywnie album imgur[/url] [size=2](forum ma ograniczenie do 100 obrazków)[/size]
- koniec;
- // Set variables
- $imgShown = 0; // how many thumbnails were printed out
- $imgNumber = 0; // total number of images pulled from db
- $imgLimit = 2; // thumbnail limit per map
- $TitleColors = array // colors for given map types
- (
- "koth" => "1ad399",
- "dom" => "ff8c00",
- "ctf" => "dda0dd",
- "cp" => "ff8c00",
- "pl" => "008000"
- );
- $lastName = "";
- $imgCurrent = 0;
- // Query table
- $query = "
- SELECT
- StajniaCustom.Name,
- StajniaCustom.Description,
- StajniaLinks.Link,
- StajniaLinks.Include
- FROM
- StajniaCustom LEFT JOIN StajniaLinks
- ON
- StajniaCustom.ID = StajniaLinks.ID
- WHERE
- StajniaCustom.ID NOT IN (SELECT ID FROM StajniaRemoved)
- ORDER BY
- StajniaCustom.Sort ASC
- ";
- $result = mysqli_query($link, $query);
- if (!$result)
- {
- echo mysql_errno($link);
- mysqli_close($link);
- exit;
- };
- // Process data
- while($row = mysqli_fetch_assoc($result))
- {
- // Output map title and description
- if ($row["Name"] != $lastName)
- {
- $lastName = $row["Name"];
- $imgCurrent = 0;
- $ColorCurrent = $TitleColors[ substr($row["Name"],0,strpos($row["Name"], "_")) ];
- // Unknown map type
- if ($ColorCurrent == NULL)
- $ColorCurrent = "FFFFFF";
- echo "\n\n[size=6][b][color=#$ColorCurrent]{$row["Name"]}";
- echo "[/color][/b][/size]";
- if ($row["Description"] != "")
- {
- echo "[size=2] - {$row["Description"]}";
- echo "[/size]";
- };
- echo "\n\n";
- };
- // Output thumbnail
- if ($row["Link"])
- {
- if ($row["Include"] && $imgCurrent<$imgLimit)
- {
- echo "[url=http://i.imgur.com/{$row["Link"]}.jpg][img=http://i.imgur.com/{$row["Link"]}b.jpg][/url] ";
- $imgShown++;
- $imgCurrent++;
- };
- $imgNumber++;
- }
- else
- echo "Jeszcze w nią nie grałem";
- };
- //echo "\n\nTotal number of images: $imgNumber\nImages displayed:$imgShown\n\n";
- mysqli_free_result($result);
- mysqli_close($link);
- ?>
- [size=6][b]Moja ocena[/b][/size] [size=2](może ulec zmianie ponieważ w niektóre mapy za mało grałem)[/size]
- [b]Chętnie zagram:[/b]
- [indent=1]croissant, stoneyridge, gydan, biodome, collis, mojave, follower, metalworks, antiquity
- angkor, great heights, swiftwater, millstone, boundary, quagmire, manngrove, 5curve
- converge, vector, garbage day[/indent]
- [b]Raczej nie:[/b]
- [indent=1]mudwater - labirynt
- auriferous - długa, ciasna i pokręcona
- syphon - zbyt dużo otwartej przestrzeni
- cloudburst - trochę pusta
- coalplant - trochę pusto w środku[/indent]
- Reszta "może być".
- [url=http://goo.gl/forms/yv26e6mJ2S]Ankieta[/url]
- </PRE>
- </BODY>
- </HTML>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement