News Memo
WordPress database error: [Server shutdown in progress]
SELECT items.*,
floor( 100 * exp( ( object_weight + max_weight ) / ( 2 * max_weight ) ) / exp( 1 ) ) as item_score
FROM (
SELECT posts.*,
posts.ID as item_id,
lower( post_title ) as item_name
FROM wp_posts as posts
WHERE posts.post_status = 'publish'
AND posts.post_type = 'post'
AND posts.post_password = ''
AND posts.ID NOT IN (6477)
) as items
INNER JOIN (
SELECT object_id,
object_weight,
MAX( max_weight ) as max_weight
FROM (
SELECT object_id,
SUM( term_weight ) as object_weight
FROM (
SELECT object_id,
term_taxonomy_id,
MAX( ( taxonomy_score * relationship_score ) ) as term_weight
FROM (
SELECT term_relationships.object_id,
term_relationships.term_taxonomy_id,
CASE
WHEN
term_taxonomy.taxonomy = 'post_tag'
THEN
100
ELSE
75
END as taxonomy_score,
CASE
WHEN
term_relationships.object_id = 6477
THEN
100
WHEN
term_relationships.object_id = object_relationships.object_id
THEN
90
ELSE
80
END as relationship_score
FROM wp_term_relationships as object_relationships
INNER JOIN wp_term_taxonomy as object_taxonomy
ON object_taxonomy.taxonomy IN ( 'post_tag', 'yahoo_terms' )
AND object_taxonomy.term_taxonomy_id = object_relationships.term_taxonomy_id
INNER JOIN wp_terms as object_terms
ON object_terms.term_id = object_taxonomy.term_id
INNER JOIN wp_term_relationships as related_relationships
ON related_relationships.term_taxonomy_id = object_relationships.term_taxonomy_id
INNER JOIN wp_term_relationships as term_relationships
ON term_relationships.object_id = related_relationships.object_id
INNER JOIN wp_term_taxonomy as term_taxonomy
ON term_taxonomy.taxonomy IN ( 'post_tag', 'yahoo_terms' )
AND term_taxonomy.term_taxonomy_id = term_relationships.term_taxonomy_id
WHERE object_relationships.object_id = 6477
OR object_terms.slug IN ( 'news', 'memo' )
) as term_scores
GROUP BY object_id, term_taxonomy_id
) as term_weights
GROUP BY object_id
) as object_weights,
(
SELECT object_weight as max_weight
FROM (
SELECT object_id,
SUM( term_weight ) as object_weight
FROM (
SELECT object_id,
term_taxonomy_id,
MAX( ( taxonomy_score * relationship_score ) ) as term_weight
FROM (
SELECT term_relationships.object_id,
term_relationships.term_taxonomy_id,
CASE
WHEN
term_taxonomy.taxonomy = 'post_tag'
THEN
100
ELSE
75
END as taxonomy_score,
CASE
WHEN
term_relationships.object_id = 6477
THEN
100
WHEN
term_relationships.object_id = object_relationships.object_id
THEN
90
ELSE
80
END as relationship_score
FROM wp_term_relationships as object_relationships
INNER JOIN wp_term_taxonomy as object_taxonomy
ON object_taxonomy.taxonomy IN ( 'post_tag', 'yahoo_terms' )
AND object_taxonomy.term_taxonomy_id = object_relationships.term_taxonomy_id
INNER JOIN wp_terms as object_terms
ON object_terms.term_id = object_taxonomy.term_id
INNER JOIN wp_term_relationships as related_relationships
ON related_relationships.term_taxonomy_id = object_relationships.term_taxonomy_id
INNER JOIN wp_term_relationships as term_relationships
ON term_relationships.object_id = related_relationships.object_id
INNER JOIN wp_term_taxonomy as term_taxonomy
ON term_taxonomy.taxonomy IN ( 'post_tag', 'yahoo_terms' )
AND term_taxonomy.term_taxonomy_id = term_relationships.term_taxonomy_id
WHERE object_relationships.object_id = 6477
OR object_terms.slug IN ( 'news', 'memo' )
) as term_scores
GROUP BY object_id, term_taxonomy_id
) as term_weights
GROUP BY object_id
) as max_weights
) as max_weights
GROUP BY object_id
) as related_objects
ON related_objects.object_id = items.item_id
ORDER BY item_score DESC, lower(items.item_name)
LIMIT 5
WordPress database error: [Lost connection to MySQL server during query]
UPDATE wp_options SET option_value = 'a:1:{s:5:\"posts\";a:1:{s:32:\"41c5e8ed2fae795f4c0c58982f37bb53\";s:0:\"\";}}' WHERE option_name = 'related_widgets_cache'


Leave a Comment
You must be logged in to comment