Login or create new account.

By registering on joomprod.com, you will have immediate access to all our free products and to the public side of our support forum.

Enjoy our subscriptions.

Each of our subscriptions allow you to enjoy the private side of the support forum and all the update of our products for a period ranging from 3 months to 1 year.

Payment And immediate download.

After subscribing to one of our subscription, the products are immediately downloadable.

Login

Or Register
Accueil / forum / Public Forum / Main Forum / Presales / [RESOLVED] Search only work on certain fields

Support Availability Because we must sleep sometimes

Working days: Monday to Friday.
Reply time: Depending on the complexity of your support issue it's usually between a few hours to 48 hours.

Support is only guaranteed to paid subscribers

AdsManager - End of life

It is with great regrets that we have chosen to end the developpement of Adsmanager and its other associated components.

AdsManager is born 10 years ago and, as of today, the number of new subscriptions and downloads have fallen and we cannot maintain the component anymore.

All active subscribers will be able to continue enjoying support until the end of their subscription.

The components will be free and no support will be provided anymore for the other users.

×

Notice

The forum is in read only mode.

[RESOLVED] Search only work on certain fields

More
11 years 8 months ago - 11 years 8 months ago #575 by Ads4ever
Replied by Ads4ever on topic Search only work on certain fields
you can put the values of drop down single select as strings, if not you should use convert interger value to string value using database query, I will update this message with the name of the function when I will have time ...

Founder of ITechnoDev
Last edit: 11 years 8 months ago by Ads4ever.
More
11 years 8 months ago #587 by Ads4ever
Replied by Ads4ever on topic Search only work on certain fields
Hello,

First solution :

Change the value of your drop down single select to be strings instead of integer, so then you don't need to convert them

Second solution :

Convert the integer values to their strings equivalent using database query :


case 'search':
 
 
	    				if (intval($filter) != 0) {
	    					$filter = JString::strtolower($filter);
	    					$id = intval($filter);
                            if (version_compare(JVERSION,'1.7.0','<')) {
                                $search .= $temp."(a.id = $id OR LOWER(a.ad_headline) LIKE '%".$this->_db->getEscaped($filter,true)."%' OR LOWER(a.ad_text) LIKE '%".$this->_db->getEscaped($filter,true)."%' OR ( SELECT LOWER(fieldtitle) FROM `#__adsmanager_field_values` WHERE fieldid=12 AND fieldvalue=a.ad_sectiona) LIKE '%".$this->_db->getEscaped($filter,true)."%')";
                            }else{
                                $search .= $temp."(a.id = $id OR LOWER(a.ad_headline) LIKE '%".$this->_db->escape($filter,true)."%' OR LOWER(a.ad_text) LIKE '%".$this->_db->escape($filter,true)."%' OR (SELECT LOWER(fieldtitle) FROM `#__adsmanager_field_values` WHERE fieldid=12 AND fieldvalue=a.ad_sectiona) LIKE '%".$this->_db->escape($filter,true)."%')";
                            }
	    				} else {
	    					$filter = JString::strtolower($filter);
                            if (version_compare(JVERSION,'1.7.0','<')) {
                                $search .= $temp."(LOWER(a.ad_headline) LIKE '%".$this->_db->getEscaped($filter,true)."%' OR LOWER(a.ad_text) LIKE '%".$this->_db->getEscaped($filter,true)."%' OR (SELECT LOWER(fieldtitle) FROM `#__adsmanager_field_values` WHERE fieldid=12 AND fieldvalue=a.ad_sectiona) LIKE '%".$this->_db->getEscaped($filter,true)."%')";
                            }else{
                                $search .= $temp."(LOWER(a.ad_headline) LIKE '%".$this->_db->escape($filter,true)."%' OR LOWER(a.ad_text) LIKE '%".$this->_db->escape($filter,true)."%' OR (SELECT LOWER(fieldtitle) FROM `#__adsmanager_field_values` WHERE fieldid=12 AND fieldvalue=a.ad_sectiona) LIKE '%".$this->_db->escape($filter,true)."%')";
                            }
	    				}
	    				break;



change ad_sectiona to the name of your field and the fieldid=12 to the fieldid of your field, I tested the code and it works fine

Founder of ITechnoDev
More
11 years 8 months ago - 11 years 7 months ago #605 by santiago34
Replied by santiago34 on topic Search only work on certain fields
Thanks! You're awesome!

Finally, I did the first solution.

The dropdown list is too extensive, so I've made a sql query like this:

UPDATE `blablabla_adsmanager_field_values` SET `fieldvalue` = `fieldtitle` WHERE 'fieldid' > '9';


Maybe this help someone else, but is nothing compared to what you've shared.

Note: "fieldid > 9" is because the dropdown that I wanted to modify has fieldid 10, 11 and 12, and I didn't wanted to modify nothing else.
Last edit: 11 years 7 months ago by santiago34.
Time to create page: 0.252 seconds
Powered by Kunena Forum