Search Feature

Hello I have been trying to find a search widget that will work with rtMedia to no avail. I have set up InspireBook and wondered if that would help but it is just the regular wordpress search, which doesn’t bring up anything for the buddypress site. So I set up the attribute function for rtMedia for my pictures and videos, but it is still not working. Is there a search function that will work for this in the new update, or can I request one?

Hi @adriandufour,

Sorry to say but no there isn’t any search function available. It might be available in future but i am not sure about when it will be developed. There is not any ETA.

@adriandufour and @pranalipatel

While rtMedia should get their own search feature written, in the meantime, once again, Media Library Assistant does offer a search feature.

1.) Install Media Library Assistant from the add new plugin (It’s free). https://wordpress.org/plugins/media-library-assistant/

2.) Once installed, go to the plugin directory of MLA and copy the ./examples/buddypress-hooks-example.php.txt into /wp-content/plugins/buddypress-hooks-example/buddypress-hooks-example.php

3.) Activate the buddypress hooks example plugin and the media library assistant plugin. MLA doesnt work out of the box with rtmedia, this is what the buddypress hooks example plugin does, is modify your queries to give the right links to rtmedia images/videos.

4.) Create a page called “Media Search” or whatever you want to call it. You can only search pictures OR videos, so you might want a page called Pictures Search and a page called Videos Search or something.

On that page, add this:

<form id="video-search-form" action="/search-videos/" method="post">
<input size=50 id="mla-search-box" name="search-string" type="text" value="" placeholder="Enter your search words     here...." autofocus/><input id="submit" name="submit" type="submit" value="Search" />
</form>

<hr>

[mla_gallery post_mime_type=video post_parent=all posts_per_page=100 s="{+template:({+request:search-string+}|a-bad-term)+}" orderby=date order=DESC buddypress_urls='cover' mla_nolink_text="Enter search terms above and hit Search!" mla_caption="{+author+} - <strong>{+title+}</strong>" mla_output="paginate_links,prev_next" mla_link_href="{+page_url+}?search-string={+request:search-string+}"]
[mla_gallery post_mime_type=video post_parent=all posts_per_page=100 s="{+template:({+request:search-string+}|a-bad-term)+}" orderby=date order=DESC buddypress_urls='cover' mla_nolink_text="Enter search terms above and hit Search!" mla_caption="{+author+} - <strong>{+title+}</strong>"]
[mla_gallery post_mime_type=video post_parent=all posts_per_page=100 s="{+template:({+request:search-string+}|a-bad-term)+}" orderby=date order=DESC buddypress_urls='cover' mla_nolink_text="Enter search terms above and hit Search!" mla_caption="{+author+} - <strong>{+title+}</strong>" mla_output="paginate_links,prev_next" mla_link_href="{+page_url+}?search-string={+request:search-string+}"]

On the top, the action="/search-videos/" that would be the permalink to the media search/video search/picture search page you just made. The example above is for VIDEOS. If you wanted to change it to PICTURES, change the buddypress_urls=‘cover’ to buddypress_urls=‘link’ – change the post_mime_type=video to post_mime_type=photo and then that will search pictures instead.

The other parameters should be somewhat obvious, such as “posts_per_page=100” being 100 thumbnails per page.

MLA is the most powerful media library plugin known to man. It is a fantastic compliment to rtMedia.

Additionally, if you wanted to make a “Text Widget” on your site, just add the 3 lines of code at the top from <form to and that will allow people to seach on your site and show the results on the media search page.

Have fun.

@illusionsglass thanks for your help in community forum.

@illusionsglass this is just what I am looking for! However I am struggling at one of the first steps… How do I activate the buddypress hooks as a plugin?

I have copied the files and created a folder called buddypress-hooks-example in my plugins directory. The txt file is placed in there.

/public_html/wp-content/plugins/buddypress-hooks-example/buddypress-hooks-example.php.txt

Not too sure if I have gone through the right steps? I cannot see the it in the front end wordpress plugin section.

Any help would be greatly appreciated!

You’re close! Rename the file to buddypress-hooks-example.php. :slight_smile: It ships as a txt file, which isnt PHP, so the server cant execute it. With the .php extension instead of .txt, the WordPress will notice it and you can activate as a plugin. Have fun.

Thank you! WIll try this out

Hello ! thanks for the tip: slight_smile:

On the page create “Media Search” all the code is present :frowning: and the search gives me a “page not found” … The addon is well create and activate, I do not find the problem … here is the code edit for photos:

 <form id="pictures-search-form" action="/search-videos/" method="post">
<input size=50 id="mla-search-box" name="search-string" type="text" value="" placeholder="Enter your search words     here...." autofocus/><input id="submit" name="submit" type="submit" value="Search" />
</form>

<hr>

    [mla_gallery post_mime_type = photo post_parent = all posts_per_page = 100 s = "{+ template: ({+ request: search-string +} | a-bad-term) +}" orderby = date order = DESC buddypress_urls = 'link' mla_nolink_text = "Search search and search!" mla_caption = "{+ author +} - <strong> {+ title +} </ strong>" mla_output = "paginate_links, prev_next" mla_link_href = "{+ page_url +}? search-string = {+ request: search-string +}"]
    [mla_gallery post_mime_type = photo post_parent = all posts_per_page = 100 s = "{+ template: ({+ request: search-string +} | a-bad-term) +}" orderby = date order = DESC buddypress_urls = 'link' mla_nolink_text = "Search search and search!" mla_caption = "{+ author +} - <strong> {+ title +} </ strong>"]
    [mla_gallery post_mime_type = photo post_parent = all posts_per_page = 100 s = "{+ template: ({+ request: search-string +} | a-bad-term) +}" orderby = date order = DESC buddypress_urls = 'link' mla_nolink_text = "Search search and search!" mla_caption = "{+ author +} - <strong> {+ title +} </ strong>" mla_output = "paginate_links, prev_next" mla_link_href = "{+ page_url +}? search-string = {+ request: search-string +}"]

Or can be my mistake? friendly ben

Hi,

If you’re searching for images this is the code I’m using. You will however need to change the action="/discover/" to the the permalink of the page you’d like to the search results to appear on, for example if your search page is on example.com/search-page use action="/search-page/" Hope this helps!


[mla_gallery post_mime_type=image post_parent=all posts_per_page=100 s="{+template:({+request:search-string+}|a-bad-term)+}" orderby=date order=DESC buddypress_urls='link' mla_nolink_text="" mla_caption="{+author+} - {+title+}" mla_output="paginate_links,prev_next" mla_link_href="{+page_url+}?search-string={+request:search-string+}"] [mla_gallery post_mime_type=image post_parent=all posts_per_page=10 s="{+template:({+request:search-string+}|a-bad-term)+}" orderby=date order=DESC buddypress_urls='link' mla_nolink_text="" mla_caption="{+author+} - {+title+}"] [mla_gallery post_mime_type=image post_parent=all posts_per_page=10 s="{+template:({+request:search-string+}|a-bad-term)+}" orderby=date order=DESC buddypress_urls='link' mla_nolink_text="" mla_caption="{+author+} - {+title+}" mla_output="paginate_links,prev_next" mla_link_href="{+page_url+}?search-string={+request:search-string+}"] [rtmedia_gallery global="true”]