Posted by Asbjørn Morell
on 02.01.2008 16:06
Hello,

How do I customize the table rows/columns for my data area? I need to 
create img tags for one of the fields etc. I have used the ex3 example 
(php) Have looked at all the php files but I can't figure out where the 
data is generated.

Best regards.
Asbjørn Morell.
Posted by Matt Brown
on 02.01.2008 21:16
This line in ex2.php and ex3.php tells the grid to get data from 
ricoXMLquery.php.

buffer=new Rico.Buffer.AjaxSQL('ricoXMLquery.php',...

These scripts also set a session variable that contains the query used 
to fetch the data.

$sqltext="select OrderID,CustomerID,ShipName,ShipCity,...
$_SESSION['ex3']=$sqltext;

The grid id is passed to ricoXMLquery.php as part of the request for 
data. ricoXMLquery gets the query associated with that id, executes it, 
and then returns the data back to the grid buffer.

To display images, your query will need to return a complete <img 
src=...> tag in the data returned to the grid.

The latest version of Rico (SVN 241) contains direct support images -- 
your query would just pass back the URL of the image to be displayed. 
This version also contains some new documentation which might also be 
helpful to you.

Matt
Posted by Asbjørn Morell
on 03.01.2008 12:43
Hello Matt,

Thank you for the reply :) If I understand this correctly then I will 
have to store the complete path including html tags in my MySQL table 
field. Can I work with the data in php before it is returned to rico? 
(combine two MySQL fields and add the img tag) I got a huge table with 
lot's of images. The directory path is in one field and the filename in 
another field.

Best regards.
Asbjørn Morell.
Posted by Matt Brown
on 04.01.2008 02:00
Sure, just make the image column a calculation:

SELECT "<img src='"+IMGPATH+IMGFILENAME+"'>", ...

Matt
Posted by Asbjørn Morell
on 04.01.2008 11:44
Thats exactly what I was looking for. However your example gives me a 
syntax error:

$sqltext="SELECT "<img src='"+FILEPATH+FILENAME+"'>" FROM 
cpg1410_pictures";

Parse error: syntax error, unexpected T_STRING in 
/rico/examples/php/ex3.php on line 19

Any ideas?

Best regards.
Asbjørn Morell.
Posted by Asbjørn Morell
on 04.01.2008 13:58
This works:
$sqltext="select title, owner_name, CONCAT('<img src=/albums/',
filepath, 'thumb_',filename, '>') AS fullpath FROM cpg1410_pictures";

Thanks.