Ultimate Profile

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

Previous topic - Next topic

Kindred

This mod DOES work on 2.0.17 with no errors.
There are some tweaks needed, however.

(There may be some additional changes needed to the installer - specifically for mysqli and a missing column)

first, the change for mysqli in Subs-Members.php (after the mod is installed)

Quote from: Kindred on February 07, 2018, 12:43:59 PM
just noticed some mysqli db_fetch_assoc errors appearing when deleting members


this change is needed to make the mod code updated for mysqli compatability (and thus working on 2.0.15)

Code (in Subs-Members.php) Select

$smcFunc['db_query']('', '
SELECT ID_PICTURE
FROM {db_prefix}profile_pictures
WHERE id_member IN ({array_int:users})',
array(
'users' => $users,
)
);

require_once($sourcedir . '/Profile-Pictures.php');
while ($row = $smcFunc['db_fetch_assoc']($request)) {
delete_picture($row['ID_PICTURE']);
}


Code (change to) Select

//modified Ultimate Profile mod for mysqli updates
$request = $smcFunc['db_query']('', '
SELECT ID_PICTURE
FROM {db_prefix}profile_pictures
WHERE id_member IN ({array_int:users})',
array(
'users' => $users,
)
);

require_once($sourcedir . '/Profile-Pictures.php');
while ($row = $smcFunc['db_fetch_assoc']($request)) {
delete_picture($row['ID_PICTURE']);
}
$smcFunc['db_free_result']($request);



there may be other places that similar updates need to be made, but I haven't triggered them yet.

I also removed the tables in the mod and converted them to divs.
(this version also has a block for the SMF-Trader system)
Сл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."

Grammy

I actually have this working in 2.1RC3 with only this one error:

Undefined index: image_href

Found on line 147 of Ultimateprofile.template.php:



<em>', $settings['use_image_buttons'] ? '<img src="' . $context['member']['online']['image_href'] . '" alt="' . $context['member']['online']['text'] . '" align="middle" />' : $context['member']['online']['text'], $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $context['member']['online']['text'] . '</span>' : '', '</em>


image_href is used in other 2.1RC3 files...  do I need to add some sort of "if exist" or $verify_context or something?  (Like I even know what I'm asking.)   :D

Grammy

Time ran out to modify my last post, but this sorted the error, and now it's not throwing any errors. 

<em>', $settings['use_image_buttons'] ? '<img src="' . $verify_context = &$context['member']['online']['image_href'] . '" alt="' . $context['member']['online']['text'] . '" align="middle" />' : $context['member']['online']['text'], $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $context['member']['online']['text'] . '</span>' : '', '</em>

(Really close to having this behaving for 2.1 just as it did in 2.0.)   :)

Shades.

Quote from: Kindred on July 10, 2020, 04:01:29 PM
This mod DOES work on 2.0.17 with no errors.
There are some tweaks needed, however.

(There may be some additional changes needed to the installer - specifically for mysqli and a missing column)

first, the change for mysqli in Subs-Members.php (after the mod is installed)

I tried to install this on 2.0.18 and it won't even allow me to install to make the edits you posted:
QuoteCall to undefined function mysql_query()
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Kindred

Quote from: Shades. on June 01, 2021, 09:38:46 PM
Quote from: Kindred on July 10, 2020, 04:01:29 PM
This mod DOES work on 2.0.17 with no errors.
There are some tweaks needed, however.

(There may be some additional changes needed to the installer - specifically for mysqli and a missing column)

first, the change for mysqli in Subs-Members.php (after the mod is installed)

I tried to install this on 2.0.18 and it won't even allow me to install to make the edits you posted:
QuoteCall to undefined function mysql_query()

Quote from: Shades. on June 01, 2021, 09:38:46 PM
Quote from: Kindred on July 10, 2020, 04:01:29 PM
(There may be some additional changes needed to the installer - specifically for mysqli and a missing column)
Сл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."

Shades.

Lol I read that but misunderstood! Was having a brain loss moment! :o ;D
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Grammy

Quote from: Kindred on June 02, 2021, 12:46:49 PM
This mod DOES work on 2.0.17 with no errors.
There are some tweaks needed, however.

(There may be some additional changes needed to the installer - specifically for mysqli and a missing column)

first, the change for mysqli in Subs-Members.php (after the mod is installed)

Hi, Kindred (anyone else who wanted to weigh in), just wanted to get your thoughts on this please?

Two screenshots attached, the first (darker background) is 2.0.17 and the second is 2.1RC3 (lighter tiled background).

This is working perfectly on 2.0.17 (you can see all the fields are populated in some respect).  The tiled background only appears within my profile summary, using Ultimate Profile's CSS option field.

In 2.1RC3, I did have two errors, both appearing in the Ultimateprofiletemplate.php file: karmaMode (I just commented that bit out) and Undefined index: image_href which I sorted by editing line 147:

<em>', $settings['use_image_buttons'] ? '<img src="' . $verify_context = &$context['member']['online']['image_href'] . '" alt="' . $context['member']['online']['text'] . '" align="middle" />' : $context['member']['online']['text'], $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $context['member']['online']['text'] . '</span>' : '', '</em>

I now have no errors, no matter how much I click around with it.  Some fields can be populated, such as media, "about me", "interests".  The tiled background background you see is, again, done by adding CSS to the option field, and only appears in my profile summary. 

I have gone through all the edits and includes, compared them with the 2.0.17 files, etc., and can see no reason for this, but the "Pictures", "Buddies" and "Comments" fields are not only unpopulated but don't really provide any clickable function to add anything.  Also, there are no "mini headers" above each field in 2.1RC3, as there are in 2.0.17 and no "side field" on the left for edits.  (The 2.1RC3 issues were occurring even before sorting the errors and didn't correct after.)

All the tables appear in both databases.  I have mysql (version 5.1.73) and 7.1.26 PHP for both forums.

All that to ask:  while I'm investigating why 2.1RC3 is not functioning completely and if the files are essentially identical between both forums and the includes are present, would I then study the database tables to proceed?

All this is only for the purposes of testing; no live forums are involved, so I'm not afraid to break anything.   :)

Kindred

I have not looked at this for 2.1 yet.....         I'll eventually get around to it and put it on my test site, but it'll be a month or so before I can look at it.
Сл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."

Grammy

Quote from: Kindred on June 03, 2021, 08:39:55 AM
I have not looked at this for 2.1 yet.....         I'll eventually get around to it and put it on my test site, but it'll be a month or so before I can look at it.

Thanks, there's no rush.  I'll keep tinkering, in the meantime.   :)

Shades.

So how did yall get it to work on 2.0.17? What changes need to be made in the installer? :o O:)
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Grammy

Quote from: Shades. on June 03, 2021, 03:29:01 PM
So how did yall get it to work on 2.0.17? What changes need to be made in the installer? :o O:)


Oh, it works fine on 2.0.17!  It's 2.1RC3 I had to wrestle with, but I'm happy to report that I just whipped it's..... uh....  I prevailed.   :D

I did the 2.0.17 manually and, if I recall, I did have to improvise on some "find" strings.  The database.php and helper.php go white (like they usually do) when you navigate to them, but they do add the tables to the database.  I'll take a peek at my edits and get back to you on what had to be tiptoed around, edit-wise.   :)

Grammy

Quote from: Grammy on June 03, 2021, 04:11:06 PM
Quote from: Shades. on June 03, 2021, 03:29:01 PM
So how did yall get it to work on 2.0.17? What changes need to be made in the installer? :o O:)


Oh, it works fine on 2.0.17!  It's 2.1RC3 I had to wrestle with, but I'm happy to report that I just whipped it's..... uh....  I prevailed.   :D

I did the 2.0.17 manually and, if I recall, I did have to improvise on some "find" strings.  The database.php and helper.php go white (like they usually do) when you navigate to them, but they do add the tables to the database.  I'll take a peek at my edits and get back to you on what had to be tiptoed around, edit-wise.   :)

If you want to try installing it manually, just let me know which files failed in the package manager (...cough....Profile-Modify.php....cough.....)   and I'll paste the edits here.   :)

Shades.

Quote from: Grammy on June 03, 2021, 04:27:39 PM
Quote from: Grammy on June 03, 2021, 04:11:06 PM
Quote from: Shades. on June 03, 2021, 03:29:01 PM
So how did yall get it to work on 2.0.17? What changes need to be made in the installer? :o O:)


Oh, it works fine on 2.0.17!  It's 2.1RC3 I had to wrestle with, but I'm happy to report that I just whipped it's..... uh....  I prevailed.   :D

I did the 2.0.17 manually and, if I recall, I did have to improvise on some "find" strings.  The database.php and helper.php go white (like they usually do) when you navigate to them, but they do add the tables to the database.  I'll take a peek at my edits and get back to you on what had to be tiptoed around, edit-wise.   :)

If you want to try installing it manually, just let me know which files failed in the package manager (...cough....Profile-Modify.php....cough.....)   and I'll paste the edits here.   :)

Well I just installed it manually on a test forum and everything appears to be good so far! (Fingers crossed) But yeah took me a minute to figure out the edits in "Profile-Modify.php" but I think I got it, we'll see lol! Thanks! 8)
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Grammy

Quote from: Shades. on June 03, 2021, 06:03:11 PM

Well I just installed it manually on a test forum and everything appears to be good so far! (Fingers crossed) But yeah took me a minute to figure out the edits in "Profile-Modify.php" but I think I got it, we'll see lol! Thanks! 8)

That one was a stinker, wasn't it?  And it REALLY stunk up the joint in 2.1RC3, ha!   :D   Glad you got it going! 

Shades.

I had errors after installing, it was conflicting with another mod that I was trying out but after removing that mod I have no errors now so I'll be sure and make full backups if I decide to use it on my live site cause its loaded with mods lol! O:) 8)

Oh...forgot to mention my install was on 2.0.18 ;)
ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean

Grammy

Quote from: Shades. on June 03, 2021, 06:17:41 PM
I had errors after installing, it was conflicting with another mod that I was trying out but after removing that mod I have no errors now so I'll be sure and make full backups if I decide to use it on my live site cause its loaded with mods lol! O:) 8)

Oh...forgot to mention my install was on 2.0.18 ;)

Oh, that reminds me, I need to test it with Pretty URLs and maybe a portal to see how it behaves. 

If you do eventually throw a "image_href" error, line 147, UltimateProfile_template.php, this sorted it for me:

<em>', $settings['use_image_buttons'] ? '<img src="' . $verify_context = &$context['member']['online']['image_href'] . '" alt="' . $context['member']['online']['text'] . '" align="middle" />' : $context['member']['online']['text'], $settings['use_image_buttons'] ? '<span class="smalltext"> ' . $context['member']['online']['text'] . '</span>' : '', '</em>

But of course, that's my duct-tape.  Bigger brains than mine may weigh in on this, ha!   :D

live627

If only there was a galaxy brain somewhere 😂

Grammy

Quote from: live627 on June 04, 2021, 09:14:25 AM
If only there was a galaxy brain somewhere 😂


Oooooo.........   

😀

aegersz

Bug: count(): Parameter must be an array or an object that implements Countable

fix at +1000 /var/www/html/Sources/Profile-Pictures.php (PHP 7.3 and above) :

find:
if (count($parents) > 0) {

replace:
if (is_countable($parents) && count($parents) > 0) {
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

Marina3

Version of mod for SMF 2.1.3?

Advertisement: