Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
News Manager Archive
#1
Could anyone point me in the right direction as to adding a 'archive' function to the news manager plugin.

I need it to list the months posts were posted in, upon clicking on a month it lists the posts posted in that month.

I am getting close but cannot figure it out.
Reply
#2
Wouldn't it be better to use a pattern for news files, like: news-year-month-day-ID as I suggested in newsmanager thread ?
This way you'd be able to scan whole news directory, push the output to an array, and for month==current echo array[2] Smile

I feel there's a way simper solution, but I'm not a php mastah Wink

ps. caching all data would be also great.
Addons: blue business theme, Online Visitors, Notepad
Reply
#3
yojoe Wrote:Wouldn't it be better to use a pattern for news files, like: news-year-month-day-ID as I suggested in newsmanager thread ?
This way you'd be able to scan whole news directory, push the output to an array, and for month==current echo array[2] Smile

I feel there's a way simper solution, but I'm not a php mastah Wink

ps. caching all data would be also great.

Thanks for your input, if noone suggests any better method I will give that a shot.
Reply
#4
Is this the sort of thing your looking for?
I use this for a different CMS but don't see why it should't work with your News manager.
Just make sure $results is an array of dates.

Then just change the HREF to a search page that returns the articles your looking for.

mike...


Code:
<ul>
<?php
$months=array("January","February","March","April","May","June","July","August","September","October","November","December");
$results= your array of dates from your pages;
$dates=array();
foreach ($results as $item){
    $d_var=explode("/",date($item));    
    $year=    $d_var[2];  
    $month=    $lmonths[$d_var[0]-1];
    @$dates[$year][$month]+= 1;
    
}
foreach ($dates as $year=>$months){    
    foreach($months as $mon=>$num){
        echo "<li><a href='#' title='{$num} Articles'>{$mon} {$year}</a></li>";
    }    
}
?>
</ul>
My Github Repos: Github
Website: DigiMute
Reply
#5
n00dles101 Wrote:Is this the sort of thing your looking for?
I use this for a different CMS but don't see why it should't work with your News manager.
Just make sure $results is an array of dates.

Then just change the HREF to a search page that returns the articles your looking for.

mike...


Code:
<ul>
<?php
$months=array("January","February","March","April","May","June","July","August","September","October","November","December");
$results= your array of dates from your pages;
$dates=array();
foreach ($results as $item){
    $d_var=explode("/",date($item));    
    $year=    $d_var[2];  
    $month=    $lmonths[$d_var[0]-1];
    @$dates[$year][$month]+= 1;
    
}
foreach ($dates as $year=>$months){    
    foreach($months as $mon=>$num){
        echo "<li><a href='#' title='{$num} Articles'>{$mon} {$year}</a></li>";
    }    
}
?>
</ul>

Awesome! Ill give this a try, thanks for your help.

On another completely unrelated note, how is your custom fields plugin going? I cannot seem to find the repository for it, and you removed the link from your footer.
Reply
#6
Tks,

its still there at

http://code.google.com/p/gs-customfields/

Latest version adds a datepicker, imagepicker (GS V3.1) and a new feature to have different page fields for different page types... Also started adding editing/adding fields ala the i8ln one... 8)

Been working less on it lately while I've been working on the shortcodes plugin, demo site here http://gs.digimute.com.

Want to finish that for a site I'm working on then I can concentrate on CustomFields again.

M
My Github Repos: Github
Website: DigiMute
Reply
#7
n00dles101 Wrote:Tks,

its still there at

http://code.google.com/p/gs-customfields/

Latest version adds a datepicker, imagepicker (GS V3.1) and a new feature to have different page fields for different page types... Also started adding editing/adding fields ala the i8ln one... 8)

Been working less on it lately while I've been working on the shortcodes plugin, demo site here http://gs.digimute.com.

Want to finish that for a site I'm working on then I can concentrate on CustomFields again.

M

Quote: have different page fields for different page types.

thanks, that will be very useful.

By the way, the pathes for the images in the left column on the demo link you supplied are localhost.

In the short codes plugins is there a way you would easily be able to add buttons in ckeditor to place the shortcodes?
Reply
#8
Cheers Mike, sorted that out.

Forgot to say just add '&shortcodes=off" to any of the pages to see the actual content before conversion.

Yeah CKeditor is causing me a lot of problems with added <p> & <div> tags all over the place which is giving so many errors in the final code. So at the moment it working with the editor turned off.

Just need to work out how to remove all the extras code CKE puts in and its good to go...


M
My Github Repos: Github
Website: DigiMute
Reply
#9
n00dles101 Wrote:Yeah CKeditor is causing me a lot of problems with added <p> & <div> tags all over the place which is giving so many errors in the final code. So at the moment it working with the editor turned off.

Mike, can you try to set the editor options,
see here:

Enter Mode: Paragraphp or LineBreak?

http://get-simple.info/wiki/how_to:wysiw...or_options

maybe set all to BR?
|--

Das deutschsprachige GetSimple-(Unter-)Forum:   http://get-simple.info/forums/forumdisplay.php?fid=18
Reply
#10
Thanks Connie,

Great Wiki article by the way... saw it a while ago very impressed....

Tried both of those setting already, and still gave me problems.

To be honest gave up on trying as I wanted to get the core plugin working first and then I'd work out the CKEditor problems.

Will try again once I've ironed out the last few bugs...

Tks,
Mike...
My Github Repos: Github
Website: DigiMute
Reply
#11
n00dles101 Wrote:To be honest gave up on trying as I wanted to get the core plugin working first and then I'd work out the CKEditor problems.

Will try again once I've ironed out the last few bugs...

Tks,
Mike...

Hello Mike, I think there will be a solution for this..
maybe a plugin or so

I am still not ready with the editor-wiki-pages, maybe I come along some info related to your problem

if so, I will note here, ok?
|--

Das deutschsprachige GetSimple-(Unter-)Forum:   http://get-simple.info/forums/forumdisplay.php?fid=18
Reply
#12
mikeh, archives are now supported in the new version of the News Manager plugin. Check it out.
Reply




Users browsing this thread: 1 Guest(s)