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`)>220, CONCAT(SUBSTRING(`media`.`mediaText`, 1, 220), "..."), `media`.`mediaText`), "\r", ""), "\n", " "), "&", "&"), "\"", """), "\'", "'"), "<", "<"), ">", ">")="", "", REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(IF(CHAR_LENGTH(`media`.`mediaText`)>220, CONCAT(SUBSTRING(`media`.`mediaText`, 1, 220), "..."), `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`, "/")), "") AS `href`,CONCAT("https://", `networkUrl`, "/", `users`.`userSeoName`, "/", IF(`mediatypes`.`mtCode`="profiles", "", CONCAT(`media`.`mediaSeoName`, "/"))) AS `abshref`,CASE WHEN `users`.`userNetwork`=9 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-30" AND "2019-10-15", ((1.1904761904762*(84-IF(`media`.`mediaCreated`>"2019-07-23", DATEDIFF(`media`.`mediaCreated`, "2019-07-23"), DATEDIFF("2019-07-23", `media`.`mediaCreated`)))))*`weightingCreated`, 0))+(IF(`weightingUpdated`>0 AND `media`.`mediaUpdated`!="0000-00-00" AND `media`.`mediaUpdated` BETWEEN "2019-04-30" AND "2019-10-15", ((1.1904761904762*(84-IF(`media`.`mediaUpdated`>"2019-07-23", DATEDIFF(`media`.`mediaUpdated`, "2019-07-23"), DATEDIFF("2019-07-23", `media`.`mediaUpdated`)))))*`weightingUpdated`, 0))+(IF(`weightingProfileupdated`>0 AND `userLastUpdate`!="0000-00-00" AND `userLastUpdate` BETWEEN "2019-04-30" AND "2019-10-15", ((1.1904761904762*(84-IF(`userLastUpdate`>"2019-07-23", DATEDIFF(`userLastUpdate`, "2019-07-23"), DATEDIFF("2019-07-23", `userLastUpdate`)))))*`weightingProfileupdated`, 0))+(IF(`weightingDate`>0 AND IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-07-23" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-07-23", IF(`media`.`mediaDate`>"2019-07-23", `media`.`mediaDate`, `media`.`mediaDateEnd`)))!="0000-00-00" AND IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-07-23" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-07-23", IF(`media`.`mediaDate`>"2019-07-23", `media`.`mediaDate`, `media`.`mediaDateEnd`))) BETWEEN "2019-04-30" AND "2019-10-15", ((1.1904761904762*(84-IF(IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-07-23" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-07-23", IF(`media`.`mediaDate`>"2019-07-23", `media`.`mediaDate`, `media`.`mediaDateEnd`)))>"2019-07-23", DATEDIFF(IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-07-23" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-07-23", IF(`media`.`mediaDate`>"2019-07-23", `media`.`mediaDate`, `media`.`mediaDateEnd`))), "2019-07-23"), DATEDIFF("2019-07-23", IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-07-23" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-07-23", IF(`media`.`mediaDate`>"2019-07-23", `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(53.644394))*COS(RADIANS(IFNULL(`media`.`mediaLatitude`, `userLatitude`)))*COS(RADIANS(IFNULL(`media`.`mediaLongitude`, `userLongitude`))-RADIANS(-1.784605))+SIN(RADIANS(53.644394))*SIN(RADIANS(IFNULL(`media`.`mediaLatitude`, `userLatitude`)))))<100, (IF((3959*ACOS(COS(RADIANS(53.644394))*COS(RADIANS(IFNULL(`media`.`mediaLatitude`, `userLatitude`)))*COS(RADIANS(IFNULL(`media`.`mediaLongitude`, `userLongitude`))-RADIANS(-1.784605))+SIN(RADIANS(53.644394))*SIN(RADIANS(IFNULL(`media`.`mediaLatitude`, `userLatitude`)))))<10, 100, 100-(100/(3959*ACOS(COS(RADIANS(53.644394))*COS(RADIANS(IFNULL(`media`.`mediaLatitude`, `userLatitude`)))*COS(RADIANS(IFNULL(`media`.`mediaLongitude`, `userLongitude`))-RADIANS(-1.784605))+SIN(RADIANS(53.644394))*SIN(RADIANS(IFNULL(`media`.`mediaLatitude`, `userLatitude`))))))))*`weightingProximity`, 0))+(IF(`weightingSpecial`>0 AND `userNetwork`=9 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`.`mediaApproved`=1 AND `userID`=`media`.`mediaUser` AND `networkID`=`userNetwork` AND `userPublish`=1 AND `userActive`=1 AND `mediatypes`.`mtID`=`media`.`mediaType` AND `weightingNetwork`=9 AND `weightingType`=`media`.`mediaType` AND `users`.`userID`=7055 AND `mediatypes`.`mtID`=6 AND IF(`mediatypes`.`mtDate`=0, 1, IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-07-23" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-07-23", IF(`media`.`mediaDate`>"2019-07-23", `media`.`mediaDate`, `media`.`mediaDateEnd`))) BETWEEN IF(`mediatypes`.`mtFuture`=1, "2019-07-23", "2018-07-23") AND IF(`mediatypes`.`mtFuture`=1, "2020-07-22", "2019-07-23")) GROUP BY `media`.`mediaID` ORDER BY `relevance` DESC LIMIT 0, 15;
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`)>220, CONCAT(SUBSTRING(`media`.`mediaText`, 1, 220), "..."), `media`.`mediaText`), "\r", ""), "\n", " "), "&", "&"), "\"", """), "\'", "'"), "<", "<"), ">", ">")="", "", REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(IF(CHAR_LENGTH(`media`.`mediaText`)>220, CONCAT(SUBSTRING(`media`.`mediaText`, 1, 220), "..."), `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`, "/")), "") AS `href`,CONCAT("https://", `networkUrl`, "/", `users`.`userSeoName`, "/", IF(`mediatypes`.`mtCode`="profiles", "", CONCAT(`media`.`mediaSeoName`, "/"))) AS `abshref`,CASE WHEN `users`.`userNetwork`=9 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-30" AND "2019-10-15", ((1.1904761904762*(84-IF(`media`.`mediaCreated`>"2019-07-23", DATEDIFF(`media`.`mediaCreated`, "2019-07-23"), DATEDIFF("2019-07-23", `media`.`mediaCreated`)))))*`weightingCreated`, 0))+(IF(`weightingUpdated`>0 AND `media`.`mediaUpdated`!="0000-00-00" AND `media`.`mediaUpdated` BETWEEN "2019-04-30" AND "2019-10-15", ((1.1904761904762*(84-IF(`media`.`mediaUpdated`>"2019-07-23", DATEDIFF(`media`.`mediaUpdated`, "2019-07-23"), DATEDIFF("2019-07-23", `media`.`mediaUpdated`)))))*`weightingUpdated`, 0))+(IF(`weightingProfileupdated`>0 AND `userLastUpdate`!="0000-00-00" AND `userLastUpdate` BETWEEN "2019-04-30" AND "2019-10-15", ((1.1904761904762*(84-IF(`userLastUpdate`>"2019-07-23", DATEDIFF(`userLastUpdate`, "2019-07-23"), DATEDIFF("2019-07-23", `userLastUpdate`)))))*`weightingProfileupdated`, 0))+(IF(`weightingDate`>0 AND IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-07-23" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-07-23", IF(`media`.`mediaDate`>"2019-07-23", `media`.`mediaDate`, `media`.`mediaDateEnd`)))!="0000-00-00" AND IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-07-23" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-07-23", IF(`media`.`mediaDate`>"2019-07-23", `media`.`mediaDate`, `media`.`mediaDateEnd`))) BETWEEN "2019-04-30" AND "2019-10-15", ((1.1904761904762*(84-IF(IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-07-23" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-07-23", IF(`media`.`mediaDate`>"2019-07-23", `media`.`mediaDate`, `media`.`mediaDateEnd`)))>"2019-07-23", DATEDIFF(IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-07-23" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-07-23", IF(`media`.`mediaDate`>"2019-07-23", `media`.`mediaDate`, `media`.`mediaDateEnd`))), "2019-07-23"), DATEDIFF("2019-07-23", IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-07-23" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-07-23", IF(`media`.`mediaDate`>"2019-07-23", `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(53.644394))*COS(RADIANS(IFNULL(`media`.`mediaLatitude`, `userLatitude`)))*COS(RADIANS(IFNULL(`media`.`mediaLongitude`, `userLongitude`))-RADIANS(-1.784605))+SIN(RADIANS(53.644394))*SIN(RADIANS(IFNULL(`media`.`mediaLatitude`, `userLatitude`)))))<100, (IF((3959*ACOS(COS(RADIANS(53.644394))*COS(RADIANS(IFNULL(`media`.`mediaLatitude`, `userLatitude`)))*COS(RADIANS(IFNULL(`media`.`mediaLongitude`, `userLongitude`))-RADIANS(-1.784605))+SIN(RADIANS(53.644394))*SIN(RADIANS(IFNULL(`media`.`mediaLatitude`, `userLatitude`)))))<10, 100, 100-(100/(3959*ACOS(COS(RADIANS(53.644394))*COS(RADIANS(IFNULL(`media`.`mediaLatitude`, `userLatitude`)))*COS(RADIANS(IFNULL(`media`.`mediaLongitude`, `userLongitude`))-RADIANS(-1.784605))+SIN(RADIANS(53.644394))*SIN(RADIANS(IFNULL(`media`.`mediaLatitude`, `userLatitude`))))))))*`weightingProximity`, 0))+(IF(`weightingSpecial`>0 AND `userNetwork`=9 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`.`mediaApproved`=1 AND `userID`=`media`.`mediaUser` AND `networkID`=`userNetwork` AND `userPublish`=1 AND `userActive`=1 AND `mediatypes`.`mtID`=`media`.`mediaType` AND `weightingNetwork`=9 AND `weightingType`=`media`.`mediaType` AND `users`.`userID`=7055 AND `mediatypes`.`mtID`=6 AND IF(`mediatypes`.`mtDate`=0, 1, IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-07-23" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-07-23", IF(`media`.`mediaDate`>"2019-07-23", `media`.`mediaDate`, `media`.`mediaDateEnd`))) BETWEEN IF(`mediatypes`.`mtFuture`=1, "2019-07-23", "2018-07-23") AND IF(`mediatypes`.`mtFuture`=1, "2020-07-22", "2019-07-23")) GROUP BY `media`.`mediaID` ORDER BY `relevance` DESC LIMIT 0, 15;
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`)>220, CONCAT(SUBSTRING(`media`.`mediaText`, 1, 220), "..."), `media`.`mediaText`), "\r", ""), "\n", " "), "&", "&"), "\"", """), "\'", "'"), "<", "<"), ">", ">")="", "", REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(IF(CHAR_LENGTH(`media`.`mediaText`)>220, CONCAT(SUBSTRING(`media`.`mediaText`, 1, 220), "..."), `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`, "/")), "") AS `href`,CONCAT("https://", `networkUrl`, "/", `users`.`userSeoName`, "/", IF(`mediatypes`.`mtCode`="profiles", "", CONCAT(`media`.`mediaSeoName`, "/"))) AS `abshref`,CASE WHEN `users`.`userNetwork`=9 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-30" AND "2019-10-15", ((1.1904761904762*(84-IF(`media`.`mediaCreated`>"2019-07-23", DATEDIFF(`media`.`mediaCreated`, "2019-07-23"), DATEDIFF("2019-07-23", `media`.`mediaCreated`)))))*`weightingCreated`, 0))+(IF(`weightingUpdated`>0 AND `media`.`mediaUpdated`!="0000-00-00" AND `media`.`mediaUpdated` BETWEEN "2019-04-30" AND "2019-10-15", ((1.1904761904762*(84-IF(`media`.`mediaUpdated`>"2019-07-23", DATEDIFF(`media`.`mediaUpdated`, "2019-07-23"), DATEDIFF("2019-07-23", `media`.`mediaUpdated`)))))*`weightingUpdated`, 0))+(IF(`weightingProfileupdated`>0 AND `userLastUpdate`!="0000-00-00" AND `userLastUpdate` BETWEEN "2019-04-30" AND "2019-10-15", ((1.1904761904762*(84-IF(`userLastUpdate`>"2019-07-23", DATEDIFF(`userLastUpdate`, "2019-07-23"), DATEDIFF("2019-07-23", `userLastUpdate`)))))*`weightingProfileupdated`, 0))+(IF(`weightingDate`>0 AND IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-07-23" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-07-23", IF(`media`.`mediaDate`>"2019-07-23", `media`.`mediaDate`, `media`.`mediaDateEnd`)))!="0000-00-00" AND IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-07-23" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-07-23", IF(`media`.`mediaDate`>"2019-07-23", `media`.`mediaDate`, `media`.`mediaDateEnd`))) BETWEEN "2019-04-30" AND "2019-10-15", ((1.1904761904762*(84-IF(IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-07-23" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-07-23", IF(`media`.`mediaDate`>"2019-07-23", `media`.`mediaDate`, `media`.`mediaDateEnd`)))>"2019-07-23", DATEDIFF(IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-07-23" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-07-23", IF(`media`.`mediaDate`>"2019-07-23", `media`.`mediaDate`, `media`.`mediaDateEnd`))), "2019-07-23"), DATEDIFF("2019-07-23", IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-07-23" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-07-23", IF(`media`.`mediaDate`>"2019-07-23", `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(53.644394))*COS(RADIANS(IFNULL(`media`.`mediaLatitude`, `userLatitude`)))*COS(RADIANS(IFNULL(`media`.`mediaLongitude`, `userLongitude`))-RADIANS(-1.784605))+SIN(RADIANS(53.644394))*SIN(RADIANS(IFNULL(`media`.`mediaLatitude`, `userLatitude`)))))<100, (IF((3959*ACOS(COS(RADIANS(53.644394))*COS(RADIANS(IFNULL(`media`.`mediaLatitude`, `userLatitude`)))*COS(RADIANS(IFNULL(`media`.`mediaLongitude`, `userLongitude`))-RADIANS(-1.784605))+SIN(RADIANS(53.644394))*SIN(RADIANS(IFNULL(`media`.`mediaLatitude`, `userLatitude`)))))<10, 100, 100-(100/(3959*ACOS(COS(RADIANS(53.644394))*COS(RADIANS(IFNULL(`media`.`mediaLatitude`, `userLatitude`)))*COS(RADIANS(IFNULL(`media`.`mediaLongitude`, `userLongitude`))-RADIANS(-1.784605))+SIN(RADIANS(53.644394))*SIN(RADIANS(IFNULL(`media`.`mediaLatitude`, `userLatitude`))))))))*`weightingProximity`, 0))+(IF(`weightingSpecial`>0 AND `userNetwork`=9 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`.`mediaApproved`=1 AND `userID`=`media`.`mediaUser` AND `networkID`=`userNetwork` AND `userPublish`=1 AND `userActive`=1 AND `mediatypes`.`mtID`=`media`.`mediaType` AND `weightingNetwork`=9 AND `weightingType`=`media`.`mediaType` AND `users`.`userID`=7055 AND `mediatypes`.`mtID`=6 AND IF(`mediatypes`.`mtDate`=0, 1, IF(`mediatypes`.`mtDateEnd`=0 OR `media`.`mediaDateEnd`="0000-00-00", `media`.`mediaDate`, IF("2019-07-23" BETWEEN `media`.`mediaDate` AND `media`.`mediaDateEnd`, "2019-07-23", IF(`media`.`mediaDate`>"2019-07-23", `media`.`mediaDate`, `media`.`mediaDateEnd`))) BETWEEN IF(`mediatypes`.`mtFuture`=1, "2019-07-23", "2018-07-23") AND IF(`mediatypes`.`mtFuture`=1, "2020-07-22", "2019-07-23")) GROUP BY `media`.`mediaID` ORDER BY `relevance` DESC LIMIT 0, 15;
Opportunities and funding / Opportunities / Creative Kirklees / Upcoming / 1 to 15 of 30

Opportunities

Discover jobs, commissions, projects, training, freelance and voluntary opportunities in the local arts, cultural and creative industries.

To list your opportunity, register and log in to My Account.

Opportunities / Creative Kirklees / Upcoming / 1 to 15 of 30

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

Crowdfunding – its free money right? (webinar)

Thu 01 Aug 2019

Crowdfunding – its free money right? (webinar)

What is it about? Have you witnessed a great project get let down because the crowdfunding campaign was put online and left waiting for the money to roll in? This workshop will give you the building blocks to develop .....Read more

The Foyle Young Poets of the Year Award

Wed 31 Jul 2019

The Foyle Young Poets of the Year Award

The Foyle Young Poets of the Year Award is an opportunity for any young poet aged 11-17 to accelerate their writing career. Since it was founded in 1998 the Award has kick-started the career of some of today’s most excit.....Read more

Let June Make A Difference, funding for North Kirklees children

Sun 18 Aug 2019

Let June Make A Difference, funding for North Kirklees children

Let June Make A Difference exists to enhance the lives of children in North Kirklees between the ages of 7 and 17. Read the information below about what the funding covers. Let June Make A Difference Grant Our aim .....Read more

Digital Enterprise Programme - Phase 2

Sat 31 Aug 2019

Digital Enterprise Programme - Phase 2

In September, phase two of the Digital Enterprise programme (DE 2.0) will launch, offering an enhanced programme of support for SMEs in the Leeds City Region that are keen to develop their digital capabilities. The progr.....Read more

Postcode Community Trust - Community Grants

Sat 31 Aug 2019

Postcode Community Trust - Community Grants

Short-term, designated funding is available for new projects, or significant expansions of existing projects, in Great Britain that focus on the 2019 themes to improve community health and wellbeing, or reduce isolation .....Read more

UK Theatres Small Grants Scheme Accepting Applications

Mon 02 Sep 2019

UK Theatres Small Grants Scheme Accepting Applications

Capital-improvement grants of up to £5,000 are available to charities’ and not-for-profit groups that run theatres in the UK. Provided by the Theatres Trust and supported by funding from the Andrew Lloyd Webber Founda.....Read more

Theatre Improvements Scheme Grants

Fri 13 Sep 2019

Theatre Improvements Scheme Grants

The deadline for the Improving Accessibility round of the Theatre Improvement Scheme from the Theatres Trust will be Thursday 13 September 2019 Further details on the scheme can be found below:..Read more

Creative Facilitation for Young People

Tue 24 Sep 2019

Creative Facilitation for Young People

This one-day course provides an introduction to a creative approach to group facilitation. It aims to encourage, develop and inspire those with responsibility to lead others through a facilitative process, be it for the .....Read more

Prosper North:free business support  for cultural heritage orgs

Mon 30 Sep 2019

Prosper North:free business support for cultural heritage orgs

A new, free business support programme for culture and heritage organisations to help them become stronger, more impactful, and make the most of the Northern Cultural Regeneration Fund investment opportunity Prosper.....Read more

First Call for Projects to develop Yorkshire & Humber

Tue 01 Oct 2019

First Call for Projects to develop Yorkshire & Humber

XR Stories, the new R&D partnership for the Yorkshire and Humber screen industries has announced the structure for its new research and development funding programme and a first open call for funding projects to grow the.....Read more

Near Neighbours Small Grants Available for 2019 (Dewsbury)

Fri 11 Oct 2019

Near Neighbours Small Grants Available for 2019 (Dewsbury)

The Near Neighbours programme offers small grants between £250 and £5,000, as seed funding for local groups and organisations who are working to bring together neighbours, developing relationships across diverse faiths a.....Read more

The National Arts Fundraising School: fundraising success

Fri 01 Nov 2019

The National Arts Fundraising School: fundraising success

31 theatres on the at risk register 2019 urgently need funding. 64 museums have closed since 2010, according to research by the Museums Association – with more looking likely. And just six months after ACE’s 2018-22 supe.....Read more

Music for All – Music in the Community

Wed 01 Jul 2020

Music for All – Music in the Community

Grants are available to UK based community groups that aim to bring musical projects to their local communities. The grants programme aims to give a helping hand to projects and initiatives across the UK that are seek.....Read more

Elephant Trust for Innovative Visual Arts Projects

Mon 14 Oct 2019

Elephant Trust for Innovative Visual Arts Projects

The Elephant Trust offers grants to artists and for new, innovative visual arts projects based in the UK. It aims to make it possible for artists and those presenting their work to undertake and complete projects when co.....Read more

Procurement Opportunities: Rugby League World Cup 2021

Tue 31 Dec 2019

Procurement Opportunities: Rugby League World Cup 2021

“In January Kirklees Council led a bid to secure some involvement in the Rugby League World Cup in 2021. This bid was successful and Kirklees Council is pleased to have been awarded a men’s Quarter final match to be held.....Read more

1 / 2 /