4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: V@no on June 04, 2003, 08:49:17 AM
-
This MOD was originaly created by www.girls-on-bikes.com ( http://4homepages.de/forum/viewforum.php?f=11 )
I just adopted it as a "public" MOD
[MOD] Search Statistics v1.5 | Works with 1.7.2 - 1.7.4 (http://www.4homepages.de/forum/index.php?topic=6033.msg95419#msg95419) thanks to ivan
------ Overview -----------
This MOD will log all searched words and phrases and count each unique word/phrase. When searched with just one word, it will be logged/count as "word" and when searched with two or more words it will be logged and count as a "phrase" and will not log/count each separate word from that phrase.
------ News ----------------
v1.2.
- Added count of who was searching word/phrase (guest, user or admin) (edit search_stats.php and set $show_more to 1 or 0)
- Date display now can be anabled/disabled (edit search_stats.php and set $show_date to 1 or 0)
v1.1.
- Added log last search date of word/phrase
All neccessery files and instruction u can find in this file:
http://gallery.vano.org/file30dl (see attachment below)
demo:
http://gallery.vano.org/search (there is a link "Search Statistics" at the left-bottom)
-
Awesome, thanks V@no!
I'm glad to see somebody could take the idea and turn it into a real mod.
I'll have to try out the "official" version when I get home.
-
Thx xwall for finding an error in the code, I have fixed at my site, but forgot update the installation guide...
if u already have installed this MOD, find in /search.php:if (count($split_words) < 1) {
and replace with:if (count($split_words) == 1) {
-
great Mod - I'll work a little on it and will repost it as an admin plugin as for our purpose we rather not make it accessible for the users.
Thanks again - I'm sort of struggeling with getting all your mods into my installation ;)
You deliver faster than I can install 'em ...
cheers,
Bernd
-
great Mod - I'll work a little on it and will repost it as an admin plugin as for our purpose we rather not make it accessible for the users.
yes, good idea! I think this should be done in the first place...
also, since u dont want show it to the public, then u might want make it to log all words, because right now it will log words that are not in the "bad" list (the ones, that u can set in 4images settings)
-
I just updated this mod. Now it uses only one table in the database, that means only one query needed to pull out data. Also, added date log when word/phrase was searched last time.
You'll need do again all steps and manualy delete 4images_search_words and 4images_search_phrases tables
-
Who makes the search Guest? user? admin? :wink:
Is it possible knowledge it? 8)
Great MOD.
-
Who makes the search Guest? user? admin? :wink:
Is it possible knowledge it? 8)
Great MOD.
done :D
redownload the package, read upgrade instructions at the bottom of the intallation guide.
P.S. the installer will automaticaly determin if database already exist and if it needs to be updated or create new one.
-
Excellent work!!!
The last requirement that is needed in this mod is, How many results that appear when making the search? :wink:
Phrases (love hewitt) Count (3) Guests (1) Users (2) Admins (0) Results (27)
-
The last requirement that is needed in this mod is, How many results that appear when making the search? :wink:
Phrases (love hewitt) Count (3) Guests (1) Users (2) Admins (0) Results (27)
do u mean to log how many images where found when searched word/phrase? :? are u sure?
but u always just can click on the phrase/word and find it out yourself...(I can add an extra code that wont count admin when hit from the search stats - that would be more accurate.)
-
(I can add an extra code that wont count admin when hit from the search stats - that would be more accurate.)
if you can do it, do it. 8)
If to see the number of results is not the best thing, at least to know if there are results of that search (Results [Yes] [No]).
I am interested in the searches that do not have results. :?
-
V@no why dont you put something similar like PMS (Deleted selected and Deleted all).
Some words or phrases are crazy 8O and to erase them i must go to the Data Base. :wink:
-
Install failed?
CREATE TABLE `4images_search_stats` ( `text` varchar( 255 ) NOT NULL default \'\', `word` tinyint( 1 ) NOT NULL default \'0\', `count` mediumint( 10 ) NOT NULL default \'1\', `date` int( 11 ) NOT NULL default \'0\', `guests` mediumint( 10 ) NOT NULL default \'0\', `users` mediumint( 10 ) NOT NULL default \'0\', `admins` mediumint( 10 ) NOT NULL default \'0\', KEY `text` ( `text` ) ) TYPE = MYISAM
DB Error: Bad SQL Query: CREATE TABLE `4images_search_stats` ( `text` varchar( 255 ) NOT NULL default \'\', `word` tinyint( 1 ) NOT NULL default \'0\', `count` mediumint( 10 ) NOT NULL default \'1\', `date` int( 11 ) NOT NULL default \'0\', `guests` mediumint( 10 ) NOT NULL default \'0\', `users` mediumint( 10 ) NOT NULL default \'0\', `admins` mediumint( 10 ) NOT NULL default \'0\', KEY `text` ( `text` ) ) TYPE = MYISAM
You have an error in your SQL syntax near '\'\', `word` tinyint( 1 ) NOT NULL default \'0\', `count` mediumint( 10 ) NOT NU' at line 1
CREATE TABLE `4images_search_stats` ( `text` varchar( 255 ) NOT NULL default \'\', `word` tinyint( 1 ) NOT NULL default \'0\', `count` mediumint( 10 ) NOT NULL default \'1\', `date` int( 11 ) NOT NULL default \'0\', `guests` mediumint( 10 ) NOT NULL default \'0\', `users` mediumint( 10 ) NOT NULL default \'0\', `admins` mediumint( 10 ) NOT NULL default \'0\', KEY `text` ( `text` ) ) TYPE = MYISAM
-
Install failed?
ooopss :oops:
please either open search_stats_install.php and replace all \' to '
or redownload the package.
-
for wich version is this mod ?
-
for wich version is this mod ?
version of what? :?
-
4images,
version 1.6
version 1.7
-
Version 1.7
-
it's a pitty
-
it's a pitty
I think pitty when ppl still using outdated software and still trying get support for it... ;)
-
ppppfffffffff, a very strange reaction
-
ppppfffffffff, a very strange reaction
no, no offense ;) :)
-
All neccessery files and instruction u can find in this file:
http://come.no-ip.com/files.php?id=30
demo:
http://come.no-ip.com/search.php (there is a link "Search Statistics" at the left-bottom)
hi.
these files are gone. :(
could someone please recover and then post a link to them here?
thank you! :)
m
-
thanks v@no! :D
marcus
-
Does this Mod work with "Keyword Jump Menu"-Mod?
Will searchwords selected by Jump menu also be counted?
-
if I'm not misstaken the "Keyword Jump Menu" works the same as if u type a keyword in the search field and hit "search" button...if it is, then yes, this mod should count it as search keywords.
-
ok, thank you.
can anybody pleas publish the "right" code of new Paging Class (which you need for Search Stats Mod) ?
In this thread
http://4homepages.de/forum/index.php?topic=5761.0
it´s confusingly encoded
if (!defined('ROOT_PATH')) {
-
please use this mod:
http://www.4homepages.de/forum/index.php?topic=6926.0
P.S. I've updated the topic u were refering to ;)
-
thanks a lot.
It works great. And it works with Keyword Jump Menu.
-
If someone wants to display date in european standard:
Falls jemand das Datum dem europäischen Standard entsprechen angezeigt haben möchte:
search_stats.php
Find
$words .= ($show_date) ? "<td nowrap title=\"".$lang['search_stats_date_alt']."\">".date("d-m-y h:i A", $result['date'])."</td>\n" : "";
Replace with
$words .= ($show_date) ? "<td nowrap title=\"".$lang['search_stats_date_alt']."\">".date("d.m.y G:i", $result['date'])."</td>\n" : "";
Find
$phrases .= ($show_date) ? "<td nowrap title=\"".$lang['search_stats_date_alt']."\">".date("d-m-y h:i A", $result['date'])."</td>\n" : "";
Replace with
$phrases .= ($show_date) ? "<td nowrap title=\"".$lang['search_stats_date_alt']."\">".date("d.m.y G:i", $result['date'])."</td>\n" : "";
Hier ein Übersetzungsvorschlag für die Sprachvariablen
//-----------------------------------------------------
//--- Search Statistics -------------------------------
//-----------------------------------------------------
$lang['search_stats'] = "Suchwortstatistik";
$lang['search_stats_words'] = "Suchwörter";
$lang['search_stats_phrases'] = "Suchphrasen";
$lang['search_stats_paging'] = "{words} Suchworte und {phrases} Suchphrasen auf {total_pages} Seite(n) gefunden.";
$lang['search_stats_sort'] = "Statistik sortieren nach:";
$lang['search_stats_perpage'] = "pro Seite:";
$lang['search_stats_nowords'] = "Keine Suchworte gefunden";
$lang['search_stats_nophrases'] = "Keine Suchphrasen gefunden";
$lang['search_stats_date_alt'] = "Datum der letzten Suche";
$lang['search_stats_sort_options'] = array(
"text" => "Alphabet",
"count" => "Anzahl",
"date" => "Datum",
"guests" => "Gäste",
"users" => "Mitglieder",
"admins" => "Admin"
);
$lang['search_stats_order_options'] = array(
"ASC" => "Aufsteigend",
"DESC" => "Absteigend"
);
//--- End Search Statistics ---------------------------
-
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
-
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?
-
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:
Warning: Invalid argument supplied for foreach() in mysite/mygallery/search_stats.php on line 95
which is in the document serach_stats.php
foreach ($lang['search_stats_sort_options'] as $key => $val) {
and
Warning: Invalid argument supplied for foreach() in mysite/mygallery/search_stats.php on line 106
which is
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
-
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
-
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
-
try this
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 ---------------------------
-
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
-
no suggestions?
:?
m
-
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.
-
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?
-
in search_stats.php find:
"paging" => $getpaging->get_paging(),
insert above: "total_count" => $words+$phrases,
then u can use {total_count} tag in the template.
-
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"
-
and that what the code I posted supposed to do...:?
-
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 :|
-
ah, I see now.
ok, remove the line I've mentioned above.
and insert$sql = "SELECT SUM(*) AS num
FROM ".SEARCH_STATS_TABLE;
$total = $site_db->query_firstrow($sql);
$site_template->register_vars("total_count", $total['num']);
below$offset = $getpaging->get_offset();
use same tag: {total_count}
P.S. not tested.
-
It gives same worth as your first code ?
-
It gives same worth as your first code ?
as I said I didnt test it.
also if u didnt remove my first code, then it will owerwrite result from the last posted code.
-
$sql = "SELECT SUM(count) AS num
FROM ".SEARCH_STATS_TABLE;
$total = $site_db->query_firstrow($sql);
$site_template->register_vars("total_count", $total['num']);
It works, no idea what I did yesterday. Uploaded wrong file or something :roll:
:!: Thank you :!:
-
Hello
could you tell me how to reset the search statistic?
sincerly
vincent
-
clear 4images_search_stats table via phpMyadmin?!
-
hello i have installed this mod all is working but i get this printed out
(http://www.artpictures.tv/fm/stat.jpg)
on screen, where in the code can i remove this please v1.71, i have deleted the DB field and run the stats_install but still the same
thanks
RT
-
is this why this is happening
http://www.4homepages.de/forum/index.php?topic=6806.0
as it did not show these tags when i had 1.7 :(
edited ..................
yes i found the answer click above :D
-
Danke für den Link zu dem conditional tags mod. Ich hatte das gleiche Problem .... ist jetzt gelöst :mrgreen:
-
:D
-
I have a strange thing, only phrases are added to search statistics...
i check the mysql with phpMyAdmin and there are no words, only phrases...
Search are working good, but i have no statistics about searching words.
What it could be?
-
recheck Step 1.2
P.S. so, where does the single word goes after the search?
For example try to search for a random, unique string, and check database if that string was added at all.
P.P.S. can we test it?
-
Thanks a lot!
It was my stuipid fault...
I was trying to install this mod two times, but every time i missed step 1.2 :)
Thanks again.
P.S. I`m also from Russia, but i`m from Moscow.
-
Look stats only admin.
Open search_stats.php
find
include(ROOT_PATH.'includes/page_header.php');
add after
if ($user_info['user_level'] != ADMIN) {
show_error_page($lang['no_permission']);
}
-
Hello
i have the Problem that the words are added to the Phrases - but i have added step 1.2
http://www.foto-kocher.com/search_stats.php
elseif ($split_words[$i] != "" && strlen($split_words[$i]) >= MIN_SEARCH_KEYWORD_LENGTH && strlen($split_words[$i]) <= MAX_SEARCH_KEYWORD_LENGTH && !in_array($split_words[$i], $stopword_list)) {
// start Search_stat
if (count($split_words) == 1) {
$sql = "UPDATE ".SEARCH_STATS_TABLE."
SET count = count + 1, word = 1, date = ".time().", ".$who." = ".$who." + 1
WHERE text LIKE '".addslashes(str_replace("*", "", $split_words[$i]))."' AND word = 1";
$site_db->query($sql);
if (!$site_db->affected_rows()) {
$sql = "INSERT INTO ".SEARCH_STATS_TABLE."
(text, word, date, ".$who.")
VALUES
('".addslashes(str_replace("*", "", $split_words[$i]))."', 1, ".time().", 1)";
$site_db->query($sql);
}
}
// end Search_stat
so who else coud be the fault?
-
i Found out that this mess with phrase and word only happen with count, if i change to date it works fine!
why this happen?
and would do i have to change to have it by default sorted by date?
sincerly
vincent
-
...
and would do i have to change to have it by default sorted by date?
...
in search_stats.php finde :
if (isset($session_info['srchstatssort'])) {
$sort = $session_info['srchstatssort'];
}else{
$sort = "count";
}
und ersetze es durch :
if (isset($session_info['srchstatssort'])) {
$sort = $session_info['srchstatssort'];
}else{
$sort = "date";
}
mawenzi
-
it works Mawenzi - thanks a lot!
but if you click on this to change to sort so it is showing confusion with phrase and words :?:
vincent
-
ja das sieht in deiner Suchstatistik schon etwas konfus aus ... :?
ich würde an deiner Stelle die search_stats.php gegen die original search_stats.php austauschen ...
mawenzi
-
habe ich gestern gemacht - wobei was ist die Original datei?
gruss
vincent
-
...
wobei was ist die Original datei?
...
... die search_stats.php aus der search_stats.zip ... :wink:
mawenzi
-
das TXT löschen dann hast du meine Org datei!
gruss
vincent
-
...
ich würde an deiner Stelle die search_stats.php gegen die original search_stats.php austauschen ...
...
... ergo ... du solltest das auch machen ... :roll:
-
wie kommst du darauf das es eine nicht originale ist?
ich habe sie aus dem Zip rausgenommen und auf den server gelegt!
oder hast du eine bessere Zip datei :?
gruss
vincent
-
hättest nur eine seite zurück blättern brauchen, da hättest du diesen link gefunden
http://www.4homepages.de/forum/index.php?topic=6806.0
bitte erst auf zitat klicken und dann den code nehmen :wink:
-
Habe eine Frage zu dem MOD
es werden ja jetzt die Ordner in der Vorschau angezeigt
Nun möchte ich aber auch noch den Jahrgang angezeigt bekommen, der 2 Ordner vorher angezeigt wird
Wie müsste denn der Code heissen, denn mit cat_name wird ja nur der aktuelle angezeigt, und ich bräuchte 2 weiter vorne.
z.B. hier Jahrgang : 2001/02
Danke Harald
(http://www.ue-ei-portal.de/bilder/jahrgang.jpg)
-
hello,
the search function still works, but on the top of the page i get this error :
DB Error: Bad SQL Query: UPDATE 4images_search_stats SET count = count + 1, word = 1, date = 1137919868, guests = guests + 1 WHERE text LIKE 'apple' AND word = 1
Can't open file: '4images_search_stats.MYI' (errno: 145)
Just discovered it, don't know how long it's there. ( edupics.com )
Someone has an idea how to deal with this ?
Thx !
-
Try to repare the table, if it doesnt help, then you'll need to remove the new table and re-create the table...
There something happend on your server, you also should contact your host administrator about this error.
-
How can i fix this?
(http://img33.imageshack.us/img33/4858/unbenannt7nz.th.jpg) (http://img33.imageshack.us/my.php?image=unbenannt7nz.jpg)
-
This is a great mod, :D
it works perfect, 8)
no problems at all :lol:
thanks V@no :mrgreen:
-
Hey everyone...
ok on my search_stats.php page I have no options or drop down to choose what I would like to sort by. I have reinstalled this mod twice and got the same problem both times. I am positive I did not miss the same thing twice. If anyone has an idea of what it would be. Please take a look at my problem at http://photographybyweston.com/gallery/search_stats.php
Thanks in advance!
Weston
-
Hmm, I seems that search.php has changed with the new version of 4images 1.7.2...
I can't find for example
elseif ($split_words[$i] != "" && strlen($split_words[$i]) >= MIN_SEARCH_KEYWORD_LENGTH && strlen($split_words[$i]) <= MAX_SEARCH_KEYWORD_LENGTH && !in_array($split_words[$i], $stopword_list)) {
nor
"search_keywords" => htmlspecialchars(stripslashes($org_search_keywords)),
It would be great if someone could modify the code for this version - I think others are interested in this too :-)
I attached search.php(.txt) of the 4images-Version 1.7.2
Thx, bye Konradin
-
Yes that reminds me now there was one line that had changed but I found what it was now in 1.7.2. That would be what messed it up probably. Anyone have it for 1.7.2?
-
Is there a new/another download available, cause Veno´s site is not online yet?
-
It would be nice to get this mod! Cause the download link from Vanos site is down.
Could someone please share it?
Thx for your help
-
hi vano
could you please attach the file?
thanks!!!
-
see the above mentioned questions :wink:
Need this mod to build an 4image tag cloud script
-
hi vano
could you please attach the file?
thanks!!!
Hi V@no,
Can you please attach the file?
Thanks in advance
m.a
-
I would like this mod as well..
Anyone that can attach it to this post?
-
V@no we need file 8)
-
Cmon, i really need this one! ;)
-
any chance of posting this file for v1.7.4 users please?
-
Hi Ivan,
Hab es dir via Mail zugeschickt, und füge das Zip hier noch mal ein.
gruss Harald
-
hi..it is done.thank you man
-
I got this Mod to work in 4images 1.7.4
There are some changes in search_stats.php because the original dint use search_stats_sort_dropdown_form in 4images 1.7.4
search_stats_install.rtf is adapted for 4images 1.7.4
the original search_stats.php is still in the zip file remove the org_ from the file name before uploading to your site.
I hope this is of use to someone (it woks for me)
EDIT
--------------------------------------------------------------------------------------------
Copy and past is a nice thing
if you select everything that needs to be copied of course. :wink:
I updated the search_stats_install.rtf file
Thanks Cristina.
-
I got this Mod to work in 4images 1.7.4
There are some changes in search_stats.php because the original dint use search_stats_sort_dropdown_form in 4images 1.7.4
search_stats_install.rtf is adapted for 4images 1.7.4
the original search_stats.php is still in the zip file remove the org_ from the file name before uploading to your site.
I hope this is of use to someone (it woks for me)
Nice that you attached the new files... thank you so much! :wink:
Just one thing: in Step 1 for 4images 1.7.2 and 1.7.4, there is one missing
}
at the end of the code. For those installing this MOD... don't forget to add it!
Regards.
-
Working great on 1.7.4; exactly what my site needed.. thanks !
-
I cant open the image so I hope this is it
In search_stats.php
Look for
foreach ($lang['search_stats_order_options'] as $key => $val) {
$sort_dropdown .= "<INPUT type=\"radio\" name=\"order\" value=\"$key\"";
if ($order == $key) {
$sort_dropdown .= " checked";
}
$sort_dropdown .= ">".$val."\n";
}
change to
/*
foreach ($lang['search_stats_order_options'] as $key => $val) {
$sort_dropdown .= "<INPUT type=\"radio\" name=\"order\" value=\"$key\"";
if ($order == $key) {
$sort_dropdown .= " checked";
}
$sort_dropdown .= ">".$val."\n";
}
*/
$sort_dropdown .="\n<select name=\"order\" class=\"setperpageselect\">\n";
foreach ($lang['search_stats_order_options'] as $key => $val) {
$sort_dropdown .= "<option value=\"$key\"";
if ($order == $key) {
$sort_dropdown .= " selected=\"selected\"";
}
$sort_dropdown .= ">".$val."</option>\n";
}
$sort_dropdown .= "</select>\n";
-
} is missing
Dorn that’s the second time this happens
empty search words
Strange I tested this en I don’t get an empty string in the stats even tested a space
Did you follow the instructions correctly? Is it possible to post your search.php?
-
Nice mod, im using 1.7.4 buggy, i followed your instructions and the search_stats.php seems to work ok, but in the search form i get this error when i try to search something:
Notice: Use of undefined constant SEARCH_STATS_TABLE - assumed 'SEARCH_STATS_TABLE' in C:\AppServ\www\search.php on line 93
Notice: Use of undefined constant SEARCH_STATS_TABLE - assumed 'SEARCH_STATS_TABLE' in C:\AppServ\www\search.php on line 98
How can i fix that?¿ What im doing wrong?¿ :?
-
It is like the notice says
undefined constant
the constant is defined in
Step 2.
Open /includes/constants.php
At the end of the file, just before closing ?> add this:
define('SEARCH_STATS_TABLE', $table_prefix.'search_stats');
if this is OK and you still got the notice remove the MOD (reinstall the backup files) and start over.
-
missing items in list
In search_stats.php look for
$count = ($words > $phrases) ? $words : $phrases;
change to
// $count = ($words > $phrases) ? $words : $phrases;
$count = $words + $phrases;
-
@ivan,
... solche Suchwörter in der Liste wie "cÄ'te" oder mit ähnlichen Hyroglyphen werden durch Searchboots erzeugt ...
... sie entstehen aus Suchwörtern deiner Website mit Umlauten und Sonderzeichen ...
... es sind ja in der Regel engl. sprachige Boots, die Umlaute und Sonderzeichen nicht kennen ...
... folgt solch ein Boot nun einem Suchwortlink mit Umlaut, so transformiert er dieses Suchwort bzw. die Umlaute/Sonderzeichen ...
... mit diesem transformiertem Suchwort geht er in deine Suche und legt es auch so in der Datenbank ab ...
... so ... und da ist es nun, das eigenartige Wort und erscheint nun in der Auflistung deiner Search Statistik ...
... und wie kann man das verhindern / umgehen / ändern ... ?
1. man verwendet keine Suchwörter mit Umlauten / Sonderzeichen ...
2. wenn doch, dann muss man regelmäßig die Datenbank etwas aufräumen und diese Suchwörter aus der Tabelle löschen ...
3. mehr fällt mir momentan dazu nicht ein ...
... in meiner Suchwortauflistung sieht es genauso aus und regele die Problematik entspr. Punkt 2. ... ;)
-
i have trouble with this code
// $count = ($words > $phrases) ? $words : $phrases;
$count = $words + $phrases;
problem with paging > comes error 404
Strange it works for me I to had missing items in the list
as you wrote
problem with browser
image one 2007-07-01_201736.gif > database keyword in search_stats table is okay
image two 2007-07-01_202141.gif > this view in opera
image three 2007-07-01_202234.gif > this view in firefox
i have with all browser the same problems.
I think you misunderstood my PM
By the way
2007-07-01_1.gif the item has a count of 14
in your img 2007-07-01_201736.gif you point out items that have a cont of 1 and 4 (it’s the wrong item)
in your 2007-07-01_1.gif the status bar points out the correct search phrase
when I take my Dutch browser the status bar gifs me the wrong search phrase
(http://buggyteambelgie.dnsalias.com/img/5.jpg)
my German reading is bad as for I can understand mawenzi post its something of English search bots so a language thing
-
I took an other look ad the missing items and I am still convinced it has to be
// $count = ($words > $phrases) ? $words : $phrases;
$count = $words + $phrases;
the calculation of the page are wrong otherwise
$count = ($words > $phrases) ? $words : $phrases;
(http://buggyteambelgie.dnsalias.com/img/7.jpg)
found 32 words and 6 phrases
these or clamed to be shown on 7 pages
5 items on every page - - > 7 pages that is only 35 items total
I wil be missing 3 items
$count = $words + $phrases;
(http://buggyteambelgie.dnsalias.com/img/8.jpg)
found 32 words and 6 phrases
these or shown on 8 pages
5 items on every page - - > 8 pages that is 40 items total
last page only contains 3 items (there isn’t any more to show)
can someone else test this and let us know what the result is?
-
@ Buggy Driver
... your new code for $count is 100% correct ... 8O
... and why ...
... in the search_stats_table are shown words and ( not or ) phrases by a count of "per page" ...
... I changed my count-code in your way and tested it ... 100% correct ...
... thanks Buggy Driver for your hint ... :mrgreen:
-
Hat jemand die Files zum Download?
Ich glaube mal das die Seach.php und Seach_stats.php nicht ales sein können.
How could I found the Files-Upload?
Only two updatet Php files for Version 1.7.4 could not be all,isn´t it?
Please
-
I dont understand this either.. the word file has sub-steps as well.. please clearify.. :?: :?: :?:
-
The files or at the bottom of this post
http://www.4homepages.de/forum/index.php?topic=6033.msg92709#msg92709
a few posts down, or some enhancements
http://www.4homepages.de/forum/index.php?topic=6033.msg95419#msg95419
and don’t forget
http://www.4homepages.de/forum/index.php?topic=6033.msg95432#msg95432
-
This is a GREAT Mod! Thanks to all!
-
After updating gallery to v1.7.6 and updating this Mod {words} and {phrases} are no longer working:
$lang['search_stats_paging'] = "Found {words} words(s) and {phrases}
Has anybody an idea? I compared all files with the old ones but I cannot find how to get these variables working.
-
schöner und nützlicher MOD. Klappt super!
http://www.urlauberschiff-fritzheckert.de/maritim/search_stats.php (http://www.urlauberschiff-fritzheckert.de/maritim/search_stats.php)
Danke Gruß Steffen
-
Where is the attachment for this mod, and has anyone got it to work with 1.7.6/????
-
I've attached to the original post. Hopefully it's the right file. It's dated 2005-04-05
-
I cant say right or wrong, but I can say that this step:
Step 1.2.
Is impossible to do in 1.7.6 ...
can you try to make it work for 1.7.6 ?
It is very important for me to know what keywords people are searching for.
The code in step 1.2 is can not be found to alter.
Thanks V@no!
-
elseif ($split_words[$i] != "" && strlen($split_words[$i]) >= MIN_SEARCH_KEYWORD_LENGTH && strlen($split_words[$i]) <= MAX_SEARCH_KEYWORD_LENGTH && !in_array($split_words[$i], $stopword_list)) {
is not in my search.php
This is my search.php
<?php
/**************************************************************************
* *
* 4images - A Web Based Image Gallery Management System *
* ---------------------------------------------------------------- *
* *
* File: search.php *
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.7.6 *
* *
* Never released without support from: Nicky (http://www.nicky.net) *
* *
**************************************************************************
* *
* Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz- *
* bedingungen (Lizenz.txt) für weitere Informationen. *
* --------------------------------------------------------------- *
* This script is NOT freeware! Please read the Copyright Notice *
* (Licence.txt) for further information. *
* *
*************************************************************************/
$main_template = 'search';
define('GET_CACHES', 1);
define('ROOT_PATH', './');
include(ROOT_PATH.'global.php');
require(ROOT_PATH.'includes/sessions.php');
$user_access = get_permission();
include(ROOT_PATH.'includes/search_utils.php');
error_reporting(E_ALL);
$org_search_keywords = $search_keywords;
$org_search_user = $search_user;
if (isset($HTTP_GET_VARS['search_terms']) || isset($HTTP_POST_VARS['search_terms'])) {
$search_terms = isset($HTTP_POST_VARS['search_terms']) ? $HTTP_POST_VARS['search_terms'] : $HTTP_GET_VARS['search_terms'];
$search_terms = $search_terms == "all" ? 1 : 0;
}
else {
$search_terms = 1;
}
if (isset($HTTP_GET_VARS['search_fields']) || isset($HTTP_POST_VARS['search_fields'])) {
$search_fields = isset($HTTP_POST_VARS['search_fields']) ? trim($HTTP_POST_VARS['search_fields']) : trim($HTTP_GET_VARS['search_fields']);
}
else {
$search_fields = "all";
}
$search_cat = $cat_id;
$search_id = array();
if ($search_user != "" && $show_result == 1) {
$search_user = str_replace('*', '%', trim($search_user));
$sql = "SELECT ".get_user_table_field("", "user_id")."
FROM ".USERS_TABLE."
WHERE ".get_user_table_field("", "user_name")." LIKE '$search_user'";
$result = $site_db->query($sql);
$search_id['user_ids'] = "";
if ($result) {
while ($row = $site_db->fetch_array($result)) {
$search_id['user_ids'] .= (($search_id['user_ids'] != "") ? ", " : "").$row[$user_table_fields['user_id']];
}
$site_db->free_result($result);
}
}
if ($search_keywords != "" && $show_result == 1) {
$split_words = prepare_searchwords($search_keywords, true);
$match_field_sql = ($search_fields != "all" && isset($search_match_fields[$search_fields])) ? "AND m.".$search_match_fields[$search_fields]." = 1" : "";
$search_word_cache = array();
for ($i = 0; $i < sizeof($split_words); $i++) {
if ($split_words[$i] == "and" || $split_words[$i] == "und" || $split_words[$i] == "or" || $split_words[$i] == "oder" || $split_words[$i] == "not") {
$search_word_cache[$i] = ($search_terms) ? "and" : $split_words[$i];
}
else {
$sql = "SELECT m.image_id
FROM (".WORDLIST_TABLE." w, ".WORDMATCH_TABLE." m)
WHERE w.word_text LIKE '".addslashes(str_replace("*", "%", $split_words[$i]))."'
AND m.word_id = w.word_id
$match_field_sql";
$result = $site_db->query($sql);
$search_word_cache[$i] = array();
while ($row = $site_db->fetch_array($result)) {
$search_word_cache[$i][$row['image_id']] = 1;
}
$site_db->free_result();
}
}
$is_first_word = 1;
$operator = "or";
$image_id_list = array();
for ($i = 0; $i < sizeof($search_word_cache); $i++) {
if ($search_word_cache[$i] == "and" || $search_word_cache[$i] == "und" || $search_word_cache[$i] == "or" || $search_word_cache[$i] == "oder" || $search_word_cache[$i] == "not") {
if (!$is_first_word) {
$operator = $search_word_cache[$i];
}
}
elseif (is_array($search_word_cache[$i])) {
if ($search_terms) {
$operator = "and";
}
foreach ($search_word_cache[$i] as $key => $val) {
if ($is_first_word || $operator == "or" || $operator == "oder") {
$image_id_list[$key] = 1;
}
elseif ($operator == "not") {
unset($image_id_list[$key]);
}
}
if (($operator == "and" || $operator == "und") && !$is_first_word) {
foreach ($image_id_list as $key => $val) {
if (!isset($search_word_cache[$i][$key])) {
unset($image_id_list[$key]);
}
}
}
}
$is_first_word = 0;
}
$search_id['image_ids'] = "";
foreach ($image_id_list as $key => $val) {
$search_id['image_ids'] .= (($search_id['image_ids'] != "") ? ", " : "").$key;
}
unset($image_id_list);
}
if ($search_new_images && $show_result == 1) {
$search_id['search_new_images'] = 1;
}
if ($search_cat && $show_result == 1) {
$search_id['search_cat'] = $search_cat;
}
if (!empty($search_id)) {
$site_sess->set_session_var("search_id", serialize($search_id));
}
include(ROOT_PATH.'includes/page_header.php');
$num_rows_all = 0;
if ($show_result == 1) {
if (empty($search_id)) {
if (!empty($session_info['search_id'])) {
$search_id = unserialize($session_info['search_id']);
} else {
$search_id = unserialize($site_sess->get_session_var("search_id"));
}
}
$sql_where_query = "";
if (!empty($search_id['image_ids'])) {
$sql_where_query .= "AND i.image_id IN (".$search_id['image_ids'].") ";
}
if (!empty($search_id['user_ids'])) {
$sql_where_query .= "AND i.user_id IN (".$search_id['user_ids'].") ";
}
if (!empty($search_id['search_new_images']) && $search_id['search_new_images'] == 1) {
$new_cutoff = time() - 60 * 60 * 24 * $config['new_cutoff'];
$sql_where_query .= "AND i.image_date >= $new_cutoff ";
}
if (!empty($search_id['search_cat']) && $search_id['search_cat'] != 0) {
$cat_id_sql = 0;
if (check_permission("auth_viewcat", $search_id['search_cat'])) {
$sub_cat_ids = get_subcat_ids($search_id['search_cat'], $search_id['search_cat'], $cat_parent_cache);
$cat_id_sql .= ", ".$search_id['search_cat'];
if (!empty($sub_cat_ids[$search_id['search_cat']])) {
foreach ($sub_cat_ids[$search_id['search_cat']] as $val) {
if (check_permission("auth_viewcat", $val)) {
$cat_id_sql .= ", ".$val;
}
}
}
}
$cat_id_sql = $cat_id_sql !== 0 ? "AND i.cat_id IN ($cat_id_sql)" : "";
}
else {
$cat_id_sql = get_auth_cat_sql("auth_viewcat", "NOTIN");
$cat_id_sql = $cat_id_sql !== 0 ? "AND i.cat_id NOT IN (".$cat_id_sql.")" : "";
}
if (!empty($sql_where_query)) {
$sql = "SELECT COUNT(*) AS num_rows_all
FROM ".IMAGES_TABLE." i
WHERE i.image_active = 1 $sql_where_query
$cat_id_sql";
$row = $site_db->query_firstrow($sql);
$num_rows_all = $row['num_rows_all'];
}
}
if (!$num_rows_all && $show_result == 1) {
$msg = preg_replace("/".$site_template->start."search_keywords".$site_template->end."/", $search_keywords, $lang['search_no_results']);
}
//-----------------------------------------------------
//--- Show Search Results -----------------------------
//-----------------------------------------------------
if ($num_rows_all && $show_result == 1) {
$link_arg = $site_sess->url(ROOT_PATH."search.php?show_result=1");
include(ROOT_PATH.'includes/paging.php');
$getpaging = new Paging($page, $perpage, $num_rows_all, $link_arg);
$offset = $getpaging->get_offset();
$site_template->register_vars(array(
"paging" => $getpaging->get_paging(),
"paging_stats" => $getpaging->get_paging_stats()
));
$imgtable_width = ceil((intval($config['image_table_width'])) / $config['image_cells']);
if ((substr($config['image_table_width'], -1)) == "%") {
$imgtable_width .= "%";
}
$additional_sql = "";
if (!empty($additional_image_fields)) {
foreach ($additional_image_fields as $key => $val) {
$additional_sql .= ", i.".$key;
}
}
$sql = "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.", "user_name")."
FROM (".IMAGES_TABLE." i, ".CATEGORIES_TABLE." c)
LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
WHERE i.image_active = 1
$sql_where_query
AND c.cat_id = i.cat_id $cat_id_sql
ORDER BY ".$config['image_order']." ".$config['image_sort'].", image_id ".$config['image_sort']."
LIMIT $offset, $perpage";
$result = $site_db->query($sql);
$thumbnails = "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">\n";
$count = 0;
$bgcounter = 0;
while ($image_row = $site_db->fetch_array($result)) {
if ($count == 0) {
$row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;
$thumbnails .= "<tr class=\"imagerow".$row_bg_number."\">\n";
}
$thumbnails .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";
show_image($image_row, "search");
$thumbnails .= $site_template->parse_template("thumbnail_bit");
$thumbnails .= "\n</td>\n";
$count++;
if ($count == $config['image_cells']) {
$thumbnails .= "</tr>\n";
$count = 0;
}
} // end while
if ($count > 0) {
$leftover = ($config['image_cells'] - $count);
if ($leftover >= 1) {
for ($i = 0; $i < $leftover; $i++) {
$thumbnails .= "<td width=\"".$imgtable_width."\">\n \n</td>\n";
}
$thumbnails .= "</tr>\n";
}
}
$thumbnails .= "</table>\n";
$content = $thumbnails;
unset($thumbnails);
} // end if
else {
$site_template->register_vars(array(
"search_keywords" => format_text(stripslashes($org_search_keywords), 2),
"search_user" => format_text(stripslashes($org_search_user), 2),
"lang_search_by_keyword" => $lang['search_by_keyword'],
"lang_search_by_username" => $lang['search_by_username'],
"lang_new_images_only" => $lang['new_images_only'],
"lang_search_terms" => $lang['search_terms'],
"lang_or" => $lang['or'],
"lang_and" => $lang['and'],
"lang_category" => $lang['category'],
"lang_search_fields" => $lang['search_fields'],
"lang_all_fields" => $lang['all_fields'],
"lang_name_only" => $lang['name_only'],
"lang_description_only" => $lang['description_only'],
"lang_keywords_only" => $lang['keywords_only'],
"category_dropdown" => get_category_dropdown($cat_id)
));
if (!empty($additional_image_fields)) {
$additional_field_array = array();
foreach ($additional_image_fields as $key => $val) {
if (isset($lang[$key.'_only'])) {
$additional_field_array['lang_'.$key.'_only'] = $lang[$key.'_only'];
}
}
if (!empty($additional_field_array)) {
$site_template->register_vars($additional_field_array);
}
}
$content = $site_template->parse_template("search_form");
}
//-----------------------------------------------------
//--- Clickstream -------------------------------------
//-----------------------------------------------------
$clickstream = "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'].$lang['search']."</span>";
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
"content" => $content,
"msg" => $msg,
"clickstream" => $clickstream,
"lang_search" => $lang['search']
));
$site_template->print_template($site_template->parse_template($main_template));
include(ROOT_PATH.'includes/page_footer.php');
?>
with 1.7.6 if you could up grade you mod instructions that would be great!
-
In v1.7.6 search for:
if ($split_words[$i] == "and" || $split_words[$i] == "und" || $split_words[$i] == "or" || $split_words[$i] == "oder" || $split_words[$i] == "not") {
$search_word_cache[$i] = ($search_terms) ? "and" : $split_words[$i];
}
else {
-
A Very important mod.Thank you very much for giving me this info. It works great.
-
hello with this mod i have an error
i have make the last change for the 1.7.6
Notice: Undefined variable: who in C:\xampp\htdocs\4images\search.php on line 83
Notice: Undefined variable: who in C:\xampp\htdocs\4images\search.php on line 83
DB Error: Bad SQL Query: UPDATE 4images_search_stats SET count = count + 1, word = 1, date = 1238338945, = + 1 WHERE text LIKE 'chien' AND word = 1
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= + 1 WHERE text LIKE 'chien' AND word = 1' at line 2
-
Hello and welcome to 4images forum.
You must have made a mistake in step 1.
-
Hi V@no.
In v1.7.6 search for:
if ($split_words[$i] == "and" || $split_words[$i] == "und" || $split_words[$i] == "or" || $split_words[$i] == "oder" || $split_words[$i] == "not") {
$search_word_cache[$i] = ($search_terms) ? "and" : $split_words[$i];
}
else {
Does this mod work with the latest version of 4images? I tried to install it but I can't find the code in step 1.2. I know you posted a fix for version 1.7.6. Does this also apply for 1.7.7? Please advise.
Thank you.
-
yes, it seems in v1.7.7 is the same as in 1.7.6
does it work? - I don't know...you tell us ;)
-
In step 1.3 this code:
"search_keywords" => htmlspecialchars(stripslashes($org_search_keywords)),
does not exist in search.php, instead THIS exists in search.php:
"search_keywords" => format_text(stripslashes($org_search_keywords), 2),
is it the same? Should I add it after that?
Thanks!
-
yes
you should install [MOD] Search Statistics v1.5 | Works with 1.7.2 - 1.7.4 (http://www.4homepages.de/forum/index.php?topic=6033.msg95419#msg95419) instead.