Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-15-2003, 05:57 AM
Sho Sho is offline
 
Join Date: Nov 2001
Location: Berlin, Germany
Posts: 155
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.
Reply With Quote
  #2  
Old 03-15-2003, 07:01 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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..
Reply With Quote
  #3  
Old 03-15-2003, 08:01 AM
Sho Sho is offline
 
Join Date: Nov 2001
Location: Berlin, Germany
Posts: 155
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 03-15-2003, 09:39 AM
Sho Sho is offline
 
Join Date: Nov 2001
Location: Berlin, Germany
Posts: 155
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 03-15-2003, 09:48 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yw.. even I didn't remember I gave the code before
Reply With Quote
  #6  
Old 03-15-2003, 02:59 PM
Sho Sho is offline
 
Join Date: Nov 2001
Location: Berlin, Germany
Posts: 155
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<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?
Reply With Quote
  #7  
Old 03-15-2003, 07:07 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

sure go ahead and publish it if you want to..
Reply With Quote
  #8  
Old 03-15-2003, 07:13 PM
Xanthine Xanthine is offline
 
Join Date: Mar 2002
Posts: 232
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Please do as Im interested in this as well
Reply With Quote
  #9  
Old 03-16-2003, 03:12 AM
Sho Sho is offline
 
Join Date: Nov 2001
Location: Berlin, Germany
Posts: 155
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #10  
Old 03-16-2003, 05:02 AM
Sho Sho is offline
 
Join Date: Nov 2001
Location: Berlin, Germany
Posts: 155
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

https://vborg.vbsupport.ru/showthrea...threadid=50249
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:46 PM.


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.04100 seconds
  • Memory Usage 2,248KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete