2
Hi
you can create a custom block, content type "PHP Script"
then add the code for getting data
Quote:
$myts = \MyTextSanitizer::getInstance();
$itemsAll = $newItems = [];
$sort ='datesub';
$order = 'DESC';
$limit = 5;
$start = 0;
/*my first publisher clone*/
$helper = \XoopsModules\Publisher1\Helper::getInstance();
$itemHandler = $helper->getHandler('Item');
$itemsObj = $itemHandler->getItems($limit, $start, [\XoopsModules\Publisher1\Constants::PUBLISHER1_STATUS_PUBLISHED], -1, $sort, $order, '', true);
$totalItems = count($itemsObj);
if ($itemsObj && $totalItems > 0) {
foreach ($itemsObj as $iValue) {
$newItems['source'] ='Publisher1: ';
$newItems['itemid'] = $iValue->itemid();
$newItems['itemlink'] = $iValue->getItemLink(false, $options[3] ?? 65);
$itemsAll[] = $newItems;
}
}
unset($itemsObj, $itemHandler);
/*my second publisher clone*/
$helper = \XoopsModules\Publisher2\Helper::getInstance();
$itemHandler = $helper->getHandler('Item');
$itemsObj = $itemHandler->getItems($limit, $start, [\XoopsModules\Publisher2\Constants::PUBLISHER2_STATUS_PUBLISHED], -1, $sort, $order, '', true);
$totalItems = count($itemsObj);
if ($itemsObj && $totalItems > 0) {
foreach ($itemsObj as $iValue) {
$newItems['source'] ='Publisher2: ';
$newItems['itemid'] = $iValue->itemid();
$newItems['itemlink'] = $iValue->getItemLink(false, $options[3] ?? 65);
$itemsAll[] = $newItems;
}
}
unset($itemsObj, $itemHandler);
/*output of result*/
foreach($itemsAll as $item) {
echo '' . $item['source'] . $item['itemlink'] . '
';
}
in this example the name of the clones are 'Publisher1' and 'Publisher2'
replace the names by your names of the clones and/or add for each additional publisher clone the adapted code
let me know if it works :)