Adult Script Pro Community Forums

The forum is here for legacy reasons. No new posts will be created. User registration is disabled! If you have any questions, please email us or check https://www.adultscriptpro.com for more details!

You are not logged in.

#1 2012-12-06 13:15:38

grantw
Member
Registered: 2012-12-03
Posts: 12

[NOT A BUG] Mass csv import, Autodetect categories

Hi all, I'm new to this script and just about getting my head around it! I've been scratching my head trying to work out why my CSV imports are not being categorised and instead all are put into the last category available.

As far as I can tell, looking at the function in csv.php there appears to be code missing that handles the categories if autodetect is selected and the auto-term for the category is empty. I'm not sure if this is intentional but I don't really want to rely on the auto-term settings all the time.

The code here just checks the title/tags for a match with the auto-term values and there doesn't appear to be anything to check the tags against the main categories:

.....edited - forget that.

Cheers, Grant

Last edited by grantw (2012-12-06 13:45:59)

Offline

#2 2012-12-06 13:44:48

grantw
Member
Registered: 2012-12-03
Posts: 12

Re: [NOT A BUG] Mass csv import, Autodetect categories

Actually, scratch that. I notice it's the same for all the importers/grabbers so I guess it's easier just to copy the category title into the auto-term box for each category smile

Grant

Offline

#3 2012-12-06 18:37:22

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: [NOT A BUG] Mass csv import, Autodetect categories

You need to have the auto-term entered. You can enter more than one auto term (eg: amateur, homemade, home made...) (eg: blowjob, sucking....)


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#4 2012-12-06 18:45:05

grantw
Member
Registered: 2012-12-03
Posts: 12

Re: [NOT A BUG] Mass csv import, Autodetect categories

Yep, got it now thanks, I initially thought it would match up with the main categories if there was no auto-term entered then went off looking at the code rather than thinking about things!

Cheers.

Offline

#5 2012-12-06 19:29:46

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: [NOT A BUG] Mass csv import, Autodetect categories

You mean the category name? Its a good idea, if no auto term is added, match the category name.


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

#6 2012-12-06 19:42:38

grantw
Member
Registered: 2012-12-03
Posts: 12

Re: [NOT A BUG] Mass csv import, Autodetect categories

symtab wrote:

You mean the category name? Its a good idea, if no auto term is added, match the category name.

Yep, I don't know why but I thought that was how it worked for some reason.

I added this bit of code into csv.php to make it match the category name as well as the auto-term so would just need something similar with a check to see if the auto-term is empty. Would be a nice feature as it's not obvious that the auto-term is a required field.

        $cats = array();
        foreach ($categories as $category) {
            $cat_id = (int) $category['cat_id'];
            $terms    = explode(',', $category['auto_term']);

            foreach ($terms as $term) {
                $term = trim($term);

                if (stripos($title, $term) !== FALSE) {
                    if (!in_array($cat_id, $cats)) {
                        $cats[] = $cat_id;
                    }
                }

                if (!empty($tags)) {
                    if (stripos($tags, $term) !== FALSE) {
                        if (!in_array($cat_id, $cats)) {
                            $cats[] = $cat_id;
                        }
                    }
                }
            }

            $cat = $category['name'];
            if (!empty($tags)) {
                if (stripos($tags, $cat) !== FALSE) {
                    if (!in_array($cat_id, $cats)) {
                        $cats[] = $cat_id;
                    }
                }
            }


        }

Cheers, Grant

Offline

#7 2012-12-06 20:12:20

symtab
Administrator
Registered: 2010-08-23
Posts: 7,501
Website

Re: [NOT A BUG] Mass csv import, Autodetect categories

Thank you! will add this in the next version.


Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds

Offline

Board footer

Powered by FluxBB