Page 1 of 1
Customizing the data displayed in the table view
Posted: 2020-08-21 09:41
by epano
Hello,
I hope you are fine, I need help if possible .
I found in the appgini web platform a hook customization
https://bigprof.com/appgini/tips-and-tu ... eview-data
It interested me but i can not make it working. I used the code exactly as it is on the website with my table and line but it is not working. I think the problem is with the line:
Code: Select all
$modField = "CONCAT('<img src="\"hooks/',`cameras`.`ratings`,'.gif\"" border="\"0\"">')";
I would appreciate if you can help me to find the error. Thank in advance and all the best.
Best regards,
Ervis
Re: Customizing the data displayed in the table view
Posted: 2020-08-21 15:28
by pfrumkin
Hi Ervis,
Please provide more information. Specifically
1) What is the problem, what error are you seeing, what isn't working?
2) The code for the entire hook. I assume that it is the cameras_init hook, but I don't know.
~Paul
Re: Customizing the data displayed in the table view
Posted: 2020-08-21 16:00
by epano
Yes it table_init hook where i want to change the appearance in TV from a specific text to picture. Find the full code:
Code: Select all
function cameras_init(&$options, $memberInfo, &$args){
$oldFields = $options->QueryFieldsTV;
foreach($oldFields as $field => $title){
if($field == '`cameras`.`ratings`'){
$modField = "CONCAT('<img src="\"hooks/',`cameras`.`ratings`,'.gif\"" border="\"0\"">')";
$newFields[$modField] = $title;
}else{
$newFields[$field] = $title;
}
}
$options->QueryFieldsTV = $newFields;
return TRUE;
}
The TV of cameras table show an error message:
Parse error: syntax error, unexpected '\' (T_NS_SEPARATOR) in C:\xampp\htdocs\fshzh\hooks\cameras.php on line 38
The line 38 is the line i posted in previous post
Re: Customizing the data displayed in the table view
Posted: 2020-08-28 12:02
by a.gneady
I have fixed the syntax in this code now. It was actaully the code highlighting plugin we're using on our website trying to be act "smart" and fix the code

The corrected line is:
Code: Select all
$modField = "CONCAT('<img src=\"hooks/',`cameras`.`ratings`,'.gif\" border=\"0\" />')";
Re: Customizing the data displayed in the table view
Posted: 2020-08-28 15:21
by epano
Great!!
These is a great customization and anyone can make great changes in tv appearance ,
thank you ahmad
