function getreading() { # The reading is fetched periodically, and stashed in # today_reading.php include 'today_reading.php'; $reading = reading(); return $reading; }
$sql_last = mysqli_query($bd, "SELECT * FROM `BOOKS` ORDER BY `Id` DESC LIMIT 25"); if (mysqli_num_rows($sql_last) > 0) { $last = mysqli_fetch_array($sql_last); do { echo '<article class="box post post-excerpt"> <header> <h2><a href="' . $home_url . 'books/' . $last['URL'] . '">' . $last['Title'] . '</a></h2> </header> <div class="info"> <span class="date"><span class="day">' . $last['Yaer'] . '</span></span> <ul class="stats"> <li><a href="#" class="icon fa-book ">' . reading($last['Id']) . '</a></li> <li><a href="#" class="icon fa-check">' . done($last['Id']) . '</a></li> <li><a href="#" class="icon fa-comment">' . comment($last['Id']) . '</a></li> <li>' . author($last['AUTHOR_ID']) . '</li> </ul> </div> <table style="width:100%"> <tr> <td style="max-width:30%;vertical-align: top;"><a href="' . $home_url . 'books/' . $last['URL'] . '" class="image featured"><img src="' . $home_url . 'images/books/' . $last['Image'] . '" alt="" /></a></td> <td style="padding-left:1em">' . $last['Description'] . '</td> </tr> </table> </article>
$systemversion = mysql_real_escape_string(reading($reader, "systemversion")); } else { if ($reader->name == "userid" && $reader->nodeType == XMLReader::ELEMENT) { $userid = mysql_real_escape_string(reading($reader, "userid")); } else { if ($reader->name == "contact" && $reader->nodeType == XMLReader::ELEMENT) { $contact = mysql_real_escape_string(reading($reader, "contact")); } else { if ($reader->name == "description" && $reader->nodeType == XMLReader::ELEMENT) { $description = mysql_real_escape_string(reading($reader, "description")); } else { if ($reader->name == "log" && $reader->nodeType == XMLReader::ELEMENT) { $logdata = reading($reader, "log"); } else { if ($reader->name == "platform" && $reader->nodeType == XMLReader::ELEMENT) { $platform = reading($reader, "platform"); } } } } } } } } } } } $reader->close(); // don't proceed if we don't have anything to search for if ($bundleidentifier == "") { die("No valid data entered!");
} elseif ($reader->name == 'applicationname' && $reader->nodeType == XMLReader::ELEMENT) { $crashes[$crashIndex]['applicationname'] = mysql_real_escape_string(reading($reader, 'applicationname')); } elseif ($reader->name == 'systemversion' && $reader->nodeType == XMLReader::ELEMENT) { $crashes[$crashIndex]['systemversion'] = mysql_real_escape_string(reading($reader, 'systemversion')); } elseif ($reader->name == 'userid' && $reader->nodeType == XMLReader::ELEMENT) { $crashes[$crashIndex]['userid'] = mysql_real_escape_string(reading($reader, 'userid')); } elseif ($reader->name == 'username' && $reader->nodeType == XMLReader::ELEMENT) { $crashes[$crashIndex]['username'] = mysql_real_escape_string(reading($reader, 'username')); } elseif ($reader->name == 'contact' && $reader->nodeType == XMLReader::ELEMENT) { $crashes[$crashIndex]['contact'] = mysql_real_escape_string(reading($reader, 'contact')); } elseif ($reader->name == 'description' && $reader->nodeType == XMLReader::ELEMENT) { $crashes[$crashIndex]['description'] = mysql_real_escape_string(reading($reader, 'description')); } elseif ($reader->name == 'log' && $reader->nodeType == XMLReader::ELEMENT) { $crashes[$crashIndex]['logdata'] = reading($reader, 'log'); } elseif ($reader->name == 'platform' && $reader->nodeType == XMLReader::ELEMENT) { $crashes[$crashIndex]['platform'] = mysql_real_escape_string(reading($reader, 'platform')); } } $reader->close(); $lastError = 0; // store the best version status to return feedback $best_status = VERSION_STATUS_UNKNOWN; // go through all crah reports foreach ($crashes as $crash) { // don't proceed if we don't have anything to search for if ($crashIndex < 0 || $crash['bundleidentifier'] == '') { die('No valid data entered!'); } // by default set the appname to bundleidentifier, so it has some meaningful value for sure $crash['appname'] = $crash['bundleidentifier']; // store the status of the fix version for this crash
$applicationname = mysql_real_escape_string(reading($reader, "applicationname")); } else { if ($reader->name == "systemversion" && $reader->nodeType == XMLReader::ELEMENT) { $systemversion = mysql_real_escape_string(reading($reader, "systemversion")); } else { if ($reader->name == "userid" && $reader->nodeType == XMLReader::ELEMENT) { $userid = mysql_real_escape_string(reading($reader, "userid")); } else { if ($reader->name == "contact" && $reader->nodeType == XMLReader::ELEMENT) { $contact = mysql_real_escape_string(reading($reader, "contact")); } else { if ($reader->name == "description" && $reader->nodeType == XMLReader::ELEMENT) { $description = mysql_real_escape_string(reading($reader, "description")); } else { if ($reader->name == "log" && $reader->nodeType == XMLReader::ELEMENT) { $logdata = reading($reader, "log"); } } } } } } } } } } $reader->close(); // don't proceed if we don't have anything to search for if ($bundleidentifier == "") { die("No valid data entered!"); }
} } else { if ($reader->name == "version" && $reader->nodeType == XMLReader::ELEMENT) { $version = reading($reader, "version"); } else { if ($reader->name == "startmemory" && $reader->nodeType == XMLReader::ELEMENT) { $startmemory = reading($reader, "startmemory"); } else { if ($reader->name == "endmemory" && $reader->nodeType == XMLReader::ELEMENT) { $endmemory = reading($reader, "endmemory"); } else { if ($reader->name == "contact" && $reader->nodeType == XMLReader::ELEMENT) { $contact = reading($reader, "contact"); } else { if ($reader->name == "log" && $reader->nodeType == XMLReader::ELEMENT) { $log = reading($reader, "log"); // last element, now add it to the database if ($log != "" && $version != "") { // check if the crash is because of a memory problem, then go back right away $pos = strpos($log, "Memory Warning!"); if ($pos !== false) { $bugstatus = 0; } else { // get all the known bug patterns for the current app version $query = "SELECT id, pattern, fix, affected FROM " . $dbanalyzetable . " WHERE affected like '%" . mysql_real_escape_string($crashappversion) . "%'"; $result = mysql_query($query) or die("<?xml version=\"1.0\" encoding=\"UTF-8\"?><result>0</result>"); $match = false; $matchid = ""; // search the log file for each pattern while ($row = mysql_fetch_row($result)) { $pos = strpos($log, $row[1]);
<?php echo '<style>@media screen and (min-width: 1024px) { #content {margin-left:14em;} }</style>'; echo "<article class='box post post-excerpt'>\n\t\t\t\t\t\t\t<header><h2>{$result['Title']}</h2>\n\t\t\t\t\t\t\t" . '<a href="#" class="icon fa-book" style="margin-right:1.5em;color:#666"> ' . reading($result['Id']) . '</a> <a href="#" class="icon fa-check" style="margin-right:1.5em;color:#666"> ' . done($result['Id']) . '</a> <a href="#" class="icon fa-comment" style="margin-right:1.5em;color:#666"> ' . comment($result['Id']) . '</a> ' . author($result['AUTHOR_ID']) . ' ' . cat($result['CATEGORY_ID']) . ' ' . "</header>"; echo '<table style="width:100%"> <tr> <td style="max-width:30%;vertical-align: top;"><a href="' . $home_url . 'books/' . $result['URL'] . '" class="image featured"><img src="' . $home_url . 'images/books/' . $result['Image'] . '" alt="" /></a></td> <td style="padding-left:1em">' . htmlspecialchars_decode($result['Description']) . '</td> </tr> </table>'; if (!empty($_SESSION["user"])) { if (read($result["Id"], $_SESSION["user"]) == 'N') { echo '<p align="center"><a href="' . $home_url . 'online/' . $result["URL"] . '"><button type="button" class="btn btn-success">ЧИТАТЬ ОНЛАЙН</button></a></p>'; } if (read($result["Id"], $_SESSION["user"]) == 'D') { echo '<p align="center"><a href="' . $home_url . 'online/' . $result["URL"] . '"><button type="button" class="btn btn-success">ОТКРЫТЬ</button></a></p>'; } if (read($result["Id"], $_SESSION["user"]) == 'Y') { echo '<p align="center"><a href="' . $home_url . 'online/' . $result["URL"] . '"><button type="button" class="btn btn-primary">ПРОДОЛЖИТЬ ЧТЕНИЕ</button></a></p>'; } } else {
$crashes[$crashIndex]["systemversion"] = mysql_real_escape_string(reading($reader, "systemversion")); } else { if ($reader->name == "userid" && $reader->nodeType == XMLReader::ELEMENT) { $crashes[$crashIndex]["userid"] = mysql_real_escape_string(reading($reader, "userid")); } else { if ($reader->name == "contact" && $reader->nodeType == XMLReader::ELEMENT) { $crashes[$crashIndex]["contact"] = mysql_real_escape_string(reading($reader, "contact")); } else { if ($reader->name == "description" && $reader->nodeType == XMLReader::ELEMENT) { $crashes[$crashIndex]["description"] = mysql_real_escape_string(reading($reader, "description")); } else { if ($reader->name == "log" && $reader->nodeType == XMLReader::ELEMENT) { $crashes[$crashIndex]["logdata"] = reading($reader, "log"); } else { if ($reader->name == "platform" && $reader->nodeType == XMLReader::ELEMENT) { $crashes[$crashIndex]["platform"] = reading($reader, "platform"); } } } } } } } } } } } } $reader->close(); $lastError = 0; // store the best version status to return feedback