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:

h2ojunkie 07-23-2007 12:41 AM

Quote:

Originally Posted by coderphp (Post 1298636)
i tested it again and i didnt face this problem
i dont know maybe u have another hack which interfere with this?

I guess it's possible.

I just remembered that I had the same problem with V1 and that was the fix which also happened to work on v2

I guess it's possible I have something else in there that is conflicting with it (although i can't imagine what it could be since search_stats.php is a stand alone admincp script and I have no mods that alter the search in any way.

But who knows, when you start modding stuff you run into all kinds of potential for conflicts. I just figured I would post up the fix just in case someone else experienced a similar problem.

Again, thank you for a great mod.

h2ojunkie 07-23-2007 12:51 AM

Just a thought, but it occurred to me that every time a user clicks on one of the "most searched" keywords on forum home it is actually increasing the count for the # of times that term/phrase was searched for, thereby falsely inflating the true number of searches people did on the term.

Since people are likely to click on them because...they can....it would seem those "most searched" words would be inflated and always remain showing in the top 20 most searched.

Maybe append a new parameter to the end of the link to each of those search terms something like (searchstats=donotcount for example). Where if that parameter is passed when clicking on the link, the searchstats plugin knows not to add to the count for that word/phrase. This way the only words counted in the search stats are terms people actually searched for on their own.

Anyway, just an idea. That was a change on made on mine.

Wayne Luke 07-23-2007 01:24 AM

Quote:

Originally Posted by coderphp (Post 1298638)
can u clearify why u think that?:confused:

Yeah. I think it should go on the search page (both advanced search and search results) myself. The "What's Going On is already overcluttered that it will be ignored by most users and you don't need this information shown unless someone is looking to search.

coderphp 07-23-2007 02:13 AM

Quote:

Originally Posted by h2ojunkie (Post 1298663)
Just a thought, but it occurred to me that every time a user clicks on one of the "most searched" keywords on forum home it is actually increasing the count for the # of times that term/phrase was searched for, thereby falsely inflating the true number of searches people did on the term.

Since people are likely to click on them because...they can....it would seem those "most searched" words would be inflated and always remain showing in the top 20 most searched.

Maybe append a new parameter to the end of the link to each of those search terms something like (searchstats=donotcount for example). Where if that parameter is passed when clicking on the link, the searchstats plugin knows not to add to the count for that word/phrase. This way the only words counted in the search stats are terms people actually searched for on their own.

Anyway, just an idea. That was a change on made on mine.

gr8 idea i think
maybe i have sometime to update it soon and add it
thanx for ur feedback & support

Regards
Mahmoud

kushal 07-23-2007 02:15 AM

This is a really good hack for me. And putting it at what's going is is equally good. VbAdvanced module would put more value to it though.
Thank you!

coderphp 07-23-2007 02:17 AM

Quote:

Originally Posted by Wayne Luke (Post 1298680)
Yeah. I think it should go on the search page (both advanced search and search results) myself. The "What's Going On is already overcluttered that it will be ignored by most users and you don't need this information shown unless someone is looking to search.

yeah thanx for ur clearance of the topic..

but i think this place is suitable for this stat
if it is all going to go like u said, so we should move the "Members count stat" to the memberlist page :rolleyes:
i think the Forumhome footer is suitable for displaying multiple stats which belongs to different things

thanx again for ur feedback, of course everyone has his own point of view, this doesnt mean the other is false :)

coderphp 07-23-2007 02:19 AM

Quote:

Originally Posted by kushal (Post 1298696)
VbAdvanced module would put more value to it though.

as it was asked b4
i will think about integration with VBA

thanx for ur feedback :)
Regards

h2ojunkie 07-23-2007 04:37 AM

Quote:

Originally Posted by coderphp (Post 1298694)
gr8 idea i think
maybe i have sometime to update it soon and add it
thanx for ur feedback & support

Regards
Mahmoud

Here's how I did it - changes in red

forumhome_complete plugin:
Code:

if(!in_array(strip_tags($put['query']), $censor_words)) $most_searched .= "<a href=\"search.php?do=process&searchstats=nocount&q=". $put['query'] ."\"><font size=\"".$r."\">" . strip_tags($put['query']) . "</font></a> &nbsp;&nbsp;";

search_process_start plugin:
Code:

if($vbulletin->options['setting_searchstats_onoff'] AND $_REQUEST['searchstats']!='nocount')
Always glad to help with a great product when I can - I spend countless hours testing software, all that practice gives me a good eye for incremental improvements

projectego 07-23-2007 07:31 AM

Looks interesting, I might try this out at some point. Cheers. :)

wizardan 07-23-2007 11:26 AM

How would I go about editing in order to have the display font show up as 'smallfont'?

Andreas 07-23-2007 11:30 AM

As Wayne already suggested, I'd show this on Advanced Search.

TMS XML attached for those who need it :)

coderphp 07-23-2007 03:04 PM

Quote:

Originally Posted by h2ojunkie (Post 1298761)
Here's how I did it - changes in red

forumhome_complete plugin:
Code:

if(!in_array(strip_tags($put['query']), $censor_words)) $most_searched .= "<a href=\"search.php?do=process&searchstats=nocount&q=". $put['query'] ."\"><font size=\"".$r."\">" . strip_tags($put['query']) . "</font></a> &nbsp;&nbsp;";
search_process_start plugin:
Code:

if($vbulletin->options['setting_searchstats_onoff'] AND $_REQUEST['searchstats']!='nocount')
Always glad to help with a great product when I can - I spend countless hours testing software, all that practice gives me a good eye for incremental improvements

thanx h2ojunkie, gr8 idea..
if u dont mind i added ur snippet of code to the product, preserving ur copyright ;)
thanx again for ur help


Quote:

Originally Posted by projectego (Post 1298856)
Looks interesting, I might try this out at some point. Cheers. :)

thanx :)

Quote:

Originally Posted by wizardan (Post 1299102)
How would I go about editing in order to have the display font show up as 'smallfont'?

in forumhome_complete plugin code:
replace:
Code:

size=\"".$r."\"
with:
Code:

class=\"smallfont\"
Quote:

Originally Posted by Andreas (Post 1299106)
As Wayne already suggested, I'd show this on Advanced Search.

TMS XML attached for those who need it :)

thanx for ur feedback... and for the file :)

funkmeister 07-23-2007 07:13 PM

Quote:

Originally Posted by Andreas (Post 1299106)
As Wayne already suggested, I'd show this on Advanced Search.

TMS XML attached for those who need it :)

How do I implement this file? Keep getting an "invalid" message when importing - do I need to copy & paste contents somewhere? Also, do you have an example screenshot of what the resulting page will look like with this in place.

Thanks.

coderphp 07-23-2007 08:06 PM

Quote:

Originally Posted by funkmeister (Post 1299468)
How do I implement this file? Keep getting an "invalid" message when importing - do I need to copy & paste contents somewhere? Also, do you have an example screenshot of what the resulting page will look like with this in place.

Thanks.

to use this file, I think u should use TMS (Template Modification System) coded by Andreas

dj_f16 07-23-2007 09:18 PM

thank u man ;) very nice... installed

Qwest 07-24-2007 01:47 PM

I'd like to see this as a sidebar module.

So I can show the searched cloud on my sidebar www.agnosticforums.com

Or just some easy code I could paste into one of the boxes in my side module would be cool.

Qwest 07-24-2007 01:55 PM

Also what about permissions?

If you have this set so guests have to use CAPTCHA to search does this bypass that or do they get an error or something?

coderphp 07-24-2007 06:59 PM

Quote:

Originally Posted by Qwest (Post 1300184)
I'd like to see this as a sidebar module.

So I can show the searched cloud on my sidebar www.agnosticforums.com

Or just some easy code I could paste into one of the boxes in my side module would be cool.

try putting this code
Code:

$most_searched
at any place in ur FORUMHOME template
and tell me if it is not working

Quote:

Originally Posted by Qwest (Post 1300195)
Also what about permissions?

If you have this set so guests have to use CAPTCHA to search does this bypass that or do they get an error or something?

of course guests have to pass CAPCHA test if u require that

tirol07 07-24-2007 09:07 PM

fixed thank you..

ElForro 07-25-2007 06:38 AM

It would be possible to user a separate "censor list" only to be used in with this mod? I would like to censor some searches, but i can't censor that words in the whole forum..

Thanks, and it's a great mod!

bryanb 07-25-2007 09:45 AM

Help!!!

I just installed this mod and my entire forum has gone blank. I uninstalled this, and it's still blank! Any assistance would be appreciated!

Elenna 07-25-2007 06:49 PM

BryanB - try reverting the FORUMHOME template?

coderphp 07-25-2007 11:37 PM

Quote:

Originally Posted by ElForro (Post 1300898)
It would be possible to user a separate "censor list" only to be used in with this mod? I would like to censor some searches, but i can't censor that words in the whole forum..

Thanks, and it's a great mod!

sorry separate sensor list not available in this version
thanx for ur feedback

Quote:

Originally Posted by bryanb (Post 1301003)
Help!!!

I just installed this mod and my entire forum has gone blank. I uninstalled this, and it's still blank! Any assistance would be appreciated!

u must been done the template edit "FORUMHOME" wrong
as BryanB said, try retreiving the original FORUMHOME template
also put ur forum's link to see the problem

bryanb 07-26-2007 08:26 AM

I tried upgrading another mod a few days ago which mangled some of the database tables (which were repaired). When installing this mod, it somehow was affected by the other mod phpAdsNew Banner Ads integration

Anyway, I was able to correct this by having several of the templates reloaded. What a PITA.

As soon as I'm sure the other mod is fully uninstalled, I'll try this again.

Nick0r 07-26-2007 08:56 PM

Is anyone running the phpadsnew banner ads and this mod - and can confirm there are no compatibility issues?

ElForro 07-28-2007 06:29 PM

Quote:

Originally Posted by coderphp (Post 1301747)
sorry separate sensor list not available in this version
thanx for ur feedback


Do you think it would be possible to add this function in future versions?

Thanks!

lazytown 08-03-2007 09:56 AM

Quote:

Originally Posted by h2ojunkie (Post 1298663)
Just a thought, but it occurred to me that every time a user clicks on one of the "most searched" keywords on forum home it is actually increasing the count for the # of times that term/phrase was searched for, thereby falsely inflating the true number of searches people did on the term.

Since people are likely to click on them because...they can....it would seem those "most searched" words would be inflated and always remain showing in the top 20 most searched.

Maybe append a new parameter to the end of the link to each of those search terms something like (searchstats=donotcount for example). Where if that parameter is passed when clicking on the link, the searchstats plugin knows not to add to the count for that word/phrase. This way the only words counted in the search stats are terms people actually searched for on their own.

Anyway, just an idea. That was a change on made on mine.

There's no perfect solution to this because either way you are losing some data.. If someone clicks the link perhaps they would have searched for it anyways (and then you are discarding that).

Perhaps if they were kept track of separately (for admins to view)... So you can see how many clicks the 'search links' got on the homepage, and separately how many times someone entered a keyword search. Two separate stats.

Personally, once I have the time to install this mod, I am just going to use it to collect search stats for my own informational purposes (assuming it can be used this way)

-vissa

lazytown 08-03-2007 09:58 AM

By the way, how does this affect guests who have to enter the captcha verification before performing a search? If they click the keywords on the homepage, does it then take them to the advanced search with the keywords filled in (assuming captcha is turned on for guest searches)?

-vissa

coderphp 08-05-2007 10:57 AM

Quote:

Originally Posted by ElForro (Post 1304083)
Do you think it would be possible to add this function in future versions?

Thanks!

maybe ill add it in a future version
regards :)

Quote:

Originally Posted by vissa (Post 1308826)
By the way, how does this affect guests who have to enter the captcha verification before performing a search? If they click the keywords on the homepage, does it then take them to the advanced search with the keywords filled in (assuming captcha is turned on for guest searches)?

-vissa

if captcha is turned on, they have to enter the symbols b4 seeing the results

HDT 08-05-2007 07:50 PM

I have customs usergroup "Bulldog Guard" with user group id:9

Then when I set "who can see most searched keywords?" to 5,6,9 there only usergroup id 5,6 who can view the most searched keywords stats in the mainpage.

All user who included usergroup 9 doesnt see it.

Please help.


All times are GMT. The time now is 06:10 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.01485 seconds
  • Memory Usage 1,905KB
  • 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
  • (15)bbcode_code_printable
  • (4)bbcode_php_printable
  • (25)bbcode_quote_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
  • (40)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