Sort image gallery when an image is uploaded

Last post 01-28-2010, 7:48 AM by benick. 6 replies.
Sort Posts: Previous Next
  •  01-22-2010, 2:30 PM 58307

    Sort image gallery when an image is uploaded

    Hi,

    Is it possible that after loading the image in image gallery, the system organice the gallery by date, or do the system to located the page where it was loaded?.

    thanks!
    Filed under:
  •  01-22-2010, 3:28 PM 58309 in reply to 58307

    Re: Sort image gallery when an image is uploaded

    Please open CuteSoft_Client\CuteEditor\Dialogs\InsertGallery.aspx and add the following code to
     
    override protected void OnInit(EventArgs args):
     
    ThumbList1.Sort="DateDesc";

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  01-25-2010, 9:22 AM 58339 in reply to 58309

    Re: Sort image gallery when an image is uploaded

    Hi!

    Testing with:
     
    1. Please open CuteSoft_Client\CuteEditor\Dialogs\InsertGallery.aspx and add the following code to
    override protected void OnInit(EventArgs args):
    ThumbList1.Sort="DateDesc";
     
    Not Work!
     
    2. Open class DBFileStorage Inherits CuteEditor.Impl.FileStorage and include
            Public Sub New(ByVal context As HttpContext)
                MyBase.New(context)
                If (TypeOf context.CurrentHandler Is CuteEditor.Dialogs.InsertGalleryFrame) Then
                    CType(CType(context.CurrentHandler, Page).FindControl("ThumbList1"), CuteEditor.Dialogs.ThumbList).Sort = "DateDesc"
                End If

    Not Work!
     
    Any alternative?
     
    My CuteEditor Version is 6.5
     
    Thanks!
     
  •  01-25-2010, 10:55 AM 58341 in reply to 58339

    Re: Sort image gallery when an image is uploaded

    override protected void OnInit(EventArgs args)
    {
     if(Context.Request.QueryString["Dialog"]=="Standard")
     {
      if(Context.Request.QueryString["IsFrame"]==null)
      {
       string FrameSrc="InsertGallery.Aspx?IsFrame=1&"+Request.ServerVariables["QUERY_STRING"];
       CuteEditor.CEU.WriteDialogOuterFrame(Context,"[[ImageGalleryByBrowsing]]",FrameSrc);
       Context.Response.End();
      }
     }
      base.OnInit(args);
     ThumbList1.Sort="DateDesc";
    }

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  01-25-2010, 5:00 PM 58356 in reply to 58341

    Re: Sort image gallery when an image is uploaded

    Hi, Adam


    The change does not work on the upload, are triggered only when other events (eg changes in the size of the images) and does not allow changing the type of organization to another as "Size Desc.

    Any alternative?

    Thanks!

  •  01-26-2010, 2:32 AM 58361 in reply to 58356

    Re: Sort image gallery when an image is uploaded

    Hi benick,
     
    Try this way:
     
    1. Open file "CuteSoft_Client\CuteEditor\Dialogs\ThumbList.ascx"
     
    2. Add the section below into the page
     
    <script runat=server>
        protected override void OnLoad(EventArgs e)
        {
            Sort = "DateAsc";
            //DateDesc,DateAsc,SizeDesc,SizeAsc
            base.OnLoad(e);
        }
    </script>
     
    Regards,
     
    Ken
  •  01-28-2010, 7:48 AM 58413 in reply to 58361

    Re: Sort image gallery when an image is uploaded

    Hi Ken,
    This change does not allow the user to change the order (for example SizeDesc), I just want that after loading an image, are organized by date desc

    Tested with event "File_Upload", and not refresh:

    Sub Uploaded_FileUploaded(ByVal sender As Object, ByVal args As CuteEditor.UploaderEventArgs)
     
    Dim oInsertGallery As CuteEditor.Dialogs.InsertGalleryFrame = CType(Context.CurrentHandler, CuteEditor.Dialogs.InsertGalleryFrame)
     
    Dim oThumbList As CuteEditor.Dialogs.ThumbList = CType(CType(Context.CurrentHandler, Page).FindControl("ThumbList1"), CuteEditor.Dialogs.ThumbList)

    oThumbList.Sort =
    "DateDesc"
    oThumbList.Refresh = True //Not Refresh
     
    End Sub

    Any Idea?
    Thanks!

View as RSS news feed in XML