Not signed in (Sign In)

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthori-CONICA
    • CommentTimeNov 20th 2008
     
    Hi.
    My gallery is using the latest 588 trunk and I've used the mod here to make the default collection, the root. So the site's home page is the default collection, viewing the albums from there.

    I'd like to know how I can remove the collection name from my urls?

    My urls currently look like this
    http://domain.com/domain.com/professional/img-482lk/
    as my default collection name is my domain name.
    Even if it was called "default" i'd still have
    http://domain.com/default/professional/img-482lk/

    I want the urls to look like this
    http://domain.com/professional/img-482lk/

    I've looked at and tried all the methods explained on here so far, Removing the breadcrumbs link and so on but can't find anything about the urls...
    I found a piece of code and removed it which made the urls look the way i want but clicking those images gives a 404.

    I'd really like some help with this.
    Thanks very much! :D
    •  
      CommentAuthorkimparsell
    • CommentTimeNov 26th 2008
     
    i-CONICA -

    You did not need to implement a mod to get the gallery structure you wanted (i.e., one collection with multiple albums) - the latest version already has a dynamic structure built into it. You just have to organize your gallery that way to take advantage of it.

    One collection, multiple albums - the main gallery page opens at the collection level, only displaying the albums. The breadcrumbs start with the collection name, not "Collections" as it used to in previous versions.

    If you've seriously modified the rev588 code already trying to remove the collections level, you might try uploading a fresh copy to overwrite those changes so you can take advantage of the dynamic structuring.

    With regard to changing the URL to remove the collection name, what code did you alter - filename and post the section of code here please?
    • CommentAuthori-CONICA
    • CommentTimeNov 28th 2008
     
    After I messed up my original install, I installed the latest trunk untouched, apart from one or two modifications from these pages. So it is now the default installation.

    My urls are http://domain.com/domain.com/myalbum/myimage/
    ^ collection name
    I don't have collections, just one default collection and multiple albums. The default collection is called domain.com also. I need to be able to remove that otherwise it looks silly.

    Can I easily remove the collection name from the breadcrumbs and urls?

    Thanks.
    •  
      CommentAuthorsidtheduck
    • CommentTimeDec 2nd 2008
     
    i_Conica,

    Currently, the SVN code should remove the collection name from the breadcrumbs (unless you have multiple albums). However, removing it from the URL would be a little harder since it's finding the path on the hard drive (collection/album/pictures.jpg). This is slated for a change in the future, but we have currently been working on a release that is as "bug-free" as possible while still implementing quite a few features that were requested on the forums. I too would like a more fluid album structure, but that is a major revision of how Plogger stores files and data and will take some time.

    In the meantime, I'll take a look at the code and try to come up with a hack for just your installation (or anyone else's that would want to manually hack their mod_rewrite rules). I'll let you know when I have a solution (I should be able to look into it in the next day or two).
    • CommentAuthori-CONICA
    • CommentTimeDec 2nd 2008
     
    Oh wow, thanks for your time, I'll check back periodically.
    •  
      CommentAuthorsidtheduck
    • CommentTimeDec 3rd 2008 edited
     
    i-CONICA,

    Here's a hack to get the URLs working for you.

    Step 1:
    Open 'plog-includes/plog-functions.php' and find the following line of code under the generate_url() function (should start around line 1259 in rev 588):
    switch($level){
    case "collection":
    [...]
    $rv = $config['baseurl'].rawurlencode(SmartStripSlashes($row['path']))."/".$args;
    break;
    case "album":
    [...]
    $rv = $config['baseurl'].rawurlencode(SmartStripSlashes($row['collection_path'])) . '/' . rawurlencode(SmartStripSlashes($row['album_path']))."/".$args;
    break;
    case "picture":
    [...]
    $rv = $config['baseurl'].str_replace("%2F", "/", rawurlencode(substr(SmartStripSlashes($pic['path']), 0, -4)))."/";
    break;
    [...]

    where [...] = more code. Change it like so:
    switch($level){
    case "collection":
    [...]
    $rv = $config['baseurl'].$args;
    break;
    case "album":
    [...]
    $rv = $config['baseurl'].rawurlencode(SmartStripSlashes($row['album_path']))."/".$args;
    break;
    case "picture":
    [...]
    $rv = $config['baseurl'].str_replace("%2F", "/", rawurlencode(substr(SmartStripSlashes($pic['path']), strpos(SmartStripSlashes($pic['path']), '/')+1, -4)))."/";
    break;
    [...]


    Step 2:
    Open 'plogger.php' and find the following code (should be around line 16):
    $resolved_path = resolve_path($path);
    change it to read:
    $resolved_path = resolve_path("your_collection_folder_name/".$path);
    changing your_collection_folder_name to the actual name of your folder (in your example it would be the 2nd "domain.com").

    Save those files and everything should be peachy!
    Thankful People: rendeto
    • CommentAuthori-CONICA
    • CommentTimeDec 8th 2008
     
    WOW, thanks, it works perfectly.

    I had to change a few things in a random image function from another thread, to remove the collection from the path but that was so easy i managed it.

    Your code works perfectly, thank you.