Check if Block is in use.
Permalink
How can i find out if an block still is in use and has not been deleted?
I have its ID.
Thx
I have its ID.
Thx
Thx but what you have already written I need a PHP code directly.
Do you have an idea?
Do you have an idea?
Here my solution:
// Data you have to know from the Block: // bID : BlockID (here: $row['bID']) // cID : PageID from Block (here: $row['cID']) $b = $db->query('SELECT Max(cvID) As cvID FROM `CollectionVersionBlocks` WHERE bID = '.$row['bID']); while ($blockRow = $b->fetchRow()) { $cvIDBlock = $blockRow['cvID']; } $p = $db->query('SELECT cvID FROM `CollectionVersions` WHERE cID = '.$row['cID'].' AND cvIsApproved = 1'); while ($pageRow = $p->fetchRow()) { $cvIDPage = $pageRow['cvID']; } if ($cvIDBlock==$cvIDPage) { //BLOCK IS IN USE }
(or do you want to do this from php code?)