Procházet zdrojové kódy

trying to keep profession background color consistent

development
mauirixxx před 8 roky
rodič
revize
3795c6d3b3
2 změnil soubory, kde provedl 3 přidání a 0 odebrání
  1. +2
    -0
      gw-history.php
  2. +1
    -0
      gw-toon.php

+ 2
- 0
gw-history.php Zobrazit soubor

@@ -12,6 +12,7 @@ include_once 'gw-connect.php';
$con = new mysqli(DATABASE_HOST, DATABASE_USER, DATABASE_PASS, DATABASE_NAME); $con = new mysqli(DATABASE_HOST, DATABASE_USER, DATABASE_PASS, DATABASE_NAME);
//$cnameid = mysqli_real_escape_string($con, $_POST['cnameid']); //need to sanitize & validate this input somehow //$cnameid = mysqli_real_escape_string($con, $_POST['cnameid']); //need to sanitize & validate this input somehow
$cnameid = $_SESSION['playerid']; $cnameid = $_SESSION['playerid'];
$profcolor = $_SESSION['profcolor'];
if ($con->connect_errno > 0){ if ($con->connect_errno > 0){
die ('Unable to connect to database [' . $db->connect_errno . ']'); die ('Unable to connect to database [' . $db->connect_errno . ']');
} }
@@ -20,6 +21,7 @@ if (!$result = $con->query($sql)){
die ('There was an error running the query [' . $con->error . ']'); die ('There was an error running the query [' . $con->error . ']');
} }
if (mysqli_num_rows($result) > 0) { if (mysqli_num_rows($result) > 0) {
echo '<STYLE TYPE="TEXT/CSS" MEDIA="SCREEN">body { background-color: ' . $profcolor . '; }</STYLE>';
while ($row = $result->fetch_array()){ while ($row = $result->fetch_array()){
echo '<TR><TD>On ' . $row['historydate'] . ', "' . $row['charname'] . '" got ' . $row['goldrec'] . 'GP and '; echo '<TR><TD>On ' . $row['historydate'] . ', "' . $row['charname'] . '" got ' . $row['goldrec'] . 'GP and ';
if ($row['itemtype'] == 16) { //this would be a rune if ($row['itemtype'] == 16) { //this would be a rune


+ 1
- 0
gw-toon.php Zobrazit soubor

@@ -41,6 +41,7 @@ if (!$_SESSION['userid']){
while ($row2 = $result2->fetch_array()){ while ($row2 = $result2->fetch_array()){
$charactername = $row2['charname']; $charactername = $row2['charname'];
$profcolor = $row2['profcolor']; $profcolor = $row2['profcolor'];
$_SESSION['profcolor'] == $profcolor;
echo '<TITLE>' . $charactername . '</TITLE><BODY>'; echo '<TITLE>' . $charactername . '</TITLE><BODY>';
echo '<STYLE TYPE="TEXT/CSS" MEDIA="SCREEN">body { background-color: ' . $profcolor . '; }</STYLE>'; echo '<STYLE TYPE="TEXT/CSS" MEDIA="SCREEN">body { background-color: ' . $profcolor . '; }</STYLE>';
} }


Načítá se…
Zrušit
Uložit