Created
January 31, 2020 12:39
-
-
Save yordanzhelevdev/1e84aacd1f0118843d735db20aeea5da to your computer and use it in GitHub Desktop.
fns-data-backup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function gallery_data($id, $section_id = 12, $limit = 100, $type = 1) { | |
$order = 'res_order, res_id'; | |
if ($section_id == $GLOBALS['s_products']) { | |
if ($GLOBALS['row']['prod_parent']) $order = 'res_order > 0 DESC, res_order'; | |
else if (strpos($id, ',') !== false && $GLOBALS['row']['prod_id']) $order = "page_id != {$GLOBALS['row']['prod_id']} DESC, ".$order; | |
} | |
$res = query("SELECT * | |
FROM wf_resources | |
WHERE page_id IN ($id) AND section_id = $section_id AND res_type = $type | |
ORDER BY res_type, $order LIMIT $limit"); | |
return num_rows($res) ? $res : false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment