Not signed in (Sign In)

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

    • CommentAuthorjlw
    • CommentTimeOct 30th 2007
     
    I don't know if anyone else had had this problem or not, but I had not been able to get commenting to work properly for the user. If someone submitted a comment, it would get put into moderation correctly. BUT, after clicking the Submit button, the user wouldn't be taken anywhere useful -- instead, the browser would display a message saying "Too many redirects" or some variation thereof. (Firefox helpfully explained that the page was trying to reload itself over and over.)

    After quite a bit of clumsy poking (remember, I am NOT a programmer!) in the "plog-comment.php" file, I isolated the problem . It's in the following line of code, which is supposed to build a URL that directs the user back to the original picture page:

    $redirect = str_replace("&","&",generate_url("picture",$parent_id, array(), true));

    Later on, a "location:$redirect" statement sends the user to the URL built and stored in the $redirect variable.

    By including an "echo" statement farther down the page, I was able to find that the URL wasn't being built correctly; it was linking back to the comment module instead of the original picture page.

    As it happens, though, all picture pages within Plogger have the same URL format:

    http://mysiteurl.net/nameofploggerdirectory/?level=picture&id=000

    where the "000" is replaced with the ID number of the individual picture. In the original line of code, that ID number is stored within the "$parent_id" variable.

    Now, if Mike were fixing this, he'd have to make it all sanitary and location-independent and so on. But I don't! Instead, I just commented out the original "problem" line in the "plog-comment.php" file, which you'll recall was...

    $redirect = str_replace("&","&",generate_url("picture",$parent_id, array(), true));

    and replaced it with a line that uses a hard-coded base URL for my site and just adds the ID number at the end, like this:

    $redirect = "http://mygallery.net/plogger/?level=picture&id=".$parent_id;

    (The . between the URL text and the $parent_id variable is you combine text strings together in PHP. Something new I learned today!)

    So now, when a user submits a comment, the line above builds a URL which points to the original picture page by combining my hard-coded base URL and the picture's ID number.

    As I said, it's very crude, but it does work!

    Hope this might be useful to somebody...


    $parent_id
  1.  
    I've been having this issue for awhile now. Saw several posts referencing the issue but no fix. Implemented your suggestion and now I'm problem free. Thanks!
    • CommentAuthorphAn
    • CommentTimeJan 8th 2008
     
    Although this thread is a tad old: this tip worked great for me. Somehow comments on my site stopped working the other day, perhaps it's due to my webhost upgrading from PHP4 to PHP5. This workaround fixed it for me. Thank you very much :)
    • CommentAuthorsergei
    • CommentTimeMay 4th 2008
     
    Very cool, jlw. I noticed that most of the sites around the internet - that are using Plogger - are experiencing this problem. I don't know how this problem got by the developers, but I thank you for this temporary, interim fix.
  2.  
    Hi,

    I made a different fix:

    updated line 1088: of plog-functions.php to:
    $rv = $config['gallery_url'].'index.php?level=picture&id='.$id;

    however, for some of you then
    $rv = $config['gallery_url'].'?level=picture&id='.$id;

    Might work better?

    Thanks,

    Mark
    • CommentAuthorDanaldinho
    • CommentTimeJun 12th 2008
     
    Thanks jlw :)
    • CommentAuthorjro
    • CommentTimeJun 17th 2008
     
    Thanks jlw, works great! And written in language that I can actually understand.
    • CommentAuthoralfonce
    • CommentTimeJun 23rd 2008
     
    Great stuff for this it seems to work - or partly work. When the url reloads the image doesnt reload back up unless you manually refresh the page. is that correct? In fact it seems that if you navigate away from the page and go back to it it still doesnt show the image unless you refresh a few times. Any ideas?