Support » Plugins » [Plugin: NextGEN Gallery] wp_ngg_tags and wp_ngg_pic2tags missing/moved after upgrade

  • Hi all,

    Hope someone can point me in the right direction here searching hasn’t located anything and bare with me as I’m not a db guru by any means

    Just upgraded NextGen to 1.02. Installed files Ok and was able to run the db upgrade successfully (based on wp-admin saying so).

    I had a search feature which looked at the wp_ngg_pic2tags and wp_nggtags tables (as well as the other tables) but both tables are missing following upgrade.

    I assume they have been integrated somewhere else as the tags are showing with I look at the pics in “Manage Gallery” and they also show under the tags link.

    I have a backup if I need to reload the tables.

    Can anyone advise?

    Cheers,

    Aengus

    P.S. this was my query (allow for slight change caused by posting)

    $nngquery = “
    SELECT pid,description,alttext
    FROM wp_ngg_pictures
    WHERE MATCH (description, filename, alttext) AGAINST (‘*$keywords*’ IN BOOLEAN MODE)
    AND exclude = ‘0’
    UNION
    SELECT pid,description,alttext
    FROM wp_ngg_pictures, wp_ngg_tags, wp_ngg_pic2tags
    WHERE pid = picid and tagid = id and
    MATCH (name) AGAINST (‘*$keywords*’ IN BOOLEAN MODE)
    AND exclude = ‘0’

Viewing 10 replies - 16 through 25 (of 25 total)
  • Hello all,
    I love your web site AengusM and I would like to incorporate your search function in my web site. Just last week I ported over my site from S9Y (Serendipity) and I’m really loving WordPress. I’m still trying to wrap my brain around the structure of WordPress and need some help with “what code to put where”, etc.

    Could you describe where each code snippet goes? I use the Amazing-Grace theme and it doesn’t have a search.php or searchform.php. I can see where I would insert your ngg_get_search_pictures function in my functions.php, but what code is in searchform.php and what code goes on the actual Page. Is the exec-php plugin required to insert code on a Page?

    You can see my web site at http://wt4y.com/. I have about 900 images and would like to give my visitors the ability to search.

    Thanks for sharing.

    Gary

    OK I figured it out. From http://lorelle.wordpress.com/2006/02/11/understanding-and-fixing-wordpress-search/ I learned a bit about how the WordPress search works. By adding my own search.php to my theme (which did not have one in the first place), WordPress automatically used it instead of its built-in search function. Also, since I use a different prefix to my database tables, I had to change the calls to the database in the ngg_get_search_pictures function. I’m almost there now.

    Cheers!

    Thread Starter aengusm

    (@aengusm)

    Glad you got sorted Gary and thanks for that great link.

    Aengus

    Hi Aengus & Tom:

    Thank you so much for posting all of this information. I am not a PHP programmer, but I’ve been able to take the code you’ve posted, and by trial and error have gotten an image search function to work on my site, for the most part. However I’m getting some odd results that have me stumped. I’m hoping you (or someone else) might be able to provide some insight:

    I have MANY pictures of elk on my site. The term elk is used in the image titles, descriptions and tags. Yet if I do a search on elk, I get no hits. If I search on bull (I use bull as a tag, as in “bull elk”, I get hits. Same thing with sheep, goat, whale – I get hits on all of those. Yet not on elk – a keyword used more than any other keyword in my photos. Any ideas?

    My web site is http://www.sherwoodimagery.com. The search function does both a search on images, then a search on posts, and displays results from both. So if you do a search on elk you will get a hit from one of my posts – but not the picture search.

    Thanks again for sharing all this information, and thanks in advance for any insight you might be able to provide on my search problem.

    Regards,

    Ron

    Hi rdsherwood,

    Nice site 🙂 erm what you describe is a problem I have with my own site and have not found the answer yet. The problem seems to be when you use the search for posts as well as images. Aengus’s search is just for images and works as intended. It is mentioned in this thread that future updates to next-gen might hopefully intergrate next-gen tags with wordpress tags, and this would solve the problem. For now though I’m sorry I cant help other than to have one searchform for posts and another for images on a dedicated image search page. Which I seem to remember being a little tricky getting a searchform to use a different search.php template. If I find any other solutions, I’ll let you know.

    Best wishes,

    tom

    Hi Tom:

    Thanks for the quick reply. Actually, I tried the search.php that Aengus posted above that only searches on images and not posts. It gave me the same results – it just wouldn’t find some keywords, in my case “Elk”. So I’m not sure this problem is identical to yours. Of course it could be that I made some other error in its implementation, as I said, I’m hacking my way through this. When I have some time, I’ll go back and experiment with it again.

    It sounds like the Nextgen update to use WordPress tags would be the ultimate solution. Hopefully that will happen soon. In the meantime, if you come up with any revelations, I’ll be much appreciative if you share them here. Of course I will do the same.

    Regards,

    Ron

    Thread Starter aengusm

    (@aengusm)

    Hi Ron,
    just searched on your site for Elk and got a couple of dozen shots back…is your issue fixed?
    Glad above was of some help at least!
    Cheers,
    Aengus

    Hi Aengus:

    When I do the search, I’m getting a return on posts that contain the word Elk, but nothing back from the Nextgen gallery search. Are you seeing gallery images when you search, or just the posts?

    Regards,

    Ron

    Thread Starter aengusm

    (@aengusm)

    Ah I see, I’m getting a post back with pics not just pics.
    What I’ve done is just to return pics, I’ve removed the post component from search.php (see above and compare with yours).
    Not sure what you need to do but suspect answer is the search.php syntax.

    I did my original adjustments based on Psykotik’s post;
    http://www.ikiru.ch/blog/2008/how-to-add-a-search-function-for-nextgen-gallery-wordpress-plugin.

    A quick interim fix for you is maybe to setup a “Search Pics” “Search blog” using a second search.php?

    Aengus

    I have posted my search code for NextGen Gallery 1.3.5 in a more recent thread, along with an explanation of why the search for “Elk” has problems. I could not have found the correct code without this thread and the links it contains, the older thread http://wordpress.org:80/support/topic/206946, and Psykotik’s post.

Viewing 10 replies - 16 through 25 (of 25 total)
  • The topic ‘[Plugin: NextGEN Gallery] wp_ngg_tags and wp_ngg_pic2tags missing/moved after upgrade’ is closed to new replies.