I would like to have a second Stories Archive module. In this one, I'd like the archive to be laid out just like the front page, except you see the entire month instead of the latest articles.
I currently do this manually by copying the front page code. Here is one of my current archive pages:
Only registered users can see links on this board! Get registered or login to the forums!
I would like this to auto-generate to make my life much easier. I still want to keep the original stories archive and just have two formats to choose from.
Any chance anyone's had a chance to ponder this? I really think it would be a great module once it is made. I think it would be a merge of the news and archives module. But, I think it's beyond my scope to create this.
Joined: Mar 11, 2007 Posts: 1536 Location: North Carolina
Posted:
Mon Sep 14, 2009 6:14 pm
I have something I have been planning for the archives module. It will be a box over for the story title. When you mouse over it, it will display the article in a box. It is not quite what you were talking about, but it is similar.
That does sound like an improvement on the current archives module. I'd definately use it. As it is, I still plan on using both archives modules since they both offer very useful formats.
That's not a bad alternative. I was looking at the index file for the news archives and it looks like maybe if I can edit what happens after you click on the 'month' you want to see I might be able to do this fairly easily. The function 'show month' seems to be where I would edit. My question is how does the front page news call your theme file 'story_home.html'. I think this is the key. If can get it to do that then I don't see why I wouldn't be able to change the echo code to pull up the full front page text instead of just the headline.
Joined: Mar 11, 2007 Posts: 1536 Location: North Carolina
Posted:
Tue Sep 15, 2009 9:23 am
Here is the show month function from the archives index.php that has the home text added below the title link. You should be able to compare it to the news index.php and make it look like you want it to.
Well your tips paid off! I was able to modify the stories_archive module and create a new one (archives). I've got it about 98% where I want it. The only stumble I've run into is getting the 'morelink' to show up. For some reason it does not. Here's my function so far:
1. My author is not coming up. It says "Posted by" and then it's blank
2. The 'morelink' is not showing up.
I've tried to figure out what is missing that it is not calling these two bits of data, but I can't figure it out. I've compared it to the news index but I'm not seeing what I'm missing.
Joined: Mar 30, 2006 Posts: 2456 Location: Pittsburgh, Pennsylvania
Posted:
Thu Sep 17, 2009 8:56 am
One problem I see is that in you SQL statement you are no longer slecting the aid and informant.
Code:
$result = $db->sql_query('SELECT sid, catid, title, hometext, time, comments, counter, topic, alanguage, score, ratings from '.$prefix.'_stories WHERE time >= \''.$year.'-'.$month.'-01 00:00:00\' AND time <= \''.$year.'-'.$month.'-31 23:59:59\' order by sid DESC');
Good catch. I missed that. The 'posted by' problem is now fixed.
On the front page I have the code tweaked so that it shows the 'readmore' link only if there is information on the article page. Otherwise, it is not put in the front page post. Perhaps something is not going right with this in the archives module and it is dropping it for all of them.
I'll try to 'roll back' that code so that it puts it on all articles again to see if I can at least get it to show up period.
OK, I've narrowed it down to the tweak I made for the front page.
Previously, I replaced this:
Code:
if ($fullcount > 0 OR $c_count > 0 OR $articlecomm == 0 OR $acomm == 1) {
with this:
Code:
if ($fullcount > 0 ) {
And that made the link go away whenever there was no article text. When I change it back I get the 'read more' link on every article again. My guess is that the above variables are not defined in this function. I will look into it some more...
It seems the problem is with the $articlecomm variable. If I include it, all of the 'read more' links show up, without it none of them do. I'm not sure how to change this to make only the ones with bobytext show the link. It works just fine for the front page news, but the archives it doesn't seem to want to do it.
View next topic View previous topic
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum