Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
custom-topic
Code Customization
Avatar
Lee H
Coastal New England (USA)
Member
Free Members
sp_UserOfflineSmall Offline
Aug 31, 2010 - 9:18 am
sp_QuotePost Quote

Janet, I'll play around with it this afternoon and see what I can do.  I don't write much code.  I mostly tweak other peoples work to suite my needs. I was looking it over and think I understand enough of what I saw to help.

Unless of course someone with the actual skills steps in [Image Can Not Be Found]

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Aug 31, 2010 - 11:55 am
sp_QuotePost Quote

Thanks Lee. I am swamped at the moment and Steve's young son has his first varsity football match tonight so he wont be around much either.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Lee H
Coastal New England (USA)
Member
Free Members
sp_UserOfflineSmall Offline
Aug 31, 2010 - 4:20 pm
sp_QuotePost Quote

Janet I whipped a new template tag. Here's a pic and tell what to change. You would need to style it.  I cheated and styled with Firebug to bring it all together.  Added the black border too. Sorry so brief.  Company is coming 🙂

[Image Can Not Be Found]

Set to show 5 posts and chopping at a word at no more then 100 characters.  Then add ... at the end of chop.  Note first post was less than 100....   so it was safe from chop.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Sep 1, 2010 - 4:36 am
sp_QuotePost Quote

This looks great. Can I make one suggestion.

Are you filtering the post content at all? The best filter to use for this would be:

$content = sf_filter_tooltip_display( $content, $status );

because that will remove any html tags that might cause havoc if spilt by the word count. This is the filter we use for displayng the tooltip when you hover over first/last posts etc.

The $status paramater is the current post_status field from the sfposts record. if it is true - and the user is not an admin or moderator - then it wil display that the post is awaiting moderation instead of the actual post content.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Lee H
Coastal New England (USA)
Member
Free Members
sp_UserOfflineSmall Offline
Sep 1, 2010 - 7:31 am
sp_QuotePost Quote

Wow! I really should think twice about doing a hasty post. I'm not even sure I can figure out what the heck I wrote. Sorry about that [Image Can Not Be Found]

@ Yellow Swordfish...  you're the best! I was stripping out the html tags, but that filter is so much better.  Especially the status option. I hadn't thought that far ahead. I was digging around all the filters yesterday for the first time, but since I only seem to understand about 70% of what I'm reading, skimming through that much code got overwhelming in a hurry.  I'm glad to use a "tested" internal filter rather then introducing my own anyhow 🙂

I did bypass the sf_rss_excerpt since words vary in length so much and I wanted the excerpt lengths to be more consistant in visual length, since I'm assuming this tag will be used in tight places. So I opted to include a filter that goes by character count, the finds the closest word at that point to split without exceeding the limit. Once again I'd prefer to use a function included with SP so if there are other options I haven't discovered, I'd be happy for another hint.

@ Janet... What I was trying to say earlier was I'm happy to word this any way you choose. I'm unclear exactly, since so many ideas were thrown out on the table in this thread. So if you can type out a "demo" example for me I can save you some code edits if it isn't exactly as you were expecting.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Sep 1, 2010 - 8:47 am
sp_QuotePost Quote

Afraid we don't have a character based filter.

andy-signature.png
YELLOW
SWORDFISH
Avatar
JanetBarclay
Hamilton, Ontario, Canada
Member
Free Members
sp_UserOfflineSmall Offline
Sep 1, 2010 - 9:57 am
sp_QuotePost Quote

Thanks - I really appreciate all your help. I will check with my client today and let you know what they decide.

Avatar
JanetBarclay
Hamilton, Ontario, Canada
Member
Free Members
sp_UserOfflineSmall Offline
Sep 2, 2010 - 8:22 am
sp_QuotePost Quote

Lee, your example is great! I'll be able to change the number of posts and the length of the excerpt simply by changing the numbers in brackets?

One tiny request - they would prefer to have the second line in this order:

posted username, date by

 

Thank you so much!!

Avatar
Lee H
Coastal New England (USA)
Member
Free Members
sp_UserOfflineSmall Offline
Sep 2, 2010 - 8:47 am
sp_QuotePost Quote

No problem with the changes. I'll have the code and directions posted here in about a hour. And yes, you have control of posts listed and how much of the post you want displayed by adjusting the numbers.  Oh...  you also have control of the trailing "...". You can specify what you want it to be. 

Back in a while

Lee

Avatar
Lee H
Coastal New England (USA)
Member
Free Members
sp_UserOfflineSmall Offline
Sep 2, 2010 - 9:14 am
sp_QuotePost Quote

JanetBarclay said:

posted username, date by


@Janet... I think I may be confusing myself.

You're saying you would like the second line to read like this?

Posted JanetBarclay, Sep 2, 2010 by

Surely I'm mistaken? Please type me a example line including a sample username, date, punctuation and wording so I can be certain 🙂

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 649
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 618
Members: 17357
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10123
Posts: 79613