<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									Guest user author stats lost when registering and using same email - wpDiscuz Comment Author Info				            </title>
            <link>https://gvectors.com/forum/wpdiscuz-comment-author-info/guest-user-author-stats-lost-when-registering-and-using-same-email-solved/</link>
            <description>WordPress Plugins Support Forum</description>
            <language>en-US</language>
            <lastBuildDate>Tue, 06 Oct 2026 12:49:01 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>RE: Guest user author stats lost when registering and using same email</title>
                        <link>https://gvectors.com/forum/wpdiscuz-comment-author-info/guest-user-author-stats-lost-when-registering-and-using-same-email-solved/#post-14619</link>
                        <pubDate>Wed, 03 Apr 2019 10:02:45 +0000</pubDate>
                        <description><![CDATA[Thank you @thepsir. I really appreciate you taking a time and share this information.]]></description>
                        <content:encoded><![CDATA[<p>Thank you @thepsir. I really appreciate you taking a time and share this information.</p>]]></content:encoded>
						                            <category domain="https://gvectors.com/forum/wpdiscuz-comment-author-info/">wpDiscuz Comment Author Info</category>                        <dc:creator>Astghik</dc:creator>
                        <guid isPermaLink="true">https://gvectors.com/forum/wpdiscuz-comment-author-info/guest-user-author-stats-lost-when-registering-and-using-same-email-solved/#post-14619</guid>
                    </item>
				                    <item>
                        <title>Guest user author stats lost when registering and using same email</title>
                        <link>https://gvectors.com/forum/wpdiscuz-comment-author-info/guest-user-author-stats-lost-when-registering-and-using-same-email-solved/#post-14602</link>
                        <pubDate>Tue, 02 Apr 2019 20:03:29 +0000</pubDate>
                        <description><![CDATA[Hello, i am here to propose a sollution to anyone facing this problem.Our sites have communities that was guest based, and the author information was showing up based on guest email. Now, we...]]></description>
                        <content:encoded><![CDATA[<p>Hello, i am here to propose a sollution to anyone facing this problem.</p><p>Our sites have communities that was guest based, and the author information was showing up based on guest email. <br />Now, we allowed register/login functions to our users, and when they register using the same email, the plugin shows only the comments made from the current (new user) user id.<br />To prevent this from happening, we made the following modifications on the addon code:</p><pre>1) plugins/wpdiscuz-comment-author-info/includes/wcai-helper.php<br />Change line 167 from<br />$allComments = $this-&gt;dbManager-&gt;getAuthorAllComments($user-&gt;ID);<br />to<br />$allComments = $this-&gt;dbManager-&gt;getAuthorAllComments($user-&gt;ID,$user-&gt;user_email);<br /><br />2) plugins/wpdiscuz-comment-author-info/includes/wcai-dbmanager.php<br />Replace the function getAuthorAllComments (line 16 to 25) to this:
public function getAuthorAllComments($userId, $email = '') {<br />        $result = '';<br />        if (trim($email)) {<br />            $sql = $this-&gt;db-&gt;prepare("SELECT `comment_ID`, `comment_approved` FROM {$this-&gt;db-&gt;comments} WHERE `comment_author_email` = %s", $email);<br />        } else if (intval($userId)) {<br />            $sql = $this-&gt;db-&gt;prepare("SELECT `comment_ID`, `comment_approved` FROM {$this-&gt;db-&gt;comments} WHERE `user_id` = %d", $userId);<br />        }<br />        $result = $this-&gt;db-&gt;get_results($sql);<br />        return $result;<br />    }</pre><p>Hope that this help everyone that needs it. </p>]]></content:encoded>
						                            <category domain="https://gvectors.com/forum/wpdiscuz-comment-author-info/">wpDiscuz Comment Author Info</category>                        <dc:creator>thepsir</dc:creator>
                        <guid isPermaLink="true">https://gvectors.com/forum/wpdiscuz-comment-author-info/guest-user-author-stats-lost-when-registering-and-using-same-email-solved/#post-14602</guid>
                    </item>
							        </channel>
        </rss>
		