i have code in my template:
$query = new EntityFieldQuery();
$entities = $query->entityCondition('entity_type', 'node')
->propertyCondition('type', 'article')
->propertyCondition('status', 1)
->fieldCondition('field_show_on', 'tid', $group['identifier'], '=') // taxonomy identifier
->fieldCondition('field_perks_categories', 'tid', $categories['tid'], '=')
->fieldCondition('field_perks_sub_categories', 'tid', $subcategory['tid'], '=')
->execute();
i have other table named "artc_order" which contents nid, weight to to order article manually i want to implement this: http://eureka.ykyuen.info/2012/05/16/drupal-7-order-entityfieldquery-by-random-using-hook_query_tag_alter/ to my template file, how to do that?