Profile Comments

Started by SMFHacks.com Team, August 24, 2006, 11:12:43 AM

Previous topic - Next topic

SMFHacks.com Team

Link to Mod



Profile Comments

By vbgamer45


Compatibility
Works with both SMF 2.0.x and SMF 1.1.x

Description
Adds a comment section under the user's profile.

User's can leave multiple comments.
User's can edit/delete their own comments.
Spell Check for comments.
BBC support and smiles

The mod is all permission based with permissions for adding comments, editing your own comment or editing others, deleting your own comment and deleting others comments.

2.2
!Minor template tweaks for style SMF 2.0
!Removed last two queries from the template files


2.0
+Added support for SMF 2.0!
+Added user info box next to comments

1.4
+Added page listing for user comment display. Show 10 comments per page
+Added comment approval options
+Added PM on a new comment added to a user's profile
!Fixed issue with embarrassed smiley in 1.0.x
!Fixed issue when editing a comment caused by spell check

Support Links
SMF Package Parser
Manual Installation Of Mods
How Do I Modify Files?

Disclaimer: SMFHacks.com Team is not affiliated with the SMF Team or the SimpleMachines NPO.
SMFHacks.com -  Paid Modifications for SMF
Latest Mods:
Community Suite
Newsletter Pro SMF Gallery Pro SMF Classifieds SMF Store

Gary

Thanks for coding this mod up.

As I said in the other thread (which can be locked now);

Quote from: AwwLilMaggie on August 24, 2006, 11:17:08 AM
EDIT: Installed fine on RC3.

EDIT 2: The attchment might be a good idea to pull off too. I'll do it to what I've just installed, but it might be better if it was like that by default. And by "length" in the attachment, I ment "width" my bad.

-AwwLilMaggie
Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

londonhogfan

awesome.  Use this along with custom profile fields and you are well on your way to a myspace style profile...

I can't wait  :)

chinclub

#3
I just installed this mod and I have 1 questions and a request.

How can I change the text above the box in each profile from User Comments to Guestbook or something like that.




And, it would be great if it would send an email or a pm to the person whenever someone left a comment on their profile.

Gary

Quote from: chinclub on August 24, 2006, 01:13:32 PM
How can I change the text above the box in each profile from User Comments to Guestbook or something like that.

Thats simple,

in Profile.template.php find:


echo '<div class="titlebg">User Comments</div>';


and replace it it with:


echo '<div class="titlebg">User Guestbook</div>';


-AwwLilMaggie
Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

Gary

In relation to my coding thing, I recoded it into my forum, by finding:


// Finally, if applicable, span the bottom of the table with links to other useful member functions.


and


// Template for showing all the posts of the user, in chronological order.


and replacing everything inbetween with:


// Finally, if applicable, span the bottom of the table with links to other useful member functions.
echo '
<tr class="titlebg">
<td colspan="2">', $txt[597], ':</td>
</tr>
<tr>
<td class="windowbg2" colspan="2">';
if (!$context['user']['is_owner'] && $context['can_send_pm'])
echo '
<a href="', $scripturl, '?action=pm;sa=send;u=', $context['member']['id'], '">', $txt[688], '.</a><br />
<br />';
echo '
<a href="', $scripturl, '?action=profile;u=', $context['member']['id'], ';sa=showPosts">', $txt[460], ' ', $txt[461], '.</a><br />
<a href="', $scripturl, '?action=profile;u=', $context['member']['id'], ';sa=statPanel">', $txt['statPanel_show'], '.</a><br />
</td>
</tr>';
//Start Profile Comments Mod
echo'
  <tr>
    <td colspan="2" class="catbg">User Comments </td>
  </tr>
  <tr>
    <td colspan="2" class="titlebg"><a href="', $scripturl, '?action=comment;sa=add;u=' . $context['member']['id']  . '">Add Comment</a></td>
  </tr>';
//Loop though all the comments
$dbresult = db_query("SELECT p.ID_COMMENT, p.ID_MEMBER, p.comment, p.subject, p.date, m.memberName, p.COMMENT_MEMBER_ID FROM {$db_prefix}profile_comments as p, {$db_prefix}members AS m WHERE  p.ID_MEMBER = m.ID_MEMBER AND COMMENT_MEMBER_ID = " . $context['member']['id'] . " ORDER BY ID_COMMENT DESC", __FILE__, __LINE__);
$comment_count = db_affected_rows();
while($row = mysql_fetch_assoc($dbresult))
{
echo'
  <tr class="titlebg">
    <td>' . $row['subject'] . ' | '  . timeformat($row['date']) . ' | <a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">'  . $row['memberName'] . '</a></td>
    <td>';
// Can they edit or delete comments?
if(allowedTo('pcomments_edit_any') || allowedTo('pcomments_edit_own') && $row['ID_MEMBER'] == $ID_MEMBER)
{
echo '<a href="', $scripturl, '?action=comment;sa=edit;id=' . $row['ID_COMMENT'] . '">Edit</a> |';
}
if(allowedTo('pcomments_delete_any') || allowedTo('pcomments_delete_own') && $row['ID_MEMBER'] == $ID_MEMBER)
{
echo '&nbsp;<a href="', $scripturl, '?action=comment;sa=delete;id=' . $row['ID_COMMENT'] . '">Delete</a>';
}
echo'
</td>
  </tr>
  <tr>
    <td colspan="2" class="windowbg">' . parse_bbc($row['comment']) . '</td>
  </tr> ';
   }
   echo'
  <tr>
    <td colspan="2" class="titlebg"><a href="', $scripturl, '?action=comment;sa=add;u=' . $context['member']['id']  . '">Add Comment</a></td>
  </tr>';
//End Profile Comments Mod
echo'
</td>
</tr>
</table>';

}

// Template for showing all the posts of the user, in chronological order.


So it joins to the summary table.

-AwwLilMaggie
Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

londonhogfan

any pictures or a test account?

I wanna see :D

Gary

Sure.

Attached.

If you wanna see it in action sign up to http://multitalk2.com ;)

-AwwLilMaggie
Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

vbgamer45

Hmm. DO you want it to use your Real Name instead of username for comments?
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Gary

I'd prefer it if it were Real Names, so for me, instead of Gazmanafc, it'd say AwwLilMaggie.

-AwwLilMaggie
Gary M. Gadsdon
Do NOT PM me unless I say so
War of the Simpsons
Bongo Comics Fan Forum
Youtube Let's Plays

^ YT is changing monetisation policy, help reach 1000 sub threshold.

vbgamer45

Ok updated it. Now uses realnames, subject no longer required, switched to tables for the summary instead of divs.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

chinclub

Is there a way to have it send an email to the person when someone leaves a comment on their profile?

londonhogfan

or something like the PM feature so it alerts you when you go to the site.

This mod is gonna be golden *Searches for thumbsup emoticon*

vbgamer45

Hmm, maybe but there could be a lot of comments made on people. I think it would be annoying.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

chinclub

#14
Well then could we make an option for them to turn notifications off and on?  I just think most people don't look at their own profile very often so they wouldn't see new posts.

Or maybe link it to their current options because isn't there already an option to set whether you receive emails to new pms and new replies?  Maybe they could control it with that.

vln004

only buddies can add comments would be a nice one. Or that as an option. And also the ability to show avatars in the comments.

vbgamer45

I like the the ida of having the avatar of the user show up next to the comment probably on the left hand side.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

londonhogfan

yea, just the avatar and name (name clickable to go to their profile) with date / time above their comment would be nice.

Would it be possible to show this users buddys on their profile also? maybe just a 2 column list just above the comments.

vln004

Quote from: londonhogfan on August 26, 2006, 09:11:29 PM
Would it be possible to show this users buddys on their profile also? maybe just a 2 column list just above the comments.

i think we're getting past the scope of this mode


londonhogfan

well vbgamer has made many mods so I thought he would be the best to do a "buddy List" mod  Maybe only buddys could comment in a profile.

That would be a nice feature.

Advertisement: