1
Mods & Plugins (Requests & Discussions) / Displaying photos on external sites
« on: October 30, 2008, 10:34:15 AM »
Hi all
I am trying to make it so that people can view pictures from my gallery on another website (I know there is other mods for this, but I need a special requirement). Is there anyone who can help?
At the moment I have come up with this.
Now this works great but as you'll notice it just searches the IMAGE_TABLE. But there is that special requirement I need.
At the moment this code shows all photos. But I need to limit what people see. This is normally done in the categories table under "auth_viewcat. " 0 is for "ALL" to view and 2 for just "MEMBERS" to view.
Questions:
How can I add an argument to include the CATEGORIES_TABLE into my code above so that just categories with 0 in the auth_viewcat are displayed. The resuls will be displayed on a .php page so don't need code anywhere else but on the page thanks.
At the moment I have set the size to width=90. Is there anyway to make this a proportional size? eg. 90 for the widest side without making it square?
Many thanks.
Gazza
I am trying to make it so that people can view pictures from my gallery on another website (I know there is other mods for this, but I need a special requirement). Is there anyone who can help?
At the moment I have come up with this.
Code: [Select]
<?
//Allow Photo Gallery on other websites
$sql = "select * from gallery_images where image_active=1 ORDER BY RAND() desc LIMIT 0,5";
$result_sq = mysql_query($sql);
while($row = mysql_fetch_array($result_sq))
{
$id = $row["image_media_file"];
$category = $row["cat_id"];
$image_name = $row["image_name"];
$photo2 = "<img alt=\"$image_name!\" src=http://gallery.lovemansfield.co.uk/data/media/$category/$id width=90 border=0>";
print "<td><div align=center>
<a href=http://gallery.lovemansfield.co.uk/data/media/$category/$id>$photo2</a>
</div></td>";
}
?>
Now this works great but as you'll notice it just searches the IMAGE_TABLE. But there is that special requirement I need.
At the moment this code shows all photos. But I need to limit what people see. This is normally done in the categories table under "auth_viewcat. " 0 is for "ALL" to view and 2 for just "MEMBERS" to view.
Questions:
How can I add an argument to include the CATEGORIES_TABLE into my code above so that just categories with 0 in the auth_viewcat are displayed. The resuls will be displayed on a .php page so don't need code anywhere else but on the page thanks.
At the moment I have set the size to width=90. Is there anyway to make this a proportional size? eg. 90 for the widest side without making it square?
Many thanks.
Gazza