phptest-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phptest-users] Embedding images vs. using a link


From: TW-2
Subject: [Phptest-users] Embedding images vs. using a link
Date: Mon, 20 Jan 2003 04:43:59 -0700

Some of you may prefer to embed an image into your tests rather than having
a link, either way is fine but I prefer to embed the image (depending on
size). Here's a quick hack for embedding, maybe later I'll make it a choice
per image if you want to embed or add a link.

Changes to your functions.inc.php and replace the following function:
(comments included)
-------------------

function pt_check_for_image($question_id)
{
    global $db;

    // check if there are any images attached to this question
    $result = $db->query("SELECT image_id, description, width, height
                          FROM images
                          WHERE question_id = $question_id");

    // if so, attach the image to the question
    if ($db->num_rows($result)) {
        $image = $db->fetch_object($result);
        echo "<img src=\"picture.php?image_id=$image->image_id\">";
// The below line makes a link for images rather than embedding the image
file
// echo pt_make_href("javascript:
popup('picture.php?image_id=$image->image_id', $image->width ,
$image->height)", $image->description);
        echo '<br /><br />';
    }

}

-------------------------------





reply via email to

[Prev in Thread] Current Thread [Next in Thread]