vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Most popular smilie ! (https://vborg.vbsupport.ru/showthread.php?t=46840)

Xenon 12-22-2002 08:25 PM

Yes, this would be the only way to keep it less server intensive, but it wouldn't work for older posts....

ok you can run the intensive algorithm first to get the ammount for all old posts.

zajako 12-27-2002 08:42 PM

I have an idea that would make this more do able.

make a sql entry everytime a smily is parsed, it would ad multiple more queries per post, but if optimized sql wise should be able to get it down pretty low. the porblem woul dthen be remodling the smilie system to fit this.

Kars10 12-28-2002 11:42 AM

I know about a Statistic (PHPBB) with that smiliething.
But there you have the Top10 Smilies. ;)

corsacrazy 12-28-2002 03:46 PM

top 10 smilies is also good coz then i could break it down just to display top one smilie but u say thats 4 phbb :(

fury 12-29-2002 04:08 PM

I was thinking of doing something similar to this, except I would only count the amount of posts that contain each smilie, not how many times the smilie appears.

Kars10 12-29-2002 05:40 PM

Here is the smilie-code from PhbBB.
Maybe we could re-write this for vb?!?

PHP Code:

// DB queries for top Smileys: 

$query "SELECT * FROM smiles GROUP BY smile_url"

$all_smileys mysql_query($query$db); 

$topten = array(); 
$total_smiles 0

while (
$aktsmile mysql_fetch_array($all_smileys))  { 

     
$aktcount 0
     
     
    
$query2 "SELECT post_text FROM posts_text 
              WHERE post_text LIKE '%
$aktsmile[smile_url]%'"
               
    
$all_posts mysql_query($query2$db);           
    while (
$aktpost mysql_fetch_array($all_posts)) { 

         
$aktcount $aktcount substr_count ($aktpost[post_text], $aktsmile[smile_url]); 
    }   
     

    
$topten[$aktsmile[smile_url]] = $aktcount
    
$total_smiles $total_smiles $aktcount
     
    } 


fury 12-29-2002 06:15 PM

I made a query that does it. (counting how many posts contain each smilie)

select count(postid) as count,smilie.smilietext from post,smilie where post.pagetext like concat("%",smilie.smilietext,"%") group by smilie.smilietext order by count;

Warning, this query can take a few minutes and may cause your server to stop responding. Don't run it from phpMyAdmin.

It could possibly be run like once a week or so and the results put in its own table (but it would require being able to disable the exec time limit on a per-file basis) which could then be called in a fraction of a second each time the page is displayed

Xenon 12-30-2002 10:31 AM

@fury: sorry to say, but your query is wrong. it just count how many posts contain a special smilie, but not how ofter the smilie is in this post...

@Minifreunde: yes, this is the code i was thinking for.
On great boards this will be very intense, because it goes more than once through nearly the whole posttable
not a good idea if you have over a million posts ;)


All times are GMT. The time now is 04:48 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.01047 seconds
  • Memory Usage 1,735KB
  • 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_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)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