PHP Web Host - Quality Web Hosting For All PHP Applications Sign up for PayPal and start accepting credit card payments instantly
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
razor
New Member
New Member


Joined: Oct 14, 2005
Posts: 22

PostPosted: Tue Oct 31, 2006 5:18 am Reply with quote Back to top

I'm looking for a block or help creating a block that will display all the months, just like seen in the Stories_Archive module... Ty for any help
View user's profile Send private message
gregexp
The Mouse Is Extension Of Arm


Joined: Feb 21, 2006
Posts: 1497
Location: In front of a screen....HELP! lol

PostPosted: Tue Oct 31, 2006 1:31 pm Reply with quote Back to top

Display all the months?

Like a block that has:

January
February
.....
November
December

?
I just want to clarify.
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
razor
New Member
New Member


Joined: Oct 14, 2005
Posts: 22

PostPosted: Tue Oct 31, 2006 5:21 pm Reply with quote Back to top

Yeah, should look like this in the block...

* November, 2006
* October, 2006
* September, 2006
* August, 2006
* July, 2006
* June, 2006
* May, 2006
* April, 2006
* March, 2006
* February, 2006
* January, 2006
View user's profile Send private message
gregexp
The Mouse Is Extension Of Arm


Joined: Feb 21, 2006
Posts: 1497
Location: In front of a screen....HELP! lol

PostPosted: Tue Oct 31, 2006 9:10 pm Reply with quote Back to top

Do they need to point to something? Like archives or something, basically, do they need to be linked?
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
razor
New Member
New Member


Joined: Oct 14, 2005
Posts: 22

PostPosted: Tue Oct 31, 2006 11:17 pm Reply with quote Back to top

Yeah just like when click Stories Archive in the modules/navigation block, how they show all the months in there... I need the block to link all the news stories to that month just like the stories archive module...
View user's profile Send private message
razor
New Member
New Member


Joined: Oct 14, 2005
Posts: 22

PostPosted: Tue Oct 31, 2006 11:45 pm Reply with quote Back to top

If you go to
Only registered users can see links on this board!
Get registered or login to the forums!
on the left they have the block called Stories Archive... thats the block i'm looking for...
View user's profile Send private message
razor
New Member
New Member


Joined: Oct 14, 2005
Posts: 22

PostPosted: Thu Nov 09, 2006 1:02 am Reply with quote Back to top

lol anyone have any ideas?
View user's profile Send private message
montego
Site Admin


Joined: Aug 29, 2004
Posts: 9136
Location: Arizona

PostPosted: Thu Nov 09, 2006 6:34 am Reply with quote Back to top

I suggest that you create your own block. Take the block-Old_Articles.php as your example from a block structure standpoint, but use the code from function select_month() within modules/Stories_Archive/index.php.
View user's profile Send private message Visit poster's website
razor
New Member
New Member


Joined: Oct 14, 2005
Posts: 22

PostPosted: Thu Nov 09, 2006 8:43 pm Reply with quote Back to top

Alright this took me a bit but i got it coded to work... anyone else who needs this block heres the code for it... Thanks all for your replies.

Code:
<?php
if (stristr($_SERVER['SCRIPT_NAME'], "block-Stories_Archive.php")) {
    Header("Location: ../index.php");
    die();
}

global $prefix, $user_prefix, $db, $module_name;
   
    $result = $db->sql_query("SELECT time from ".$prefix."_stories order by time DESC");
    $content = "<ul>";
    while($row = $db->sql_fetchrow($result)) {
   $time = $row['time'];
   ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})", $time, $getdate);
   if ($getdate[2] == "01") { $month = _JANUARY; } elseif ($getdate[2] == "02") { $month = _FEBRUARY; } elseif ($getdate[2] == "03") { $month = _MARCH; } elseif ($getdate[2] == "04") { $month = _APRIL; } elseif ($getdate[2] == "05") { $month = _MAY; } elseif ($getdate[2] == "06") { $month = _JUNE; } elseif ($getdate[2] == "07") { $month = _JULY; } elseif ($getdate[2] == "08") { $month = _AUGUST; } elseif ($getdate[2] == "09") { $month = _SEPTEMBER; } elseif ($getdate[2] == "10") { $month = _OCTOBER; } elseif ($getdate[2] == "11") { $month = _NOVEMBER; } elseif ($getdate[2] == "12") { $month = _DECEMBER; }
   if ($month != $thismonth) {
       $year = $getdate[1];
       $content .= "<li><a href=\"modules.php?name=$module_name&amp;sa=show_month&amp;year=$year&amp;month=$getdate[2]&amp;month_l=$month\">$month, $year</a>";
       $thismonth = $month;
   }
    }
    $content .= "</ul>"
   ."<br><center>"
   ."[ <a href=\"modules.php?name=$module_name&amp;sa=show_all\">Show All</a> ]</center>";

?>
View user's profile Send private message
montego
Site Admin


Joined: Aug 29, 2004
Posts: 9136
Location: Arizona

PostPosted: Fri Nov 10, 2006 6:09 am Reply with quote Back to top

Most excellent!

For those who are using the 3.x patches from Chatserv, you would want to replace this:

Code:

if (stristr($_SERVER['SCRIPT_NAME'], "block-Stories_Archive.php")) {
    Header("Location: ../index.php");
    die();
}


with this:

Code:

if ( !defined('BLOCK_FILE') ) {
   Header('Location: ../index.php');
   die();
}
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum