I needed to display comments from several documents too and I’m using Jot 1.1.3
The following changes allow &docids=`120,155,156...` or something like &docids=`[[get_all_documents_I_want]]` to work.
in Jot-snippet add:
$Jot->Set("docids", $docids);
In assets/snippets/jot/jot.class.inc.php, add
$this->config["docids"] = !is_null($this->Get("docids")) ? explode(',',$this->Get("docids")):explode(',',$this->config["docid"]);
and replace
$array_comments = $this->provider->GetComments($this->config["docid"],$this->config["tagid"],$view,$this->config["sortby"],$pageOffset,$pageLength);
with
$array_comments = $this->provider->GetComments($this->config["docids"],$this->config["tagid"],$view,$this->config["sortby"],$pageOffset,$pageLength);
and
return $this->provider->GetCommentCount($this->config["docid"],$this->config["tagid"],$view);
with
return $this->provider->GetCommentCount($this->config["docids"],$this->config["tagid"],$view);
In assets/snippets/jot/includes/jot.db.class.inc.php
In function GetCommentCount, change
$sql = 'SELECT count(id) FROM '.$this->tbl["content"].' WHERE uparent = '.$docid.' AND tagid = "' . $tagid .'"'.$where;
with
$where.=' and (false';
foreach ($docid as $did){
$where.= ' or uparent = '.$did;
}
$where.=')';
$sql = 'SELECT count(id) FROM '.$this->tbl["content"].' WHERE tagid = "' . $tagid .'"'.$where;
and in function GetComments, change
$sql = "select a.* from " . $tbl . " as a " . $tblcustom . " where uparent = '" . $docid . "' and tagid = '" . $tagid ."' and mode = '0' " . $where . $orderby . $limit;
with
$where.=' and ( false';
foreach ($docid as $did){
$where.= ' or uparent = '.$did;
}
$where.=')';
$sql = "select a.* from " . $tbl . " as a " . $tblcustom . " where tagid = '" . $tagid ."' and mode = '0' " . $where . $orderby . $limit;