SELECT SQL_CALC_FOUND_ROWS SQL_NO_CACHE `mediatypes`.`mtID` AS `mediaTypeID`,IF(`mediatypes`.`mtCode`="profiles", CONCAT(`users`.`userDisplayName`, " / ", `media`.`mediaTitle`), `media`.`mediaTitle`) AS `name`,`media`.`mediaTitle` AS `title`,`users`.`userDisplayName` AS `displayname`,`mediatypes`.`mtCode` AS `media`,IF(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(IF(CHAR_LENGTH(`media`.`mediaText`)>150, CONCAT(SUBSTRING(`media`.`mediaText`, 1, 150), "..."), `media`.`mediaText`), "\r", ""), "\n", " "), "&", "&"), "\"", """), "\'", "'"), "<", "<"), ">", ">")="", "", REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(IF(CHAR_LENGTH(`media`.`mediaText`)>150, CONCAT(SUBSTRING(`media`.`mediaText`, 1, 150), "..."), `media`.`mediaText`), "\r", ""), "\n", " "), "&", "&"), "\"", """), "\'", "'"), "<", "<"), ">", ">")) AS `text`,IF(`media`.`mediaFile`!="" AND `mediatypes`.`mtImage`+`mediatypes`.`mtVideo`!=0, CONCAT("media/", `networkAlias`, "/", `mediatypes`.`mtCode`, "/", IF(`mediatypes`.`mtVideo`=1, SUBSTRING(`media`.`mediaFile`, 1, LOCATE(".", `media`.`mediaFile`)-1), `media`.`mediaFile`)), (SELECT IF(`avatar`.`mediaFile`!="", CONCAT("media/", `networkAlias`, "/", `avatarmt`.`mtCode`, "/", `avatar`.`mediaFile`), "") FROM `media` AS `avatar`, `mediatypes` AS `avatarmt` WHERE `avatar`.`mediaUser`=`media`.`mediaUser` AND `avatar`.`mediaType`=`avatarmt`.`mtID` AND `avatarmt`.`mtCode`="profiles" LIMIT 1)) AS `image`,CONCAT("/", `users`.`userSeoName`, "/") AS `pubHref`,CONCAT("/", `users`.`userSeoName`, "/", IF(`mediatypes`.`mtCode`="profiles", "", CONCAT(`media`.`mediaSeoName`, "/")), "?archive=1") AS `href`,CONCAT("https://", `networkUrl`, "/", `users`.`userSeoName`, "/", IF(`mediatypes`.`mtCode`="profiles", "", CONCAT(`media`.`mediaSeoName`, "/"))) AS `abshref`,CASE WHEN `users`.`userNetwork`=1 AND `users`.`userElevation`>=99 THEN "special" WHEN `mediatypes`.`mtCode` IS NULL OR `mediatypes`.`mtCode`="profiles" THEN `users`.`userType` ELSE `mediatypes`.`mtCode` END AS `class`,IF(`mediatypes`.`mtDate`=1, IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`=`media`.`mediaDate`, DATE_FORMAT(`media`.`mediaDate`, "%a %d %b %Y"), CONCAT(DATE_FORMAT(`media`.`mediaDate`, CASE WHEN DATE_FORMAT(`media`.`mediaDate`, "%Y%m")=DATE_FORMAT(`media`.`mediaDateEnd`, "%Y%m") THEN "%a %d" WHEN DATE_FORMAT(`media`.`mediaDate`, "%Y")=DATE_FORMAT(`media`.`mediaDateEnd`, "%Y") THEN "%a %d %b" ELSE "%a %d %b %Y" END), " to ", DATE_FORMAT(`media`.`mediaDateEnd`, "%a %d %b %Y"), " (", CASE WHEN DATEDIFF(`media`.`mediaDateEnd`, `media`.`mediaDate`)+1<7 THEN CONCAT(DATEDIFF(`media`.`mediaDateEnd`, `media`.`mediaDate`)+1, " days") WHEN DATEDIFF(`media`.`mediaDateEnd`, `media`.`mediaDate`)+1<=28 THEN CONCAT(ROUND((DATEDIFF(`media`.`mediaDateEnd`, `media`.`mediaDate`)+1)/7), IF(ROUND((DATEDIFF(`media`.`mediaDateEnd`, `media`.`mediaDate`)+1)/7)=1, " week", " weeks")) WHEN DATEDIFF(`media`.`mediaDateEnd`, `media`.`mediaDate`)+1<365 THEN CONCAT(ROUND((DATEDIFF(`media`.`mediaDateEnd`, `media`.`mediaDate`)+1)/30.417), IF(ROUND((DATEDIFF(`media`.`mediaDateEnd`, `media`.`mediaDate`)+1)/30.417)=1, " month", " months")) ELSE CONCAT(ROUND((DATEDIFF(`media`.`mediaDateEnd`, `media`.`mediaDate`)+1)/365), IF(DATEDIFF(`media`.`mediaDateEnd`, `media`.`mediaDate`)+1<730, " year", " years")) END, ")")), "") AS `date`,`media`.`mediaDate` AS `rssdate`,DATE_FORMAT(`media`.`mediaDate`, "%Y-%m-%dT%TZ") AS `isodate`,IF(`mediatypes`.`mtCode`="profiles", CONCAT(UPPER(SUBSTRING(`userType`, 1, 1)), SUBSTRING(`userType`, 2)), `mediatypes`.`mtName`) AS `type`,((IF(`weightingCreated`>0 AND `media`.`mediaCreated`!="0000-00-00" AND `media`.`mediaCreated` BETWEEN "2019-04-04" AND "2019-09-19", ((1.1904761904762*(84-IF(`media`.`mediaCreated`>"2019-06-27", DATEDIFF(`media`.`mediaCreated`, "2019-06-27"), DATEDIFF("2019-06-27", `media`.`mediaCreated`)))))*`weightingCreated`, 0))+(IF(`weightingUpdated`>0 AND `media`.`mediaUpdated`!="0000-00-00" AND `media`.`mediaUpdated` BETWEEN "2019-04-04" AND "2019-09-19", ((1.1904761904762*(84-IF(`media`.`mediaUpdated`>"2019-06-27", DATEDIFF(`media`.`mediaUpdated`, "2019-06-27"), DATEDIFF("2019-06-27", `media`.`mediaUpdated`)))))*`weightingUpdated`, 0))+(IF(`weightingProfileupdated`>0 AND `userLastUpdate`!="0000-00-00" AND `userLastUpdate` BETWEEN "2019-04-04" AND "2019-09-19", ((1.1904761904762*(84-IF(`userLastUpdate`>"2019-06-27", DATEDIFF(`userLastUpdate`, "2019-06-27"), DATEDIFF("2019-06-27", `userLastUpdate`)))))*`weightingProfileupdated`, 0))+(IF(`weightingDate`>0 AND IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-06-27" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-06-27", IF(`media`.`mediaDate`>"2019-06-27", `media`.`mediaDate`, `media`.`mediaDateEnd`)))!="0000-00-00" AND IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-06-27" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-06-27", IF(`media`.`mediaDate`>"2019-06-27", `media`.`mediaDate`, `media`.`mediaDateEnd`))) BETWEEN "2019-04-04" AND "2019-09-19", ((1.1904761904762*(84-IF(IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-06-27" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-06-27", IF(`media`.`mediaDate`>"2019-06-27", `media`.`mediaDate`, `media`.`mediaDateEnd`)))>"2019-06-27", DATEDIFF(IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-06-27" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-06-27", IF(`media`.`mediaDate`>"2019-06-27", `media`.`mediaDate`, `media`.`mediaDateEnd`))), "2019-06-27"), DATEDIFF("2019-06-27", IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-06-27" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-06-27", IF(`media`.`mediaDate`>"2019-06-27", `media`.`mediaDate`, `media`.`mediaDateEnd`))))))))*`weightingDate`, 0))+(IF(`weightingDuration`>0 AND `mediatypes`.`mtDate`=1 AND `mediatypes`.`mtDateEnd`=1 AND IF(`mtFuture`=1, DATEDIFF(`media`.`mediaDateEnd`, `media`.`mediaDate`), DATEDIFF(`media`.`mediaDate`, `media`.`mediaDateEnd`)) BETWEEN 0 AND 365, (100-((100/365)*IF(`mtFuture`=1, DATEDIFF(`media`.`mediaDateEnd`, `media`.`mediaDate`), DATEDIFF(`media`.`mediaDate`, `media`.`mediaDateEnd`))))*`weightingDuration`, 0))+(IF(`weightingProximity`>0 AND (3959*ACOS(COS(RADIANS(50.468567))*COS(RADIANS(IFNULL(`media`.`mediaLatitude`, `userLatitude`)))*COS(RADIANS(IFNULL(`media`.`mediaLongitude`, `userLongitude`))-RADIANS(-3.533231))+SIN(RADIANS(50.468567))*SIN(RADIANS(IFNULL(`media`.`mediaLatitude`, `userLatitude`)))))<100, (IF((3959*ACOS(COS(RADIANS(50.468567))*COS(RADIANS(IFNULL(`media`.`mediaLatitude`, `userLatitude`)))*COS(RADIANS(IFNULL(`media`.`mediaLongitude`, `userLongitude`))-RADIANS(-3.533231))+SIN(RADIANS(50.468567))*SIN(RADIANS(IFNULL(`media`.`mediaLatitude`, `userLatitude`)))))<10, 100, 100-(100/(3959*ACOS(COS(RADIANS(50.468567))*COS(RADIANS(IFNULL(`media`.`mediaLatitude`, `userLatitude`)))*COS(RADIANS(IFNULL(`media`.`mediaLongitude`, `userLongitude`))-RADIANS(-3.533231))+SIN(RADIANS(50.468567))*SIN(RADIANS(IFNULL(`media`.`mediaLatitude`, `userLatitude`))))))))*`weightingProximity`, 0))+(IF(`weightingSpecial`>0 AND `userNetwork`=1 AND `userElevation`>0, (`userElevation`)*`weightingSpecial`, 0))+(IF(`weightingTotalitems`>0 AND `userTotalItems`>0, ((100/11)*IF(`userTotalItems`>11, 11, `userTotalItems`))*`weightingTotalitems`, 0))+(IF(`weightingMediaviews`>0 AND `media`.`mediaViews`>0, ((100/25351)*`media`.`mediaViews`)*`weightingMediaviews`, 0))+(IF(`weightingProfileviews`>0 AND `userProfileViews`>0, ((100/2605)*`userProfileViews`)*`weightingProfileviews`, 0)))/(`weightingCreated`+`weightingUpdated`+`weightingProfileupdated`+`weightingDate`+`weightingDuration`+`weightingProximity`+`weightingSpecial`+`weightingTotalitems`+`weightingMediaviews`+`weightingProfileviews`) AS `relevance` FROM `media`, `users`, `mediatypes`, `networks`, `weightings` WHERE `media`.`mediaActive`=1 AND `media`.`mediaEncoding`=0 AND (`media`.`mediaChecked`=0 OR `media`.`mediaApproved`=1) AND `userID`=`media`.`mediaUser` AND `networkID`=`userNetwork` AND `userPublish`=1 AND `userActive`=1 AND `mediatypes`.`mtID`=`media`.`mediaType` AND `weightingNetwork`=1 AND `weightingType`=`media`.`mediaType` AND `users`.`userID`=4742 AND `mediatypes`.`mtID`=2 AND IF(`mediatypes`.`mtDate`=0, 1, IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-06-27" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-06-27", IF(`media`.`mediaDate`>"2019-06-27", `media`.`mediaDate`, `media`.`mediaDateEnd`)))
SELECT SQL_CALC_FOUND_ROWS SQL_NO_CACHE `mediatypes`.`mtID` AS `mediaTypeID`,IF(`mediatypes`.`mtCode`="profiles", CONCAT(`users`.`userDisplayName`, " / ", `media`.`mediaTitle`), `media`.`mediaTitle`) AS `name`,`media`.`mediaTitle` AS `title`,`users`.`userDisplayName` AS `displayname`,`mediatypes`.`mtCode` AS `media`,IF(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(IF(CHAR_LENGTH(`media`.`mediaText`)>150, CONCAT(SUBSTRING(`media`.`mediaText`, 1, 150), "..."), `media`.`mediaText`), "\r", ""), "\n", " "), "&", "&"), "\"", """), "\'", "'"), "<", "<"), ">", ">")="", "", REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(IF(CHAR_LENGTH(`media`.`mediaText`)>150, CONCAT(SUBSTRING(`media`.`mediaText`, 1, 150), "..."), `media`.`mediaText`), "\r", ""), "\n", " "), "&", "&"), "\"", """), "\'", "'"), "<", "<"), ">", ">")) AS `text`,IF(`media`.`mediaFile`!="" AND `mediatypes`.`mtImage`+`mediatypes`.`mtVideo`!=0, CONCAT("media/", `networkAlias`, "/", `mediatypes`.`mtCode`, "/", IF(`mediatypes`.`mtVideo`=1, SUBSTRING(`media`.`mediaFile`, 1, LOCATE(".", `media`.`mediaFile`)-1), `media`.`mediaFile`)), (SELECT IF(`avatar`.`mediaFile`!="", CONCAT("media/", `networkAlias`, "/", `avatarmt`.`mtCode`, "/", `avatar`.`mediaFile`), "") FROM `media` AS `avatar`, `mediatypes` AS `avatarmt` WHERE `avatar`.`mediaUser`=`media`.`mediaUser` AND `avatar`.`mediaType`=`avatarmt`.`mtID` AND `avatarmt`.`mtCode`="profiles" LIMIT 1)) AS `image`,CONCAT("/", `users`.`userSeoName`, "/") AS `pubHref`,CONCAT("/", `users`.`userSeoName`, "/", IF(`mediatypes`.`mtCode`="profiles", "", CONCAT(`media`.`mediaSeoName`, "/")), "?archive=1") AS `href`,CONCAT("https://", `networkUrl`, "/", `users`.`userSeoName`, "/", IF(`mediatypes`.`mtCode`="profiles", "", CONCAT(`media`.`mediaSeoName`, "/"))) AS `abshref`,CASE WHEN `users`.`userNetwork`=1 AND `users`.`userElevation`>=99 THEN "special" WHEN `mediatypes`.`mtCode` IS NULL OR `mediatypes`.`mtCode`="profiles" THEN `users`.`userType` ELSE `mediatypes`.`mtCode` END AS `class`,IF(`mediatypes`.`mtDate`=1, IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`=`media`.`mediaDate`, DATE_FORMAT(`media`.`mediaDate`, "%a %d %b %Y"), CONCAT(DATE_FORMAT(`media`.`mediaDate`, CASE WHEN DATE_FORMAT(`media`.`mediaDate`, "%Y%m")=DATE_FORMAT(`media`.`mediaDateEnd`, "%Y%m") THEN "%a %d" WHEN DATE_FORMAT(`media`.`mediaDate`, "%Y")=DATE_FORMAT(`media`.`mediaDateEnd`, "%Y") THEN "%a %d %b" ELSE "%a %d %b %Y" END), " to ", DATE_FORMAT(`media`.`mediaDateEnd`, "%a %d %b %Y"), " (", CASE WHEN DATEDIFF(`media`.`mediaDateEnd`, `media`.`mediaDate`)+1<7 THEN CONCAT(DATEDIFF(`media`.`mediaDateEnd`, `media`.`mediaDate`)+1, " days") WHEN DATEDIFF(`media`.`mediaDateEnd`, `media`.`mediaDate`)+1<=28 THEN CONCAT(ROUND((DATEDIFF(`media`.`mediaDateEnd`, `media`.`mediaDate`)+1)/7), IF(ROUND((DATEDIFF(`media`.`mediaDateEnd`, `media`.`mediaDate`)+1)/7)=1, " week", " weeks")) WHEN DATEDIFF(`media`.`mediaDateEnd`, `media`.`mediaDate`)+1<365 THEN CONCAT(ROUND((DATEDIFF(`media`.`mediaDateEnd`, `media`.`mediaDate`)+1)/30.417), IF(ROUND((DATEDIFF(`media`.`mediaDateEnd`, `media`.`mediaDate`)+1)/30.417)=1, " month", " months")) ELSE CONCAT(ROUND((DATEDIFF(`media`.`mediaDateEnd`, `media`.`mediaDate`)+1)/365), IF(DATEDIFF(`media`.`mediaDateEnd`, `media`.`mediaDate`)+1<730, " year", " years")) END, ")")), "") AS `date`,`media`.`mediaDate` AS `rssdate`,DATE_FORMAT(`media`.`mediaDate`, "%Y-%m-%dT%TZ") AS `isodate`,IF(`mediatypes`.`mtCode`="profiles", CONCAT(UPPER(SUBSTRING(`userType`, 1, 1)), SUBSTRING(`userType`, 2)), `mediatypes`.`mtName`) AS `type`,((IF(`weightingCreated`>0 AND `media`.`mediaCreated`!="0000-00-00" AND `media`.`mediaCreated` BETWEEN "2019-04-04" AND "2019-09-19", ((1.1904761904762*(84-IF(`media`.`mediaCreated`>"2019-06-27", DATEDIFF(`media`.`mediaCreated`, "2019-06-27"), DATEDIFF("2019-06-27", `media`.`mediaCreated`)))))*`weightingCreated`, 0))+(IF(`weightingUpdated`>0 AND `media`.`mediaUpdated`!="0000-00-00" AND `media`.`mediaUpdated` BETWEEN "2019-04-04" AND "2019-09-19", ((1.1904761904762*(84-IF(`media`.`mediaUpdated`>"2019-06-27", DATEDIFF(`media`.`mediaUpdated`, "2019-06-27"), DATEDIFF("2019-06-27", `media`.`mediaUpdated`)))))*`weightingUpdated`, 0))+(IF(`weightingProfileupdated`>0 AND `userLastUpdate`!="0000-00-00" AND `userLastUpdate` BETWEEN "2019-04-04" AND "2019-09-19", ((1.1904761904762*(84-IF(`userLastUpdate`>"2019-06-27", DATEDIFF(`userLastUpdate`, "2019-06-27"), DATEDIFF("2019-06-27", `userLastUpdate`)))))*`weightingProfileupdated`, 0))+(IF(`weightingDate`>0 AND IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-06-27" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-06-27", IF(`media`.`mediaDate`>"2019-06-27", `media`.`mediaDate`, `media`.`mediaDateEnd`)))!="0000-00-00" AND IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-06-27" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-06-27", IF(`media`.`mediaDate`>"2019-06-27", `media`.`mediaDate`, `media`.`mediaDateEnd`))) BETWEEN "2019-04-04" AND "2019-09-19", ((1.1904761904762*(84-IF(IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-06-27" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-06-27", IF(`media`.`mediaDate`>"2019-06-27", `media`.`mediaDate`, `media`.`mediaDateEnd`)))>"2019-06-27", DATEDIFF(IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-06-27" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-06-27", IF(`media`.`mediaDate`>"2019-06-27", `media`.`mediaDate`, `media`.`mediaDateEnd`))), "2019-06-27"), DATEDIFF("2019-06-27", IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-06-27" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-06-27", IF(`media`.`mediaDate`>"2019-06-27", `media`.`mediaDate`, `media`.`mediaDateEnd`))))))))*`weightingDate`, 0))+(IF(`weightingDuration`>0 AND `mediatypes`.`mtDate`=1 AND `mediatypes`.`mtDateEnd`=1 AND IF(`mtFuture`=1, DATEDIFF(`media`.`mediaDateEnd`, `media`.`mediaDate`), DATEDIFF(`media`.`mediaDate`, `media`.`mediaDateEnd`)) BETWEEN 0 AND 365, (100-((100/365)*IF(`mtFuture`=1, DATEDIFF(`media`.`mediaDateEnd`, `media`.`mediaDate`), DATEDIFF(`media`.`mediaDate`, `media`.`mediaDateEnd`))))*`weightingDuration`, 0))+(IF(`weightingProximity`>0 AND (3959*ACOS(COS(RADIANS(50.468567))*COS(RADIANS(IFNULL(`media`.`mediaLatitude`, `userLatitude`)))*COS(RADIANS(IFNULL(`media`.`mediaLongitude`, `userLongitude`))-RADIANS(-3.533231))+SIN(RADIANS(50.468567))*SIN(RADIANS(IFNULL(`media`.`mediaLatitude`, `userLatitude`)))))<100, (IF((3959*ACOS(COS(RADIANS(50.468567))*COS(RADIANS(IFNULL(`media`.`mediaLatitude`, `userLatitude`)))*COS(RADIANS(IFNULL(`media`.`mediaLongitude`, `userLongitude`))-RADIANS(-3.533231))+SIN(RADIANS(50.468567))*SIN(RADIANS(IFNULL(`media`.`mediaLatitude`, `userLatitude`)))))<10, 100, 100-(100/(3959*ACOS(COS(RADIANS(50.468567))*COS(RADIANS(IFNULL(`media`.`mediaLatitude`, `userLatitude`)))*COS(RADIANS(IFNULL(`media`.`mediaLongitude`, `userLongitude`))-RADIANS(-3.533231))+SIN(RADIANS(50.468567))*SIN(RADIANS(IFNULL(`media`.`mediaLatitude`, `userLatitude`))))))))*`weightingProximity`, 0))+(IF(`weightingSpecial`>0 AND `userNetwork`=1 AND `userElevation`>0, (`userElevation`)*`weightingSpecial`, 0))+(IF(`weightingTotalitems`>0 AND `userTotalItems`>0, ((100/11)*IF(`userTotalItems`>11, 11, `userTotalItems`))*`weightingTotalitems`, 0))+(IF(`weightingMediaviews`>0 AND `media`.`mediaViews`>0, ((100/25351)*`media`.`mediaViews`)*`weightingMediaviews`, 0))+(IF(`weightingProfileviews`>0 AND `userProfileViews`>0, ((100/2605)*`userProfileViews`)*`weightingProfileviews`, 0)))/(`weightingCreated`+`weightingUpdated`+`weightingProfileupdated`+`weightingDate`+`weightingDuration`+`weightingProximity`+`weightingSpecial`+`weightingTotalitems`+`weightingMediaviews`+`weightingProfileviews`) AS `relevance` FROM `media`, `users`, `mediatypes`, `networks`, `weightings` WHERE `media`.`mediaActive`=1 AND `media`.`mediaEncoding`=0 AND (`media`.`mediaChecked`=0 OR `media`.`mediaApproved`=1) AND `userID`=`media`.`mediaUser` AND `networkID`=`userNetwork` AND `userPublish`=1 AND `userActive`=1 AND `mediatypes`.`mtID`=`media`.`mediaType` AND `weightingNetwork`=1 AND `weightingType`=`media`.`mediaType` AND `users`.`userID`=4742 AND `mediatypes`.`mtID`=2 AND IF(`mediatypes`.`mtDate`=0, 1, IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-06-27" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-06-27", IF(`media`.`mediaDate`>"2019-06-27", `media`.`mediaDate`, `media`.`mediaDateEnd`)))
SELECT SQL_CALC_FOUND_ROWS SQL_NO_CACHE `mediatypes`.`mtID` AS `mediaTypeID`,IF(`mediatypes`.`mtCode`="profiles", CONCAT(`users`.`userDisplayName`, " / ", `media`.`mediaTitle`), `media`.`mediaTitle`) AS `name`,`media`.`mediaTitle` AS `title`,`users`.`userDisplayName` AS `displayname`,`mediatypes`.`mtCode` AS `media`,IF(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(IF(CHAR_LENGTH(`media`.`mediaText`)>150, CONCAT(SUBSTRING(`media`.`mediaText`, 1, 150), "..."), `media`.`mediaText`), "\r", ""), "\n", " "), "&", "&"), "\"", """), "\'", "'"), "<", "<"), ">", ">")="", "", REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(IF(CHAR_LENGTH(`media`.`mediaText`)>150, CONCAT(SUBSTRING(`media`.`mediaText`, 1, 150), "..."), `media`.`mediaText`), "\r", ""), "\n", " "), "&", "&"), "\"", """), "\'", "'"), "<", "<"), ">", ">")) AS `text`,IF(`media`.`mediaFile`!="" AND `mediatypes`.`mtImage`+`mediatypes`.`mtVideo`!=0, CONCAT("media/", `networkAlias`, "/", `mediatypes`.`mtCode`, "/", IF(`mediatypes`.`mtVideo`=1, SUBSTRING(`media`.`mediaFile`, 1, LOCATE(".", `media`.`mediaFile`)-1), `media`.`mediaFile`)), (SELECT IF(`avatar`.`mediaFile`!="", CONCAT("media/", `networkAlias`, "/", `avatarmt`.`mtCode`, "/", `avatar`.`mediaFile`), "") FROM `media` AS `avatar`, `mediatypes` AS `avatarmt` WHERE `avatar`.`mediaUser`=`media`.`mediaUser` AND `avatar`.`mediaType`=`avatarmt`.`mtID` AND `avatarmt`.`mtCode`="profiles" LIMIT 1)) AS `image`,CONCAT("/", `users`.`userSeoName`, "/") AS `pubHref`,CONCAT("/", `users`.`userSeoName`, "/", IF(`mediatypes`.`mtCode`="profiles", "", CONCAT(`media`.`mediaSeoName`, "/")), "?archive=1") AS `href`,CONCAT("https://", `networkUrl`, "/", `users`.`userSeoName`, "/", IF(`mediatypes`.`mtCode`="profiles", "", CONCAT(`media`.`mediaSeoName`, "/"))) AS `abshref`,CASE WHEN `users`.`userNetwork`=1 AND `users`.`userElevation`>=99 THEN "special" WHEN `mediatypes`.`mtCode` IS NULL OR `mediatypes`.`mtCode`="profiles" THEN `users`.`userType` ELSE `mediatypes`.`mtCode` END AS `class`,IF(`mediatypes`.`mtDate`=1, IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`=`media`.`mediaDate`, DATE_FORMAT(`media`.`mediaDate`, "%a %d %b %Y"), CONCAT(DATE_FORMAT(`media`.`mediaDate`, CASE WHEN DATE_FORMAT(`media`.`mediaDate`, "%Y%m")=DATE_FORMAT(`media`.`mediaDateEnd`, "%Y%m") THEN "%a %d" WHEN DATE_FORMAT(`media`.`mediaDate`, "%Y")=DATE_FORMAT(`media`.`mediaDateEnd`, "%Y") THEN "%a %d %b" ELSE "%a %d %b %Y" END), " to ", DATE_FORMAT(`media`.`mediaDateEnd`, "%a %d %b %Y"), " (", CASE WHEN DATEDIFF(`media`.`mediaDateEnd`, `media`.`mediaDate`)+1<7 THEN CONCAT(DATEDIFF(`media`.`mediaDateEnd`, `media`.`mediaDate`)+1, " days") WHEN DATEDIFF(`media`.`mediaDateEnd`, `media`.`mediaDate`)+1<=28 THEN CONCAT(ROUND((DATEDIFF(`media`.`mediaDateEnd`, `media`.`mediaDate`)+1)/7), IF(ROUND((DATEDIFF(`media`.`mediaDateEnd`, `media`.`mediaDate`)+1)/7)=1, " week", " weeks")) WHEN DATEDIFF(`media`.`mediaDateEnd`, `media`.`mediaDate`)+1<365 THEN CONCAT(ROUND((DATEDIFF(`media`.`mediaDateEnd`, `media`.`mediaDate`)+1)/30.417), IF(ROUND((DATEDIFF(`media`.`mediaDateEnd`, `media`.`mediaDate`)+1)/30.417)=1, " month", " months")) ELSE CONCAT(ROUND((DATEDIFF(`media`.`mediaDateEnd`, `media`.`mediaDate`)+1)/365), IF(DATEDIFF(`media`.`mediaDateEnd`, `media`.`mediaDate`)+1<730, " year", " years")) END, ")")), "") AS `date`,`media`.`mediaDate` AS `rssdate`,DATE_FORMAT(`media`.`mediaDate`, "%Y-%m-%dT%TZ") AS `isodate`,IF(`mediatypes`.`mtCode`="profiles", CONCAT(UPPER(SUBSTRING(`userType`, 1, 1)), SUBSTRING(`userType`, 2)), `mediatypes`.`mtName`) AS `type`,((IF(`weightingCreated`>0 AND `media`.`mediaCreated`!="0000-00-00" AND `media`.`mediaCreated` BETWEEN "2019-04-04" AND "2019-09-19", ((1.1904761904762*(84-IF(`media`.`mediaCreated`>"2019-06-27", DATEDIFF(`media`.`mediaCreated`, "2019-06-27"), DATEDIFF("2019-06-27", `media`.`mediaCreated`)))))*`weightingCreated`, 0))+(IF(`weightingUpdated`>0 AND `media`.`mediaUpdated`!="0000-00-00" AND `media`.`mediaUpdated` BETWEEN "2019-04-04" AND "2019-09-19", ((1.1904761904762*(84-IF(`media`.`mediaUpdated`>"2019-06-27", DATEDIFF(`media`.`mediaUpdated`, "2019-06-27"), DATEDIFF("2019-06-27", `media`.`mediaUpdated`)))))*`weightingUpdated`, 0))+(IF(`weightingProfileupdated`>0 AND `userLastUpdate`!="0000-00-00" AND `userLastUpdate` BETWEEN "2019-04-04" AND "2019-09-19", ((1.1904761904762*(84-IF(`userLastUpdate`>"2019-06-27", DATEDIFF(`userLastUpdate`, "2019-06-27"), DATEDIFF("2019-06-27", `userLastUpdate`)))))*`weightingProfileupdated`, 0))+(IF(`weightingDate`>0 AND IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-06-27" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-06-27", IF(`media`.`mediaDate`>"2019-06-27", `media`.`mediaDate`, `media`.`mediaDateEnd`)))!="0000-00-00" AND IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-06-27" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-06-27", IF(`media`.`mediaDate`>"2019-06-27", `media`.`mediaDate`, `media`.`mediaDateEnd`))) BETWEEN "2019-04-04" AND "2019-09-19", ((1.1904761904762*(84-IF(IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-06-27" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-06-27", IF(`media`.`mediaDate`>"2019-06-27", `media`.`mediaDate`, `media`.`mediaDateEnd`)))>"2019-06-27", DATEDIFF(IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-06-27" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-06-27", IF(`media`.`mediaDate`>"2019-06-27", `media`.`mediaDate`, `media`.`mediaDateEnd`))), "2019-06-27"), DATEDIFF("2019-06-27", IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-06-27" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-06-27", IF(`media`.`mediaDate`>"2019-06-27", `media`.`mediaDate`, `media`.`mediaDateEnd`))))))))*`weightingDate`, 0))+(IF(`weightingDuration`>0 AND `mediatypes`.`mtDate`=1 AND `mediatypes`.`mtDateEnd`=1 AND IF(`mtFuture`=1, DATEDIFF(`media`.`mediaDateEnd`, `media`.`mediaDate`), DATEDIFF(`media`.`mediaDate`, `media`.`mediaDateEnd`)) BETWEEN 0 AND 365, (100-((100/365)*IF(`mtFuture`=1, DATEDIFF(`media`.`mediaDateEnd`, `media`.`mediaDate`), DATEDIFF(`media`.`mediaDate`, `media`.`mediaDateEnd`))))*`weightingDuration`, 0))+(IF(`weightingProximity`>0 AND (3959*ACOS(COS(RADIANS(50.468567))*COS(RADIANS(IFNULL(`media`.`mediaLatitude`, `userLatitude`)))*COS(RADIANS(IFNULL(`media`.`mediaLongitude`, `userLongitude`))-RADIANS(-3.533231))+SIN(RADIANS(50.468567))*SIN(RADIANS(IFNULL(`media`.`mediaLatitude`, `userLatitude`)))))<100, (IF((3959*ACOS(COS(RADIANS(50.468567))*COS(RADIANS(IFNULL(`media`.`mediaLatitude`, `userLatitude`)))*COS(RADIANS(IFNULL(`media`.`mediaLongitude`, `userLongitude`))-RADIANS(-3.533231))+SIN(RADIANS(50.468567))*SIN(RADIANS(IFNULL(`media`.`mediaLatitude`, `userLatitude`)))))<10, 100, 100-(100/(3959*ACOS(COS(RADIANS(50.468567))*COS(RADIANS(IFNULL(`media`.`mediaLatitude`, `userLatitude`)))*COS(RADIANS(IFNULL(`media`.`mediaLongitude`, `userLongitude`))-RADIANS(-3.533231))+SIN(RADIANS(50.468567))*SIN(RADIANS(IFNULL(`media`.`mediaLatitude`, `userLatitude`))))))))*`weightingProximity`, 0))+(IF(`weightingSpecial`>0 AND `userNetwork`=1 AND `userElevation`>0, (`userElevation`)*`weightingSpecial`, 0))+(IF(`weightingTotalitems`>0 AND `userTotalItems`>0, ((100/11)*IF(`userTotalItems`>11, 11, `userTotalItems`))*`weightingTotalitems`, 0))+(IF(`weightingMediaviews`>0 AND `media`.`mediaViews`>0, ((100/25351)*`media`.`mediaViews`)*`weightingMediaviews`, 0))+(IF(`weightingProfileviews`>0 AND `userProfileViews`>0, ((100/2605)*`userProfileViews`)*`weightingProfileviews`, 0)))/(`weightingCreated`+`weightingUpdated`+`weightingProfileupdated`+`weightingDate`+`weightingDuration`+`weightingProximity`+`weightingSpecial`+`weightingTotalitems`+`weightingMediaviews`+`weightingProfileviews`) AS `relevance` FROM `media`, `users`, `mediatypes`, `networks`, `weightings` WHERE `media`.`mediaActive`=1 AND `media`.`mediaEncoding`=0 AND (`media`.`mediaChecked`=0 OR `media`.`mediaApproved`=1) AND `userID`=`media`.`mediaUser` AND `networkID`=`userNetwork` AND `userPublish`=1 AND `userActive`=1 AND `mediatypes`.`mtID`=`media`.`mediaType` AND `weightingNetwork`=1 AND `weightingType`=`media`.`mediaType` AND `users`.`userID`=4742 AND `mediatypes`.`mtID`=2 AND IF(`mediatypes`.`mtDate`=0, 1, IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-06-27" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-06-27", IF(`media`.`mediaDate`>"2019-06-27", `media`.`mediaDate`, `media`.`mediaDateEnd`))) Creative Torbay / knowledge hub / News / Deborah Duffin / Archive / 1 to 11 of 11

Knowledge Hub

News / Deborah Duffin / Archive / 1 to 11 of 11

Show All / Today / Jun / May / Apr / Mar / Feb / Jan / Dec / Nov / Oct / Sep / Aug / Jul / Archive

Drawing Accepted for Thelma Hulbert Open

Thu 12 Jul 2012

Drawing Accepted for Thelma Hulbert Open

A drawing accepted for the Thelma Hulbert Open exhibition ' Equality and Endeavour' will be on show from 14th July to 8th September. A large (60x80cm).....Read more

Sculpture accepted for RWA Autumn Exhibition

Tue 23 Oct 2012

Sculpture accepted for RWA Autumn Exhibition

Deborah Duffin has had a sculpture accepted for the 160th Royal West of England Academy Autumn Exhibition, Bristol. The piece is entitled: 'Curl with .....Read more

New book from CV Publications

Wed 21 Dec 2011

New book from CV Publications

A new book from CV publications entitled: 'Interviews - Artists 4'. An anthology of interviews conducted over a period of years, by Nick James, includ.....Read more

New book: 'Eco-Aesthetics'

Tue 10 Jun 2014

New book: 'Eco-Aesthetics'

A fascinating new book by Malcolm Miles featuring numerous artists including Deborah Duffin; Cornford and Cross; Peter Randall-Page; Heather and Ivan .....Read more

Sculpture sited at Exeter University

Wed 21 Dec 2011

Sculpture sited at Exeter University

Two sculptures made from wire and recycled materails newly sited at Exeter University as part of their extensive sculpture trail, on the university ca.....Read more

Commission sited at University of Exeter Sculpture Trail

Mon 27 Feb 2012

Commission sited at University of Exeter Sculpture Trail

'Blue/orange Zigzag with Oval' - new piece commissioned by University of Exeter sited in the Old Library, as part of the campus Sculpture Trail. This .....Read more

Affirmation: Affirmative Art Exhibition

Wed 04 Apr 2012

Affirmation: Affirmative Art Exhibition

A group exhibition in the beautiful, atmospheric Spanish Barn in the grounds of Torre Abbey. Deborah Duffin's installation comprises numerous suspende.....Read more

Deborah Duffin short-listed for Culture Cloud

Thu 21 Jun 2012

Deborah Duffin short-listed for Culture Cloud

Deborah Duffin is one of 101 artists whose artworks have been selected to feature in the next stage of the Culture Cloud internet exhibition. Of these.....Read more

New piece installed at women's art collection, Cambridge

Sun 15 Jun 2014

New piece installed at women's art collection, Cambridge

A new piece of work by Deborah Duffin has been installed in the Women' Art Collection held by New hall College, Cambridge University. A fascinating re.....Read more

New commission for University of Exeter

Thu 11 Dec 2014

New commission for University of Exeter

Entitled 'White Entwined', this piece was commissioned for the sculpture trail around the Streatham Campus of University of Exeter. The piece was desi.....Read more

New Commission

Fri 11 Nov 2016

New Commission

A series of new works by Deborah Duffin have been commissioned by global communications company: Liberty Global. The finished pieces will be shown on .....Read more