vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Statistics Modifications - Forum Search Stats V.2 (https://vborg.vbsupport.ru/showthread.php?t=153072)

coderphp 07-21-2007 10:00 PM

Forum Search Stats V.2
 
Hi all

Did you ever wondered what your users expect to find in your forums?
Did you ever wanted to know what are their needs?
Did you ever wanted to let them know what they can easily find?
If your answer is "Yes", then you must use this product ...

The 1st version was here
https://vborg.vbsupport.ru/showthread.php?t=139829

What is new in Version 2
  1. Most searched keywords in smaller text.
  2. Most searched keywords leads to results page directly instead of search page.
  3. Fixed random list bug.
  4. Fixed blank keyword bug.
  5. An option for choosing who can see search stats in homepage.
  6. Censor words listed in Most searched stats according to Forum's censor list.
  7. Solved "<span dir=rtl>" problem.
  8. Solved TABLE_PREFIX problem.
  9. Solved falsy search count when user clicks on links on "most searched keyword stats". ((Thanx to h2ojunkie))
Features
1- Log user searches in your forums.
2- Show most searched keywords on the main forums page in away that demonstrates every keywords importance in your forums.

Screens
https://vborg.vbsupport.ru/external/...chmentid=67368
https://vborg.vbsupport.ru/external/...chmentid=67369
https://vborg.vbsupport.ru/external/...chmentid=67370
https://vborg.vbsupport.ru/external/...chmentid=67371

Version
Expected to work on all vBulletin 3.6 versions tell now.

Template Edits
1 template edit in FORUMHOME

Plugins
2 Plugins

Installation
1- Upload the directory "upload" contents to your forum root.
2- Import the attached product "[product] Forum Search Stats 2.0.xml" into your AdminCP.
3- Edit template "FORUMHOME":
BEFORE:
Code:

</table>
<br />
<!-- end what's going on box -->

ADD:
Code:

<if condition="$vbulletin->options['setting_searchstats_showuser'] AND in_array($vbulletin->userinfo['usergroupid'], $allowed_groups)">
<tbody>
 <tr>
  <td class="thead" colspan="2">
  <a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_events')"><img id="collapseimg_forumhome_events" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_events].gif" alt="" border="0" /></a>
$vbphrase[most_searched]
</td>
 </tr>
</tbody>
<tbody id="collapseobj_forumhome_events" style="$vbcollapse[collapseobj_forumhome_events]">
 <tr>
  <td class="alt2"><img src="images/misc/search_stats.gif" alt="$vbphrase[most_searched]" border="0" /></td>
  <td class="alt1" width="100%">$most_searched</td>
 </tr>
</tbody>
</if>

Finally, if you like the product Please show your support by clicking INSTALL..
you can also NOMINATE FOR MOD OF THE MONTH :)

ALSO, many thanx for all who helped in testing and debugging the 1st version, the list is long so i couldnt name them here :)

coderphp 07-22-2007 09:14 PM

screenshots :)

txspaderz 07-22-2007 09:17 PM

Sounds like a good idea. I'll wait for other's opinions on it

h2ojunkie 07-22-2007 10:27 PM

I hope I'm not stepping on any toes, cause I really do love this mod.

I just tested V2 on 3.6.4 to see if it would work and get the following error when trying to view search stats in admincp. (I know, i'm too lazy to do the full 3.6.7 update and settled for just the security patches)

Code:

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /my/path/forum/admincp/search_stats.php on line 18
I used the same fix on V2 that I did on V1 to solve the problem
in search_stats.php
Replace this:
PHP Code:

    $records=$db->query_read("SELECT * FROM  " TABLE_PREFIX "coder_searchstats");
    
$num=mysql_num_rows($records);

    
$records=$db->query_read("SELECT s.id, s.query, s.dateline, s.count FROM " TABLE_PREFIX "coder_searchstats AS s ORDER BY `count` DESC LIMIT $eu$limit");
    
$pa ceil($eu/$limit)+1;
    
$to ceil($num/$limit);
    
print_form_header();
    
print_table_header($vbphrase['coder_searchstats_show'] . "(Page $pa of $to)"5);
    if(
mysql_num_rows($records) > 0

With this:
PHP Code:

    $recordcount=$db->query_first("SELECT COUNT(*) AS count FROM  " TABLE_PREFIX "coder_searchstats");
    
$num=$recordcount['count'];

    
$records=$db->query_read("SELECT s.id, s.query, s.dateline, s.count FROM " TABLE_PREFIX "coder_searchstats AS s ORDER BY `count` DESC LIMIT $eu$limit");
    
$pa ceil($eu/$limit)+1;
    
$to ceil($num/$limit);
    
print_form_header();
    
print_table_header($vbphrase['coder_searchstats_show'] . "(Page $pa of $to)"5);
    if(
$num 0

Also the "Most searched keywords" block on forum home still shows to usergroups that don't have permissions to see it.

The actual search terms don't show up (just the word "None") but the block itself still shows. I would think the entire section should not show if they don't have viewing permissions. It doesn't make sense to show a 'search stats' box with nothing in it.

So I changed the FORUMHOME template edit from this:
Code:

<if condition="$vbulletin->options['setting_searchstats_showuser']">
To this:
Code:

<if condition="$vbulletin->options['setting_searchstats_showuser'] AND in_array($vbulletin->userinfo['usergroupid'], $allowed_groups)">
Thanks for the great mod!!!

johnrizz 07-22-2007 10:52 PM

very nice

edenx 07-22-2007 10:55 PM

How can I show the most searched keywords using vbadvanced? like a search cloud?

Wayne Luke 07-22-2007 11:46 PM

Does the list of most searched for terms have to go in the "what's going on box"? I think that is the most illogical place to put it.

coderphp 07-22-2007 11:52 PM

Quote:

Originally Posted by h2ojunkie (Post 1298606)
I hope I'm not stepping on any toes, cause I really do love this mod.

I just tested V2 on 3.6.4 to see if it would work and get the following error when trying to view search stats in admincp. (I know, i'm too lazy to do the full 3.6.7 update and settled for just the security patches)

Code:

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /my/path/forum/admincp/search_stats.php on line 18
I used the same fix on V2 that I did on V1 to solve the problem
in search_stats.php
Replace this:
PHP Code:

    $records=$db->query_read("SELECT * FROM  " TABLE_PREFIX "coder_searchstats");
    
$num=mysql_num_rows($records);

    
$records=$db->query_read("SELECT s.id, s.query, s.dateline, s.count FROM " TABLE_PREFIX "coder_searchstats AS s ORDER BY `count` DESC LIMIT $eu$limit");
    
$pa ceil($eu/$limit)+1;
    
$to ceil($num/$limit);
    
print_form_header();
    
print_table_header($vbphrase['coder_searchstats_show'] . "(Page $pa of $to)"5);
    if(
mysql_num_rows($records) > 0

With this:
PHP Code:

    $recordcount=$db->query_first("SELECT COUNT(*) AS count FROM  " TABLE_PREFIX "coder_searchstats");
    
$num=$recordcount['count'];

    
$records=$db->query_read("SELECT s.id, s.query, s.dateline, s.count FROM " TABLE_PREFIX "coder_searchstats AS s ORDER BY `count` DESC LIMIT $eu$limit");
    
$pa ceil($eu/$limit)+1;
    
$to ceil($num/$limit);
    
print_form_header();
    
print_table_header($vbphrase['coder_searchstats_show'] . "(Page $pa of $to)"5);
    if(
$num 0


i tested it again and i didnt face this problem
i dont know maybe u have another hack which interfere with this?

Quote:

Originally Posted by h2ojunkie (Post 1298606)
Also the "Most searched keywords" block on forum home still shows to usergroups that don't have permissions to see it.

The actual search terms don't show up (just the word "None") but the block itself still shows. I would think the entire section should not show if they don't have viewing permissions. It doesn't make sense to show a 'search stats' box with nothing in it.

So I changed the FORUMHOME template edit from this:
Code:

<if condition="$vbulletin->options['setting_searchstats_showuser']">
To this:
Code:

<if condition="$vbulletin->options['setting_searchstats_showuser'] AND in_array($vbulletin->userinfo['usergroupid'], $allowed_groups)">
Thanks for the great mod!!!

fixed thank you..
please re-download the product

PixelFx 07-22-2007 11:56 PM

looks cool :D thanks for sharing .. won't install yet, but looks really nice .. great job :D

coderphp 07-22-2007 11:57 PM

Quote:

Originally Posted by stone0075 (Post 1298616)
very nice

thanx :)

Quote:

Originally Posted by edenx (Post 1298617)
How can I show the most searched keywords using vbadvanced? like a search cloud?

id ont know about installation with vbadvanced

Quote:

Originally Posted by Wayne Luke (Post 1298633)
Does the list of most searched for terms have to go in the "what's going on box"? I think that is the most illogical place to put it.

can u clearify why u think that?:confused:


All times are GMT. The time now is 11:45 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.01250 seconds
  • Memory Usage 1,786KB
  • 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
  • (8)bbcode_code_printable
  • (4)bbcode_php_printable
  • (5)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