| @@ 1432-1442 (lines=11) @@ | ||
| 1429 | echo " $name: " . $_lang['installed'] . PHP_EOL; |
|
| 1430 | } |
|
| 1431 | // add system events |
|
| 1432 | if (count($events) > 0) { |
|
| 1433 | $ds = mysqli_query($sqlParser->conn, |
|
| 1434 | "SELECT id FROM $dbase.`" . $table_prefix . "site_plugins` WHERE name='$name' AND description='$desc';"); |
|
| 1435 | if ($ds) { |
|
| 1436 | $row = mysqli_fetch_assoc($ds); |
|
| 1437 | $id = $row["id"]; |
|
| 1438 | // remove existing events |
|
| 1439 | mysqli_query($sqlParser->conn, |
|
| 1440 | 'DELETE FROM ' . $dbase . '.`' . $table_prefix . 'site_plugin_events` WHERE pluginid = \'' . $id . '\''); |
|
| 1441 | // add new events |
|
| 1442 | mysqli_query($sqlParser->conn, |
|
| 1443 | "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("','", |
|
| 1444 | $events) . "')"); |
|
| 1445 | } |
|
| @@ 589-599 (lines=11) @@ | ||
| 586 | echo "<p> $name: <span class=\"ok\">" . $_lang['installed'] . "</span></p>"; |
|
| 587 | } |
|
| 588 | // add system events |
|
| 589 | if (count($events) > 0) { |
|
| 590 | $ds=mysqli_query($sqlParser->conn, "SELECT id FROM $dbase.`".$table_prefix."site_plugins` WHERE name='$name' AND description='$desc';"); |
|
| 591 | if ($ds) { |
|
| 592 | $row = mysqli_fetch_assoc($ds); |
|
| 593 | $id = $row["id"]; |
|
| 594 | // remove existing events |
|
| 595 | mysqli_query($sqlParser->conn, 'DELETE FROM ' . $dbase . '.`' . $table_prefix . 'site_plugin_events` WHERE pluginid = \'' . $id . '\''); |
|
| 596 | // add new events |
|
| 597 | 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) . "')"); |
|
| 598 | } |
|
| 599 | } |
|
| 600 | } |
|
| 601 | } |
|
| 602 | } |
|