Author Topic: more search findings  (Read 10659 times)

0 Members and 1 Guest are viewing this topic.

Offline edwin

  • Full Member
  • ***
  • Posts: 199
    • View Profile
    • http://www.foto-janssen.nl
more search findings
« on: September 15, 2002, 02:37:00 PM »
Jan or Nicky, is it possible to see on what kind of keywords my visitor search.
And how do i get more results in my controlpanel, so not the 5 best but the 25 best visited pictures and were should i change it

regards edwin

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
Re: more search findings
« Reply #1 on: September 16, 2002, 08:32:39 AM »
Quote from: edwin
Jan or Nicky, is it possible to see on what kind of keywords my visitor search.

At the moment no. If you want to log the searches, just create a new table in your database "4images_searchlog":

Code: [Select]
CREATE TABLE 4images_searchlog (
user_id MEDIUMINT NOT NULL,
search_keywords VARCHAR(255) NOT NULL
);

and paste in "search.php" just before
Code: [Select]
$search_keywords = strip_tags(strtolower(stripslashes($search_keywords)));
this code
Code: [Select]
$sql = "INSERT INTO 4images_searchlog (user_id , search_keywords)
        VALUES (".$user_info['user_id'].", '$search_keywords')";
$site_db->query($sql);


Quote
And how do i get more results in my controlpanel, so not the 5 best but the 25 best visited pictures and were should i change it

Just change in the firstline of "admin/home.php"
Code: [Select]
$stats_limit = 5;
Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline edwin

  • Full Member
  • ***
  • Posts: 199
    • View Profile
    • http://www.foto-janssen.nl
more search findings
« Reply #2 on: September 17, 2002, 09:53:17 AM »
Jan, i did it but i get the next error, do you have any idea what it is

regards

Parse error: parse error, unexpected T_STRING in /home/ejanssen/public_html/images/search.php on line 105

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
more search findings
« Reply #3 on: September 17, 2002, 10:28:34 AM »
Check your code, maybe you did some faults while pasting the code. I tested it, for me it works.

Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline edwin

  • Full Member
  • ***
  • Posts: 199
    • View Profile
    • http://www.foto-janssen.nl
more search findings
« Reply #4 on: September 17, 2002, 02:07:52 PM »
Can you show me like above how it would look like, mayby i don't understand u correctly

regards edwin

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
more search findings
« Reply #5 on: September 17, 2002, 02:14:11 PM »
Code: [Select]
if ($search_keywords != "" && $show_result == 1) {
  $sql = "INSERT INTO 4images_searchlog (user_id, search_keywords)
          VALUES (".$user_info['user_id'].", '$search_keywords')";
  $site_db->query($sql);
  $search_keywords = strip_tags(strtolower(stripslashes($search_keywords)));

With 1 line around the part.

Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline edwin

  • Full Member
  • ***
  • Posts: 199
    • View Profile
    • http://www.foto-janssen.nl
more search findings
« Reply #6 on: September 17, 2002, 02:21:10 PM »
Great, that works only now i have to make a table in my database, can you help me with that to or do i have to contact my provider for that

DB Error: Bad SQL Query: INSERT INTO 4images_searchlog (user_id , search_keywords) VALUES (1, 'alexander')
Table 'ejanssen.4images_searchlog' doesn't exist

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
more search findings
« Reply #7 on: September 17, 2002, 03:08:49 PM »
Try phpMyAdmin. With that tool you can manage mySQL databases.

Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline bernd

  • Full Member
  • ***
  • Posts: 214
    • View Profile
more search findings
« Reply #8 on: September 17, 2002, 11:55:36 PM »
Jan,

This sounds really interesting so I immediatley tried it ;)
Really cool - now all I need is a nice page that creates some cool statistics ... but I guess I have to try that myself  :o

thnx so far!
Bernd

Offline edwin

  • Full Member
  • ***
  • Posts: 199
    • View Profile
    • http://www.foto-janssen.nl
more search findings
« Reply #9 on: September 18, 2002, 12:31:06 AM »
Mayby the stuppiest question of all but how do i get into my Mysql database ??
i'm a complete newbie to this.

Can i get there from by example; http://janssen.xs4fun.net/database.php or something else.

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
more search findings
« Reply #10 on: September 18, 2002, 01:20:41 AM »
ok ;)

make an new file with a name new_table.php
put ONLY this as content:
Code: [Select]

<?php 
define
&#40;'ROOT_PATH', './'&#41;;

include&#40;ROOT_PATH.'config.php'&#41;;
include&#40;ROOT_PATH.'includes/db_mysql.php'&#41;;

$site_db = new Db&#40;$db_host, $db_user, $db_password, $db_name&#41;;
$sql="CREATE TABLE 4images_searchlog 
      &#40;user_id MEDIUMINT NOT NULL, 
      search_keywords VARCHAR&#40;255&#41; NOT NULL&#41;"
;
$result $site_db->query&#40;$sql&#41;;

echo "table <b>4images_searchlog</b> created !<br>have fun !";
?>


save. upload new_table.php into your 4images folder (where config.php reside) now point your webbrowser to:
http://your_url_to/4images/new_table.php .

done.. delete new_table.php from your server.
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline edwin

  • Full Member
  • ***
  • Posts: 199
    • View Profile
    • http://www.foto-janssen.nl
more search findings
« Reply #11 on: September 18, 2002, 11:35:49 AM »
great and need, i'm very humble to you because i need and us your program evendo i don't knw anything of mysql.

one last question, how can i see this log

again thanks for your quick and sharp help

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
more search findings
« Reply #12 on: September 18, 2002, 11:41:18 AM »
You can use phpMyAdmin. I posted the link above:
http://www.4homepages.de/forum/viewtopic.php?p=8056#8056

Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search