EE: Yearly Archives plugin
Yearly Archives: a ExpressionEngine plugin. This post now provides a place for support for the Low Yearly Archives plugin.
Download and docs for Low Yearly Archives can be found in the Software section
Yearly Archives: a ExpressionEngine plugin. This post now provides a place for support for the Low Yearly Archives plugin.
Download and docs for Low Yearly Archives can be found in the Software section
Comments
any demo?
Sure, like I pointed out at the beginning of this post: these archives work with this plugin (and some ajax ^_^). Chris Ruzin uses it too.
I need a listing of yearly archives for events. The page should list upcoming events from the current year ONWARDS, and on the side, should provide links to past from previous years. How do I do this?
With EE I had to manually hardcode the current year to get the the page to work.
Can the plugin avoid the hard-coding?
See
http://www.straitsknowledge.com/events/
Maish, you could probably work around hard-coding the current year by allowing php in your template and adding some code. Take a look at these two threads over at the pMachine forums.
How would you get both the years and months to be descending? Playing around with start_month and sort results in not all entries being displayed. Using your default set-up shows all results but with the months going from Jan - Dec instead of Dec - Jan (ie newest first).
John, version 1.1 allows for this functionality.
I must’ve just missed this by a few hours did I?
Actually, I added this to the plugin ’cause it couldn’t do what you asked. I think more people will benifit from this. :)
Hello Low,
I love your archive plugin. One cient would like to display their archives like this:
2005
2004
2003
…
the user clicks a year to display a list of all articles from that year in date order. is this possible with your plugin?
thanks!
David, you can create the list of years with this plugin. They could link to another template where you set up a
{exp:weblog:entries}tag and have that display entries per year. This plugin doesn’t create lists of entries, just lists of months and years.Sorry for posting in an old topic, but I just wanted to say thank you for this fantastic plugin. You should try to get this into the core of EE 2.0!
I am not able to show future entries using this plugin - though I am adding in
show_future_entries=”yes” - is there any further attributes I should be using to make it work correctly?
Thanks
Joel, it would appear you’ve discovered a tiny bug! I’ve switched
show_future_entriesandshow_expiredaround by mistake. I’ll fix this later on. For now, you can useshow_expired="yes"to achieve the desired result.Excellent! This almost drove me crazy today trying to track down where I had gone wrong, thanks very much for replying so quickly
Just one thing - how (if possible) can i restrict the listings to the current year only? I am showing an event scheduler and it needs to be restricted to just showing 12 months of entries? Thanks again
Joel, you should probably enable php in your template for that, explained here, and use
$year = $LOC->decode_date("%Y", $LOC->now);to retrieve the current year. You can then usestart_year="<?=$year?>"andend_year="<?=$year?>"to show only the current year.Ha! Very good - yes of course, that would do the job nicely; thanks again!
Joel, the bug has been fixed in version 1.11.
What I would like to to have is just a list like this:
*2007
-April
-March
-February
-January
2006
2005
2004
When someone click on a month, the monthly posting should be shown.
When someclick of a year, this year should expand (or collaps).
Is this possible to with your plugin????
Would be very nice!!!
Yes Erwin, that’s possible with this plugin. You’ll need to add some JavaScript to toggle the display of the list of months from block to none and vice versa. You can keep the markup almost exactly the same as in the example, only add a link or a span around the year and
ids to the nesteduls so you’re able to target them with JS.Great! Tx for your fast reply.
Just one question: do you have an example website where I copy the code from (I am not that a Java-guru ;) )
Erwin, a Google search for “toggle display javascript” will get you going in the right direction.
Hi Low:
I ran into a recent problem with this plugin, I posted my question at the EE support forums, would it be best to resubmit here?
Thank you for producing such a useful plugin!
Feature Request: {switch} tag
Hi Low,
I really love your ajax archives, however, I do not seem to be able to figure out how to do it. Could you provide some help?
Is it possible to combine the ajax date archives with a ajax category archive: Depending on what one clicks on the archive list changes. I was planning on doing this own my own site since some time… (If I don’t make sense could you send me an email, maybe we could tackle this together and create a follow-up plugin…)
Squawk, have you seen my article on Ajax archives? Does that help?
My site has multiple sections, I’m having trouble linking to some sort of a page that will display all stories from that month in all of the sections, instead of just one.
Just the “{month_short}”
How can I specify multiple blogs/sections here?
{month_short}
Hi, Can this handle category parameter?
Display a weblog and a specific category only?
Thanks
Paul, there’s no category parameter support at the moment. Sorry…
Hi,
I from this thread on EE where someone managed to implement it but I am not sure where to place the code.
perhaps you can take a look and enlighted me.
Cheers, Paul
Post below:
————————————-
I’ve managed to find a workable solution for me. I’ve changed A few line of code in yearly archive.
Added:
$category = $TMPL->fetch_param(’category’) ? $TMPL->fetch_param(’category’) : ”;
$sql_category = $FNS->sql_andor_string($category, ‘cat_id’);
and changed SQL query to include:
INNER JOIN
exp_category_posts p
ON
t.entry_id = p.entry_id
This adds parameter category to {exp:yearly_archives /}
————————————-
Hi, Thanks for the great plugin. One thing I noticed though was that it doesn’t seem to work for entries that are on the 1st of any month. Is there something special I need to do to enable this? Has anyone else had this problem?
I’m using the following code:
{exp:yearly_archives weblog=”article” start_month=”1″ status=”not closed” sort=”desc”}
{months}
{if num_entries > 0}
…code here…
{/if}
{/months}
{/exp:yearly_archives}
It’s a big shame there’s no category support at the moment. I use the Category name in the URL so even the hack above doesn’t help me out.
It’s a shame as I really just need the {entries_in_year} single tag to for a count comparison in order to close a table of entries where I had a new table for each year.
@Mel: I haven’t seen that issue before. Can you point me to a working example?
@Steven: I’ll take category support into account for an upcoming version, if I ever get round to it. And by the looks of it, you shouldn’t be using this plugin for what you need, anyway. Some other custom plugin would be more efficient…
@Low If only someone would find a solution for me on the forums!
Hi Steven,
Do you know where to place the code I posted above to get it to work?
Paul, if you must, then here you go:
Add this code after line #41:
$category = $TMPL->fetch_param('category') ? $TMPL->fetch_param('category') : '';Add this code after line #55:
$sql_category = $FNS->sql_andor_string($category, 'p.cat_id');Add this code after line #68 (before
WHERE 1):INNER JOIN exp_category_posts p ON t.entry_id = p.entry_idAdd this code after line #72 (before
GROUP BY):$sql_categoryHi Low, thanks but it doesnt seems to work.
Do I use it like:
weblog=”blog” category-id=”2″
for example
Paul, try
category="2"instead ofcategory-id.Thanks a lot Low! :-)
Got it working.
Sorry if I have been a pain on this subject!
Paul
This may be two unrelated problems:
1) My most current month doesn’t appear until I have posted 2 entries
2) The {num_entries} count for a month is off by one ( shows 0 when there is actually 1 )
Much thanks
Scratch that. Here is description of the real bug:
I posted an entry at 2007-12-20 03:00 AM - and the plugin didn’t recognize it
I moved the date back hourly and at 2007-12-19 07:36 PM is when it recognized the entry as being there
Mysteries!
@Mike: strange indeed. I’ll look into it as soon as I get the chance.
Hi,
i m usign this code
============
{exp:yearly_archives weblog=”f1news” start_month=”1″ status=”not closed” sort=”desc” }
<li>
{if entries_in_year > 0}
{if leap_year == 1}{year}{if:else}{year}{/if}
{months}
{if num_entries > 0}
{month_short}
{if:else}
{month_short}
{/if}
{/months}
{/if}
</li>
{/exp:yearly_archives}
</ul>
=============
What i want is i want to print the months only related to current year & links to rest of the year.
How did you do your archive. I would really like to have something like that on mye site.
And is it possible to change te location of the news depending on what category the news is. I it is a eview i would like it to go to an other place than the regular news.
Thank you for this plugin, I love it and I have used it in a couple of sites.
Handige tool, als ik het maar werkende kreeg.
@Edwin: I’d point you in the right direction, if only I’d know what your problem is.
Hi low, great plugin!
I’ve been running into a problem with selecting “end_year” however. I’m using some php to get first year and last year as I want to do exactly what #19 does.
I want current year to default to on and the only way I can think to do this is by having 2 instances of the plugin. The first only showing current year with start_year=”<?php echo $year; ?>” and the second instance end_year=”<?php echo $last_year; ?>”.
The problem is that the second instance, what is supposed to be last year, is only displaying the number of months of the CURRENT year. So, for example, 2007 months end in April. I thought it might be my php so I hard coded end_year=”2007″ and got the same results.
Any help is much appreciated :)
To clarify a little bit:
Even with only one instance of the plugin, if I say end_year=”2007″ it shows only the number of months for 2008 yet the URL’s display correctly (ie:2007).
If I say end_year=”2008″ all months and URLs are displayed correctly, but unfortunately this won’t work as we want to be able to target 2008 separately.
Hi Joey. I’m not entirely sure what you’re trying to accomplish, but if you’re after something like #19, then you’ll need some JavaScript to show/hide the list of months per year. Here’s a snippet of code I used, php on input:
<?php</pre>$thisyear = date("Y",time());
$thismonth = date("m",time());
?>
<ul id="yearly_archives">{exp:yearly_archives weblog="blog" start_month="1" start_year="2005" sort="desc"}
{if entries_in_year > 0}
<li><a href="#year{year}" class="toggle">{year}</a>
<ul id="year{year}" class="{if year == "<?=$thisyear?>"}show{if:else}hidden{/if}">
{months}
<li>{if num_entries > 0}<a href="{path=blog/archives/}{year}/{month_num}/">{month}</a>{if:else}{month}{/if}</li>
{/months}
</ul>
</li>
{/if}{/exp:yearly_archives}
</ul>
Now you can use the classes
showandhiddento display or hide the list of months, and you can use the links withclass="toggle"to switch between views.You can see it something similar right here (bottom left), although that shows 2 years by default if the active month of the current year is April or less.
Hi again Low!
Sorry, I should have been more clear. The javascript toggling and all that is functioning. My problem is a basic one and I’ll try and explain it better.
When I set the plugin to end_year=”2007″, it doesn’t show all the months in 2007. Instead it only shows Jan, Feb, March and April, the same number of months that are in 2008. The URL’s all show the correct year but the number of months is incorrect. end_year=”2007″ should show all months Jan-Dec. However, if I set end year 2008 it shows every year correctly.
Hope my problem makes more sense now. Again, appreciate your help and love the plugin.
Hi Joey. I was able to reproduce your problem. I think you can solve it by explicitly defining the end_month parameter:
end_month="12".Let me know if that works out for you.
AH! So simple :) Thanks so much, really appreciate it. I hope ya a beer!
…”owe” that is, not “hope”.
I’m using your plugin to show a list of just the years with entries and I want to display the number of entries next to the year. From what I can tell {num_entries} only works with month listings. Is what I want to do currently possible?
Hi Jeff, you could probably use the variable
{entries_in_year}for this.Ah excellent, that worked perfectly. I didn’t realize that variable existed. I didn’t see it in the usage info.
One quick question about this plugin:
Is there any way to show all months in a year even if there aren’t any postings in that month. Just show the month number sans archive link? A good example of this can be found here (see footer for example).
Thanks.
Hi Joshua. In fact, the above code example does exactly that. I use almost the same code for my archives, and use css to hide the linkless months. But you can style it any way you want, of course.
I noticed that posts made today (as in the current day) don’t get counted. For example, if I have only one post in June and that post is today June 5 the month link for June doesn’t show up. However if I change the post date to June 4 it does show up. Is this by design or is it a bug?
Hi Jeff. It might be a bug, but I can’t say for sure, since I can’t duplicate it. Are you still having trouble with this?
thanks for this - works just as expected. amazing it’s not core to EE!
I’m trying to use exp:weblog:entries under each month (a list generated with Yearly Archives) to show links links to each entry posted in that month.
I’m trying to use exp:weblog:entries under each month (a list generated with Yearly Archives) to show links to each entry. I’m getting erros with the “month” and “year” parameters in exp:weblog:entries: “Warming: mktime() expects parameter 4 to be long, string given…”
By manually typing in, for example, 2008 and 07 everything’s ok, but using tags generated by this plugin, {year} and {month_num}, I get that error.
I’m able to get around this by embedding the exp:weblog:entries part of the code, but I would like to have this working right in the template where I’m using Yearly Archives.
Timo, I think you’re trying to use the plugin’s output to use as input for the exp:weblog:entries tag, right? But that probably doesn’t work because the latter is parsed before the former. Instead, why not keep the two separate and let EE’s dynamic URLs handle the input for the exp:weblog:entries tag?
THANK YOU THANK YOU THANK YOU THANK YOU THANK YOU
Sorry about that, but your plugin just saved me a massive headache!
Just a quick message to say many thanks for taking the time to create this plugin (which really should be part of EE’s core functions!). It has proved very useful for us and our clients, and i’m sure it will continue to do so. Keep up the good work :)
Hi,
This archive news is organized by the submitting date.
How can i archived my news according to my customfiled (datedropdown in the cms).
Thanks
With this plugin, you can’t — it only uses the entry date. A custom date field is only useful for displaying a custom date. It’s not really possible to do anything else but sorting on that field. Not without a substantial amount of php, anyway.
Hi Low. I’m running EE 1.6.6 build 20081114 and your sample code stop working. I get error:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /var/www/hosts/system/core/core.functions.php(637) : eval()’d code on line 114
The problem is in the {if num_entries > 0} {/if}
When I remove this part of code, plugin start working.
Hi Gabriel. I couldn’t reproduce with the latest build (20081212). Are you using php in your template?
Not, I’m not using php in the template. I will update the latest build 20081212 and I’ll see.
Low, I tried the same code on other server and plugin working perfect. So the problem is on the server side on my webhosting. PHP on webhosting says “PHP Version 5.2.0-8+etch13″. Is there any special requirements to get start plugin working? The error line in core.functions.php contains code:
return eval('?>'.$str.'<?php ');Coul you help me resolve problem?
In addition script start working only if I remove all {if} comparations between {exp:yearly_archives} {/exp:yearly_archives}.
These comparations produce error
{if entries_in_year > 0} {/if}{if num_entries > 0} {/if}
but this one works well
{if leap_year == 1} {/if}Hi Gabriel. I still cannot reproduce your issue. Have you perhaps tried code like
{if num_entries != 0} ... {/if}?Hello,
I’m new to EE, and I’m attempting to make an archive template that shows all the entries for a given year, such that a url like:
domain.com/group/archive/2008
…will show all entries from that year. I don’t understand why EE will only parse the URL dynamically when a month is also appended, or how I could override this after turning dynamic off. Can your plugin assist with this?
Thanks!
Is there a way to assign a limit? For example, I only want to list the 6 most recent months.
@Emily Lewis: I’m afraid not. But you could do something with the
start_monthparameter and php on input, I reckon.Hi Low,
Is there any restriction on the ’start-year’. I’m currently managing a site that uses your plugin, but it does not show items from 1965. (Sounds strange, but it has it’s uses). Is it maybe because you are using UNIX time internally? Easy fix?
thx
Ik heb zelf al ontdekt dat je gebruik maakt van FROM_UNIXTIME om de entry dates op te halen (helemaal prima!). Helaas ondersteunt deze geen negatieve UNIX Timestamps. Ik denk dat ik dit uitzonderlijke geval maar ga ‘hard-coden’ in mn template. Ik zie geen oplossing die meer voor de hand ligt.
For your English readers ;) :
This plugin uses FROM_UNIXTIME in the query, which does not support negative UNIX timestamps. Therefore any entry from before 1970 (which could happen when you use some exotic ways of organising things) will not be shown. So far, I cannot see any solution to this ‘problem’ which is only caused by the limitations of MySQL.
Hi and thanks, this is very helpful. Like eben I am also wondering how to display entries by year only?
Given a url like
domain.com/group/archive/2008, EE will think that ‘2008′ actually is an entry_id, not a year. That’s why you can’t use the regular weblog:entries tag with dynamic=”on” to display entries by year. Instead you should use something like this:{exp:weblog:entries year="{segment_3}" dynamic="off"}Got it, thanks so much!
I have a single entry (which is a pdf) per month, per year. I would like to list each month, grouped under each year as a heading. Each month is the url to the pdf itself. I was using the following code:
<ul>{exp:yearly_archives weblog="{my_weblog}" start_year="1997" start_month="1" status="not closed"
sort="desc"}
<li>
<h5>{year}</h5>
<ul>
{months}
{exp:weblog:entries weblog="{my_weblog}" year="{year}" month="{month_num}" disable="pagination|categories|member_data|trackbacks" dynamic="off"}
<li><a href="/media/pdf/resources/the-journal/{cf_tj_pdf}" title="">{entry_date format="%F %Y"}</a></li>
{/exp:weblog:entries}
{/months}
</ul>
</li>
{/exp:yearly_archives}
</ul>
but it just gives me a blank page. If I understand an earlier comment you made, it is b/c the exp:weblog:entries tag is parsed first, so it doesn’t even know what {year} and {month_num} are.
Is there a way to go about this with this plugin to accomplish what I am trying to do?
@D. Shun-Luoi Fong: nesting tags like that is generally a bad idea. You’ll end up with lots and lots of queries because you’re looping a weblog:entries tag. Performance-wise, that’s a big no-no.
I’d recommend not to use this plugin to display actual entries. Instead, I think you’d be better off using just one weblog:entries tag, along with
{date_heading display="yearly"}(see the docs).How would I your plugin to build a list of years without months?
@wrb: that’s easy, just don’t add the
{months}{/months}variable pair.Like this?
{exp:yearly_archives weblog="{my_weblog}" start_month="1" status="not closed" sort="desc"}{if year_count == 1}<ul>{/if}
<li>
{if num_entries != 0}
<a href="{path={my_template_group}/{my_template}}{year}/" title="{num_entries} entries in {year}">{year}</a>
{if:else}
{month_short}
{/if}
</li>
{if year_count == total_years}</ul>{/if}
{/exp:yearly_archives}
Why not try and find out? :)
I tried and got it to work, thanks! ;)
I just wanted to share a variation on the usage of this excellent plugin. I am using it to show a list of months, but without displaying the year. The reason for this is explained more in my comment on another of Low’s posts, about how to get all entries from a given month, regardless of the year.
Basically it is a blog about seasonal/month specific topics which you might want to browse by month, but wouldn’t need to browse by year.
Essentially I just stripped out any references to the year. I also have a non-linked month item set to be displayed if there are no entries, but this isn’t set to show up until that month of the year has passed.
<h2 id="archives_month">Archives by month</h2>{exp:yearly_archives weblog="woods_pages" status="Published" sort="desc"}
<ul class="yearly_archives">
{months}
{if num_entries > 0}
<li>
<a href="/{segment_1}/month/{month_num}/" title="{num_entries} entries for {month}">{month}</a>
</li>
{if:else}
<li>
{month}
</li>
{/if}
{/months}
</ul>
{/exp:yearly_archives}
Hi Low,
Is there any way to use this plugin with a custom date field?
Not sure if it matters, but I’m listing entries using Solspace’s Date Field Filter plugin.
Thanks!
Aliotsy
Hey aliotsy, I’m afraid not. The plugin uses the entry dates to generate the output.
Hi there,
I just want to have two years displaying in two columns. Is there a way to dynamically assign last years year to the start_year parameter instead of hard coding it?
A display_years parameter would be welcome so I can display for example if I added display_years=”3″ then I would get -
2009
2008
2007
PS. You’re website still says you are 31 ;)
Hey Hambo, if I understand correctly, what you’re really after is something like an ‘offset’ and ‘limit’ parameter for the years to display, right? Guess you could use PHP on output for now. I’ll see if I can add those to the plugin for the 2.0 release. :)
I am trying to figure out how to not show items that are empty. Some of the months in my output have no entries bit the month is still out put. Is there a fix for that? Thanks.
Do not worry I found the line to remove. Thanks.
Hello!
Thank you for your wonderful plugin! However when I’m trying to use it I receive the following error:
Deprecated: Function ereg() is deprecated in C:\xampp\htdocs\vulichenko\system\plugins\pi.yearly_archives.php on line 230
The years list is populated though, but this error does bother me. Could you please comment on this?
Thanks a lot!
I’m using EE 1.6.8, Apache/2.2.12, PHP Version 5.3.0
Hope this info is of any use regarding my problem :)
Hey Lyubov, yeah I figured you were using php 5.3. I’ve replaced the said function, so the error should be history. I’ll upload the new version shortly, but in the mean time, you can grab your copy from GitHub, if you want.
Low, thanks a lot! That was super fast :)
It now works like charm.
Thanks again for your great job.
Low,
I just updated to the latest version of EE 1.6.8 build 20091201 and am now getting an error with this plugin.
When not logged in, it only links to the latest month, but when I am logged in (as superadmin) it displays the following error - between the year and the month)
my template code looks like this and was working prior to updating to build 20091201:
<ul class=“yearly_archives”>
{exp:yearly_archives weblog=“blog” start_month=“1″ status=“not closed”
sort=“desc”}
<li class=“months”>
{if leap_year == 1}<em>{year}</em>{if:else}{year}{/if}
<ul>{months}
{if num_entries > 0}
<li>
<a href=“{path=blog/archive}{year}/{month_num}/”
title=“{num_entries} entries in {month} {year}”>{month}</a>
</li>
{if:else}
<li class=“emptymonth”>{month}</li>
{/if}
{/months}
</ul>
</li>
{/exp:yearly_archives}
</ul>
Hope you can help me out here.
Thank you
Sean
re: above comment - if I remove the archives there is no error on the page at all.
There should be archives back to September but when not logged in it only shows November now - you can view the page at http://repatriate.me
Thank you
Sean, looks like the newest build made some changes to how it handles {if…} statements. I’ll take a closer look as soon as I can.
My hunch was right. I’ll investigate some more, but for now, you can fix errors by changing the if-statements slightly. Instead of
{if num_entries > 0}, use{if "{num_entries}" > "0"}. (and fix the leap year conditional in the same way)Low,
yeah that fixed it. Sorry for taking so long to get back to you on that.
hello I’m using this plugin as well and I found that it doesnt display entries from this (2010) year. It does display however entries from 2008 and 2009. In 2010 I have future and past entries which are missing as I said in the results. I’m using
{exp:yearly_archives weblog="{wb}" sort="asc" show_expired="yes" show_future_entries="yes"}
<li> <a href="{path='{tg}/view'}">{year}</a></li>
{/exp:yearly_archives}
When using the {months}{/months} tags pair, is there any way to ONLY display those months where entries exist?
Looks like I answered my own question:
//
//Display only months where entries exist
//
{exp:yearly_archives weblog=“gallery” start_month=“1″ status=“not closed” sort=“desc”}
{if “{year_count}” == “1″}<ul>{/if}
<li>
{year}
<ul>
{months}
{if “{num_entries}” != “0″}<li>
<a href=“{path=blog/archive}{year}/{month_num}/” title=“{num_entries} entries in {month} {year}”>{month_short}</a>
</li>
{/if}
{/months}
</ul>
</li>
{if “{year_count}” == “{total_years}”}</ul>{/if}
{/exp:yearly_archives}
Great plugin! Any way to have the archives loop paginate?
Andrew, there is no pagination natively. The only way I can think of, is by setting the start_year and end_year parameters manually.
Thanks for the quick response,
I’ll let you know if we come up with a good solution to this. Thanks again and keep up the great work!
Hi Low,
I’m getting really odd behaviour on an MSM site. I only have 1 entry in the news channel but the yearly pluging is reporting -
Apr - 9 articles
Mar - 25 articles
Feb - 26 articles
Jan - 26 articles
I have no idea where it’s counting these article!
My code is -
{exp:yearly_archives weblog=“news” start_month=“1″ end_month=“12″ start_year=“{current_time format=”%Y“}” monthsort=“desc”}
<li>
{year} - {entries_in_year}
<ul>
{months}
{if num_entries != 0}
<li><a href=“{path=news/archive}{year}/{month_num}”>{month_short} (“{num_entries}” article{if num_entries != 1}s{/if})</a></li>
{/if}
{/months}
</ul>
</li>
{/exp:yearly_archives}
It seems to be picking up news weblogs across all sites.
SELECT FROM_UNIXTIME( entry_date, ‘%Y%m’ ) AS ym, COUNT(*) AS num_entries FROM exp_weblog_titles t INNER JOIN exp_weblogs w ON t.weblog_id = w.weblog_id WHERE 1 AND ( expiration_date = 0 OR expiration_date > UNIX_TIMESTAMP() ) AND entry_date < UNIX_TIMESTAMP() AND status = ‘open’ AND blog_name = ‘news’ GROUP BY ym ORDER BY ym ASC
Perhaps a site parameter is in order?
SELECT FROM_UNIXTIME( entry_date, ‘%Y%m’ ) AS ym, COUNT(*) AS num_entries FROM exp_weblog_titles t INNER JOIN exp_weblogs w ON t.weblog_id = w.weblog_id WHERE 1 AND ( expiration_date = 0 OR expiration_date > UNIX_TIMESTAMP() ) AND entry_date < UNIX_TIMESTAMP() AND status = ‘open’ AND blog_name = ‘news’ AND t.site_id = ‘32′ GROUP BY ym ORDER BY ym ASC
Steven, I’ve updated the plugin so it now supports a site_id parameter. Does that help?
Awesome thanks Low! I’ll test this later.
PS. Thanks for the name edit ;)
Valdo is correct. This doesn’t seem to work with the year 2010 for some reason.
Is there a problem with 1.6.9? I just get -
{YEAR_SHORT}
{/year} {year}
Disregard my last post. Work fine :)
Low, I inherited a site that uses this plugin. I am trying to get it to limit the years to 2010-2008. The site is EE 1.6.8 but your plugin is the latest (1.6). The code I have is:
{exp:yearly_archives weblog=”news” start_year=”2010″ status=”not closed” end_year=”2008″ sort=”desc” show_expired=”yes”}
{if entries_in_year > 0}
<h3>{year}</h3>
<ul class=”archivelist”>{months}
<li>
{if num_entries > 0}
{month}
{if:else}
{month}
{/if}
</li>{/months}
</ul>
{/if}
{/exp:yearly_archives}
But it is still outputting the 2006-2007 years as well. What am I missing?
Hey Marcus,
Can you try reversing start_year and end_year? So:
start_year="2008" end_year="2010"Low, sorry bout that. I must have been editing the wrong file on the server. Scratch one up to a lack of coffee this morning. It works as you designed. Thanks for the help!
Low, i have query at my database of MSSql 2000 server using PHP 5+ and Apache 2 Server
the example value is “Jul 3 2010 12:00:00:000AM”;
<?php
$DOCDATE = “Jul 3 2010 12:00:00:000AM”;
$result = strftime(”%m/%d/%Y”, strtotime($DOCDATE));
echo $result;
//the result is 01/01/1970
//i want a result of 07/03/2010
?>
before, i use an old version of PHP and FreeTDS it works fine! now i don’t know what is
hope u help me!
Gildebrando, your question has nothing to do with ExpressionEngine, so I suggest you look for help at more appropriate channels.