Guestbook editing comments to not show one editing as sender not admin
PermalinkThe issue: When we complete the edit and approve the comments it now says it is from the admin rather than the one that filled out the comment form. It even shows the person who originally filled out the comment form when editing it but changes after save.
Any way how to make this stay showing it is from the one that filled it out?

# concrete5 Version
5.5.1
# concrete5 Packages
CSV displayer (1.1), Database Backup (1.0), engagingit_table_sorter (1.1), Expand / Collapse (1.2.0), Facebook Like Button (1.1), Galleria image gallery (2.0), Google Map (Premium) (2.0.1), iCal Template (1.1), Likes This! (1.0), PHP block by ND (1.0), Sisimizi's Download Folder (1.0), tnSpacer (1.2), Touching (1.0), View Directory (1.3), Yosemite (1.0), ZenLike (1.02).
# concrete5 Overrides
blocks/autonav, blocks/external_form, blocks/survey, elements/header_required.php, elements/header_required-old.php, single_pages/page_not_found-dont-use.php, themes/cannonf700_zenlike, themes/touching_test
# Server Software
Apache
# Server API
cgi-fcgi
# PHP Version
5.2.17
# PHP Extensions
apc, bcmath, bz2, calendar, cgi-fcgi, ctype, curl, date, dba, dbase, dom, exif, filter, ftp, gd, gettext, gmp, hash, iconv, imap, ionCube Loader, json, ldap, libxml, mbstring, mcrypt, mhash, mime_magic, mysql, mysqli, ncurses, odbc, openssl, pcntl, pcre, PDO, pdo_dblib, pdo_mysql, PDO_ODBC, pdo_pgsql, pdo_sqlite, pgsql, posix, pspell, readline, Reflection, session, shmop, SimpleXML, soap, sockets, SourceGuardian, SPL, SQLite, standard, sysvmsg, sysvsem, sysvshm, tidy, tokenizer, wddx, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, zlib.
Not at this point that I am aware of. Really wish we could resolve this.
and do this
*I think. This should basically just ignore username and email on update. I don't know if it works, I never use the guest book. But might be worth a try.
However, it may not be what you want to happen. It doesn't suit what I want and I have needed to work round this before.
I have written up a solution that although involves updating the database directly, is a simple thing to do and doesn't require code changes.
You update the btGuestBookEntries table and set the uID to 0 for the comment entry that you want to change. The full post ishttp://richardjh.org/blog/editing-concrete5-comments-changes-posted...
The function responsible for updating a comment is updateEntry(), which is part of the Concrete5_Controller_Block_GuestbookEntry class in /concrete/core/controllers/blocks/guestbook_entry.php.
approveEntry() and unApproveEntry() follow updateEntry(), and they reference the private function adjustCountCache().
An empty 'placeholder' extension of this class can be found in /concrete/blocks/guestbook/controller.php, which can in turn be overridden or extended (without touching the original) by creating a new script in /blocks/guestbook/ called controller.php containing the following:
<?php ####################################### ## CORE OVERRIDE - EDIT BLOG COMMENT ## ####################################### ### alters the original code as shown such that only the comment text is updated upon edit, ### and the original posting timestamp is left unchanged on approval or unapproval. defined('C5_EXECUTE') or die("Access Denied."); class GuestbookBlockController extends Concrete5_Controller_Block_Guestbook { } class GuestBookBlockEntry extends Concrete5_Controller_Block_GuestbookEntry { private function adjustCountCache($number=false){ $ca = new Cache(); $db = Loader::db(); $count = $ca->get('GuestBookCount',$this->cID."-".$this->bID); if($count && $number){ $count += $number;
HTH and feel free to correct me if I've got anything wrong :)