In CB 1.9 I used the MySQL-Field-Plugin to calculate the distance to a user.
I want to do this in CB2, but the MySQL Field Plugin is not compatible.
The SQL-Query I used in CB1.9 was:
Code:
SELECT
round(
6378.137*ACOS(
SIN(u.cb_plug_lat / 180 * PI()) *
SIN(v.cb_plug_lat / 180 * PI()) +
COS(u.cb_plug_lat / 180 * PI()) *
COS(v.cb_plug_lat / 180 * PI()) *
COS(v.cb_plug_lng / 180 * PI() - u.cb_plug_lng / 180 * PI()))
)
FROM
`#__comprofiler` as u, `#__comprofiler` as v
WHERE
u.id={USERID} and v.id={VIEWERID}
Is the CB Query Plugin the right choice to get the same result?
If yes, how can I substitute {USERID} and {VIEWERID} in CB Query?