• Resolved dinhluong

    (@dinhluong)


    I neglected my old WordPress blog and recently got new hosting and started another. One of my favorite plug-ins for my old site was Alex King’s Since Last Visit, but I can’t seem to get it to run on WordPress 2.0.5, and I’m not sure if it’s the plug-in, WordPress, my host, or just my lack of coding experience.

    My first hurdle was that my new host, DreamHost, disables allow_url_fopen, so instead of:

    <?php require(bloginfo(‘url;’).’/wp-content/plugins/wp-last-visit.php?type=js’); ?>

    I put:
    <?php $type = “js”;
    require(‘/home/dinhluong/dinhternet.com/wp-content/plugins/wp-last-visit.php’); ?>

    into my theme’s header.php file.

    In wp-last-visit.php itself, I changed lines 55-57 (of version 2.2) to read:
    if ($type == “js”) {
    $wplastvisit_output = “javascript”;
    }

    And line 62 to read:
    include(“/home/dinhluong/dinhternet.com/wp-blog-header.php”);

    And after all that, I got my main page to display properly, with no errors or fail messages.

    Now, I’m trying to put the slvBanner() call in my sidebar, but nothing shows up where I placed it. Any idea what my next step should be?

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter dinhluong

    (@dinhluong)

    Thanks for the links! I didn’t see these when I did a search.

    Actually, after reading over Podz’s solution, which is basically what I came up with (but a little cleaner than mine), I went back through all of my code and realized that I had commented out the include in the header file earlier because it gave me a strange error where it printed out the HTML of my page as if I was reading it in Notepad instead of displaying it nicely.

    That’s why my slvBanner call wasn’t working… no include, so all the JavaScript functions were undefined! Anyway, uncommented the include, and I got the weird printing-out-HTML error again. Looked carefully at where the include was supposed to be, and I realized that wp-last-visit.php was getting included all right, but it was just JavaScript in the middle of HTML, so I deleted lines 62-63 and inserted this:
    <script type=’text/javascript’ language=’Javascript’>
    between lines 64 and 65. Of course, that meant I also had to add </script> between lines 121 and 122.

    After that, everything seems to be working perfectly! I hope this helps someone else who wants to use this awesome plug-in, too!

    Maybe you could mark this as resolved, then, please and thanks?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Alex King’s Since Last Visit and WP 2.0.5’ is closed to new replies.