1
Greets,
It's not often I'm on this end of the question, but I have been making some minor modifications to News 1.2 and I was wondering what code I would use to change a display element of the news.
We're all familiar with the "xxx Bytes more" being displayed. What I would like to do is change the code so that it does a word count and thus display either "Total Words" or "xxx Words more" (I prefer total words, but either will suffice for my needs)
I suspect this is in /news/class/class.newsstory.php around line 277:
line 277: $morelink .= sprintf(_NW_BYTESMORE,$totalcount);
There also seems to be some related functions that start at around line 269:
line 269: $introcount = strlen($story['text']);
line 270: $fullcount = strlen($this->bodytext());
line 271: $totalcount = $introcount + $fullcount;
So far I have only commented out line 277 and edited a different "$morelink .=" element that was being rendered on the page, effectively eliminating the Byte's more from being displayed.
It's not important that I have a word count, but it would be a more elegant option to have instead of Bytes. I don't think anyone cares how many bytes are used for something they are reading; words at least is a bit more interesting to look at and people can relate to that a bit more imho.
Mith, or anyone else care to shed some light on this small hack?
Stew