Forum Replies Created

Viewing 15 replies - 1 through 15 (of 22 total)
  • It’s against Flickr’s TOS not to link back to the Flickr page for each photo. It’s not likely the plugin author will change for this reason. You could hack the code to do this yourself, but then you run the risk of Flickr terminating your account.

    I also use Flickr to host all my blog images. I set photos to private if they shouldn’t be viewed in my stream. The plugin has the ability to pull private images. I wouldn’t worry about outclicks for stock images driving traffic away from your blog.

    So I’m not actually sure if date() returns server time or GMT/UTC. In any case, if an offset is needed, here’s an example of how to do it:

    date('m.d.y', strtotime('-4 hours')) > '05.01.11' && date('m.d.y', strtotime('-4 hours')) < '05.15.11'

    The -4 hours should be replaced with your offset to date().

    This is the part that needs to be added to the date function, after the formatting string:

    , strtotime('-4 hours')

    To do the one minute difference, you need to know what your server time is (and I’d still leave out the “:s” and “T” from the date formatting). ultimately, it’s just too restrictive to use for testing.

    If you need to display a widget using hour and minute, test it by changing the hour (after you know what your server time is). Once you successfully test it with variables that will produce a “yes” answer and variables that will produce a “no” answer you can set it to whatever hour and minute you want and rest assured that as long as the server time doesn’t go wacky it will work.

    Also, do you know what your server time IS? It’s possible it’s completely off of reality and that’s why the values you’re entering won’t work.

    You should be able to find out your server’s time by uploading a file named whatever.php with this line of code in it: <?php phpinfo(); ?>

    If it’s wrong, contact your host to fix it.

    date("m.d.y") > '05.01.11' && date("m.d.y") < '05.15.11'

    I tested the code above by setting the end date to 05.20.11, then loaded my page. The widget appeared. Then I set the end date to 05.15.11. The widget disappeared. Worked as expected.

    To test it out, choose dates in the current parameters. If you set one up to display in the month of January (date(“l”) is not the way to do that as “l” represents weekday) then it shouldn’t display when you load your site. If you change that month to May, then it should display when you load your site. If that’s true then the code will work as expected.

    The more you include for the date to capture, the more likely it will be that you’ll screw up the value so I would definitely recommend less is more.

    I would not recommend testing using a one minute difference, even if you know the server time. It’s just too hard to catch the “right time” with so little room for error.

    I tested this on my blog before I replied to you and it worked exactly as expected. What date values did you put in to start with the original code above?

    Ah! Okay, that is doable! This is what you want to put in the widget logic box:

    date("m.d.y") > '05.01.11' && date("m.d.y") < '05.15.11'

    Change 05.01.11 to the start date and 05.15.11 to the end date. Written this way, you need to enter a mm.dd.yy format for the date.

    I hope this helps!

    oh, you want to use the date of the post to conditionally display widgets? My use is for the current date to conditionally display widgets.

    I think your way would require another loop to pull out the post date, which sounds messy, if not impossible with this plugin. A better way to do it might be to write some PHP to call for the post date and do the calculations in the header and then pass the resulting variable along to the widget.

    For example, you could grab the post month, day, year and then write an if statement assigning a specific variable value between the dates in question, then use that in the widget box ($myvariable == 'yes')

    That will take some thought though. I’m thinking out loud here in case anyone with more time than I do right now wants to try it.

    Use the date function. For example, I programmed a widget to only display if the day is Wednesday:

    date("l")=='Wednesday'

    Any of the PHP date formats should work here.

    Well, I just got a date function to work using this:

    date("l") == 'Wednesday'

    You could change the string inside the date function and the output to grab January 2011

    It’s probably possible to code between X and Y the same way you would in PHP, but I don’t have that need. I searched high and low for the correct way to phrase the conditional to get a date match with widget logic and never found it, so I thought I’d share that solution here.

    Perfect Dan! I think I know what’s wrong. Thanks.

    It’s strange though, because there’s no javascript difference between the pages it’s working on and isn’t working on.

    Also, I’m starting to think this might have something to do with how many images are being returned. Seems to work fine when fewer images are being returned. I could deal with lightbox not working, but the Next / Prev page links aren’t working either.

    Dan, I only post in the HTML view. There is no HTML in my shortcode. Here it is exactly:

    [flickr-gallery mode=”search” tags=”dwcff-macro” group_id=”1478338@N23″]

    It’s not working on this page either: https://www.digitalwoe.com/2010/07/12-wordpress-plugins-i-cant-live-without/

    I’m not sure why lightbox is selective about when it will and won’t work. The only thing differentiating a page that does work with one that doesn’t is extra text and maybe a little HTML (outside the shortcode, of course.)

    Any other ideas?

    okay, very strange. It has to be something on that page causing the problem. It’s working fine on another page:

    https://www.digitalwoe.com/2010/07/friday-finds-camera-phone-shots/

    What’s even stranger is that I posted that first entry into a new draft and previewed it. Technically, everything on the page is exactly the same – yet on one the lightbox/next works and on the other it doesn’t.

    The only difference is the comments.

Viewing 15 replies - 1 through 15 (of 22 total)