This topic is locked

Image Gallery

11/3/2007 4:26:11 AM
ASPRunnerPro General questions
M
Michael7 author

Hi,
I am using ASPRunner for an Image Gallery. Could you please help and tell me how to properly place the {$row.1Photo_value} tag into the code below.

<td align=center valign=middle class=borderbody {$row.1Photo_style}>

<!--{if $row.1show}-->

<a href={$row.1Photo_value} rel="PhotoExpand" ><img src={$row.1Photo_value} width="70px" height="70px"/></a>

<!--{else}-->

<!--{/if}-->

</td>


Thanks

Michael

M
Michael7 author 11/3/2007

Never mind, I got it working with this.

If there is a better way please let me know. thanks

<span class="postcolor"><td align=center valign=middle class=borderbody {$row.1Photo_style}>

<!--{if $row.1show}--></span>

<a href="Photos_imager.asp?Field=Photo&key1={$row.1recno}" rel="lightbox">{$row.1Photo_value}</a><span class="postcolor">

<!--{else}-->

<!--{/if}-->

</td></span>
F
freindly 11/11/2007

Never mind, I got it working with this.

If there is a better way please let me know. thanks

<span class="postcolor"><td align=center valign=middle class=borderbody {$row.1Photo_style}>

<!--{if $row.1show}--></span>

<a href="Photos_imager.asp?Field=Photo&key1={$row.1recno}" rel="lightbox">{$row.1Photo_value}</a><span class="postcolor">

<!--{else}-->

<!--{/if}-->

</td></span>


Could you explain how to start with the image gallery; I have no idea what I should do to build this with Asprunner

M
Michael7 author 11/11/2007

Use master detail relationship
table 1 fields

Gallery ID

Gallery Name

Gallery Desciption

Date Created

Created By etc
(this i used for master page and just provides a desciption of images inside the gallery)
table 2 fields

Photo ID

Gallery ID - Used for Master-Detail (make it a number field)

Photo

Photo Description

Date Created

Created By etc
(this is used for holding all the images inside the gallery.)

  • In asp runner select the two tables. highlight table 2 and select table 1 as master table where Gallery ID = Gallery ID
  • make sure you set Photo field to OLE Object if access or the appropriate type for your db.
  • On the fields Order & Total page of ASP runner make it vertical and 4 records per row.
    that gives a plain looking photo gallery. from here I use Lightbox to give it nicer formatting.

    this can be found here http://www.huddletogether.com/projects/lightbox/
    regarding my questions in this post. it was to ensure that when on the list page it always looked good because the photos where all about 70 x 70 px then once clicked they open up using lightbox to their full size.
    Obviosly both the photo page and gallery list page will have all the search functions etc that shouldn't be required for this type of project so just remove what is not needed.
    hope that helps

F
freindly 11/12/2007

Use master detail relationship

table 1 fields

Gallery ID

Gallery Name

Gallery Desciption

Date Created

Created By etc
(this i used for master page and just provides a desciption of images inside the gallery)
table 2 fields

Photo ID

Gallery ID - Used for Master-Detail (make it a number field)

Photo

Photo Description

Date Created

Created By etc
(this is used for holding all the images inside the gallery.)

  • In asp runner select the two tables. highlight table 2 and select table 1 as master table where Gallery ID = Gallery ID
  • make sure you set Photo field to OLE Object if access or the appropriate type for your db.
  • On the fields Order & Total page of ASP runner make it vertical and 4 records per row.
    that gives a plain looking photo gallery. from here I use Lightbox to give it nicer formatting.

    this can be found here http://www.huddletogether.com/projects/lightbox/
    regarding my questions in this post. it was to ensure that when on the list page it always looked good because the photos where all about 70 x 70 px then once clicked they open up using lightbox to their full size.
    Obviosly both the photo page and gallery list page will have all the search functions etc that shouldn't be required for this type of project so just remove what is not needed.
    hope that helps


Thank you. I will give it a try.

F
freindly 11/13/2007

It works fine, although the progamme to make it look nicer seems difficult.

where do you change the code, in the asp pages itselves?

M
Michael7 author 11/14/2007

Hi,
Put all the files into the output folder

eg)

output/js/lightbox.js

output/js/prototype.js

output/css/lightbox.css
then open the /Templates/Photo...list.asp page
In the header place
<link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />

<script src="js/scriptaculous.js?load=effects" type="text/javascript"></script>

<script src="js/lightbox.js" type="text/javascript"></script>
then in the same file find the {$row.1_value} tag

and replace with....
<a href="[color="#0000ff"]PhotosFileName_imager.asp?Field=">

<img src="[color="#0000ff"]PhotoFileName_imager.asp?Field="></a>
Note : Depending on how many columns your layout has. (yours has two) will need to change the above tag for each.

eg {$row.[color="#ff0000"]2keyblock} {$row.4keyblock}
That is all that is required.

E
ebolisa 11/16/2007

Hi,

In this case how would the password table be setup? I mean, how should the relations user/gallery be?

I cannot get the login (using passwords) to work when the guest account is enabled.

Thanks,

Emilio

M
Michael7 author 11/17/2007

I use my own security so you will need to speak with admin regarding this login question.
my guess is that you would just setup your asprunner security with another table called "users" include a username column and allow registrations in ASPrunner, then once the user logs in, instead of allowing them to enter their name when creating the gallery use their Session("UserName") as a readonly field. In future when they log in they will be able to see the edit / delete options etc where their Session username is the one that created the gallery depending on what privledges you offer.
If you are having problems with the guest only or login it sound so like it is not set up right. Login should work and provide privlaged controls (add, edit delete) and guest only should just allow viewing with limited options.
Not sure if this was a new question or related to my last reply but if it was for the last reply that code will have no impact on your security at all.
Admin will have more documentation on the ASP runner security so check with them though.
Thanks

Michael