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.
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
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
Grant
Offline
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
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
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
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
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