RE : Char Limit Function…
Posted: 20 September 2008 09:27 AM   [ Ignore ]  
Professor
Avatar
RankRankRankRankRankRankRank
Total Posts:  10833
Joined  04-15-2006

Hiya,

Not sure if this is technically a bug or not but was wondering if the char_limiter(str [string], num [int]) function and perhaps even the word_limiter (haven’t tried that one yet) could be updated to not cut out HTML tags.

Someone was having a problem today with the plugin and I forgot about the TruncHTML plugin that silenz had made some time back which does indeed do the correct thing but I do use the char_limiter function a few times in plugins and was just wondering if it could be updated to allow for this sort of behavior?

If there is a better way of going around this then please feel free to move this thread and let me know but it would be nice to have this in the in-built functions for developers to be able to work with natively.

Thanks again for such a wonderful developer set of functions though wink

Best wishes,

Mark

[Mod edit: moved to Feature Request forum]

 Signature 

Shopping Cart Plugin
Full list of add-ons
———————————————————-
Buy me a drink, or two if you like!!

Profile
 
 
Posted: 20 September 2008 11:02 AM   [ Ignore ]   [ # 1 ]  
Professor
Avatar
RankRankRankRankRankRankRank
Total Posts:  10833
Joined  04-15-2006

Oops sorry about that. Should have thought about putting this in the Feature Requests forum, thanks for moving it.

I just thought as the documentation said that you could place anything between the tags that it was a little misleading.

Best wishes,

Mark

 Signature 

Shopping Cart Plugin
Full list of add-ons
———————————————————-
Buy me a drink, or two if you like!!

Profile
 
 
Posted: 20 September 2008 11:13 AM   [ Ignore ]   [ # 2 ]  
Administrator
Avatar
RankRankRankRankRankRankRank
Total Posts:  19293
Joined  06-03-2002

Well, you can put anything you want.  I don’t see that the description of this plugin nor the function in the developers docs gives any indication that the tag will make assumptions about the content other than breaking the text into “words”.

These two functions are used for much more than output processing in the templates, and are required by the application for internal use as-is.  The plugins are merely gateways to these internal library functions, so modifying them is out of the question, though there wouldn’t be anything wrong with a separate plugin that is content aware.  Silenz’s TruncHTML does a fabulous job with that, in fact I use it myself, and I don’t particularly see a reason for a first party solution to be made.  What would that say to the development community if every well-executed add-on ended up having a first party implementation?

 Signature 
Profile
MSG
 
 
Posted: 20 September 2008 11:17 AM   [ Ignore ]   [ # 3 ]  
Professor
Avatar
RankRankRankRankRankRankRank
Total Posts:  10833
Joined  04-15-2006

Yep I totally get your point about taking other peoples plugins and making them 1st party. I was probably looking at this a little wrong. No offense was intended to silenz in that way.

I suppose if ever I need a plugin to do something and need to use the char_limiter() function then I will just write it myself. I was just thinking out loud really, perhaps a little too loud? wink

Consider this closed, thanks for the explanation.

Best wishes,

Mark

 Signature 

Shopping Cart Plugin
Full list of add-ons
———————————————————-
Buy me a drink, or two if you like!!

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1743, on December 02, 2009 03:47 PM
Total Registered Members: 120494 Total Logged-in Users: 41
Total Topics: 126565 Total Anonymous Users: 24
Total Replies: 665430 Total Guests: 281
Total Posts: 791995    
Members ( View Memberlist )