hbernard
Založený: 23.03.2003
Príspevky: 159
Bydlisko: FRANCE
Zaslal: 2004-01-10 23:21
Návrat hore
Odpovedať s citátom
|
$opts['fdd']['image_type1']['escape'] = false;
$opts['fdd']['image_type1']['sql'] = 'if(image_type1 > 0,concat("<a href=\"image_popup_pipe.php?id=",id,"\">$val</a>","")';
(and remove 'URL' stuff)
should do what you want, although I m not sure.
|
michal
Založený: 17.06.2003
Príspevky: 537
Bydlisko: Slovakia
Zaslal: 2004-01-10 23:31
Návrat hore
Odpovedať s citátom
|
this could be easily done by output_functions (see bug report), but it's still not in cvs :(
|
hbernard
Založený: 23.03.2003
Príspevky: 159
Bydlisko: FRANCE
Zaslal: 2004-01-11 09:41
Návrat hore
Odpovedať s citátom
|
I forgot a ')' in my post above :
$opts['fdd']['image_type1']['escape'] = false;
$opts['fdd']['image_type1']['sql'] = 'if(image_type1 > 0,concat("<a href=\"image_popup_pipe.php?id=",id,"\">View</a>"),"")';
|
nepto
Založený: 06.01.2003
Príspevky: 320
Bydlisko: Phoenix, Arizona (USA)
Zaslal: 2004-01-12 07:46
Návrat hore
Odpovedať s citátom
|
for michal: output_function code is probably the last thing on my TODO list before 5.4 release...
Although ['output_function'] is nice and useful feature, using ['sql'] is suggested and desirable, because the value is changed on the database layer. Thus sorting works properly and so on...
However certain things can be done only with ['ouput_functions'].
_________________ Ondrej Jombik (Nepto)
Visit my
homepage
, review my recent
CV
or
projects
and give me some
feedback
.
|
hbernard
Založený: 23.03.2003
Príspevky: 159
Bydlisko: FRANCE
Zaslal: 2004-01-12 10:45
Návrat hore
Odpovedať s citátom
|
Doug, wouldn't you need to have
'sql|LFVD' = ...
in place of 'sql' only ?
Just for completeness ;-)
|
hbernard
Založený: 23.03.2003
Príspevky: 159
Bydlisko: FRANCE
Zaslal: 2004-01-21 22:20
Návrat hore
Odpovedať s citátom
|
Great, very nice sample !
|
hbernard
Založený: 23.03.2003
Príspevky: 159
Bydlisko: FRANCE
Zaslal: 2004-01-28 15:32
Návrat hore
Odpovedať s citátom
|
concat is a SQL function which is processed at query-time.
Then, you may only use it with data that are IN the database.
values2 datas are not in the database (well, the keys are, but not the values).
Answer seems to be negative :-(
But if values2 is not dynamic and not too big array, you may use the CASE SQL statement
http://www.mysql.com/doc/en/CASE_Statement.html
inside your concat() expression to associate keys to values
Did I misunderstand your question ?
|
michal
Založený: 17.06.2003
Príspevky: 537
Bydlisko: Slovakia
Zaslal: 2004-01-28 19:22
Návrat hore
Odpovedať s citátom
|
or you want to use 'php' option (formerly known as 'output_function')
then you could simply declare a simple php function to do the job or in 'URL' with 'row' and 'rough_row' asociative arrays.
please say that yes, i want to force nepto to implement this new and useful feature.
|
nepto
Založený: 06.01.2003
Príspevky: 320
Bydlisko: Phoenix, Arizona (USA)
Zaslal: 2004-01-28 21:08
Návrat hore
Odpovedať s citátom
|
I bet that ['php'] will be certainly implemented. :)
However now there is a feature freeze, because we have to release 5.4. But do not worry, ['php'] is useful. I need it for one from my projects. ;-)
_________________ Ondrej Jombik (Nepto)
Visit my
homepage
, review my recent
CV
or
projects
and give me some
feedback
.
|
hbernard
Založený: 23.03.2003
Príspevky: 159
Bydlisko: FRANCE
Zaslal: 2004-01-28 21:27
Návrat hore
Odpovedať s citátom
|
| michal Napísal: |
| please say that yes, i want to force nepto to implement this new and useful feature. |
We all agree that 'php' will be an usefull feature.
But you can't indroduce too many features in 3000 lines without thinking a bit about it to be sure doing it the 'right way' (tm).
Look at the time it take to have more triggers, tabs and sqlw features.
|
|
Odoslať novú tému
Odpovedať na tému
|