11
LazyBadger
Re: having "words more" not "bytes more" in news items

Quote:

Mithrandir wrote:
Ok, take a step back and look at what you are doing, will ya?

Well, name me "idiot", but (it's not complain, but I try to find answer), why calculated word's count differ from real count? It's smaller for a small number
Counted - 26, real - 28
Counted - 99, real - 108

Not a problem at all, I'm only have interest why... according to code - there must be identical digits

Just to note: I use both corrected strings

12
chaymation
Re: having "words more" not "bytes more" in news items
  • 2005/1/9 16:42

  • chaymation

  • Just popping in

  • Posts: 27

  • Since: 2005/1/9 0


I appreciate the help, although, no it isn't obvious. Having never done ANY php or coding before, I was just looking for someone to take me through some easy steps to get it to display the word count, I'm a new user, just trying to get a site set up, and I was hoping there would be just an option or dropdown list to choose "word count, character count, byte count"!

I didn't realise I would have to edit all this stuff, and no, to a non coder it's not very clear what I'm editing, sorry for being stupid.

13
chaymation
Re: having "words more" not "bytes more" in news items
  • 2005/1/9 16:45

  • chaymation

  • Just popping in

  • Posts: 27

  • Since: 2005/1/9 0


If that post just sounded ungrateful, im sorry, it wasnt supposed to be. I just find this code editing a bit scary and so need someone to hold my hand and talk me through it step by step. I really do apprectiate the help, but telling me it's obvious just makes me feel stupid.

Anyway, thanks for replying, I am impressed with the speed of replies on this forum, and people's willingness to help.

14
chaymation
Re: having "words more" not "bytes more" in news items
  • 2005/1/9 16:58

  • chaymation

  • Just popping in

  • Posts: 27

  • Since: 2005/1/9 0


OK So I've got it to display "352 words more".

But, as you say this is the total count, but that's not what "more" means. It should say how many MORE words there are in the rest of the post, not counting the ones in the intro. so it should say "250 more" as there are about 100 words in the intro text.

I'm just getting annoying now aren't I?

I guess I could just change the text to "X words total"

That would make sense

15
chaymation
Re: having "words more" not "bytes more" in news items
  • 2005/1/9 17:00

  • chaymation

  • Just popping in

  • Posts: 27

  • Since: 2005/1/9 0


I guess having "X words in total" will have to do for me.

Thank you very much for pointing me in the right direction, I really do appreciate it.

16
Mithrandir
Re: having "words more" not "bytes more" in news items

Sorry - that came out a little harsh.
I meant it to be my "teacher's voice" asking you to look at what you are doing, while you are doing it, and see if you can understand it. Was a little hard to convey that message in a forum post and I didn't do a good job conveying it.

@lazybadger: It is not 100% perfect as what it does is count the spaces in the text and not the actual words. Quite possibly, you have line breaks and similar to break words, which is not counted in that simple counter. It was a 2-minute implementation so I did not think it all through. I ought to at least add one to the result as there is most likely not a space after the last word (3 words = 2 spaces)

17
rowdie
Re: having "words more" not "bytes more" in news items
  • 2005/1/9 17:05

  • rowdie

  • Just can't stay away

  • Posts: 846

  • Since: 2004/7/21


Quote:

chaymation wrote:
OK So I've got it to display "352 words more".

But, as you say this is the total count, but that's not what "more" means. It should say how many MORE words there are in the rest of the post, not counting the ones in the intro. so it should say "250 more" as there are about 100 words in the intro text.


Try changing the $totalcount line into :

$totalcount = $fullcount - $introcount;

edit : what you did was better
I haven't seen the code, just what was posted in this thread... so ignore me

Rowd

18
chaymation
Re: having "words more" not "bytes more" in news items
  • 2005/1/9 17:05

  • chaymation

  • Just popping in

  • Posts: 27

  • Since: 2005/1/9 0


No problem Mithrandir :)

I've solved my "More" problem by changing

Quote:
$morelink .= sprintf(_NW_BYTESMORE,$totalcount);


into
Quote:
$morelink .= sprintf(_NW_BYTESMORE,$fullcount);


I'm pleased with that, cos, like I say, im no coding person

cheers!

19
chaymation
Re: having "words more" not "bytes more" in news items
  • 2005/1/9 17:07

  • chaymation

  • Just popping in

  • Posts: 27

  • Since: 2005/1/9 0


Thanks for the idea rowdie, i did do that first, but i think this way is more suitable :)

NP Rowdie, it's always good to hear from helpful, friendly people. I certainly won't be scared to ask for some help in the future.

Open source stuff really makes you feel warm inside about the kindness of strangers
:)

20
chaymation
Re: having "words more" not "bytes more" in news items
  • 2005/1/9 17:15

  • chaymation

  • Just popping in

  • Posts: 27

  • Since: 2005/1/9 0


You can see the coding change working on my site here is anyone is interested:

Ideas Site

The word count isn't 100% accurate, but certainly enough for my needs, then people can see if its going to be a short idea, or a massive rambling one.

And like I said before, I reckon "words more" is much more friendly and human sounding than "bytes more"!



Cheers!

Login

Who's Online

211 user(s) are online (136 user(s) are browsing Support Forums)


Members: 0


Guests: 211


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits