News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Ultimate Profile

Started by JovanT, March 12, 2009, 12:14:40 PM

Previous topic - Next topic

Voku

Is there any way to add an "Edit comment" button on the profile comments?

Kindred

Not easily...  you would have to also write the script to allow editing as well as add the button
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

neosymmetrical

Quote from: punjabilokvirsa on January 17, 2012, 08:02:05 PM
I've discovered a bug in the code of Ultimate Profile 0.9.1 (don't know about previous versions). It was creating empty buddies in the buddy_list field of smf_members table when the person added their first buddy. This in turn meant that UP's code to check if guests should be allowed see the other person's UP or their pictures was always true. In other words, guests could see the locked pictures.

The problem is php's explode function:
explode(',', '')
creates
array(1) {
  [0]=>
  string(0) ""
}


But the developer's code (and normal human beings) expect it to be:
array(0) {
}


So to fix, change line 365 and 404 from:
$buddies = explode(',', $user_profile[$_GET['u']]['buddy_list']);
to:
$buddies = array_filter(explode(',', $user_profile[$_GET['u']]['buddy_list']));

In English, array_filter removes the bogus entry.

But that's not all folks, if you've used this mod for a while, you will also need to run a script to cleanup all the empty entries that have corrupted your users. To do this, run the following code in the root forum directory (comment out the updateMemberData line if you want to see what it does). Remove it when done, please.

<?php
require_once 
'SSI.php';
$space "<br />\n<br />\n";


$request $smcFunc['db_query']('''
SELECT id_member, buddy_list
FROM {db_prefix}members
ORDER BY id_member ASC'
,
array()
);

while ($row $smcFunc['db_fetch_assoc']($request)) {
if ($row['buddy_list']) {
$exp explode(','$row['buddy_list']);
$fil array_filter($exp);
if (count($exp) != count($fil)) {
echo "$space {$row['id_member']}: ";
var_dump($row['buddy_list']);/*
echo "$space exp:";
var_dump($exp);
echo "$space fil: ";
var_dump($fil);*/
echo "$space fixed: ";
$fixed implode(',',$fil);
var_dump($fixed);
echo "$space";
if (function_exists('updateMemberData')) updateMemberData($row['id_member'], array('buddy_list' => $fixed));

}
}
}

$smcFunc['db_free_result']($request);


I got everything besides the last bit, I'm not sure how to run that last code.

Kindred

create a new file called "upreset.php" (or anything you want to call it) 
paste that code into it
run it in your browser like any other page
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

hcfwesker

SMF 2.0.11

This may seem like a big request, but going to shoot for it anyway.  When creating a board you can select a theme to force users on when viewing it.  Well, some forums, like ours, have several themes and when members customize their profile on a specific theme, some other themes mess up the look.  So just wondering if it's possible that member's can select what theme they want their profile to be viewed on when other member's visit.

I'm not expecting anyone to take on the task, would be nice though :)  Mostly just wondering if it is possible

live627

A good start could be appending ;theme=1  to the URL.

Jade Elizabeth

Quote from: hcfwesker on December 01, 2015, 07:33:33 PM
SMF 2.0.11

This may seem like a big request, but going to shoot for it anyway.  When creating a board you can select a theme to force users on when viewing it.  Well, some forums, like ours, have several themes and when members customize their profile on a specific theme, some other themes mess up the look.  So just wondering if it's possible that member's can select what theme they want their profile to be viewed on when other member's visit.

I'm not expecting anyone to take on the task, would be nice though :)  Mostly just wondering if it is possible

That's actually a really fantastic idea.

Quote from: live627 on December 01, 2015, 07:42:42 PM
A good start could be appending ;theme=1  to the URL.

But then you'd have to re-append the original themes id on exit...if they even exit that page they could close the tab and come back to a surprise.
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

hcfwesker

Quote from: live627 on December 01, 2015, 07:42:42 PM
A good start could be appending ;theme=1  to the URL.

Ya forcing a global theme change I understand that.  But this is more like how you chaneg the theme when viewing a specific board that forces a theme



^ something like that, added in with the 'per user' ultimate profile options.  So if i build my profile look based on a dark theme, a member using a light theme would see it different; not to mention themes use different tables/css format layout.  So, with an option, the theme I use when making my profile design, I would be able to force other users to view that theme when visiting my own profile ... along with other members having the same option.


Rene88

Hello

is there a way to add a permissions so that a user (not all) cant send Profiel Messages?
i have a user i want to block sending Profiel Messages.

hope someone can help.

Kindred

that would require recoding the mod to add more permissions and permissions checks
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Shambles

Quote from: Rene88
is there a way to add a permissions so that a user (not all) cant send Profiel Messages?
i have a user i want to block sending Profiel Messages.

hope someone can help.
Enable the SMF warning system and set a warn level that prevents him/her using PMs

Illori

Quote from: Shambles on December 22, 2015, 05:30:16 PM
Enable the SMF warning system and set a warn level that prevents him/her using PMs

the warning system does not do anything to stop sending PM's

Shambles

Quote from: Illori on December 22, 2015, 05:33:12 PM
Quote from: Shambles on December 22, 2015, 05:30:16 PM
Enable the SMF warning system and set a warn level that prevents him/her using PMs

the warning system does not do anything to stop sending PM's

I have to dispute that.

A full warning on my 2.0.11 system prevents that member sending PMs


Illori

well that was not documented...

still i am not sure that is what that person wants to do. that also stops the user from posting.

either we are off topic for this mod support topic or the person we are replying to most likely does not mean what we think they do.

Kindred

The question is not about pm, the question was regarding profile comments which is a feature of the ultimate profile mod
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

margarett

A bit more off-topic :P

Quote from: Illori on December 22, 2015, 06:03:52 PM
well that was not documented...
Indeed it isn't. But the code says so
(it's also the first time I looked at this :P )

elseif (isset($_SESSION['ban']['cannot_post']) || (!empty($modSettings['warning_mute']) && $modSettings['warning_mute'] <= $user_info['warning']))
{
$denied_permissions = array(
'pm_send',
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Rene88

Thanks for the reply's but idd i mean Profile Comments. Sending PM for this user is all ready blocked.
i now want to block that the user cant post profile comments on any profile (ultiemate Profile)

Kindred

right... and, as I said - there is no way to do that without adding extra code and possibly a complete new permission...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Suki

This is what I did on a similar mod:

// Does an ignored user wants to see your wall? never!!!
if (isset($context['Breeze']['settings']['owner']['kick_ignored']) && !empty($context['Breeze']['settings']['owner']['kick_ignored']) && !empty($context['Breeze']['settings']['owner']['ignoredList']))
{
// Make this an array
$ignored = explode(',', $context['Breeze']['settings']['owner']['ignoredList']);
if (in_array($user_info['id'], $ignored ))
redirectexit('action=profile;area=static;u='.$context['member']['id']);
}


Basically, you need to fetch the profile's owner data, there is some info stored in $context['member']  but I don't remember it if also contains the list of ignored users.

The list of ignored users its a comma separated string, you just need to explode it into an array and check the ID of the user viewing that profile against that array, if it exists send the user somewhere else or show him/her a message or whatever.

This code needs to be placed in the Sources code for the ultimate profile mod, I don't know this mod very well so I can't tell you exactly where it should be placed.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Kindred

and it would need to be modified as well, since it specifically is looking for stuff in an array called Breeze under context
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: