Not signed in (Sign In)

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

    • CommentAuthorsamir
    • CommentTimeNov 20th 2009
     
    Hello,

    This gallery works very well. I got Cruft-Free URLs to work with the new version, I would like to know if its possible to modify the URL to have a .html extension instead of a / at the end?

    Thanks
    •  
      CommentAuthorsidtheduck
    • CommentTimeNov 20th 2009
     
    It's possible, but would require some changes. If I may ask, why do you want an .html extension instead of just the trailing slash?
    • CommentAuthorsamir
    • CommentTimeNov 22nd 2009
     
    Hi Sidtheduck,

    Firstly, Thank you for replying to my query.

    I understand the URL's with trailing Slash are search engine friendly. I have an existing website with more than 400 pages and is working with all .html pages. It's ranked good on major search engines. I wanted to use your gallery on that website and want the new pages to be created with .html extensions.

    You have done a real great job by putting forward such a gallery as an Open Source. I will appreciate if you can help me achieve the changes.

    Thanks
    • CommentAuthorsamir
    • CommentTimeNov 23rd 2009
     
    Hi Sidtheduck,

    I found the function generate_url inside the plog-functions files, I have modified the line:

    $rv = $config['baseurl'].str_replace('%2F', '/', rawurlencode(substr(SmartStripSlashes($pic['path']), 0, strrpos($pic['path'], '.')))).'.html';

    which gives me the url to .html for the image links, however which I click, it say page not found.

    I think I need to modify something in the .htaccess file.

    Can you guide me on this.

    Thanks
    •  
      CommentAuthorsidtheduck
    • CommentTimeNov 24th 2009 edited
     
    samir,

    Your .htaccess should be fine. You do need to edit your resolve_path function in plog-includes/plog-functions.php file, however. Open plog-functions.php and starting around line 1206 look for this code:
    if (!empty($names['picture'])) {
    // Check for album level pagination first
    if ($names['picture'] == 'page' && !empty($names['arg1']) && is_numeric($names['arg1']) && intval($names['arg1']) == $names['arg1']) {
    return array('level' => 'album', 'id' => $album['id'], 'plog_page' => intval($names['arg1']));
    }
    $sql = "SELECT *
    FROM `".PLOGGER_TABLE_PREFIX."pictures`
    WHERE `caption`='".$names['picture']."'
    AND `parent_album`=".intval($album['id']);
    $result = run_query($sql);

    and change it to read:
    if (!empty($names['picture'])) {
    // Check for album level pagination first
    if ($names['picture'] == 'page' && !empty($names['arg1']) && is_numeric($names['arg1']) && intval($names['arg1']) == $names['arg1']) {
    return array('level' => 'album', 'id' => $album['id'], 'plog_page' => intval($names['arg1']));
    }
    $names['picture'] = substr($names['picture'], 0, strpos($names['picture'], '.html'));
    $sql = "SELECT *
    FROM `".PLOGGER_TABLE_PREFIX."pictures`
    WHERE `caption`='".$names['picture']."'
    AND `parent_album`=".intval($album['id']);
    $result = run_query($sql);


    You will be adding the $names['picture']... line of code in the middle.
    Let me know if that works for you.
    Thankful People: kegster
    • CommentAuthorsamir
    • CommentTimeNov 24th 2009
     
    Hi Sidtheduck,

    It works. Thanks a lot.

    Great help.