Not signed in (Sign In)

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

    • CommentAuthorsamir
    • CommentTimeNov 30th 2009 edited
     
    Hi,

    I am trying to get the .html extension work with the old version. I don't want to upgade to the new version.

    I have replaced the generate_url function line to

    else if ($level == "picture") {
    $pic = get_picture_by_id($id);
    $album = $pic["parent_album"];
    return $config['baseurl'].str_replace('%2F', '/', rawurlencode(substr(SmartStripSlashes($pic['path']), 0, strrpos($pic['path'], '.')))).'.html';
    };


    Also, I have added the following line:

    if (!empty($names["picture"])) {
    $names["picture"] = substr($names["picture"], 0, strpos($names["picture"], '.html'));
    $sql = "SELECT * FROM `".$TABLE_PREFIX."pictures`
    WHERE caption = '" . $names["picture"] . "' AND parent_album = " . intval($album["id"]);
    $result = run_query($sql);
    $picture = mysql_fetch_assoc($result);

    Can anyone tell if there is something still to be updated.

    I have got the .html extension working for the new version using the above. I want to get the old version to work.

    Thanks
    •  
      CommentAuthorsidtheduck
    • CommentTimeDec 2nd 2009
     
    I have added more code just below the second code change you listed. I think that should do it for you.

    Your code:
    Posted By: samirif (!empty($names["picture"])) {
    $names["picture"] = substr($names["picture"], 0, strpos($names["picture"], '.html'));
    $sql = "SELECT * FROM `".$TABLE_PREFIX."pictures`
    WHERE caption = '" . $names["picture"] . "' AND parent_album = " . intval($album["id"]);
    $result = run_query($sql);
    $picture = mysql_fetch_assoc($result);

    Just after that:
    // no such caption, perhaps we have better luck with path?
    if (!$picture) {
    $filepath = join("/",$names);
    $like_match = array('_', '%');
    $like_replace = array('\_', '\%');
    $filepath = str_replace($like_match, $like_replace, $filepath);

    $sql = "SELECT *
    FROM `".TABLE_PREFIX."pictures`
    WHERE `path` LIKE '".$filepath.".%'
    AND `parent_album`=".intval($album["id"]);
    $result = run_query($sql);
    $picture = mysql_fetch_assoc($result);
    }