Search

I've got a datasource that is listing categories with associated counts. I'd like to restrict those counts to only include posts in the current language.

I am using a selectbox_link field and have got it working if I update the fetchAssociatedEntryCount function as follows:

public function fetchAssociatedEntryCount($value){
$lc = FLang::getLangCode();
return Symphony::Database()->fetchVar('count', 0, sprintf("
SELECT COUNT(*) as `count`
FROM `sym_entries_data_%d`
LEFT JOIN `sym_entries_data_84` 
ON `sym_entries_data_86`.`entry_id` = `sym_entries_data_84`.`entry_id`
WHERE `relation_id` = %d
AND `value` = '%s'",
$this->get('id'), $value, $lc
));
}

But I'd like to put this into the data-source function instead. Thank you for your help. Josh

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details