Support for SermonSpeaker 3.x is canceled as it is for Joomla 1.5. I will gladly assist you with minor issues but I will not fix any bugs anymore in this releases.
The fix is to upgrade to SermonSpeaker 4.x, which is better anyway.

NEW Notification

More
18 Apr 2011 06:40 #474 by Ruben Ryapolov
When I post a sermon, I'd like for the most recent one have an image, or text that says "NEW!"

How can I accomplish this? This should be just a little bit of easy php, I think, but then again, I dont know php very well... :huh:

Please Log in or Create an account to join the conversation.

More
18 Apr 2011 07:20 #475 by Thomas Hunziker
In the respective layout file (in the tmpl directory of the chosen view, usually default.php) you would add an if statement to check the 'sermon_date' against an own $variable.

The funny part starts with defining $variable. You would need to first transform the 'sermon_date' to an unix timestamp (strtotime($item->sermon_date) or so) then make your calculations and fill the $variable. Then compare this $variable against the timestamp of 'sermon_date'.

I'll be away for the next few days, maybe I can have a closer look later this week.

Please Log in or Create an account to join the conversation.

More
18 Apr 2011 21:43 #492 by Ruben Ryapolov
Replied by Ruben Ryapolov on topic Re: NEW Notification
I think I will wait for you to have a better look first, that way I'm pretty sure it'll get done faster, and without me sitting on the computer for 3hrs trying to figure it out. :woohoo:

Please Log in or Create an account to join the conversation.

More
21 Apr 2011 07:57 #511 by Thomas Hunziker
Assuming you want this for the sermons view:
Edit the file /components/com_sermonspeaker/views/sermons/tmpl/default.php
Before line 14 (?>) add this:
Code:
$timestamp = strtotime('-14 days');
Here we create the Unix timestamp for the date two weeks ago. We will later compare against this timestamp. Change the days to the needed values of course :)

Around line 57 starts the data tablerows. Assuming you want the "new" picture in front of the title, you would need to add the following code around line #67:
Code:
<?php if ($timestamp < strtotime($row->sermon_date)): ?> <img src="<?php echo JURI::root(); ?>components/com_sermonspeaker/images/new.gif"> <?php endif; ?>
Of course change the path to the picture to the file you use.

Please Log in or Create an account to join the conversation.

Time to create page: 0.096 seconds
Powered by Kunena Forum