Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Gazzagreen

Pages: [1]
1
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.

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

2
I have been working on a new mod to allow users to create password protected categories. Visitors will be able to open a new password page and type in a password. If they type in a correct password the category and its photos will appear on the page.

I have this up and working but now and you can see a demo here: http://gallery.lovemansfield.co.uk/password.php, use video as a password

Now I have a problem I need help with.

The category is set to private  (auth_viewcat  =  5), and doesn’t show anywhere on the site except on the password page (if correct password is entered). This is correct and as it should be! However, when the category comes up on the password page, the photos in the category are unclickable. If I am signed in as an admin, I CAN click the photos and open them on the details page, but visitors and other members cannot.

I need to get to the code to allow visitors and members to click the photos on the password page so they open as normal on the details page? Where can I find this code as i have searched and can’t seem to find it?

All the best
Gary
lovemansfield.co.uk

Pages: [1]