J
|
Jane 10/31/2006 |
Hi, if ($value==1) $value = "<font color=green>".$value."</font>"; if ($value==2) $value = "<font color=red>".$value."</font>"; |
M
|
markdorminy 11/1/2006 |
How would one do this for a value contained in an output row in 3.1? |
![]() |
Admin 11/1/2006 |
Hi, |
M
|
markdorminy 11/1/2006 |
$value is not working... in fact, the custom code doesn't seem to be included anywhere. What am I missing? |
![]() |
Admin 11/1/2006 |
Open List or View page in Visual Editor in PHPRunner, double-click your field, choose Custom in the dialog and enter the expression suggested. |
M
|
markdorminy 11/1/2006 |
Yep. Still not working. I can't find the script where the custom code has been incorporated, either. |
M
|
markdorminy 11/1/2006 |
A thousand pardons, Alexey... it does work just as you said. I was trying to color a lookup field. By the way, how can one do that? |
![]() |
Admin 11/1/2006 |
To color lookup field on the list page you'll need to modify generated list page. |
M
|
markdorminy 11/2/2006 |
I was afraid you'd say that. |
G
|
gdude66 11/12/2006 |
To color lookup field on the list page you'll need to modify generated list page. Apply the same login to open <font color=...> tag before field value is displayed and close it after that.
|
![]() |
Admin 11/13/2006 |
Graeme, if($lookuprow=db_fetch_numarray($rsLookup)) $value=ProcessLargeText($lookuprow[0],"","",MODE_LIST); else $value=ProcessLargeText(GetData($data,"FieldName", "..."),"field=FieldName".$keylink,"",MODE_LIST);
if($data["FieldName"]>0) $value = "<font color=red>".$value."</font>"; |
G
|
gdude66 11/13/2006 |
Graeme, to add a conditional coloring to your lookup fields you need to modify generated ..._list.php file. Find ths snippet there: where FieldName is your actual field name. Then add a coloring code just after. I.e.
|
![]() |
Admin 11/13/2006 |
No, this workaround is for 3.1 only. if($lookuprow=db_fetch_numarray($rsLookup)) echo ProcessLargeText($lookuprow[0]); else echo ProcessLargeText(GetData($rsData,$data,"FieldName", "..."),$iquery); |
G
|
gdude66 11/13/2006 |
No, this workaround is for 3.1 only. Here is the code snippet in ..._list.php you need to modify in version 3.0
|
G
|
gdude66 11/18/2006 |
Graeme, to add a conditional coloring to your lookup fields you need to modify generated ..._list.php file. Find ths snippet there: where FieldName is your actual field name. Then add a coloring code just after. I.e.
if($lookuprow=db_fetch_numarray($rsLookup)) $value=ProcessLargeText($lookuprow[0],"","",MODE_LIST); else $value=ProcessLargeText(GetData($data,"progressid", "Custom"),"field=progressid".$keylink,"",MODE_LIST); if($data["progressid"]="1") $value = "<font color=red>".$value."</font>"; } else $value=""; $row[$col."progressid_value"]=$value;
|
T
|
thesofa 11/18/2006 |
I think he means this Then add a coloring code just after. I.e.
if($data["progressid"]="1")
if($data["progressid"]=="1")
|
G
|
gdude66 11/18/2006 |
I think he means this shiould read as "Then add a coloring code just after, for example" Also your line of code thus if($data["progressid"]="1")
|
T
|
thesofa 11/19/2006 |
HTH |