language/de.xml 0100644 0000000 0000000 00000132662 14071047562 012522 0 ustar 00 0000000 0000000
- Dieser Bot überwacht die Änderung oder das Löschen von Beiträgen durch den Verfasser und erstellt eine Benachrichtigung, wenn ein Benutzer seinen Beitrag ändert oder löscht. Die Moderation von Beiträgen wird durch diesen Bot nicht erfasst.
Der Verfasser des Beitrags ist der betroffene Benutzer und kann direkt adressiert werden. Bei Bedarf kann auch ein Beitrag direkt im Thema mit dem erkannten Beitrag erstellt werden. Dazu muss unter Benachrichtigung 0 als Thema-ID bei „Thema“ eingegeben werden.
Durch Konfiguration von Foren und der Allgemeinen Benutzer-Bedingungen kann die Überwachung auf bestimmte Foren bzw. Benutzer begrenzt werden.
Die folgenden Bot-spezifischen Platzhalter stehen zur Verfügung:
[action] Ausgeführte Aktion: „geändert“ oder „gelöscht“
[count] Anzahl der geänderten / gelöschten Beiträge (immer 1)
[count-user] Anzahl der geänderten / gelöschten Beiträge des betroffenen Benutzers (immer 1)
[board-id] ID des Forums, in dem der Beitrag bearbeitet wurde
[board-name] Name des Forums
[post-id] ID des bearbeiteten Beitrags
[post-link] Link zum Beitrag
[post-subject] Titel des Beitrags
[post-text] Text des Beitrags
[quote] Text des Beitrags als Zitat
[reason] Vom Benutzer angegebener Grund für das Bearbeiten bzw. Löschen
[thread-link] Link zum Thema des Beitrags
[thread-subject] Titel des Themas
Die folgenden allgemeinen Platzhalter stehen zur Verfügung:
[date] Datum der Bot-Ausführung
[time] Uhrzeit der Bot-Ausführung
[page] Name dieser Webseite, wie im ACP angegeben
[receiver] Benutzername des Empfängers einer Benachrichtigung
Die folgenden Benutzer-bezogenen Platzhalter (betroffene Benutzer) stehen zur Verfügung:
[user-age] Alter des Benutzers
[user-email] E-Mail-Adresse des Benutzers
[user-groups] Namen der Benutzergruppen, denen der Benutzer angehört
[user-id] ID des Benutzers
[user-name] Name des Benutzers
[user-profile] Link zum Profil des Benutzers
[@user-profile] Link zum Profil des Benutzers mit Benachrichtungsfunktion (nur Beiträge)
]]>
- Dieser Bot überwacht die Veröffentlichung von Beiträgen und erstellt Benachrichtigungen, wenn ein Benutzer oder Gast einen neuen Beitrag verfasst hat und dieser veröffentlicht/freigeschaltet wird.
Der Verfasser des Beitrags ist der betroffene Benutzer und kann direkt adressiert werden. Bei Bedarf kann auch ein Beitrag direkt im Thema mit dem erkannten Beitrag erstellt werden. Dazu muss unter Benachrichtigung 0 als Thema-ID bei „Thema“ eingegeben werden.
Bei „Gesamtzahl der Beiträge“ erfolgt die Benachrichtigung, wenn die Gesamtzahl einen der unter „Auslösewerte“ eingegebenen Wert erreicht hat.
Bei „x. Beitrag eines Benutzer“ erfolgt die Benachrichtigung, wenn der betroffenen Benutzer eine der unter „Auslösewerte“ eingegebene Anzahl an Beiträgen erreicht hat.
Bei „Benutzer mit den meisten Beiträgen“ wird benachrichtigt, wenn sich der Benutzer mit den meisten Beiträgen ändert. Auslösewerte müssen hierfür nicht konfiguriert werden.
Durch Konfiguration der Allgemeinen Benutzer-Bedingungen kann die Benachrichtigung bei „x. Beitrag eines Benutzer“ auf bestimmte Benutzer begrenzt werden.
Die folgenden Bot-spezifischen Platzhalter stehen zur Verfügung:
[count] Gesamtzahl der Beiträge (ohne Beiträge im Papierkorb)
[count-user] Anzahl der Beiträge des betroffenen Benutzers (0 bei Gästen)
[board-id] ID des Forums, in dem der Beitrag veröffentlicht wurde
[board-name] Name des Forums
[post-id] ID des erstellten Beitrags
[post-link] Link zum Beitrag
[post-subject] Titel des Beitrags
[post-text] Text des Beitrags
[quote] Text des Beitrags als Zitat
[thread-link] Link zum erstellten Thema
[thread-subject] Titel des Themas
Die folgenden allgemeinen Platzhalter stehen zur Verfügung:
[date] Datum der Bot-Ausführung
[time] Uhrzeit der Bot-Ausführung
[page] Name dieser Webseite, wie im ACP angegeben
[receiver] Benutzername des Empfängers einer Benachrichtigung
Die folgenden Benutzer-bezogenen Platzhalter (betroffene Benutzer) stehen zur Verfügung:
[user-age] Alter des Benutzers
[user-email] E-Mail-Adresse des Benutzers
[user-groups] Namen der Benutzergruppen, denen der Benutzer angehört
[user-id] ID des Benutzers
[user-name] Name des Benutzers
[user-profile] Link zum Profil des Benutzers
[@user-profile] Link zum Profil des Benutzers mit Benachrichtungsfunktion (nur Beiträge)
]]>
- Dieser Bot überwacht die Moderation von Beiträgen und erstellt Benachrichtigungen, wenn ein Beitrag entsprechend der ausgewählten Aktion(en) geändert wurde.
Der Verfasser des Beitrags ist der betroffene Benutzer und kann direkt adressiert werden. Bei Bedarf kann auch ein Beitrag direkt im Thema mit dem moderierten Beitrag erstellt werden. Dazu muss unter Benachrichtigung 0 als Thema-ID bei „Thema“ eingegeben werden.
Durch Konfiguration von Foren und der Allgemeinen Benutzer-Bedingungen kann die Überwachung auf bestimmte Foren bzw. Benutzer begrenzt werden. Durch Wahl des Betroffenen Benutzers kann die Benachrichtigung entweder an den Moderator oder den Ersteller des Beitrags versendet werden.
Die folgenden Bot-spezifischen Platzhalter stehen zur Verfügung:
[count] Anzahl der von der Moderation betroffenen Benutzer (immer 1)
[board-id] ID des Forums, in dem der moderierte Beitrag erstellt wurde
[board-name] Name des Forums
[moderation-action] Aktion (z.B. „gelöscht“, „aktiviert“, „verschoben“
[moderation-reason] Grund für die Moderation (nicht bei allen Aktionen)
[moderator-id] ID des Benutzers, der das Thema moderiert hat
[moderator-link] Link zum Profil des Benutzers
[moderator-link2] Maskierter Link zum Profil des Benutzers
[moderator-name] Name des Benutzers
[post-link] Link zum moderierten Beitrag (nicht durch alle Benutzer aufrufbar)
[post-subject] Titel des Beitrags
[post-text] Text des Beitrags
[thread-link] Link zum Thema mit dem moderierten Beitrag (nicht durch alle Benutzer aufrufbar)
[thread-subject] Titel des Themas
[thread-text] Text des Themas
Die folgenden allgemeinen Platzhalter stehen zur Verfügung:
[date] Datum der Bot-Ausführung
[time] Uhrzeit der Bot-Ausführung
[page] Name dieser Webseite, wie im ACP angegeben
[receiver] Benutzername des Empfängers einer Benachrichtigung
Die folgenden Benutzer-bezogenen Platzhalter (betroffene Benutzer) stehen zur Verfügung:
[user-age] Alter des Benutzers
[user-email] E-Mail-Adresse des Benutzers
[user-groups] Namen der Benutzergruppen, denen der Benutzer angehört
[user-id] ID des Benutzers
[user-name] Name des Benutzers
[user-profile] Link zum Profil des Benutzers
[@user-profile] Link zum Profil des Benutzers mit Benachrichtungsfunktion (nur Beiträge)
]]>
- Dieser Bot überwacht die Moderation von Themen und erstellt Benachrichtigungen, wenn ein Thema entsprechend der ausgewählten Aktion(en) geändert wurde.
Der Verfasser des Themas und, wenn nicht ausgeschlossen, die Verfasser von Beiträgen im Thema (Poster) sind die betroffenen Benutzer und können direkt adressiert werden. Bei Bedarf kann auch ein Beitrag direkt im moderierten Thema erstellt werden. Dazu muss unter Benachrichtigung 0 als Thema-ID bei „Thema“ eingegeben werden.
Durch Konfiguration von Foren und der Allgemeinen Benutzer-Bedingungen kann die Überwachung auf bestimmte Foren bzw. Benutzer begrenzt werden. Durch Wahl des Betroffenen Benutzers kann die Benachrichtigung entweder an den Moderator oder den Ersteller des Themas und die Poster versendet werden.
Hinweis: Es wird für jeden betroffenen Benutzer eine Benachrichtigung erstellt. Dies gilt auch für Benachrichtigungen ohne individuellen Empfänger wie Artikel, Themen oder Beiträge. Soll nur eine Benachrichtigung durch den Bot erstellt werden, so muss entweder bei Verfasser „nur den Verfasser des Themas als betroffenen Benutzer nutzen“ oder bei Betroffener Benutzer „Agierender Benutzer“ ausgewählt werden.
Die folgenden Bot-spezifischen Platzhalter stehen zur Verfügung:
[count] Anzahl der von der Moderation betroffenen Benutzer
[board-id] ID des Forums, in dem das moderierte Thema erstellt wurde
[board-name] Name des Forums
[moderation-action] Aktion (z.B. „gelöscht“, „aktiviert“, „Label geändert“, „verschoben“
[moderation-reason] Grund für die Moderation (nicht bei allen Aktionen)
[moderator-id] ID des Benutzers, der das Thema moderiert hat
[moderator-link] Link zum Profil des Benutzers
[moderator-link2] Maskierter Link zum Profil des Benutzers
[moderator-name] Name des Benutzers
[thread-link] Link zum moderierten Thema (nicht durch alle Benutzer aufrufbar)
[thread-subject] Titel des Themas
[thread-text] Text des Themas
[user-count] Anzahl der Beiträge eines betroffenen Benutzers im moderierten Thema
Die folgenden allgemeinen Platzhalter stehen zur Verfügung:
[date] Datum der Bot-Ausführung
[time] Uhrzeit der Bot-Ausführung
[page] Name dieser Webseite, wie im ACP angegeben
[receiver] Benutzername des Empfängers einer Benachrichtigung
Die folgenden Benutzer-bezogenen Platzhalter (betroffene Benutzer) stehen zur Verfügung:
[user-age] Alter des Benutzers
[user-email] E-Mail-Adresse des Benutzers
[user-groups] Namen der Benutzergruppen, denen der Benutzer angehört
[user-id] ID des Benutzers
[user-name] Name des Benutzers
[user-profile] Link zum Profil des Benutzers
[@user-profile] Link zum Profil des Benutzers mit Benachrichtungsfunktion (nur Beiträge)
]]>
- Dieser Bot modifiziert ausgewählte Themen und erstellt Benachrichtigungen, wenn eine Aktion auf die betroffenen Themen angewendet wurde. Die Anzahl der Themen je Bot-Durchlauf kann konfiguriert werden (Standard: 300).
Die Verfasser der Themen und, wenn nicht ausgeschlossen, die Verfasser von Beiträgen im Thema (Poster) sind die betroffenen Benutzer und können direkt adressiert werden. Bei Bedarf kann auch ein Beitrag direkt im modifizierten Thema erstellt werden. Dazu muss unter Benachrichtigung 0 als Thema-ID bei „Thema“ eingegeben werden.
Es kann mehr als eine Aktion gewählt werden. Die Aktionen werden in der Reihenfolge wie bei der Bot-Konfiguration abgearbeitet.
Hinweis: Es wird für jeden betroffenen Benutzer eine Benachrichtigung erstellt. Dies gilt auch für Benachrichtigungen ohne individuellen Empfänger wie Artikel, Themen oder Beiträge. Soll nur eine Benachrichtigung je Thema durch den Bot erstellt werden, so muss bei Verfasser „nur den Verfasser des Themas als betroffenen Benutzer nutzen“ ausgewählt werden. Abhängig von Konfiguration und Anzahl der modifizierten Themen können sehr viele Benachrichtigungen erstellt werden.
Die folgenden Bot-spezifischen Platzhalter stehen zur Verfügung:
[action] Aktion (z.B. „gelöscht“, „aktiviert“, „Label geändert“, „verschoben“
[count] Anzahl der betroffenen Themen
[object-ids] IDs der modifizierten Themen
Die folgenden allgemeinen Platzhalter stehen zur Verfügung:
[date] Datum der Bot-Ausführung
[time] Uhrzeit der Bot-Ausführung
[page] Name dieser Webseite, wie im ACP angegeben
[receiver] Benutzername des Empfängers einer Benachrichtigung
Die folgenden Benutzer-bezogenen Platzhalter (betroffene Benutzer) stehen zur Verfügung:
[user-age] Alter des Benutzers
[user-email] E-Mail-Adresse des Benutzers
[user-groups] Namen der Benutzergruppen, denen der Benutzer angehört
[user-id] ID des Benutzers
[user-name] Name des Benutzers
[user-profile] Link zum Profil des Benutzers
[@user-profile] Link zum Profil des Benutzers mit Benachrichtungsfunktion (nur Beiträge)
]]>
- Dieser Bot überwacht die Veröffentlichung von Themen und versendet eine Benachrichtigung, wenn ein Benutzer oder Gast ein neues Thema verfasst hat und dieses veröffentlicht/freigeschaltet wird.
Der Verfasser des Themas ist der betroffene Benutzer und kann direkt adressiert werden. Bei Bedarf kann auch ein Beitrag direkt im Thema erstellt werden. Dazu muss unter Benachrichtigung 0 als Thema-ID bei „Thema“ eingegeben werden.
Es können mehrere Foren überwacht werden oder nur eines. Durch Konfiguration der Allgemeinen Benutzer-Bedingungen lassen sich zudem gezielt einzelne Benutzer überwachen.
Die folgenden Bot-spezifischen Platzhalter stehen zur Verfügung:
[count] Anzahl der erstellten Themen (immer 1)
[count-user] Anzahl der durch den betroffenen Benutzer erstellten Themen (immer 1)
[board-id] ID des Forums, in dem das Thema veröffentlicht wurde
[board-name] Name des Forums
[options] Fügt den Inhalt des Themenformulars als Text ein (ab WSC 5.2)
[quote] Fügt den Text des Themas als Zitat ein
[thread-link] Link zum erstellten Thema
[thread-subject] Titel des Themas
[thread-text] Text des Themas
Die folgenden allgemeinen Platzhalter stehen zur Verfügung:
[date] Datum der Bot-Ausführung
[time] Uhrzeit der Bot-Ausführung
[page] Name dieser Webseite, wie im ACP angegeben
[receiver] Benutzername des Empfängers einer Benachrichtigung
Die folgenden Benutzer-bezogenen Platzhalter (betroffene Benutzer) stehen zur Verfügung:
[user-age] Alter des Benutzers
[user-email] E-Mail-Adresse des Benutzers
[user-groups] Namen der Benutzergruppen, denen der Benutzer angehört
[user-id] ID des Benutzers
[user-name] Name des Benutzers
[user-profile] Link zum Profil des Benutzers
[@user-profile] Link zum Profil des Benutzers mit Benachrichtungsfunktion (nur Beiträge)
]]>
- Dieser Bot ermittelt die Top-Poster (Beiträge) in einem wählbaren Zeitraum und versendet eine Benachrichtigung, wenn dieser Zeitraum abgelaufen ist. Es werden bis auf gelöschte Beiträge alle Beiträge der Benutzer berücksichtigt.
Die ermittelten Top-Poster sind die betroffenen Benutzer und können direkt adressiert werden.
Es können mehrere Foren überwacht werden oder nur eines. Durch Konfiguration der Allgemeinen Benutzer-Bedingungen lassen sich zudem gezielt einzelne Benutzer überwachen.
Hinweis: Es wird für jeden betroffenen Benutzer eine Benachrichtigung erstellt. Dies gilt auch für Benachrichtigungen ohne individuellen Empfänger wie Artikel, Themen oder Beiträge. Soll nur eine Benachrichtigung durch den Bot erstellt werden, so muss „Ergebnisse zusammenfassen“ aktiviert werden.
Die folgenden Bot-spezifischen Platzhalter stehen zur Verfügung:
[date-from] Datum des Zeitraumbeginns
[time-from] Uhrzeit des Zeitraumbeginns
[date-to] Datum des Zeitraumendes
[time-to] Uhrzeit des Zeitraumendes
[user-rank] Der Rang des Benutzers; der Top-Poster bekommt die 1, die folgenden Benutzer 2, 3, 4 ...
[user-count] Anzahl der Beiträge des Benutzers im Zeitraum
Die folgenden allgemeinen Platzhalter stehen zur Verfügung:
[date] Datum der Bot-Ausführung
[time] Uhrzeit der Bot-Ausführung
[page] Name dieser Webseite, wie im ACP angegeben
[receiver] Benutzername des Empfängers einer Benachrichtigung
Die folgenden Benutzer-bezogenen Platzhalter (betroffene Benutzer) stehen zur Verfügung:
[user-age] Alter des Benutzers
[user-email] E-Mail-Adresse des Benutzers
[user-groups] Namen der Benutzergruppen, denen der Benutzer angehört
[user-id] ID des Benutzers
[user-name] Name des Benutzers
[user-profile] Link zum Profil des Benutzers
[@user-profile] Link zum Profil des Benutzers mit Benachrichtungsfunktion (nur Beiträge)
]]>
- Dieser Bot eine tägliche Statistik mit Forum-Daten wie z.B. Foren, Themen und Beiträge.
Es muss nur eine Benachrichtigung konfiguriert werden. Betroffene Benutzer gibt es bei diesem Bot nicht.
Die folgenden Bot-spezifischen Platzhalter stehen zur Verfügung:
[stats] Statistische Daten in formatierter Form
[date-from] Datum des Zeitraumbeginns
[time-from] Uhrzeit des Zeitraumbeginns
[date-to] Datum des Zeitraumendes
[time-to] Uhrzeit des Zeitraumendes
Die folgenden allgemeinen Platzhalter stehen zur Verfügung:
[date] Datum der Bot-Ausführung
[time] Uhrzeit der Bot-Ausführung
[page] Name dieser Webseite, wie im ACP angegeben
[receiver] Benutzername des Empfängers einer Benachrichtigung
Die folgenden Benutzer-bezogenen Platzhalter (betroffene Benutzer) stehen zur Verfügung:
]]>
- Dieser Bot überwacht das Auswählen eines Beitrags als Hilfreichste Antwort und versendet eine Benachrichtigung, wenn die Hilfreichste Antwort in einem Thema festgelegt wird.
Der Autor des Beitrags ist der betroffene Benutzer und kann direkt adressiert werden. Bei Bedarf kann auch ein Beitrag direkt im Thema erstellt werden. Dazu muss unter Benachrichtigung 0 als Thema-ID bei „Thema“ eingegeben werden.
Die folgenden Bot-spezifischen Platzhalter stehen zur Verfügung:
[count] Anzahl der hilfreichsten Antworten (immer 1)
[count-user] Anzahl der durch den betroffenen Benutzer erstellten Beiträge
[board-id] ID des Forums, in dem das Thema veröffentlicht wurde
[board-name] Name des Forums
[thread-link] Link zum erstellten Thema
[thread-subject] Titel des Themas
[post-id] ID des Beitrags mit der Hilfreichsten Antwort
[post-link] Link zum Beitrag
[post-subject] Titel des Beitrags
[post-text] Text des Beitrags
[quote] Fügt den Text des Beitrags als Zitat ein
Die folgenden allgemeinen Platzhalter stehen zur Verfügung:
[date] Datum der Bot-Ausführung
[time] Uhrzeit der Bot-Ausführung
[page] Name dieser Webseite, wie im ACP angegeben
[receiver] Benutzername des Empfängers einer Benachrichtigung
Die folgenden Benutzer-bezogenen Platzhalter (betroffene Benutzer) stehen zur Verfügung:
[user-age] Alter des Benutzers
[user-email] E-Mail-Adresse des Benutzers
[user-groups] Namen der Benutzergruppen, denen der Benutzer angehört
[user-id] ID des Benutzers
[user-name] Name des Benutzers
[user-profile] Link zum Profil des Benutzers
[@user-profile] Link zum Profil des Benutzers mit Benachrichtungsfunktion (nur Beiträge)
]]>
- Foren
- Gesamt: {#$boardOld} -- {#$board} ({if $board > $boardOld}+{/if}{$board - $boardOld})
- Kategorien: {#$boardCategoryOld} -- {#$boardCategory} ({if $boardCategory > $boardCategoryOld}+{/if}{$boardCategory - $boardCategoryOld})
- Verweise: {#$boardLinkOld} -- {#$boardLink} ({if $boardLink > $boardLinkOld}+{/if}{$boardLink - $boardLinkOld})
- Gesperrt: {#$boardClosedOld} -- {#$boardClosed} ({if $boardClosed > $boardClosedOld}+{/if}{$boardClosed - $boardClosedOld})
- Versteckt: {#$boardInvisibleOld} -- {#$boardInvisible} ({if $boardInvisible > $boardInvisibleOld}+{/if}{$boardInvisible - $boardInvisibleOld})
Themen
- Gesamt: {#$threadOld} -- {#$thread} ({if $thread > $threadOld}+{/if}{$thread - $threadOld})
- Ankündigungen: {#$threadAnnouncementOld} -- {#$threadAnnouncement} ({if $threadAnnouncement > $threadAnnouncementOld}+{/if}{$threadAnnouncement - $threadAnnouncementOld})
- Umfragen: {#$threadPollOld} -- {#$threadPoll} ({if $threadPoll > $threadPollOld}+{/if}{$threadPoll - $threadPollOld})
- Angepinnt: {#$threadStickyOld} -- {#$threadSticky} ({if $threadSticky > $threadStickyOld}+{/if}{$threadSticky - $threadStickyOld})
- Deaktiviert: {#$threadDisabledOld} -- {#$threadDisabled} ({if $threadDisabled > $threadDisabledOld}+{/if}{$threadDisabled - $threadDisabledOld})
- Geschlossen: {#$threadClosedOld} -- {#$threadClosed} ({if $threadClosed > $threadClosedOld}+{/if}{$threadClosed - $threadClosedOld})
- Gelöscht: {#$threadDeletedOld} -- {#$threadDeleted} ({if $threadDeleted > $threadDeletedOld}+{/if}{$threadDeleted - $threadDeletedOld})
- Aufrufe: {#$threadViewOld} -- {#$threadView} ({if $threadView > $threadViewOld}+{/if}{$threadView - $threadViewOld})
Beiträge
- Gesamt: {#$postOld} -- {#$post} ({if $post > $postOld}+{/if}{$post - $postOld})
- Deaktiviert: {#$postDisabledOld} -- {#$postDisabled} ({if $postDisabled > $postDisabledOld}+{/if}{$postDisabled - $postDisabledOld})
- Gesperrt: {#$postClosedOld} -- {#$postClosed} ({if $postClosed > $postClosedOld}+{/if}{$postClosed - $postClosedOld})
- Gelöscht: {#$postDeletedOld} -- {#$postDeleted} ({if $postDeleted > $postDeletedOld}+{/if}{$postDeleted - $postDeletedOld})
- Bearbeitungen: {#$postEditOld} -- {#$postEdit} ({if $postEdit > $postEditOld}+{/if}{$postEdit - $postEditOld})
]]>
language/en.xml 0100644 0000000 0000000 00000124137 14071047561 012531 0 ustar 00 0000000 0000000
- This Bot monitors the modification or deletion of posts by their authors and sends a notification when a user has edited or deleted a post of him. The moderation of posts is not accessed by this Bot.
The author of the post is affected user and can be directly addressed. If necessary, a post can be created directly in the thread with the recognized post. To do so, you must enter 0 as a thread ID under “Thread”.
By selection of monitored boards and / or configuration of general user conditions the monitoring can be limited to certain boards resp. users.
The following Bot-specific placeholders are available:
[action] Action executed by the user: “edited” or “deleted”
[count] Total number of modified / deleted posts (always 1)
[count-user] Number of posts modified / deleted by the affected user (always 1)
[board-id] ID of the forum the changed post was posted
[board-name] Name of the forum
[post-id] ID of the modified post
[post-link] Link to the post
[post-subject] Title of post
[post-text] Text of post
[quote] Text of the post as quote
[reason] Reason for the modification as given ba the user
[thread-link] Link to the thread the modified post was created in
[thread-subject] Title of the thread
The following general placeholders are available:
[date] Date of Bot execution
[time] Time of Bot execution
[page] Name of this website, as defined in ACP
[receiver] Username of the receiver of a notification
The following user-specific placeholders are available:
[user-age] Age of the user
[user-email] Email address of the user
[user-groups] Names of the user groups the user is member of
[user-id] ID of the user
[user-name] Name of the user
[user-profile] Link to the user’s profile
[@user-profile] Link to the user’s profile with notification (posts only)
]]>
- This Bot monitors the publication of posts and sends a notification when a user or guest has written a new post and the post is published / enabled.
The author of the post is affected user and can be directly addressed. If necessary, a post can be created directly in the thread with the recognized post. To do so, you must enter 0 as a thread ID under “Thread”.
“Total number of posts” will force a notification when the total number of posts reaches one of the values in “Trigger Values”.
Using “Xth post of a user” the notification will be sent when the affected user’s count for posts reaches one of the values in “Trigger Values”.
“User with the most posts” will force a notification when the user with the most posts changes. Trigger values don’t need to be configured.
By configuration of general user conditions the notification for “Xth post of a user” can be limited to certain users.
The following Bot-specific placeholders are available:
[count] Total number of posts (without posts in trash can)
[count-user] Number of posts of the affected user (0 if guest)
[board-id] ID of the forum the post was published in
[board-name] Name of the forum
[post-id] ID of the new post
[post-link] Link to the post
[post-subject] Title of post
[post-text] Text of post
[quote] Text of the post as quote
[thread-link] Link to the thread the post was created in
[thread-subject] Title of the thread
The following general placeholders are available:
[date] Date of Bot execution
[time] Time of Bot execution
[page] Name of this website, as defined in ACP
[receiver] Username of the receiver of a notification
The following user-specific placeholders are available:
[user-age] Age of the user
[user-email] Email address of the user
[user-groups] Names of the user groups the user is member of
[user-id] ID of the user
[user-name] Name of the user
[user-profile] Link to the user’s profile
[@user-profile] Link to the user’s profile with notification (posts only)
]]>
- This Bot monitors the moderation of posts and sends a notification when a post was changed in accordance with the selected action(s).
The author of the post is the affected user and can be directly addressed. If necessary, a post can be created directly in the thread with the moderated post. To do so, you must enter 0 as a thread ID under “Thread”.
By selection of monitored boards and / or configuration of general user conditions the monitoring can be limited to certain boards resp. users. By selection of the affected user, the notifications will be send to either the moderator or the authors of the post.
The following Bot-specific placeholders are available:
[count] Total number of users affected by the moderation
[board-id] ID of the forum the moderated post was created in
[board-name] Name of the forum
[moderation-action] Action (e.g. “deleted”, “enabled”, “moved”
[moderation-reason] Reason for moderation (not all actions)
[moderator-id] ID of the user who moderated the post
[moderator-link] Link to the user’s profile
[moderator-link2] Masked link to the user’s profile
[moderator-name] Name of the user
[post-link] Link to the moderated post (depending on permissions not available for all users)
[post-subject] Title of post
[post-text] Text of post
[thread-link] Link to the thread with the moderated post (depending on permissions not available for all users)
[thread-subject] Title of thread
[thread-text] Text of thread
The following general placeholders are available:
[date] Date of Bot execution
[time] Time of Bot execution
[page] Name of this website, as defined in ACP
[receiver] Username of the receiver of a notification
The following user-specific placeholders are available:
[user-age] Age of the user
[user-email] Email address of the user
[user-groups] Names of the user groups the user is member of
[user-id] ID of the user
[user-name] Name of the user
[user-profile] Link to the user’s profile
[@user-profile] Link to the user’s profile with notification (posts only)
]]>
- This Bot monitors the moderation of threads and sends a notification when a thread was changed in accordance with the selected action(s).
The author of the thread and, unless excluded, authors of the posts within the thread (poster) are the affected users and can be directly addressed. If necessary, a post can be created directly in the moderated thread. To do so, you must enter 0 as a thread ID under “Thread”.
By selection of monitored boards and / or configuration of general user conditions the monitoring can be limited to certain boards resp. users. By selection of the affected user, the notifications will be send to either the moderator or the authors of the thread / posts.
Notice: one notification will be created for each affected user. This is valid for notifications without individual receiver, like article, threads and posts, too. If you wish only one notification, you have to either select “only consider the author of the thread as affected user” (Author) or “Acting user” as affected user.
The following Bot-specific placeholders are available:
[count] Total number of users affected by the moderation
[board-id] ID of the forum the moderated thread was created in
[board-name] Name of the forum
[moderation-action] Action (e.g. “deleted”, “enabled”, “label changed”, “moved”
[moderation-reason] Reason for moderation (not all actions)
[moderator-id] ID of the user who moderated the thread
[moderator-link] Link to the user’s profile
[moderator-link2] Masked link to the user’s profile
[moderator-name] Name of the user
[thread-link] Link to the moderated thread (depending on permissions not available for all users)
[thread-subject] Title of thread
[thread-text] Text of thread
[user-count] Number of posts of a affected user within the moderated thread
The following general placeholders are available:
[date] Date of Bot execution
[time] Time of Bot execution
[page] Name of this website, as defined in ACP
[receiver] Username of the receiver of a notification
The following user-specific placeholders are available:
[user-age] Age of the user
[user-email] Email address of the user
[user-groups] Names of the user groups the user is member of
[user-id] ID of the user
[user-name] Name of the user
[user-profile] Link to the user’s profile
[@user-profile] Link to the user’s profile with notification (posts only)
]]>
- This Bot modifies selected threads and sends a notification when a modification action was applied to the threads. The number of threads per cronjob run can be configured (default: 300).
The authors of the threads and, unless excluded, authors of the posts within the thread (poster) are the affected users and can be directly addressed. If necessary, a post can be created directly in the modified thread. To do so, you must enter 0 as a thread ID under “Thread”.
You may choose more than one action. Actions will be executed according to the sequence in the Bot configuration.
Notice: one notification will be created for each affected user. This is valid for notifications without individual receiver, like article, threads and posts, too. If you wish only one notification per thread, you have to select “only consider the author of the thread as affected user” under Author. Depending on configuration and number of modified threads, a lot of notifications may be created.
The following Bot-specific placeholders are available:
[action] Action (e.g. “deleted”, “enabled”, “label changed”, “moved”
[count] Total number of affected threads
[object-ids] IDs of the affected threads
The following general placeholders are available:
[date] Date of Bot execution
[time] Time of Bot execution
[page] Name of this website, as defined in ACP
[receiver] Username of the receiver of a notification
The following user-specific placeholders are available:
[user-age] Age of the user
[user-email] Email address of the user
[user-groups] Names of the user groups the user is member of
[user-id] ID of the user
[user-name] Name of the user
[user-profile] Link to the user’s profile
[@user-profile] Link to the user’s profile with notification (posts only)
]]>
- This bot monitors the publication of threads and sends a notification when a user or guest has written a new thread and the thread is published / enabled.
The author of the topic is the affected user and can be directly addressed. If necessary, a post can be created directly in the thread. To do so, you must enter 0 as a thread ID under “Thread”.
Multiple forums can be monitored or only one. By configuring the general user conditions, specific users can be monitored.
The following Bot-specific placeholders are available:
[count] Total number of published threads (always 1)
[count-user] Number of threads created by the affected user (always 1)
[board-id] ID of the forum the thread was published in
[board-name] Name of the forum
[options] Inserts the contents of the thread form as text (from WSC 5.2)
[quote] Inserts the text of the thread as quote
[thread-link] Link to the thread
[thread-subject] Title of the thread
[thread-text] Text of the thread
The following general placeholders are available:
[date] Date of Bot execution
[time] Time of Bot execution
[page] Name of this website, as defined in ACP
[receiver] Username of the receiver of a notification
The following user-specific placeholders are available:
[user-age] Age of the user
[user-email] Email address of the user
[user-groups] Names of the user groups the user is member of
[user-id] ID of the user
[user-name] Name of the user
[user-profile] Link to the user’s profile
[@user-profile] Link to the user’s profile with notification (posts only)
]]>
- This bot calculates the top posters for the given time period and sends a notification when the period has expired.
The top posters are the affected users and can be directly addressed.
Multiple forums can be monitored or only one. By configuring the general user conditions, specific users can be monitored.
Notice: one notification will be created for each affected user. This is valid for notifications without individual receiver, like article, threads and posts, too. If you wish only one notification, you have to activate “Condense Results”.
The following Bot-specific placeholders are available:
[date-from] Date of the period’s beginning
[time-from] Time of period’s beginning
[date-to] Date of the period’s end
[time-to] Time of period’s end
[user-rank] Rank of the user; the top poster gets a 1, the following users 2, 3, 4 ...
[user-count] Nuimber of posts in the period
The following general placeholders are available:
[date] Date of Bot execution
[time] Time of Bot execution
[page] Name of this website, as defined in ACP
[receiver] Username of the receiver of a notification
The following user-specific placeholders are available:
[user-age] Age of the user
[user-email] Email address of the user
[user-groups] Names of the user groups the user is member of
[user-id] ID of the user
[user-name] Name of the user
[user-profile] Link to the user’s profile
[@user-profile] Link to the user’s profile with notification (posts only)
]]>
- This Bot creates a daily statistics with forum data like boards, threads and posts.
Only the notification must be configured. And there are no affected users.
The following Bot-specific placeholders are available:
[stats] Formatted statistics data
[date-from] Date of the period’s beginning
[time-from] Time of period’s beginning
[date-to] Date of the period’s end
[time-to] Time of period’s end
The following general placeholders are available:
[date] Date of Bot execution
[time] Time of Bot execution
[page] Name of this website, as defined in ACP
[receiver] Username of the receiver of a notification
The following user-specific placeholders are available:
]]>
- This bot monitors the selection of a post as Best Answer and sends a notification when the Best Answer is set in a thread.
The author of the post is the affected user and can be directly addressed. If necessary, a post can be created directly in the thread. To do so, you must enter 0 as a thread ID under “Thread”.
The following Bot-specific placeholders are available:
[count] Number of Best Answers (always 1)
[count-user] Number of user posts
[board-id] ID of the board, in which the thread was published
[board-name] Board name
[thread-link] Link to thread
[thread-subject] Title of thread
[post-id] ID of the post with the Best Answer
[post-link] Link to post
[post-subject] Title of post
[post-text] Text of post
[quote] Text of the post as quote
The following general placeholders are available:
[date] Date of Bot execution
[time] Time of Bot execution
[page] Name of this website, as defined in ACP
[receiver] Username of the receiver of a notification
The following user-specific placeholders are available:
[user-age] Age of the user
[user-email] Email address of the user
[user-groups] Names of the user groups the user is member of
[user-id] ID of the user
[user-name] Name of the user
[user-profile] Link to the user’s profile
[@user-profile] Link to the user’s profile with notification (posts only)
]]>
- Boards
- Total: {#$boardOld} -- {#$board} ({if $board > $boardOld}+{/if}{$board - $boardOld})
- Categories: {#$boardCategoryOld} -- {#$boardCategory} ({if $boardCategory > $boardCategoryOld}+{/if}{$boardCategory - $boardCategoryOld})
- Links: {#$boardLinkOld} -- {#$boardLink} ({if $boardLink > $boardLinkOld}+{/if}{$boardLink - $boardLinkOld})
- Closed: {#$boardClosedOld} -- {#$boardClosed} ({if $boardClosed > $boardClosedOld}+{/if}{$boardClosed - $boardClosedOld})
- Hidden: {#$boardInvisibleOld} -- {#$boardInvisible} ({if $boardInvisible > $boardInvisibleOld}+{/if}{$boardInvisible - $boardInvisibleOld})
Threads
- Total: {#$threadOld} -- {#$thread} ({if $thread > $threadOld}+{/if}{$thread - $threadOld})
- Announcements: {#$threadAnnouncementOld} -- {#$threadAnnouncement} ({if $threadAnnouncement > $threadAnnouncementOld}+{/if}{$threadAnnouncement - $threadAnnouncementOld})
- Polls: {#$threadPollOld} -- {#$threadPoll} ({if $threadPoll > $threadPollOld}+{/if}{$threadPoll - $threadPollOld})
- Sticky: {#$threadStickyOld} -- {#$threadSticky} ({if $threadSticky > $threadStickyOld}+{/if}{$threadSticky - $threadStickyOld})
- Disabled: {#$threadDisabledOld} -- {#$threadDisabled} ({if $threadDisabled > $threadDisabledOld}+{/if}{$threadDisabled - $threadDisabledOld})
- Closed: {#$threadClosedOld} -- {#$threadClosed} ({if $threadClosed > $threadClosedOld}+{/if}{$threadClosed - $threadClosedOld})
- Deleted: {#$threadDeletedOld} -- {#$threadDeleted} ({if $threadDeleted > $threadDeletedOld}+{/if}{$threadDeleted - $threadDeletedOld})
- Views: {#$threadViewOld} -- {#$threadView} ({if $threadView > $threadViewOld}+{/if}{$threadView - $threadViewOld})
Posts
- Total: {#$postOld} -- {#$post} ({if $post > $postOld}+{/if}{$post - $postOld})
- Disabled: {#$postDisabledOld} -- {#$postDisabled} ({if $postDisabled > $postDisabledOld}+{/if}{$postDisabled - $postDisabledOld})
- Closed: {#$postClosedOld} -- {#$postClosed} ({if $postClosed > $postClosedOld}+{/if}{$postClosed - $postClosedOld})
- Deleted: {#$postDeletedOld} -- {#$postDeleted} ({if $postDeleted > $postDeletedOld}+{/if}{$postDeleted - $postDeletedOld})
- Edits: {#$postEditOld} -- {#$postEdit} ({if $postEdit > $postEditOld}+{/if}{$postEdit - $postEditOld})
]]>
acptemplates.tar 0100644 0000000 0000000 00000074000 14244502621 013000 0 ustar 00 0000000 0000000 __uzbotAddNotifyWbb.tpl 0100644 0000000 0000000 00000006534 14071773636 014252 0 ustar 00 0000000 0000000
__uzbotAddNotifyWbbJS.tpl 0100644 0000000 0000000 00000000371 13056474736 014501 0 ustar 00 0000000 0000000 $('.notifyWbbPostSettings, .notifyWbbThreadSettings').hide();
if ($value == 10) {
$('.notifyWbbThreadSettings, .notifySubject, .notifyTags').show();
$('#notifyLabelContainer').show();
}
if ($value == 11) {
$('.notifyWbbPostSettings').show();
}
__uzbotAddTypeWbb.tpl 0100644 0000000 0000000 00000040216 13677134046 013713 0 ustar 00 0000000 0000000
{lang}wcf.acp.uzbot.wbb.threadNew.threadNewBoardIDs{/lang}
{foreach from=$boardNodeList item=boardNode}
getBoard()->boardID|in_array:$threadNewBoardIDs} selected{/if}>{if $boardNode->getDepth() > 1}{@' '|str_repeat:-1+$boardNode->getDepth()}{/if}{$boardNode->getBoard()->title|language}
{/foreach}
{if $errorField == 'threadNewBoardIDs'}
{lang}wcf.acp.uzbot.wbb.threadNew.threadNewBoardIDs.error.{@$errorType}{/lang}
{/if}
{lang}wcf.acp.uzbot.type.description.notifyOnly{/lang}
{lang}wcf.acp.uzbot.wbb.uzbotBoardIDs{/lang}
{foreach from=$boardNodeList item=boardNode}
getBoard()->boardID|in_array:$uzbotBoardIDs} selected{/if}>{if $boardNode->getDepth() > 1}{@' '|str_repeat:-1+$boardNode->getDepth()}{/if}{$boardNode->getBoard()->title|language}
{/foreach}
{if $errorField == 'uzbotBoardIDs'}
{lang}wcf.acp.uzbot.wbb.uzbotBoardIDs.error.{@$errorType}{/lang}
{/if}
{foreach from=$wbbConditions key='conditionGroup' item='conditionObjectTypes'}
{foreach from=$conditionObjectTypes item='condition'}
{@$condition->getProcessor()->getHtml()}
{/foreach}
{/foreach}
__uzbotAddTypeWbbJS.tpl 0100644 0000000 0000000 00000002640 13677133266 014152 0 ustar 00 0000000 0000000 $('.wbb_threadNew, .wbb_postCount, .wbb_postChange, .wbb_postModeration, .wbb_bestAnswer').hide();
$('.wbb_threadModification, .wbb_threadModeration, .wbb_topPoster, .wbb_statistics').hide();
$('.wbbUzbotBoardIDs, .wbbConditionSettings, .wbbBoardIDs').hide();
if (value == 30) {
$('.wbb_postChange, .wbbUzbotBoardIDs, .uzbotUserConditions').show();
$('#receiverAffected').show();
}
if (value == 31) {
$('.wbb_postCount, .uzbotUserConditions, .user_count').show();
$('#receiverAffected').show();
}
if (value == 32) {
$('.wbb_postModeration, .wbbUzbotBoardIDs, .uzbotUserConditions, .affectedSetting').show();
$('#receiverAffected').show();
}
if (value == 40) {
$('.wbb_threadModeration, .wbbUzbotBoardIDs, .uzbotUserConditions, .affectedSetting').show();
$('#receiverAffected').show();
}
if (value == 41) {
$('.wbb_threadModification, .wbbConditionSettings').show();
$('#receiverAffected, #actionLabelContainer, #conditionLabelContainer').show();
}
if (value == 42) {
$('.wbb_threadNew, .uzbotUserConditions').show();
$('#receiverAffected').show();
}
if (value == 43) {
$('.wbb_topPoster, .wbbUzbotBoardIDs, .condenseSetting, .uzbotUserConditions').show();
$('#receiverAffected').show();
if ($('#condenseEnable').is(':checked')) { $('.notifyCondense').show(); }
}
if (value == 44) {
$('.wbb_statistics').show();
}
if (value == 45) {
$('.wbb_bestAnswer, .wbbUzbotBoardIDs').show();
$('#receiverAffected').show();
}
files.tar 0100644 0000000 0000000 00000454000 14244502621 011422 0 ustar 00 0000000 0000000 acp/ 0040755 0000000 0000000 00000000000 14244460336 010361 5 ustar 00 0000000 0000000 lib/ 0040755 0000000 0000000 00000000000 14244460336 010364 5 ustar 00 0000000 0000000 lib/data/ 0040755 0000000 0000000 00000000000 14244460336 011275 5 ustar 00 0000000 0000000 lib/data/uzbot/ 0040755 0000000 0000000 00000000000 14244460336 012440 5 ustar 00 0000000 0000000 lib/data/uzbot/notification/ 0040755 0000000 0000000 00000000000 14244460336 015126 5 ustar 00 0000000 0000000 lib/system/ 0040755 0000000 0000000 00000000000 14244460336 011710 5 ustar 00 0000000 0000000 lib/system/condition/ 0040755 0000000 0000000 00000000000 14244460336 013676 5 ustar 00 0000000 0000000 lib/system/condition/uzbot/ 0040755 0000000 0000000 00000000000 14244460336 015041 5 ustar 00 0000000 0000000 lib/system/cronjob/ 0040755 0000000 0000000 00000000000 14244460336 013344 5 ustar 00 0000000 0000000 lib/system/event/ 0040755 0000000 0000000 00000000000 14244460336 013031 5 ustar 00 0000000 0000000 lib/system/event/listener/ 0040755 0000000 0000000 00000000000 14244460336 014656 5 ustar 00 0000000 0000000 acp/install_com.uz.wcf.bot3.wbb.php 0100644 0000000 0000000 00000001326 14167533111 016223 0 ustar 00 0000000 0000000
* @package com.uz.wcf.bot3.wbb
* @subpackage acp
* @category WoltLab Suite Forum
*/
// posts
$topPosterID = null;
$sql = "SELECT userID, wbbPosts
FROM wcf".WCF_N."_user
ORDER BY wbbPosts DESC";
$statement = WCF::getDB()->prepareStatement($sql, 1);
$statement->execute();
$row = $statement->fetchArray();
if (!empty($row)) $topPosterID = $row['userID'];
$action = new UzbotTopAction([1], 'update', [
'data' => [
'post' => $topPosterID
]
]);
$action->executeAction(); lib/data/uzbot/notification/UzbotNotifyForumPost.class.php 0100644 0000000 0000000 00000010020 14167533111 023100 0 ustar 00 0000000 0000000
* @package com.uz.wcf.bot3.wbb
*/
class UzbotNotifyForumPost {
public function send(Uzbot $bot, $content, $subject, $teaser, $language, $receiver, $tags) {
// prepare texts and data
$defaultLanguage = LanguageFactory::getInstance()->getLanguage(LanguageFactory::getInstance()->getDefaultLanguageID());
$content = MessageUtil::stripCrap($content);
// ufn no subject
//$subject = MessageUtil::stripCrap(StringUtil::stripHTML($subject));
//if (mb_strlen($subject) > 255) $subject = mb_substr($subject, 0, 250) . '...';
$subject = '';
// set publication time
$publicationTime = TIME_NOW;
if (isset($bot->publicationTime) && $bot->publicationTime) {
$publicationTime = $bot->publicationTime;
}
if (!$bot->testMode) {
$htmlInputProcessor = new HtmlInputProcessor();
$htmlInputProcessor->process($content, 'com.woltlab.wbb.post', 0);
// get post data and create
try {
$wbbPostData = unserialize($bot->wbbPostData);
// preset thread, maybe 0 on automatic post in affected thread
if (!$wbbPostData['postNotifyThreadID']) {
$wbbPostData['postNotifyThreadID'] = $bot->threadID;
}
$thread = new Thread($wbbPostData['postNotifyThreadID']);
$board = $thread->getBoard();
$htmlInputProcessor = new HtmlInputProcessor();
$htmlInputProcessor->process($content, 'com.woltlab.wbb.post', 0);
$postData = [
'threadID' => $thread->threadID,
'subject' => $subject,
'message' => $content,
'time' => $publicationTime,
'userID' => $bot->senderID,
'username' => $bot->sendername,
'enableTime' => 0,
'isClosed' => $wbbPostData['postNotifyIsClosed'],
'isDisabled' => $wbbPostData['postNotifyIsDisabled'],
'ipAddress' => '',
'isOfficial' => $bot->postIsOfficial,
'isUzbot' => 1
];
$postCreateParameters = [
'data' => $postData,
'thread' => $thread,
'board' => $board,
'isFirstPost' => false,
'attachmentHandler' => null,
'htmlInputProcessor' => $htmlInputProcessor
];
$postAction = new PostAction([], 'create', $postCreateParameters);
$postAction->executeAction();
}
catch (SystemException $e) {
// users may get lost; check sender again to abort
if (!$bot->checkSender(true, true)) return false;
// thread must exist / disable
if (!$thread->threadID) {
$editor = new UzbotEditor($bot);
$editor->update(['isDisabled' => 1]);
UzbotEditor::resetCache();
if ($bot->enableLog) {
UzbotLogEditor::create([
'bot' => $bot,
'status' => 2,
'additionalData' => 'wcf.acp.uzbot.notify.post.threadID.error.notValid'
]);
UzbotLogEditor::create([
'bot' => $bot,
'status' => 2,
'additionalData' => 'wcf.acp.uzbot.error.disabled'
]);
}
return false;
}
// report any other error und continue
if ($bot->enableLog) {
$error = $defaultLanguage->get('wcf.acp.uzbot.log.notify.error') . ' ' . $e->getMessage();
UzbotLogEditor::create([
'bot' => $bot,
'status' => 1,
'count' => 1,
'additionalData' => $error
]);
}
}
}
else {
$teaser = '';
if (mb_strlen($content) > 63500) $content = mb_substr($content, 0, 63500) . ' ...';
$result = serialize([$subject, $teaser, $content]);
UzbotLogEditor::create([
'bot' => $bot,
'count' => 1,
'testMode' => 1,
'additionalData' => $result
]);
}
}
}
lib/data/uzbot/notification/UzbotNotifyForumThread.class.php 0100644 0000000 0000000 00000011034 14167533111 023370 0 ustar 00 0000000 0000000
* @package com.uz.wcf.bot3.wbb
*/
class UzbotNotifyForumThread {
public function send(Uzbot $bot, $content, $subject, $teaser, $language, $receiver, $tags) {
// prepare text and data
$defaultLanguage = LanguageFactory::getInstance()->getLanguage(LanguageFactory::getInstance()->getDefaultLanguageID());
$content = MessageUtil::stripCrap($content);
$subject = MessageUtil::stripCrap(StringUtil::stripHTML($subject));
if (mb_strlen($subject) > 255) $subject = mb_substr($subject, 0, 250) . '...';
// set publication time
$publicationTime = TIME_NOW;
if (isset($bot->publicationTime) && $bot->publicationTime) {
$publicationTime = $bot->publicationTime;
}
if (!$bot->testMode) {
$htmlInputProcessor = new HtmlInputProcessor();
$htmlInputProcessor->process($content, 'com.woltlab.wbb.post', 0);
// get thread / notification data
$wbbThreadData = unserialize($bot->wbbThreadData);
$assignedLabels = UzbotNotificationLabelObjectHandler::getInstance()->getAssignedLabels([$bot->botID], false);
// tags to include feedreader
if (!MODULE_TAGGING || !WBB_THREAD_ENABLE_TAGS) {
$tags = [];
}
else {
if (isset($bot->feedreaderUseTags) && $bot->feedreaderUseTags) {
if (isset($bot->feedreaderTags) && !empty($bot->feedreaderTags)) {
$tags = array_unique(array_merge($tags, $bot->feedreaderTags));
}
}
}
if (!WBB_MODULE_THREAD_MARKING_AS_DONE) {
$wbbThreadData['threadNotifyIsDone'] = 0;
}
// consider multilingualism for threads
if (!LanguageFactory::getInstance()->multilingualismEnabled() || !$language->languageID) {
$languageID = null;
}
else {
$languageID = $language->languageID;
}
$data = [
'boardID' => $wbbThreadData['threadNotifyBoardID'],
'languageID' => $languageID,
'topic' => $subject,
'time' => $publicationTime,
'userID' => $bot->senderID,
'username' => $bot->sendername,
'isClosed' => $wbbThreadData['threadNotifyIsClosed'],
'isDisabled' => $wbbThreadData['threadNotifyIsDisabled'],
'isDone' => $wbbThreadData['threadNotifyIsDone'],
'isSticky' => $wbbThreadData['threadNotifyIsSticky'],
'hasLabels' => !empty($assignedLabels) ? 1 : 0,
'isUzbot' => 1
];
// create thread
try {
// official post since 5.4
$postData['isOfficial'] = $bot->threadIsOfficial;
$action = new ThreadAction([], 'create', [
'data' => $data,
'postData' => $postData,
'tags' => $tags,
'subscribeThread' => false,
'htmlInputProcessor' => $htmlInputProcessor
]);
$resultValues = $action->executeAction();
// set labels
if (!empty($assignedLabels)) {
$labelIDs = [];
foreach ($assignedLabels as $labels) {
foreach ($labels as $label) {
$labelIDs[] = $label->labelID;
}
}
ThreadLabelObjectHandler::getInstance()->setLabels($labelIDs, $resultValues['returnValues']->threadID);
}
// update last post
$boardEditor = new BoardEditor(BoardCache::getInstance()->getBoard($wbbThreadData['threadNotifyBoardID']));
$boardEditor->updateLastPost();
}
catch (SystemException $e) {
// users may get lost; check sender again to abort
if (!$bot->checkSender(true, true)) return false;
// report any other error und continue
if ($bot->enableLog) {
$error = $defaultLanguage->get('wcf.acp.uzbot.log.notify.error') . ' ' . $e->getMessage();
UzbotLogEditor::create([
'bot' => $bot,
'status' => 1,
'count' => 1,
'additionalData' => $error
]);
}
}
}
else {
$teaser = '';
if (mb_strlen($content) > 63500) $content = mb_substr($content, 0, 63500) . ' ...';
$result = serialize([$subject, $teaser, $content]);
UzbotLogEditor::create([
'bot' => $bot,
'count' => 1,
'testMode' => 1,
'additionalData' => $result
]);
}
}
}
lib/system/condition/uzbot/UzbotThreadIntegerPropertyCondition.class.php 0100644 0000000 0000000 00000003250 14167533111 026034 0 ustar 00 0000000 0000000
* @package com.uz.wcf.bot3.wbb
*/
class UzbotThreadIntegerPropertyCondition extends ThreadIntegerPropertyCondition {
/**
* @inheritDoc
*/
public function addObjectListCondition(DatabaseObjectList $objectList, array $conditionData) {
if (!($objectList instanceof ThreadList)) {
throw new \InvalidArgumentException("Object list is no instance of '".ThreadList::class."', instance of '".get_class($objectList)."' given.");
}
if (isset($conditionData['greaterThan'])) {
$objectList->getConditionBuilder()->add('thread.'.$this->getPropertyName().' < ?', [TIME_NOW - 86400 * $conditionData['greaterThan']]);
}
}
/**
* @inheritDoc
*/
protected function getLabel() {
return WCF::getLanguage()->get('wcf.acp.uzbot.wbb.condition.days.'.$this->getPropertyName());
}
/**
* @inheritDoc
*/
public function getFieldElement() {
$greaterThanPlaceHolder = WCF::getLanguage()->get('wcf.condition.greaterThan');
$lessThanPlaceHolder = WCF::getLanguage()->get('wcf.condition.lessThan');
return <<getMinMaxAttributes('greaterThan')} class="medium">
HTML;
}
}
lib/system/condition/uzbot/UzbotThreadLabelStateCondition.class.php 0100644 0000000 0000000 00000007645 14167533111 024726 0 ustar 00 0000000 0000000
* @package com.uz.wcf.bot3.wbb
*/
class UzbotThreadLabelStateCondition extends AbstractSingleFieldCondition implements IContentCondition, IObjectCondition, IObjectListCondition {
/**
* @inheritDoc
*/
protected $label = 'wcf.acp.uzbot.wbb.condition.label';
/**
* values of the possible state
* @var integer[]
*/
protected $hasLabels = 0;
protected $hasNoLabels = 0;
/**
* @see \wcf\system\condition\IObjectListCondition::addObjectListCondition()
*/
public function addObjectListCondition(DatabaseObjectList $objectList, array $conditionData) {
if (!($objectList instanceof ThreadList)) {
throw new \InvalidArgumentException("Object list is no instance of '".ThreadList::class."', instance of '".get_class($objectList)."' given.");
}
if (isset($conditionData['hasLabels'])) {
$objectList->getConditionBuilder()->add('thread.hasLabels = ?', [1]);
}
if (isset($conditionData['hasNoLabels'])) {
$objectList->getConditionBuilder()->add('thread.hasLabels = ?', [0]);
}
}
/**
* @inheritDoc
*/
public function checkObject(DatabaseObject $object, array $conditionData) {
// don't need it
return true;
}
/**
* @see \wcf\system\condition\ICondition::getData()
*/
public function getData() {
$data = [];
if ($this->hasLabels) $data['hasLabels'] = 1;
if ($this->hasNoLabels) $data['hasNoLabels'] = 1;
if (!empty($data)) {
return $data;
}
return null;
}
/**
* Returns the "checked" attribute for an input element.
*
* @param string $propertyName
* @return string
*/
protected function getCheckedAttribute($propertyName) {
if ($this->$propertyName) {
return ' checked';
}
return '';
}
/**
* @see \wcf\system\condition\AbstractSingleFieldCondition::getFieldElement()
*/
protected function getFieldElement() {
$hasNoLabels = WCF::getLanguage()->get('wcf.acp.uzbot.wbb.condition.label.hasNoLabels');
$hasLabels = WCF::getLanguage()->get('wcf.acp.uzbot.wbb.condition.label.hasLabels');
return << getCheckedAttribute('hasLabels')}> {$hasLabels}
getCheckedAttribute('hasNoLabels')}> {$hasNoLabels}
HTML;
}
/**
* @inheritDoc
*/
public function readFormParameters() {
if (isset($_POST['uzbotHasLabels'])) $this->hasLabels = 1;
if (isset($_POST['uzbotHasNoLabels'])) $this->hasNoLabels = 1;
}
/**
* @see \wcf\system\condition\ICondition::reset()
*/
public function reset() {
$this->hasLabels = 0;
$this->hasNoLabels = 0;
}
/**
* @see \wcf\system\condition\ICondition::setData()
*/
public function setData(Condition $condition) {
if ($condition->hasLabels !== null) {
$this->hasLabels = $condition->hasLabels;
}
if ($condition->hasNoLabels !== null) {
$this->hasNoLabels = $condition->hasNoLabels;
}
}
/**
* @inheritDoc
*/
public function showContent(Condition $condition) {
// don't need it
return null;
}
/**
* @see \wcf\system\condition\ICondition::validate()
*/
public function validate() {
if ($this->hasLabels && $this->hasNoLabels) {
$this->errorMessage = 'wcf.acp.uzbot.wbb.condition.label.error.conflict';
throw new UserInputException('uzbotHasNoLabels', 'conflict');
}
}
}
lib/system/condition/uzbot/UzbotWbbConditionHandler.class.php 0100644 0000000 0000000 00000002412 14167533111 023551 0 ustar 00 0000000 0000000
* @package com.uz.wcf.bot3.wbb
*/
class UzbotWbbConditionHandler extends SingletonFactory {
/**
* list of grouped user group / inactive assignment condition object types
* @var array
*/
protected $groupedObjectTypes = [];
/**
* Returns the list of grouped user group / inactive assignment condition object types.
*
* @return array
*/
public function getGroupedObjectTypes() {
return $this->groupedObjectTypes;
}
/**
* @see \wcf\system\SingletonFactory::init()
*/
protected function init() {
$objectTypes = ObjectTypeCache::getInstance()->getObjectTypes('com.uz.wcf.bot.condition.wbb');
foreach ($objectTypes as $objectType) {
if (!$objectType->conditiongroup) continue;
if (!isset($this->groupedObjectTypes[$objectType->conditiongroup])) {
$this->groupedObjectTypes[$objectType->conditiongroup] = [];
}
$this->groupedObjectTypes[$objectType->conditiongroup][$objectType->objectTypeID] = $objectType;
}
}
}
lib/system/cronjob/UzbotPostTopPosterCronjob.class.php 0100644 0000000 0000000 00000014556 14167533111 022333 0 ustar 00 0000000 0000000
* @package com.uz.wcf.bot3.wbb
*/
class UzbotPostTopPosterCronjob extends AbstractCronjob {
/**
* @see wcf\system\cronjob\ICronjob::execute()
*/
public function execute(Cronjob $cronjob) {
parent::execute($cronjob);
if (!MODULE_UZBOT) return;
// Read all active, valid activity bots, abort if none
$bots = UzbotValidBotCacheBuilder::getInstance()->getData(array('typeDes' => 'wbb_topPoster'));
if (empty($bots)) return;
$defaultLanguage = LanguageFactory::getInstance()->getLanguage(LanguageFactory::getInstance()->getDefaultLanguageID());
// Step through all bots and get top poster
foreach ($bots as $bot) {
// set first next if 0
if (!$bot->topPosterNext) {
$month = date('n');
$year = date('Y');
switch ($bot->topPosterInterval) {
case 1:
$next = strtotime('next Monday');
break;
case 2:
$next = gmmktime(0, 0, 0, $month != 12 ? $month + 1 : 1, 1, $month != 12 ? $year : $year + 1);
break;
case 3:
if ($month >= 10) $next = gmmktime(0, 0, 0, 1, 1, $year + 1);
elseif ($month >= 7) $next = gmmktime(0, 0, 0, 10, 1, $year);
elseif ($month >= 4) $next = gmmktime(0, 0, 0, 7, 1, $year);
else $next = gmmktime(0, 0, 0, 4, 1, $year);
break;
}
$editor = new UzbotEditor($bot);
$editor->update(['topPosterNext' => $next]);
UzbotEditor::resetCache();
$bot->topPosterNext = $next;
}
// leave if time does not match, unless test mode
if (!$bot->testMode) {
if ($bot->topPosterNext > TIME_NOW) continue;
}
// must execute
$end = $bot->topPosterNext;
$month = date('n');
$year = date('Y');
switch ($bot->topPosterInterval) {
case 1:
$start = $end - 7 * 86400;
$next = $end + 7 * 86400;
break;
case 2:
$start = gmmktime(0, 0, 0, $month > 1 ? $month - 1 : 12, 1, $month > 1 ? $year : $year - 1);
$next = gmmktime(0, 0, 0, $month != 12 ? $month + 1 : 1, 1, $month != 12 ? $year : $year + 1);
break;
case 3:
$start = gmmktime(0, 0, 0, $month > 3 ? $month - 3 : 10, 1, $month > 3 ? $year : $year - 1);
if ($month >= 10) $next = gmmktime(0, 0, 0, 1, 1, $year + 1);
elseif ($month >= 7) $next = gmmktime(0, 0, 0, 10, 1, $year);
elseif ($month >= 4) $next = gmmktime(0, 0, 0, 7, 1, $year);
else $next = gmmktime(0, 0, 0, 4, 1, $year);
break;
}
// update bot, unless test mode
if (!$bot->testMode) {
$editor = new UzbotEditor($bot);
$editor->update(['topPosterNext' => $next]);
UzbotEditor::resetCache();
}
// get top poster
$affectedUserIDs = $countToUserID = $placeholders = $userIDs = [];
$rank = 0;
$boardIDs = unserialize($bot->uzbotBoardIDs);
$conditions = $bot->getUserConditions();
if (count($conditions)) {
$userList = new UserList();
foreach ($conditions as $condition) {
$condition->getObjectType()->getProcessor()->addUserCondition($condition, $userList);
}
$userList->readObjects();
$temp = $userList->getObjects();
if (count($temp)) {
foreach ($temp as $user) {
$userIDs[] = $user->userID;
}
}
}
$conditionBuilder = new PreparedStatementConditionBuilder();
$conditionBuilder->add('board.boardID IN (?)', [$boardIDs]);
if (count($userIDs)) $conditionBuilder->add('post.userID IN (?)', [$userIDs]);
else $conditionBuilder->add('post.userID > ?', [0]);
$conditionBuilder->add('post.isDeleted = ?', [0]);
$conditionBuilder->add('post.time > ?', [$start]);
$conditionBuilder->add('post.time < ?', [$end]);
$sql = "SELECT post.userID as topID, COUNT(*) as count
FROM wbb".WCF_N."_post post
LEFT JOIN wbb".WCF_N."_thread thread ON (thread.threadID = post.threadID)
LEFT JOIN wbb".WCF_N."_board board ON (board.boardID = thread.boardID)
".$conditionBuilder."
GROUP BY topID
ORDER BY count DESC";
$statement = WCF::getDB()->prepareStatement($sql, $bot->topPosterCount);
$statement->execute($conditionBuilder->getParameters());
while ($row = $statement->fetchArray()) {
$rank ++;
$affectedUserIDs[] = $row['topID'];
$countToUserID[$row['topID']] = $row['count'];
$placeholders['ranks'][$row['topID']] = $rank;
}
// data
if ($bot->enableLog) {
if (!$bot->testMode) {
UzbotLogEditor::create([
'bot' => $bot,
'count' => count($affectedUserIDs),
'additionalData' => $defaultLanguage->getDynamicVariable('wcf.acp.uzbot.log.user.affected', [
'total' => count($affectedUserIDs),
'userIDs' => implode(', ', $affectedUserIDs)
])
]);
}
else {
$result = $defaultLanguage->getDynamicVariable('wcf.acp.uzbot.log.test', [
'objects' => count($affectedUserIDs),
'users' => count($affectedUserIDs),
'userIDs' => implode(', ', $affectedUserIDs)
]);
if (mb_strlen($result) > 64000) $result = mb_substr($result, 0, 64000) . ' ...';
UzbotLogEditor::create([
'bot' => $bot,
'count' => count($affectedUserIDs),
'testMode' => 1,
'additionalData' => serialize(['', '', $result])
]);
}
}
// notification
if (!count($affectedUserIDs)) continue;
$notify = $bot->checkNotify(true, true);
if ($notify === null) continue;
$placeholders['date-from'] = $placeholders['time-from'] = $start;
$placeholders['date-to'] = $placeholders['time-to'] = $end - 1;
// send to scheduler
$data = [
'bot' => $bot,
'placeholders' => $placeholders,
'affectedUserIDs' => $affectedUserIDs,
'countToUserID' => $countToUserID
];
$job = new NotifyScheduleBackgroundJob($data);
BackgroundQueueHandler::getInstance()->performJob($job);
}
}
}
lib/system/cronjob/UzbotStatsWbbCronjob.class.php 0100644 0000000 0000000 00000015625 14167533111 021255 0 ustar 00 0000000 0000000
* @package com.uz.wcf.bot3.wbb
*/
class UzbotStatsWbbCronjob extends AbstractCronjob {
/**
* @see wcf\system\cronjob\ICronjob::execute()
*/
public function execute(Cronjob $cronjob) {
parent::execute($cronjob);
if (!MODULE_UZBOT) return;
// always create stats
// read data
$statsOld = new UzBotStats(1);
$stats = new UzBotStats(1);
// Make new stats
// Board
$sql = "SELECT COUNT(*) as board,
COALESCE(SUM(isClosed), 0) AS boardClosed,
COALESCE(SUM(isInvisible), 0) AS boardInvisible
FROM wbb".WCF_N."_board";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute();
$row = $statement->fetchArray();
$stats->board = $row['board'];
$stats->boardClosed = $row['boardClosed'];
$stats->boardInvisible = $row['boardInvisible'];
$sql = "SELECT COUNT(*) as total
FROM wbb".WCF_N."_board
WHERE boardType = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([Board::TYPE_CATEGORY]);
$row = $statement->fetchArray();
$stats->boardCategory = $row['total'];
$sql = "SELECT COUNT(*) as total
FROM wbb".WCF_N."_board
WHERE boardType = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([Board::TYPE_LINK]);
$row = $statement->fetchArray();
$stats->boardLink = $row['total'];
// Thread
$sql = "SELECT COUNT(*) as thread,
COALESCE(SUM(isAnnouncement), 0) AS threadAnnouncement,
COALESCE(SUM(polls), 0) AS threadPoll,
COALESCE(SUM(isSticky), 0) AS threadSticky,
COALESCE(SUM(isDisabled), 0) AS threadDisabled,
COALESCE(SUM(isClosed), 0) AS threadClosed,
COALESCE(SUM(isDeleted), 0) AS threadDeleted,
COALESCE(SUM(views), 0) AS threadView
FROM wbb".WCF_N."_thread";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute();
$row = $statement->fetchArray();
$stats->thread = $row['thread'];
$stats->threadAnnouncement = $row['threadAnnouncement'];
$stats->threadPoll = $row['threadPoll'];
$stats->threadSticky = $row['threadSticky'];
$stats->threadDisabled = $row['threadDisabled'];
$stats->threadClosed = $row['threadClosed'];
$stats->threadDeleted = $row['threadDeleted'];
$stats->threadView = $row['threadView'];
// Post
$sql = "SELECT COUNT(postID) as post,
COALESCE(SUM(isDisabled), 0) AS postDisabled,
COALESCE(SUM(isClosed), 0) AS postClosed,
COALESCE(SUM(isDeleted), 0) AS postDeleted,
COALESCE(SUM(editCount), 0) AS postEdit
FROM wbb".WCF_N."_post";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute();
$row = $statement->fetchArray();
$stats->post = $row['post'];
$stats->postDisabled = $row['postDisabled'];
$stats->postClosed = $row['postClosed'];
$stats->postDeleted = $row['postDeleted'];
$stats->postEdit = $row['postEdit'];
// don't update stats here
// Read all active, valid activity bots, abort if none
$bots = UzbotValidBotCacheBuilder::getInstance()->getData(['typeDes' => 'wbb_statistics']);
if (!count($bots)) return;
$result = [
'board' => $stats->board,
'boardOld' => $statsOld->board,
'boardClosed' => $stats->boardClosed,
'boardClosedOld' => $statsOld->boardClosed,
'boardInvisible' => $stats->boardInvisible,
'boardInvisibleOld' => $statsOld->boardInvisible,
'boardCategory' => $stats->boardCategory,
'boardCategoryOld' => $statsOld->boardCategory,
'boardLink' => $stats->boardLink,
'boardLinkOld' => $statsOld->boardLink,
'thread' => $stats->thread,
'threadOld' => $statsOld->thread,
'threadAnnouncement' => $stats->threadAnnouncement,
'threadAnnouncementOld' => $statsOld->threadAnnouncement,
'threadPoll' => $stats->threadPoll,
'threadPollOld' => $statsOld->threadPoll,
'threadSticky' => $stats->threadSticky,
'threadStickyOld' => $statsOld->threadSticky,
'threadDisabled' => $stats->threadDisabled,
'threadDisabledOld' => $statsOld->threadDisabled,
'threadClosed' => $stats->threadClosed,
'threadClosedOld' => $statsOld->threadClosed,
'threadClosed' => $stats->threadClosed,
'threadClosedOld' => $statsOld->threadClosed,
'threadDeleted' => $stats->threadDeleted,
'threadDeletedOld' => $statsOld->threadDeleted,
'threadView' => $stats->threadView,
'threadViewOld' => $statsOld->threadView,
'post' => $stats->post,
'postOld' => $statsOld->post,
'postDisabled' => $stats->postDisabled,
'postDisabledOld' => $statsOld->postDisabled,
'postClosed' => $stats->postClosed,
'postClosedOld' => $statsOld->postClosed,
'postDeleted' => $stats->postDeleted,
'postDeletedOld' => $statsOld->postDeleted,
'postEdit' => $stats->postEdit,
'postEditOld' => $statsOld->postEdit,
];
$placeholders['stats'] = $result;
$placeholders['stats-lang'] = 'wcf.uzbot.wbb.stats';
$placeholders['date-from'] = $statsOld->timeWbb;
$placeholders['time-from'] = $statsOld->timeWbb;
$placeholders['date-to'] = TIME_NOW;
$placeholders['time-to'] = TIME_NOW;
// Step through all bots and get updates
foreach ($bots as $bot) {
// update stats unless test mode
if (!$bot->testMode) {
$editor = new UzbotStatsEditor($stats);
$editor->update([
'board' => $stats->board,
'boardClosed' => $stats->boardClosed,
'boardInvisible' => $stats->boardInvisible,
'boardCategory' => $stats->boardCategory,
'boardLink' => $stats->boardLink,
'thread' => $stats->thread,
'threadAnnouncement' => $stats->threadAnnouncement,
'threadPoll' => $stats->threadPoll,
'threadSticky' => $stats->threadSticky,
'threadDisabled' => $stats->threadDisabled,
'threadClosed' => $stats->threadClosed,
'threadDeleted' => $stats->threadDeleted,
'threadView' => $stats->threadView,
'post' => $stats->post,
'postDisabled' => $stats->postDisabled,
'postClosed' => $stats->postClosed,
'postDeleted' => $stats->postDeleted,
'postEdit' => $stats->postEdit,
'timeWbb' => TIME_NOW
]);
}
// send to scheduler
$notify = $bot->checkNotify(true, true);
if ($notify === null) continue;
$data = [
'bot' => $bot,
'placeholders' => $placeholders,
'affectedUserIDs' => [],
'countToUserID' => []
];
$job = new NotifyScheduleBackgroundJob($data);
BackgroundQueueHandler::getInstance()->performJob($job);
}
}
}
lib/system/cronjob/UzbotThreadModificationCronjob.class.php 0100644 0000000 0000000 00000063245 14210357773 023271 0 ustar 00 0000000 0000000
* @package com.uz.wcf.bot3.wbb
*/
class UzbotThreadModificationCronjob extends AbstractCronjob {
/**
* list with threads to be modified
*/
protected $threadList = null;
// thread limit per action
// made configurable: UZBOT_DATA_LIMIT_THREAD
// const THREAD_LIMIT = 200;
/**
* @see wcf\system\cronjob\ICronjob::execute()
*/
public function execute(Cronjob $cronjob) {
parent::execute($cronjob);
if (!MODULE_UZBOT) return;
// Read all active, valid bots, abort if none
$bots = UzbotValidBotCacheBuilder::getInstance()->getData(array('typeDes' => 'wbb_threadModification'));
if (empty($bots)) return;
$defaultLanguage = LanguageFactory::getInstance()->getLanguage(LanguageFactory::getInstance()->getDefaultLanguageID());
// Step through all bots and get threads to be modified
foreach ($bots as $bot) {
// set data
$modifications = unserialize($bot->wbbThreadModificationData);
$userData = [];
// check executer
$user = new User($modifications['threadModificationExecuterID']);
if (!$user->userID) {
$editor = new UzbotEditor($bot);
$editor->update(['isDisabled' => 1]);
UzbotEditor::resetCache();
if ($bot->enableLog) {
UzbotLogEditor::create([
'bot' => $bot,
'count' => 0,
'status' => 2,
'additionalData' => $defaultLanguage->get('wcf.acp.uzbot.wbb.error.executerInvalid')
]);
}
continue;
}
// change user to fix for some plugin modifying ThreadList :-(
$oldUser = WCF::getUser();
WCF::getSession()->changeUser(new User($modifications['threadModificationExecuterID']), true);
// get all threadIDs matching conditions
$conditions = ConditionHandler::getInstance()->getConditions('com.uz.wcf.bot.condition.wbb', $bot->botID);
$conditionThreadIDs = [];
if (count($conditions)) {
$threadList = new ThreadList();
foreach ($conditions as $condition) {
$condition->getObjectType()->getProcessor()->addObjectListCondition($threadList, $condition->conditionData);
}
$threadList->readObjectIDs();
$conditionThreadIDs = $threadList->getObjectIDs();
if (empty($conditionThreadIDs)) $conditionThreadIDs[] = 0;
}
$conditionCount = count($conditionThreadIDs);
// same for labels
$labelThreadIDs = [];
$useLabels = 0;
$labels = UzbotConditionLabelObjectHandler::getInstance()->getAssignedLabels([$bot->botID], false);
if (!empty($labels)) {
$useLabels = 1;
$labelIDs = [];
foreach ($labels as $temp) {
foreach ($temp as $labelID => $label) {
$labelIDs[] = $labelID;
}
}
$objectType = LabelHandler::getInstance()->getObjectType('com.woltlab.wbb.thread');
$threadList = new ThreadList();
foreach ($labelIDs as $labelID) {
$threadList->getConditionBuilder()->add('thread.threadID IN (SELECT objectID FROM wcf'.WCF_N.'_label_object WHERE objectTypeID = ? AND labelID = ?)', [$objectType->objectTypeID, $labelID]);
}
$threadList->readObjectIDs();
$labelThreadIDs = $threadList->getObjectIDs();
if (empty($labelThreadIDs)) $labelThreadIDs[] = 0;
}
$labelCount = count($labelThreadIDs);
// merge threadIDs
if (!$conditionCount && !$labelCount) { // all threads
$threadList = new ThreadList();
$threadList->readObjectIDs();
$threadIDs = $threadList->getObjectIDs();
}
elseif ($conditionCount && $labelCount) {
$threadIDs = array_intersect($labelThreadIDs, $conditionThreadIDs);
}
else {
$threadIDs = array_merge($labelThreadIDs, $conditionThreadIDs);
}
// if no threads, log and abort
$threadCount = count($threadIDs);
// log found threads (not action)
if ($bot->enableLog) {
if ($threadCount == 1 && isset($threadIDs[0]) && $threadIDs[0] == 0) $count = 0;
else $count = $threadCount;
$result = $defaultLanguage->getDynamicVariable('wcf.acp.uzbot.log.wbb.thread.affected', ['count' => $count]);
if (!$bot->testMode) {
UzbotLogEditor::create([
'bot' => $bot,
'count' => $count,
'additionalData' => $result
]);
}
else {
UzbotLogEditor::create([
'bot' => $bot,
'count' => $count,
'testMode' => 1,
'additionalData' => serialize(['', '', $result])
]);
}
}
// abort if no threads
if ($threadCount == 1 && isset($threadIDs[0]) && $threadIDs[0] == 0) {
// Reset to old user
WCF::getSession()->changeUser($oldUser, true);
continue;
}
// get actionLabelIDs and related data
$actionLabelIDs = [];
$actionLabels = UzbotActionLabelObjectHandler::getInstance()->getAssignedLabels([$bot->botID], false);
if (count($actionLabels)) {
foreach ($actionLabels as $temp) {
foreach ($temp as $label) {
$actionLabelIDs[] = $label->labelID;
}
}
}
$objectType = LabelHandler::getInstance()->getObjectType('com.woltlab.wbb.thread');
$labelObjectTypeID = $objectType->objectTypeID;
// step through threads until at least one thread was modified
$found = 0;
for ($i = 0; $i < $threadCount; $i += UZBOT_DATA_LIMIT_THREAD) {
$ids = array_slice($threadIDs, $i, UZBOT_DATA_LIMIT_THREAD);
// step through action in sequence of add form
if ($modifications['threadModificationEnable']) {
$threadList = new ThreadList();
$threadList->getConditionBuilder()->add('thread.threadID IN (?)', [$ids]);
$threadList->getConditionBuilder()->add('thread.isDisabled = ?', [1]);
$threadList->readObjects();
$threads = $threadList->getObjects();
if (count($threads)) {
$found = 1;
$this->executeBot($bot, $threads, 'enable', $modifications['threadModificationAuthorOnly'], $defaultLanguage);
}
}
if ($modifications['threadModificationDisable']) {
$threadList = new ThreadList();
$threadList->getConditionBuilder()->add('thread.threadID IN (?)', [$ids]);
$threadList->getConditionBuilder()->add('thread.isDisabled = ?', [0]);
$threadList->readObjects();
$threads = $threadList->getObjects();
if (count($threads)) {
$found = 1;
$this->executeBot($bot, $threads, 'disable', $modifications['threadModificationAuthorOnly'], $defaultLanguage);
}
}
if ($modifications['threadModificationDone']) {
$threadList = new ThreadList();
$threadList->getConditionBuilder()->add('thread.threadID IN (?)', [$ids]);
$threadList->getConditionBuilder()->add('thread.isDone = ?', [0]);
$threadList->readObjects();
$threads = $threadList->getObjects();
if (count($threads)) {
$found = 1;
$this->executeBot($bot, $threads, 'markAsDone', $modifications['threadModificationAuthorOnly'], $defaultLanguage);
}
}
if ($modifications['threadModificationUndone']) {
$threadList = new ThreadList();
$threadList->getConditionBuilder()->add('thread.threadID IN (?)', [$ids]);
$threadList->getConditionBuilder()->add('thread.isDone = ?', [1]);
$threadList->readObjects();
$threads = $threadList->getObjects();
if (count($threads)) {
$found = 1;
$this->executeBot($bot, $threads, 'markAsUndone', $modifications['threadModificationAuthorOnly'], $defaultLanguage);
}
}
if (isset($modifications['threadModificationUnannounce'])) {
if ($modifications['threadModificationUnannounce']) {
$threadList = new ThreadList();
$threadList->getConditionBuilder()->add('thread.threadID IN (?)', [$ids]);
$threadList->getConditionBuilder()->add('thread.isAnnouncement = ?', [1]);
$threadList->readObjects();
$threads = $threadList->getObjects();
if (count($threads)) {
$found = 1;
$this->executeBot($bot, $threads, 'unannounce', $modifications['threadModificationAuthorOnly'], $defaultLanguage);
}
}
}
if ($modifications['threadModificationSetLabel']) {
// user wants to delete labels
if (!count($actionLabelIDs)) {
$threadList = new ThreadList();
$threadList->getConditionBuilder()->add('thread.threadID IN (?)', [$ids]);
$threadList->getConditionBuilder()->add('thread.hasLabels = ?', [1]);
$threadList->readObjects();
$threads = $threadList->getObjects();
if (count($threads)) {
$found = 1;
$this->executeBot($bot, $threads, 'deleteLabels', $modifications['threadModificationAuthorOnly'], $defaultLanguage);
}
}
// user wants to add / change labels
else {
// read actual label assignment and get threads to be modified
$assign = $modifyID = [];
$conditionBuilder = new PreparedStatementConditionBuilder();
$conditionBuilder->add('objectTypeID = ?', [$labelObjectTypeID]);
$conditionBuilder->add('objectID IN (?)', [$ids]);
$sql = "SELECT objectID, labelID
FROM wcf".WCF_N."_label_object
".$conditionBuilder;
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditionBuilder->getParameters());
while ($row = $statement->fetchArray()) {
$assign[$row['objectID']][] = $row['labelID'];
}
$modifyID = [];
foreach ($ids as $threadID) {
if (!isset($assign[$threadID])) {
$modifyID[] = $threadID;
continue;
}
if (count($assign[$threadID]) != count($actionLabelIDs)) {
$modifyID[] = $threadID;
continue;
}
if (!empty(array_diff($actionLabelIDs, $assign[$threadID]))) {
$modifyID[] = $threadID;
}
}
if (count($modifyID)) {
$threadList = new ThreadList();
$threadList->getConditionBuilder()->add('thread.threadID IN (?)', [$modifyID]);
$threadList->readObjects();
$threads = $threadList->getObjects();
if (count($threads)) {
$found = 1;
$this->executeBot($bot, $threads, 'setLabels', $modifications['threadModificationAuthorOnly'], $defaultLanguage, $actionLabels);
}
}
}
}
if ($modifications['threadModificationTrash']) {
$threadList = new ThreadList();
$threadList->getConditionBuilder()->add('thread.threadID IN (?)', [$ids]);
$threadList->getConditionBuilder()->add('thread.isDeleted = ?', [0]);
$threadList->readObjects();
$threads = $threadList->getObjects();
if (count($threads)) {
$found = 1;
$this->executeBot($bot, $threads, 'trash', $modifications['threadModificationAuthorOnly'], $defaultLanguage);
}
}
if ($modifications['threadModificationRestore']) {
$threadList = new ThreadList();
$threadList->getConditionBuilder()->add('thread.threadID IN (?)', [$ids]);
$threadList->getConditionBuilder()->add('thread.isDeleted = ?', [1]);
$threadList->readObjects();
$threads = $threadList->getObjects();
if (count($threads)) {
$found = 1;
$this->executeBot($bot, $threads, 'restore', $modifications['threadModificationAuthorOnly'], $defaultLanguage);
}
}
if ($modifications['threadModificationSticky']) {
$threadList = new ThreadList();
$threadList->getConditionBuilder()->add('thread.threadID IN (?)', [$ids]);
$threadList->getConditionBuilder()->add('thread.isSticky = ?', [0]);
$threadList->readObjects();
$threads = $threadList->getObjects();
if (count($threads)) {
$found = 1;
$this->executeBot($bot, $threads, 'sticky', $modifications['threadModificationAuthorOnly'], $defaultLanguage);
}
}
if ($modifications['threadModificationScrape']) {
$threadList = new ThreadList();
$threadList->getConditionBuilder()->add('thread.threadID IN (?)', [$ids]);
$threadList->getConditionBuilder()->add('thread.isSticky = ?', [1]);
$threadList->readObjects();
$threads = $threadList->getObjects();
if (count($threads)) {
$found = 1;
$this->executeBot($bot, $threads, 'scrape', $modifications['threadModificationAuthorOnly'], $defaultLanguage);
}
}
if ($modifications['threadModificationOpen']) {
$threadList = new ThreadList();
$threadList->getConditionBuilder()->add('thread.threadID IN (?)', [$ids]);
$threadList->getConditionBuilder()->add('thread.isClosed = ?', [1]);
$threadList->readObjects();
$threads = $threadList->getObjects();
if (count($threads)) {
$found = 1;
$this->executeBot($bot, $threads, 'open', $modifications['threadModificationAuthorOnly'], $defaultLanguage);
}
}
if ($modifications['threadModificationClose']) {
$threadList = new ThreadList();
$threadList->getConditionBuilder()->add('thread.threadID IN (?)', [$ids]);
$threadList->getConditionBuilder()->add('thread.isClosed = ?', [0]);
$threadList->readObjects();
$threads = $threadList->getObjects();
if (count($threads)) {
$found = 1;
$this->executeBot($bot, $threads, 'close', $modifications['threadModificationAuthorOnly'], $defaultLanguage);
}
}
if ($modifications['threadModificationMove']) {
$threadList = new ThreadList();
$threadList->getConditionBuilder()->add('thread.threadID IN (?)', [$ids]);
$threadList->getConditionBuilder()->add('thread.boardID <> ?', [$modifications['threadModificationBoardID']]);
$threadList->readObjects();
$threads = $threadList->getObjects();
if (count($threads)) {
$found = 1;
$this->executeBot($bot, $threads, 'move', $modifications['threadModificationAuthorOnly'], $defaultLanguage);
}
}
// break if thread was found
if ($found) break;
}
// Reset to old user
WCF::getSession()->changeUser($oldUser, true);
}
}
protected function executeBot($bot, $threads, $action, $authorOnly, $defaultLanguage, $labels = []) {
$affectedUserIDs = $countToUserID = $placeholders = $threadIDs = $threadToUser = [];
if (!count($threads)) {
if ($bot->enableLog) {
if (!$bot->testMode) {
UzbotLogEditor::create([
'bot' => $bot,
'count' => 0,
'additionalData' => $defaultLanguage->getDynamicVariable('wcf.acp.uzbot.log.wbb.thread.modified', [
'action' => $defaultLanguage->get('wcf.acp.uzbot.wbb.threadModification.action.' . $action),
'threadIDs' => ''
])
]);
UzbotLogEditor::create([
'bot' => $bot,
'count' => count($affectedUserIDs),
'additionalData' => $defaultLanguage->getDynamicVariable('wcf.acp.uzbot.log.user.affected', [
'total' => 0,
'userIDs' => ''
])
]);
}
else {
$result = $defaultLanguage->getDynamicVariable('wcf.acp.uzbot.log.test', [
'objects' => 0,
'users' => 0,
'userIDs' => ''
]);
if (mb_strlen($result) > 64000) $result = mb_substr($result, 0, 64000) . ' ...';
UzbotLogEditor::create([
'bot' => $bot,
'count' => count($threadIDs),
'testMode' => 1,
'additionalData' => serialize(['', '', $result])
]);
}
}
return;
}
foreach ($threads as $thread) {
$threadIDs[] = $thread->threadID;
if ($authorOnly) {
if (!$thread->userID) continue;
$threadToUser[$thread->threadID] = $thread->userID;
$affectedUserIDs[] = $thread->userID;
if (isset($countToUserID[$thread->userID])) $countToUserID[$thread->userID] ++;
else $countToUserID[$thread->userID] = 1;
}
else {
$postList = new PostList();
$postList->getConditionBuilder()->add('post.threadID = ?', [$thread->threadID]);
$postList->getConditionBuilder()->add('post.userID > ?', [0]);
// $postList->getConditionBuilder()->add('post.isDeleted = ?', [0]);
// $postList->getConditionBuilder()->add('post.isDisabled = ?', [0]);
$postList->readObjects();
$posts = $postList->getObjects();
foreach ($posts as $post) {
$affectedUserIDs[] = $post->userID;
if (isset($countToUserID[$post->userID])) $countToUserID[$post->userID] ++;
else $countToUserID[$post->userID] = 1;
}
}
}
$affectedUserIDs = array_unique($affectedUserIDs);
// change user for action + execute unless test mode
if (!$bot->testMode) {
if ($action != 'setLabels' && $action != 'deleteLabels' && $action != 'move' && $action != 'unannounce') {
$threadAction = new ThreadAction($threads, $action);
$threadAction->executeAction();
}
else if ($action == 'move') {
$modifications = unserialize($bot->wbbThreadModificationData);
$threadAction = new ThreadAction($threads, 'move', [
'boardID' => $modifications['threadModificationBoardID'],
'isBulkProcessing' => false,
'showMoveNotice' => false
]);
$threadAction->executeAction();
}
else if ($action == 'unannounce') {
$threadAction = new ThreadAction($threads, 'update', [
'data' => ['isAnnouncement' => 0],
'announcementBoardIDs' => [],
'isBulkProcessing' => false
]);
$threadAction->executeAction();
}
else {
// label object type
$objectType = LabelHandler::getInstance()->getObjectType('com.woltlab.wbb.thread');
$objectTypeID = $objectType->objectTypeID;
// delete ...
if ($action == 'deleteLabels') {
$objectTypeID = LabelHandler::getInstance()->getObjectType('com.woltlab.wbb.thread')->objectTypeID;
$oldLabels = LabelHandler::getInstance()->getAssignedLabels($objectTypeID, $threadIDs, false);
// remove labels
foreach ($threads as $thread) {
LabelHandler::getInstance()->setLabels([], $objectTypeID, $thread->threadID, false);
// update hasLabels flag
$editor = new ThreadEditor($thread);
$editor->update(['hasLabels' => 0]);
}
$assignedLabels = LabelHandler::getInstance()->getAssignedLabels($objectTypeID, $threadIDs, false);
$labelList = null;
// clear log
WCF::getDB()->beginTransaction();
foreach ($threads as $thread) {
$groupedOldLabels = [];
if (!empty($oldLabels[$thread->threadID])) {
foreach ($oldLabels[$thread->threadID] as $oldLabel) {
$groupedOldLabels[$oldLabel->groupID] = $oldLabel;
}
}
if ($labelList !== null) {
foreach ($labelList as $label) {
if (!isset($groupedOldLabels[$label->groupID]) || $label->labelID != $groupedOldLabels[$label->groupID]->labelID) {
ThreadModificationLogHandler::getInstance()->setLabel($thread, $label, (isset($groupedOldLabels[$label->groupID]) ? $groupedOldLabels[$label->groupID] : null));
}
if (isset($groupedOldLabels[$label->groupID])) unset($groupedOldLabels[$label->groupID]);
}
}
foreach ($groupedOldLabels as $groupID => $label) {
ThreadModificationLogHandler::getInstance()->setLabel($thread, null, $label);
}
}
WCF::getDB()->commitTransaction();
}
// set ...
if ($action == 'setLabels') {
foreach ($labels as $temp) {
foreach ($temp as $label) {
$labelIDs[] = $label->labelID;
}
}
$botLabels = $labels;
$botLabelIDs = $labelIDs;
// almost same as above
$objectTypeID = LabelHandler::getInstance()->getObjectType('com.woltlab.wbb.thread')->objectTypeID;
$oldLabels = LabelHandler::getInstance()->getAssignedLabels($objectTypeID, $threadIDs, false);
foreach ($threads as $thread) {
LabelHandler::getInstance()->setLabels($botLabelIDs, $objectTypeID, $thread->threadID, false);
$editor = new ThreadEditor($thread);
$editor->update(['hasLabels' => !empty($botLabelIDs) ? 1 : 0]);
}
$assignedLabels = LabelHandler::getInstance()->getAssignedLabels($objectTypeID, $threadIDs, false);
$labelList = null;
if (!empty($assignedLabels)) {
$labelList = reset($assignedLabels);
}
// log changes
WCF::getDB()->beginTransaction();
foreach ($threads as $thread) {
$groupedOldLabels = [];
if (!empty($oldLabels[$thread->threadID])) {
foreach ($oldLabels[$thread->threadID] as $oldLabel) {
$groupedOldLabels[$oldLabel->groupID] = $oldLabel;
}
}
if ($labelList !== null) {
foreach ($labelList as $label) {
if (!isset($groupedOldLabels[$label->groupID]) || $label->labelID != $groupedOldLabels[$label->groupID]->labelID) {
ThreadModificationLogHandler::getInstance()->setLabel($thread, $label, (isset($groupedOldLabels[$label->groupID]) ? $groupedOldLabels[$label->groupID] : null));
}
if (isset($groupedOldLabels[$label->groupID])) unset($groupedOldLabels[$label->groupID]);
}
}
foreach ($groupedOldLabels as $groupID => $label) {
ThreadModificationLogHandler::getInstance()->setLabel($thread, null, $label);
}
}
WCF::getDB()->commitTransaction();
}
}
}
if ($bot->enableLog) {
$result1 = $defaultLanguage->getDynamicVariable('wcf.acp.uzbot.log.wbb.thread.modified', [
'action' => $defaultLanguage->get('wcf.acp.uzbot.wbb.threadModification.action.' . $action),
'threadIDs' => implode(', ', $threadIDs)
]);
if (mb_strlen($result1) > 64000) $result1 = mb_substr($result1, 0, 64000) . ' ...';
$result2 = $defaultLanguage->getDynamicVariable('wcf.acp.uzbot.log.user.affected', [
'total' => count($affectedUserIDs),
'userIDs' => implode(', ', $affectedUserIDs)
]);
if (mb_strlen($result2) > 64000) $result2 = mb_substr($result2, 0, 64000) . ' ...';
UzbotLogEditor::create([
'bot' => $bot,
'testMode' => !$bot->testMode ? 0 : 1,
'count' => count($threadIDs),
'additionalData' => !$bot->testMode ? $result1 : serialize(['', '', $result1])
]);
UzbotLogEditor::create([
'bot' => $bot,
'testMode' => !$bot->testMode ? 0 : 1,
'count' => count($affectedUserIDs),
'additionalData' => !$bot->testMode ? $result2 : serialize(['', '', $result2])
]);
}
// check for and prepare notification
if ($bot->notifyID) {
$notify = $bot->checkNotify(true, true);
if ($notify === null) return;
$placeholders['count'] = count($threadIDs);
$placeholders['object-ids'] = implode(', ', $threadIDs);
$placeholders['action'] = $defaultLanguage->get('wcf.acp.uzbot.wbb.threadModification.action.' . $action);
// test mode
$testUserIDs = $testToUserIDs = [];
if (count($affectedUserIDs)) {
$userID = reset($affectedUserIDs);
$testUserIDs[] = $userID;
$testToUserIDs[$userID] = $countToUserID[$userID];
}
// send to scheduler, if not test mode
if ($bot->testMode) {
// only one notification
$data = [
'bot' => $bot,
'placeholders' => $placeholders,
'affectedUserIDs' => !$bot->testMode ? $affectedUserIDs : $testUserIDs,
'countToUserID' => !$bot->testMode ? $countToUserID : $testToUserIDs
];
$job = new NotifyScheduleBackgroundJob($data);
BackgroundQueueHandler::getInstance()->performJob($job);
}
else {
// not post - only one
if ($bot->notifyDes != 'post') {
$data = [
'bot' => $bot,
'placeholders' => $placeholders,
'affectedUserIDs' => !$bot->testMode ? $affectedUserIDs : $testUserIDs,
'countToUserID' => !$bot->testMode ? $countToUserID : $testToUserIDs
];
$job = new NotifyScheduleBackgroundJob($data);
BackgroundQueueHandler::getInstance()->performJob($job);
}
else {
$wbbPostData = unserialize($bot->wbbPostData);
// threadID given - only one
if ($wbbPostData['postNotifyThreadID']) {
$data = [
'bot' => $bot,
'placeholders' => $placeholders,
'affectedUserIDs' => !$bot->testMode ? $affectedUserIDs : $testUserIDs,
'countToUserID' => !$bot->testMode ? $countToUserID : $testToUserIDs
];
$job = new NotifyScheduleBackgroundJob($data);
BackgroundQueueHandler::getInstance()->performJob($job);
}
// threadID = 0 - one post in each thread
else {
// there must be threads
if (count($threadIDs)) {
// preset
$data = [
'bot' => $bot,
'placeholders' => $placeholders,
'affectedUserIDs' => !$bot->testMode ? $affectedUserIDs : $testUserIDs,
'countToUserID' => !$bot->testMode ? $countToUserID : $testToUserIDs
];
foreach ($threadIDs as $threadID) {
$bot->threadID = $threadID;
// limit affected user to one if author only
if ($authorOnly && !$bot->testMode) {
$affectedUserIDs = $countToUserID = [];
$affectedUserIDs[] = $threadToUser[$threadID];
$countToUserID[$threadToUser[$threadID]] = 1;
$data = [
'bot' => $bot,
'placeholders' => $placeholders,
'affectedUserIDs' => $affectedUserIDs,
'countToUserID' => $countToUserID
];
}
else {
$data['bot'] = $bot;
}
$job = new NotifyScheduleBackgroundJob($data);
BackgroundQueueHandler::getInstance()->performJob($job);
}
}
}
}
}
}
}
}
lib/system/event/listener/UzbotAddFormWbbListener.class.php 0100644 0000000 0000000 00000103257 14167533111 023175 0 ustar 00 0000000 0000000
* @package com.uz.wcf.bot3.wbb
*/
class UzbotAddFormWbbListener implements IParameterizedEventListener {
/**
* instance of UzbotAddForm
*/
protected $eventObj;
/**
* general data
*/
protected $boardNodeList;
/**
* thread and post data
*/
protected $threadNotifyBoardID = 0;
protected $threadNotifyDelayed = 0;
protected $threadNotifyIsClosed = 0;
protected $threadNotifyIsDisabled = 0;
protected $threadNotifyIsDone = 0;
protected $threadNotifyIsSticky = 0;
protected $postNotifyThreadID = 0;
protected $postNotifyIsClosed = 0;
protected $postNotifyIsDisabled = 0;
protected $wbbThreadModerationData = 0;
protected $threadModerationAuthorOnly = 0;
protected $threadModerationChangeTopic = 0;
protected $threadModerationClose = 0;
protected $threadModerationDisable = 0;
protected $threadModerationDone = 0;
protected $threadModerationEnable = 0;
protected $threadModerationMerge = 0;
protected $threadModerationMove = 0;
protected $threadModerationOpen = 0;
protected $threadModerationRestore = 0;
protected $threadModerationScrape = 0;
protected $threadModerationSetAsAnnouncement = 0;
protected $threadModerationSetLabel = 0;
protected $threadModerationSticky = 0;
protected $threadModerationTrash = 0;
protected $threadModerationUndone = 0;
protected $threadModerationUnsetAsAnnouncement = 0;
protected $wbbThreadModificationData = 0;
protected $threadModificationAuthorOnly = 0;
protected $threadModificationBoardID = 0;
protected $threadModificationExecuter = '';
protected $threadModificationExecuterID = 0;
protected $threadModificationClose = 0;
protected $threadModificationDisable = 0;
protected $threadModificationDone = 0;
protected $threadModificationEnable = 0;
protected $threadModificationMove = 0;
protected $threadModificationOpen = 0;
protected $threadModificationRestore = 0;
protected $threadModificationScrape = 0;
protected $threadModificationSetLabel = 0;
protected $threadModificationSticky = 0;
protected $threadModificationTrash = 0;
protected $threadModificationUndone = 0;
protected $threadModificationUnannounce = 0;
protected $wbbPostModerationData = 0;
protected $postModerationClose = 0;
protected $postModerationDelete = 0;
protected $postModerationDisable = 0;
protected $postModerationEdit = 0;
protected $postModerationEnable = 0;
protected $postModerationMerge = 0;
protected $postModerationMove = 0;
protected $postModerationOpen = 0;
protected $postModerationRestore = 0;
protected $postModerationTrash = 0;
/**
* further bot data
*/
protected $postCountAction = 'postTotal';
protected $topPosterCount = 1;
protected $topPosterInterval = 1;
protected $threadNewBoardIDs = [];
protected $uzbotBoardIDs = [];
protected $postIsOfficial = 0;
protected $threadIsOfficial = 0;
/**
* postChange switches
*/
protected $postChangeUpdate = 1;
protected $postChangeDelete = 1;
/**
* condition data
*/
public $wbbConditions = [];
/**
* @inheritDoc
*/
public function execute($eventObj, $className, $eventName, array &$parameters) {
$this->eventObj = $eventObj;
$this->$eventName();
}
/**
* Handles the readData event. Only in UzbotEdit!
*/
protected function readData() {
if (empty($_POST)) {
if (!empty($this->eventObj->uzbot->wbbThreadData)) {
$wbbThreadData = unserialize($this->eventObj->uzbot->wbbThreadData);
$this->threadNotifyBoardID = $wbbThreadData['threadNotifyBoardID'];
$this->threadNotifyDelayed = $wbbThreadData['threadNotifyDelayed'];
$this->threadNotifyIsClosed = $wbbThreadData['threadNotifyIsClosed'];
$this->threadNotifyIsDisabled = $wbbThreadData['threadNotifyIsDisabled'];
$this->threadNotifyIsDone = $wbbThreadData['threadNotifyIsDone'];
$this->threadNotifyIsSticky = $wbbThreadData['threadNotifyIsSticky'];
}
if (!empty($this->eventObj->uzbot->wbbPostData)) {
$wbbPostData = unserialize($this->eventObj->uzbot->wbbPostData);
$this->postNotifyThreadID = $wbbPostData['postNotifyThreadID'];
$this->postNotifyIsClosed = $wbbPostData['postNotifyIsClosed'];
$this->postNotifyIsDisabled = $wbbPostData['postNotifyIsDisabled'];
}
if (!empty($this->eventObj->uzbot->wbbThreadModerationData)) {
$wbbThreadModerationData = unserialize($this->eventObj->uzbot->wbbThreadModerationData);
$this->threadModerationAuthorOnly = $wbbThreadModerationData['threadModerationAuthorOnly'];
$this->threadModerationChangeTopic = $wbbThreadModerationData['threadModerationChangeTopic'];
$this->threadModerationClose = $wbbThreadModerationData['threadModerationClose'];
$this->threadModerationDisable = $wbbThreadModerationData['threadModerationDisable'];
$this->threadModerationDone = $wbbThreadModerationData['threadModerationDone'];
$this->threadModerationEnable = $wbbThreadModerationData['threadModerationEnable'];
$this->threadModerationMerge = $wbbThreadModerationData['threadModerationMerge'];
$this->threadModerationMove = $wbbThreadModerationData['threadModerationMove'];
$this->threadModerationOpen = $wbbThreadModerationData['threadModerationOpen'];
$this->threadModerationRestore = $wbbThreadModerationData['threadModerationRestore'];
$this->threadModerationScrape = $wbbThreadModerationData['threadModerationScrape'];
$this->threadModerationSetAsAnnouncement = $wbbThreadModerationData['threadModerationSetAsAnnouncement'];
$this->threadModerationSetLabel = $wbbThreadModerationData['threadModerationSetLabel'];
$this->threadModerationSticky = $wbbThreadModerationData['threadModerationSticky'];
$this->threadModerationTrash = $wbbThreadModerationData['threadModerationTrash'];
$this->threadModerationUndone = $wbbThreadModerationData['threadModerationUndone'];
$this->threadModerationUnsetAsAnnouncement = $wbbThreadModerationData['threadModerationUnsetAsAnnouncement'];
}
if (!empty($this->eventObj->uzbot->wbbThreadModificationData)) {
$wbbThreadModificationData = unserialize($this->eventObj->uzbot->wbbThreadModificationData);
$this->threadModificationAuthorOnly = $wbbThreadModificationData['threadModificationAuthorOnly'];
$this->threadModificationBoardID = $wbbThreadModificationData['threadModificationBoardID'];
$this->threadModificationExecuter = $wbbThreadModificationData['threadModificationExecuter'];
$this->threadModificationExecuterID = $wbbThreadModificationData['threadModificationExecuterID'];
$this->threadModificationClose = $wbbThreadModificationData['threadModificationClose'];
$this->threadModificationDisable = $wbbThreadModificationData['threadModificationDisable'];
$this->threadModificationDone = $wbbThreadModificationData['threadModificationDone'];
$this->threadModificationEnable = $wbbThreadModificationData['threadModificationEnable'];
$this->threadModificationMove = $wbbThreadModificationData['threadModificationMove'];
$this->threadModificationOpen = $wbbThreadModificationData['threadModificationOpen'];
$this->threadModificationRestore = $wbbThreadModificationData['threadModificationRestore'];
$this->threadModificationScrape = $wbbThreadModificationData['threadModificationScrape'];
$this->threadModificationSetLabel = $wbbThreadModificationData['threadModificationSetLabel'];
$this->threadModificationSticky = $wbbThreadModificationData['threadModificationSticky'];
$this->threadModificationTrash = $wbbThreadModificationData['threadModificationTrash'];
$this->threadModificationUndone = $wbbThreadModificationData['threadModificationUndone'];
if (isset($wbbThreadModificationData['threadModificationUnannounce'])) {
$this->threadModificationUnannounce = $wbbThreadModificationData['threadModificationUnannounce'];
}
}
if (!empty($this->eventObj->uzbot->wbbPostModerationData)) {
$wbbPostModerationData = unserialize($this->eventObj->uzbot->wbbPostModerationData);
$this->postModerationClose = $wbbPostModerationData['postModerationClose'];
$this->postModerationDelete = $wbbPostModerationData['postModerationDelete'];
$this->postModerationDisable = $wbbPostModerationData['postModerationDisable'];
$this->postModerationEdit = $wbbPostModerationData['postModerationEdit'];
$this->postModerationEnable = $wbbPostModerationData['postModerationEnable'];
$this->postModerationMerge = $wbbPostModerationData['postModerationMerge'];
$this->postModerationMove = $wbbPostModerationData['postModerationMove'];
$this->postModerationOpen = $wbbPostModerationData['postModerationOpen'];
$this->postModerationRestore = $wbbPostModerationData['postModerationRestore'];
$this->postModerationTrash = $wbbPostModerationData['postModerationTrash'];
}
$this->postCountAction = $this->eventObj->uzbot->postCountAction;
$this->topPosterCount = $this->eventObj->uzbot->topPosterCount;
$this->topPosterInterval = $this->eventObj->uzbot->topPosterInterval;
$this->postIsOfficial = $this->eventObj->uzbot->postIsOfficial;
$this->threadIsOfficial = $this->eventObj->uzbot->threadIsOfficial;
$this->postChangeUpdate = $this->eventObj->uzbot->postChangeUpdate;
$this->postChangeDelete = $this->eventObj->uzbot->postChangeDelete;
$this->threadNewBoardIDs = [];
if (!empty($this->eventObj->uzbot->threadNewBoardIDs)) {
$this->threadNewBoardIDs = unserialize($this->eventObj->uzbot->threadNewBoardIDs);
}
$this->uzbotBoardIDs = [];
if (!empty($this->eventObj->uzbot->uzbotBoardIDs)) {
$this->uzbotBoardIDs = unserialize($this->eventObj->uzbot->uzbotBoardIDs);
}
// conditions
$this->wbbConditions = UzbotWbbConditionHandler::getInstance()->getGroupedObjectTypes();
$conditions = ConditionHandler::getInstance()->getConditions('com.uz.wcf.bot.condition.wbb', $this->eventObj->botID);
foreach ($conditions as $condition) {
$this->wbbConditions[$condition->getObjectType()->conditiongroup][$condition->objectTypeID]->getProcessor()->setData($condition);
}
}
}
/**
* Handles the assignVariables event.
*/
protected function assignVariables() {
$this->boardNodeList = new RealtimeBoardNodeList();
$this->boardNodeList->readNodeTree();
$this->wbbConditions = UzbotWbbConditionHandler::getInstance()->getGroupedObjectTypes();
WCF::getTPL()->assign([
'boardNodeList' => $this->boardNodeList->getNodeList(),
'threadNotifyBoardID' => $this->threadNotifyBoardID,
'threadNotifyDelayed' => $this->threadNotifyDelayed,
'threadNotifyIsClosed' => $this->threadNotifyIsClosed,
'threadNotifyIsDisabled' => $this->threadNotifyIsDisabled,
'threadNotifyIsDone' => $this->threadNotifyIsDone,
'threadNotifyIsSticky' => $this->threadNotifyIsSticky,
'postNotifyThreadID' => $this->postNotifyThreadID,
'postNotifyIsClosed' => $this->postNotifyIsClosed,
'postNotifyIsDisabled' => $this->postNotifyIsDisabled,
'postCountAction' => $this->postCountAction,
'topPosterCount' => $this->topPosterCount,
'topPosterInterval' => $this->topPosterInterval,
'threadNewBoardIDs' => $this->threadNewBoardIDs,
'uzbotBoardIDs' => $this->uzbotBoardIDs,
'postIsOfficial' => $this->postIsOfficial,
'threadIsOfficial' => $this->threadIsOfficial,
'postChangeUpdate' => $this->postChangeUpdate,
'postChangeDelete' => $this->postChangeDelete,
'threadModerationAuthorOnly' => $this->threadModerationAuthorOnly,
'threadModerationChangeTopic' => $this->threadModerationChangeTopic,
'threadModerationClose' => $this->threadModerationClose,
'threadModerationDisable' => $this->threadModerationDisable,
'threadModerationDone' => $this->threadModerationDone,
'threadModerationEnable' => $this->threadModerationEnable,
'threadModerationMerge' => $this->threadModerationMerge,
'threadModerationMove' => $this->threadModerationMove,
'threadModerationOpen' => $this->threadModerationOpen,
'threadModerationRestore' => $this->threadModerationRestore,
'threadModerationScrape' => $this->threadModerationScrape,
'threadModerationSetAsAnnouncement' => $this->threadModerationSetAsAnnouncement,
'threadModerationSetLabel' => $this->threadModerationSetLabel,
'threadModerationSticky' => $this->threadModerationSticky,
'threadModerationTrash' => $this->threadModerationTrash,
'threadModerationUndone' => $this->threadModerationUndone,
'threadModerationUnsetAsAnnouncement' => $this->threadModerationUnsetAsAnnouncement,
'threadModificationAuthorOnly' => $this->threadModificationAuthorOnly,
'threadModificationBoardID' => $this->threadModificationBoardID,
'threadModificationExecuter' => $this->threadModificationExecuter,
'threadModificationExecuterID' => $this->threadModificationExecuterID,
'threadModificationClose' => $this->threadModificationClose,
'threadModificationDisable' => $this->threadModificationDisable,
'threadModificationDone' => $this->threadModificationDone,
'threadModificationEnable' => $this->threadModificationEnable,
'threadModificationMove' => $this->threadModificationMove,
'threadModificationOpen' => $this->threadModificationOpen,
'threadModificationRestore' => $this->threadModificationRestore,
'threadModificationScrape' => $this->threadModificationScrape,
'threadModificationSetLabel' => $this->threadModificationSetLabel,
'threadModificationSticky' => $this->threadModificationSticky,
'threadModificationTrash' => $this->threadModificationTrash,
'threadModificationUndone' => $this->threadModificationUndone,
'threadModificationUnannounce' => $this->threadModificationUnannounce,
'postModerationClose' => $this->postModerationClose,
'postModerationDelete' => $this->postModerationDelete,
'postModerationDisable' => $this->postModerationDisable,
'postModerationEdit' => $this->postModerationEdit,
'postModerationEnable' => $this->postModerationEnable,
'postModerationMerge' => $this->postModerationMerge,
'postModerationMove' => $this->postModerationMove,
'postModerationOpen' => $this->postModerationOpen,
'postModerationRestore' => $this->postModerationRestore,
'postModerationTrash' => $this->postModerationTrash,
'wbbConditions' => $this->wbbConditions
]);
}
/**
* Handles the readFormParameters event.
*/
protected function readFormParameters() {
if (isset($_POST['threadNotifyBoardID'])) $this->threadNotifyBoardID = intval($_POST['threadNotifyBoardID']);
$this->threadNotifyDelayed = $this->threadNotifyIsClosed = $this->threadNotifyIsDisabled = 0;
$this->threadNotifyIsDone = $this->threadNotifyIsSticky = 0;
if (isset($_POST['threadNotifyDelayed'])) $this->threadNotifyDelayed = intval($_POST['threadNotifyDelayed']);
if (isset($_POST['threadNotifyIsClosed'])) $this->threadNotifyIsClosed = intval($_POST['threadNotifyIsClosed']);
if (isset($_POST['threadNotifyIsDisabled'])) $this->threadNotifyIsDisabled = intval($_POST['threadNotifyIsDisabled']);
if (isset($_POST['threadNotifyIsDone'])) $this->threadNotifyIsDone = intval($_POST['threadNotifyIsDone']);
if (isset($_POST['threadNotifyIsSticky'])) $this->threadNotifyIsSticky = intval($_POST['threadNotifyIsSticky']);
$this->postNotifyIsClosed = $this->postNotifyIsDisabled = 0;
if (isset($_POST['postNotifyThreadID'])) $this->postNotifyThreadID = intval($_POST['postNotifyThreadID']);
if (isset($_POST['postNotifyIsClosed'])) $this->postNotifyIsClosed = intval($_POST['postNotifyIsClosed']);
if (isset($_POST['postNotifyIsDisabled'])) $this->postNotifyIsDisabled = intval($_POST['postNotifyIsDisabled']);
if (isset($_POST['postCountAction'])) $this->postCountAction = StringUtil::trim($_POST['postCountAction']);
if (isset($_POST['topPosterCount'])) $this->topPosterCount = intval($_POST['topPosterCount']);
if (isset($_POST['topPosterInterval'])) $this->topPosterInterval = intval($_POST['topPosterInterval']);
if (isset($_POST['threadNewBoardIDs']) && is_array($_POST['threadNewBoardIDs'])) $this->threadNewBoardIDs = ArrayUtil::toIntegerArray($_POST['threadNewBoardIDs']);
if (isset($_POST['uzbotBoardIDs']) && is_array($_POST['uzbotBoardIDs'])) $this->uzbotBoardIDs = ArrayUtil::toIntegerArray($_POST['uzbotBoardIDs']);
$this->postIsOfficial = $this->threadIsOfficial= 0;
if (isset($_POST['postIsOfficial'])) $this->postIsOfficial = intval($_POST['postIsOfficial']);
if (isset($_POST['threadIsOfficial'])) $this->threadIsOfficial = intval($_POST['threadIsOfficial']);
$this->postChangeUpdate = $this->postChangeDelete = 0;
if (isset($_POST['postChangeUpdate'])) $this->postChangeUpdate = intval($_POST['postChangeUpdate']);
if (isset($_POST['postChangeDelete'])) $this->postChangeDelete = intval($_POST['postChangeDelete']);
$this->threadModerationChangeTopic = $this->threadModerationClose = $this->threadModerationDisable = 0;
$this->threadModerationDone = $this->threadModerationEnable = $this->threadModerationMerge = $this->threadModerationMove = $this->threadModerationOpen = 0;
$this->threadModerationRestore = $this->threadModerationScrape = $this->threadModerationSetAsAnnouncement = $this->threadModerationSetLabel = 0;
$this->threadModerationSticky = $this->threadModerationTrash = $this->threadModerationUndone = $this->threadModerationAuthorOnly = 0;
if (isset($_POST['threadModerationAuthorOnly'])) $this->threadModerationAuthorOnly = intval($_POST['threadModerationAuthorOnly']);
if (isset($_POST['threadModerationChangeTopic'])) $this->threadModerationChangeTopic = intval($_POST['threadModerationChangeTopic']);
if (isset($_POST['threadModerationClose'])) $this->threadModerationClose = intval($_POST['threadModerationClose']);
if (isset($_POST['threadModerationDisable'])) $this->threadModerationDisable = intval($_POST['threadModerationDisable']);
if (isset($_POST['threadModerationDone'])) $this->threadModerationDone = intval($_POST['threadModerationDone']);
if (isset($_POST['threadModerationEnable'])) $this->threadModerationEnable = intval($_POST['threadModerationEnable']);
if (isset($_POST['threadModerationMerge'])) $this->threadModerationMerge = intval($_POST['threadModerationMerge']);
if (isset($_POST['threadModerationMove'])) $this->threadModerationMove = intval($_POST['threadModerationMove']);
if (isset($_POST['threadModerationOpen'])) $this->threadModerationOpen = intval($_POST['threadModerationOpen']);
if (isset($_POST['threadModerationRestore'])) $this->threadModerationRestore = intval($_POST['threadModerationRestore']);
if (isset($_POST['threadModerationScrape'])) $this->threadModerationScrape = intval($_POST['threadModerationScrape']);
if (isset($_POST['threadModerationSetAsAnnouncement'])) $this->threadModerationSetAsAnnouncement = intval($_POST['threadModerationSetAsAnnouncement']);
if (isset($_POST['threadModerationSetLabel'])) $this->threadModerationSetLabel = intval($_POST['threadModerationSetLabel']);
if (isset($_POST['threadModerationSticky'])) $this->threadModerationSticky = intval($_POST['threadModerationSticky']);
if (isset($_POST['threadModerationTrash'])) $this->threadModerationTrash = intval($_POST['threadModerationTrash']);
if (isset($_POST['threadModerationUndone'])) $this->threadModerationUndone = intval($_POST['threadModerationUndone']);
if (isset($_POST['threadModerationUnsetAsAnnouncement'])) $this->threadModerationUnsetAsAnnouncement = intval($_POST['threadModerationUnsetAsAnnouncement']);
$this->threadModificationClose = $this->threadModificationDisable = 0;
$this->threadModificationDone = $this->threadModificationEnable = $this->threadModificationMove = $this->threadModificationOpen = 0;
$this->threadModificationRestore = $this->threadModificationScrape = $this->threadModificationSetLabel = 0;
$this->threadModificationSticky = $this->threadModificationTrash = $this->threadModificationUndone = $this->threadModificationUnannounce = $this->threadModificationAuthorOnly = 0;
if (isset($_POST['threadModificationAuthorOnly'])) $this->threadModificationAuthorOnly = intval($_POST['threadModificationAuthorOnly']);
if (isset($_POST['threadModificationBoardID'])) $this->threadModificationBoardID = intval($_POST['threadModificationBoardID']);
if (isset($_POST['threadModificationExecuter'])) $this->threadModificationExecuter = StringUtil::trim($_POST['threadModificationExecuter']);
if (isset($_POST['threadModificationExecuterID'])) $this->threadModificationExecuterID = intval($_POST['threadModificationExecuterID']);
if (isset($_POST['threadModificationClose'])) $this->threadModificationClose = intval($_POST['threadModificationClose']);
if (isset($_POST['threadModificationDisable'])) $this->threadModificationDisable = intval($_POST['threadModificationDisable']);
if (isset($_POST['threadModificationDone'])) $this->threadModificationDone = intval($_POST['threadModificationDone']);
if (isset($_POST['threadModificationEnable'])) $this->threadModificationEnable = intval($_POST['threadModificationEnable']);
if (isset($_POST['threadModificationMove'])) $this->threadModificationMove = intval($_POST['threadModificationMove']);
if (isset($_POST['threadModificationOpen'])) $this->threadModificationOpen = intval($_POST['threadModificationOpen']);
if (isset($_POST['threadModificationRestore'])) $this->threadModificationRestore = intval($_POST['threadModificationRestore']);
if (isset($_POST['threadModificationScrape'])) $this->threadModificationScrape = intval($_POST['threadModificationScrape']);
if (isset($_POST['threadModificationSetLabel'])) $this->threadModificationSetLabel = intval($_POST['threadModificationSetLabel']);
if (isset($_POST['threadModificationSticky'])) $this->threadModificationSticky = intval($_POST['threadModificationSticky']);
if (isset($_POST['threadModificationTrash'])) $this->threadModificationTrash = intval($_POST['threadModificationTrash']);
if (isset($_POST['threadModificationUndone'])) $this->threadModificationUndone = intval($_POST['threadModificationUndone']);
if (isset($_POST['threadModificationUnannounce'])) $this->threadModificationUnannounce = intval($_POST['threadModificationUnannounce']);
$this->postModerationClose = $this->postModerationDelete = $this->postModerationDisable = $this->postModerationEdit = 0;
$this->postModerationEnable = $this->postModerationMerge = $this->postModerationMove = $this->postModerationOpen = 0;
$this->postModerationRestore = $this->postModerationTrash = 0;
if (isset($_POST['postModerationClose'])) $this->postModerationClose = intval($_POST['postModerationClose']);
if (isset($_POST['postModerationDelete'])) $this->postModerationDelete = intval($_POST['postModerationDelete']);
if (isset($_POST['postModerationDisable'])) $this->postModerationDisable = intval($_POST['postModerationDisable']);
if (isset($_POST['postModerationEdit'])) $this->postModerationEdit = intval($_POST['postModerationEdit']);
if (isset($_POST['postModerationEnable'])) $this->postModerationEnable = intval($_POST['postModerationEnable']);
if (isset($_POST['postModerationMerge'])) $this->postModerationMerge = intval($_POST['postModerationMerge']);
if (isset($_POST['postModerationMove'])) $this->postModerationMove = intval($_POST['postModerationMove']);
if (isset($_POST['postModerationOpen'])) $this->postModerationOpen = intval($_POST['postModerationOpen']);
if (isset($_POST['postModerationRestore'])) $this->postModerationRestore = intval($_POST['postModerationRestore']);
if (isset($_POST['postModerationTrash'])) $this->postModerationTrash = intval($_POST['postModerationTrash']);
$this->wbbThreadModerationData = [
'threadModerationAuthorOnly' => $this->threadModerationAuthorOnly,
'threadModerationChangeTopic' => $this->threadModerationChangeTopic,
'threadModerationClose' => $this->threadModerationClose,
'threadModerationDisable' => $this->threadModerationDisable,
'threadModerationDone' => $this->threadModerationDone,
'threadModerationEnable' => $this->threadModerationEnable,
'threadModerationMerge' => $this->threadModerationMerge,
'threadModerationMove' => $this->threadModerationMove,
'threadModerationOpen' => $this->threadModerationOpen,
'threadModerationRestore' => $this->threadModerationRestore,
'threadModerationScrape' => $this->threadModerationScrape,
'threadModerationSetAsAnnouncement' => $this->threadModerationSetAsAnnouncement,
'threadModerationSetLabel' => $this->threadModerationSetLabel,
'threadModerationSticky' => $this->threadModerationSticky,
'threadModerationTrash' => $this->threadModerationTrash,
'threadModerationUndone' => $this->threadModerationUndone,
'threadModerationUnsetAsAnnouncement' => $this->threadModerationUnsetAsAnnouncement
];
$this->wbbThreadModificationData = [
'threadModificationAuthorOnly' => $this->threadModificationAuthorOnly,
'threadModificationBoardID' => $this->threadModificationBoardID,
'threadModificationExecuter' => $this->threadModificationExecuter,
'threadModificationExecuterID' => $this->threadModificationExecuterID,
'threadModificationClose' => $this->threadModificationClose,
'threadModificationDisable' => $this->threadModificationDisable,
'threadModificationDone' => $this->threadModificationDone,
'threadModificationEnable' => $this->threadModificationEnable,
'threadModificationMove' => $this->threadModificationMove,
'threadModificationOpen' => $this->threadModificationOpen,
'threadModificationRestore' => $this->threadModificationRestore,
'threadModificationScrape' => $this->threadModificationScrape,
'threadModificationSetLabel' => $this->threadModificationSetLabel,
'threadModificationSticky' => $this->threadModificationSticky,
'threadModificationTrash' => $this->threadModificationTrash,
'threadModificationUndone' => $this->threadModificationUndone,
'threadModificationUnannounce' => $this->threadModificationUnannounce
];
$this->wbbPostModerationData = [
'postModerationClose' => $this->postModerationClose,
'postModerationDelete' => $this->postModerationDelete,
'postModerationDisable' => $this->postModerationDisable,
'postModerationEdit' => $this->postModerationEdit,
'postModerationEnable' => $this->postModerationEnable,
'postModerationMerge' => $this->postModerationMerge,
'postModerationMove' => $this->postModerationMove,
'postModerationOpen' => $this->postModerationOpen,
'postModerationRestore' => $this->postModerationRestore,
'postModerationTrash' => $this->postModerationTrash
];
// read conditions
$this->wbbConditions = UzbotWbbConditionHandler::getInstance()->getGroupedObjectTypes();
foreach ($this->wbbConditions as $conditions) {
foreach ($conditions as $condition) {
$condition->getProcessor()->readFormParameters();
}
}
}
/**
* Handles the validate event.
*/
protected function validate() {
// Get type / notify data
$type = UzbotType::getTypeByID($this->eventObj->typeID);
$notify = UzbotNotify::getNotifyByID($this->eventObj->notifyID);
// threadNotifyBoardID
if ($notify->notifyTitle == 'thread') {
if ($this->threadNotifyBoardID == 0) {
throw new UserInputException('threadNotifyBoardID', 'notConfigured');
}
$board = BoardCache::getInstance()->getBoard($this->threadNotifyBoardID);
if (!$board->boardID) {
throw new UserInputException('threadNotifyBoardID', 'notValid');
}
if (!$board->isBoard()) {
throw new UserInputException('threadNotifyBoardID', 'notValid');
}
}
// postNotifyThreadID
if ($notify->notifyTitle == 'post') {
// threadID may be 0 with certain bots
$allowed = ['wbb_postModeration', 'wbb_threadModification', 'wbb_threadModeration', 'wbb_threadNew', 'wbb_postCount', 'wbb_postChange', 'wbb_bestAnswer'];
if (!$this->postNotifyThreadID) {
if (!in_array($type->typeTitle, $allowed)) {
throw new UserInputException('postNotifyThreadID', 'notValid');
}
}
else {
$thread = new Thread($this->postNotifyThreadID);
if (!$thread->threadID) {
throw new UserInputException('postNotifyThreadID', 'notValid');
}
}
}
// need notify?
if ($type->needNotify && !$notify->notifyID) {
throw new UserInputException('notifyID', 'missing');
}
// need count for trigger values
if ($type->needCount && $type->typeTitle == 'wbb_postCount') {
if ($this->postCountAction == 'postTotal' || $this->postCountAction == 'postX') {
$counts = ArrayUtil::trim(explode(',', $this->eventObj->userCount));
$counts = ArrayUtil::toIntegerArray($counts);
if (!count($counts)) throw new UserInputException('userCount', 'empty');
}
}
// thread new - wbb_threadNew
if ($type->typeTitle == 'wbb_threadNew') {
// board(s) must be selected
if (!count($this->threadNewBoardIDs)) {
throw new UserInputException('threadNewBoardIDs', 'notConfigured');
}
// no thread notification in monitored boards on threadNew
if ($notify->notifyTitle == 'thread') {
if (in_array($this->threadNotifyBoardID, $this->threadNewBoardIDs)) {
throw new UserInputException('threadNotifyBoardID', 'notAllowedOnThreadNew');
}
}
}
// action needing boardIDs
$actions = ['wbb_postModeration', 'wbb_threadModeration', 'wbb_postChange', 'wbb_topPoster', 'wbb_bestAnswer'];
if (in_array($type->typeTitle, $actions)) {
// board(s) must be selected
if (!count($this->uzbotBoardIDs)) {
throw new UserInputException('uzbotBoardIDs', 'notConfigured');
}
}
// wbb_threadModeration
if ($type->typeTitle == 'wbb_threadModeration') {
if (array_sum($this->wbbThreadModerationData) - $this->wbbThreadModerationData['threadModerationAuthorOnly'] == 0) {
throw new UserInputException('threadModerationAction', 'notConfigured');
}
}
// wbb_threadModification
if ($type->typeTitle == 'wbb_threadModification') {
// unset change labels if no labels
if (empty($this->eventObj->labelGroups) || empty($this->eventObj->availableLabels)) {
$this->wbbThreadModificationData['threadModificationSetLabel'] = 0;
$this->threadModificationSetLabel = 0;
}
if (array_sum($this->wbbThreadModificationData) - $this->wbbThreadModificationData['threadModificationAuthorOnly'] == 0) {
throw new UserInputException('threadModificationAction', 'notConfigured');
}
// if move, board must be selected and must exist
if ($this->threadModificationMove) {
$board = BoardCache::getInstance()->getBoard($this->threadModificationBoardID);
if (!$board || !$board->isBoard()) {
throw new UserInputException('threadModificationBoardID', 'notValid');
}
}
// executer must exist
if (empty($this->threadModificationExecuter)) throw new UserInputException('threadModificationExecuter');
$user = User::getUserByUsername($this->threadModificationExecuter);
if (!$user->userID) throw new UserInputException('threadModificationExecuter', 'invalid');
$this->threadModificationExecuterID = $user->userID;
$this->wbbThreadModificationData['threadModificationExecuterID'] = $user->userID;
}
// wbb_postModeration
if ($type->typeTitle == 'wbb_postModeration') {
if (!array_sum($this->wbbPostModerationData)) {
throw new UserInputException('postModerationAction', 'notConfigured');
}
}
// wbb_postChange
if ($type->typeTitle == 'wbb_postChange') {
if (!$this->postChangeUpdate && !$this->postChangeDelete) {
throw new UserInputException('postChangeAction', 'notConfigured');
}
}
}
/**
* Handles the save event.
*/
protected function save() {
// wbbThreadNotifyData
$wbbThreadData = [
'threadNotifyBoardID' => $this->threadNotifyBoardID,
'threadNotifyDelayed' => $this->threadNotifyDelayed,
'threadNotifyIsClosed' => $this->threadNotifyIsClosed,
'threadNotifyIsDisabled' => $this->threadNotifyIsDisabled,
'threadNotifyIsDone' => $this->threadNotifyIsDone,
'threadNotifyIsSticky' => $this->threadNotifyIsSticky
];
$wbbPostData = [
'postNotifyThreadID' => $this->postNotifyThreadID,
'postNotifyIsClosed' => $this->postNotifyIsClosed,
'postNotifyIsDisabled' => $this->postNotifyIsDisabled
];
$this->eventObj->additionalFields = array_merge($this->eventObj->additionalFields, [
'wbbThreadData' => serialize($wbbThreadData),
'wbbPostData' => serialize($wbbPostData),
'wbbPostModerationData' => serialize($this->wbbPostModerationData),
'wbbThreadModerationData' => serialize($this->wbbThreadModerationData),
'wbbThreadModificationData' => serialize($this->wbbThreadModificationData),
'postCountAction' => $this->postCountAction,
'topPosterCount' => $this->topPosterCount,
'topPosterInterval' => $this->topPosterInterval,
'topPosterNext' => 0,
'threadNewBoardIDs' => serialize($this->threadNewBoardIDs),
'uzbotBoardIDs' => serialize($this->uzbotBoardIDs),
'postIsOfficial' => $this->postIsOfficial,
'threadIsOfficial' => $this->threadIsOfficial,
'postChangeUpdate' => $this->postChangeUpdate,
'postChangeDelete' => $this->postChangeDelete
]);
}
/**
* Handles the saved event.
*/
protected function saved() {
// transform conditions array into one-dimensional array and save
$conditions = [];
foreach ($this->wbbConditions as $groupedObjectTypes) {
$conditions = array_merge($conditions, $groupedObjectTypes);
}
$oldConditions = ConditionHandler::getInstance()->getConditions('com.uz.wcf.bot.condition.wbb', $this->eventObj->botID);
ConditionHandler::getInstance()->updateConditions($this->eventObj->botID, $oldConditions, $conditions);
}
}
lib/system/event/listener/UzbotPostActionListener.class.php 0100644 0000000 0000000 00000030313 14167533111 023301 0 ustar 00 0000000 0000000
* @package com.uz.wcf.bot3.wbb
*/
class UzbotPostActionListener implements IParameterizedEventListener {
/**
* @inheritDoc
*/
public function execute($eventObj, $className, $eventName, array &$parameters) {
if (!MODULE_UZBOT) return;
$action = $eventObj->getActionName();
$defaultLanguage = LanguageFactory::getInstance()->getLanguage(LanguageFactory::getInstance()->getDefaultLanguageID());
// on new posts get user post count, top poster and total post count
if ($action == 'triggerPublication') {
// Read all active, valid bots, abort if none
$bots = UzbotValidBotCacheBuilder::getInstance()->getData(['typeDes' => 'wbb_postCount']);
if (!count($bots)) return;
// get posts
$posts = $eventObj->getObjects();
if (!count($posts)) return;
foreach ($posts as $editor) {
$post = $editor->getDecoratedObject();
// check later, whether post is counted
$thread = $post->getThread();
if (!$thread->threadID) return;
$board = $thread->getBoard();
if (!$board->boardID) return;
// top poster
$top = new UzbotTop(1);
$topUser = new User($top->post);
// total post count
$sql = "SELECT COUNT(*) AS count
FROM wbb".WCF_N."_post
WHERE isDeleted = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([0]);
$countTotal = $statement->fetchColumn();
$user = new User($post->userID);
foreach ($bots as $bot) {
$affectedUserIDs = $countToUserID = $placeholders = [];
$count = 1;
// only users if not postTop
if ($bot->postCountAction != 'postTotal' && !$user->userID) {
continue;
}
// user condition relevant on postX only
if ($bot->postCountAction == 'postX') {
$conditions = $bot->getUserConditions();
if (count($conditions)) {
$userList = new UserList();
$userList->getConditionBuilder()->add('user_table.userID = ?', [$user->userID]);
foreach ($conditions as $condition) {
$condition->getObjectType()->getProcessor()->addUserCondition($condition, $userList);
}
$userList->readObjects();
if (!count($userList->getObjects())) {
continue;
}
}
}
// only on count match or new top poster
$counts = explode(',', $bot->userCount);
$hit = false;
switch ($bot->postCountAction) {
case 'postTotal':
if (in_array($countTotal, $counts)) $hit = true;
break;
case 'postX':
if ($board->countUserPosts) {
if (in_array($user->wbbPosts, $counts)) {
$hit = true;
}
}
break;
case 'postTop':
if ($board->countUserPosts) {
if ($user->wbbPosts > $topUser->wbbPosts && $user->userID != $topUser->userID) {
$hit = true;
if (!$bot->testMode) {
$editor = new UzbotTopEditor($top);
$editor->update(['post' => $user->userID]);
}
}
}
break;
}
if ($hit) {
$affectedUserIDs = $countToUserID = $placeholders = [];
if ($user->userID) {
$affectedUserIDs[] = $user->userID;
$countToUserID[$user->userID] = $user->wbbPosts;
}
// post, thread etc. data
// $thread = $post->getThread(); $board = $thread->getBoard(); see above
$quote = $this->getQuote($post);
// set placeholders
$placeholders['board-id'] = $board->boardID;
$placeholders['board-name'] = $board->title;
$placeholders['count'] = $countTotal;
$placeholders['count-user'] = $user->userID ? $user->wbbPosts : 0;
$placeholders['post-id'] = $post->postID;
$placeholders['post-link'] = $post->getLink();
$placeholders['post-subject'] = $post->getTitle();
$placeholders['post-text'] = $post->getMessage();
$placeholders['quote'] = $quote;
$placeholders['thread-link'] = $thread->getLink();
$placeholders['thread-subject'] = $thread->getTitle();
$placeholders['translate'] = ['board-name'];
// add guest placeholders
if (!$user->userID) {
$placeholders['user-email'] = $placeholders['user-groups'] = 'wcf.user.guest';
$placeholders['user-name'] = $placeholders['user-profile'] = $placeholders['@user-profile'] = 'wcf.user.guest';
$placeholders['user-age'] = 'x';
$placeholders['user-id'] = 0;
$placeholders['translate'] = ['board-name', 'user-email', 'user-groups', 'user-name', 'user-profile', '@user-profile', 'user-age'];
}
// save threadID for post in affected thread
$bot->threadID = $thread->threadID;
// log action
if ($bot->enableLog) {
if (!$bot->testMode) {
UzbotLogEditor::create([
'bot' => $bot,
'count' => 1,
'additionalData' => $defaultLanguage->getDynamicVariable('wcf.acp.uzbot.log.user.affected', [
'total' => 1,
'userIDs' => implode(', ', $affectedUserIDs)
])
]);
}
}
else {
$result = $defaultLanguage->getDynamicVariable('wcf.acp.uzbot.log.test', [
'objects' => 1,
'users' => count($affectedUserIDs),
'userIDs' => implode(', ', $affectedUserIDs)
]);
if (mb_strlen($result) > 64000) $result = mb_substr($result, 0, 64000) . ' ...';
UzbotLogEditor::create([
'bot' => $bot,
'count' => 1,
'testMode' => 1,
'additionalData' => serialize(['', '', $result])
]);
}
// check for and prepare notification
$notify = $bot->checkNotify(true, true);
if ($notify === null) continue;
// send to scheduler
$data = [
'bot' => $bot,
'placeholders' => $placeholders,
'affectedUserIDs' => $affectedUserIDs,
'countToUserID' => $countToUserID
];
$job = new NotifyScheduleBackgroundJob($data);
BackgroundQueueHandler::getInstance()->performJob($job);
}
}
}
}
// post change by user himself
if ($action == 'update' || $action == 'trash') {
// Read all active, valid bots, abort if none
$bots = UzbotValidBotCacheBuilder::getInstance()->getData(['typeDes' => 'wbb_postChange']);
if (!count($bots)) return;
// get posts / data
$posts = $eventObj->getObjects();
if (!count($posts)) return;
$params = $eventObj->getParameters();
foreach ($posts as $editor) {
$post = $editor->getDecoratedObject();
if ($post->userID && WCF::getUser()->userID == $post->userID) {
//preset data
$user = WCF::getUser();
$thread = $post->getThread();
// get reason
$reason = '';
if (isset($params['reason'])) {
$reason = $params['reason'];
}
elseif (isset($params['data']['editReason'])) {
$reason = $params['data']['editReason'];
}
foreach ($bots as $bot) {
// check type of change
if ($action == 'update' && !$bot->postChangeUpdate) continue;
if ($action == 'trash' && !$bot->postChangeDelete) continue;
$affectedUserIDs = $countToUserID = $placeholders = [];
$count = 1;
// must be in monitored boards
if (!in_array($thread->boardID, unserialize($bot->uzbotBoardIDs))) continue;
$conditions = $bot->getUserConditions();
if (count($conditions)) {
$userList = new UserList();
$userList->getConditionBuilder()->add('user_table.userID = ?', [$user->userID]);
foreach ($conditions as $condition) {
$condition->getObjectType()->getProcessor()->addUserCondition($condition, $userList);
}
$userList->readObjects();
if (!count($userList->getObjects())) continue;
}
// found one
$affectedUserIDs[] = $user->userID;
$countToUserID[$user->userID] = $user->wbbPosts;
// post, thread and etc. data
$thread = $post->getThread();
$board = $thread->getBoard();
$quote = $this->getQuote($post);
// set placeholders
$placeholders['action'] = $action == 'update' ? 'wcf.acp.uzbot.wbb.action.changed' : 'wcf.acp.uzbot.wbb.action.deleted';
$placeholders['board-id'] = $board->boardID;
$placeholders['board-name'] = $board->title;
$placeholders['count'] = 1;
$placeholders['count-user'] = 1;
$placeholders['post-id'] = $post->postID;
$placeholders['post-link'] = $post->getLink();
$placeholders['post-subject'] = $post->getTitle();
$placeholders['post-text'] = $post->getMessage();
$placeholders['quote'] = $quote;
$placeholders['reason'] = $reason;
$placeholders['thread-link'] = $thread->getLink();
$placeholders['thread-subject'] = $thread->getTitle();
$placeholders['translate'] = ['board-name', 'action'];
// save threadID for post in affected thread
$bot->threadID = $thread->threadID;
// log action
if ($bot->enableLog) {
if (!$bot->testMode) {
UzbotLogEditor::create([
'bot' => $bot,
'count' => 1,
'additionalData' => $defaultLanguage->getDynamicVariable('wcf.acp.uzbot.log.user.affected', [
'total' => 1,
'userIDs' => implode(', ', $affectedUserIDs)
])
]);
}
else {
$result = $defaultLanguage->getDynamicVariable('wcf.acp.uzbot.log.test', [
'objects' => 1,
'users' => count($affectedUserIDs),
'userIDs' => implode(', ', $affectedUserIDs)
]);
if (mb_strlen($result) > 64000) $result = mb_substr($result, 0, 64000) . ' ...';
UzbotLogEditor::create([
'bot' => $bot,
'count' => 1,
'testMode' => 1,
'additionalData' => serialize(['', '', $result])
]);
}
}
// check for and prepare notification
$notify = $bot->checkNotify(true, true);
if ($notify === null) continue;
// send to scheduler
$data = [
'bot' => $bot,
'placeholders' => $placeholders,
'affectedUserIDs' => $affectedUserIDs,
'countToUserID' => $countToUserID
];
$job = new NotifyScheduleBackgroundJob($data);
BackgroundQueueHandler::getInstance()->performJob($job);
}
}
}
}
}
/**
* Create qoute from post / thread
*/
protected function getQuote($post) {
$quoteID = MessageQuoteManager::getInstance()->addQuote(
'com.woltlab.wbb.post',
$post->threadID,
$post->postID,
$post->getExcerpt(),
$post->getMessage()
);
if ($quoteID === false) {
$removeQuoteID = MessageQuoteManager::getInstance()->getQuoteID(
'com.woltlab.wbb.post',
$post->postID,
$post->getExcerpt(),
$post->getMessage()
);
MessageQuoteManager::getInstance()->removeQuote($removeQuoteID);
}
$returnValues = [
'count' => MessageQuoteManager::getInstance()->countQuotes(),
'fullQuoteMessageIDs' => MessageQuoteManager::getInstance()->getFullQuoteObjectIDs(['com.woltlab.wbb.post'])
];
if ($quoteID) {
$returnValues['renderedQuote'] = MessageQuoteManager::getInstance()->getQuoteComponents($quoteID);
$username = str_replace(["\\", "'"], ["\\\\", "\'"], $returnValues['renderedQuote']['username']);
$link = str_replace(["\\", "'"], ["\\\\", "\'"], $returnValues['renderedQuote']['link']);
$message = $returnValues['renderedQuote']['text'];
// build quote and replace
$quote = '';
$quote .= $message;
$quote .= ' ';
}
else $quote = '';
return $quote;
}
}
lib/system/event/listener/UzbotPostModerationListener.class.php 0100644 0000000 0000000 00000016234 14167533111 024173 0 ustar 00 0000000 0000000
* @package com.uz.wcf.bot3.wbb
*/
class UzbotPostModerationListener implements IParameterizedEventListener {
/**
* @inheritDoc
*/
public function execute($eventObj, $className, $eventName, array &$parameters) {
// check module
if (!MODULE_UZBOT) return;
// only action create and user
if ($eventObj->getActionName() != 'create') return;
if (!WCF::getUser()->userID) return;
// only post modification
$objectTypeID = ObjectTypeCache::getInstance()->getObjectTypeIDByName('com.woltlab.wcf.modifiableContent', 'com.woltlab.wbb.post');
$params = $eventObj->getParameters();
if ($params['data']['objectTypeID'] != $objectTypeID) return;
// only if bots
$bots = UzbotValidBotCacheBuilder::getInstance()->getData(['typeDes' => 'wbb_postModeration']);
if (!count($bots)) return;
// preset data
$defaultLanguage = LanguageFactory::getInstance()->getLanguage(LanguageFactory::getInstance()->getDefaultLanguageID());
$postID = $params['data']['objectID'];
$threadID = $params['data']['parentObjectID'];
$action = $params['data']['action'];
$moderatorID = $params['data']['userID'];
$additional = [];
if (isset($params['data']['additionalData'])) $additional = unserialize($params['data']['additionalData']);
// allow 'delete'
$validActions = ['close', 'delete', 'disable', 'edit', 'enable', 'merge', 'move', 'open', 'restore', 'trash'];
if (!in_array($action, $validActions)) return;
// only moderation
$post = new Post($postID); // may be null (delete)
$thread = new Thread($threadID);
if ($post && $post->userID == $moderatorID) return;
// Step through bots
foreach ($bots as $bot) {
$affectedUserIDs = $countToUserID = $placeholders = [];
$count = 0;
// check action
if (!stripos($bot->wbbPostModerationData, $action)) continue; // 0/false doesn't matter
// check board
if (!in_array($thread->boardID, unserialize($bot->uzbotBoardIDs))) continue;
// check action
$moderations = unserialize($bot->wbbPostModerationData);
$act = 0;
foreach ($moderations as $key => $value) {
if (0 == strcasecmp($key, 'postModeration'.$action) && $value == 1) {
$act = 1;
break;
}
}
if (!$act) continue;
// get affected users
if ($bot->changeAffected) {
$affectedUserIDs[] = $moderatorID;
$countToUserID[$moderatorID] = 1;
$count = 1;
}
else {
if ($action != 'delete') {
$affectedUserIDs[] = $post->userID;
$countToUserID[$post->userID] = 1;
$count = 1;
}
else {
// leave if no user
if (isset($additional['username'])) {
$user = User::getUserByUsername($additional['username']);
if (!$user->userID) continue;
$affectedUserIDs[] = $user->userID;
$countToUserID[$user->userID] = 1;
$count = 1;
}
else continue;
}
}
// check users
$conditions = $bot->getUserConditions();
if (count($conditions)) {
$userList = new UserList();
$userList->getConditionBuilder()->add('user_table.userID IN (?)', [$affectedUserIDs]);
foreach ($conditions as $condition) {
$condition->getObjectType()->getProcessor()->addUserCondition($condition, $userList);
}
$userList->readObjects();
if (!count($userList->getObjects())) continue;
}
// found users, board and a valid action, get data
// log action
if ($bot->enableLog) {
if (!$bot->testMode) {
UzbotLogEditor::create([
'bot' => $bot,
'count' => $count,
'additionalData' => $defaultLanguage->getDynamicVariable('wcf.acp.uzbot.log.user.affected', [
'total' => count($affectedUserIDs),
'userIDs' => implode(', ', $affectedUserIDs)
])
]);
}
else {
$result = $defaultLanguage->getDynamicVariable('wcf.acp.uzbot.log.test', [
'objects' => $count,
'users' => count($affectedUserIDs),
'userIDs' => implode(', ', $affectedUserIDs)
]);
if (mb_strlen($result) > 64000) $result = mb_substr($result, 0, 64000) . ' ...';
UzbotLogEditor::create([
'bot' => $bot,
'count' => $count,
'testMode' => 1,
'additionalData' => serialize(['', '', $result])
]);
}
}
// check for and prepare notification
$notify = $bot->checkNotify(true, true);
if ($notify === null) continue;
$bot->threadID = $thread->threadID;
$board = $thread->getBoard();
$moderator = WCF::getUser();
$placeholders['board-id'] = $thread->boardID;
$placeholders['board-name'] = $thread->getBoard()->title;
$placeholders['count'] = count($affectedUserIDs);
$placeholders['moderation-action'] = 'wcf.uzbot.wbb.moderation.post.' . $action;
$placeholders['moderation-reason'] = '';
if (isset($additional['reason'])) $placeholders['moderation-reason'] = $additional['reason'];
$placeholders['moderator-id'] = $moderator->userID;
$placeholders['moderator-link'] = $moderator->getLink();
$placeholders['moderator-link2'] = StringUtil::getAnchorTag($moderator->getLink(), $moderator->username);
$placeholders['moderator-name'] = $moderator->username;
$placeholders['thread-link'] = $thread->getLink();
$placeholders['thread-subject'] = $thread->getTitle();
if ($action != 'delete') {
$placeholders['thread-text'] = $thread->getFirstPost()->getMessage();
}
else {
// cancel placeholder. Might be only post; cached.
$placeholders['thread-text'] = 'thread-text';
}
$placeholders['translate'] = ['board-name', 'moderation-action'];
if ($action != 'delete') {
$placeholders['post-link'] = $post->getLink();
$placeholders['post-subject'] = $post->getTitle();
$placeholders['post-text'] = $post->getMessage();
}
else {
$placeholders['post-link'] = $placeholders['post-subject'] = $placeholders['post-text'] = 'wcf.uzbot.wbb.moderation.post.deleted';
$placeholders['translate'][] = 'post-link';
$placeholders['translate'][] = 'post-subject';
$placeholders['translate'][] = 'post-text';
}
// test mode
$testUserIDs = $testToUserIDs = [];
$testUserIDs[] = $affectedUserIDs[0];
$testToUserIDs[$affectedUserIDs[0]] = $countToUserID[$affectedUserIDs[0]];
// send to scheduler
$data = [
'bot' => $bot,
'placeholders' => $placeholders,
'affectedUserIDs' => !$bot->testMode ? $affectedUserIDs : $testUserIDs,
'countToUserID' => !$bot->testMode ? $countToUserID : $testToUserIDs
];
$job = new NotifyScheduleBackgroundJob($data);
BackgroundQueueHandler::getInstance()->performJob($job);
}
}
}
lib/system/event/listener/UzbotThreadActionListener.class.php 0100644 0000000 0000000 00000025253 14167533111 023572 0 ustar 00 0000000 0000000
* @package com.uz.wcf.bot3.wbb
*/
class UzbotThreadActionListener implements IParameterizedEventListener {
/**
* @inheritdoc
*/
public function execute($eventObj, $className, $eventName, array &$parameters) {
// check module
if (!MODULE_UZBOT) return;
$action = $eventObj->getActionName();
$defaultLanguage = LanguageFactory::getInstance()->getLanguage(LanguageFactory::getInstance()->getDefaultLanguageID());
// Thread publication
if ($action == 'triggerPublication') {
// Read all active, valid bots, abort if none
$bots = UzbotValidBotCacheBuilder::getInstance()->getData(['typeDes' => 'wbb_threadNew']);
if (!count($bots)) return;
// get threads
$threads = $eventObj->getObjects();
if (!count($threads)) return;
foreach ($threads as $editor) {
$thread = $editor->getDecoratedObject();
// not if created by bot
if ($thread->isUzbot) continue;
foreach ($bots as $bot) {
$affectedUserIDs = $countToUserID = $placeholders = [];
$count = 1;
//monitored boards
if (!in_array($thread->boardID, unserialize($bot->threadNewBoardIDs))) continue;
// user conditions
$conditions = $bot->getUserConditions();
if (count($conditions)) {
if (!$thread->userID) {
continue;
}
else {
$userList = new UserList();
$userList->getConditionBuilder()->add('user_table.userID = ?', [$thread->userID]);
foreach ($conditions as $condition) {
$condition->getObjectType()->getProcessor()->addUserCondition($condition, $userList);
}
$userList->readObjects();
if (!count($userList->getObjects())) {
continue;
}
}
}
// affected user
$user = null;
if ($thread->userID) {
$user = new User($thread->userID);
if (!$user->userID) {
$user = null;
}
}
// save threadID for post in affected thread
$bot->threadID = $thread->threadID;
if ($user) {
$affectedUserIDs[] = $user->userID;
$countToUserID[$user->userID] = 1;
}
else {
$placeholders['user-email'] = $placeholders['user-groups'] = 'wcf.user.guest';
$placeholders['user-name'] = $placeholders['user-profile'] = $placeholders['@user-profile'] = 'wcf.user.guest';
$placeholders['user-age'] = 'x';
$placeholders['user-id'] = 0;
}
$placeholders['board-id'] = $thread->boardID;
$placeholders['board-name'] = $thread->getBoard()->title;
$placeholders['count'] = 1;
$placeholders['count-user'] = $user ? $user->wbbPosts : 0;
$placeholders['thread-link'] = $thread->getLink();
$placeholders['thread-subject'] = $thread->getTitle();
$placeholders['thread-text'] = $thread->getFirstPost()->getMessage();
if ($user) {
$placeholders['translate'] = ['board-name'];
}
else {
$placeholders['translate'] = ['board-name', 'user-email', 'user-groups', 'user-name', 'user-profile', '@user-profile', 'user-age'];
}
// get quote
$post = $thread->getFirstPost();
$quote = $this->getQuote($post);
$placeholders['quote'] = $quote;
// get options; >= 5.2.0
$optionValues = [];
$sql = "SELECT thread_form_option.optionTitle, thread_form_option_value.optionValue
FROM wbb".WCF_N."_thread_form_option_value thread_form_option_value
LEFT JOIN wbb".WCF_N."_thread_form_option thread_form_option
ON (thread_form_option_value.optionID = thread_form_option.optionID)
WHERE postID = ?
ORDER BY thread_form_option.showOrder";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([$post->postID]);
$optionValues = $statement->fetchMap('optionTitle', 'optionValue');
$placeholders['options'] = $optionValues;
// log action
if ($bot->enableLog) {
// userIDs string
if (count($affectedUserIDs)) {
$userIDs = implode(', ', $affectedUserIDs);
}
else {
$userIDs = $defaultLanguage->get('wcf.user.guest');
}
if (!$bot->testMode) {
UzbotLogEditor::create([
'bot' => $bot,
'count' => 1,
'additionalData' => $defaultLanguage->getDynamicVariable('wcf.acp.uzbot.log.user.affected', [
'total' => 1,
'userIDs' => $userIDs
])
]);
}
else {
$result = $defaultLanguage->getDynamicVariable('wcf.acp.uzbot.log.test', [
'objects' => 1,
'users' => count($affectedUserIDs),
'userIDs' => $userIDs
]);
if (mb_strlen($result) > 64000) $result = mb_substr($result, 0, 64000) . ' ...';
UzbotLogEditor::create([
'bot' => $bot,
'count' => 1,
'testMode' => 1,
'additionalData' => serialize(['', '', $result])
]);
}
}
// check for and prepare notification
$notify = $bot->checkNotify(true, true);
if ($notify === null) continue;
// send to scheduler
$data = [
'bot' => $bot,
'placeholders' => $placeholders,
'affectedUserIDs' => $affectedUserIDs,
'countToUserID' => $countToUserID
];
$job = new NotifyScheduleBackgroundJob($data);
BackgroundQueueHandler::getInstance()->performJob($job);
}
}
}
// best answer
if ($action == 'markAsBestAnswer') {
// Read all active, valid activity bots, abort if none
$bots = UzbotValidBotCacheBuilder::getInstance()->getData(['typeDes' => 'wbb_bestAnswer']);
if (count($bots)) {
// data
$params = $eventObj->getParameters();
$thread = $eventObj->thread;
$board = $thread->getBoard();
$post = new Post($params['postID']);
if (!$post->postID) return;
$quote = $this->getQuote($post);
$user = null;
if ($post->userID) {
$user = new User($post->userID);
if (!$user->userID) $user = null;
}
foreach ($bots as $bot) {
$affectedUserIDs = $countToUserID = $placeholders = [];
// must be in monitored boards
if (!in_array($thread->boardID, unserialize($bot->uzbotBoardIDs))) continue;
// user
if ($user) {
$affectedUserIDs[] = $user->userID;
$countToUserID[$user->userID] = $user->wbbPosts;
}
else {
$placeholders['user-email'] = $placeholders['user-groups'] = 'wcf.user.guest';
$placeholders['user-name'] = $placeholders['user-profile'] = $placeholders['@user-profile'] = 'wcf.user.guest';
$placeholders['user-age'] = 'x';
$placeholders['user-id'] = 0;
}
// set placeholders
$placeholders['board-id'] = $board->boardID;
$placeholders['board-name'] = $board->title;
$placeholders['count'] = 1;
$placeholders['count-user'] = $user ? $user->wbbPosts : 0;
$placeholders['post-id'] = $post->postID;
$placeholders['post-link'] = $post->getLink();
$placeholders['post-subject'] = $post->getTitle();
$placeholders['post-text'] = $post->getMessage();
$placeholders['quote'] = $quote;
$placeholders['thread-link'] = $thread->getLink();
$placeholders['thread-subject'] = $thread->getTitle();
if ($user) {
$placeholders['translate'] = ['board-name'];
}
else {
$placeholders['translate'] = ['board-name', 'user-email', 'user-groups', 'user-name', 'user-profile', '@user-profile', 'user-age'];
}
// save threadID for post in affected thread
$bot->threadID = $thread->threadID;
// log action
if ($bot->enableLog) {
if (!$bot->testMode) {
UzbotLogEditor::create([
'bot' => $bot,
'count' => 1,
'additionalData' => $defaultLanguage->getDynamicVariable('wcf.acp.uzbot.log.user.affected', [
'total' => 1,
'userIDs' => implode(', ', $affectedUserIDs)
])
]);
}
else {
$result = $defaultLanguage->getDynamicVariable('wcf.acp.uzbot.log.test', [
'objects' => 1,
'users' => count($affectedUserIDs),
'userIDs' => implode(', ', $affectedUserIDs)
]);
if (mb_strlen($result) > 64000) $result = mb_substr($result, 0, 64000) . ' ...';
UzbotLogEditor::create([
'bot' => $bot,
'count' => 1,
'testMode' => 1,
'additionalData' => serialize(['', '', $result])
]);
}
}
// check for and prepare notification
$notify = $bot->checkNotify(true, true);
if ($notify === null) continue;
// send to scheduler
$data = [
'bot' => $bot,
'placeholders' => $placeholders,
'affectedUserIDs' => $affectedUserIDs,
'countToUserID' => $countToUserID
];
$job = new NotifyScheduleBackgroundJob($data);
BackgroundQueueHandler::getInstance()->performJob($job);
}
}
}
}
/**
* Create qoute from post / thread
*/
protected function getQuote($post) {
$quoteID = MessageQuoteManager::getInstance()->addQuote(
'com.woltlab.wbb.post',
$post->threadID,
$post->postID,
$post->getExcerpt(),
$post->getMessage()
);
if ($quoteID === false) {
$removeQuoteID = MessageQuoteManager::getInstance()->getQuoteID(
'com.woltlab.wbb.post',
$post->postID,
$post->getExcerpt(),
$post->getMessage()
);
MessageQuoteManager::getInstance()->removeQuote($removeQuoteID);
}
$returnValues = [
'count' => MessageQuoteManager::getInstance()->countQuotes(),
'fullQuoteMessageIDs' => MessageQuoteManager::getInstance()->getFullQuoteObjectIDs(['com.woltlab.wbb.post'])
];
if ($quoteID) {
$returnValues['renderedQuote'] = MessageQuoteManager::getInstance()->getQuoteComponents($quoteID);
$username = str_replace(["\\", "'"], ["\\\\", "\'"], $returnValues['renderedQuote']['username']);
$link = str_replace(["\\", "'"], ["\\\\", "\'"], $returnValues['renderedQuote']['link']);
$message = $returnValues['renderedQuote']['text'];
// build quote and replace
$quote = '';
$quote .= $message;
$quote .= ' ';
}
else $quote = '';
return $quote;
}
}
lib/system/event/listener/UzbotThreadModerationListener.class.php 0100644 0000000 0000000 00000016035 14167533111 024454 0 ustar 00 0000000 0000000
* @package com.uz.wcf.bot3.wbb
*/
class UzbotThreadModerationListener implements IParameterizedEventListener {
/**
* @inheritDoc
*/
public function execute($eventObj, $className, $eventName, array &$parameters) {
// check module
if (!MODULE_UZBOT) return;
// only action create and user
if ($eventObj->getActionName() != 'create') return;
if (!WCF::getUser()->userID) return;
// only thread modification
$objectTypeID = ObjectTypeCache::getInstance()->getObjectTypeIDByName('com.woltlab.wcf.modifiableContent', 'com.woltlab.wbb.thread');
$params = $eventObj->getParameters();
if ($params['data']['objectTypeID'] != $objectTypeID) return;
// only if bots
$bots = UzbotValidBotCacheBuilder::getInstance()->getData(['typeDes' => 'wbb_threadModeration']);
if (!count($bots)) return;
// preset data
$defaultLanguage = LanguageFactory::getInstance()->getLanguage(LanguageFactory::getInstance()->getDefaultLanguageID());
$threadID = $params['data']['objectID'];
$action = $params['data']['action'];
$moderatorID = $params['data']['userID'];
$additional = [];
if (isset($params['data']['additionalData'])) $additional = unserialize($params['data']['additionalData']);
// skip 'delete'
$validActions = ['changeTopic', 'close', 'disable', 'done', 'enable', 'merge', 'move', 'open', 'restore', 'scrape', 'setAsAnnouncement', 'setLabel', 'sticky', 'trash', 'undone', 'unsetAsAnnouncement'];
if (!in_array($action, $validActions)) return;
// only moderation
$thread = new Thread($threadID);
if ($thread && $thread->userID == $moderatorID) return;
// Step through bots
foreach ($bots as $bot) {
$affectedUserIDs = $countToUserID = $placeholders = [];
$count = 0;
// check action
if (!stripos($bot->wbbThreadModerationData, $action)) continue; // 0/false doesn't matter
// check board
if (!in_array($thread->boardID, unserialize($bot->uzbotBoardIDs))) continue;
// check action
$moderations = unserialize($bot->wbbThreadModerationData);
$act = 0;
foreach ($moderations as $key => $value) {
if ($key == 'threadModerationAuthorOnly') continue;
if (0 == strcasecmp($key, 'threadModeration'.$action) && $value == 1) {
$act = 1;
break;
}
}
if (!$act) continue;
// get potentially affected users
if ($bot->changeAffected) {
$affectedUserIDs[] = $moderatorID;
$countToUserID[$moderatorID] = 1;
$count = 1;
}
else {
if ($moderations['threadModerationAuthorOnly']) {
// leave if thread without author
if (!$thread->userID) continue;
$affectedUserIDs[] = $thread->userID;
$countToUserID[$thread->userID] = 1;
$count = 1;
}
else {
// authors of posts are affected, only active posts
$sql = "SELECT userID
FROM wbb".WCF_N."_post
WHERE threadID = ? AND userID > ? AND isDeleted = ? AND isDisabled = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([$threadID, 0, 0, 0]);
while ($row = $statement->fetchArray()) {
$count ++;
$affectedUserIDs[] = $row['userID'];
if (isset($countToUserID[$row['userID']])) $countToUserID[$row['userID']] ++;
else $countToUserID[$row['userID']] = 1;
}
// leave if no users
if (!count($affectedUserIDs)) continue;
$affectedUserIDs = array_unique($affectedUserIDs);
}
}
// check users
$conditions = $bot->getUserConditions();
if (count($conditions)) {
$userList = new UserList();
$userList->getConditionBuilder()->add('user_table.userID IN (?)', [$affectedUserIDs]);
foreach ($conditions as $condition) {
$condition->getObjectType()->getProcessor()->addUserCondition($condition, $userList);
}
$userList->readObjects();
if (!count($userList->getObjects())) continue;
}
// found users, board and a valid action, get data
// log action
if ($bot->enableLog) {
if (!$bot->testMode) {
UzbotLogEditor::create([
'bot' => $bot,
'count' => $count,
'additionalData' => $defaultLanguage->getDynamicVariable('wcf.acp.uzbot.log.user.affected', [
'total' => count($affectedUserIDs),
'userIDs' => implode(', ', $affectedUserIDs)
])
]);
}
else {
$result = $defaultLanguage->getDynamicVariable('wcf.acp.uzbot.log.test', [
'objects' => $count,
'users' => count($affectedUserIDs),
'userIDs' => implode(', ', $affectedUserIDs)
]);
if (mb_strlen($result) > 64000) $result = mb_substr($result, 0, 64000) . ' ...';
UzbotLogEditor::create([
'bot' => $bot,
'count' => $count,
'testMode' => 1,
'additionalData' => serialize(['', '', $result])
]);
}
}
// check for and prepare notification
$notify = $bot->checkNotify(true, true);
if ($notify === null) continue;
$bot->threadID = $thread->threadID;
$board = $thread->getBoard();
$moderator = WCF::getUser();
$placeholders['board-id'] = $thread->boardID;
$placeholders['board-name'] = $thread->getBoard()->title;
$placeholders['count'] = count($affectedUserIDs);
$placeholders['moderation-action'] = 'wcf.uzbot.wbb.moderation.' . $action;
$placeholders['moderation-reason'] = '';
if (isset($additional['reason'])) $placeholders['moderation-reason'] = $additional['reason'];
$placeholders['moderator-id'] = $moderator->userID;
$placeholders['moderator-link'] = $moderator->getLink();
$placeholders['moderator-link2'] = StringUtil::getAnchorTag($moderator->getLink(), $moderator->username);
$placeholders['moderator-name'] = $moderator->username;
$placeholders['thread-link'] = $thread->getLink();
$placeholders['thread-subject'] = $thread->getTitle();
$placeholders['thread-text'] = $thread->getFirstPost()->getMessage();
$placeholders['translate'] = ['board-name', 'moderation-action'];
// test mode
$testUserIDs = $testToUserIDs = [];
$testUserIDs[] = $affectedUserIDs[0];
$testToUserIDs[$affectedUserIDs[0]] = $countToUserID[$affectedUserIDs[0]];
// send to scheduler
$data = [
'bot' => $bot,
'placeholders' => $placeholders,
'affectedUserIDs' => !$bot->testMode ? $affectedUserIDs : $testUserIDs,
'countToUserID' => !$bot->testMode ? $countToUserID : $testToUserIDs
];
$job = new NotifyScheduleBackgroundJob($data);
BackgroundQueueHandler::getInstance()->performJob($job);
}
}
}
lib/system/event/listener/UzbotWbbDeleteBotListener.class.php 0100644 0000000 0000000 00000001551 14167533111 023522 0 ustar 00 0000000 0000000
* @package com.uz.wcf.bot3.wbb
*/
class UzbotWbbDeleteBotListener implements IParameterizedEventListener {
/**
* @inheritDoc
*/
public function execute($eventObj, $className, $eventName, array &$parameters) {
// check module
if (!MODULE_UZBOT) return;
// only delete
if ($eventObj->getActionName() != 'delete') return;
$botIDs = $eventObj->getObjectIDs();
if (!empty($botIDs)) {
$oldConditions = ConditionHandler::getInstance()->deleteConditions('com.uz.wcf.bot.condition.wbb', $botIDs);
}
}
}
cronjob.xml 0100644 0000000 0000000 00000003411 13574655763 012007 0 ustar 00 0000000 0000000
wbb\system\cronjob\UzbotThreadModificationCronjob
*/30
*
*
*
*
1
1
1
wbb\system\cronjob\UzbotPostTopPosterCronjob
*/30
*
*
*
*
1
1
1
wbb\system\cronjob\UzbotStatsWbbCronjob
0
5
*
*
*
1
1
1
eventListener.xml 0100644 0000000 0000000 00000006013 13723223274 013163 0 ustar 00 0000000 0000000
wcf\acp\form\UzbotAddForm
assignVariables,readFormParameters,save,validate,saved
wbb\system\event\listener\UzbotAddFormWbbListener
1
admin
wcf\acp\form\UzbotEditForm
readData
wbb\system\event\listener\UzbotAddFormWbbListener
admin
wbb\data\thread\ThreadAction
finalizeAction
wbb\system\event\listener\UzbotThreadActionListener
user
wbb\data\thread\ThreadAction
finalizeAction
wbb\system\event\listener\UzbotThreadActionListener
admin
wbb\data\post\PostAction
finalizeAction
wbb\system\event\listener\UzbotPostActionListener
user
wbb\data\post\PostAction
finalizeAction
wbb\system\event\listener\UzbotPostActionListener
admin
wcf\data\modification\log\ModificationLogAction
finalizeAction
wbb\system\event\listener\UzbotThreadModerationListener
user
wcf\data\modification\log\ModificationLogAction
finalizeAction
wbb\system\event\listener\UzbotPostModerationListener
user
wcf\data\uzbot\UzbotAction
finalizeAction
wbb\system\event\listener\UzbotWbbDeleteBotListener
admin
objectType.xml 0100644 0000000 0000000 00000006210 13562177623 012452 0 ustar 00 0000000 0000000
com.uz.wcf.bot.condition.wbbPosts
com.uz.wcf.bot.condition.user
wcf\system\condition\UserIntegerPropertyCondition
contents
wbbPosts
0
com.uz.wcf.bot.wbb.username
com.uz.wcf.bot.condition.wbb
wbb\system\condition\thread\ThreadUsernameCondition
com.woltlab.wbb.thread
general
com.uz.wcf.bot.wbb.thread.time
com.uz.wcf.bot.condition.wbb
wbb\system\condition\uzbot\UzbotThreadIntegerPropertyCondition
com.woltlab.wbb.thread
general
com.uz.wcf.bot.wbb.thread.lastPostTime
com.uz.wcf.bot.condition.wbb
wbb\system\condition\uzbot\UzbotThreadIntegerPropertyCondition
com.woltlab.wbb.thread
general
com.uz.wcf.bot.wbb.replies
com.uz.wcf.bot.condition.wbb
wbb\system\condition\thread\ThreadIntegerPropertyCondition
com.woltlab.wbb.thread
general
0
com.uz.wcf.bot.wbb.views
com.uz.wcf.bot.condition.wbb
wbb\system\condition\thread\ThreadIntegerPropertyCondition
com.woltlab.wbb.thread
general
0
com.uz.wcf.bot.wbb.board
com.uz.wcf.bot.condition.wbb
wbb\system\condition\thread\ThreadBoardCondition
com.woltlab.wbb.thread
general
com.uz.wcf.bot.wbb.state
com.uz.wcf.bot.condition.wbb
wbb\system\condition\thread\ThreadStateCondition
com.woltlab.wbb.thread
general
com.uz.wcf.bot.wbb.state.label
com.uz.wcf.bot.condition.wbb
wbb\system\condition\uzbot\UzbotThreadLabelStateCondition
com.woltlab.wbb.thread
general
objectTypeDefinition.xml 0100644 0000000 0000000 00000000635 13562177623 014470 0 ustar 00 0000000 0000000
com.uz.wcf.bot.condition.wbb
wcf\system\condition\IObjectListCondition
option.xml 0100644 0000000 0000000 00000001000 13562177623 011642 0 ustar 00 0000000 0000000
uzbot.general.data
integer
300
50
5000
package.xml 0100644 0000000 0000000 00000007056 14244463000 011727 0 ustar 00 0000000 0000000
Community Bot 3 - Forum Extension
Community Bot 3 - Forum-Erweiterung
5.5.0
2022-05-29
Udo Zaydowicz
https://zaydowicz.de
com.uz.wcf.bot3
com.woltlab.wbb
com.woltlab.wcf
com.woltlab.wcf
eventListener.xml
files.tar
language/*.xml
update_post.sql
update_thread.sql
update_uzbot.sql
update_uzbot_top.sql
update_stats.sql
option.xml
cronjob.xml
objectTypeDefinition.xml
objectType.xml
templateListener.xml
acptemplates.tar
uzbotNotify.xml
uzbotType.xml
acp/install_com.uz.wcf.bot3.wbb.php
update_uzbot_540.sql
files.tar
acptemplates.tar
language/*.xml
update_uzbot_540.sql
files.tar
acptemplates.tar
language/*.xml
update_uzbot_540.sql
files.tar
acptemplates.tar
language/*.xml
files.tar
templateListener.xml 0100644 0000000 0000000 00000002540 13562177623 013665 0 ustar 00 0000000 0000000
admin
uzbotAdd
UzbotNotify
admin
uzbotAdd
UzbotNotifyJS
admin
uzbotAdd
UzbotType
admin
uzbotAdd
UzbotTypeJS
update_post.sql 0100644 0000000 0000000 00000000070 12476617570 012671 0 ustar 00 0000000 0000000 ALTER TABLE wbb1_post ADD isUzbot TINYINT(1) DEFAULT 0;
update_stats.sql 0100644 0000000 0000000 00000002265 13064417150 013034 0 ustar 00 0000000 0000000 ALTER TABLE wcf1_uzbot_stats ADD board INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD boardCategory INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD boardLink INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD boardClosed INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD boardInvisible INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD thread INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD threadAnnouncement INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD threadPoll INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD threadSticky INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD threadDisabled INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD threadClosed INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD threadDeleted INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD threadView INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD post INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD postDisabled INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD postClosed INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD postDeleted INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD postEdit INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD timeWbb INT(10) DEFAULT 0; update_thread.sql 0100644 0000000 0000000 00000000072 12476617606 013155 0 ustar 00 0000000 0000000 ALTER TABLE wbb1_thread ADD isUzbot TINYINT(1) DEFAULT 0;
update_uzbot.sql 0100644 0000000 0000000 00000001674 14071045354 013046 0 ustar 00 0000000 0000000 ALTER TABLE wcf1_uzbot ADD wbbPostData TEXT;
ALTER TABLE wcf1_uzbot ADD wbbPostModerationData TEXT;
ALTER TABLE wcf1_uzbot ADD wbbThreadData TEXT;
ALTER TABLE wcf1_uzbot ADD wbbThreadModerationData TEXT;
ALTER TABLE wcf1_uzbot ADD wbbThreadModificationData TEXT;
ALTER TABLE wcf1_uzbot ADD postCountAction VARCHAR(15),
ALTER TABLE wcf1_uzbot ADD threadID INT(10);
ALTER TABLE wcf1_uzbot ADD topPosterCount INT(10) DEFAULT 1;
ALTER TABLE wcf1_uzbot ADD topPosterInterval TINYINT(1) DEFAULT 1;
ALTER TABLE wcf1_uzbot ADD topPosterNext INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot ADD threadNewBoardIDs TEXT;
ALTER TABLE wcf1_uzbot ADD uzbotBoardIDs TEXT;
ALTER TABLE wcf1_uzbot ADD postChangeUpdate TINYINT(1) DEFAULT 1;
ALTER TABLE wcf1_uzbot ADD postChangeDelete TINYINT(1) DEFAULT 1;
ALTER TABLE wcf1_uzbot ADD postIsOfficial TINYINT(1) DEFAULT 0;
ALTER TABLE wcf1_uzbot ADD threadIsOfficial TINYINT(1) DEFAULT 0; update_uzbot_540.sql 0100644 0000000 0000000 00000000207 14071045406 013423 0 ustar 00 0000000 0000000 ALTER TABLE wcf1_uzbot ADD postIsOfficial TINYINT(1) DEFAULT 0;
ALTER TABLE wcf1_uzbot ADD threadIsOfficial TINYINT(1) DEFAULT 0; update_uzbot_top.sql 0100644 0000000 0000000 00000000240 13057000746 013713 0 ustar 00 0000000 0000000 ALTER TABLE wcf1_uzbot_top ADD post INT(10) DEFAULT NULL;
ALTER TABLE wcf1_uzbot_top ADD FOREIGN KEY (post) REFERENCES wcf1_user (userID) ON DELETE SET NULL;
uzbotNotify.xml 0100644 0000000 0000000 00000002107 13562177623 012677 0 ustar 00 0000000 0000000
10
1
1
1
1
0
1
0
wbb\data\uzbot\notification\UzbotNotifyForumThread
10
11
1
0
1
0
0
0
0
wbb\data\uzbot\notification\UzbotNotifyForumPost
11
uzbotType.xml 0100644 0000000 0000000 00000010215 13676276361 012354 0 ustar 00 0000000 0000000
30
WBB
0
1
1
0
0
1
30
31
WBB
0
1
1
0
1
postCountAction
postTop
1
31
32
WBB
0
1
0
1
0
1
32
40
WBB
1
1
0
1
0
1
41
41
WBB
0
1
1
0
0
0
42
42
WBB
0
1
1
0
0
1
43
43
WBB
1
1
0
0
0
1
45
44
WBB
0
0
0
0
0
1
44
45
WBB52
0
1
1
0
0
1
40