- Moderated by:
- Support
-
- rank:
-
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 -
- rank:
-
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. -
- rank:
-
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... -
- rank:
-
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. :)
--
Get PhotoGallery, PayPalCart, Dynamenu, Enhanced Blocks & other mods
Cape Cod Travel Info... -
- rank:
-
Softmore
- registered:
- January 2004
- Status:
- offline
- last visit:
- 08.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. -
- rank:
-
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
With the code above...
--
Get PhotoGallery, PayPalCart, Dynamenu, Enhanced Blocks & other mods
Cape Cod Travel Info... -
- rank:
-
Freshman
- registered:
- February 2004
- Status:
- offline
- last visit:
- 21.02.04
- Posts:
- 6
Duster
The 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 -
- rank:
-
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... -
- rank:
-
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 -
- rank:
-
Professional
- registered:
- September 2003
- Status:
- offline
- last visit:
- 11.04.08
- Posts:
- 3055
lamruyter
I 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...
