Zikula: A Flexible Open Source Content Management System
home | forum | international support | contact us

Support Forum

Start ::  PostNuke 0.7 Support ::  Tutorials and Solutions ::  Solving the ephemerids problem

Moderated by: Support Team

Goto page : 1 | 2 Next Page
Bottom
Solving the ephemerids problem

  • Link to this postingPosted: 10.09.2003, 21:43
    Profile Homepage
    Duster
    rank:
    Professional Professional
    registered:
     July 2003
    Status:
    offline
    last visit:
    20.06.04
    Posts:
    807
    The one problem with Ephemerids is that the text "On a day like today" shows up even when there are no entries for a date. Because I think that doesn't look right, I haven't enabled ephemerids on my site. I only have a dozen or so out of the 365 days in a year.

    Last night while falling off to sleep the solution hit me. Edit the ephemerids file, delete that text and make reference to "On this date" in the ephemerid entries themselves.

    The text is found in the file includes/language/blocks/eng/ephem.php

    -----
    Yes, I have checked the pnGuide and done a search on the forums before posting my question.
    PN Guides for Beginners
    How To Find Answers and Ask Questions
  • Link to this postingPosted: 11.09.2003, 21:09
    Profile Homepage
    Duster
    rank:
    Professional Professional
    registered:
     July 2003
    Status:
    offline
    last visit:
    20.06.04
    Posts:
    807
    One thing I noticed io that in themes with the blocks bordered by graphics, you still get an empty block, which is also not desirable. The ideal solution would be for the ephemerids block not to appear on dates there are no entries.

    I also realized that there is no need to edit the ephemerids to indicate anything like "On this date" It's simple enough that most people will realize the significance of it. It is quite superfluous after all.
  • Link to this postingPosted: 22.11.2003, 01:41
    Profile Homepage
    nate_02631
    rank:
    Professional Professional
    registered:
     September 2003
    Status:
    offline
    last visit:
    11.04.08
    Posts:
    3055
    Hi D-Man

    Perhaps a better solution would be to change the bottom of the "includes/blocks/ephem.php" file to :

    Code
    while(list($yid, $content) = $result->fields) {

            $result->MoveNext();
            $boxstuff .= '<br /><br />';
            $boxstuff .= '<b>'.pnVarPrepForDisplay($yid).'</b><br />'.pnVarPrepHTMLDisplay(nl2br($content)).'';
            $content_match = 1;

            }
           
        if (!$content_match) {
            return;
        }                  
           
        if (empty($row['title'])) {
            $row['title'] = _EPHEMERIDS;
        }
        $row['content'] = $boxstuff;
        return themesideblock($row);
    }


    Then the block wouldn't display at all when no events are listed for that day. (Basically added a $content_match flag in the while statement and did a check for it just after -- doesn't retain the value of $content outside the loop for some reason.)
    -----
    Get PhotoGallery, PayPalCart, Dynamenu, Enhanced Blocks & other mods

    Cape Cod Travel Info...
  • Link to this postingPosted: 23.11.2003, 04:23
    Profile Homepage
    Duster
    rank:
    Professional Professional
    registered:
     July 2003
    Status:
    offline
    last visit:
    20.06.04
    Posts:
    807
    Thanks, Nate. I had made the suggestion months ago to add that very same feature to ephemerids (not display at all if there were none). This certainly represents the ideal solution.
  • Link to this postingPosted: 16.01.2004, 02:15
    Profile Homepage
    D-Day
    rank:
    Freshman Freshman
    registered:
     November 2003
    Status:
    offline
    last visit:
    29.09.04
    Posts:
    8
    Thanks, Nate. Works Perfectly.
  • Link to this postingPosted: 26.01.2004, 03:15
    Profile Homepage
    PuddySpace
    rank:
    Softmore Softmore
    registered:
     January 2004
    Status:
    offline
    last visit:
    09.11.04
    Posts:
    85
    Can someone tell me where exactly in the ephem.php doc this goes as im not a techy or a code writer ?
  • Link to this postingPosted: 26.01.2004, 05:26
    Profile Homepage
    nate_02631
    rank:
    Professional Professional
    registered:
     September 2003
    Status:
    offline
    last visit:
    11.04.08
    Posts:
    3055
    Look at the script under includes/blocks towards the bottom - should be fairly clear one you check it out. icon_smile

    -----
    Get PhotoGallery, PayPalCart, Dynamenu, Enhanced Blocks & other mods

    Cape Cod Travel Info...
  • Link to this postingPosted: 26.01.2004, 18:48
    Profile Homepage
    PuddySpace
    rank:
    Softmore Softmore
    registered:
     January 2004
    Status:
    offline
    last visit:
    09.11.04
    Posts:
    85
    I know what PHP file to put it in.......i mean where in the file. I pasted it at the very end and all i got were errors...as I said im not a scripter or a techy and don't get where in the file it goes.
  • Link to this postingPosted: 26.01.2004, 19:14
    Profile Homepage
    nate_02631
    rank:
    Professional Professional
    registered:
     September 2003
    Status:
    offline
    last visit:
    11.04.08
    Posts:
    3055
    I'm afraid I don't have the one with mods completed, but you don't just paste it in at the bottom it is a *change*. Thus, you want to *replace* the code at the bottom of the script that reads like:
    Code
    while(list($yid, $content) = $result->fields) {
    ...
        return themesideblock($row);
    }

    With the code above...
    -----
    Get PhotoGallery, PayPalCart, Dynamenu, Enhanced Blocks & other mods

    Cape Cod Travel Info...
  • Link to this postingPosted: 26.01.2004, 22:33
    Profile Homepage
    PuddySpace
    rank:
    Softmore Softmore
    registered:
     January 2004
    Status:
    offline
    last visit:
    09.11.04
    Posts:
    85
    Ahh that's where i was going wrong lol

    Ttold you I wasn't a techie! heh
  • Link to this postingPosted: 21.02.2004, 13:32
    Profile Homepage
    lamruyter
    rank:
    Freshman Freshman
    registered:
     February 2004
    Status:
    offline
    last visit:
    21.02.04
    Posts:
    6
    DusterThe ideal solution would be for the ephemerids block not to appear on dates there are no entries.

    I showed up late here, I know but nevertheless I feel the need to comment on something Duster said a few comments back. Why not include a link like mailto:webmaster@yourdomain.com?subject=Suggest-something-for-this-day? for all the empty days.

    This way you get the ephemerids filled 'automatically' with events related to your site's topics.

    I guess this will be relatively easy for experienced postnukers. Any volunteers out there?

    -----
    Fare (sail) well, greets, the Skipper
  • Link to this postingPosted: 21.02.2004, 18:55
    Profile Homepage
    nate_02631
    rank:
    Professional Professional
    registered:
     September 2003
    Status:
    offline
    last visit:
    11.04.08
    Posts:
    3055
    Well, it's not PostNuke per se, just simple PHP... In the
    Code
    if (!$content_match) {
            return;
        }

    Instead of returning, you could put:
    Code
    $boxstuff .= 'There are no events for today, why not <A HREF="mailto:webmaster@yourdomain.com?subject=Suggest_Ephermerid_for_'.date('F_jS,_Y').'">suggest one?</A>';

    -----
    Get PhotoGallery, PayPalCart, Dynamenu, Enhanced Blocks & other mods

    Cape Cod Travel Info...
  • Link to this postingPosted: 21.02.2004, 19:36
    Profile Homepage
    lamruyter
    rank:
    Freshman Freshman
    registered:
     February 2004
    Status:
    offline
    last visit:
    21.02.04
    Posts:
    6
    Wasn't looking for the code to do this. &BTW, even easier than I thought. Just meant to say that you could use the empty days for the mailto:

    Saw no need for empty days, that's all.

    -----
    Fare (sail) well, greets, the Skipper
  • Link to this postingPosted: 21.02.2004, 20:43
    Profile Homepage
    nate_02631
    rank:
    Professional Professional
    registered:
     September 2003
    Status:
    offline
    last visit:
    11.04.08
    Posts:
    3055
    lamruyterI guess this will be relatively easy for experienced postnukers. Any volunteers out there?

    I guess I misunderstood then? :?

    The point of this mod really was *not* to show the Ephermerids for the empty days for presentation purposes, as very often there are no entries for most days...

    -----
    Get PhotoGallery, PayPalCart, Dynamenu, Enhanced Blocks & other mods

    Cape Cod Travel Info...
  • Link to this postingPosted: 25.05.2004, 09:23
    Profile Homepage
    ep
    rank:
    Freshman Freshman
    registered:
     March 2004
    Status:
    offline
    last visit:
    29.05.04
    Posts:
    30
    Thanks so much for that code replacement. It works perfectly.
Goto page : 1 | 2 Next Page

Start ::  PostNuke 0.7 Support ::  Tutorials and Solutions ::  Solving the ephemerids problem

Main Menu

Extensions Database

Documentation

Development

Login





 


 Log in Problems?
 New User? Sign Up!

Donate to Zikula