forum.coppermine-gallery.net

Support => cpg1.4 plugins => cpg1.4.x Support => Older/other versions => cpg1.4 plugin contributions => Topic started by: Paver on January 15, 2006, 09:43:32 am

Title: Search Album Title & Description
Post by: Paver on January 15, 2006, 09:43:32 am
Note: This first post mentions some features that have been modified in later releases of this plugin.  Please read the whole thread for the history and for what features are present in the current release.

This plugin adds "Album Title" and "Album Description" to the list of fields you can search.  The results are returned in a separate box showing the albums that match your search criteria; this box appears above the regular search box.  The only configuration option is on installation: whether to show an empty box when no albums match your criteria or not. 

This was an interesting task due to the placement and number of the current plugin hooks.  As Donnoman noted on CPG-Contrib, modifying album contents using the thumb_caption plugin filters is problematic since the albums depend on a count variable which is not accessible to the plugin.  But in this case, since I'm returning albums and not images to browse in a meta album, the count isn't used.  Here's the thread for those interested: http://cpg-contrib.org/board/index.php?topic=52.0 (http://cpg-contrib.org/board/index.php?topic=52.0).  Also, the search page doesn't have a plugin hook.  This plugin uses a copied version of search.php and adds the new fields.  For the search results page, I use the 'lastalb' meta album and "hijack" it by replacing its title with my title and $rowset with my search results.

It works, but I don't know if I would consider it ideal or not.  I'm sure the plugin system will improve, but for the current state, I'm not sure if there's anything different (better) I could have done.  If anyone has any comments, please let me know.  It seems to me that adding this feature to the search core scripts would be useful; I'm willing to contribute to such an update for a future version.

Note that this plugin replaces the search link on your SUB_MENU.  If you have the search link someplace else (and especially if you don't use the sub menu), you might think this plugin is not working.  Ideally you shouldn't manually add a link to the plugin search form in your theme because then uninstalling the plugin would require an extra step.  Please let me know where else this plugin should look for search links and I can add them. 

v1.01 includes a bugfix (hard-coded config table) and a better check in _addresults
v1.02 improves the method of replacing the search link so it works with all themes
v1.03 adds the category name to the thumbnail caption for both search album results & 'lastalb' (Last Updated Albums)
v1.04 adds config option for category name display, fixes processing so original search form works, replaces search.php everywhere on page, added README.txt to describe theme custom search boxes, and a few other behind-the-scenes improvements
v1.05 adds a config panel, adds album stats, adds option to search albums only (no pictures) - more details (http://forum.coppermine-gallery.net/index.php?topic=26483.msg126090#msg126090)
v1.06 uses a new stats template and date format, replaces thumbnail captions completely for albums - more details (http://forum.coppermine-gallery.net/index.php?topic=26483.msg126423#msg126423)
v1.07 changes nothing except the default value of 'files' and 'views' in english.php, which is commented out by default - more details (http://forum.coppermine-gallery.net/index.php?topic=26483.msg126447#msg126447)
v1.08 includes two important bug fixes regarding restricted & empty albums - more details (http://forum.coppermine-gallery.net/index.php?topic=26483.msg133360#msg133360) - known issues (http://forum.coppermine-gallery.net/index.php?topic=26483.msg133374#msg133374)

FYI: It's easier to read the thread manually than to use the "more details" links in the changelog.
Title: Re: Search Album Title & Description
Post by: Prisoner_24601 on January 15, 2006, 11:19:23 pm
Downloaded.  Installed.

Two problems:

1.  The plugin initially wouldn't install.  I turned on CPG's debug and found that there was a problem where the plugin couldn't find a table.  This is in CODEBASE.PHP, line 39:

Code: [Select]
cpg_db_query("DELETE FROM cpg_config WHERE name REGEXP '^plugin_searchalbum_'");
Changed it to
Code: [Select]
cpg_db_query("DELETE FROM cpg143_config WHERE name REGEXP '^plugin_searchalbum_'");
... In other words, I changed the name of the table prefix in the code.  On my CPG install the table prefixes are "cpg143", not "cpg".  I didn't install CPG myself, my webhost did, so I dunno if "cpg" or "cpg143" is the default table prefix.

2.  Doing the above correction allowed me to install the plugin, but when I searched, it didn't find anything.  For gee whiz, I also created a new album, uploaded some pics and then added a description.  Search still didn't find anything.

There was a notice in DEBUG:

Quote
\plugins\search_album\codebase.php

* Notice line 162: Undefined index: REQUEST_URI

(This index also appears in line 62.)

I don't know how to resolve that.  Please assist! 

Here's the full DEBUG info (I've got all of 6 pictures in my DB; I don't mind reinstalling stuff to make this work).  It's a plain vanilla install of CPG 1.43 on a Windows 2003 server, running PHP 5.1.1 and MySQL 5:

Code: [Select]
USER:
------------------
Array
(
    [ID] => 11d4f5a45178d211db13b5858a7add36
    [am] => 1
    [lang] => english
    [liv] => Array
        (
            [0] => 5
        )

    [search] => Array
        (
            [search] => 1958
            [album] => search
            [title] => on
            [newer_than] =>
            [caption] => on
            [older_than] =>
            [keywords] => on
            [type] => OR
            [album_title] => on
            [album_description] => on
            [params] => Array
                (
                    [title] => on
                    [caption] => on
                    [keywords] => on
                )

        )

)

==========================
USER DATA:
------------------
Array
(
    [user_id] => 1
    [user_name] => saxpics
    [groups] => Array
        (
            [0] => 1
        )

    [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] => 5
    [num_URI_upload] => 3
    [can_post_comments] => 1
    [can_upload_pictures] => 1
    [can_create_albums] => 1
    [has_admin_access] => 1
    [pub_upl_need_approval] => 0
    [priv_upl_need_approval] => 0
    [group_name] => Administrators
    [upload_form_config] => 3
    [group_quota] => 0
    [can_see_all_albums] => 1
    [group_id] => 1
)

==========================
Queries:
------------------
Array
(
    [0] => SELECT extension, mime, content, player FROM cpg143_filetypes; (0.002s)
    [1] => select * from cpg143_plugins order by priority asc; (0.001s)
    [2] => delete from `test`.cpg143_sessions where time<1137358357 and remember=0; (0.001s)
    [3] => delete from `test`.cpg143_sessions where time<1136152357; (0.001s)
    [4] => select user_id from `test`.cpg143_sessions where session_id=md5("d7b002f7bde6566522de95281119c8f086230dde26c1ff66700314c65d7b330d"); (0.001s)
    [5] => select user_id as id, user_password as password from `test`.cpg143_users where user_id=1 (0.001s)
    [6] => SELECT u.user_id AS id, u.user_name AS username, u.user_password AS password, u.user_group+100 AS group_id FROM `test`.cpg143_users AS u INNER JOIN `test`.cpg143_usergroups AS g ON u.user_group=g.group_id WHERE u.user_id='1' (0.001s)
    [7] => SELECT user_group_list FROM `test`.cpg143_users AS u WHERE user_id='1' and user_group_list <> ''; (0.001s)
    [8] => 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 cpg143_usergroups WHERE group_id in (1) (0.001s)
    [9] => SELECT group_name FROM  cpg143_usergroups WHERE group_id= 1 (0.001s)
    [10] => update `test`.cpg143_sessions set time='1137361957' where session_id=md5('d7b002f7bde6566522de95281119c8f086230dde26c1ff66700314c65d7b330d'); (0.001s)
    [11] => SELECT user_favpics FROM cpg143_favpics WHERE user_id = 1 (0.001s)
    [12] => DELETE FROM cpg143_banned WHERE expiry < '2006-01-15 21:52:37' (0.001s)
    [13] => SELECT * FROM cpg143_banned WHERE (ip_addr='68.104.158.246' OR ip_addr='68.104.158.246' OR user_id=1) AND brute_force=0 (0.001s)
    [14] => SELECT COUNT(*) FROM cpg143_pictures WHERE approved = 'NO' (0.001s)
    [15] => SELECT COUNT(*) FROM cpg143_pictures WHERE (title LIKE '%1958%' OR caption LIKE '%1958%' OR keywords LIKE '%1958%')  (0.001s)
    [16] => SELECT * FROM cpg143_pictures WHERE (title LIKE '%1958%' OR caption LIKE '%1958%' OR keywords LIKE '%1958%')  ORDER BY filename ASC  LIMIT 0 ,12 (0.001s)
)

==========================
GET :
------------------
Array
(
)

==========================
POST :
------------------
Array
(
    [search] => 1958
    [album] => search
    [title] => on
    [newer_than] =>
    [caption] => on
    [older_than] =>
    [keywords] => on
    [type] => OR
    [album_title] => on
    [album_description] => on
    [params] => Array
        (
            [title] => on
            [caption] => on
            [keywords] => on
        )

    [params_plugin] => Array
        (
            [album_title] => on
            [album_description] => on
        )

)

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

==========================
Module: mysql
------------------
MySQL Supportenabled
Active Persistent Links 0
Active Links 1
Client API version 4.1.7
==========================
Module: zlib
------------------
ZLib Support enabled
Stream Wrapper support compress.zlib://
Stream Filter support zlib.inflate, zlib.deflate
Compiled Version 1.2.3
Linked Version 1.2.3
==========================
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 | .;C:\php5\pear | .;C:\php5\pear
open_basedir | no value | no value
==========================
email
------------------
Directive | Local Value | Master Value
sendmail_from <Edited out by Prisoner_24601>
sendmail_path | no value | no value
SMTP | localhost | localhost
smtp_port | 25 | 25
==========================
Size and Time
------------------
Directive | Local Value | Master Value
max_execution_time | 30 | 30
max_input_time | 60 | 60
upload_max_filesize | 2M | 2M
post_max_size | 8M | 8M
==========================
Page generated in 0.234 seconds - 17 queries in 0.018 seconds - Album set : ; Meta set: ;
Title: Re: Search Album Title & Description
Post by: Paver on January 16, 2006, 12:14:44 am
Darn.  This is the second time I've done this.  I'm 2 for 2 in the same bug in plugins!  I need to make a list of things to check before I release, and be more careful.  I fixed it and attached version 1.01 in the first post.  As for your search problem, are you sure your search link uses my new search page?  You should see 2 new checkboxes for Album Title and Album Description if you are using my new page.  If you don't see those, your search link was not replaced by my plugin.  My plugin only looks in the default place for the search link which is in the gallery SUB_MENU.  Never mind that.  I looked more carefully at your debug info.  I see you are using my form.

I thought at first that the notice you posted is just a warning.  I could avoid it by checking whether REQUEST_URI exists before doing a string compare, but it shouldn't cause errors.  But now I'm not so sure.  I looked more carefully at my check in function _addresults and changed it to avoid using the REQUEST_URI value.  Please see if this new version works for you.  This check is used since there is a search meta-album that is used for the search results for photos.  My plugin was adding album search results to this meta album.  I tried using REQUEST_URI to determine whether the referring file was thumbnails.php or displayimage.php.  It worked in my case so I'm not sure if this is your problem or not.  In any case, I replaced this check with one that should work more simply.
Title: Re: Search Album Title & Description
Post by: Prisoner_24601 on January 16, 2006, 05:07:16 am
It works!  I'm very happy.

Just a comment -- and this may be because I've not read the documentation in enough depth: this only works on the "default" theme ("classic", I think it's called).  In my case, at least, when I switched to a different theme, I got a variety of different PHP and SQL errors.  I tried three different themes and got three different pages of errors.  I did the expedient thing and turned off the ability to select different themes.

I am going to search and see if I can get the Album Description to show up on the Film Strip page.  That, this plugin that you've written, and the directory-to-album import mod will make CPG essentially PERFECT for my needs (although I'm gonna have to do descriptions for something like 50,000+ albums of pictures).

Thanks very much!
Title: Re: Search Album Title & Description
Post by: Paver on January 16, 2006, 05:30:07 am
Huh.  I'm using a modified classic theme so I haven't tried any other themes yet.  I'm not sure why the theme would matter ... unless it has to do with the SUB_MENU search link being replaced.  I'll check it out.

I'm also working on a way to mass apply keywords to photos but that's not related to what you want to do.  You actually have to type in something different for each album I assume.  And yes, that batch add script is a beautiful way to add new photos - I use it routinely.  That's why I'm working on the mass-keyword plugin/add-on.
Title: Re: Search Album Title & Description
Post by: Prisoner_24601 on January 16, 2006, 05:44:41 am
Quote
unless it has to do with the SUB_MENU search link being replaced.
I think that may be it.  The most common error I get when I use a different theme is:

Quote
Template error
Failed to find block 'search'(#(<!-- BEGIN search -->)(.*?)(<!-- END search -->)#s)

I'm not a coder, nor do I play one on TV, so I'm not sure.

Quote
You actually have to type in something different for each album I assume.
Yes, sir. 

I have a very large picture website and I recently got SQL and PHP for my server and I know that CPG will make my life and browsing my gallery easier.  Everything is in the form of:

<root>\make\model\configuration\finish\album

... and I have between 1 and a zillion pictures per album
Title: Re: Search Album Title & Description
Post by: Paver on January 16, 2006, 05:57:16 am
I just added version 1.02 above.  I improved the method of replacing the search link and now it works for all themes, at least all the ones included in the core package.

Do you plan to put the category tree into the album description so that the albums are searchable by their inheritance?  If so, I would do that programatically using PHP & MySQL.  You could even modify the Batch Add script to do this during the process of adding the photos (and creating the albums & categories).
Title: Re: Search Album Title & Description
Post by: Prisoner_24601 on January 16, 2006, 10:10:53 pm
Yup.  Works as advertised: search returns the Albums and it works with all the "included by default" themes.  Thanks much.

Quote
Do you plan to put the category tree into the album description so that the albums are searchable by their inheritance?  If so, I would do that programatically using PHP & MySQL.  You could even modify the Batch Add script to do this during the process of adding the photos (and creating the albums & categories).

I can see the benefits of doing this, but I hadn't even thought of it, because I had been putting in rather enthusiastic Album descriptions and didn't think I could make it automagic.

I know how to add tables and info into them in MySQL through phpMyAdmin, but I don't know how to do what you mention.  If you can give me some ideas, I'd appreciate it.  While I'm not a coder, I am a computer tech so playing with stuff doesn't bother me.

Title: Re: Search Album Title & Description
Post by: Paver on January 16, 2006, 10:29:38 pm
You're welcome.  If you notice any other themes where there's a problem, let me know on this thread.

If you are all set with enthusiastic descriptions, that's definitely better in the long run and nicer to read.  If you would like to discuss the automagic code, please start another thread somewhere (I'm not sure offhand which board is best).  Let's stick to one question per thread.  If you do, please post a link on this thread or I might not see it.
Title: Re: Search Album Title & Description
Post by: andrewshu329 on January 18, 2006, 02:15:29 pm
Specific searches turn up database errors on my site:
-xinjiang
-x
-y
etc..

Any clues as to why?
heres my site:
www.sasphotos.net

Title: Re: Search Album Title & Description
Post by: Paver on January 18, 2006, 03:51:40 pm
Huh.  You're right.  I assume you mean the "Template error: Failed to find block 'admin_approval'" error.  That's what I see for most searches on your site.  That's almost always a theme error.  Yes, my plugin produced a similar error noted in a previous post, but that's because I was modifying the theme's search link.  My plugin doesn't touch the $template_gallery_admin_menu variable which is where the admin_approval block is to be found.  Check the sample theme's theme.php to see.

I tried your original search.php and got the same errors.  But one thing is weird.  If I search for 'photos' on the plugin search form, I get results fine.  If I search for 'photos' on the original search form, I get the admin_approval error.  I don't know why my search form would avoid the error compared to the original search form.

The bottom line is that this "Failed to find block" error is easily fixed by modifying your theme.php file.  Look to see if your theme.php has a $template_gallery_admin_menu definition in it.  If it does, add the admin_approval block as shown in the sample theme.php.  If it doesn't add the whole definition from the sample theme.php, including the admin_approval block.

My guess is that you have photos to approve now and maybe coincidentally had those photos uploaded when you installed my plugin.  I don't think the error & my plugin are related, but I'm not sure.  For now, I don't think there's a reason to troubleshoot the problem further until you fix the theme error.

edit: If for some reason you don't want the admin_approval link on your admin menu, then just add the BEGIN & END comments and leave the space in between blank.
Title: Re: Search Album Title & Description
Post by: Prisoner_24601 on January 18, 2006, 04:00:21 pm
Paver's quicker than me.  :)

I just wanted to mention that I don't have that problem.

andrewshu329, you've got several more search options than I do.  It could also be that you've got some conflict with another search plugin or hack, too.
Title: Re: Search Album Title & Description
Post by: Paver on January 31, 2006, 02:16:11 am
I wanted to add the category name to search album results so I did and released version 1.03 (attached to the first post as usual).  I left 1.02 on there in case people don't want this added feature.  There's no config. option in 1.03; it just adds the category name.  And oh yeah, it adds the category name to the 'lastalb' meta-album ("Last Updated Albums) as well, since I think it's an analogous feature, and I like it.

If people would like this feature but want a config. option, go ahead and request it.  I'll probably do it anyways before the next release whenever it is, but I didn't have time now to do it, and I think it's a useful feature, so here it is.
Title: Re: Search Album Title & Description
Post by: Prisoner_24601 on January 31, 2006, 08:14:18 pm
Thank you.  I will test further when I have a chance.

I have to ask it: is it possible to include a search for a) "star" ratings for albums and/or b) user comment fields?  As it stands, this plugin (1.02) is wonderful, but I'd love to have these features, too.

Thanks for putting up with my requests!
Title: Re: Search Album Title & Description
Post by: Paver on January 31, 2006, 11:54:00 pm
No problem with the requests.  I'm willing to consider anything; I just cannot promise anything either.

I assume you mean star ratings & comments for pictures, not albums, right?  Please give more details of exactly what would be searched and how the search results would be returned.
Title: Re: Search Album Title & Description
Post by: Paver on February 01, 2006, 02:35:02 am
I added version 1.04 in the first post above, with changes as noted (and as noted in CHANGELOG in the plugin package).

I removed the previous versions because this release takes care of the previous releases' differences.
Title: Re: Search Album Title & Description
Post by: Prisoner_24601 on February 01, 2006, 04:17:57 am
Quote from: Paver
No problem with the requests.  I'm willing to consider anything; I just cannot promise anything either.
I'm sorry to say that I don't know enough about CPG to be that effective to help other folks on this forum -- although I try to share what I do know -- and I ask for a lot of stuff, so thanks for being gracious with your time.

Quote from: Paver
I assume you mean star ratings & comments for pictures, not albums, right?  Please give more details of exactly what would be searched and how the search results would be returned.
Yes.

As far as the star ratings are concerned, I'm assuming that picture X has rating Y saved in some table someplace, and that table has numbers assigned to it (I could be completely wrong, of course).  It'd be nice to check the Gallery every now and then and perhaps remove all the photos with one star or put the five-star ones on display on my main website, using one or more of the other hacks/plugins that do this.

However, more important to me would be a search on comments.  Because CPG is so similar to phpBB (and is built on that technology, if I read the documentation right), it'd be like searching for a post.  I'm hoping to start getting comments from folks that may know more than I about the items in my gallery and I'd like to be able to search under their names and whatever comments they give, as the comments will relate to standardized equipment, etc.

As I said, the search feature does this well in phpBB, so I'd love to see that functionality integrated into CPG -- without having to use some sort of phpBB to CPG bridge, as I have no need for a full-featured Forum, nor do I wish to have to moderate/administrate one.

============

I installed 1.0.3 today and I really like the improvement.  Thanks for anticipating that feature request.
Title: Re: Search Album Title & Description
Post by: Joachim Müller on February 01, 2006, 07:52:07 am
searching comments would really be a nice feature. Searching for particular ratings shouldn't go into this plugin imo, as it actually doesn't involve the search engine, but running a rather simple query, so I suggest writing a separate mod/plugin to accomplish this.
Title: Re: Search Album Title & Description
Post by: lordprodigy on February 01, 2006, 06:12:11 pm
when I do the search, it finds the the relevant albums and displays them. Underneath in a separate window is says "No image to display ". I guess it didnt find any images with the keyword I was looking for so has nothing to display... How can I get rid of that block as I am only interested in people searching by album and not by image... and the only results I want is Albums.

thanks.
Title: Re: Search Album Title & Description
Post by: Paver on February 01, 2006, 06:46:23 pm
@lordprodigy: Ok, I figured out one way to do what you want.  It's related to my plugin so I'll add it in to the next release.  But I assume you want the search form to have only the "Album Title" and the "Album Description" checkboxes and *nothing* else?  Otherwise it doesn't make sense to have checkboxes but then not to return matches using those checkboxes.
Title: Re: Search Album Title & Description
Post by: lordprodigy on February 01, 2006, 07:53:03 pm
@Paver:

Exactly. What i did is I commented out the checkboxes I didnt need. It seeems to be working fine like this except the problem I talked about. As discussed maybe in a future release you chould have those checkboxes optional and tie them to the results. but thats no rush as its working great now.
Title: Re: Search Album Title & Description
Post by: Paver on February 02, 2006, 08:30:54 am
Version 1.05 has been added to the first post as usual. 

A config panel has been added to the admin toolbar to replace the configuration on installation. 

Album stats have been added (with a toggle config option) to the album search results and the "Last Updated Albums" meta-album.   There are a few config options for the stats display and you can further style the stats with "thumb_stats" in theme/style.css.  The stats are also wrapped with the style "thumb_caption" so you don't have to create "thumb_stats" if you don't want to.

A "search only albums (no pictures)" option has been added.  It requires an addition to your theme/theme.php which is described in detail on configuration of this option.  I could find no other way to do this using the plugin system than to require a manual code addition to your theme.  Once added though, you never have to remove it since it does the regular thing even when the plugin is uninstalled. 

Please read the README.txt for more information about the "search only albums" option and about modifying your custom search boxes to use this plugin's search album features.
Title: Re: Search Album Title & Description
Post by: lordprodigy on February 02, 2006, 05:45:29 pm
Great plugin!!! I tested it and works well :)
Title: Re: Search Album Title & Description
Post by: Paver on February 03, 2006, 10:18:55 am
Version 1.06 has been added to the first post as usual.

I have done some tests on the comment & rating searching and this may be in the next plugin release, whenever that is.  I agree with GauGau's previous comment about Prisoner_24601's request for rating content management & syndication, but I do think it might be useful on the search form to return files with certain ratings (and certain other search keys), so that's what I'm considering adding.  You could use this as a poor man's content management (from the results page) & syndication (with GET links), but that's not the main intent.  One thing to note is that so far I have only added on to the search results with a separate album results table.  Comments & rating searching would be added on to the files search form, which is in the thick of the main search feature of the Coppermine core.  If I do add these features, I'm thinking this plugin should be renamed to "Advanced Search" or something like that.  The thread could still include "Search Album" so that other places I mentioned this plugin would still make sense - something like "Advanced Search, including Search Album Title & Description".  Something to consider if I do add these features to the core search.

I have been thinking about a customizable search form with more advanced features to suggest for the next release of Coppermine, but I wouldn't hold my breath for it.  This plugin does things pretty well and it works right now.
Title: Re: Search Album Title & Description
Post by: Paver on February 03, 2006, 02:38:30 pm
I guess I should have known that I shouldn't release a version at 4 in the morning.  Version 1.07 has only one very minor change.  The default value of the labels 'files' and 'views' in lang/english.php is now 'files' and 'views'.  It was something else in 1.06 due to some testing I did.  These values are commented out by default so that Coppermine's multi-language support is enabled by default, i.e. 'files' and 'views' from Coppermine's language files is used unless you remove the comments in the plugin's language file.  You would do this to customize the labels. In so doing, you would break multi-language support, unless you in turn create language files for every language in the plugin's lang directory.

So to sum up, 1.07 works identically to 1.06.  The only change is to make it clear for people who want to customize the 'files' and 'views' labels in the plugin.

Then again, I'm writing this now with barely 4.5 hours of sleep, so I'm probably cruisin' for a bruisin'.  Don't ask why when I woke up, I immediately thought of this.  It scares me too.
Title: Re: Search Album Title & Description
Post by: lordprodigy on February 03, 2006, 05:54:26 pm
WOW. impressive. I love it Paver. Good job. you can see it in action www.bogho.com/b514

It is exactly what I was looking for! In fact, I think this should be a standard config option in coppermine. Right now there is no way to customise what caption is shown and how its shown for the: 'random', 'lastup', 'topn', 'toprated', 'lastcom', 'lasthits', 'lastalb'... I guess for now if someone can come up with a plugin that manages that, it would be fantastic!

The search works great. This is an awesome plugin. Once again great job paver and I appologise for the impatience.
Title: Re: Search Album Title & Description
Post by: Paver on February 03, 2006, 06:09:39 pm
All the other meta-albums you listed (besides 'lastalb') show thumbnails of files, so the options on the config. panel for "Thumbnail List View" are appropriate and allow you to customize the content of the caption.  You can use the styles "thumb_title" and "thumb_caption" in theme/style.css for styling.

I agree that a template like I created in this plugin for the album thumbnails would be handy for specific cases, but I think the current config options for content and style classes for formatting handle virtually all the needs of users.

You are excused for your impatience.  Please keep this in mind in the future.  We all make mistakes now & again.  Let's move on.
Title: Re: Search Album Title & Description
Post by: lordprodigy on February 03, 2006, 07:56:33 pm
Thanks Paver  ;)
Title: Re: Search Album Title & Description
Post by: lordprodigy on February 06, 2006, 10:25:07 pm
Hello Paver,

I found this mod on the board about most popular searches and so on ( http://forum.coppermine-gallery.net/index.php?topic=22244.0 ) ... do you think this could be integrated with your plugin, so it shows the info only on the search page (your plugin)? Let me know. thanks a lot.
Title: Re: Search Album Title & Description
Post by: Joachim Müller on February 07, 2006, 07:41:27 am
stop requesting new plugin features in a thread that deals with a plugin contrib please.
Title: Re: Search Album Title & Description
Post by: Paver on February 07, 2006, 08:22:36 am
I realize I have been condoning the requests by implementing them.  Most of the more elaborate plugins that could have feature requests will most likely make their way onto the CPG-Contrib Boards (http://cpg-contrib.org/board/), where you can more clearly make feature requests on the appropriate sub-boards.  As GauGau has been stressing, this "Plugin Contrib" board is meant as merely an announcement for plugin contributions and discussions on how to use the contributions with no intent for further requests.  Plugin support should go on the parent board "cpg1.4 plugins".  Such support can include "how would one modify this plugin to do this"?  Ideally, as I said, you shouldn't be requesting new features left & right.  If you want to implement new features and contribute those modifications, please do so.  That would be a communal & friendly thing to do.

That's my understanding of the intent of these boards.  GauGau can correct or elaborate on this.  The bottom line for all of this is to keep the boards organized, clear, and easy to read for future & new visitors.

As an example, a request for a mod or feature can be started in a new thread on the main plugins support board.  That request can be discussed there and "solved" by either a mod posted in that thread or a new version announced in the plugin contribution thread.  This keeps "one question per thread" for support.
Title: Re: Search Album Title & Description
Post by: lordprodigy on February 08, 2006, 12:25:27 am
I am aware of the rules of the board. I am getting used to them and trying my best to respect them. In this case, its not a request for a feature, but rather a possibility for integration and willingness to do so. I was looking for a yes / no answer and not a solution. I thought it was a neat mod that can add on to the already amazing plugin that Paver has.

On the other hand, believe me, if I knew any php/mysql I would have done all the mods that came to my mind on my own. Unfortunately I cant do it myself, so the contribution I can give to this community is only in ideas and feature requests.

I will re-post my question in the main plugin board. Point taken.
Title: Re: Search Album Title & Description
Post by: lordprodigy on February 28, 2006, 10:25:47 pm
Paver,

I have been using the plugin for a while. works fantastic. recently I get an error when search for a specific word... I get this:
Code: [Select]
Template error
Failed to find block 'admin_approval'(#(<!-- BEGIN admin_approval -->)(.*?)(<!-- END admin_approval -->)#s) in :

                <div align="center">
                <table cellpadding="0" cellspacing="1">
                        <tr>

                                <td class="admin_menu"><a href="admin.php" title="{ADMIN_TITLE}">{ADMIN_LNK}</a></td>
                                <td class="admin_menu"><a href="catmgr.php" title="{CATEGORIES_TITLE}">{CATEGORIES_LNK}</a></td>
                                <td class="admin_menu"><a href="albmgr.php{CATL}" title="{ALBUMS_TITLE}">{ALBUMS_LNK}</a></td>
                                <td class="admin_menu"><a href="groupmgr.php" title="{GROUPS_TITLE}">{GROUPS_LNK}</a></td>
                                <td class="admin_menu"><a href="usermgr.php" title="{USERS_TITLE}">{USERS_LNK}</a></td>
                                <td class="admin_menu"><a href="banning.php" title="{BAN_TITLE}">{BAN_LNK}</a></td>
                                <td class="admin_menu"><a href="reviewcom.php" title="{COMMENTS_TITLE}">{COMMENTS_LNK}</a></td>
                                </tr><tr>
<!-- BEGIN log_ecards -->
                                <td class="admin_menu"><a href="db_ecard.php" title="{DB_ECARD_TITLE}">{DB_ECARD_LNK}</a></td>
<!-- END log_ecards -->
                                <td class="admin_menu"><a href="picmgr.php" title="{PICTURES_TITLE}">{PICTURES_LNK}</a></td>
                                <td class="admin_menu"><a href="searchnew.php" title="{SEARCHNEW_TITLE}">{SEARCHNEW_LNK}</a></td>
                                <td class="admin_menu"><a href="util.php" title="{UTIL_TITLE}">{UTIL_LNK}</a></td>
                                <td class="admin_menu"><a href="profile.php?op=edit_profile" title="{MY_PROF_TITLE}">{MY_PROF_LNK}</a></td>
<!-- BEGIN documentation -->
                                <td class="admin_menu"><a href="{DOCUMENTATION_HREF}" title="{DOCUMENTATION_TITLE}" target="cpg_documentation">{DOCUMENTATION_LNK}</a></td>
<!-- END documentation -->
                        </tr>
                </table>
                </div>


The weird thing is that I started from a 1.4.x template and issues similar to this were referenced to upgrading from an old theme... This error happens only when I search the word "Time" for some reason... I appreciate your help. thanks a lot!
Title: Re: Search Album Title & Description
Post by: Paver on February 28, 2006, 11:33:10 pm
That's bizarre.  I just checked it out on your site, and I see what you mean.  Is your theme based on "hardwired"?  Take a look in your theme.php and look for the variable $template_gallery_admin_menu.  See if you see a line with <!-- BEGIN admin_approval --> near the beginning of this variable's definition.  The core hardwired theme has it.  Let me know if your theme.php has this block.  It might be helpful if you attach your theme.php to your reply so I can try it on my site and troubleshoot the problem.  This is the second time I've heard of a case where a particular search word does something particularly weird.  I didn't have any way to troubleshoot the first report, but I believe it was fixed (in an overall way which didn't hint at why the particular word was special).
Title: Re: Search Album Title & Description
Post by: lordprodigy on March 01, 2006, 12:10:59 am
Paver, thank you very much for your reply. Here is the theme.php attached. and the code I have there is
Code: [Select]
// HTML template for gallery admin menu
$template_gallery_admin_menu = <<<EOT

                <div align="center">
                <table cellpadding="0" cellspacing="1">
                        <tr>
<!-- BEGIN admin_approval -->
                                <td class="admin_menu" id="admin_menu_anim"><a href="editpics.php?mode=upload_approval" title="{UPL_APP_TITLE}">{UPL_APP_LNK}</a></td>
<!-- END admin_approval -->
                                <td class="admin_menu"><a href="admin.php" title="{ADMIN_TITLE}">{ADMIN_LNK}</a></td>
                                <td class="admin_menu"><a href="catmgr.php" title="{CATEGORIES_TITLE}">{CATEGORIES_LNK}</a></td>
                                <td class="admin_menu"><a href="albmgr.php{CATL}" title="{ALBUMS_TITLE}">{ALBUMS_LNK}</a></td>
                                <td class="admin_menu"><a href="groupmgr.php" title="{GROUPS_TITLE}">{GROUPS_LNK}</a></td>
                                <td class="admin_menu"><a href="usermgr.php" title="{USERS_TITLE}">{USERS_LNK}</a></td>
                                <td class="admin_menu"><a href="banning.php" title="{BAN_TITLE}">{BAN_LNK}</a></td>
                                <td class="admin_menu"><a href="reviewcom.php" title="{COMMENTS_TITLE}">{COMMENTS_LNK}</a></td>
                                </tr><tr>
<!-- BEGIN log_ecards -->
                                <td class="admin_menu"><a href="db_ecard.php" title="{DB_ECARD_TITLE}">{DB_ECARD_LNK}</a></td>
<!-- END log_ecards -->
                                <td class="admin_menu"><a href="picmgr.php" title="{PICTURES_TITLE}">{PICTURES_LNK}</a></td>
                                <td class="admin_menu"><a href="searchnew.php" title="{SEARCHNEW_TITLE}">{SEARCHNEW_LNK}</a></td>
                                <td class="admin_menu"><a href="util.php" title="{UTIL_TITLE}">{UTIL_LNK}</a></td>
                                <td class="admin_menu"><a href="profile.php?op=edit_profile" title="{MY_PROF_TITLE}">{MY_PROF_LNK}</a></td>
<!-- BEGIN documentation -->
                                <td class="admin_menu"><a href="{DOCUMENTATION_HREF}" title="{DOCUMENTATION_TITLE}" target="cpg_documentation">{DOCUMENTATION_LNK}</a></td>
<!-- END documentation -->
                        </tr>
                </table>
                </div>
EOT;

My theme is based on hardwired and I did my mods on the one provided in the 1.4.3 package. Let me know if you find any glitches. I appreciate yout time for this!
Title: Re: Search Album Title & Description
Post by: Paver on March 01, 2006, 04:09:22 am
I found one error in my plugin having to do with albums which have no photos in them.  But I do not get the same error that you got.  I tried your theme.php and it works fine for me.

Do you have an album with no photos that has "time" in the title?

I noticed on your website that only searching for "time" in the title gives the error.  If you search the description, things are fine, so that leads me to believe that there's an album title with "time" in it that leads to the error.  I also searched for "tim", "ti", and "t" with similar results which is consistent with this supposition.

I don't know why you are getting the "admin_approval" error, but it might be related to the albums with no photos error.  Or it might not be.  I'm working on a fix for the error I found, but it's not ready yet for you to try.  I'll post it when it's ready.
Title: Re: Search Album Title & Description
Post by: lordprodigy on March 01, 2006, 05:23:08 am
Paver, you are amaizing! you found the glitch! I do have an empty album with Time in the title... hence the error when your plugin finds that album. I am not intending to have empty albums so this should be fine :) But I will follow up to see when you post the update. Thanks a lot. Great Job.
Title: Re: Search Album Title & Description
Post by: lordprodigy on March 04, 2006, 10:34:40 pm
Hello Paver,

I have transfered my test installation to my site (www.b514.com) and now I always get this error, unless I am logged in as admin... :(
Code: [Select]
Template error
Failed to find block 'admin_approval'(#(<!-- BEGIN admin_approval -->)(.*?)(<!-- END admin_approval -->)#s) in :

                <div align="center">
                <table cellpadding="0" cellspacing="1">
                        <tr>

                                <td class="admin_menu"><a href="admin.php" title="{ADMIN_TITLE}">{ADMIN_LNK}</a></td>
                                <td class="admin_menu"><a href="catmgr.php" title="{CATEGORIES_TITLE}">{CATEGORIES_LNK}</a></td>
                                <td class="admin_menu"><a href="albmgr.php{CATL}" title="{ALBUMS_TITLE}">{ALBUMS_LNK}</a></td>
                                <td class="admin_menu"><a href="groupmgr.php" title="{GROUPS_TITLE}">{GROUPS_LNK}</a></td>
                                <td class="admin_menu"><a href="usermgr.php" title="{USERS_TITLE}">{USERS_LNK}</a></td>
                                <td class="admin_menu"><a href="banning.php" title="{BAN_TITLE}">{BAN_LNK}</a></td>
                                <td class="admin_menu"><a href="reviewcom.php" title="{COMMENTS_TITLE}">{COMMENTS_LNK}</a></td>
                                </tr><tr>
<!-- BEGIN log_ecards -->
                                <td class="admin_menu"><a href="db_ecard.php" title="{DB_ECARD_TITLE}">{DB_ECARD_LNK}</a></td>
<!-- END log_ecards -->
                                <td class="admin_menu"><a href="picmgr.php" title="{PICTURES_TITLE}">{PICTURES_LNK}</a></td>
                                <td class="admin_menu"><a href="searchnew.php" title="{SEARCHNEW_TITLE}">{SEARCHNEW_LNK}</a></td>
                                <td class="admin_menu"><a href="util.php" title="{UTIL_TITLE}">{UTIL_LNK}</a></td>
                                <td class="admin_menu"><a href="profile.php?op=edit_profile" title="{MY_PROF_TITLE}">{MY_PROF_LNK}</a></td>
<!-- BEGIN documentation -->
                                <td class="admin_menu"><a href="{DOCUMENTATION_HREF}" title="{DOCUMENTATION_TITLE}" target="cpg_documentation">{DOCUMENTATION_LNK}</a></td>
<!-- END documentation -->
                        </tr>
                </table>
                </div>
Any ideas why? How can I fix it? Thanks a lot in advance.
Title: Re: Search Album Title & Description
Post by: Nibbler on March 04, 2006, 10:41:10 pm
Update your gallery.
Title: Re: Search Album Title & Description
Post by: lordprodigy on March 04, 2006, 11:35:06 pm
Thanks Nibbler. I just updated to 1.4.4 but the problem is still there...

Basically, when I am logged in as admin I get error
Code: [Select]
There was an error while processing a database query when the search find an album with no photos inside it. When I am not logged in as admin, I get the above template error... Paver mentioned that he found a little problem refering to that. I understand that the problem would give a
Code: [Select]
There was an error while processing a database query result, but why would it give the template error when not logged in. This is the condition on my test site (www.bogho.com/b514) and on my real site www.b514.com any search attemp results into the template error above when not logged in as admin... I think there might be another, possibly bigger glitch somewhere... :( Do you have any ideas? I appreciate all the help.
Title: Re: Search Album Title & Description
Post by: Nibbler on March 04, 2006, 11:41:41 pm
Works properly with the classic theme. I suspect you have overridden the function that contains the fix with your own function in theme.php. You'll need to apply the fix (http://forum.coppermine-gallery.net/index.php?topic=24295.msg118141#msg118141) manually to your theme.
Title: Re: Search Album Title & Description
Post by: lordprodigy on March 05, 2006, 12:29:08 am
you are right. I had seen that thread about the ecards, but didnt think would apply here. Thanks a lot. The template problem is solved.

I still get the There was an error while processing a database query error
debug info
Code: [Select]
While executing query "SELECT *,a.title AS title,a.aid AS aid,a.description as description,p.ctime as ctime FROM cpg132_albums as a LEFT JOIN cpg132_pictures as p ON (a.thumb=p.pid) WHERE (a.title LIKE '%time%' OR a.description LIKE '%time%') AND cpg132_pictures.cpg132_pictures.aid NOT IN (53,95,96,99,113,117,127)  ORDER BY a.pos" on 0

mySQL error: Unknown table 'cpg132_pictures.cpg132_pictures' in where clause
File: /home/b514/public_html/photos/include/functions.inc.php - Line: 248

it only happens if i am not logged in as admin. it works fine in admin mode.

Thanks for all the help!
Title: Re: Search Album Title & Description
Post by: Nibbler on March 05, 2006, 12:33:57 am
Comment out this line in codebase and see what happens

Code: [Select]
$META_ALBUM_SET = str_replace( "aid", $CONFIG['TABLE_PICTURES'].".aid" , $META_ALBUM_SET );
Title: Re: Search Album Title & Description
Post by: lordprodigy on March 05, 2006, 12:38:11 am
i get
Code: [Select]
Parse error: parse error, unexpected '<' in /home/b514/public_html/photos/plugins/search_album/codebase.php on line 239
Title: Re: Search Album Title & Description
Post by: Nibbler on March 05, 2006, 01:31:48 am
Comment it out using php comments

Code: [Select]
// this line is commented out
not html comments.
Title: Re: Search Album Title & Description
Post by: Paver on March 05, 2006, 01:36:17 am
Well, this is embarrassing ... the $META_ALBUM_SET line Nibbler mentioned I didn't really know what that did when I put it in there - it's the *only* line I didn't understand (really!) - I grabbed it from the 'lastalb' code.  So I'm not surprised if it's useless or does something bad.  I forgot about it until now.

If your problem is the search results with albums with 0 photos, here's a quick fix that will remove the database error and gives a result with the correct link but with bad stats & no thumbnail.

Find this block of code in function searchalbum_hijacklastalb:
Code: [Select]
$query_newpic = "SELECT *,a.title AS title,a.description as description,p.ctime as ctime FROM {$CONFIG['TABLE_ALBUMS']} as a,{$CONFIG['TABLE_PICTURES']} as p WHERE (a.aid=p.aid AND p.ctime = $maxctime)";
$result_newpic = cpg_db_query($query_newpic);
$rowset_newpic = cpg_db_fetch_rowset($result_newpic);
$rowset[$irow] = $rowset_newpic[0];
mysql_free_result($result_newpic);
and replace it with this block:
Code: [Select]
if ($maxctime) {
$query_newpic = "SELECT *,a.title AS title,a.description as description,p.ctime as ctime FROM {$CONFIG['TABLE_ALBUMS']} as a,{$CONFIG['TABLE_PICTURES']} as p WHERE (a.aid=p.aid AND p.ctime = $maxctime)";
$result_newpic = cpg_db_query($query_newpic);
$rowset_newpic = cpg_db_fetch_rowset($result_newpic);
$rowset[$irow] = $rowset_newpic[0];
mysql_free_result($result_newpic);
} else {
$cpg_nopic_data = cpg_get_system_thumb('nopic.jpg',10001);
$cpg_nopic_data['filename'] = basename($cpg_nopic_data['thumb']);
$cpg_nopic_data['filepath'] = dirname($cpg_nopic_data['thumb']).'/';
foreach ($cpg_nopic_data as $key => $value) {
$rowset[$irow][$key] = $value;
}
$rowset[$irow]['caption'] = '<img src="' . $cpg_nopic_data['thumb'] . '" ' . $cpg_nopic_data['whole'] . ' class="image" border="0" alt="" />';
// $rowset[$irow]['aid'] = $row['aid'];
// echo "<pre>"; print_r($cpg_nopic_data); echo "</pre>";
// $rowset[$irow]['title'] = $row['title'];
// $rowset[$irow]['description'] = $row['description'];
// $rowset[$irow]['category'] = $row['category'];
}

As you might be able to tell, the new code has some commented out lines which is part of my testing for the correct code that will give the correct system thumbnail for 'nopic' and the correct stats.  I haven't had time to work on this since I last posted.  I figured I'd post this little bit now if you want to remove the database error.
Title: Re: Search Album Title & Description
Post by: lordprodigy on March 05, 2006, 08:33:35 am
Hello Nibbler, Paver,

I tried both of the above options but none of them yielded a successful search. :( This is the debug info i get:
 
Code: [Select]
debug info removed
In this case, I dont think it is an emty album problem, as I dont have any. The weird thing is that it works well in admin mode...  Any more clues? :( I appreciate your help.

edit: I removed the debug info as its not needed in this case.
Title: Re: Search Album Title & Description
Post by: Joachim Müller on March 05, 2006, 10:49:13 am
1) never leave admin mode
2) don't post debug_output unless requested
Title: Re: Search Album Title & Description
Post by: lordprodigy on March 05, 2006, 05:05:36 pm
I had no choice, since the plugin works only when I am signed in as admin. If I am not logged in, I get the above error.  :(
Title: Re: Search Album Title & Description
Post by: Paver on March 05, 2006, 05:56:39 pm
I don't understand what the error is now.  If you commented out the $META_ALBUM_SET line properly, you shouldn't have the cp132.pictures.cpg132.pictures error and you shouldn't have the '<' error.  If you have no empty albums, you shouldn't have those errors as well.  What's left?  The debug_info, as GauGau said, is only useful in certain cases and so should not be posted unless requested.  In addition, it doesn't include the error message so I don't know what the current problem is.  I tried 'USER_MODE' right now, and the plugin works fine.

I'll post a quick fix now to remove that $META_ALBUM_SET line and remove the empty album error since it's embarassing to have script-killing errors in a release.  The caption for empty albums will not be correct yet - it's an "issue" until I decide how best to deal with it.

edit: Hold on a second, I think I know what your error is.  And I think I have fixed it.  Just a minute . . .  (well, after lunch)
Title: Re: Search Album Title & Description
Post by: lordprodigy on March 05, 2006, 06:23:41 pm
Thanks Paver, take your time. Bonne appetit. It doesnt affect the usage of the site (except search)

To state clearly the above errors above are taken care of. I was commenting as Nibbler said with the html commands and not the php... silly. I dont have empty albums, so the empty album problem doesnt affect me. The problem is that, as a normal user any search string gives me the "There was an error while processing a database query" error. While logged in as admin, the plugin works great...   :( take a look at www.b514.com/photos.

Thanks a million.
Title: Re: Search Album Title & Description
Post by: Paver on March 05, 2006, 06:57:34 pm
Yeah, this is a serious error.  It occurs if you have group-restricted albums so $META_ALBUM_SET has a value (which includes the albums that are restricted from the current user's group).  If you have no restricted albums, you don't see this error.

It's a serious mistake because I should have tested this on various user groups.  The plugin is basically useless until I fix this.  I have a fix that works now, but I want to test it out and tweak things a bit before I release it.
Title: Re: Search Album Title & Description
Post by: lordprodigy on March 05, 2006, 09:43:11 pm
Paver, I am happy you found the problem. I do have restricted user groups so you are right on the spot. For now I will take out the plugin and will reinstall it when you manage to update it. I will keep an eye on this thread for the new release. If you want me to do some testing on my site let me know.

Thanks a lot!!
Title: Re: Search Album Title & Description
Post by: Paver on March 06, 2006, 08:27:01 pm
v1.08 has been added to the first post as usual.  It includes 2 important bug fixes, one that killed the script, the other merely unprofessional-looking results.

Title: Re: Search Album Title & Description
Post by: lordprodigy on March 06, 2006, 09:21:30 pm
Paver, I tested it and all problems are gone. works as expected. its great. thanks a lot! Its a wonderful plugin! Great work!!!  ;)
Title: Re: Search Album Title & Description
Post by: Paver on March 06, 2006, 10:06:52 pm
Fiddlesticks.  I need to report 2 known issues with the current version (1.08).  I thought the more serious one (the first one) was due to another plugin, but it looks like it might be this plugin's fault.

Title: Re: Search Album Title & Description
Post by: lordprodigy on March 06, 2006, 10:18:18 pm
I came across the Search link problem before but I thought it was fixed in 1.08... (my plugin is last in prority list)

Good point about the case sensitiveness... insensitive is better in my opinion too.
Title: Re: Search Album Title & Description
Post by: Paver on March 06, 2006, 10:50:20 pm
Are you saying that with the plugin last in the priority list, you still have the search link problem?  Or are you saying you saw the problem before when the plugin was higher up, but now that you've installed 1.08 and it happens to be last, you don't see the problem anymore?
Title: Re: Search Album Title & Description
Post by: lordprodigy on March 06, 2006, 11:16:20 pm
the second one. Right now the plugin is last and I don't see the problem anymore.
Title: Re: Search Album Title & Description
Post by: Paver on March 06, 2006, 11:42:52 pm
Ok, that makes sense.  It's a weird problem.  I would think giving a plugin a higher priority would always make things work even if the plugin doesn't "behave".  Only working with a lower priority is weird.  I have tested it with only one other plugin installed - Nibbler's file-type editor - and that plugin doesn't use the "page_html" filter.  I'm glad there's a work-around because this will take some troubleshooting to figure out.  If Nibbler or anyone else has some thoughts on this, please let me know.  It does remind me of a common looping issue where you don't pass the processed value in the loop to the next iteration and so the next iteration uses the original value which causes the final output to appear to only have processed the last iteration.  In this case though the file-type editor plugin doesn't have a "page_html" filter so it's effectively an empty iteration.  Hmm . . .  The only other thing that comes to mind is that the output buffer is flushed in my plugin code somehow and so the output buffer callback function is called prematurely.  I don't have any explicit ob_end_flush() calls though, so it's not obvious if this is a possible cause.  But why would that happen only when another plugin is installed and exists at a higher priority?  Hmm . . .
Title: Re: Search Album Title & Description
Post by: lordprodigy on March 07, 2006, 04:11:50 pm
hmm something else too...

When I am on an error page and I click on the search, it takes me to the old one and doesnt overwrite with your plugin's search ...

Take a look on my site (www.b514.com/photos); when you click on a thumb you`ll get the Register or Login screen; on that screen click search and you`ll see what I mean.

I guess it is related to the issue you mentioned above. The plugin is last in priority.
Title: Re: Search Album Title & Description
Post by: Paver on March 07, 2006, 10:18:32 pm
Ahh... I see.  That's very interesting.  I tested out a number of things yesterday but haven't found the culprit yet.  How did you implement the register requirement?  Did you use the one-line mod for displayimage.php mentioned in the FAQ?  I can use this new error to investigate the problem as well.  In your case, it's probably not very often that someone will immediately want to search after getting that error page, but regardless, I am trying to solve the problem as soon as I can because it bugs me.   >:(
Title: Re: Search Album Title & Description
Post by: lordprodigy on March 07, 2006, 11:27:03 pm
Oh this isnt bothering me at all. I only brought it up because I think it is relevant to the above error. In fact, all error screens's search button takes you to the old search. I had this happen before with the database error that was getting (you fixed that error in 1.08).

I implemented the FAQ approach to the registration requirement. I only changed the wording and styling directly in the displayimage.php as no one here wanted to give me directions how to modify the global styling of error messages...
Title: Re: Search Album Title & Description
Post by: Paver on March 07, 2006, 11:51:35 pm
Ok, I'll use this error to see if that helps uncover the pesky bug.

And I would say that no one who read your global-error message was able to answer it in the time they had - it wasn't that everyone shunned you.  I often read messages but if I don't have time to answer right then, I move on, and check back later when I do have time to see if the question is still outstanding.  The board is not a hotline; if someone can answer quickly, he/she will.  If not, you have to hope someone else might be able to.  After a few weeks with no response, it's perfectly reasonable to bump a thread up to effectively ask the question again.  In many threads, it's not clear whether the question is still outstanding because people do not return to close out the thread.  This makes it difficult to decide of the old threads which to read & answer.

I don't mean to belabor this point.  In any case, I'll bend the rules a bit by giving a general answer: all message text should be available in the language files, e.g. lang/english.php.  It's recommended to copy the language file to a new name like english-mod.php, then modify the new file and set your Coppermine to point to the new "language" - that way you know what you've modded when you upgrade.  If you have a follow-up question regarding this, please use your other thread to continue this discussion.
Title: Re: Search Album Title & Description
Post by: lordprodigy on March 08, 2006, 12:31:34 am
Yes I know about the rules of the board... I learned the hard way.. hahaah look at my karma...

About the plugin: I think its a bug to be fixed in a future version, when you have the time to work on it. Its working fine for now... 

Once stable, do you think this should be integrated into the core code of CPG 1.5? Maybe with the most popular searches mod, I wrote about in the the other thread  ;)

Your time on this is very much appreciated by everyone.
Title: Re: Search Album Title & Description
Post by: Paver on March 08, 2006, 01:02:22 am
Most plugins & mods are being considered by the devs for inclusion in 1.5.  The devil's in the details as always.  Regardless of whether it makes it or not, plugins are of course the easiest to add on to the core.
Title: Re: Search Album Title & Description
Post by: trippinsweet on March 22, 2006, 01:59:36 pm
I'm curious if this could be modified to allow searches of category titles too.
Title: Re: Search Album Title & Description
Post by: Paver on March 22, 2006, 03:27:09 pm
Anything is possible with a little time & effort.  But please don't request new features in this thread.  You should only discuss the current code as it currently exists (bugs or installation support) in this thread.

Start a new thread on the main plugin board referencing this plugin thread.  That way we can discuss your proposal and work on implementing it (if and when someone or me has the time to do so).  For example, I'm not sure how the category results would look.  This thread would become even more clutterred if we discuss this here.  Start the new thread and explain exactly what you propose.
Title: Re: Search Album Title & Description
Post by: Konstantinos on April 05, 2006, 06:59:12 pm
nice usefull plugin cheers mate
Title: Re: Search Album Title & Description
Post by: tgiokdi on August 12, 2006, 12:35:08 am
One Issue:
Using one of the themes that came with Copper (rain_drop) I find that everytime I run a search, and I click on the "search" button again, I'm taken to the original search page, which doesn't allow for title / description searches.

I appreciate this plug in, I've tried practically dozens of other picture galleries, and not a single one of those supported title/album name searches, so this single plug-in makes coppermine work for me!
Title: Re: Search Album Title & Description
Post by: tgiokdi on August 12, 2006, 12:53:20 am
yeah, forgot to tell you where I'm at :

http://www.comiccovers.com/copper

going to be moving over the 65,000 images I have on the site to coppermine soon, I think I can just hardcode the search into the theme...
Title: Re: Search Album Title & Description
Post by: Paver on August 14, 2006, 02:53:27 am
It looks like you have set it up correctly on your site.  I don't see the issue you mentioned right now.

I just checked the rainy_day and water_drop themes on my site with the Search_Album plugin and both work fine.  The search buttons go to the Search_Album search page, and after returning search results, everything is still fine.

I did see the issue you mentioned during one of the previous versions of this plugin, but the current version should not have this issue anymore.

Please report with your Coppermine version and a link directly to the page (or instructions on how to get to it) if you still see the problem on your site.
Title: Re: Search Album Title & Description
Post by: tgiokdi on August 14, 2006, 04:01:53 am
Paver:
I've taken off the sub_menu and am using a hardcoded search link, I think I like having that better then the sub_menu.  Now my only issue is with the link color, but that's not for this thread ;)

Again, thank you for this, it's made the entire program worth it for me!
Title: Re: Search Album Title & Description
Post by: Paver on August 14, 2006, 02:22:28 pm
You're welcome. 

I'm still not sure why using the search button on the sub_menu didn't work for you since I tried the default rainy_day and water_drop themes and it seemed to work fine.  But that's OK.  If someone else runs into it, I'm sure they'll post for assistance.  The only issue with using a hardcoded link is if you uninstall the plugin or disable plugins, then you'll have an invalid link.
Title: Re: Search Album Title & Description
Post by: loot on April 03, 2007, 12:02:20 am
great job paver
thx dude

one question.
i added a search field on my mainsite.

<!-- add search box -->
<td width ="478" align="right" valign="baseline">
   <form method="get" action="thumbnails.php" name="searchcpg">
   <input  type="hidden" name="album" value="search">
   <input  type="hidden" name="type" value="full">
   <input  type="text" style="vertical-align: bottom" style="height: 16px" style="width: 100px" name="search" maxlength="30" value="" class="textinput">
   <input  type="submit" style="height: 20px" value="Schnellsuche">
  </form>
          <!-- End search box -->



ok it works but one problem.
only if user klick first on default search, go back and than use your search, the album_title is displayed correctly.
Seems to be a flag problem.
the reason was, i want to have a full search allthoug in my album_title(Title).

maybe you got on idea

thx in advance

Title: Re: Search Album Title & Description
Post by: bolt on August 28, 2007, 12:39:00 pm
Just finally found this thread and this great plugin after searching through many other dead end topics.  Great job and thank you.
Title: Re: Search Album Title & Description
Post by: Ludo on October 09, 2007, 04:19:12 pm
I just installed this plugin and it works fine, but the standard search link in SUB_MENU was not replaced in any theme installed, I had to do it manually.

Italian translation attached.
A short mod for a complete translation:

OPEN
lang/english.php

FIND (line 1632)
Code: [Select]
$lang_adv_opts = array(
  'title' => 'Title', //cpg1.4
  'caption' => 'Caption', //cpg1.4
  'keywords' => 'Keywords', //cpg1.4
  'owner_name' => 'Owner name', //cpg1.4
  'filename' => 'Filename', //cpg1.4

AFTER, ADD
Code: [Select]
  'alb_title' => 'Album Title', //Search Album Plugin 
  'alb_desc' => 'Album Description', //Search Album Plugin


OPEN
lang/italian.php

FIND (line 1632)
Code: [Select]
$lang_adv_opts = array(
  'title' => 'Titolo', //cpg1.4
  'caption' => 'Didascalia', //cpg1.4
  'keywords' => 'Parole chiave', //cpg1.4
  'owner_name' => 'Nome proprietario', //cpg1.4
  'filename' => 'Nome File', //cpg1.4

AFTER, ADD
Code: [Select]
  'alb_title' => 'Titolo Album', //Search Album Plugin 
  'alb_desc' => 'Descrizione Album', //Search Album Plugin


OPEN
plugins/search_album/search.php

FIND (line 100)
Code: [Select]
<td><input type="checkbox" name="album_title" id="album_title" class="checkbox" checked="checked" /><label for="album_title" class="clickable_option">Album Title</label></td>
REPLACE WITH
Code: [Select]
<td><input type="checkbox" name="album_title" id="album_title" class="checkbox" checked="checked" /><label for="album_title" class="clickable_option">{$lang_adv_opts['alb_title']}</label></td>
FIND (line 104)
Code: [Select]
<td><input type="checkbox" name="album_description" id="album_description" class="checkbox" checked="checked" /><label for="album_description" class="clickable_option">Album Description</label></td>
REPLACE WITH
Code: [Select]
<td><input type="checkbox" name="album_description" id="album_description" class="checkbox" checked="checked" /><label for="album_description" class="clickable_option">{$lang_adv_opts['alb_desc']}</label></td>

OPEN
plugins/search_album/search_album.php

FIND (line 49)
Code: [Select]
<td><input type="checkbox" name="album_title" id="album_title" class="checkbox" checked="checked" /><label for="album_title" class="clickable_option">Album Title</label></td>
REPLACE WITH
Code: [Select]
<td><input type="checkbox" name="album_title" id="album_title" class="checkbox" checked="checked" /><label for="album_title" class="clickable_option">{$lang_adv_opts['alb_title']}</label></td>
FIND (line 53)
Code: [Select]
<td><input type="checkbox" name="album_description" id="album_description" class="checkbox" checked="checked" /><label for="album_description" class="clickable_option">Album Description</label></td>
REPLACE WITH
Code: [Select]
<td><input type="checkbox" name="album_description" id="album_description" class="checkbox" checked="checked" /><label for="album_description" class="clickable_option">{$lang_adv_opts['alb_desc']}</label></td>
SAVE AND CLOSE ALL FILES
Title: Re: Search Album Title & Description
Post by: Mimer on January 26, 2008, 03:07:00 pm
Hi

I've translated language file for Search Album v1.08 to danish.

Mimer  8)
Title: Re: Search Album Title & Description
Post by: nointerest on January 26, 2008, 03:18:15 pm
Hello,

I use that plug-in in two galleries and like it very much. I also use the offered little hack for full language-compability which works also very well.

I have translated the Plug-In into German (Du). I attach the file as txt.
Title: Re: Search Album Title & Description
Post by: jaguar00 on June 26, 2008, 07:32:07 pm
It works very nice.
Title: Re: Search Album Title & Description
Post by: JamesG on October 21, 2008, 06:28:44 pm
Hi, rather new to coppermine and have basic knowledge of php and need some help.
Installed latest version of coppermine and latest version of Album Search. Have got the search by album working fine and returns the results, however, I don't need the 'Files Search results' pane that appears beneath. I've read through the threads and can't see how you can stop this part of the search results from showing!

I'd be very grateful if you can help in any way,
Best regards James
Title: Re: Search Album Title & Description
Post by: tjiepie on March 06, 2009, 08:22:24 am
Hello I install these on my gallery.
And it's work fine, thanks :)

But I have one question:
I added these code in anycontent.php on line 72



Code: [Select]
<br>           
<table class="maintable" width="100%" border="0" cellspacing="" cellpadding="5">
<tr>
<td class="tableh1">                   
                      <img src="http://www.-------/themes/classic/images/glas.png" width="18" height="18" align="absmiddle" longdesc="http://www.-------/themes/classic/images/glas.png" /> Advanced Search</td>
</tr>
<tr>
  <td align="left" valign="top">
            <form method="get" action="thumbnails.php" name="searchcpg">
            <input type="hidden" name="album" value="search" />
            <input type="hidden" name="type" value="full" />
            <input type="hidden" name="plugin_search_album" value="true" />
            <input type="input" name="search" maxlength="255" value="" class="textinput" />
            <input type="submit" value="Quick Search" />
            &gt; <a href="search.php">Advanced Search</a>
          </form>
          <script language="javascript" type="text/javascript">
          <!--
          document.searchcpg.search.focus();
          -->
          </script>
          </td>
</tr>

</table>
            </div>

Now the index.php page scroll automatic down to the input box for search album (line 84)
Code: [Select]
<input type="input" name="search" maxlength="255" value="" class="textinput" />
Can I disable these?

Title: Re: Search Album Title & Description
Post by: Joachim Müller on March 28, 2009, 09:52:38 am
Also, the search page doesn't have a plugin hook. 
Why not add a hook now to search.php for cpg1.5.x?
Title: Re: Search Album Title & Description
Post by: ryanwba1 on May 23, 2009, 10:42:00 pm
What's the code to get the username to come up in the description part. Many thanks to person who helps.
Title: Re: Search Album Title & Description
Post by: vova_m on September 12, 2009, 08:27:11 pm
Nice plugin, but there is one problem for me: i'm using a cyrillic symbols in album titles and search in cyrillic does not find anything. Standard search works fine. It seems to be problems with charset (i'm using utf-8). Is there any way to make it works?

P.S. Sorry for my Engligh.
Title: Re: Search Album Title & Description
Post by: darrenkemp on October 15, 2009, 06:39:50 pm
I have been having some issues with searches returning albums that do not match the search term.
Is there a simple way to force an inline album_search to ONLY search album title and nothing else?

Here is my current inline search code:

          <form method="get" action="thumbnails.php" name="searchcpg">
            <input type="hidden" name="album" value="search" />
            <input type="hidden" name="type" value="albumonly" />
            <input type="hidden" name="plugin_search_album" value="true" />
            <input type="input" name="search" maxlength="255" value="" class="textinput" />
            <input type="submit" value="Search" />
          </form>
          <script language="javascript" type="text/javascript">
          <!--
          document.searchcpg.search.focus();
          -->
          </script>


Thanks!

Darren
Title: Re: Search Album Title & Description
Post by: JohannM on May 10, 2011, 11:31:01 pm
Pavel

I have read and follow the instructions in installing the search_album plugin

But it seems to give me problems: I get the following error : Call to undefined function: theme_no_img_to_display() in /home/ysf/public_html/include/functions.inc.php on line 1724

This is when I try to search a "keyword"

Any suggestions please ?