vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Letter counter in getinfo for all posts by a user! (https://vborg.vbsupport.ru/showthread.php?t=50183)

Sho 03-15-2003 05:57 AM

Letter counter in getinfo for all posts by a user!
 
Hi there,

I really want a letter counter for my forums :). A user writes a post and the number of letters it contains is added to his counter. Of course, 'editpost' has to be considered, too. The counter should show up in getinfo. Now, all in all, I understand what has to be done, but my SQL is too bad to figure out how to count the letters in the existing posts and where to insert them. I tried it with some simple loops, printing out per userid, but ... well, I'm not up to it.

Since I'm posting this in "Hack Requests", I'm obviously shooting for a complete solution :cheeky:. But if someone takes the time to post some PHP/SQL code on how to count the letters in the existing posts and gives advice on which database structure would be best (I'm guessing the best would be a new field in the user table containing the calculated number, constantly updated by newreply/newthread/editpost; counting anew every time would result in an extreme load), I might be able to try it on my own again.

Anyway, thanks for reading. :)

Logician 03-15-2003 07:01 AM

I bet Xenon provided this code in this forum, but I couldnt find its thread when I searched now. You can try to search maybe you can be luckier than me, or maybe Xenon can point it.. :)

Sho 03-15-2003 08:01 AM

Xenon did provide me with code to display the letter count of the respective post in the postbit template once, but that's not what I need. I want an ongoing counter and I have to count the letters of the existing posts per user before. :)

Sho 03-15-2003 09:39 AM

Ah, I got it to work ("Buchstaben" = letters). Logician posted a way to do it dynamically in the old thread, I added it to member.php:

Quote:

SELECT SUM(LENGTH(pagetext)) FROM `post` WHERE userid='$userid'
Sorry. I didn't notice the new posts in the old thread, should've looked at it before posting a new one.

Thanks Logician, anyway. :)

Logician 03-15-2003 09:48 AM

yw.. even I didn't remember I gave the code before :)

Sho 03-15-2003 02:59 PM

<a href="http://www.forenplanet.de/member.php?s=&action=getinfo&userid=450" target="_blank">Now it shows</a> the number of letters, how many letters per day, how many letters of all letters by all members in percent and how many letters per post on average. Maybe I should publish all this as a new hack. Of course, I'd credit you, Logician. What do you say?

Logician 03-15-2003 07:07 PM

sure go ahead and publish it if you want to..

Xanthine 03-15-2003 07:13 PM

Please do as Im interested in this as well

Sho 03-16-2003 03:12 AM

Cool, thanks a lot Logician!

Xanthine, expect a hack in 10 - 15 hours, I'll do it when it's evening for me over here.

Sho 03-16-2003 05:02 AM

Well, what the hell. Here ya go, Xanthine:

https://vborg.vbsupport.ru/showthrea...threadid=50249


All times are GMT. The time now is 01:42 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00948 seconds
  • Memory Usage 1,726KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete