Experiencing Website Comments Plugin Issues

2 posts by 2 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: July 30, 2012   (RSS)

By Steve99 - July 25, 2012

Hello,
I currently have the Website Membership Plugin (v1.07) running in conjunction with the Website Comments Plugin(v1.01) on version 2.15 of CMSB.

A separate site user account table has been set up for use with the Website Membership Plugin, as I have done many times before. In the Website Membership Plugin the 'WSM_ACCOUNTS_TABLE' is set to be 'site_user_accounts' and 'WSM_SEPARATE_LOGIN' is set to 'true'. All base Website Membership functions work without any issues.

With the Website Comments, the issue I am experiencing is that an incorrect username is being displayed alongside the user comment on page.

All other Website Comments items such as notification emails are being sent to the proper email addresses and displays the proper username from the site user accounts table (I had changed line 205 the Website Comments to set $accountsTable to 'site_user_accounts').

It appears as if when the call is being made to display article comments on-page that the main 'accounts' table is being queried instead of the separate 'site_user_accounts' table.

Thank you in advance for your help.

Regards,
Steve

Re: [steve99] Experiencing Website Comments Plugin Issues

By Jason - July 30, 2012

Hi Steve,

This is actually a "bug" in the theme file. The issue here is that the code is referencing "createdBy.username", which is a pseudo field generated by getRecords(). This field always refers back to the "accounts" section of CMSB.

Try this change:

<?php foreach ($commentsRecords as $comment): ?>
<div class="wsc_comment">

<?php foreach ($comment['attachments'] as $upload): ?>
Attachment: <a href="<?php echo $upload['urlPath'] ?>">Download <?php echo $upload['filename'] ?></a><br/>
<?php endforeach ?><br/>

<?php echo nl2br(htmlspecialchars($comment['comment'])) ?><br/>
<?php $user = mysql_get($GLOBALS['WSM_ACCOUNTS_TABLE'], $comment['createdByUserNum']);?>
<strong><?php echo htmlspecialchars($user['username']) ?></strong> -
<span class="wsc_date"><?php echo prettyDate($comment['createdDate']) ?></span>
</div><hr size="1"/>
<?php endforeach ?>


Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/