Re: User Image Gallery

  •  08-18-2004, 5:18 AM

    Re: User Image Gallery

    Hi,

    I built this functionality around the gallery control. 
    Essentially, what I did was when a user logs in and decides to create a gallery
    I dynamicaly create a folder usersPics/userID with userPics being my root image dir (for all user img folders) and userID being their folder using their unique ID (for example). 
    Then I programmatically change the FolderPath in my codebehind for the myGallery.ascx control (myGallery.ascx.cs)-like this:
     
    gallery1.FolderPath = "~/usersPics/" + user_id ;
     
    YES I made the control use a code-behind as I prefer to code this way (ez to do-of course).
    Obviously I can create N number of user folders under userPics/.  I turn off all editing and top controls for viewers BUT
    when the users is logged in I test for his login cookie and set bool isAdmin to true and do the following on the myGallery.ascx.cs
    page (everything is done on that page-btw): 

    if (isAdmin)

    {

    gallery1.ShowUpload=true;

    gallery1.ShowEditDescription=true;

    }

    else

    {

    gallery1.ShowUpload=false;

    gallery1.ShowEditDescription=false;

    }
    This allows the logged in user to upload and edit (as admin) their gallery while other can simply view.
    My solution is for a slightly different implementation then yours, but the functionality seems similar to me.
    The rest should be easy to code into DNuke.  If I missed anything or was unclear feel free to ask more (hope it helps).
    Cheers,
    DM.
View Complete Thread