Search doesn't work Search doesn't work
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Search doesn't work

Started by Zenigata, January 29, 2006, 04:17:52 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Zenigata

After upgrading from cpg 1.3.5 to cpg 1.4.3 the search funcion doesn't work. It only shows the first page, but if I click on a thumbnail or on the next page I have an error that says there is an error during a query in the database.

Please help me, thanks.

My server configuration:
apache, php 4.4.2, mysql 4.0.23

Nibbler


Zenigata


Tranz

How about providing a sample query or two since we're not familiar with your gallery to know what to search for? Particularly the query that's giving you issues.

Zenigata

Quote from: TranzNDance on January 29, 2006, 05:11:31 PM
How about providing a sample query or two since we're not familiar with your gallery to know what to search for? Particularly the query that's giving you issues.

Ok, first search query that gives the firts page with thumbnails:

USER:
------------------
Array
(
    [ID] => da6c40e41f7ae499ecd2683d85f29d12
    [am] => 1
    [liv] => Array
        (
           
  • => 1029
                [1] => 1405
                [2] => 1390
                [3] => 453
                [4] => 452
            )

        [sort] => na
        [search] => Array
            (
                [search] => sara
                [album] => search
                [title] => on
                [newer_than] =>
                [caption] => on
                [older_than] =>
                [keywords] => on
                [type] => AND
                [params] => Array
                    (
                        [title] => on
                        [caption] => on
                        [keywords] => on
                    )

            )

        [lang] => italian
    )

    ==========================
    USER DATA:
    ------------------
    Array
    (
        [user_id] => 2
        [user_name] => Zenigata
        [groups] => Array
            (
               
  • => 101
                [1] => 21
            )

        [disk_max] => 0
        [disk_min] => 0
        [can_rate_pictures] => 1
        [can_send_ecards] => 1
        [ufc_max] => 3
        [ufc_min] => 3
        [custom_user_upload] => 0
        [num_file_upload] => 10
        [num_URI_upload] => 1
        [can_post_comments] => 1
        [can_upload_pictures] => 1
        [can_create_albums] => 0
        [has_admin_access] => 1
        [pub_upl_need_approval] => 1
        [priv_upl_need_approval] => 1
        [group_name] => Administrator
        [upload_form_config] => 3
        [group_quota] => 0
        [can_see_all_albums] => 1
        [group_id] => 101
    )

    ==========================
    Queries:
    ------------------
    Array
    (
       
  • => SELECT extension, mime, content, player FROM cpg133_filetypes; (0.001s)
        [1] => select * from cpg133_plugins order by priority asc; (0.001s)
        [2] => SELECT * FROM cpg133_bridge (0s)
        [3] => SELECT MAX(group_quota) as disk_max, MIN(group_quota) as disk_min, MAX(can_rate_pictures) as can_rate_pictures, MAX(can_send_ecards) as can_send_ecards, MAX(upload_form_config) as ufc_max, MIN(upload_form_config) as ufc_min, MAX(custom_user_upload) as custom_user_upload, MAX(num_file_upload) as num_file_upload, MAX(num_URI_upload) as num_URI_upload, MAX(can_post_comments) as can_post_comments, MAX(can_upload_pictures) as can_upload_pictures, MAX(can_create_albums) as can_create_albums, MAX(has_admin_access) as has_admin_access, MIN(pub_upl_need_approval) as pub_upl_need_approval, MIN( priv_upl_need_approval) as  priv_upl_need_approval FROM cpg133_usergroups WHERE group_id in (101,21) (0.001s)
        [4] => SELECT group_name FROM  cpg133_usergroups WHERE group_id= 101 (0s)
        [5] => SELECT user_favpics FROM cpg133_favpics WHERE user_id = 2 (0.001s)
        [6] => DELETE FROM cpg133_banned WHERE expiry < '2006-01-29 16:23:52' (0s)
        [7] => SELECT * FROM cpg133_banned WHERE (ip_addr='87.1.202.56' OR ip_addr='87.1.202.56' OR user_id=2) AND brute_force=0 (0s)
        [8] => SELECT COUNT(*) FROM cpg133_pictures WHERE approved = 'NO' (0.002s)
        [9] => SELECT COUNT(*) FROM cpg133_pictures WHERE (title LIKE '%sara%' OR caption LIKE '%sara%' OR keywords LIKE '%sara%')  (0.008s)
        [10] => SELECT * FROM cpg133_pictures WHERE (title LIKE '%sara%' OR caption LIKE '%sara%' OR keywords LIKE '%sara%')  ORDER BY filename ASC  LIMIT 0 ,12 (0.007s)
        [11] => SELECT count(*) from cpg133_comments where pid=690 and msg_id!=0 (0.001s)
        [12] => SELECT count(*) from cpg133_comments where pid=284 and msg_id!=0 (0s)
        [13] => SELECT count(*) from cpg133_comments where pid=1434 and msg_id!=0 (0s)
        [14] => SELECT count(*) from cpg133_comments where pid=868 and msg_id!=0 (0s)
        [15] => SELECT count(*) from cpg133_comments where pid=512 and msg_id!=0 (0s)
        [16] => SELECT count(*) from cpg133_comments where pid=665 and msg_id!=0 (0s)
        [17] => SELECT count(*) from cpg133_comments where pid=234 and msg_id!=0 (0s)
        [18] => SELECT count(*) from cpg133_comments where pid=663 and msg_id!=0 (0s)
        [19] => SELECT count(*) from cpg133_comments where pid=718 and msg_id!=0 (0s)
        [20] => SELECT count(*) from cpg133_comments where pid=137 and msg_id!=0 (0s)
        [21] => SELECT count(*) from cpg133_comments where pid=119 and msg_id!=0 (0s)
        [22] => SELECT count(*) from cpg133_comments where pid=1163 and msg_id!=0 (0s)
    )

    ==========================
    GET :
    ------------------
    Array
    (
        [thumbnails_php] =>
    )

    ==========================
    POST :
    ------------------
    Array
    (
        [search] => sara
        [album] => search
        [title] => on
        [newer_than] =>
        [caption] => on
        [older_than] =>
        [keywords] => on
        [type] => AND
        [params] => Array
            (
                [title] => on
                [caption] => on
                [keywords] => on
            )

    )

    ==========================
    VERSION INFO :
    ------------------
    PHP version: 4.4.2-dev - OK
    ------------------
    mySQL version: 4.0.23-standard
    ------------------
    Coppermine version: 1.4.3(stable)
    ==========================
    Module: GD
    ------------------
    GD Version: bundled (2.0.28 compatible)
    FreeType Support: 1
    FreeType Linkage: with freetype
    T1Lib Support:
    GIF Read Support: 1
    GIF Create Support: 1
    JPG Support: 1
    PNG Support: 1
    WBMP Support: 1
    XBM Support: 1
    JIS-mapped Japanese Font Support:

    ==========================
    Module: mysql
    ------------------
    MySQL Supportenabled
    Active Persistent Links 0
    Active Links 1
    Client API version 4.0.23
    MYSQL_MODULE_TYPE external
    MYSQL_SOCKET /var/lib/mysql/mysql.sock
    MYSQL_INCLUDE -I/usr/include/mysql
    MYSQL_LIBS -L/usr/lib -lmysqlclient 
    ==========================
    Module: zlib
    ------------------
    ZLib Support enabled
    Compiled Version 1.2.1.2
    Linked Version 1.2.1.2
    ==========================
    Server restrictions (safe mode)?
    ------------------
    Directive | Local Value | Master Value
    safe_mode | Off | Off
    safe_mode_exec_dir | no value | no value
    safe_mode_gid | Off | Off
    safe_mode_include_dir | no value | no value
    safe_mode_exec_dir | no value | no value
    sql.safe_mode | Off | Off
    disable_functions | no value | no value
    file_uploads | On | On
    include_path | .:/usr/lib/php:/usr/local/lib/php | .:/usr/lib/php:/usr/local/lib/php
    open_basedir | no value | no value
    ==========================
    email
    ------------------
    Directive | Local Value | Master Value
    sendmail_from | no value | no value
    sendmail_path | /usr/sbin/sendmail -t -i | /usr/sbin/sendmail -t -i
    SMTP | localhost | localhost
    smtp_port | 25 | 25
    ==========================
    Size and Time
    ------------------
    Directive | Local Value | Master Value
    max_execution_time | 30 | 30
    max_input_time | -1 | -1
    upload_max_filesize | 40M | 40M
    post_max_size | 55M | 55M
    ==========================
    Page generated in 0.445 seconds - 23 queries in 0.022 seconds - Album set : ; Meta set: ;[/size]

    Second query that gives error when I click on a thumbnail:


    While executing query "SELECT COUNT(*) FROM cpg133_pictures WHERE () AND ctime > UNIX_TIMESTAMP() - 0 AND ctime < UNIX_TIMESTAMP() - 0 " on 0

    mySQL error: 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 ') AND ctime > UNIX_TIMESTAMP() - 0 AND ctime < UNIX_TIMESTAMP()


    File: /home/jwwwazen/public_html/forum/galleria/include/functions.inc.php - Line: 248

    USER:
    ------------------
    Array
    (
        [ID] => da6c40e41f7ae499ecd2683d85f29d12
        [am] => 1
        [liv] => Array
            (
               
    • => 1029
                  [1] => 1405
                  [2] => 1390
                  [3] => 453
                  [4] => 452
              )

          [sort] => na
          [search] => ###eleonora
          [lang] => italian
      )

      ==========================
      USER DATA:
      ------------------
      Array
      (
          [user_id] => 2
          [user_name] => Zenigata
          [groups] => Array
              (
                 
    • => 101
                  [1] => 21
              )

          [disk_max] => 0
          [disk_min] => 0
          [can_rate_pictures] => 1
          [can_send_ecards] => 1
          [ufc_max] => 3
          [ufc_min] => 3
          [custom_user_upload] => 0
          [num_file_upload] => 10
          [num_URI_upload] => 1
          [can_post_comments] => 1
          [can_upload_pictures] => 1
          [can_create_albums] => 0
          [has_admin_access] => 1
          [pub_upl_need_approval] => 1
          [priv_upl_need_approval] => 1
          [group_name] => Administrator
          [upload_form_config] => 3
          [group_quota] => 0
          [can_see_all_albums] => 1
          [group_id] => 101
      )

      ==========================
      Queries:
      ------------------
      Array
      (
         
    • => SELECT extension, mime, content, player FROM cpg133_filetypes; (0.001s)
          [1] => select * from cpg133_plugins order by priority asc; (0.001s)
          [2] => SELECT * FROM cpg133_bridge (0s)
          [3] => SELECT MAX(group_quota) as disk_max, MIN(group_quota) as disk_min, MAX(can_rate_pictures) as can_rate_pictures, MAX(can_send_ecards) as can_send_ecards, MAX(upload_form_config) as ufc_max, MIN(upload_form_config) as ufc_min, MAX(custom_user_upload) as custom_user_upload, MAX(num_file_upload) as num_file_upload, MAX(num_URI_upload) as num_URI_upload, MAX(can_post_comments) as can_post_comments, MAX(can_upload_pictures) as can_upload_pictures, MAX(can_create_albums) as can_create_albums, MAX(has_admin_access) as has_admin_access, MIN(pub_upl_need_approval) as pub_upl_need_approval, MIN( priv_upl_need_approval) as  priv_upl_need_approval FROM cpg133_usergroups WHERE group_id in (101,21) (0.001s)
          [4] => SELECT group_name FROM  cpg133_usergroups WHERE group_id= 101 (0s)
          [5] => SELECT user_favpics FROM cpg133_favpics WHERE user_id = 2 (0.001s)
          [6] => DELETE FROM cpg133_banned WHERE expiry < '2006-01-29 16:30:24' (0.001s)
          [7] => SELECT * FROM cpg133_banned WHERE (ip_addr='87.1.202.56' OR ip_addr='87.1.202.56' OR user_id=2) AND brute_force=0 (0s)
          [8] => SELECT COUNT(*) FROM cpg133_pictures WHERE () AND ctime > UNIX_TIMESTAMP() - 0 AND ctime < UNIX_TIMESTAMP() - 0  (0s)
          [9] => SELECT COUNT(*) FROM cpg133_pictures WHERE approved = 'NO' (0.002s)
      )

      ==========================
      GET :
      ------------------
      Array
      (
          [album] => search
          [cat] => 0
          [pos] => 0
      )

      ==========================
      POST :
      ------------------
      ###eleonora
      ==========================
      VERSION INFO :
      ------------------
      PHP version: 4.4.2-dev - OK
      ------------------
      mySQL version: 4.0.23-standard
      ------------------
      Coppermine version: 1.4.3(stable)
      ==========================
      Module: GD
      ------------------
      GD Version: bundled (2.0.28 compatible)
      FreeType Support: 1
      FreeType Linkage: with freetype
      T1Lib Support:
      GIF Read Support: 1
      GIF Create Support: 1
      JPG Support: 1
      PNG Support: 1
      WBMP Support: 1
      XBM Support: 1
      JIS-mapped Japanese Font Support:

      ==========================
      Module: mysql
      ------------------
      MySQL Supportenabled
      Active Persistent Links 0
      Active Links 1
      Client API version 4.0.23
      MYSQL_MODULE_TYPE external
      MYSQL_SOCKET /var/lib/mysql/mysql.sock
      MYSQL_INCLUDE -I/usr/include/mysql
      MYSQL_LIBS -L/usr/lib -lmysqlclient 
      ==========================
      Module: zlib
      ------------------
      ZLib Support enabled
      Compiled Version 1.2.1.2
      Linked Version 1.2.1.2
      ==========================
      Server restrictions (safe mode)?
      ------------------
      Directive | Local Value | Master Value
      safe_mode | Off | Off
      safe_mode_exec_dir | no value | no value
      safe_mode_gid | Off | Off
      safe_mode_include_dir | no value | no value
      safe_mode_exec_dir | no value | no value
      sql.safe_mode | Off | Off
      disable_functions | no value | no value
      file_uploads | On | On
      include_path | .:/usr/lib/php:/usr/local/lib/php | .:/usr/lib/php:/usr/local/lib/php
      open_basedir | no value | no value
      ==========================
      email
      ------------------
      Directive | Local Value | Master Value
      sendmail_from | no value | no value
      sendmail_path | /usr/sbin/sendmail -t -i | /usr/sbin/sendmail -t -i
      SMTP | localhost | localhost
      smtp_port | 25 | 25
      ==========================
      Size and Time
      ------------------
      Directive | Local Value | Master Value
      max_execution_time | 30 | 30
      max_input_time | -1 | -1
      upload_max_filesize | 40M | 40M
      post_max_size | 55M | 55M
      ==========================
      Page generated in 0.489 seconds - 10 queries in 0.007 seconds - Album set : ; Meta set: ;[/size]

      Third query, I have errors when i click on "page 2":


      While executing query "SELECT COUNT(*) FROM cpg133_pictures WHERE () AND ctime > UNIX_TIMESTAMP() - 0 AND ctime < UNIX_TIMESTAMP() - 0 " on 0

      mySQL error: 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 ') AND ctime > UNIX_TIMESTAMP() - 0 AND ctime < UNIX_TIMESTAMP()

      File: /home/jwwwazen/public_html/forum/galleria/include/functions.inc.php - Line: 248

      USER:
      ------------------
      Array
      (
          [ID] => da6c40e41f7ae499ecd2683d85f29d12
          [am] => 1
          [liv] => Array
              (
                 
      • => 1029
                    [1] => 1405
                    [2] => 1390
                    [3] => 453
                    [4] => 452
                )

            [sort] => na
            [search] => ###eleonora
            [lang] => italian
        )

        ==========================
        USER DATA:
        ------------------
        Array
        (
            [user_id] => 2
            [user_name] => Zenigata
            [groups] => Array
                (
                   
      • => 101
                    [1] => 21
                )

            [disk_max] => 0
            [disk_min] => 0
            [can_rate_pictures] => 1
            [can_send_ecards] => 1
            [ufc_max] => 3
            [ufc_min] => 3
            [custom_user_upload] => 0
            [num_file_upload] => 10
            [num_URI_upload] => 1
            [can_post_comments] => 1
            [can_upload_pictures] => 1
            [can_create_albums] => 0
            [has_admin_access] => 1
            [pub_upl_need_approval] => 1
            [priv_upl_need_approval] => 1
            [group_name] => Administrator
            [upload_form_config] => 3
            [group_quota] => 0
            [can_see_all_albums] => 1
            [group_id] => 101
        )

        ==========================
        Queries:
        ------------------
        Array
        (
           
      • => SELECT extension, mime, content, player FROM cpg133_filetypes; (0.001s)
            [1] => select * from cpg133_plugins order by priority asc; (0.001s)
            [2] => SELECT * FROM cpg133_bridge (0s)
            [3] => SELECT MAX(group_quota) as disk_max, MIN(group_quota) as disk_min, MAX(can_rate_pictures) as can_rate_pictures, MAX(can_send_ecards) as can_send_ecards, MAX(upload_form_config) as ufc_max, MIN(upload_form_config) as ufc_min, MAX(custom_user_upload) as custom_user_upload, MAX(num_file_upload) as num_file_upload, MAX(num_URI_upload) as num_URI_upload, MAX(can_post_comments) as can_post_comments, MAX(can_upload_pictures) as can_upload_pictures, MAX(can_create_albums) as can_create_albums, MAX(has_admin_access) as has_admin_access, MIN(pub_upl_need_approval) as pub_upl_need_approval, MIN( priv_upl_need_approval) as  priv_upl_need_approval FROM cpg133_usergroups WHERE group_id in (101,21) (0.001s)
            [4] => SELECT group_name FROM  cpg133_usergroups WHERE group_id= 101 (0s)
            [5] => SELECT user_favpics FROM cpg133_favpics WHERE user_id = 2 (0.001s)
            [6] => DELETE FROM cpg133_banned WHERE expiry < '2006-01-29 16:34:36' (0s)
            [7] => SELECT * FROM cpg133_banned WHERE (ip_addr='87.1.202.56' OR ip_addr='87.1.202.56' OR user_id=2) AND brute_force=0 (0s)
            [8] => SELECT COUNT(*) FROM cpg133_pictures WHERE approved = 'NO' (0.002s)
            [9] => SELECT COUNT(*) FROM cpg133_pictures WHERE () AND ctime > UNIX_TIMESTAMP() - 0 AND ctime < UNIX_TIMESTAMP() - 0  (0s)
        )

        ==========================
        GET :
        ------------------
        Array
        (
            [album] => search
            [cat] => 0
            [page] => 2
        )

        ==========================
        POST :
        ------------------
        ###eleonora
        ==========================
        VERSION INFO :
        ------------------
        PHP version: 4.4.2-dev - OK
        ------------------
        mySQL version: 4.0.23-standard
        ------------------
        Coppermine version: 1.4.3(stable)
        ==========================
        Module: GD
        ------------------
        GD Version: bundled (2.0.28 compatible)
        FreeType Support: 1
        FreeType Linkage: with freetype
        T1Lib Support:
        GIF Read Support: 1
        GIF Create Support: 1
        JPG Support: 1
        PNG Support: 1
        WBMP Support: 1
        XBM Support: 1
        JIS-mapped Japanese Font Support:

        ==========================
        Module: mysql
        ------------------
        MySQL Supportenabled
        Active Persistent Links 0
        Active Links 1
        Client API version 4.0.23
        MYSQL_MODULE_TYPE external
        MYSQL_SOCKET /var/lib/mysql/mysql.sock
        MYSQL_INCLUDE -I/usr/include/mysql
        MYSQL_LIBS -L/usr/lib -lmysqlclient 
        ==========================
        Module: zlib
        ------------------
        ZLib Support enabled
        Compiled Version 1.2.1.2
        Linked Version 1.2.1.2
        ==========================
        Server restrictions (safe mode)?
        ------------------
        Directive | Local Value | Master Value
        safe_mode | Off | Off
        safe_mode_exec_dir | no value | no value
        safe_mode_gid | Off | Off
        safe_mode_include_dir | no value | no value
        safe_mode_exec_dir | no value | no value
        sql.safe_mode | Off | Off
        disable_functions | no value | no value
        file_uploads | On | On
        include_path | .:/usr/lib/php:/usr/local/lib/php | .:/usr/lib/php:/usr/local/lib/php
        open_basedir | no value | no value
        ==========================
        email
        ------------------
        Directive | Local Value | Master Value
        sendmail_from | no value | no value
        sendmail_path | /usr/sbin/sendmail -t -i | /usr/sbin/sendmail -t -i
        SMTP | localhost | localhost
        smtp_port | 25 | 25
        ==========================
        Size and Time
        ------------------
        Directive | Local Value | Master Value
        max_execution_time | 30 | 30
        max_input_time | -1 | -1
        upload_max_filesize | 40M | 40M
        post_max_size | 55M | 55M
        ==========================
        Page generated in 0.665 seconds - 10 queries in 0.006 seconds - Album set : ; Meta set: ;[/size]

Tranz

I don't remember having been to your site before, but when I did the search, and clicked on thumbnail, I got no image displayed.

I did a search for the error message you showed in debug and found I had had a similar issue... http://forum.coppermine-gallery.net/index.php?topic=22064.msg101018#msg101018

So when I used the web dev toolbar to delete all cookies from your site, the search function worked.

Zenigata

Sorry TranzNDance, but your solution doesn't work. I've tried to clear my cookies in IE 6.0, FF 1.5 (even via web developer toolbar), to change the name of the cookie and to the template but when I click on a thumbnail the gallery says there isn't any image to display.

Please help me, it's a very big problem.  :-\

Nibbler

You've added your header all wrong, that's likely messing with the proper setting of cookies.

Zenigata

#8
Quote from: Nibbler on January 29, 2006, 07:00:46 PM
You've added your header all wrong, that's likely messing with the proper setting of cookies.

Yes, I've modified the subsilver template and I've added an header and a navigation menu because I can't add two header files in cpg configuraton menu. How can I fix it?

Thanks.


edit: I still have problems with Classic Theme (temporanely it's the defalut theme), where there isn't any header, so I think it's not a theme related bug.

Joachim Müller

rename your cookie name in coppermine's config (only use alphanumeric chars).

Zenigata

Quote from: GauGau on January 29, 2006, 09:48:40 PM
rename your cookie name in coppermine's config (only use alphanumeric chars).

I've changed the cookie name from cpg133 to cpg coppermine, delteled all cookied via web developer extension in ff 1.5; I've also tried with IE 6.0 but I have the same message no images found . Do think it's a bug of the smf bridge?

Tranz

Hmm... try logging out of smf. When it worked for me, I wasn't logged in.

Zenigata

#12
Quote from: TranzNDance on January 30, 2006, 01:37:19 AM
Hmm... try logging out of smf.

No, same message. :(

edit: I've also optimized the database via phpmyadmin but nothing changed.