<?php
function smarty_modifier_get_first_media($id)
{
global $mysqli;
$sql = "SELECT * FROM lists_media WHERE list_id='$id' ORDER BY media_order LIMIT 1";
$query = $mysqli->query($sql);
$row = $query->fetch_assoc();
return $row['media_id'];
}
?>