vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Community Lounge (https://vborg.vbsupport.ru/forumdisplay.php?f=13)
-   -   Most popular smilies (https://vborg.vbsupport.ru/showthread.php?t=66721)

ogetbilo 06-30-2004 05:07 PM

Most popular smilies
 
To get the number of occurences of each smilie in user's posts on all over the forum, run the sql query:


[SQL]
select smilietext , count(*) as count
from post, smilie
where pagetext like concat("%",smilie.smilietext,"%")
group by smilietext
order by count desc;[/sql]

You will get an output like:

+------------+-------+
| smilietext | count |
+------------+-------+
| :D | 14063 |
| :) | 4596 |
| :lol: | 2381 |
| :( | 1526 |
| ;) | 1518 |
...


This is useful to determine the popular smilies and to put them in the smiliebox in the message posting interface.

assassingod 06-30-2004 05:14 PM

Great idea, maybe you could implent it into the vB3 Admin CP and release it as a hack?:)

Dean C 06-30-2004 05:36 PM

Gosh that query would kill a large board ;) Thanks for sharing the tip nevertheless! :D

ogetbilo 06-30-2004 08:17 PM

You're right Dean C. It took 5.57 in my board (with ~35000 posts) to execute the query.
It will take roughly 1 minute for vbulletin.org, and more for larger boards, which may exceed their php timeout.

I will try to write the hack for the admincp when I have some time (maybe this weekend?)

Dean C 07-01-2004 01:35 PM

Go for it :)! I look forward to seeing your first release ;)

Xenon 07-01-2004 01:43 PM

actually, that query isn't correct.

for example if you have used :) 3 times in a post, it will just be counted one time, because you er doing the count on ammounts of posts, not ammounts of smilies used in a particular post.

Boofo 07-01-2004 03:11 PM

Quote:

Originally Posted by Xenon
actually, that query isn't correct.

for example if you have used :) 3 times in a post, it will just be counted one time, because you er doing the count on ammounts of posts, not ammounts of smilies used in a particular post.

What query would you use then?

Xenon 07-01-2004 04:36 PM

hmm, that's a bit more complicate and i fear even much more intese.
I didn't find a way to do substring counts in mysql, maybe i'm just blind or there isn't such a function.

so the only way i can see now is to query the pagetext of each post, and to the php string count on it, but that's not fast of course ;)

Boofo 07-01-2004 04:37 PM

Quote:

Originally Posted by Xenon
hmm, that's a bit more complicate and i fear even much more intese.
I didn't find a way to do substring counts in mysql, maybe i'm just blind or there isn't such a function.

so the only way i can see now is to query the pagetext of each post, and to the php string count on it, but that's not fast of course ;)

Fast or not, I would still like to see the query. :p

Xenon 07-01-2004 04:40 PM

as i said, i don't find a way to do it in a query.

i don't think there is the needed function in mysql, or if it is, then i can't figure out the nae, so the only way i see right now to get the correct value would be a php/mysql combination


All times are GMT. The time now is 10:00 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.01079 seconds
  • Memory Usage 1,728KB
  • 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
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete