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 1.0 (https://vborg.vbsupport.ru/showthread.php?t=139829)

coderphp 02-25-2007 05:22 AM

Quote:

Originally Posted by ncweb (Post 1190071)
Thanks Mahmoud, any chance of posting your mysql version? I'm a newb when it comes to mysql errors but still curious to know. I appreciate you work on this mod, I love being able to see what terms users are searching for. Also, I downloaded 2days ago.. what changes were made on 2/23/2007 and should I uninstall/upgrade? Thank you.

MySQL version: 4.1.21

re-upload the file admincp/search_stats.php as the variable "$this" was renamed to "$thispage"

dutchbb 02-25-2007 07:39 AM

Quote:

Originally Posted by coderphp (Post 1189902)
of course size is specified depending on the popularity of the keyword in ur forum

Ok but can it be ordered so that keywords with more searches are displayed instead of the ones that have only 1 search? :)

coderphp 02-25-2007 01:52 PM

Quote:

Originally Posted by dutchbb (Post 1190221)
Ok but can it be ordered so that keywords with more searches are displayed instead of the ones that have only 1 search? :)

Indeed keywords with more search times is displayed...
if you have all keywords searched just one time, then that means that no keyword is searched twice till now...

you can try to click on any keyword on the footer and search for it.. it is supposed to be larger the next time u visit the homepage

dutchbb 02-26-2007 03:06 PM

But it shows keywords with only one search on forumhome while there are keywords with more than one search.

The statistics also still show the top keyword with a lot of searches but it is blank. So I think something is wrong on my board. Its not wrking like it should.

coderphp 02-26-2007 04:16 PM

Quote:

Originally Posted by dutchbb (Post 1191155)
But it shows keywords with only one search on forumhome while there are keywords with more than one search.

The statistics also still show the top keyword with a lot of searches but it is blank. So I think something is wrong on my board. Its not wrking like it should.

ok there seems really something wrong... so u can re-install the hack & start testing it on ur own before people submit their searches

VIP66 02-26-2007 06:10 PM

Thank you

VIP

unitedpunjab 02-26-2007 08:00 PM

I modified the hack to process the search directly instead of taking to search page (I like it that way)
I am attaching the modified product file in case some one else want it that way,

Demo: http://www.unitedpunjab.co.uk/

coderphp 02-27-2007 07:42 AM

Quote:

Originally Posted by unitedpunjab (Post 1191366)
I modified the hack to process the search directly instead of taking to search page (I like it that way)
I am attaching the modified product file in case some one else want it that way,

Demo: http://www.unitedpunjab.co.uk/

thank you

FireFish 03-01-2007 03:31 AM

Nice mod; the only thing I'd change is the large font / font size representing the searches.

It makes my front page look inconsistent, so I disabled showing this on the front page.

I use it just to monitor from the AdminCP.

It would be nice to simply have the top searches there in a normal page font & do something like a mouse over or number next to each term in parenthesis representing search popularity.

coderphp 03-01-2007 09:15 AM

Quote:

Originally Posted by FireFish (Post 1193092)
Nice mod; the only thing I'd change is the large font / font size representing the searches.

It makes my front page look inconsistent, so I disabled showing this on the front page.

I use it just to monitor from the AdminCP.

It would be nice to simply have the top searches there in a normal page font & do something like a mouse over or number next to each term in parenthesis representing search popularity.

you can change the keywords font size this way:

Quote:

Originally Posted by Redlinemotorsports (Post 1188454)
Hi Nikki, the easiest way I could do it was this...

Go into your admincp > plugins & products > plugin manager

and edit Forum Search Stats 1.0 at hook location forumhome_complete

Then change:
PHP Code:

$rat 5/$max

To:
PHP Code:

$rat 2/$max

You can change 2 to whatever number you want. 2 is just what I have mine at


Tom_S 03-01-2007 11:03 AM

Installed then Uninstalled. It crashed my board:

Quote:

Database error in vBulletin 3.6.4:

Invalid SQL:
SELECT MAX(`count`) AS m FROM vb_coder_searchstats;

MySQL Error : Table 'myboard.vb_coder_searchstats' doesn't exist Error Number : 1146

Tom_S 03-01-2007 11:21 AM

Okay...I read through all this thread and see that I have to manually fix this issue. It also says it would be updated and fixed in the next few days from the 21st but it isn't. I will wait until it is. doing it manually is no problem. just don't want to :p

Great mod though ;)

coderphp 03-01-2007 09:00 PM

Quote:

Originally Posted by Tom_S (Post 1193257)
Okay...I read through all this thread and see that I have to manually fix this issue. It also says it would be updated and fixed in the next few days from the 21st but it isn't. I will wait until it is. doing it manually is no problem. just don't want to :p

Great mod though ;)

the new version isnot to be released now as im busy with my work...

u can query it manually though :)

dutchbb 03-19-2007 04:11 PM

Is there a way to just show the top 5 most searched on forumhome? Without changing the fontsize, just 1. keyword 2. keyword 3. etc...

I'm guessing it's

ORDER BY RAND()

rand = random? How to make it order by most searched?

coffee 04-27-2007 09:46 AM

Great job brother ..

Could you please add search terms from search engines like Google, Yahoo and MSN?

That can be done through reading visitor's browser header.

coderphp 05-02-2007 06:54 AM

Quote:

Originally Posted by dutchbb (Post 1207409)
Is there a way to just show the top 5 most searched on forumhome? Without changing the fontsize, just 1. keyword 2. keyword 3. etc...

I'm guessing it's

ORDER BY RAND()

rand = random? How to make it order by most searched?

replace
Code:

ORDER BY RAND()
with
Code:

ORDER BY `count`
regards

coderphp 05-02-2007 06:57 AM

Quote:

Originally Posted by coffee (Post 1236324)
Great job brother ..

Could you please add search terms from search engines like Google, Yahoo and MSN?

That can be done through reading visitor's browser header.

Ahlan mohammed :)

yes it could maybe soon ill add this feature

Regards

dutchbb 05-05-2007 08:35 AM

Quote:

Originally Posted by coderphp (Post 1239519)
replace
Code:

ORDER BY RAND()
with
Code:

ORDER BY `count`
regards

I tried it without succes.

Can you please check my plugin code for errors:

Quote:

if($vbulletin->options['setting_searchstats_showuser']){
$most_searched = "";
$m = $db->query_read("SELECT MAX(`count`) AS m FROM " . TABLE_PREFIX . "coder_searchstats");
$ma = $db->fetch_array($m);
$max = $ma['m'];
if($max)
{
$rat = 5/$max;
$get = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "coder_searchstats ORDER BY `count` LIMIT " . $vbulletin->options['setting_searchstats_showusernum']);
while($put = $db->fetch_array($get))
{
$r = round($rat*$put['count']);
$most_searched .= "<span dir=\"rtl\"><a href=\"search.php?q=". $put['query'] ."\"><font size=\"".$r."\">" . strip_tags($put['query']) . "</font></a></span>&nbsp;&nbsp;";
}
}
else
{
$most_searched .= "None";
}
}
Thank you

coderphp 05-05-2007 08:40 AM

Quote:

Originally Posted by dutchbb (Post 1241796)
I tried it without succes.

Can you please check my plugin code for errors:



Thank you

the code looks good

can u please copy the error u got?

dutchbb 05-05-2007 09:12 AM

it didn't order on count. But I installed it again and now it seems to order ok :)

But I still get this problem with the blank keyword:

http://aycu14.webshots.com/image/170...5538836_rs.jpg

dutchbb 05-05-2007 09:17 AM

Now it's ordering random again... strange. Ill' try to disable other plugins, maybe something is interfering.

dutchbb 05-05-2007 09:42 PM

Ok ordering is solved, needed to add 'DESC'

thanks anyway coder

Muellmann 05-05-2007 10:21 PM

Works not, tableprefix at (un-)installcode missing. :down:

coderphp 05-30-2007 09:51 PM

Quote:

Originally Posted by dutchbb (Post 1242115)
Ok ordering is solved, needed to add 'DESC'

thanks anyway coder

thank you

Cagonni 06-04-2007 06:29 PM

gr8 work for seo ;)

Cagonni 06-05-2007 04:59 AM

Quote:

Originally Posted by unitedpunjab (Post 1191366)
I modified the hack to process the search directly instead of taking to search page (I like it that way)
I am attaching the modified product file in case some one else want it that way,

you right.i permit guests to search keywords.Search engines can search directly to index more pages.but this hack doesnt search the keywords directly its only go to the search page and enter the keyword.I will try urs ;)

ricker 06-10-2007 12:42 AM

I'm getting the blank keyword as well. Any fix for this?

jderouen 06-10-2007 04:09 PM

It works great for me, however.... is there any way to get it NOT to list words that are in the censor filter? Ie: if you search for "the f word" (you know what I mean) it lists it, plain as day, under the searches. Not good if you run a family-oriented forum.

jderouen 06-11-2007 10:48 PM

Quote:

Originally Posted by dutchbb (Post 1242115)
Ok ordering is solved, needed to add 'DESC'

thanks anyway coder

Can you tell me exactly what you changed to do this? I to want to order it by count.

Thanks!
Joe

dotJoel 06-20-2007 12:31 AM

Excellent Mod, thankyou very much. I just manually had to enter the forum database prefix and worked a treat.

Regards,

Joel

Nick0r 06-20-2007 05:19 PM

Great idea for a hack. I've asked many people about something exactly like this! There is no better keyword data than from your internal search!

Edit: gah - is there anyway that the output can be displayed on a page in the admin control panel. I don't want others to see this data, it should be used internally only. Like a list of the last 100 searches or something.

feverhost 06-20-2007 05:27 PM

Cool Mod.. thx!!

msalman 06-24-2007 12:11 AM

Quote:

Originally Posted by Tom_S (Post 1193246)
Installed then Uninstalled. It crashed my board:

you need to replace the install code and uninstall code lines in xml file with following

Code:

<installcode><![CDATA[$db->hide_errors();
$db->query_write("CREATE TABLE" .TABLE_PREFIX. "coder_searchstats ( `id` int(10) unsigned NOT NULL auto_increment, `query` varchar(200) NOT NULL default '', `dateline` int(10) unsigned NOT NULL default '0', `count` int(11) NOT NULL default '0', PRIMARY KEY (`id`) )");
$db->show_errors();]]></installcode>
                        <uninstallcode><![CDATA[$db->hide_errors();
$db->query_write("DROP TABLE" .TABLE_PREFIX. "coder_searchstats");
$db->show_errors();]]></uninstallcode>


under_takers 06-25-2007 06:27 PM

Hello, i just install this module and after this i get this error

Quote:

Database error in vBulletin 3.6.7:

Invalid SQL:
SELECT MAX(`count`) AS m FROM vb_coder_searchstats;

MySQL Error : Table 'ibp.vb_coder_searchstats' doesn't exist
Error Number : 1146
Date : Monday, June 25th 2007 @ 11:53:39 AM
Script : http://www.xxxxxx-xxxx.com/vb/forum.php
Referrer :
IP Address : 125.xxx.xx.xx
Username : xxxxxxxx
Classname : vb_database

powerful_rogue 06-28-2007 02:10 PM

Quote:

Originally Posted by Nick0r (Post 1272598)
Great idea for a hack. I've asked many people about something exactly like this! There is no better keyword data than from your internal search!

Edit: gah - is there anyway that the output can be displayed on a page in the admin control panel. I don't want others to see this data, it should be used internally only. Like a list of the last 100 searches or something.

I also want to install this mod, but only have the data available in the admin section. Is this possible at all?

cellarius 07-01-2007 07:33 AM

:confused:

When using this mod in Firefox, the keywords show weird behavior. For instance: a keyword like "Roma Pass" would show "Pass" at the end of line 2 and "Roma" at the beginning of line 1. (See screenshot 1, and yes, this is one keyword, not two). Also, as soon as one clicks a keyword, the keywords sort of jump around and even disintegrate before the search-page is loaded, and most of the time the search page isn't even loaded at all.

Link: http://www.roma-antiqua.de/forum/
Screenshots attached.

This is the source code of the page:

HTML Code:

  <td class="alt1" width="100%"><span dir="rtl"><a rel="nofollow" href="http://www.roma-antiqua.de/forum/search.php?do=process&amp;query=jugendherberge"><font size="3">jugendherberge</font></a></span>&nbsp;&nbsp;<span dir="rtl"><a rel="nofollow" href="http://www.roma-antiqua.de/forum/search.php?do=process&amp;query=rom meer"><font size="3">rom meer</font></a></span>&nbsp;&nbsp;<span dir="rtl"><a rel="nofollow" href="http://www.roma-antiqua.de/forum/search.php?do=process&amp;query=romapass"><font size="2">romapass</font></a></span>&nbsp;&nbsp;<span dir="rtl"><a rel="nofollow" href="http://www.roma-antiqua.de/forum/search.php?do=process&amp;query=Roma Pass"><font size="3">Roma Pass</font></a></span>&nbsp;&nbsp;<span dir="rtl"><a rel="nofollow" href="http://www.roma-antiqua.de/forum/search.php?do=process&amp;query=Toiletten"><font size="3">Toiletten</font></a></span>&nbsp;&nbsp;<span dir="rtl"><a rel="nofollow" href="http://www.roma-antiqua.de/forum/search.php?do=process&amp;query=Kolosseum"><font size="5">Kolosseum</font></a></span>&nbsp;&nbsp;<span dir="rtl"><a rel="nofollow" href="http://www.roma-antiqua.de/forum/search.php?do=process&amp;query=tempel"><font size="2">tempel</font></a></span>&nbsp;&nbsp;<span dir="rtl"><a rel="nofollow" href="http://www.roma-antiqua.de/forum/search.php?do=process&amp;query=taxi pauschale"><font size="3">taxi pauschale</font></a></span>&nbsp;&nbsp;<span dir="rtl"><a rel="nofollow" href="http://www.roma-antiqua.de/forum/search.php?do=process&amp;query=taxi"><font size="2">taxi</font></a></span>&nbsp;&nbsp;<span dir="rtl"><a rel="nofollow" href="http://www.roma-antiqua.de/forum/search.php?do=process&amp;query=Fiumicino"><font size="2">Fiumicino</font></a></span>&nbsp;&nbsp;</td>
I suspect this behaviour might be due to the fact, that all keywords seem to be embeddet into a span-Tag: "<span dir="rtl">".

In IE everything works just fine.

cellarius 07-01-2007 12:36 PM

Never mind, fixed it myself. Maybe you should think about changing the code accordingly?

I had to change the code of the "forumhome_complete" plugin. It's this piece of code:
Code:

$r = round($rat*$put['count']);
$most_searched .= "<span dir=\"rtl\"><a href=\"search.php?q=". $put['query'] ."\"><font size=\"".$r."\">" . strip_tags($put['query']) . "</font></a></span>&nbsp;&nbsp;";

I removed the <span>-Tag completely, which solved the problem of the "jumping" keywords when clicked in Firefox and spawned no other issues.

Next problem, which caused the funny line-changing-behaviour I described: If you insert "&nbsp;&nbsp;" only, Firefox will not allow linebreaks there - which is exactly as it should be (after all, nbsp stands for non breaking space). So linebreaks will only be where there happens to be a space in the keywords (i.e. if the search term consists of two words). Solution: Add a normal space in the code after the closing a-Tag.

So, the code from above looks like this and now works all well in Firefox!
Code:

$r = round($rat*$put['count']);
$most_searched .= "<a href=\"search.php?q=". $put['query'] ."\"><font size=\"".$r."\">" . strip_tags($put['query']) . "</font></a> &nbsp;&nbsp;";

Attached you will find the altered addon-code with those changes applied. One version handles clicks like the original (goes to the search-page with the keyword filled in as search-term), one like the version by unitedpunjab (See this post).

---

Furthermore I centered the keywords, which is really easy to do. Instead of the original template-modification-code provided, use this:
Code:

<if condition="$vbulletin->options['setting_searchstats_showuser']">
<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>


cellarius 07-01-2007 08:24 PM

Another question I have.

At my forum it seems that not the most searched keywords are displayed, but a random choice of all keywords. If I hit reload every so often, sometimes one or other of my most searched for keywords vanish.

BrettMo 07-02-2007 09:10 PM

PHP Code:

Database error in vBulletin 3.6.5:

Invalid SQL:
SELECT COUNT(`id`) AS `cFROM PREFIXcoder_searchstats WHERE query='search this';

MySQL Error  Table 'user_dbname.PREFIXcoder_searchstats' doesn't exist
Error Number : 1146 

Same as Under_takers, I see an error when I try to use this. I just disabled it and my site is working normally again so no harm done, but I really wanted to see what people search for. Any ideas how to fix that error?

Also, it would be great if you could make it so that it would log what people search for via the Zoints Tag search.

Expertu 07-03-2007 06:16 PM

For all the people who have the SQL problem:

You have to rename the created table, MANUALLY, with PhpMyAdmin or other SQL management scripts, from coder_searchstats, to vb_coder_searchstats.

The creator of this module, appends all over the place, the VB standard table prefix, although he creates the database without it.


All times are GMT. The time now is 12:29 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.01512 seconds
  • Memory Usage 1,869KB
  • 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
  • (1)bbcode_html_printable
  • (3)bbcode_php_printable
  • (20)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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