loading image bits prep

This commit is contained in:
awesomeuser 2023-08-04 16:40:17 +00:00
parent 2d8b74f6a1
commit 3ae452806b

View file

@ -94,6 +94,12 @@
cursor: pointer; cursor: pointer;
} }
</style> </style>
<script>
function loadImageBits(canvasId, bits) {
alert(canvasId);
}
</script>
</head> </head>
<body> <body>
@ -202,11 +208,13 @@
// show content // show content
$myfile = fopen("posts.txt", "r") or die("Unable to open file!"); $myfile = fopen("posts.txt", "r") or die("Unable to open file!");
if ($myfile) { if ($myfile) {
$index = 0;
while (($line = fgets($myfile)) !== false) { while (($line = fgets($myfile)) !== false) {
echo "<div class='post'><h2>" . $line . "</h2>"; echo "<div class='post'><h2>" . $line . "</h2>";
echo "<i>" . fgets($myfile) . "</i>"; echo "<i>" . fgets($myfile) . "</i>";
echo "<div>" . fgets($myfile) . "</div></div>"; echo "<canvas id=\"c" . $index . "\" onload='loadImageBits(\"c" . $index . "\", " . fgets($myfile) . ")' style='width: 100%;' width='128' height='64'></canvas></div>";
// <canvas style="width: 100%;" width="128" height="64"></canvas>
index++;
} }
fclose($myfile); fclose($myfile);