| @@ 606-616 (lines=11) @@ | ||
| 603 | echo "<p> $name: <span class=\"ok\">" . $_lang['installed'] . "</span></p>"; |
|
| 604 | } |
|
| 605 | // add system events |
|
| 606 | if (count($events) > 0) { |
|
| 607 | $ds=mysqli_query($sqlParser->conn, "SELECT id FROM $dbase.`".$table_prefix."site_plugins` WHERE name='$name' AND description='$desc';"); |
|
| 608 | if ($ds) { |
|
| 609 | $row = mysqli_fetch_assoc($ds); |
|
| 610 | $id = $row["id"]; |
|
| 611 | // remove existing events |
|
| 612 | mysqli_query($sqlParser->conn, 'DELETE FROM ' . $dbase . '.`' . $table_prefix . 'site_plugin_events` WHERE pluginid = \'' . $id . '\''); |
|
| 613 | // add new events |
|
| 614 | mysqli_query($sqlParser->conn, "INSERT INTO $dbase.`" . $table_prefix . "site_plugin_events` (pluginid, evtid) SELECT '$id' as 'pluginid',se.id as 'evtid' FROM $dbase.`" . $table_prefix . "system_eventnames` se WHERE name IN ('" . implode("','", $events) . "')"); |
|
| 615 | } |
|
| 616 | } |
|
| 617 | } |
|
| 618 | } |
|
| 619 | } |
|
| @@ 1338-1348 (lines=11) @@ | ||
| 1335 | echo " $name: " . $_lang['installed'] . PHP_EOL; |
|
| 1336 | } |
|
| 1337 | // add system events |
|
| 1338 | if (count($events) > 0) { |
|
| 1339 | $ds=mysqli_query($sqlParser->conn, "SELECT id FROM $dbase.`".$table_prefix."site_plugins` WHERE name='$name' AND description='$desc';"); |
|
| 1340 | if ($ds) { |
|
| 1341 | $row = mysqli_fetch_assoc($ds); |
|
| 1342 | $id = $row["id"]; |
|
| 1343 | // remove existing events |
|
| 1344 | mysqli_query($sqlParser->conn, 'DELETE FROM ' . $dbase . '.`' . $table_prefix . 'site_plugin_events` WHERE pluginid = \'' . $id . '\''); |
|
| 1345 | // add new events |
|
| 1346 | mysqli_query($sqlParser->conn, "INSERT INTO $dbase.`" . $table_prefix . "site_plugin_events` (pluginid, evtid) SELECT '$id' as 'pluginid',se.id as 'evtid' FROM $dbase.`" . $table_prefix . "system_eventnames` se WHERE name IN ('" . implode("','", $events) . "')"); |
|
| 1347 | } |
|
| 1348 | } |
|
| 1349 | } |
|
| 1350 | } |
|
| 1351 | } |
|