language/de.xml 0100644 0000000 0000000 00000066422 14105664347 012526 0 ustar 00 0000000 0000000
- Dieser Bot überwacht die Erstellung von Blogs und versendet eine Benachrichtigung, wenn ein Benutzer einen neuen Blog erstellt.
Der Ersteller ist der betroffene Benutzer und kann direkt adressiert werden. Bei Bedarf kann auch ein Artikel direkt im Blog erstellt werden. Dazu muss unter Benachrichtigung „0 - automatisch“ bei „Blog“ eingegeben werden.
Durch Konfiguration der Allgemeinen Benutzer-Bedingungen lassen sich gezielt einzelne Benutzer überwachen.
Die folgenden Bot-spezifischen Platzhalter stehen zur Verfügung:
[count] | Anzahl der erstellten Blogs (immer 1) |
[count-user] | Anzahl der durch den betroffenen Benutzer insgesamt erstellten Blogs |
[blog-access] | Zugriffsrechte des Blogs, der erstellt wurde |
[blog-authors] | Weitere Autoren des Blogs |
[blog-id] | ID des Blogs |
[blog-link] | Link zum Blog |
[blog-title] | Titel des Blogs |
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 das Ändern und das Löschen von Blogs durch den Ersteller und versendet eine Benachrichtigung, wenn ein Benutzer seinen Blog ändert oder löscht. Die Moderation von Blogs wird nicht erfasst.
Der Ersteller ist der betroffene Benutzer und kann direkt adressiert werden.
Durch Konfiguration der Allgemeinen Benutzer-Bedingungen lassen sich gezielt einzelne Benutzer überwachen.
Die folgenden Bot-spezifischen Platzhalter stehen zur Verfügung:
[action] | Ausgeführte Aktion: „geändert“, „gelöscht“ oder „empfohlen“ bzw. „nicht empfohlen“ |
[count] | Anzahl der geänderten / gelöschten Blogs (immer 1) |
[count-user] | Anzahl der durch den betroffenen Benutzer insgesamt erstellten Blogs |
[blog-access] | Zugriffsrechte des Blogs, der erstellt wurde |
[blog-authors] | Weitere Autoren des Blogs |
[blog-id] | ID des Blogs |
[blog-link] | Link zum Blog |
[blog-title] | Titel des Blogs |
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 Erstellung von Artikeln und versendet eine Benachrichtigung, wenn ein Benutzer einen neuen Artikel in einem Blog verfasst und dieser veröffentlicht / freigeschaltet wird.
Der Verfasser ist der betroffene Benutzer und kann direkt adressiert werden. Bei Bedarf kann auch ein Artikel direkt im betroffenen Blog erstellt werden. Dazu muss unter Benachrichtigung „0 - automatisch“ bei „Blog“ eingegeben werden.
Durch Konfiguration der Allgemeinen Benutzer-Bedingungen lassen sich gezielt einzelne Benutzer überwachen.
Die folgenden Bot-spezifischen Platzhalter stehen zur Verfügung:
[count] | Anzahl der erstellten Artikel (immer 1) |
[count-user] | Anzahl der durch den betroffenen Benutzer erstellten Artikel |
[blog-access] | Zugriffsrechte des Blogs, in dem der Artikel erstellt wurde |
[blog-authors] | Weitere Autoren des Blogs |
[blog-id] | ID des Blogs |
[blog-link] | Link zum Blog |
[blog-title] | Titel des Blogs |
[entry-id] | ID des erstellten Artikels |
[entry-link] | Link zum Artikel |
[entry-teaser] | Kurzer Auszug aus Blog-Artikel |
[entry-text] | Text des Artikels |
[entry-title] | Titel des Artikels |
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 Blog-Daten wie z.B. Blogs und Blog-Artikel.
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 Ändern und Löschen von Blog-Artikeln durch den Ersteller und versendet eine Benachrichtigung, wenn ein Benutzer einen Blog-Al ändert oder löscht. Die Moderation von Blog-Artikeln wird nicht erfasst.
Der Ersteller des Artikels ist der betroffene Benutzer und kann direkt adressiert werden.
Durch Konfiguration der Allgemeinen Benutzer-Bedingungen lassen sich gezielt einzelne Benutzer überwachen.
Die folgenden Bot-spezifischen Platzhalter stehen zur Verfügung:
[action] | Ausgeführte Aktion: „geändert“, „gelöscht“ oder „empfohlen“ bzw. „nicht empfohlen“ und weitere |
[count] | Anzahl der geänderten / gelöschten Blog-Artikel (immer 1) |
[count-user] | Anzahl der durch den betroffenen Benutzer insgesamt erstellten Blog-Artikel |
[blog-access] | Zugriffsrechte des Blogs, dessen Artikel geändert / gelöscht wurde |
[blog-authors] | Weitere Autoren des Blogs |
[blog-id] | ID des Blogs |
[blog-link] | Link zum Blog |
[blog-title] | Titel des Blogs |
[entry-id] | ID des Blog-Artikels |
[entry-link] | Link zum Blog-Artikel |
[entry-teaser] | Kurzer Auszug aus Blog-Artikel |
[entry-text] | Text des Blog-Artikels |
[entry-title] | Titel des Blog-Artikels |
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 Blog-Artikeln und erstellt Benachrichtigungen, wenn ein Benutzer einen neuen Artikel verfasst hat und dieser veröffentlicht/freigeschaltet wird.
Der Verfasser des Artikels ist der betroffene Benutzer und kann direkt adressiert werden. Bei Bedarf kann auch ein Artikel direkt im Blog mit dem erkannten Artikel erstellt werden. Dazu muss unter Benachrichtigung „0 - automatisch“ bei „Blog“ eingegeben werden.
Bei „Gesamtzahl der Artikel“ erfolgt die Benachrichtigung, wenn die Gesamtzahl einen der unter „Auslösewerte“ eingegebenen Wert erreicht hat.
Bei „x. Artikel eines Benutzer“ erfolgt die Benachrichtigung, wenn der betroffenen Benutzer eine der unter „Auslösewerte“ eingegebene Anzahl an Artikeln erreicht hat.
Bei „Benutzer mit den meisten Artikeln“ wird benachrichtigt, wenn sich der Benutzer mit den meisten Artikeln ändert. Auslösewerte müssen hierfür nicht konfiguriert werden.
Durch Konfiguration der Allgemeinen Benutzer-Bedingungen kann die Benachrichtigung bei „x. Artikel eines Benutzer“ auf bestimmte Benutzer begrenzt werden.
Die folgenden Bot-spezifischen Platzhalter stehen zur Verfügung:
[count] | Gesamtzahl der veröffentlichten Artikel (ohne Artikel im Papierkorb) |
[count-user] | Anzahl der durch den betroffenen Benutzer insgesamt erstellten Blog-Artikel |
[blog-access] | Zugriffsrechte des Blogs, dessen Artikel geändert / gelöscht wurde |
[blog-authors] | Weitere Autoren des Blogs |
[blog-id] | ID des Blogs |
[blog-link] | Link zum Blog |
[blog-title] | Titel des Blogs |
[entry-id] | ID des Blog-Artikels |
[entry-link] | Link zum Blog-Artikel |
[entry-teaser] | Kurzer Auszug aus Blog-Artikel |
[entry-text] | Text des Blog-Artikels |
[entry-title] | Titel des Blog-Artikels |
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-Blogger (Artikel) in einem wählbaren Zeitraum und versendet eine Benachrichtigung, wenn dieser Zeitraum abgelaufen ist. Es werden alle veröffentlichten und nicht gelöschten Artikel der Benutzer berücksichtigt.
Die ermittelten Top-Blogger sind die betroffenen Benutzer und können direkt adressiert werden.
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-Blogger bekommt die 1, die folgenden Benutzer 2, 3, 4 ... |
[user-count] | Anzahl der Blog-Artikel 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) |
]]>
- Blogs
- Gesamt: {#$blogOld} -- {#$blog} ({if $blog > $blogOld}+{/if}{$blog - $blogOld})
- Zugang Jeder: {#$blogAccessEveryoneOld} -- {#$blogAccessEveryone} ({if $blogAccessEveryone > $blogAccessEveryoneOld}+{/if}{$blogAccessEveryone - $blogAccessEveryoneOld})
- Zugang Registrierte: {#$blogAccessRegisteredOld} -- {#$blogAccessRegistered} ({if $blogAccessRegistered > $blogAccessRegisteredOld}+{/if}{$blogAccessRegistered - $blogAccessRegisteredOld})
- Zugang Following: {#$blogAccessFollowingOld} -- {#$blogAccessFollowing} ({if $blogAccessFollowing > $blogAccessFollowingOld}+{/if}{$blogAccessFollowing - $blogAccessFollowingOld})
- Zugang Privat: {#$blogAccessOwnerOld} -- {#$blogAccessOwner} ({if $blogAccessOwner > $blogAccessOwnerOld}+{/if}{$blogAccessOwner - $blogAccessOwnerOld})
- Empfohlen: {#$blogFeaturedOld} -- {#$blogFeatured} ({if $blogFeatured > $blogFeaturedOld}+{/if}{$blogFeatured - $blogFeaturedOld})
- Kommentare: {#$blogCommentsOld} -- {#$blogComments} ({if $blogComments > $blogCommentsOld}+{/if}{$blogComments - $blogCommentsOld})
- Likes: {#$blogLikesOld} -- {#$blogLikes} ({if $blogLikes > $blogLikesOld}+{/if}{$blogLikes - $blogLikesOld})
- Abonnenten: {#$blogSubscribersOld} -- {#$blogSubscribers} ({if $blogSubscribers > $blogSubscribersOld}+{/if}{$blogSubscribers - $blogSubscribersOld})
- Aufrufe: {#$blogViewsOld} -- {#$blogViews} ({if $blogViews > $blogViewsOld}+{/if}{$blogViews - $blogViewsOld})
Artikel
- Gesamt: {#$blogEntryOld} -- {#$blogEntry} ({if $blogEntry > $blogEntryOld}+{/if}{$blogEntry - $blogEntryOld})
- Zugang Jeder: {#$blogEntryAccessEveryoneOld} -- {#$blogEntryAccessEveryone} ({if $blogEntryAccessEveryone > $blogEntryAccessEveryoneOld}+{/if}{$blogEntryAccessEveryone - $blogEntryAccessEveryoneOld})
- Zugang Registrierte: {#$blogEntryAccessRegisteredOld} -- {#$blogEntryAccessRegistered} ({if $blogEntryAccessRegistered > $blogEntryAccessRegisteredOld}+{/if}{$blogEntryAccessRegistered - $blogEntryAccessRegisteredOld})
- Zugang Following: {#$blogEntryAccessFollowingOld} -- {#$blogEntryAccessFollowing} ({if $blogEntryAccessFollowing > $blogEntryAccessFollowingOld}+{/if}{$blogEntryAccessFollowing - $blogEntryAccessFollowingOld})
- Zugang Privat: {#$blogEntryAccessOwnerOld} -- {#$blogEntryAccessOwner} ({if $blogEntryAccessOwner > $blogEntryAccessOwnerOld}+{/if}{$blogEntryAccessOwner - $blogEntryAccessOwnerOld})
- Gelöscht: {#$blogEntryDeletedOld} -- {#$blogEntryDeleted} ({if $blogEntryDeleted > $blogEntryDeletedOld}+{/if}{$blogEntryDeleted - $blogEntryDeletedOld})
- Deaktiviert: {#$blogEntryDisabledOld} -- {#$blogEntryDisabled} ({if $blogEntryDisabled > $blogEntryDisabledOld}+{/if}{$blogEntryDisabled - $blogEntryDisabledOld})
- Entwurf: {#$blogEntryDraftOld} -- {#$blogEntryDraft} ({if $blogEntryDraft > $blogEntryDraftOld}+{/if}{$blogEntryDraft - $blogEntryDraftOld})
- Empfohlen: {#$blogEntryFeaturedOld} -- {#$blogEntryFeatured} ({if $blogEntryFeatured > $blogEntryFeaturedOld}+{/if}{$blogEntryFeatured - $blogEntryFeaturedOld})
- Umfrage: {#$blogEntryPollOld} -- {#$blogEntryPoll} ({if $blogEntryPoll > $blogEntryPollOld}+{/if}{$blogEntryPoll - $blogEntryPollOld})
- Veröffentlicht: {#$blogEntryPublishedOld} -- {#$blogEntryPublished} ({if $blogEntryPublished > $blogEntryPublishedOld}+{/if}{$blogEntryPublished - $blogEntryPublishedOld})
- Kommentare: {#$blogEntryCommentsOld} -- {#$blogEntryComments} ({if $blogEntryComments > $blogEntryCommentsOld}+{/if}{$blogEntryComments - $blogEntryCommentsOld})
- Likes: {#$blogEntryLikesOld} -- {#$blogEntryLikes} ({if $blogEntryLikes > $blogEntryLikesOld}+{/if}{$blogEntryLikes - $blogEntryLikesOld})
- Aufrufe: {#$blogEntryViewsOld} -- {#$blogEntryViews} ({if $blogEntryViews > $blogEntryViewsOld}+{/if}{$blogEntryViews - $blogEntryViewsOld})
]]>
language/en.xml 0100644 0000000 0000000 00000063047 14105664360 012533 0 ustar 00 0000000 0000000
- This bot monitors the creation of blogs and sends a notification when a user has created a new blog.
The owner of the blog is the affected user and can be directly addressed. If necessary, an article can be created directly in the blog. To do so, you must enter “0 - automatic” under “Blog”.
By configuring the general user conditions, specific users can be monitored.
The following Bot-specific placeholders are available:
[count] | Total number of created blogs (always 1) |
[count-user] | Total number of blogs created by the affected user |
[blog-access] | Access level of the created blog |
[blog-authors] | Further authors of the blog |
[blog-id] | ID of the blog |
[blog-link] | Link to the blog |
[blog-title] | Title of the blog |
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 changes or deletions of blogs by the author and sends a notification when a user changes or deletes a blog owned by him. The moderation og blogs is not monitored.
The owner of the blog is the affected user and can be directly addressed.
By configuring the general user conditions, specific users can be monitored.
The following Bot-specific placeholders are available:
[action] | Action executed by the user: “edited”, “deleted” or “featured” resp. “unfeatured” |
[count] | Total number of created blogs (always 1) |
[count-user] | Total number of blogs created by the affected user |
[blog-access] | Access level of the created blog |
[blog-authors] | Further authors of the blog |
[blog-id] | ID of the blog |
[blog-link] | Link to the blog |
[blog-title] | Title of the blog |
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 blog articles and sends a notification when a user has written a new article and the article is published / enabled.
The author of the article is the affected user and can be directly addressed. If necessary, an article can be created directly in the affected blog. To do so, you must enter “0 - automatic” under “Blog”.
By configuring the general user conditions, specific users can be monitored.
The following Bot-specific placeholders are available:
[count] | Total number of published articles (always 1) |
[count-user] | Number of articles created by the affected user (always 1) |
[blog-access] | Access level of the blog the article was created in |
[blog-authors] | Further authors of the blog |
[blog-id] | ID of the blog |
[blog-link] | Link to the blog |
[blog-title] | Title of the blog |
[entry-id] | ID of the created article |
[entry-link] | Link to the article |
[entry-teaser] | Short teaser of the article |
[entry-text] | Text of the article |
[entry-title] | Title of the article |
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 Blog data like blogs and blog articles.
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 changes or deletions of blog articles by the author and sends a notification when a user changes or deletes a blog article owned by him. The moderation of blog articles is not monitored.
The owner of the blog article is the affected user and can be directly addressed.
By configuring the general user conditions, specific users can be monitored.
The following Bot-specific placeholders are available:
[action] | Action executed by the user: “edited”, “deleted” or “featured” resp. “unfeatured” and others |
[count] | Number of blog articles edited or deleted by the user (always 1) |
[count-user] | Total number of blog articles created by the affected user |
[blog-access] | Access level of the created blog |
[blog-authors] | Further authors of the blog |
[blog-id] | ID of the blog |
[blog-link] | Link to the blog |
[blog-title] | Title of the blog |
[entry-id] | ID of the blog article |
[entry-link] | Link to the blog article |
[entry-teaser] | Short teaser of the article |
[entry-text] | Text of the blog article |
[entry-title] | Title of the blog article |
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 articles and sends a notification when a user has written a new Blog article and the article is published.
The author of the article is affected user and can be directly addressed. If necessary, a article can be created directly in the blog with the recognized article. To do so, you must enter “0 - Automatic” under “Blog”.
“Total number of articles” will force a notification when the total number of articles reaches one of the values in “Trigger Values”.
Using “Xth article of a user” the notification will be sent when the affected user’s count for articles reaches one of the values in “Trigger Values”.
“User with the most articles” will force a notification when the user with the most articles changes. Trigger values don’t need to be configured.
By configuration of general user conditions the notification for “Xth article of a user” can be limited to certain users.
The following Bot-specific placeholders are available:
[count] | Total number of articles (without articles in trash can) |
[count-user] | Number of articles of the affected user |
[blog-access] | Access level of the created blog |
[blog-authors] | Further authors of the blog |
[blog-id] | ID of the blog |
[blog-link] | Link to the blog |
[blog-title] | Title of the blog |
[entry-id] | ID of the blog article |
[entry-link] | Link to the blog article |
[entry-teaser] | Short teaser of the article |
[entry-text] | Text of the blog article |
[entry-title] | Title of the blog article |
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 bloggers for the given time period and sends a notification when the period has expired. All published and not deleted blog articles are accounted for.
The top bloggers are the affected users and can be directly addressed.
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 blogger gets a 1, the following users 2, 3, 4 ... |
[user-count] | Number of blog articles 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) |
]]>
- Blogs
- Total: {#$blogOld} -- {#$blog} ({if $blog > $blogOld}+{/if}{$blog - $blogOld})
- Access Everyone: {#$blogAccessEveryoneOld} -- {#$blogAccessEveryone} ({if $blogAccessEveryone > $blogAccessEveryoneOld}+{/if}{$blogAccessEveryone - $blogAccessEveryoneOld})
- Access Registered: {#$blogAccessRegisteredOld} -- {#$blogAccessRegistered} ({if $blogAccessRegistered > $blogAccessRegisteredOld}+{/if}{$blogAccessRegistered - $blogAccessRegisteredOld})
- Access Following: {#$blogAccessFollowingOld} -- {#$blogAccessFollowing} ({if $blogAccessFollowing > $blogAccessFollowingOld}+{/if}{$blogAccessFollowing - $blogAccessFollowingOld})
- Access Private: {#$blogAccessOwnerOld} -- {#$blogAccessOwner} ({if $blogAccessOwner > $blogAccessOwnerOld}+{/if}{$blogAccessOwner - $blogAccessOwnerOld})
- Featured: {#$blogFeaturedOld} -- {#$blogFeatured} ({if $blogFeatured > $blogFeaturedOld}+{/if}{$blogFeatured - $blogFeaturedOld})
- Comments: {#$blogCommentsOld} -- {#$blogComments} ({if $blogComments > $blogCommentsOld}+{/if}{$blogComments - $blogCommentsOld})
- Likes: {#$blogLikesOld} -- {#$blogLikes} ({if $blogLikes > $blogLikesOld}+{/if}{$blogLikes - $blogLikesOld})
- Subscribers: {#$blogSubscribersOld} -- {#$blogSubscribers} ({if $blogSubscribers > $blogSubscribersOld}+{/if}{$blogSubscribers - $blogSubscribersOld})
- Views: {#$blogViewsOld} -- {#$blogViews} ({if $blogViews > $blogViewsOld}+{/if}{$blogViews - $blogViewsOld})
Articles
- Total: {#$blogEntryOld} -- {#$blogEntry} ({if $blogEntry > $blogEntryOld}+{/if}{$blogEntry - $blogEntryOld})
- Access Everyone: {#$blogEntryAccessEveryoneOld} -- {#$blogEntryAccessEveryone} ({if $blogEntryAccessEveryone > $blogEntryAccessEveryoneOld}+{/if}{$blogEntryAccessEveryone - $blogEntryAccessEveryoneOld})
- Access Registered: {#$blogEntryAccessRegisteredOld} -- {#$blogEntryAccessRegistered} ({if $blogEntryAccessRegistered > $blogEntryAccessRegisteredOld}+{/if}{$blogEntryAccessRegistered - $blogEntryAccessRegisteredOld})
- Access Following: {#$blogEntryAccessFollowingOld} -- {#$blogEntryAccessFollowing} ({if $blogEntryAccessFollowing > $blogEntryAccessFollowingOld}+{/if}{$blogEntryAccessFollowing - $blogEntryAccessFollowingOld})
- Access Private: {#$blogEntryAccessOwnerOld} -- {#$blogEntryAccessOwner} ({if $blogEntryAccessOwner > $blogEntryAccessOwnerOld}+{/if}{$blogEntryAccessOwner - $blogEntryAccessOwnerOld})
- Deleted: {#$blogEntryDeletedOld} -- {#$blogEntryDeleted} ({if $blogEntryDeleted > $blogEntryDeletedOld}+{/if}{$blogEntryDeleted - $blogEntryDeletedOld})
- Disabled: {#$blogEntryDisabledOld} -- {#$blogEntryDisabled} ({if $blogEntryDisabled > $blogEntryDisabledOld}+{/if}{$blogEntryDisabled - $blogEntryDisabledOld})
- Draft: {#$blogEntryDraftOld} -- {#$blogEntryDraft} ({if $blogEntryDraft > $blogEntryDraftOld}+{/if}{$blogEntryDraft - $blogEntryDraftOld})
- Featured: {#$blogEntryFeaturedOld} -- {#$blogEntryFeatured} ({if $blogEntryFeatured > $blogEntryFeaturedOld}+{/if}{$blogEntryFeatured - $blogEntryFeaturedOld})
- Polls: {#$blogEntryPollOld} -- {#$blogEntryPoll} ({if $blogEntryPoll > $blogEntryPollOld}+{/if}{$blogEntryPoll - $blogEntryPollOld})
- Published: {#$blogEntryPublishedOld} -- {#$blogEntryPublished} ({if $blogEntryPublished > $blogEntryPublishedOld}+{/if}{$blogEntryPublished - $blogEntryPublishedOld})
- Comments: {#$blogEntryCommentsOld} -- {#$blogEntryComments} ({if $blogEntryComments > $blogEntryCommentsOld}+{/if}{$blogEntryComments - $blogEntryCommentsOld})
- Likes: {#$blogEntryLikesOld} -- {#$blogEntryLikes} ({if $blogEntryLikes > $blogEntryLikesOld}+{/if}{$blogEntryLikes - $blogEntryLikesOld})
- Views: {#$blogEntryViewsOld} -- {#$blogEntryViews} ({if $blogEntryViews > $blogEntryViewsOld}+{/if}{$blogEntryViews - $blogEntryViewsOld})
]]>
acptemplates.tar 0100644 0000000 0000000 00000050000 14240157512 012773 0 ustar 00 0000000 0000000 __uzbotAddNotifyBlog.tpl 0100644 0000000 0000000 00000010210 13464575406 014405 0 ustar 00 0000000 0000000
__uzbotAddNotifyBlogJS.tpl 0100644 0000000 0000000 00000000167 14240156004 014632 0 ustar 00 0000000 0000000 $('.notifyBlogSettings').hide();
if ($value == 20) {
$('.notifyBlogSettings, .notifySubject, .notifyTags').show();
}
__uzbotAddTypeBlog.tpl 0100644 0000000 0000000 00000005710 13072352210 014044 0 ustar 00 0000000 0000000
{lang}wcf.acp.uzbot.type.description.notifyOnly.userCondition{/lang}
{lang}wcf.acp.uzbot.type.description.notifyOnly.userCondition{/lang}
{lang}wcf.acp.uzbot.type.description.notifyOnly.userCondition{/lang}
{lang}wcf.acp.uzbot.type.description.notifyOnly.userCondition{/lang}
{lang}wcf.acp.uzbot.type.description.notifyOnly{/lang}
__uzbotAddTypeBlogJS.tpl 0100644 0000000 0000000 00000001657 13074061736 014323 0 ustar 00 0000000 0000000 $('.blog_blogChange, .blog_entryChange, .blog_entryCount, .blog_blogNew').hide();
$('.blog_entryNew, .blog_statistics, .blog_topBlogger').hide();
if (value == 50) {
$('.blog_blogNew, .uzbotUserConditions').show();
$('#receiverAffected').show();
}
if (value == 51) {
$('.blog_entryNew, .uzbotUserConditions').show();
$('#receiverAffected').show();
}
if (value == 52) {
$('.blog_blogChange, .uzbotUserConditions').show();
$('#receiverAffected').show();
}
if (value == 53) {
$('.blog_statistics').show();
}
if (value == 54) {
$('.blog_entryChange, .uzbotUserConditions').show();
$('#receiverAffected').show();
}
if (value == 55) {
$('.blog_entryCount, .uzbotUserConditions, .user_count').show();
$('#receiverAffected').show();
}
if (value == 56) {
$('.blog_topBlogger, .condenseSetting, .uzbotUserConditions').show();
$('#receiverAffected').show();
if ($('#condenseEnable').is(':checked')) { $('.notifyCondense').show(); }
}
files.tar 0100644 0000000 0000000 00000214000 14240157512 011415 0 ustar 00 0000000 0000000 acp/ 0040755 0000000 0000000 00000000000 14114207043 010347 5 ustar 00 0000000 0000000 lib/ 0040755 0000000 0000000 00000000000 14114207043 010352 5 ustar 00 0000000 0000000 lib/data/ 0040755 0000000 0000000 00000000000 14114207043 011263 5 ustar 00 0000000 0000000 lib/data/uzbot/ 0040755 0000000 0000000 00000000000 14114207043 012426 5 ustar 00 0000000 0000000 lib/data/uzbot/notification/ 0040755 0000000 0000000 00000000000 14114207043 015114 5 ustar 00 0000000 0000000 lib/system/ 0040755 0000000 0000000 00000000000 14114207043 011676 5 ustar 00 0000000 0000000 lib/system/cronjob/ 0040755 0000000 0000000 00000000000 14114207043 013332 5 ustar 00 0000000 0000000 lib/system/event/ 0040755 0000000 0000000 00000000000 14114207043 013017 5 ustar 00 0000000 0000000 lib/system/event/listener/ 0040755 0000000 0000000 00000000000 14114207043 014644 5 ustar 00 0000000 0000000 acp/install_com.uz.wcf.bot3.blog.php 0100644 0000000 0000000 00000001263 14240156427 016377 0 ustar 00 0000000 0000000
* @package com.uz.wcf.bot3.blog
*/
// posts
$topBloggerID = null;
$sql = "SELECT userID, blogEntries
FROM wcf".WCF_N."_user
ORDER BY blogEntries DESC";
$statement = WCF::getDB()->prepareStatement($sql, 1);
$statement->execute();
$row = $statement->fetchArray();
if (!empty($row)) $topBloggerID = $row['userID'];
$action = new UzbotTopAction([1], 'update', [
'data' => [
'blogEntry' => $topBloggerID
]
]);
$action->executeAction();
lib/data/uzbot/notification/UzbotNotifyBlogEntry.class.php 0100644 0000000 0000000 00000007136 14240156427 023070 0 ustar 00 0000000 0000000
* @package com.uz.wcf.bot3.blog
*/
class UzbotNotifyBlogEntry {
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.blog.entry', 0);
// get blog / notification data
$blogEntryData = unserialize($bot->blogEntryData);
// tags to include feedreader
if (!MODULE_TAGGING) {
$tags = [];
}
else {
if (isset($bot->feedreaderUseTags) && $bot->feedreaderUseTags) {
if (isset($bot->feedreaderTags) && !empty($bot->feedreaderTags)) {
$tags = array_unique(array_merge($tags, $bot->feedreaderTags));
}
}
}
// create entry
// preset blogID (automtic)
$blogID = $bot->blogID;
if ($blogEntryData['blogID']) $blogID = $blogEntryData['blogID'];
try {
$blog = new Blog($blogID);
$data = [
'blogID' => $blog->blogID,
'languageID' => $language->languageID,
'accessLevel' => $blog->accessLevel,
'subject' => $subject,
'time' => $publicationTime,
'userID' => $bot->senderID,
'username' => $bot->sendername,
'enableComments' => $blogEntryData['enableComments'],
'isDisabled' => $blogEntryData['isDisabled'],
'isFeatured' => $blogEntryData['isFeatured'],
'isDraft' => $blogEntryData['isDraft'],
'isPublished' => $blogEntryData['isDraft'] ? 0 :1,
'isUzbot' => 1
];
$entryData = [
'data' => $data,
'categoryIDs' => unserialize($blogEntryData['categoryIDs']),
'attachmentHandler' => null,
'htmlInputProcessor' => $htmlInputProcessor,
'tags' => $tags
];
$this->objectAction = new EntryAction([], 'create', $entryData);
$resultValues = $this->objectAction->executeAction();
}
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 {
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/cronjob/UzbotBlogTopBloggerCronjob.class.php 0100644 0000000 0000000 00000014114 14240156427 022367 0 ustar 00 0000000 0000000
* @package com.uz.wcf.bot3.blog
*/
class UzbotBlogTopBloggerCronjob extends AbstractCronjob {
/**
* @inheritDoc
*/
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' => 'blog_topBlogger'));
if (empty($bots)) return;
$defaultLanguage = LanguageFactory::getInstance()->getLanguage(LanguageFactory::getInstance()->getDefaultLanguageID());
// Step through all bots and get top blogger
foreach ($bots as $bot) {
// set first next if 0
if (!$bot->topBloggerNext) {
$month = date('n');
$year = date('Y');
switch ($bot->topBloggerInterval) {
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 ($months >= 10) $next = gmmktime(0, 0, 0, 1, 1, $year + 1);
elseif ($months >= 7) $next = gmmktime(0, 0, 0, 10, 1, $year);
elseif ($months >= 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(['topBloggerNext' => $next]);
UzbotEditor::resetCache();
$bot->topBloggerNext = $next;
}
// leave if time does not match, unless test mode
if (!$bot->testMode) {
if ($bot->topBloggerNext > TIME_NOW) continue;
}
// must execute
$end = $bot->topBloggerNext;
$month = date('n');
$year = date('Y');
switch ($bot->topBloggerInterval) {
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 : 12, 1, $month > 3 ? $year : $year - 1);
if ($months >= 10) $next = gmmktime(0, 0, 0, 1, 1, $year + 1);
elseif ($months >= 7) $next = gmmktime(0, 0, 0, 10, 1, $year);
elseif ($months >= 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(['topBloggerNext' => $next]);
UzbotEditor::resetCache();
}
// get top blogger
$affectedUserIDs = $countToUserID = $placeholders = $userIDs = [];
$rank = 0;
$conditions = $bot->getUserConditions();
if (count($conditions)) {
$userList = new UserList();
foreach ($conditions as $condition) {
$condition->getObjectType()->getProcessor()->addUserCondition($condition, $userList);
}
$userList->readObjectIDs();
$userIDs = $userList->getObjectIDs();
}
$conditionBuilder = new PreparedStatementConditionBuilder();
if (count($userIDs)) $conditionBuilder->add('entry.userID IN (?)', [$userIDs]);
else $conditionBuilder->add('entry.userID > ?', [0]);
$conditionBuilder->add('entry.isDeleted = ?', [0]);
$conditionBuilder->add('entry.isDraft = ?', [0]);
$conditionBuilder->add('entry.isPublished = ?', [1]);
$conditionBuilder->add('entry.time > ?', [$start]);
$conditionBuilder->add('entry.time < ?', [$end]);
$sql = "SELECT userID as topID, COUNT(*) as count
FROM blog".WCF_N."_entry entry
".$conditionBuilder."
GROUP BY topID
ORDER BY count DESC";
$statement = WCF::getDB()->prepareStatement($sql, $bot->topBloggerCount);
$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/UzbotStatsBlogCronjob.class.php 0100644 0000000 0000000 00000024063 14240156427 021425 0 ustar 00 0000000 0000000
* @package com.uz.wcf.bot3.blog
*/
class UzbotStatsBlogCronjob extends AbstractCronjob {
/**
* @inheritDoc
*/
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
// Blog
$sql = "SELECT COUNT(*) as blog,
COALESCE(SUM(isFeatured), 0) AS blogFeatured,
COALESCE(SUM(comments), 0) AS blogComments,
COALESCE(SUM(cumulativeLikes), 0) AS blogLikes,
COALESCE(SUM(views), 0) AS blogViews,
COALESCE(SUM(subscribers), 0) AS blogSubscribers
FROM blog".WCF_N."_blog";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute();
$row = $statement->fetchArray();
$stats->blog = $row['blog'];
$stats->blogFeatured = $row['blogFeatured'];
$stats->blogComments = $row['blogComments'];
$stats->blogLikes = $row['blogLikes'];
$stats->blogSubscribers = $row['blogSubscribers'];
$stats->blogViews = $row['blogViews'];
$sql = "SELECT COUNT(*) as total
FROM blog".WCF_N."_blog
WHERE accessLevel = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([Blog::ACCESS_EVERYONE]);
$row = $statement->fetchArray();
$stats->blogAccessEveryone = $row['total'];
$sql = "SELECT COUNT(*) as total
FROM blog".WCF_N."_blog
WHERE accessLevel = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([Blog::ACCESS_REGISTERED]);
$row = $statement->fetchArray();
$stats->blogAccessRegistered = $row['total'];
$sql = "SELECT COUNT(*) as total
FROM blog".WCF_N."_blog
WHERE accessLevel = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([Blog::ACCESS_FOLLOWING]);
$row = $statement->fetchArray();
$stats->blogAccessFollowing = $row['total'];
$sql = "SELECT COUNT(*) as total
FROM blog".WCF_N."_blog
WHERE accessLevel = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([Blog::ACCESS_OWNER]);
$row = $statement->fetchArray();
$stats->blogAccessOwner = $row['total'];
// Blog Entries
$sql = "SELECT COUNT(*) as blogEntry,
COALESCE(SUM(isDeleted), 0) AS blogEntryDeleted,
COALESCE(SUM(isDisabled), 0) AS blogEntryDisabled,
COALESCE(SUM(isDraft), 0) AS blogEntryDraft,
COALESCE(SUM(isFeatured), 0) AS blogEntryFeatured,
COALESCE(SUM(isPublished), 0) AS blogEntryPublished,
COALESCE(SUM(comments), 0) AS blogEntryComments,
COALESCE(SUM(cumulativeLikes), 0) AS blogEntryLikes,
COALESCE(SUM(views), 0) AS blogEntryViews
FROM blog".WCF_N."_entry";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute();
$row = $statement->fetchArray();
$stats->blogEntry = $row['blogEntry'];
$stats->blogEntryDeleted = $row['blogEntryDeleted'];
$stats->blogEntryDisabled = $row['blogEntryDisabled'];
$stats->blogEntryDraft = $row['blogEntryDraft'];
$stats->blogEntryFeatured = $row['blogEntryFeatured'];
$stats->blogEntryPublished = $row['blogEntryPublished'];
$stats->blogEntryComments = $row['blogEntryComments'];
$stats->blogEntryLikes = $row['blogEntryLikes'];
$stats->blogEntryViews = $row['blogEntryViews'];
$sql = "SELECT COUNT(*) as total
FROM blog".WCF_N."_entry
WHERE accessLevel = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([Blog::ACCESS_EVERYONE]);
$row = $statement->fetchArray();
$stats->blogEntryAccessEveryone = $row['total'];
$sql = "SELECT COUNT(*) as total
FROM blog".WCF_N."_entry
WHERE accessLevel = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([Blog::ACCESS_REGISTERED]);
$row = $statement->fetchArray();
$stats->blogEntryAccessRegistered = $row['total'];
$sql = "SELECT COUNT(*) as total
FROM blog".WCF_N."_entry
WHERE accessLevel = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([Blog::ACCESS_FOLLOWING]);
$row = $statement->fetchArray();
$stats->blogEntryAccessFollowing = $row['total'];
$sql = "SELECT COUNT(*) as total
FROM blog".WCF_N."_entry
WHERE accessLevel = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([Blog::ACCESS_OWNER]);
$row = $statement->fetchArray();
$stats->blogEntryAccessOwner = $row['total'];
$sql = "SELECT COUNT(*) as total
FROM blog".WCF_N."_entry
WHERE pollID IS NOT NULL";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute();
$row = $statement->fetchArray();
$stats->blogEntryPoll = $row['total'];
// don't update stats here
// Read all active, valid activity bots, abort if none
$bots = UzbotValidBotCacheBuilder::getInstance()->getData(['typeDes' => 'blog_statistics']);
if (!count($bots)) return;
$result = [
'blog' => $stats->blog,
'blogOld' => $statsOld->blog,
'blogAccessEveryone' => $stats->blogAccessEveryone,
'blogAccessEveryoneOld' => $statsOld->blogAccessEveryone,
'blogAccessRegistered' => $stats->blogAccessRegistered,
'blogAccessRegisteredOld' => $statsOld->blogAccessRegistered,
'blogAccessFollowing' => $stats->blogAccessFollowing,
'blogAccessFollowingOld' => $statsOld->blogAccessFollowing,
'blogAccessOwner' => $stats->blogAccessOwner,
'blogAccessOwnerOld' => $statsOld->blogAccessOwner,
'blogFeatured' => $stats->blogFeatured,
'blogFeaturedOld' => $statsOld->blogFeatured,
'blogComments' => $stats->blogComments,
'blogCommentsOld' => $statsOld->blogComments,
'blogLikes' => $stats->blogLikes,
'blogLikesOld' => $statsOld->blogLikes,
'blogSubscribers' => $stats->blogSubscribers,
'blogSubscribersOld' => $statsOld->blogSubscribers,
'blogViews' => $stats->blogViews,
'blogViewsOld' => $statsOld->blogViews,
'blogEntry' => $stats->blogEntry,
'blogEntryOld' => $statsOld->blogEntry,
'blogEntryAccessEveryone' => $stats->blogEntryAccessEveryone,
'blogEntryAccessEveryoneOld' => $statsOld->blogEntryAccessEveryone,
'blogEntryAccessRegistered' => $stats->blogEntryAccessRegistered,
'blogEntryAccessRegisteredOld' => $statsOld->blogEntryAccessRegistered,
'blogEntryAccessFollowing' => $stats->blogEntryAccessFollowing,
'blogEntryAccessFollowingOld' => $statsOld->blogEntryAccessFollowing,
'blogEntryAccessOwner' => $stats->blogEntryAccessOwner,
'blogEntryAccessOwnerOld' => $statsOld->blogEntryAccessOwner,
'blogEntryDeleted' => $stats->blogEntryDeleted,
'blogEntryDeletedOld' => $statsOld->blogEntryDeleted,
'blogEntryDisabled' => $stats->blogEntryDisabled,
'blogEntryDisabledOld' => $statsOld->blogEntryDisabled,
'blogEntryDraft' => $stats->blogEntryDraft,
'blogEntryDraftOld' => $statsOld->blogEntryDraft,
'blogEntryFeatured' => $stats->blogEntryFeatured,
'blogEntryFeaturedOld' => $statsOld->blogEntryFeatured,
'blogEntryPoll' => $stats->blogEntryPoll,
'blogEntryPollOld' => $statsOld->blogEntryPoll,
'blogEntryPublished' => $stats->blogEntryPublished,
'blogEntryPublishedOld' => $statsOld->blogEntryPublished,
'blogEntryComments' => $stats->blogEntryComments,
'blogEntryCommentsOld' => $statsOld->blogEntryComments,
'blogEntryLikes' => $stats->blogEntryLikes,
'blogEntryLikesOld' => $statsOld->blogEntryLikes,
'blogEntryViews' => $stats->blogEntryViews,
'blogEntryViewsOld' => $statsOld->blogEntryViews
];
$placeholders['stats'] = $result;
$placeholders['stats-lang'] = 'wcf.uzbot.stats.blog';
$placeholders['date-from'] = $statsOld->timeBlog;
$placeholders['time-from'] = $statsOld->timeBlog;
$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([
'blog' => $stats->blog,
'blogAccessEveryone' => $stats->blogAccessEveryone,
'blogAccessRegistered' => $stats->blogAccessRegistered,
'blogAccessFollowing' => $stats->blogAccessFollowing,
'blogAccessOwner' => $stats->blogAccessOwner,
'blogFeatured' => $stats->blogFeatured,
'blogComments' => $stats->blogComments,
'blogLikes' => $stats->blogLikes,
'blogSubscribers' => $stats->blogSubscribers,
'blogViews' => $stats->blogViews,
'blogEntry' => $stats->blogEntry,
'blogEntryAccessEveryone' => $stats->blogEntryAccessEveryone,
'blogEntryAccessRegistered' => $stats->blogEntryAccessRegistered,
'blogEntryAccessFollowing' => $stats->blogEntryAccessFollowing,
'blogEntryAccessOwner' => $stats->blogEntryAccessOwner,
'blogEntryDeleted' => $stats->blogEntryDeleted,
'blogEntryDisabled' => $stats->blogEntryDisabled,
'blogEntryDraft' => $stats->blogEntryDraft,
'blogEntryFeatured' => $stats->blogEntryFeatured,
'blogEntryPoll' => $stats->blogEntryPoll,
'blogEntryPublished' => $stats->blogEntryPublished,
'blogEntryComments' => $stats->blogEntryComments,
'blogEntryLikes' => $stats->blogEntryLikes,
'blogEntryViews' => $stats->blogEntryViews,
'timeBlog' => 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/event/listener/UzbotAddFormBlogListener.class.php 0100644 0000000 0000000 00000015421 14240156427 023344 0 ustar 00 0000000 0000000
* @package com.uz.wcf.bot3.blog
*/
class UzbotAddFormBlogListener implements IParameterizedEventListener {
/**
* instance of UzbotAddForm
*/
protected $eventObj;
/**
* general data
*/
protected $availableBlogs = [];
protected $blogCategoryList;
/**
* entry data
*/
protected $blogID = 0;
protected $blogCategoryIDs = [];
protected $blogEnableComments = 1;
protected $blogIsDisabled = 0;
protected $blogIsDraft = 0;
protected $blogIsFeatured = 0;
protected $blogEntryCountAction = 'entryTotal';
/**
* further data
*/
protected $topBloggerCount = 1;
protected $topBloggerInterval = 1;
/**
* @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->blogEntryData)) {
$blogEntryData = unserialize($this->eventObj->uzbot->blogEntryData);
$this->blogID = $blogEntryData['blogID'];
$this->blogCategoryIDs = unserialize($blogEntryData['categoryIDs']);
$this->blogEnableComments = $blogEntryData['enableComments'];
$this->blogIsDisabled = $blogEntryData['isDisabled'];
$this->blogIsDraft = $blogEntryData['isDraft'];
$this->blogIsFeatured = $blogEntryData['isFeatured'];
}
$this->blogEntryCountAction = $this->eventObj->uzbot->blogEntryCountAction;
$this->topBloggerCount = $this->eventObj->uzbot->topBloggerCount;
$this->topBloggerInterval = $this->eventObj->uzbot->topBloggerInterval;
}
}
/**
* Handles the assignVariables event.
*/
protected function assignVariables() {
// get categories
$excludedCategoryIDs = array_diff(BlogCategory::getAccessibleCategoryIDs(), BlogCategory::getAccessibleCategoryIDs(['canUseCategory']));
$categoryTree = new BlogCategoryNodeTree('com.woltlab.blog.category', 0, false, $excludedCategoryIDs);
$this->blogCategoryList = $categoryTree->getIterator();
$this->blogCategoryList->setMaxDepth(0);
$blogList = new BlogList();
$blogList->readObjects();
$availableBlogs = $blogList->getObjects();
WCF::getTPL()->assign([
'availableBlogs' => $availableBlogs,
'blogCategoryList' => $this->blogCategoryList,
'blogID' => $this->blogID,
'blogCategoryIDs' => $this->blogCategoryIDs,
'blogEnableComments' => $this->blogEnableComments,
'blogIsDisabled' => $this->blogIsDisabled,
'blogIsDraft' => $this->blogIsDraft,
'blogIsFeatured' => $this->blogIsFeatured,
'blogEntryCountAction' => $this->blogEntryCountAction,
'topBloggerCount' => $this->topBloggerCount,
'topBloggerInterval' => $this->topBloggerInterval
]);
}
/**
* Handles the readFormParameters event.
*/
protected function readFormParameters() {
if (isset($_REQUEST['blogID'])) $this->blogID = intval($_REQUEST['blogID']);
if (isset($_REQUEST['blogCategoryIDs']) && is_array($_REQUEST['blogCategoryIDs'])) $this->blogCategoryIDs = ArrayUtil::toIntegerArray($_REQUEST['blogCategoryIDs']);
$this->blogEnableComments = $this->blogIsDisabled = $this->blogIsDraft = $this->blogIsFeatured = 0;
if (isset($_POST['blogEnableComments'])) $this->blogEnableComments = intval($_POST['blogEnableComments']);
if (isset($_POST['blogIsDisabled'])) $this->blogIsDisabled = intval($_POST['blogIsDisabled']);
if (isset($_POST['blogIsDraft'])) $this->blogIsDraft = intval($_POST['blogIsDraft']);
if (isset($_POST['blogIsFeatured'])) $this->blogIsFeatured = intval($_POST['blogIsFeatured']);
if (isset($_POST['blogEntryCountAction'])) $this->blogEntryCountAction = StringUtil::trim($_POST['blogEntryCountAction']);
if (isset($_POST['topBloggerCount'])) $this->topBloggerCount = intval($_POST['topBloggerCount']);
if (isset($_POST['topBloggerInterval'])) $this->topBloggerInterval = intval($_POST['topBloggerInterval']);
}
/**
* Handles the validate event.
*/
protected function validate() {
$blogList = new BlogList();
$blogList->readObjects();
$availableBlogs = $blogList->getObjects();
// Get type / notify data
$type = UzbotType::getTypeByID($this->eventObj->typeID);
$notify = UzbotNotify::getNotifyByID($this->eventObj->notifyID);
// blog notify
if ($notify->notifyTitle == 'blog') {
// blogID, allow 0 on certain bots
if (!$this->blogID) {
$allowed = ['blog_blogNew', 'blog_entryNew', 'blog_entryCount'];
if (!in_array($type->typeTitle, $allowed)) {
throw new UserInputException('blogID', 'invalid');
}
}
else {
if (!isset($availableBlogs[$this->blogID])) {
throw new UserInputException('blogID', 'invalid');
}
}
// categoryIDs
if (empty($this->blogCategoryIDs)) {
throw new UserInputException('blogCategoryIDs', 'notConfigured');
}
$categories = [];
foreach ($this->blogCategoryIDs as $categoryID) {
$category = CategoryHandler::getInstance()->getCategory($categoryID);
if ($category === null) throw new UserInputException('blogCategoryIDs', 'invalid');
}
// count leaf categories
$leafCategories = $categories;
foreach ($categories as $category) {
if ($category->parentCategoryID && isset($leafCategories[$category->parentCategoryID])) {
unset($leafCategories[$category->parentCategoryID]);
}
}
if (count($leafCategories) > BLOG_ENTRY_MAX_CATEGORIES) {
throw new UserInputException('blogCategoryIDs', 'tooMany');
}
}
}
/**
* Handles the save event.
*/
protected function save() {
$blogEntryData = [
'blogID' => $this->blogID,
'categoryIDs' => serialize($this->blogCategoryIDs),
'enableComments' => $this->blogEnableComments,
'isDisabled' => $this->blogIsDisabled,
'isDraft' => $this->blogIsDraft,
'isFeatured' => $this->blogIsFeatured
];
$this->eventObj->additionalFields = array_merge($this->eventObj->additionalFields, [
'blogEntryData' => serialize($blogEntryData),
'blogEntryCountAction' => $this->blogEntryCountAction,
'topBloggerCount' => $this->topBloggerCount,
'topBloggerInterval' => $this->topBloggerInterval
]);
}
/**
* Handles the saved event.
*/
protected function saved() {
// not yet ...
}
}
lib/system/event/listener/UzbotBlogBlogActionListener.class.php 0100644 0000000 0000000 00000021232 14240156427 024046 0 ustar 00 0000000 0000000
* @package com.uz.wcf.bot3.blog
*/
class UzbotBlogBlogActionListener implements IParameterizedEventListener {
/**
* @inheritDoc
*/
public function execute($eventObj, $className, $eventName, array &$parameters) {
// check module
if (!MODULE_UZBOT) return;
$defaultLanguage = LanguageFactory::getInstance()->getLanguage(LanguageFactory::getInstance()->getDefaultLanguageID());
$action = $eventObj->getActionName();
// Blog publication on create
if ($action == 'create') {
// no guests
if (!WCF::getUser()->userID) return;
// get blog data
$params = $eventObj->getParameters();
$accessLevel = $params['data']['accessLevel'];
$authors = $params['authors'];
$retValues = $eventObj->getReturnValues();
$blog = $retValues['returnValues'];
// new blog
// Read all active, valid activity bots, abort if none
$bots = UzbotValidBotCacheBuilder::getInstance()->getData(['typeDes' => 'blog_blogNew']);
if (count($bots)) {
foreach ($bots as $bot) {
$affectedUserIDs = $countToUserID = $placeholders = [];
$count = 1;
// check for conditions, if exist, no guests
$conditions = $bot->getUserConditions();
if (count($conditions)) {
$userList = new UserList();
$userList->getConditionBuilder()->add('user_table.userID = ?', [WCF::getUser()->userID]);
foreach ($conditions as $condition) {
$condition->getObjectType()->getProcessor()->addUserCondition($condition, $userList);
}
$userList->readObjectIDs();
if (!count($userList->getObjectIDs())) continue;
}
$affectedUserIDs[] = WCF::getUser()->userID;
$countToUserID[WCF::getUser()->userID] = WCF::getUser()->blogs;
// save blogID for entry in affected blog, support open
$bot->blogID = $blog->blogID;
// get access level string
$access = 'wcf.uzbot.blog.access.';
if ($accessLevel == Blog::ACCESS_EVERYONE) $access .= 'everyone';
elseif ($accessLevel == Blog::ACCESS_REGISTERED) $access .= 'registered';
elseif ($accessLevel == Blog::ACCESS_FOLLOWING) $access .= 'following';
elseif ($accessLevel == Blog::ACCESS_OWNER) $access .= 'nobody';
// get authors
$authors = $blog->getAuthors();
$names = [];
if (count($authors)) {
foreach ($authors as $author) {
$names[] = $author->username;
}
}
$placeholders['count'] = 1;
$placeholders['count-user'] = WCF::getUser()->blogs + 1;
$placeholders['blog-access'] = $access;
$placeholders['blog-authors'] = count($names) ? implode(', ', $names) : ' ';
$placeholders['blog-id'] = $blog->blogID;
$placeholders['blog-link'] = $blog->getLink();
$placeholders['blog-title'] = $blog->getTitle();
$placeholders['translate'] = ['blog-access'];
// 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);
}
}
}
// blog change by user
elseif ($action == 'update' || $action == 'delete' || $action == 'setAsFeatured' || $action == 'unsetAsFeatured') {
$blog = $eventObj->getObjects()[0]->getDecoratedObject();
if ($blog->userID && WCF::getUser()->userID == $blog->userID) {
$bots = UzbotValidBotCacheBuilder::getInstance()->getData(['typeDes' => 'blog_blogChange']);
if (count($bots)) {
//preset data
$user = WCF::getUser();
// get reason
$params = $eventObj->getParameters();
$reason = '';
if (isset($params['reason'])) $reason = $params['reason'];
elseif (isset($params['data']['editReason'])) $reason = $params['data']['editReason'];
foreach ($bots as $bot) {
$affectedUserIDs = $countToUserID = $placeholders = [];
$count = 1;
$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->readObjectIDs();
if (!count($userList->getObjectIDs())) continue;
}
// found one
$affectedUserIDs[] = $user->userID;
$countToUserID[$user->userID] = $user->blogs;
// get access level string
$access = 'wcf.uzbot.blog.access.';
$accessLevel = $blog->accessLevel;
if ($accessLevel == Blog::ACCESS_EVERYONE) $access .= 'everyone';
elseif ($accessLevel == Blog::ACCESS_REGISTERED) $access .= 'registered';
elseif ($accessLevel == Blog::ACCESS_FOLLOWING) $access .= 'following';
elseif ($accessLevel == Blog::ACCESS_OWNER) $access .= 'nobody';
// get authors
$names = [];
$authors = $blog->getAuthors();
if (count($authors)) {
foreach ($authors as $author) {
$names[] = $author->username;
}
}
// set placeholders
$placeholders['action'] = 'wcf.uzbot.blog.action.' . $action;
$placeholders['blog-access'] = $access;
$placeholders['blog-authors'] = count($names) ? implode(', ', $names) : ' ';
$placeholders['blog-id'] = $blog->blogID;
$placeholders['blog-link'] = $blog->getLink();
$placeholders['blog-title'] = $blog->getTitle();
$placeholders['count'] = 1;
$placeholders['count-user'] = $user->blogs;
$placeholders['translate'] = ['action', 'blog-access'];
// save blogID for entry in affected blog
$bot->blogID = $blog->blogID;
// 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);
}
}
}
}
}
}
lib/system/event/listener/UzbotBlogEntryActionListener.class.php 0100644 0000000 0000000 00000034755 14240156427 024302 0 ustar 00 0000000 0000000
* @package com.uz.wcf.bot3.blog
*/
class UzbotBlogEntryActionListener implements IParameterizedEventListener {
/**
* @inheritDoc
*/
public function execute($eventObj, $className, $eventName, array &$parameters) {
// check module
if (!MODULE_UZBOT) return;
$defaultLanguage = LanguageFactory::getInstance()->getLanguage(LanguageFactory::getInstance()->getDefaultLanguageID());
// entry publication
if ($eventObj->getActionName() == 'triggerPublication') {
// no guests
if (!WCF::getUser()->userID) return;
// get entry
$entry = $eventObj->getObjects()[0]->getDecoratedObject();
// new entry
// Read all active, valid activity bots, abort if none
$bots = UzbotValidBotCacheBuilder::getInstance()->getData(['typeDes' => 'blog_entryNew']);
if (count($bots)) {
// disregard uzbot
if ($entry->isUzbot) return;
foreach ($bots as $bot) {
$affectedUserIDs = $countToUserID = $placeholders = [];
$count = 1;
// check for conditions, if exist, no guests
$conditions = $bot->getUserConditions();
if (count($conditions)) {
$userList = new UserList();
$userList->getConditionBuilder()->add('user_table.userID = ?', [WCF::getUser()->userID]);
foreach ($conditions as $condition) {
$condition->getObjectType()->getProcessor()->addUserCondition($condition, $userList);
}
$userList->readObjectIDs();
if (!count($userList->getObjectIDs())) continue;
}
if ($entry->userID) {
$affectedUserIDs[] = $entry->userID;
$countToUserID[$entry->userID] = WCF::getUser()->blogEntries;
}
// save blogID for entry in affected blog
$bot->blogID = $entry->blogID;
// get access level string
$access = 'wcf.user.access.';
if ($entry->accessLevel == Blog::ACCESS_EVERYONE) $access .= 'everyone';
elseif ($entry->accessLevel == Blog::ACCESS_REGISTERED) $access .= 'registered';
elseif ($entry->accessLevel == Blog::ACCESS_FOLLOWING) $access .= 'following';
elseif ($entry->accessLevel == Blog::ACCESS_OWNER) $access .= 'nobody';
// set placeholder
$blog = $entry->getBlog();
// get authors
$authors = $blog->getAuthors();
$names = [];
if (count($authors)) {
foreach ($authors as $author) {
$names[] = $author->username;
}
}
$placeholders['count'] = 1;
$placeholders['count-user'] = WCF::getUser()->blogEntries + 1;
$placeholders['blog-access'] = $access;
$placeholders['blog-authors'] = count($names) ? implode(', ', $names) : ' ';
$placeholders['blog-id'] = $blog->blogID;
$placeholders['blog-link'] = $blog->getLink();
$placeholders['blog-title'] = $blog->getTitle();
$placeholders['entry-id'] = $entry->entryID;
$placeholders['entry-link'] = $entry->getLink();
$placeholders['entry-teaser'] = $entry->getExcerpt();
$placeholders['entry-text'] = $entry->getMessage();
$placeholders['entry-title'] = $entry->getTitle();
$placeholders['translate'] = ['blog-access'];
// 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);
}
}
// entry count
// Read all active, valid activity bots, abort if none
$bots = UzbotValidBotCacheBuilder::getInstance()->getData(['typeDes' => 'blog_entryCount']);
if (count($bots)) {
// top blogger
$top = new UzbotTop(1);
$topUser = new User($top->blogEntry);
// total entry count
$sql = "SELECT COUNT(*) AS count
FROM blog".WCF_N."_entry
WHERE isDeleted = ? AND isPublished = ?";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute([0, 1]);
$countTotal = $statement->fetchColumn();
$user = new User($entry->userID);
foreach ($bots as $bot) {
// only users if not entryTop
if ($bot->blogEntryCountAction != 'entryTop' && !$user->userID) continue;
// user condition match relevant on entryX only
if ($bot->blogEntryCountAction != 'entryX') {
$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->readObjectIDs();
if (!count($userList->getObjectIDs())) continue;
}
}
// only on count match or new top blogger
$counts = explode(',', $bot->userCount);
$hit = false;
switch ($bot->blogEntryCountAction) {
case 'entryTotal':
if (in_array($countTotal, $counts)) $hit = true;
break;
case 'entryX':
if (in_array($user->blogEntries, $counts)) $hit = true;
break;
case 'entryTop':
if ($user->blogEntries > $topUser->blogEntries && $user->userID != $topUser->userID) {
$hit = true;
if (!$bot->testMode) {
$editor = new UzbotTopEditor($top);
$editor->update(['blogEntry' => $user->userID]);
}
}
break;
}
if ($hit) {
$affectedUserIDs = $countToUserID = $placeholders = [];
if ($user->userID) {
$affectedUserIDs[] = $user->userID;
$countToUserID[$user->userID] = $user->blogEntries;
}
// save blogID for entry in affected blog
$bot->blogID = $entry->blogID;
// get access level string
$access = 'wcf.user.access.';
if ($entry->accessLevel == Blog::ACCESS_EVERYONE) $access .= 'everyone';
elseif ($entry->accessLevel == Blog::ACCESS_REGISTERED) $access .= 'registered';
elseif ($entry->accessLevel == Blog::ACCESS_FOLLOWING) $access .= 'following';
elseif ($entry->accessLevel == Blog::ACCESS_OWNER) $access .= 'nobody';
// set placeholder
$blog = $entry->getBlog();
// get authors
$authors = $blog->getAuthors();
$names = [];
if (count($authors)) {
foreach ($authors as $author) {
$names[] = $author->username;
}
}
$placeholders['count'] = $countTotal;
$placeholders['count-user'] = $user->userID ? $user->blogEntries : 0;
$placeholders['blog-access'] = $access;
$placeholders['blog-authors'] = count($names) ? implode(', ', $names) : ' ';
$placeholders['blog-id'] = $blog->blogID;
$placeholders['blog-link'] = $blog->getLink();
$placeholders['blog-title'] = $blog->getTitle();
$placeholders['entry-id'] = $entry->entryID;
$placeholders['entry-link'] = $entry->getLink();
$placeholders['entry-teaser'] = $entry->getExcerpt();
$placeholders['entry-text'] = $entry->getMessage();
$placeholders['entry-title'] = $entry->getTitle();
$placeholders['translate'] = ['blog-access'];
// 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);
}
}
}
}
else {
$action = $eventObj->getActionName();
$allowed = ['disable', 'enable', 'restore', 'trash', 'setAsFeatured', 'unsetAsFeatured', 'update'];
if (!in_array($action, $allowed)) return;
if (empty($eventObj->getObjects())) return;
// get entry and check for user
$entry = $eventObj->getObjects()[0]->getDecoratedObject();
if (!$entry->userID) return;
if (WCF::getUser()->userID != $entry->userID) return;
// check for bots
$bots = UzbotValidBotCacheBuilder::getInstance()->getData(['typeDes' => 'blog_entryChange']);
if (count($bots)) {
//preset data
$user = WCF::getUser();
$blog = $entry->getBlog();
// get reason
$params = $eventObj->getParameters();
$reason = '';
if (isset($params['editReason'])) $reason = $params['editReason'];
elseif (isset($params['data']['editReason'])) $reason = $params['data']['editReason'];
foreach ($bots as $bot) {
$affectedUserIDs = $countToUserID = $placeholders = [];
$count = 1;
$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->readObjectIDs();
if (!count($userList->getObjectIDs())) continue;
}
// found one
$affectedUserIDs[] = $user->userID;
$countToUserID[$user->userID] = $user->blogEntries;
// get access level string
$access = 'wcf.uzbot.blog.access.';
$accessLevel = $entry->accessLevel;
if ($accessLevel == Blog::ACCESS_EVERYONE) $access .= 'everyone';
elseif ($accessLevel == Blog::ACCESS_REGISTERED) $access .= 'registered';
elseif ($accessLevel == Blog::ACCESS_FOLLOWING) $access .= 'following';
elseif ($accessLevel == Blog::ACCESS_OWNER) $access .= 'nobody';
// get authors
$names = [];
$authors = $blog->getAuthors();
if (count($authors)) {
foreach ($authors as $author) {
$names[] = $author->username;
}
}
// set placeholders
$placeholders['action'] = 'wcf.uzbot.blog.action.' . $action;
$placeholders['blog-access'] = $access;
$placeholders['blog-authors'] = count($names) ? implode(', ', $names) : ' ';
$placeholders['blog-id'] = $blog->blogID;
$placeholders['blog-link'] = $blog->getLink();
$placeholders['blog-title'] = $blog->getTitle();
$placeholders['count'] = 1;
$placeholders['count-user'] = $user->userID ? $user->blogEntries : 0;
$placeholders['entry-id'] = $entry->entryID;
$placeholders['entry-link'] = $entry->getLink();
$placeholders['entry-teaser'] = $entry->getExcerpt();
$placeholders['entry-text'] = $entry->getMessage();
$placeholders['entry-title'] = $entry->getTitle();
$placeholders['reason'] = $reason;
$placeholders['translate'] = ['action', 'blog-access'];
// save blogID for entry in affected blog
$bot->blogID = $blog->blogID;
// 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);
}
}
}
}
}
cronjob.xml 0100644 0000000 0000000 00000002377 13574655526 012016 0 ustar 00 0000000 0000000
blog\system\cronjob\UzbotStatsBlogCronjob
10
5
*
*
*
1
1
1
blog\system\cronjob\UzbotBlogTopBloggerCronjob
*/30
*
*
*
*
1
1
1
eventListener.xml 0100644 0000000 0000000 00000002762 13562177452 013201 0 ustar 00 0000000 0000000
wcf\acp\form\UzbotAddForm
assignVariables,readFormParameters,save,validate,saved
blog\system\event\listener\UzbotAddFormBlogListener
1
admin
wcf\acp\form\UzbotEditForm
readData
blog\system\event\listener\UzbotAddFormBlogListener
admin
blog\data\blog\BlogAction
finalizeAction
blog\system\event\listener\UzbotBlogBlogActionListener
user
blog\data\entry\EntryAction
finalizeAction
blog\system\event\listener\UzbotBlogEntryActionListener
user
objectType.xml 0100644 0000000 0000000 00000001601 13562177452 012451 0 ustar 00 0000000 0000000
com.uz.wcf.bot.condition.blogs
com.uz.wcf.bot.condition.user
wcf\system\condition\UserIntegerPropertyCondition
contents
blogs
0
com.uz.wcf.bot.condition.blogEntries
com.uz.wcf.bot.condition.user
wcf\system\condition\UserIntegerPropertyCondition
contents
blogEntries
0
package.xml 0100644 0000000 0000000 00000006117 14240156257 011735 0 ustar 00 0000000 0000000
Community Bot 3 - Blog Extension
Community Bot 3 - Blog-Erweiterung
5.3.3
2022-05-15
Udo Zaydowicz
https://zaydowicz.de
com.uz.wcf.bot3
com.woltlab.blog
com.woltlab.wcf
com.woltlab.wcf
objectType.xml
eventListener.xml
files.tar
language/*.xml
update_blog.sql
update_uzbot.sql
update_stats.sql
update_uzbot_top.sql
cronjob.xml
templateListener.xml
acptemplates.tar
uzbotNotify.xml
uzbotType.xml
acp/install_com.uz.wcf.bot3.blog.php
files.tar
acptemplates.tar
uzbotNotify.xml
language/*.xml
files.tar
acptemplates.tar
uzbotNotify.xml
language/*.xml
acptemplates.tar
uzbotNotify.xml
templateListener.xml 0100644 0000000 0000000 00000002554 13562177452 013672 0 ustar 00 0000000 0000000
admin
uzbotAdd
UzbotNotify
admin
uzbotAdd
UzbotNotifyJS
admin
uzbotAdd
UzbotType
admin
uzbotAdd
UzbotTypeJS
update_blog.sql 0100644 0000000 0000000 00000000072 13057227030 012611 0 ustar 00 0000000 0000000 ALTER TABLE blog1_entry ADD isUzbot TINYINT(1) DEFAULT 0;
update_stats.sql 0100644 0000000 0000000 00000003255 13070714642 013037 0 ustar 00 0000000 0000000 ALTER TABLE wcf1_uzbot_stats ADD blog INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD blogAccessEveryone INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD blogAccessRegistered INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD blogAccessFollowing INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD blogAccessOwner INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD blogFeatured INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD blogComments INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD blogLikes INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD blogSubscribers INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD blogViews INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD blogEntry INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD blogEntryAccessEveryone INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD blogEntryAccessRegistered INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD blogEntryAccessFollowing INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD blogEntryAccessOwner INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD blogEntryDeleted INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD blogEntryDisabled INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD blogEntryDraft INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD blogEntryFeatured INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD blogEntryPoll INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD blogEntryPublished INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD blogEntryComments INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD blogEntryLikes INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD blogEntryViews INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot_stats ADD timeBlog INT(10) DEFAULT 0;
update_uzbot.sql 0100644 0000000 0000000 00000001107 13073462173 013040 0 ustar 00 0000000 0000000 ALTER TABLE wcf1_uzbot ADD blogEntryData TEXT;
ALTER TABLE wcf1_uzbot ADD blogID INT(10) DEFAULT 0;
ALTER TABLE wcf1_uzbot ADD blogChangeBlogEdit TINYINT(1) DEFAULT 0;
ALTER TABLE wcf1_uzbot ADD blogChangeEntryEdit TINYINT(1) DEFAULT 0;
ALTER TABLE wcf1_uzbot ADD blogChangeEntryDelete TINYINT(1) DEFAULT 0;
ALTER TABLE wcf1_uzbot ADD blogEntryCountAction VARCHAR(15) DEFAULT 'entryTotal';
ALTER TABLE wcf1_uzbot ADD topBloggerCount INT(10) DEFAULT 1;
ALTER TABLE wcf1_uzbot ADD topBloggerInterval TINYINT(1) DEFAULT 1;
ALTER TABLE wcf1_uzbot ADD topBloggerNext INT(10) DEFAULT 0; update_uzbot_top.sql 0100644 0000000 0000000 00000000250 13461251672 013721 0 ustar 00 0000000 0000000 ALTER TABLE wcf1_uzbot_top ADD blogEntry INT(10) DEFAULT NULL;
ALTER TABLE wcf1_uzbot_top ADD FOREIGN KEY (blogEntry) REFERENCES wcf1_user (userID) ON DELETE SET NULL;
uzbotNotify.xml 0100644 0000000 0000000 00000001236 14240155706 012671 0 ustar 00 0000000 0000000
20
1
0
1
1
0
1
0
blog\data\uzbot\notification\UzbotNotifyBlogEntry
20
uzbotType.xml 0100644 0000000 0000000 00000006402 13562177452 012352 0 ustar 00 0000000 0000000
50
Blog
0
1
0
0
0
1
54
51
Blog
0
1
0
0
0
1
52
52
Blog
0
1
0
0
0
1
53
53
Blog
0
0
0
0
0
1
55
54
Blog
0
1
0
0
0
1
50
55
Blog
0
1
0
0
0
1
51
56
Blog
1
1
0
0
0
1
56