Hi,
Sorry it the title is a little confussing.
I am using the tinymce and I am generating the image_list in a php file. My system has all the variables declared for my database and tbl names etc. Obviously when the tinymce references the list it will run the php code within the page and display what I get to echo out.
[code=php]
function GetImages($Purpose) {
$imagestr = “”;
$sql = “SELECT * FROM ” . TBL_IMAGES . ” WHERE GalleryID=’0′ AND Active=’1′ AND IMGPurpose='” . $Purpose . “‘”;
$queryresults = mysqlquery($sql, “image_list.php”, “GetImages”, __LINE__);
// Run through all the images and place into a string to return
while ($results = mysqlarray($queryresults, “image_list.php”, “GetImages”, __LINE__, $sql, true)) {
$imagestr .= ‘[“‘ . $results[“IMGName”] . ‘”, “‘ . $results[“smlURL”] . ‘”],’;
}
// Remove the last comma
$imagestr = rtrim($imagestr, ‘,’);
return $imagestr;
}
$js = ‘var tinyMCEImageList = new Array(‘;
$js .= GetImages($_SESSION[“IMGPurpose”]);
// test
$js .= ‘[“aa”, “asdfsadf”]);’;
echo $js;
As you can see from above it will run through my db and pull the images out.
The problem I have is for this function to work I need to somewhere include the file. When I do include the file it obviously displays the echo’d data.
Not sure on how to get around this?
Thanks
k0r54