Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authors of unapproved versions #142

Open
Rainbow-Spike opened this issue Jan 21, 2020 · 33 comments
Open

Authors of unapproved versions #142

Rainbow-Spike opened this issue Jan 21, 2020 · 33 comments

Comments

@Rainbow-Spike
Copy link
Contributor

Please add a column for observing authors of last edits

@auto-comment
Copy link

auto-comment bot commented Jan 21, 2020

Thank you for opening this issue.
CosmoCode is a software company in Berlin providing services for wiki, app and web development. As such we can't guarantee quick responses for issues opened on our Open Source projects.
If you require certain features or bugs fixed, you can always hire us. Feel free to contact us at [email protected] for an offer.

@Rainbow-Spike

This comment has been minimized.

@Chris75forumname
Copy link

Chris75forumname commented Jul 21, 2021

I need exactly that, too: A line with the "author and date of the last edit" in each banner.

Since this is already shown at the bottom of the page (page footer), it should be not so hard to transfer it into the banner (or page header). I will try to build it in. I will post my solution, if I succeed.

Yours, Christian

@Chris75forumname
Copy link

Hi Spike,
I managed to do so! It was not all that hard to do. It took me some time only because I am a total beginner. I just modified the messages in the banner. (I think, columns would be great too, it should be possible, but I didn't try to make columns and I will stick with the banner layout right now.)
I found some code how to display the last editor here: https://www.dokuwiki.org/plugin:verinfo (an old plugin, but the code is plain and well documented). Also I found the layout of the $INFO array here: https://www.dokuwiki.org/devel:infoarray (so I could verify I use the correct data). I will send you all the necessary changes / files, if you want? (I run latest Dokuwiki Hogfather and latest version of publish plugin.)
Yours, Christian

@Rainbow-Spike

This comment has been minimized.

@Chris75forumname

This comment has been minimized.

@Rainbow-Spike

This comment has been minimized.

@Rainbow-Spike

This comment has been minimized.

@Chris75forumname

This comment has been minimized.

@Chris75forumname

This comment has been minimized.

@Rainbow-Spike

This comment has been minimized.

@Chris75forumname

This comment has been minimized.

@Rainbow-Spike

This comment has been minimized.

@Chris75forumname

This comment has been minimized.

@Rainbow-Spike

This comment has been minimized.

@Chris75forumname

This comment has been minimized.

@Rainbow-Spike

This comment has been minimized.

@Chris75forumname

This comment has been minimized.

@Rainbow-Spike

This comment has been minimized.

@Chris75forumname

This comment has been minimized.

@Rainbow-Spike
Copy link
Contributor Author

It works on Greebo!
http://screenshot.ru/3c72fbae852f11266e93f30ee93ee284.png =>
http://screenshot.ru/3c6b6079a134409e565ddf6a60f16aaa.png

@Rainbow-Spike
Copy link
Contributor Author

But we don't use the Discussion plugin, instead we use the Discord conference

@Chris75forumname
Copy link

Chris75forumname commented Jul 25, 2021

Oh, I forgot this feature. I added a note into the code, because the built-in internal_note function did not work as expected.
This is easy to fix, just comment out the highlighted two of the following lines, so all of these lines are commented out in the function showDraft() in banner.php:

echo '<br/>';

// printf(' ' . $this->getLang('approvals'), $approvalCount, $this->getConf('number_of_approved')); // ++++++ Diese Zeile wird nicht angezeigt! ++++++

echo $this->getLang('approve_note'); // ++++++ Hinzugefügt weil showInternalNote() nicht funktioniert! ++++++

@Chris75forumname
Copy link

Chris75forumname commented Jul 25, 2021

If you want your number_of_approved shown as in your old banner, you can uncomment all lines in the function showDraft() in banner.php again, except the line of my tweak:
// echo $this->getLang('approve_note');

@Rainbow-Spike
Copy link
Contributor Author

http://screenshot.ru/16d1096d83a35224bb0a5a00ba99feac.png nice

@Chris75forumname
Copy link

Chris75forumname commented Jul 25, 2021

BTW, all comments like: "++++ comment ++++" were added by me. Comments without "++++" are original comments.
In the showDraft() function and in the showApproved() function is where I added the last Editor, that's where you also find fractions of the language string, such as: "letzte Änderung:" "von" for your language replacement (besides the lang.php) ...
Also, you will see, I moved the Approve Action Link to the lower right corner within the banner box, all of this can be styled in style.css.
Yours, Christian

@splitbrain
Copy link
Member

Guys, please stay on topic here.

@Chris75forumname it would be helpful if you could send a proper pull request.

@Rainbow-Spike

This comment has been minimized.

@Chris75forumname
Copy link

Chris75forumname commented Jul 26, 2021

Hi Andi,
you are right! I wish I could, but I am afraid, sending a proper pull request is beyond my current abilities! But, after the summer break, I will ask a friend to help me to do this. It will be something to learn! But, before that, I should do some more proper testing!

Hi Spike,
Today, my colleges started testing my tweak by creating pages like wild! Which sent me on a bug hunt myself, making me work overtime today. The problem was, when a page is freshly created, the contributor array is NOT generated right away. Only after the next edit. Since my colleges were using the nice little manual I wrote, all went good and next edits were not necessary. So most of the new pages were shown with NO last editor/creator in the banner. Which does not look appealing! So I added an if-else construct to inquire if the contributor array does exist and if so, show the last editor, and if not, fall back to the creator of the page, each provided as full user names.
So this is the new version of my tweak:
banner.php.zip
And it seems to work, a full user name is shown all the time, now. But, I did not have time to fully validate it and test it. And I won't have time to do so in the next 4 weeks from now.
Also, you would have to do all the changes again, which we discussed above, for your preferences.
So, please use with caution! I would be grateful for tester's feedback!

Thanks to you all!
Christian

@Chris75forumname
Copy link

Chris75forumname commented Jul 26, 2021

Since this is already shown at the bottom of the page (page footer), it should be not so hard to transfer it into the banner.

BTW: Where is actually the code that generates the pagefooter? I couldn't find it anywhere.

@Rainbow-Spike
Copy link
Contributor Author

Rainbow-Spike commented Jul 29, 2021

look at /lib/tpl/your_template/ - files named main.php or footer.html
try to use https://www.dokuwiki.org/plugin:headerfooter or https://www.dokuwiki.org/plugin:footer

@Chris75forumname
Copy link

Chris75forumname commented Jul 29, 2021

No, I mean the part of the dokuwiki code, which uses $lang['lastmod'] and displays the last modification of the current page in the page footer. None of these plugins do anything like that. I should figure out how to do a text search for this string across all php files in the entire dokuwiki directory. Strange! I never had this problem before! I always found whatever I was looking for in this very well structured system! Hm? Cheers!

@Chris75forumname
Copy link

Chris75forumname commented Jul 30, 2021

Hi, I found a simple way to search text strings inside all php files of my /dokuwiki directory!
Open Windows terminal, change to your dokuwiki directory:
cd C:\dokuwiki
execute the following command with your "textstring" in place:
findstr /L /S textstring *.php
This way I found what I was looking for:
The pagefooter "lastmod" message is created by the function tpl_pageinfo() in dokuwiki/inc/template.php ( *** Print some info about the current page *** ).
This uses the function editorinfo() from dokuwiki/inc/common.php ( *** Return the users real name ... for use in page footer ... *** ). That was the part, I had missed!
After checking all this out, I still think my solution is the best. So nothing is changed! It seems to work as expected, now!
Enjoy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants