PDA

View Full Version : Upcoming Event module - limit descr length


keita
08-04-2006, 03:14 AM
Mambo 4.5.3h
EsCal: 6.3.22
Database: flat

I have EsCal module on the front page with the title "upcoming events" which shows the first upcoming event.

Currently, the Upcoming Event module is displaying the entire description for the event.

Is there any way to limit the length of the description field so I can maintain a certain height of the module?

PS: If this is all possible, it would bring up another question - how to show the rest of the description text? - would it make more sense to incorporate [more...] functionality to the Upcoming Event module in future so it jumps to TOC?

(ref: http://www.easyphpcalendar.com/forums/showthread.php?p=16963#post16963)

Brian
08-04-2006, 10:08 AM
Can you provide a link to your page so I can see your implementation and can better determine a solution to your question?

keita
08-04-2006, 11:06 AM
Upcoming Events is located on the front page at the bottom of the right column.

A perfect example of a "really long description" is currently being displayed for Aug 5.

Brian
08-04-2006, 02:53 PM
There currently isn't a mechanism to shorten descriptions in the List Mode. You can use PHP's ob_start function to grab the output of the List Mode and shorten it before outputting it to the page.

keita
08-04-2006, 03:33 PM
Would you be able to give me a pointer as to which file to insert ob_start?

Would it be somewhere in functions/listings.php?

Brian
08-05-2006, 10:19 AM
ob_start: http://us3.php.net/ob_start

You would use ob_start to capture the output of the List Mode, then manipulate the output however you want, then display the result.

keita
08-05-2006, 11:45 AM
What I wanted to ask you was where I could capture the output of the List Mode using that ob_start.

Would it be somewhere in functions/listings.php?

Brian
08-05-2006, 05:11 PM
You would add it just before $LIST=1;.

You would still keep in the same place on your page.

keita
08-06-2006, 06:08 PM
Due to my limited PHP knowledge and lack of time, I haven't been able to materialize this code. If there's any PHP gurus in this forum who is willing to help me out with this coding, I will highly appreciate it.

Thanks.

Brian
08-07-2006, 10:23 AM
This thread may help:

http://www.easyphpcalendar.com/forums/showthread.php?t=3685&highlight=ob_start

There's lots of information this forum when searching on ob_start.