@@ -299,13 +299,14 @@ function_exists('topcoderRoleCssStyles')) {
299299 */
300300 function dateUpdated ($ row , $ wrap = null ) {
301301 $ result = '' ;
302+ $ insertUserID = val ('InsertUserID ' , $ row );
302303 $ dateUpdated = val ('DateUpdated ' , $ row );
303304 $ updateUserID = val ('UpdateUserID ' , $ row );
304305
305306 if ($ dateUpdated ) {
306307 $ updateUser = Gdn::userModel ()->getID ($ updateUserID );
307308 $ dateUpdatedFormatted = Gdn::getContainer ()->get (DateTimeFormatter::class)->formatDate ($ dateUpdated , false , DateTimeFormatter::FORCE_FULL_FORMAT );
308- if ($ updateUser ) {
309+ if ($ updateUser && $ insertUserID != $ updateUserID ) {
309310 $ title = sprintf (t ('Edited %s by %s. ' ), $ dateUpdatedFormatted , val ('Name ' , $ updateUser ));
310311 $ link = userAnchor ($ updateUser );
311312 $ text = sprintf (t ('edited %s by %s ' ), $ dateUpdatedFormatted , $ link );
@@ -803,4 +804,105 @@ function myDraftsMenuItem($CountDrafts) {
803804 $ cssClass .= $ CountDrafts == 0 ? ' hidden ' : '' ;
804805 return sprintf ('<li id="MyDrafts" class="%s">%s</li> ' , $ cssClass , anchor (sprite ('SpMyDrafts ' ).$ Drafts , '/drafts ' ));
805806 }
807+ }
808+
809+ if (!function_exists ('writeInlineDiscussionOptions ' )) {
810+ function writeInlineDiscussionOptions ($ discussionRow ) {
811+ $ discussionID = val ('DiscussionID ' , $ discussionRow );
812+ Gdn::controller ()->EventArguments ['RecordID ' ] = $ discussionID ;
813+ //Gdn_Theme::bulletRow();
814+ echo '<div class="Controls flex"> ' ;
815+ echo '<div class="left"> ' ;
816+ Gdn::controller ()->EventArguments ['RecordID ' ] = $ discussionID ;
817+ Gdn::controller ()->fireEvent ('InlineDiscussionOptionsLeft ' );
818+ echo '</div> ' ;
819+ echo '<div class="center"></div> ' ;
820+ echo '<div class="right"> ' ;
821+
822+ // Write the items.
823+ // DropdownModule
824+ $ discussionDropdown = getDiscussionOptionsDropdown ($ discussionRow );
825+
826+ // Allow plugins to edit the dropdown.
827+ $ sender = Gdn::controller ();
828+ $ sender ->EventArguments ['DiscussionOptions ' ] = &$ discussionDropdown ;
829+ $ sender ->EventArguments ['Discussion ' ] = $ discussionRow ;
830+ $ sender ->fireEvent ('InlineDiscussionOptions ' );
831+
832+ $ discussionDropdownItems = $ discussionDropdown ->toArray ()['items ' ];
833+
834+ unset($ discussionDropdownItems ['announce ' ]);
835+ unset($ discussionDropdownItems ['sink ' ]);
836+ unset($ discussionDropdownItems ['close ' ]);
837+ unset($ discussionDropdownItems ['dismiss ' ]);
838+ unset($ discussionDropdownItems ['move ' ]);
839+ unset($ discussionDropdownItems ['tag ' ]);
840+
841+ if (!empty ($ discussionDropdownItems ) && is_array ($ discussionDropdownItems )) {
842+ array_walk ($ discussionDropdownItems , function (&$ value , $ key ) {
843+ $ anchor = anchor ($ value ['text ' ], $ value ['url ' ], val ('cssClass ' , $ value , $ key ));
844+ $ value = '<span class="" style=""> ' .$ anchor .'</span> ' ;
845+ });
846+
847+ echo implode ('<span class="MiddleDot">·</span> ' , $ discussionDropdownItems );
848+ }
849+ echo '</div> ' ;
850+ echo '</div> ' ;
851+
852+ }
853+ }
854+
855+ if (!function_exists ('writeInlineCommentOptions ' )) {
856+ function writeInlineCommentOptions ($ comment ) {
857+ $ iD = val ('CommentID ' , $ comment );
858+ Gdn::controller ()->EventArguments ['RecordID ' ] = $ iD ;
859+ //Gdn_Theme::bulletRow();
860+ echo '<div class="Controls flex"> ' ;
861+ echo '<div class="left"></div> ' ;
862+ echo '<div class="center"></div> ' ;
863+ echo '<div class="right"> ' ;
864+
865+ // Write the items.
866+ $ items = getCommentOptions ($ comment );
867+ if (!empty ($ items ) && is_array ($ items )) {
868+ array_walk ($ items , function (&$ value , $ key ) {
869+ $ anchor = anchor ($ value ['Label ' ], $ value ['Url ' ], val ('Class ' , $ value , $ key ));
870+ $ value = '<span class="" style=""> ' .$ anchor .'</span> ' ;
871+ });
872+ echo implode ('<span class="MiddleDot">·</span> ' , $ items );
873+ }
874+ echo '</div> ' ;
875+ echo '</div> ' ;
876+
877+ }
878+ }
879+
880+ if (!function_exists ('discussionUrl ' )) {
881+ /**
882+ * Return a URL for a discussion. This function is in here and not functions.general so that plugins can override.
883+ *
884+ * @param object|array $discussion
885+ * @param int|string $page
886+ * @param bool $withDomain
887+ * @return string
888+ */
889+ function discussionUrl ($ discussion , $ page = '' , $ withDomain = true ) {
890+ $ discussion = (object )$ discussion ;
891+ $ name = Gdn_Format::url ($ discussion ->Name );
892+
893+ // Disallow an empty name slug in discussion URLs.
894+ if (empty ($ name )) {
895+ $ name = 'x ' ;
896+ }
897+
898+ $ result = '/discussion/ ' .$ discussion ->DiscussionID .'/ ' .$ name ;
899+
900+ if ($ page ) {
901+ //if ($page > 1 || Gdn::session()->UserID) {
902+ $ result .= '/p ' .$ page ;
903+ // }
904+ }
905+
906+ return url ($ result , $ withDomain );
907+ }
806908}
0 commit comments