[BETA] Ultimate profile mod

Started by JovanT, July 19, 2007, 05:26:00 PM

Previous topic - Next topic

runebergen


Hum... the code is correct... Not sure why you got that twice

Search within the file, and see if you got $comment['body'] 3 times ?   (should only be 2, part of the code above)

runebergen

#1341
ADD DELETE OWN COMMENTS AT OTHER PROFILES

A thing thats a bit strange at Ultimate Profiles, is that you can not delete your OWN comments at others profiles..
It can be useful to add this possibility, for example if you post something wrong.. and want to repost correct .. etc


Here is how...

In UltimateProfile.template.php


*EDIT - need a fix... will post later --- sorry



geo32101

Quote from: runebergen on August 26, 2008, 11:20:16 PM

Hum... the code is correct... Not sure why you got that twice

Search within the file, and see if you got $comment['body'] 3 times ?   (should only be 2, part of the code above)
There is 3 but I dont know which to get rid of and what else to get rid of.
Here is the code again, it was also in my previous post.
Quote
         // auto select comment HTML or BCC
         
         if(strstr($comment['body'],'[')) {
               
                echo parse_bbc ($comment['body']);
         }
         else {
         
         echo (un_htmlspecialchars ($comment['body'])); }
               
            echo   '</td>
            </tr>

            <tr>
I bolded them to make it easier for you, Im also going to make that other change that you posted above me as soon as I fix this one
Thanks

callteg4

Quote from: runebergen on August 26, 2008, 11:22:34 PM

ADD DELETE OWN COMMENTS AT OTHER PROFILES

A thing thats a bit strange at Ultimate Profiles, is that you can not delete your OWN comments at others profiles..
It can be useful to add this possibility, for example if you post something wrong.. and want to repost correct .. etc


Here is how...

In UltimateProfile.template.php

Code (FIND) Select

if ($context['can_delete'])
echo '
<a href="', $comment['delete'], '">', $txt['profile_comment_delete'] ,'</a>';



replace with this code

Code (REPLACE) Select

if (($comment['author']['ID_MEMBER'] ==  $context['user']['id']) or ($context['can_delete']))
echo '
<a href="', $comment['delete'], '">', $txt['profile_comment_delete'] ,'</a>';


This shows the delete but when u press delete it does nothing

дTдKдИ

Thanks Nice Mod.  ;)

Türkish Translations

runebergen

Quote from: callteg4 on August 27, 2008, 06:02:49 PM

This shows the delete but when u press delete it does nothing


Yeah, bummer... sorry about that... will try fix it ... 

Hum

geo32101

Quote from: runebergen on August 27, 2008, 06:50:08 PM
Quote from: callteg4 on August 27, 2008, 06:02:49 PM

This shows the delete but when u press delete it does nothing
So do you know which of the 3 $comment['body']  am I supposed to delete?

Yeah, bummer... sorry about that... will try fix it ... 

Hum

callteg4

Ok thanks, but can I just say its a bit of a pian really as once they comment on your profile a pm is sent,so then if they delete it that will just confuse people

runebergen

#1348
Quote from: callteg4 on August 27, 2008, 07:10:59 PM
Ok thanks, but can I just say its a bit of a pian really as once they comment on your profile a pm is sent,so then if they delete it that will just confuse people

True, nothing to do about notifier, but I think the possibility to delete own comments weights more than the user getting a notifier about it .. :)

And this goes for any Social Network site.. If you make a comment at Facebook, and delete it (and there you can), the user will get a notifier regardless :)


runebergen



Anyways, here is the fully working code, if others want to add the feature

ADD DELETE OWN COMMENTS AT OTHER PROFILES

A thing thats a bit strange at Ultimate Profiles, is that you can not delete your OWN comments at others profiles..
It can be useful to add this possibility, for example if you post something wrong.. and want to repost correct .. etc

FULLY WORKING CODE NOW :)
Here is how...

In UltimateProfile.template.php

Code (FIND) Select

if ($context['can_delete'])
echo '
<a href="', $comment['delete'], '">', $txt['profile_comment_delete'] ,'</a>';



replace with this code

Code (REPLACE) Select

if (($comment['author']['ID_MEMBER'] ==  $context['user']['id']) or ($context['can_delete']))
echo '
<a href="', $comment['delete'], '">', $txt['profile_comment_delete'] ,'</a>';




In addition you need to set up the PERMISSION to delete posts...

In Profile.php (find this in sources directory)

Code (FIND) Select

// Are you deleting comment that is on your own profile?
$request = db_query ('SELECT COMMENT_MEMBER_ID FROM ' . $db_prefix . 'profile_comments WHERE ID_COMMENT = "' . (int)$_GET['delete'] . '"', __FILE__, __LINE__);
list ($user_id) = mysql_fetch_row ($request);

if ($context['user']['id'] == $user_id)
$allowed = true;


}





Add the following AFTER the above

Code (ADD) Select

// Are you deleting comments that are your own?
$request = db_query ('SELECT ID_MEMBER FROM ' . $db_prefix . 'profile_comments WHERE ID_COMMENT = "' . (int)$_GET['delete'] . '"', __FILE__, __LINE__);
list ($user_id) = mysql_fetch_row ($request);

if ($context['user']['id'] == $user_id)
$allowed = true;







Now it works :)

runebergen

#1350
@ geo32101


Can you attatch your UltimateProfile.template.php at your post...

Or search your file, for $comment['body']

and see if you have $comment['body']  placed MORE that in the code below (a total of 3, you're right.. but NO more than these 3)


// auto select of comment HTML or BBC

if(strstr($comment['body'],'[')) {

echo parse_bbc ($comment['body']);
}
else {

echo ( un_htmlspecialchars ($comment['body'])); }



the code works great, I got 3000 forum users posting  very day with this , and working :)

geo32101


runebergen

file is fine ... cant see why you get double output...

You have exactly same code as me...

weird...


geo32101

Maybe it has something to do with the Profile.template file?
Can that be the problem?
And the whole CSS and MySpace thing wont work either I fill in the things and click to costumize, but nothing changes in the profile.

JovanT

Quote from: runebergen on August 27, 2008, 08:39:22 PM

// auto select of comment HTML or BBC

if(strstr($comment['body'],'[')) {

echo parse_bbc ($comment['body']);
}
else {

echo ( un_htmlspecialchars ($comment['body'])); }

the code works great, I got 3000 forum users posting  very day with this , and working :)

I think that this if is unnecessary. You can accomplish the same thing using parse_bbc(un_htmlspecialchars ($comment['body']))

callteg4

Quote from: runebergen on August 27, 2008, 08:20:21 PM
Quote from: callteg4 on August 27, 2008, 07:10:59 PM
Ok thanks, but can I just say its a bit of a pian really as once they comment on your profile a pm is sent,so then if they delete it that will just confuse people

True, nothing to do about notifier, but I think the possibility to delete own comments weights more than the user getting a notifier about it .. :)

And this goes for any Social Network site.. If you make a comment at Facebook, and delete it (and there you can), the user will get a notifier regardless :)

I am not knocking you,It is a great addition and i will be using it thanks

sub367


callteg4

The way you have done a delete can you do a edit?

bfeo

I'm getting an error and it isn't the same as that on page 62.  Any advice?

Unknown column 'com.time' in 'field list'
File: /home/bfeo/public_html/forum/Sources/Profile.php
Line: 1369

Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 1.1.5, while your database is at version 1.1.4. The above error might possibly go away if you execute the latest version of upgrade.php.

DonGiovanni


Advertisement: