Comic Discussion > QUESTIONABLE CONTENT
WCDT: 2401-2405 (11-15 March, 2013) Weekly Comic Discussion Thread
westrim:
--- Quote from: pwhodges on 16 Mar 2013, 04:12 ---
--- Quote from: Loki on 16 Mar 2013, 03:17 ---I assume the forum has some filtering built in, as do most. It is commonly set up for purposes of filtering swearing or spam, but also frequently used for humorous purposes.
--- End quote ---
There were some such when I became admin, but the only word filter I have left in place is on the name of a file-sharing site used in the BAND section.
--- End quote ---
I thought I had something to say to that, but then I started squeeing over glowy Ayato Kamina from the penultimate episode of RahXephon, which reloaded into Naota from the manga version of FLCL. I've noticed Naota before, but haven't really looked at it otherwise. How many images does your profile image have, and how did you set that up?
Pilchard123:
My guess is that he's using a PHP (or some such language) script containing something like
--- Code: (PHP) ---<?php
//Tell the browser (or other HTTP-receiving application) to expect a PNG image
header('Content-Type: image/png');
//Create a folder handler
$folder = opendir("path/to/images");
//Get all the filenames, plus an empty entry in the array because of the way I've written this
while($images[] = readdir()){}
//Remove the empty entry
array_pop($images);
//Get a random file name from that folder
$filename = $images[array_rand($images)];
//Inters the contents of the image intoto the data to be returned
echo file_get_contents("path/to/images/" . $filename);
//Stop execution
exit;
?>
--- End code ---
I haven't tested this, so there's probably a bug or six, but it's how I'd do it.
Loki:
--- Quote from: Pilchard123 on 16 Mar 2013, 04:47 ---My guess is that he's using a PHP (or some such language) script containing something like
--- Code: (PHP) ---<?php
[...]
//Get all the filenames, plus an empty entry in the array because of the way I've written this
while($images[] = readdir()){}
[...]
?>
--- End code ---
--- End quote ---
Is that construct really valid? I wouldn't have expected it to work in the way intended. I mean, I get what you are trying to do; still looks weird to me to fill an array like this. Maybe because you forgot to pass the $folder handle to readdir :wink:
Pilchard123:
If you don't specify a handle, readdir() will use the last one opened.
I'm pretty sure that construct is valid. I know that using
--- Code: (PHP) ---<?php
while($dataset[] = mysql_fetch_assoc($mysql_resource)){}
?>
--- End code ---
works, so it should work here too.
Seripham89:
I know Jeph was worried about getting a transgender character right, but in the last comic when Marten and Claire are looking into each others eyes, my first thought was "Despite the trolling, if these two ever got together the potential children would have pretty eyes no matter what- oh. right. I forgot. I am an idiot." That's a win for Jeph I think, being able to make me forget a character's origin and look at how they are now. From the very few trans friends I have that seems like the goal and the entire point. Well done, JJ.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version