Logo of SermonSpeaker Extension Claim

Login Form

Additional field: Sermon filesize

More
5 years 7 months ago #2909 by Martini
Hi,
I'm working at an layout, that will show the sermonfilesize and a Subtitle.
To make this work, I plan to use the empty databasefields custom1 and custom2.

My Question:
Is there any purpose to add the field 'sermonfilesize'?
I'm asking because this is a very useful information and in case I have to use both custom-fields I would have no further one for customization.

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

More
5 years 7 months ago #2910 by Thomas Hunziker
So far I didn't think about adding the filesize to the database, but I could certainly do it. It could even be automatically filled out for local files using the PHp filesize() function.

I guess showing this information on the detail page could be interesting.

Feel free to rate SermonSpeaker on JED .
Useful documentation for beginners: First Steps & FAQ
How to say "Thank You!": Contribute or support using the Donate button at the bottom of each page.
The following user(s) said Thank You: Martini

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

More
5 years 7 months ago #2911 by Martini
Cool, the filesize would be very nice!
Maybe you could call the filesize() function at every changes belonging the sermon. That would allow replacement of the audiofile in backend (if little changes are necessary).

2nd Question:
Is there a way to get the custom fields in the sermons-view without changing the model-file or make an override?
In the site/models/sermons.php the custom-fields aren't requested from database.

Thank you

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

More
5 years 7 months ago #2912 by Thomas Hunziker
I'll probably make it so that the filesize will be looked up during save (and maybe id3 lookup) if the field is empty or 0. If anything is entered, I'll leave it as is.

You would have to add the customs to the model. I think it makes sense to add them to the sermons model as well since it doesn't really have a performance impact if you load two more fields.
I saw that currently some sermons layouts even check for them. Since the parameter is only meant to affect the detailpage, I will remove the customs from the sermons layouts. If someone wants to use them there, he can always create a custom layout like you do. Most likely the place where I put it will not match anyway :)

Feel free to rate SermonSpeaker on JED .
Useful documentation for beginners: First Steps & FAQ
How to say "Thank You!": Contribute or support using the Donate button at the bottom of each page.

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

Time to create page: 0.097 seconds
Powered by Kunena Forum