Replace qa_eqf_output() function in qa-eqf-layer.php with below.
function qa_eqf_output(&$q_view, $position) {
$output = '';
$isoutput = false;
foreach($this->extradata as $key => $item) {
if($item['position'] == $position) {
$name = $item['name'];
$type = $item['type'];
$value = $item['value'];
echo '<pre>';
echo '--- Dump1 --'.PHP_EOL;
echo 'name = '.print_r($name, true).PHP_EOL;
echo 'type = '.print_r($type, true).PHP_EOL;
echo 'value = '.print_r($value, true).PHP_EOL;
echo '</pre>';
if ($type == qa_eqf::FIELD_TYPE_TEXTAREA)
$value = nl2br($value);
else if ($type == qa_eqf::FIELD_TYPE_CHECK)
if ($value == '')
$value = 0;
if ($type != qa_eqf::FIELD_TYPE_TEXT && $type != qa_eqf::FIELD_TYPE_TEXTAREA && $type != qa_eqf::FIELD_TYPE_FILE) {
$options = $this->qa_eqf_options(qa_opt(qa_eqf::FIELD_OPTION.$key));
if(is_array($options))
$value = @$options[$value];
}
if($value == '' && qa_opt(qa_eqf::FIELD_HIDE_BLANK.$key))
continue;
switch ($position) {
case qa_eqf::FIELD_PAGE_POS_UPPER:
$outerclass = 'qa-q-view-extra-upper qa-q-view-extra-upper'.$key;
$innertclass = 'qa-q-view-extra-upper-title qa-q-view-extra-upper-title'.$key;
$innervclass = 'qa-q-view-extra-upper-content qa-q-view-extra-upper-content'.$key;
$inneraclass = 'qa-q-view-extra-upper-link qa-q-view-extra-upper-link'.$key;
$innericlass = 'qa-q-view-extra-upper-img qa-q-view-extra-upper-img'.$key;
break;
case qa_eqf::FIELD_PAGE_POS_INSIDE:
$outerclass = 'qa-q-view-extra-inside qa-q-view-extra-inside'.$key;
$innertclass = 'qa-q-view-extra-inside-title qa-q-view-extra-inside-title'.$key;
$innervclass = 'qa-q-view-extra-inside-content qa-q-view-extra-inside-content'.$key;
$inneraclass = 'qa-q-view-extra-inside-link qa-q-view-extra-inside-link'.$key;
$innericlass = 'qa-q-view-extra-inside-img qa-q-view-extra-inside-img'.$key;
break;
case qa_eqf::FIELD_PAGE_POS_BELOW:
$outerclass = 'qa-q-view-extra qa-q-view-extra'.$key;
$innertclass = 'qa-q-view-extra-title qa-q-view-extra-title'.$key;
$innervclass = 'qa-q-view-extra-content qa-q-view-extra-content'.$key;
$inneraclass = 'qa-q-view-extra-link qa-q-view-extra-link'.$key;
$innericlass = 'qa-q-view-extra-img qa-q-view-extra-img'.$key;
break;
}
$title = qa_opt(qa_eqf::FIELD_LABEL.$key);
if ($type == qa_eqf::FIELD_TYPE_FILE && $value != '') {
echo '<pre>';
echo '--- Dump2 --'.PHP_EOL;
echo 'type is OK!'.PHP_EOL;
echo 'value is OK!'.PHP_EOL;
echo '</pre>';
if(qa_blob_exists($value)) {
echo '<pre>';
echo '--- Dump3 --'.PHP_EOL;
echo 'qa_blob_exists is OK!'.PHP_EOL;
echo '</pre>';
$blob = qa_read_blob($value);
echo '<pre>';
echo '--- Dump4 --'.PHP_EOL;
echo 'blob data = '.print_r($blob,true).PHP_EOL;
echo '</pre>';
$format = $blob['format'];
$bloburl = qa_get_blob_url($value);
$imageurl = str_replace('qa=blob', 'qa=image', $bloburl);
echo '<pre>';
echo '--- Dump5 --'.PHP_EOL;
echo 'format = '.print_r($format,true).PHP_EOL;
echo 'bloburl = '.print_r($bloburl,true).PHP_EOL;
echo 'imageurl = '.print_r($imageurl,true).PHP_EOL;
echo '</pre>';
$filename = $blob['filename'];
$width = $this->qa_eqf_get_image_width($blob['content']);
if($width > qa_opt(qa_eqf::THUMB_SIZE))
$width = qa_opt(qa_eqf::THUMB_SIZE);
$value = $filename;
if($format == 'jpg' || $format == 'jpeg' || $format == 'png' || $format == 'gif') {
$value = '<IMG SRC="'.$imageurl.'&qa_size='.$width.'" ALT="'.$filename.'" TARGET="_blank"/>';
$value = '<A HREF="'.$imageurl.'" CLASS="'.$inneraclass.' '.$innericlass.'" TITLE="'.$title.'">' . $value . '</A>';
} else
$value = '<A HREF="'.$bloburl.'" CLASS="'.$inneraclass.'" TITLE="'.$title.'">' . $value . '</A>';
} else
$value = '';
}
$output .= '<DIV CLASS="'.$outerclass.'">';
$output .= '<DIV CLASS="'.$innertclass.'">'.$title.'</DIV>';
$output .= '<DIV CLASS="'.$innervclass.'">'.$value.'</DIV>';
$output .= '</DIV>';
if(qa_opt(qa_eqf::FIELD_PAGE_POS.$key) != qa_eqf::FIELD_PAGE_POS_INSIDE)
$this->output($output);
else {
if(isset($q_view['content'])) {
$hook = str_replace('^', $key, qa_eqf::FIELD_PAGE_POS_HOOK);
$q_view['content'] = str_replace($hook, $output, $q_view['content']);
}
}
$isoutput = true;
}
$output = '';
}
if($isoutput)
$this->output('<DIV style="clear:both;"></DIV>');
}