Author Topic: [MOD] Search Statistics v1.2  (Read 160748 times)

0 Members and 1 Guest are viewing this topic.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Search Statistics v1.2
« Reply #30 on: April 06, 2005, 02:06:34 PM »
hmmm...I think the date("d-m-y h:i A", $result['date']) function should be replaced by format_date($config['date_format']." ".$config['time_format'], $result['date'])
this way it will use date format from the settings
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline RoadDogg

  • Sr. Member
  • ****
  • Posts: 488
    • View Profile
    • Düsipixel
Re: [MOD] Search Statistics v1.2
« Reply #31 on: April 12, 2005, 02:46:14 PM »
I didn´t figure out how to show:

"Search was used XXX times"
on search_stats page

How can I count how often search was used for each word and phrase altogether?
For support requests please don´t forget link to your Gallery/to phpinfo.php
Code: [Select]
<?
phpinfo()
?>
safe_mode must turned OFF
Please check Error Messages

Offline marcus_s

  • Newbie
  • *
  • Posts: 33
    • View Profile
Re: [MOD] Search Statistics v1.2
« Reply #32 on: April 13, 2005, 02:49:01 PM »
hi!

i installed serach statistics without any problems. but when i point my browser to http://mysite/mygallery/search_stats.php

i get these error messages:


Code: [Select]
Warning: Invalid argument supplied for foreach() in mysite/mygallery/search_stats.php on line 95

which is in the document serach_stats.php
Code: [Select]
foreach ($lang['search_stats_sort_options'] as $key => $val) {
and

Code: [Select]
Warning: Invalid argument supplied for foreach() in mysite/mygallery/search_stats.php on line 106

which is
Code: [Select]
foreach ($lang['search_stats_order_options'] as $key => $val) {
within the layout.


what could cause this?

i also see no link at my search.php after adding {search_stats} to my serach_form.html template.

any suggestions?

everything else is working correctly.

thank you.

marcus

Offline RoadDogg

  • Sr. Member
  • ****
  • Posts: 488
    • View Profile
    • Düsipixel
Re: [MOD] Search Statistics v1.2
« Reply #33 on: April 13, 2005, 02:59:46 PM »
Have you set the new language variables to lang/YOURLANGUAGE/main.php?

Have you replaced paging.php ?
http://www.4homepages.de/forum/index.php?topic=6926.0
For support requests please don´t forget link to your Gallery/to phpinfo.php
Code: [Select]
<?
phpinfo()
?>
safe_mode must turned OFF
Please check Error Messages

Offline marcus_s

  • Newbie
  • *
  • Posts: 33
    • View Profile
Re: [MOD] Search Statistics v1.2
« Reply #34 on: April 13, 2005, 03:12:08 PM »
Have you set the new language variables to lang/YOURLANGUAGE/main.php?

where do i have to do that?

Have you replaced paging.php ?
http://www.4homepages.de/forum/index.php?topic=6926.0

yes.

marcus

Offline RoadDogg

  • Sr. Member
  • ****
  • Posts: 488
    • View Profile
    • Düsipixel
Re: [MOD] Search Statistics v1.2
« Reply #35 on: April 13, 2005, 03:14:57 PM »
try this

Code: [Select]
Step 3.
Open /lang/<yourlanguage>/main.php
At the end of the file, just before closing ?> add this:

//-----------------------------------------------------
//--- Search Statistics -------------------------------
//-----------------------------------------------------
$lang['search_stats'] = "Search Statistic";
$lang['search_stats_words'] = "Words";
$lang['search_stats_phrases'] = "Phrases";
$lang['search_stats_paging'] = "Found {words} words(s) and {phrases} phrase(s) on {total_pages} page(s).";
$lang['search_stats_sort'] = "Sort stats by:";
$lang['search_stats_perpage'] = "Per page:";
$lang['search_stats_nowords'] = "No words were found";
$lang['search_stats_nophrases'] = "No phrases were found";
$lang['search_stats_date_alt'] = "Date of last search";
$lang['search_stats_sort_options'] = array(
"text" => "Alphabet",
"count" => "Count",
"date" => "Date",
"guests" => "Guests",
"users" => "Users",
"admins" => "Admins"
);
$lang['search_stats_order_options'] = array(
  "ASC"  => "Ascending",
  "DESC" => "Descending"
);
//--- End Search Statistics ---------------------------
For support requests please don´t forget link to your Gallery/to phpinfo.php
Code: [Select]
<?
phpinfo()
?>
safe_mode must turned OFF
Please check Error Messages

Offline marcus_s

  • Newbie
  • *
  • Posts: 33
    • View Profile
Re: [MOD] Search Statistics v1.2
« Reply #36 on: April 13, 2005, 03:32:53 PM »
oh sorry. yes i did. of course.

i did everything exactly (i´m quite sure) like it was written down in v@nos install.doc.

i do coding on a mac with an application called "hyperedit" which validates and alerts errors in the php-code immediately.
i got no error messages while replacing / adding code to the documents. i am nevertheless a php-noob.

so …

 :?

thanks, m

Offline marcus_s

  • Newbie
  • *
  • Posts: 33
    • View Profile
Re: [MOD] Search Statistics v1.2
« Reply #37 on: April 14, 2005, 09:13:58 PM »
no suggestions?

 :?

m

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Search Statistics v1.2
« Reply #38 on: April 15, 2005, 12:39:54 AM »
either u didnt add the needed code from Step 3 in the correct file/dir or u didnt upload the changed file to the server.
the errors could happend only if main.php file wasnt updated.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline RoadDogg

  • Sr. Member
  • ****
  • Posts: 488
    • View Profile
    • Düsipixel
Re: [MOD] Search Statistics v1.2
« Reply #39 on: April 16, 2005, 06:12:08 PM »
I didn´t figure out how to show:

"Search was used XXX times"
on search_stats page

How can I count how often search was used for each word and phrase altogether?

Do anybody know how to count all times search was used?
For support requests please don´t forget link to your Gallery/to phpinfo.php
Code: [Select]
<?
phpinfo()
?>
safe_mode must turned OFF
Please check Error Messages

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Search Statistics v1.2
« Reply #40 on: April 16, 2005, 06:28:52 PM »
in search_stats.php find:
Code: [Select]
  "paging" => $getpaging->get_paging(),insert above:
Code: [Select]
  "total_count" => $words+$phrases,then u can use {total_count} tag in the template.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline RoadDogg

  • Sr. Member
  • ****
  • Posts: 488
    • View Profile
    • Düsipixel
Re: [MOD] Search Statistics v1.2
« Reply #41 on: April 17, 2005, 07:33:41 PM »
thanks, but I meant sth other:
I want to count all search hits together - sum each search hit up.

Keyword flower was found 35 times
Keyword portrait was found 40 times
phrases XYZ was found 22 times
...

Alltogehter "we had 512 search hits"
For support requests please don´t forget link to your Gallery/to phpinfo.php
Code: [Select]
<?
phpinfo()
?>
safe_mode must turned OFF
Please check Error Messages

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Search Statistics v1.2
« Reply #42 on: April 17, 2005, 08:21:56 PM »
and that what the code I posted supposed to do...:?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline RoadDogg

  • Sr. Member
  • ****
  • Posts: 488
    • View Profile
    • Düsipixel
Re: [MOD] Search Statistics v1.2
« Reply #43 on: April 17, 2005, 08:52:54 PM »
no, it sums up how many words and phrases were searched for. For example: flower, potrait, landscape = 3  (point "1." on attached picture)
What I´m searching for (how many hits do each word an phrase have) : Flowers (4 times), potrait (2 times), landscape (4 times) = 10 search hits altogehther (point "2." on attached picture).

Sorry for that complicate explanation  :|
For support requests please don´t forget link to your Gallery/to phpinfo.php
Code: [Select]
<?
phpinfo()
?>
safe_mode must turned OFF
Please check Error Messages

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Search Statistics v1.2
« Reply #44 on: April 17, 2005, 10:00:38 PM »
ah, I see now.
ok, remove the line I've mentioned above.
and insert
Code: [Select]
$sql = "SELECT SUM(*) AS num
        FROM ".SEARCH_STATS_TABLE;
$total = $site_db->query_firstrow($sql);
$site_template->register_vars("total_count", $total['num']);
below
Code: [Select]
$offset = $getpaging->get_offset();use same tag: {total_count}

P.S. not tested.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)