I redid and reworked the Nicer Archives for WordPress. The archives list can be sorted by date and category and filtered by author and year. All of the functions, as far as I tested, are working.
The example archives are here:
http://mindfulmusings.net/weblog/narchives.php
Download php file from here:
http://weblogtoolscollection.com/b2-img/narchives.phps
The install is really simple. Just rename the downloaded file to narchives.php and copy it to the root of your blog and create a link from your index.php.
Hi!
I’m trying to download the narchives.phps file, but when I download it, all I get is a file with a ton of br and font tags… It seems that formatting has been applied to the PHP script. Is there any other way I can get the script?
Thanks a lot!
The code should be covered in
tags etc. I am not sure what you are looking at. However, if after you copy and paste the code, it still does not work, I will send you the code in another format.
Hi!
Here’s a snippet of the code that I get when I try and get the page source for the .phps file (I get the same downloading it with wget and then viewing it):
`<?php require('wp-config.php'); $single = 1; $siteurl = get_settings('siteurl'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head profile="http://gmpg.org/xfn/1">`
There are br and font tags everywhere, which seem to interfere with the actual PHP code. (I enclosed the code in backticks… Hopefully that works.)
Any ideas?
Thankyou very much!
Ummm… OK, that IS weird. There were br and font tags everywhere when I pasted it. Something must have happened to it when I posted the comment. Is there any chance I could get someone to email a plaintext copy to me?
Thanks!
Hi I’ve installed this and it’s been working fine. However, it recently changed it’s behavior.
It used to be that when I loaded the nice archive, I got a list of all the site’s posts and the menus to sort/select them. Now when I load it, it shows no posts until I select and sort. And it won’t show “all years,” only one or the other of the years in my archive.
Any ideas about what might have caused this change?
Hi there, your archive will not read my CSS file, it just displays the information as a normal page without even looking at my CSS.
HELP! I would really like to implement your plugin.
Thanks
Are you sure you are putting it in the right place?
This is a great script thanks !
Hi,
Thanks for a great hack that is easy to install.
I would like to change the order within a category by name. At the moment when I filter by category there doesn’t seem to be any discernible order, not date, name or post ID.
I’ve looked throught the code but am not smart enough to know where to look.
The exact code is here:
http://www.planetphillip.com/narchives.phps
TIA
Phillip
This script is great. Got a question though. How can I set it so sort by category is the default. I tried changing the $defaultorderby but it did nothing. thanks in advance
Hi there,
I know you don’t have to provide any support for this hack, But I was wondering if you could let me know why this error message keeps apperaring when I try to view narchives.php
Fatal error: Cannot redeclare show_year_select() (previously declared in /home/softalie/public_html/narchives.php:59) in /home/softalie/public_html/narchives.php on line 58
I have been trying to re skin the plugin (To no avail it appears).
Any ideas what would cause this error? (Clearly my messing around has caused this, I just don’t know what I could have done).
Thanks very much.
Oliver
Very nice – but there’s a bug, and I don’t know how to fix it. I’ve been all over the code but I can’t find where to insert the relevant clause (AND where $date < $today): If you select Category and set the year to the current one (2005, right now) you get as yet unpublished articles. This does not happen with Title or Date. (It's not relevant if you don't write posts in advance, but it's a show-stopper if you do.) Next, there's only one author for my blog. Commenting out the relevant author_select function and function calls is easy - but perhaps this could be made into an option? A smaller bug: changing the $defaultorder = 'DESC'; to $defaultorder = 'ASC'; doesn't work, that is, the default sort order remains DESC. (That's not the browser cache - I tried it with Moz and Firefox.) (And I'd really like the "title" to show the short post blurb (wp_posts.post_exerpt) instead of repeating the post title, but that's a very minor thing.) Many thanks for this plugin, minor faults and all!
… that got cut off. The bug is: if you have as yet unpublished posts, they get shown if you select category and current year (2005, right now). It’s of no consequence if you don’t write things in advance, but it’s a showstopper if you do – and I can’t find where to insert that “and where $date smallerthan $today”.
A minor bug, as posted earlier: changing the defaultorder to ‘ASC’ doesn’t work.
An even smaller niggle: I have no need for the author select (and in fact it shows all registered blog users … not just authors). It’s easy to comment out the author_select function and function calls, but perhaps showing author_select at all should be an option, not a default thing?
And a very minor niggle: I’d like the “title” (the mouseover hint) for a post to show wp_posts.post_excerpt, not a repeat of the post title.
Thanks for a nice script, minor bugs and all!
… ended up using podz’ narchives2.php, here: http://wordpress.org/support/topic.php?id=15653
Thanks!
BUG
On my site at http://www.cameraontheroad.com.....chives.php I’m having a very strange bug. When nice archives is sorted by date, everything is fine, but when I sort by category (only change to sort), look under category “life on the road” and there begins a bunch of duplicate entries for the same post. Life on the Road is the default category and I’ve triple-checked and these are only single posts (no duplicates) and they are listed without duplicates when sorted by date. Not every post is duplicated, so maybe there is something about these individual posts, but I can’t find anything. No special keys, nothing. Ideas?
Are they in more than one category? If they are, they will show up uynder both categories.
Hi there,
I am trying to find way to change the defaults on this. I’d like Catagory and ASC to be the default sort options.
I’ve seen plenty of messages all over the place that talk about how to change these defauts but I’ve found nothing that actually conclussively describes how to do it in a way that works.
Can you tell me how? Would certainly appreciate it.
Thanks
Find these lines in the narchives.php file:
<code>
//Make sure categories get parsed out, they are deprecated in wp-blog-header.php
if ($_POST[“orderby”] == ‘category’) {
global $author, $m;
$orderby = ‘category’;
if ($_POST[“order”] == ”) $order = “DESC”;
</code>
and reaplce them with:
<code>
//Make sure categories get parsed out, they are deprecated in wp-blog-header.php
if ($_POST[“orderby”] == ”) $_POST[“orderby”] = ‘category’;
if ($_POST[“orderby”] == ‘category’) {
global $author, $m;
$orderby = ‘category’;
if ($_POST[“order”] == ”) $order = “ASC”;
</code>
Hi
I have added a call to my sidebar (that I would like to have on the left side) as the second statement in the narchives.php body:
this produces the folowing warning at the top of the narchives.php, otherwise narchives works fine:
Warning: extract() [function.extract]: First argument should be an array in
wordpress/wp-includes/functions.php on line 1733
This is the relevant line from functions.php:
extract($wp_query->query_vars);
require_once($file);
}
Additionally, entries where I have edited the post date or are deleted also show up on the narchies page. How can I get rid of them?
Any help is very much appreciated!
That wasn’t the issue. Having the same post show up twice in the same category is different than having one post in different categories. It is still doing the same thing. Hasn’t been fixed yet.
I’m upgrading everything to 1.5 and the version for that, narchives2, is working fine. Very odd.
Tried this several times and couldn’t get it to work. Any other ideas? I’m using on version 2 of nicer archives.
not sure what I did wrong… followed the directions, but just get a page of code…
http://www.atmasphere.net/wp/narchives.phps
I am so sorry! I should have been more clear and I will fix the tutorial. Rename the dowloaded file to narchives.php and go from there. 🙂 sorry again
Firebird added a bunch of HTML codes to narchives.phps when I chose “save link to disk” :???:, had to copy and paste to a new file (narchives.php) manually.
Hope that helps.
OK – Did that… still getting code displayed… 😥
http://www.atmasphere.net/wp/narchives.php
You’ve got mail. 🙂
I can’t seem to get past the following output:
Fatal error: Failed opening required ‘blog.header.php’ (include_path=’.:/usr/local/lib/php’) in /nethome/www/justkristin/narchives.php on line 3
Where did I go wrong? Thank you for this great script,
and for helping with it. 🙂
Mark, I have the same problem as Jonathan.
Actually, my install works now. No idea how I changed it, though. Now I am only having the ascending sort issue (random). thank you for a wonderful plugin!
Sorry I am not coherent enough to keep all my stuff in one comment. 🙂 I just realized what is messing up the sort – either way, now that I look at it. The few posts that have titles beginning with some kind of special character get sorted by the character…
I’d offer a solution if the thing were in Perl, but I am hopelessly lost in PHP land. Is there some way to use regexp to parse out non-alpha characters at the beginning of the string?
copy and pasting the code solved my problem. Thanks Siuyee
I’m getting this error:
Parse error: parse error, unexpected T_VARIABLE in /home/public_html/narchives.php on line 42
Geoff,
Right click on the phps file and save it as a .php file. There should not no parse error at line 42.
I have a problem with the date sort. It will only show the month of December for descending sorts and only show the month of January for ascending sorts. Any ideas? Thanks for the nicer archives and thank is advance for any help.
If I use narchives & post per page plugin (http://rephrase.net/miscellany/05/perpage.phps ) together narchives reports the following error:
WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘-1’ at line 1]
SELECT DISTINCT * FROM wp_posts WHERE 1=1 AND post_date_gmt
If I use narchives & post per page plugin (http://rephrase.net/miscellany/05/perpage.phps ) together narchives reports the following error:
WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘-1’ at line 1]
SELECT DISTINCT * FROM wp_posts WHERE 1=1 AND post_date_gmt ‘2005-02-27 14:04:59’ AND (post_status = “publish”) GROUP BY wp_posts.ID ORDER BY post_date DESC LIMIT 0, 5-1
If I deactivate post per page plugin narchives works fine. This is the only thing I change. Can anyone help?
Thanks
You seem to have a profound understanding on the powers of the Sort. What is the easiest way to change my archive page to always sort by alpha of title of post.
Currently using WP 1.5.
Running WP as a really simple CMS and if I can solve this little problem, I’m golden.
Any help would be REALLY appreicated, I’m busting head trying to figure out how to do something really easy. Can’t believe this isn’t a standard option.
I am having the same problem with the weird “-1 at line 1” error and also use the post per page plugin. Had not thought about that being the culprit. Wish someone had figured out the problem not sure I am capable.
This is a great program, but seems to have a lot of sorting bugs; ascending/descending are mixed up, sorting by date leaves out many entries, etc. Is the author alive? I’d love to fix these problems 🙁
It occurs to me this might be an issue with using permalinks. Possible?
Is the dev alive?
Howdy all,
How do I make narchives sort by title as default instead of by date? I tried experimenting by changing $defaultorderby = ‘post_date’; to post_title but that obviously didn’t work (I just tried guessing since I don’t do any programming).
If you know the answer please send me an email at http://www.andrebell.com/contact.html or post here if weblogtools automatically notifies of replies.
Thank you very very much!!!
btw, I’m using narchives at http://www.economicbooster.com/blog/narchives.php
After fixing the css path and adding the get header/footer functions my sitemap looks like any other part of my site except… along the top is a warning.
Warning: extract(): First argument should be an array in /www/a/archshrkcom/htdocs/wp-includes/functions.php on line 1813
But I don’t know what’s wrong. Any thoughts?
Hi there. Is it possible to change what the default sort is? Namely, I’d like it to show everything sorted by category by default. The user can then change it from that if they wish.
Also, does this support WP1.5.x theming? I have the default Kubrick theme and want to insure this will use that.
Thanks…Jonathan
I can’t seem to figure out how to have the archives appear on a page formatted like my theme. Narchives appears to “break” it. I have tried many things including the default installation & also changing the wp-layout.css to the path of my theme’s css. Neither work.
Look here: http://www.thebellsite.com/blog/narchives.php
If you’ve got ideas or suggestions drop me a line at jbell2k@hotmail.com – Thanks!
I have used Sortable Nicer Archives for a long time. It works well in WP 1.*. But after upgrade to 2.0, it returns some errors:
——————
WordPress database error: [Unknown column ‘user_level’ in ‘where clause’]
SELECT * FROM wp_users WHERE user_level > 0
Warning: Invalid argument supplied for foreach() in /home/…/archives.php on line 74
——————
The related codes are:
——————
function show_author_select() {
global $wpdb, $tableusers, $author;
$users = $wpdb->get_results(“SELECT * FROM $tableusers WHERE user_level > 0“, ARRAY_A);
$output .= ‘All Authors’.NL;
foreach ($users as $user) {
$output .= ”.$user[‘user_nickname’].”.NL;
}
$output = ”.NL.$output.”.NL;
echo $output;
}
——————
Can Mark or anybody help me to solve this problem?
Thank you!
WordPress database error: [Unknown column ‘user_level’ in ‘where clause’]
SELECT * FROM wp_users WHERE user_level > 0
Warning: Invalid argument supplied for foreach() in /home/nic10001/public_html/investmentoption.org/blog/narchives.php on line 89
Take a look:
http://www.investmentoption.org/blog/narchives.php
Can you fix this? It works fine in wordpress 1.5.2 but when I upgraded
to 2.0 this is the problem I get.
I’m trying to setup narchives.php on 1riccie.com/ideas (so a link to it appears in the sidebar.php). I’m a novice and would like to ask for more detailsa about how to include a link to /narhives.php from index.php (or sidebar.php). I’ve searched all over wordpress for instructions and have had no success. Hope you can please help!
If you just want to sort posts in category view by title rather than by date, then here’s a quick and easy way to do that:
mikesmullin.com/2006/05/23/wordpress-plugin-sort-category-posts-by-title/
So, was narchives ever upgraded for WordPress 2.x?
So, was narchives ever upgraded for WordPress 2.x?
Hi there, your archive will not read my CSS file, it just displays the information as a normal page without even looking at my CSS.
HELP! I would really like to implement your plugin.
Thanks
I’m trying to setup narchives.php on 1riccie.com/ideas (so a link to it appears in the sidebar.php). I’m a novice and would like to ask for more detailsa about how to include a link to /narhives.php from index.php (or sidebar.php). I’ve searched all over wordpress for instructions and have had no success. Hope you can please help!
Thanks for a nice script, minor bugs and all!
I am having the same problem with the weird “-1 at line 1? error and also use the post per page plugin. Had not thought about that being the culprit. Wish someone had figured out the problem not sure I am capable.
It occurs to me this might be an issue with using permalinks