Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Changing the query strings
Krste
#1 Posted : Thursday, 21 May 2009 7:04:34 PM(UTC)
Rank: Member

Joined: 10/05/2009(UTC)
Posts: 9

Hi Roger,

I know I'm bothering you with too many questions, but Im stuck with implementing your gallery into my existing capstone project. I have website that already has query string logic, and now I need to modify the query strings.
I have implemented the gallery as a module gallery, so now when the gallery is opened, the query string looks like this: http://localhost/108811/default.aspx?m=gallery. That works just fine, and opens the gallery homepage. But when I click on some of the albums the query string looks like this http://localhost/108811/default.aspx?g=album&aid=3, and it wont show the album view page. All I need to do is to modify http://localhost/108811/default.aspx?g=album&aid=3, and add &m=gallery at the end of the query string for every album view page and for every media object view page change the query strings from http://localhost/108811/default.aspx?g=mediaobject&moid=2 to http://localhost/108811/default.aspx?g=mediaobject&moid=2&m=gallery
I hope it is possible with your code, because I have implemented everything else, and it works. Just need to fix the query strings.
I will really appreciate your help.

Best Regards
Krste
Roger Martin
#2 Posted : Friday, 22 May 2009 12:37:42 AM(UTC)
Roger Martin

Rank: Administration

Joined: 3/08/2007(UTC)
Posts: 3,300
Location: Fort Atkinson, WI

There are only a few places where URL's are generated, so if you modify those you should be in good shape. I assume you are able to edit the source code.

Modify the two overloads of GetUrl in Website\CodeFiles\Util.cs to this:

Code:
public static string GetUrl(PageId page)
{
    return Util.UrlBuilder.BuildUrl(String.Concat("g=", page, "&m=gallery"));
}

public static string GetUrl(PageId page, string format, params object[] args)
{
    if ((page == PageId.album) || (page == PageId.mediaobject))
    {
        // Don't use the "g" parameter for album or mediaobject pages, since we can deduce it by looking for the
        // aid or moid query string parms. This results in a shorter, cleaner URL.
        return Util.UrlBuilder.BuildUrl(String.Concat(string.Format(format, args), "&m=gallery"));
    }
    else
        return Util.UrlBuilder.BuildUrl(String.Concat("g=", page, "&", string.Format(format, args, "&m=gallery")));
}


Modify the function buildMenuString in Website\gs\controls\albumenu.ascx so that each of the three <a ...> tags that are generated include your "m=gallery" query string. This will take care of the album breadcrumb menu.

Hope this helps.
Roger Martin
Creator and Lead Developer of Gallery Server Pro
Krste
#3 Posted : Monday, 25 May 2009 8:43:27 PM(UTC)
Rank: Member

Joined: 10/05/2009(UTC)
Posts: 9

Thank you very much. That was the solution that I was looking for. I hope I'll be able to help you back sometimes.

Best Regards to you and your family
Krste

Rss Feed  Atom Feed
Users browsing this topic
Guest
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.