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-02" AND "2019-09-17", ((1.1904761904762*(84-IF(`media`.`mediaCreated`>"2019-06-25", DATEDIFF(`media`.`mediaCreated`, "2019-06-25"), DATEDIFF("2019-06-25", `media`.`mediaCreated`)))))*`weightingCreated`, 0))+(IF(`weightingUpdated`>0 AND `media`.`mediaUpdated`!="0000-00-00" AND `media`.`mediaUpdated` BETWEEN "2019-04-02" AND "2019-09-17", ((1.1904761904762*(84-IF(`media`.`mediaUpdated`>"2019-06-25", DATEDIFF(`media`.`mediaUpdated`, "2019-06-25"), DATEDIFF("2019-06-25", `media`.`mediaUpdated`)))))*`weightingUpdated`, 0))+(IF(`weightingProfileupdated`>0 AND `userLastUpdate`!="0000-00-00" AND `userLastUpdate` BETWEEN "2019-04-02" AND "2019-09-17", ((1.1904761904762*(84-IF(`userLastUpdate`>"2019-06-25", DATEDIFF(`userLastUpdate`, "2019-06-25"), DATEDIFF("2019-06-25", `userLastUpdate`)))))*`weightingProfileupdated`, 0))+(IF(`weightingDate`>0 AND IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-06-25" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-06-25", IF(`media`.`mediaDate`>"2019-06-25", `media`.`mediaDate`, `media`.`mediaDateEnd`)))!="0000-00-00" AND IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-06-25" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-06-25", IF(`media`.`mediaDate`>"2019-06-25", `media`.`mediaDate`, `media`.`mediaDateEnd`))) BETWEEN "2019-04-02" AND "2019-09-17", ((1.1904761904762*(84-IF(IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-06-25" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-06-25", IF(`media`.`mediaDate`>"2019-06-25", `media`.`mediaDate`, `media`.`mediaDateEnd`)))>"2019-06-25", DATEDIFF(IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-06-25" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-06-25", IF(`media`.`mediaDate`>"2019-06-25", `media`.`mediaDate`, `media`.`mediaDateEnd`))), "2019-06-25"), DATEDIFF("2019-06-25", IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-06-25" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-06-25", IF(`media`.`mediaDate`>"2019-06-25", `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`=61 AND `mediatypes`.`mtID`=6 AND IF(`mediatypes`.`mtDate`=0, 1, IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-06-25" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-06-25", IF(`media`.`mediaDate`>"2019-06-25", `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-02" AND "2019-09-17", ((1.1904761904762*(84-IF(`media`.`mediaCreated`>"2019-06-25", DATEDIFF(`media`.`mediaCreated`, "2019-06-25"), DATEDIFF("2019-06-25", `media`.`mediaCreated`)))))*`weightingCreated`, 0))+(IF(`weightingUpdated`>0 AND `media`.`mediaUpdated`!="0000-00-00" AND `media`.`mediaUpdated` BETWEEN "2019-04-02" AND "2019-09-17", ((1.1904761904762*(84-IF(`media`.`mediaUpdated`>"2019-06-25", DATEDIFF(`media`.`mediaUpdated`, "2019-06-25"), DATEDIFF("2019-06-25", `media`.`mediaUpdated`)))))*`weightingUpdated`, 0))+(IF(`weightingProfileupdated`>0 AND `userLastUpdate`!="0000-00-00" AND `userLastUpdate` BETWEEN "2019-04-02" AND "2019-09-17", ((1.1904761904762*(84-IF(`userLastUpdate`>"2019-06-25", DATEDIFF(`userLastUpdate`, "2019-06-25"), DATEDIFF("2019-06-25", `userLastUpdate`)))))*`weightingProfileupdated`, 0))+(IF(`weightingDate`>0 AND IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-06-25" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-06-25", IF(`media`.`mediaDate`>"2019-06-25", `media`.`mediaDate`, `media`.`mediaDateEnd`)))!="0000-00-00" AND IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-06-25" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-06-25", IF(`media`.`mediaDate`>"2019-06-25", `media`.`mediaDate`, `media`.`mediaDateEnd`))) BETWEEN "2019-04-02" AND "2019-09-17", ((1.1904761904762*(84-IF(IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-06-25" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-06-25", IF(`media`.`mediaDate`>"2019-06-25", `media`.`mediaDate`, `media`.`mediaDateEnd`)))>"2019-06-25", DATEDIFF(IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-06-25" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-06-25", IF(`media`.`mediaDate`>"2019-06-25", `media`.`mediaDate`, `media`.`mediaDateEnd`))), "2019-06-25"), DATEDIFF("2019-06-25", IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-06-25" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-06-25", IF(`media`.`mediaDate`>"2019-06-25", `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`=61 AND `mediatypes`.`mtID`=6 AND IF(`mediatypes`.`mtDate`=0, 1, IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-06-25" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-06-25", IF(`media`.`mediaDate`>"2019-06-25", `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-02" AND "2019-09-17", ((1.1904761904762*(84-IF(`media`.`mediaCreated`>"2019-06-25", DATEDIFF(`media`.`mediaCreated`, "2019-06-25"), DATEDIFF("2019-06-25", `media`.`mediaCreated`)))))*`weightingCreated`, 0))+(IF(`weightingUpdated`>0 AND `media`.`mediaUpdated`!="0000-00-00" AND `media`.`mediaUpdated` BETWEEN "2019-04-02" AND "2019-09-17", ((1.1904761904762*(84-IF(`media`.`mediaUpdated`>"2019-06-25", DATEDIFF(`media`.`mediaUpdated`, "2019-06-25"), DATEDIFF("2019-06-25", `media`.`mediaUpdated`)))))*`weightingUpdated`, 0))+(IF(`weightingProfileupdated`>0 AND `userLastUpdate`!="0000-00-00" AND `userLastUpdate` BETWEEN "2019-04-02" AND "2019-09-17", ((1.1904761904762*(84-IF(`userLastUpdate`>"2019-06-25", DATEDIFF(`userLastUpdate`, "2019-06-25"), DATEDIFF("2019-06-25", `userLastUpdate`)))))*`weightingProfileupdated`, 0))+(IF(`weightingDate`>0 AND IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-06-25" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-06-25", IF(`media`.`mediaDate`>"2019-06-25", `media`.`mediaDate`, `media`.`mediaDateEnd`)))!="0000-00-00" AND IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-06-25" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-06-25", IF(`media`.`mediaDate`>"2019-06-25", `media`.`mediaDate`, `media`.`mediaDateEnd`))) BETWEEN "2019-04-02" AND "2019-09-17", ((1.1904761904762*(84-IF(IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-06-25" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-06-25", IF(`media`.`mediaDate`>"2019-06-25", `media`.`mediaDate`, `media`.`mediaDateEnd`)))>"2019-06-25", DATEDIFF(IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-06-25" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-06-25", IF(`media`.`mediaDate`>"2019-06-25", `media`.`mediaDate`, `media`.`mediaDateEnd`))), "2019-06-25"), DATEDIFF("2019-06-25", IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-06-25" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-06-25", IF(`media`.`mediaDate`>"2019-06-25", `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`=61 AND `mediatypes`.`mtID`=6 AND IF(`mediatypes`.`mtDate`=0, 1, IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-06-25" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-06-25", IF(`media`.`mediaDate`>"2019-06-25", `media`.`mediaDate`, `media`.`mediaDateEnd`))) Creative Torbay / jobs / Opportunities / Cockington Court Craft Centre / Archive / 1 to 13 of 13

jobs

All the latest arts jobs, commissions  and voluntary opportunities in the Arts and Cultural sector. In order to advertise a position or  opportunity you must first be registered in the directory.

Opportunities / Cockington Court Craft Centre / Archive / 1 to 13 of 13

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

Ceramics Festival Co-ordinator (PT freelance)

Mon 12 Nov 2012

Ceramics Festival Co-ordinator (PT freelance)

May 2013 will see the very first Ceramics Festival at Cockington Court, thanks to a successful funding bid to Arts Council England. As such, we ar.....Read more

Ceramics Festival at Cockington Court, Outreach Co-ordinator

Mon 12 Nov 2012

Ceramics Festival at Cockington Court, Outreach Co-ordinator

May 2013 will see the very first Ceramics Festival at Cockington Court, thanks to a successful funding bid to Arts Council England. As such, we ar.....Read more

Part Time Administrator/Receptionist required

Mon 02 Feb 2015

Part Time Administrator/Receptionist required

To provide comprehensive support to the Centre Director and work in partnership with the FT Administrator for the day to day operation of the centre i.....Read more

PT Garden Co-ordinator & Gardener required at Cockington Court

Fri 20 Mar 2015

PT Garden Co-ordinator & Gardener required at Cockington Court

The Feijoa Project in partnership with Cockington Court Craft Centre is looking to recruit two self-employed positions to assist with the Walled Art G.....Read more

Cockington Craft & Sculpture Studio Units for Rent

Sun 31 Dec 2017

Cockington Craft & Sculpture Studio Units for Rent

We have our last few craft and sculpture studios available for rent at Cockington Court from as little as £85 per mth Over 26 craft studios found .....Read more

Gallery Administrator Receptionist

Sun 23 Jul 2017

Gallery Administrator Receptionist

Job Vacancies Cockington Court is a vibrant cultural visitor attraction generating over 150,000 visitors per annum. It is a centre of crafts exce.....Read more

Food and Beverage Assistants Cockington Court Tea Rooms

Fri 15 Dec 2017

Food and Beverage Assistants Cockington Court Tea Rooms

Cockington Tea Rooms At Cockington Tea Rooms we pride ourselves on giving an excellent customer experience so that our customers return again and a.....Read more

Buskers needed for  Dec weekends

Sun 24 Dec 2017

Buskers needed for Dec weekends

Buskers /performers invited to perform at Cockington Court which generates over 150 visitors per annum on site outside in all studio areas all wee.....Read more

Father Xmas needed for weekends at Cockington Court

Wed 15 Nov 2017

Father Xmas needed for weekends at Cockington Court

Father Xmas needed for weekends in December 10-4pm at Cockington Court Contact Marissa.wakefield@tedcltd.com..Read more

Story tellers needed for 28th october Cockington Court

Sun 15 Oct 2017

Story tellers needed for 28th october Cockington Court

Story tellers wanted to tell ghost stories to a family audience at Cockington Court to take part in a new exciting event need to be available bet.....Read more

Opportunity for Printmaker for studio  at cockington court

Sat 30 Dec 2017

Opportunity for Printmaker for studio at cockington court

Historic and listed Stable Yard Studio available to rent for a Printmaker to join our vibrant makers community at Cockington Court Craft Centre St.....Read more

Functional Potter wanted for Cockington Court studios

Sun 31 Dec 2017

Functional Potter wanted for Cockington Court studios

Historic and listed Stable Yard Studio available to rent for a functional potter to join our vibrant makers community at Cockington Court Craft Centre.....Read more

Applications Invited for Cockington Court Sculpture Trail 2018

Wed 31 Jan 2018

Applications Invited for Cockington Court Sculpture Trail 2018

Cockington Court Sculpture Trail 2018 The very first sculpture trail took place in 2017 and proved a huge success, 17 artists/sculptors took part ......Read more