Last active
February 3, 2018 03:09
-
-
Save davidsword/6920a66855e522da8f3af3d00a671406 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
// read cache and convert XML to ARRAY | |
$data_cache = explode($breaker,file_get_contents($cache)); | |
$reading = new SimpleXMLElement($data_cache[0]); | |
$read = new SimpleXMLElement($data_cache[1]); | |
echo "<div id='bookshelf'>"; | |
// cycle through currently reading (@TODO i dont know if cycle works nativily, only developed with 1 book in shelf. sometimes they change the xml structure when >1. would need to change) | |
foreach ($reading->reviews->review as $reading) | |
echo "<div>book->title}' class='book reading' style='background-image:url(".str_replace('http:', 'https:', $reading->book->image_url).");'></div>"; | |
// cycle through read | |
$c = 1; | |
foreach ($read->reviews->review as $read) { | |
$img = @(isset($image_fix['id_'.$read->book->id])) ? $image_fix['id_'.$read->book->id] : $read->book->image_url; | |
if ($c < 4) | |
echo "<div>book->title} - #{$read->book->id}' class='book read' style='background-image:url(".str_replace('http:', 'https:', $img).");'></div>"; | |
$c++; | |
} | |
echo "</div><!--/bookshelf-->"; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment