News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Ultimate Profile

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

Previous topic - Next topic

trekkie2444

Quote from: SunKing on July 26, 2011, 06:01:39 PM
Simple enough.

Open UltimateProfile.template.php.

In the $column_layout array add an entry called 'membermap', where you want your map to display (top, left, right, or bottom). I have mine in the right array as follows:
'right' => array(
'media',
'membermap',
'buddies',
                'visitors',
'awards',
'championships',


Next, at the end of the file just before the ?> add the following block of code:
function up_block_membermap()
{
global $modSettings, $context, $txt, $scripturl, $user_info;
if(isset($context['member']['googleMap']['latitude']) && isset($context['member']['googleMap']['longitude'])){
if ($modSettings['googleMapsEnable'] && allowedTo('googleMap_view'))
{
if (isset($context['member']['googleMap']['latitude']) && isset($context['member']['googleMap']['longitude']))
{

echo '
<div id="up_membermap">
<div class="cat_bar">
<h3 class="catbg" style="text-align:left;">
'.$txt['googleMap'].'
<span class="floatright" style="font-size:.8em;"><a href="'.$scripturl.'?action=profile;area=customized;u='.$context['member']['id'].';#mmap">Edit pin</a></span>
</h3>
</div>
<div class="windowbg creator">
<div class="content">
<script src="http://maps.google.com/maps?file=api&v=2&key=' . $modSettings['googleMapsKey'] . '" type="text/javascript"></script>
<div id="map" style="width: 100%; height: 350px; color: #000000;"></div>
<input type="hidden" name="latitude" size="50" value="', $context['member']['googleMap']['latitude'], '" />
<input type="hidden" name="longitude" size="50" value="', $context['member']['googleMap']['longitude'], '" />
<script type="text/javascript">';

// Evil hack on this!!!
echo '
//' . chr(60) . chr(33) . chr(91) . chr(67) . chr(68) . chr(65) . chr(84) . chr(65) . chr(91);

echo '
function LoadMap()
{
var map = new GMap2(document.getElementById("map"));
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng(' . $context['member']['googleMap']['latitude'] . ',' . $context['member']['googleMap']['longitude'] . '), 13, '. $modSettings['googleMapsType'] . ');
var point = new GLatLng(' . $context['member']['googleMap']['latitude'] . ',' . $context['member']['googleMap']['longitude'] . ');
var marker = new GMarker(point);
map.addOverlay(marker);
}

if (GBrowserIsCompatible()) {
window.onload=LoadMap;
}';

// Let's make another evil hack!
echo '
//' . chr(93) . chr(93) . chr(62);

echo '
</script>
</div>

</div>
</div><br />';
}
}
}
}


That block was simply taken from the GoogleMap template.

Please keep in mind that the block of code is styled for my site and may look odd used in your layout, but the needed code is there.

Thank you!

[unplugged]

« Next Edit: Tomorrow at 08:34:45 PM by SunKing »   <---- « someone stole my sig... :o »



trekkie2444

Is there going to be an SMF 2.0 update?

bedeceived

For the 1324th time.  Emulate.   ;D

trekkie2444

Quote from: MiY4Gi on July 15, 2011, 06:52:21 AM
It's very simple.

You download/upload the package as usual, but when you get to the point when you need to install, navigate back to Admin > Main > Package Manager > Browse Packages.

Note the position of your mod on the list of uploaded mods. Most of the mods will have [Uninstall] or [Install Mod] before [list Files], however the Ultimate Profile mod, will NOT have an [Install Mod], since the mod is "incompatible" with 2.0 Gold, nor an [Uninstall], since the mod hasn't been installed yet.

Now, click Advanced in the bottom right corner, then type in SMF 2.0 RC4 and click Apply. Check to see if [Install Mod] appeared next to Ultimate Profile. If not, go back to Advanced and change the version to SMF 2.0 RC3 and click Apply, then check to see if [Install Mod] appeared.

Repeat the process with various versions of SMF 2.0 until the [Install Mod] appears, then click it and proceed with the installation as usual.

That my friend, is called emulating.  [/list]

Ah, this is quite useful.

[unplugged]

To quickly restate what has been posted several times and perhaps obscured, if you are getting the error:
Unknown column 'com.time' in 'field list'
File: /home/content/88/6470888/html/Sources/Profile-View.php
Line: 246

Here:




I am not going to explain to you the inner workings of phpMyAdmin nor how to log into anything through your host. If you have questions with these, try using Google or contacting your host.

Once you have phpMyAdmin open, and you have clicked on your database at the top of the left-hand column, you'll notice tabs at the top.

Structure    SQL    Search    Query    Export    Import    Operations

Select the SQL tab and type/paste the following line into that box:

ALTER TABLE smf_profile_comments ADD time INT NOT NULL AFTER date

Make sure to replace smf_ with your table prefix.

Now click Go and the query will be run. This should fix the problem.


« Next Edit: Tomorrow at 08:34:45 PM by SunKing »   <---- « someone stole my sig... :o »



SIMul8rReviews

I need some help with this mod.

Okay, so I installed the mod.. there were no errors, so everything installed successfully. I even have the Ultimate Profile enabled for all members.
But, once I go to my profile or anyone else's profile.. I get this error (see image attachment)

I'm running SMF 2.0 Gold.

Yngwiedis

Just read the previous post before yours. Doh !!!
AmityHost.com - The Affordable Host

SIMul8rReviews

Quote from: Yngwiedis on August 02, 2011, 03:39:44 PM
Just read the previous post before yours. Doh !!!

Oh, well excuse me. I couldn't recognize that small of font in the code box.. but thanks for informing me ever so nicely..

TheListener

It does usually help if a person reads through a topic first.

Xarcell

Quote from: SunKing on July 26, 2011, 06:01:39 PM
Simple enough.

Open UltimateProfile.template.php.

In the $column_layout array add an entry called 'membermap', where you want your map to display (top, left, right, or bottom). I have mine in the right array as follows:
'right' => array(
'media',
'membermap',
'buddies',
                'visitors',
'awards',
'championships',


Next, at the end of the file just before the ?> add the following block of code:
function up_block_membermap()
{
global $modSettings, $context, $txt, $scripturl, $user_info;
if(isset($context['member']['googleMap']['latitude']) && isset($context['member']['googleMap']['longitude'])){
if ($modSettings['googleMapsEnable'] && allowedTo('googleMap_view'))
{
if (isset($context['member']['googleMap']['latitude']) && isset($context['member']['googleMap']['longitude']))
{

echo '
<div id="up_membermap">
<div class="cat_bar">
<h3 class="catbg" style="text-align:left;">
'.$txt['googleMap'].'
<span class="floatright" style="font-size:.8em;"><a href="'.$scripturl.'?action=profile;area=customized;u='.$context['member']['id'].';#mmap">Edit pin</a></span>
</h3>
</div>
<div class="windowbg creator">
<div class="content">
<script src="http://maps.google.com/maps?file=api&v=2&key=' . $modSettings['googleMapsKey'] . '" type="text/javascript"></script>
<div id="map" style="width: 100%; height: 350px; color: #000000;"></div>
<input type="hidden" name="latitude" size="50" value="', $context['member']['googleMap']['latitude'], '" />
<input type="hidden" name="longitude" size="50" value="', $context['member']['googleMap']['longitude'], '" />
<script type="text/javascript">';

// Evil hack on this!!!
echo '
//' . chr(60) . chr(33) . chr(91) . chr(67) . chr(68) . chr(65) . chr(84) . chr(65) . chr(91);

echo '
function LoadMap()
{
var map = new GMap2(document.getElementById("map"));
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng(' . $context['member']['googleMap']['latitude'] . ',' . $context['member']['googleMap']['longitude'] . '), 13, '. $modSettings['googleMapsType'] . ');
var point = new GLatLng(' . $context['member']['googleMap']['latitude'] . ',' . $context['member']['googleMap']['longitude'] . ');
var marker = new GMarker(point);
map.addOverlay(marker);
}

if (GBrowserIsCompatible()) {
window.onload=LoadMap;
}';

// Let's make another evil hack!
echo '
//' . chr(93) . chr(93) . chr(62);

echo '
</script>
</div>

</div>
</div><br />';
}
}
}
}


That block was simply taken from the GoogleMap template.

Please keep in mind that the block of code is styled for my site and may look odd used in your layout, but the needed code is there.

Works nicely! however how can I change it so that only the person's buddies & owner can see it? I'm no code but I tried :

if ($modSettings['googleMapsEnable'] && $memberContext[$user_info['id']]['is_buddy']  && allowedTo('googleMap_view'))
{


and

function up_block_membermap()
{
global $modSettings, $context, $txt, $scripturl, $user_info;
if ($memberContext[$user_info['id']]['is_buddy']){
if(isset($context['member']['googleMap']['latitude']) && isset($context['member']['googleMap']['longitude'])){
if ($modSettings['googleMapsEnable'] && allowedTo('googleMap_view'))
{
if (isset($context['member']['googleMap']['latitude']) && isset($context['member']['googleMap']['longitude']))
{

echo '
<div id="up_membermap">
<div class="cat_bar">
<h3 class="catbg" style="text-align:left;">
'.$txt['googleMap'].'
<span class="floatright" style="font-size:.8em;"><a href="'.$scripturl.'?action=profile;area=customized;u='.$context['member']['id'].';#mmap">Edit pin</a></span>
</h3>
</div>
<div class="windowbg creator">
<div class="content">
<script src="http://maps.google.com/maps?file=api&v=2&key=' . $modSettings['googleMapsKey'] . '" type="text/javascript"></script>
<div id="map" style="width: 100%; height: 350px; color: #000000;"></div>
<input type="hidden" name="latitude" size="50" value="', $context['member']['googleMap']['latitude'], '" />
<input type="hidden" name="longitude" size="50" value="', $context['member']['googleMap']['longitude'], '" />
<script type="text/javascript">';

// Evil hack on this!!!
echo '
//' . chr(60) . chr(33) . chr(91) . chr(67) . chr(68) . chr(65) . chr(84) . chr(65) . chr(91);

echo '
function LoadMap()
{
var map = new GMap2(document.getElementById("map"));
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng(' . $context['member']['googleMap']['latitude'] . ',' . $context['member']['googleMap']['longitude'] . '), 13, '. $modSettings['googleMapsType'] . ');
var point = new GLatLng(' . $context['member']['googleMap']['latitude'] . ',' . $context['member']['googleMap']['longitude'] . ');
var marker = new GMarker(point);
map.addOverlay(marker);
}

if (GBrowserIsCompatible()) {
window.onload=LoadMap;
}';

// Let's make another evil hack!
echo '
//' . chr(93) . chr(93) . chr(62);

echo '
</script>
</div>

</div>
</div><br />';
}
}
}
}
}


with no prevail...

[unplugged]

« Next Edit: Tomorrow at 08:34:45 PM by SunKing »   <---- « someone stole my sig... :o »



TheListener


Kindred

well, it looks like you'd have to add the changes which the activity bar mod makes to the standard profile and profile.template files into the ultimateprofile files...
Сл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."

studiowi33

Hi all--

Illori ran me off the 2.0 support page and I have to ask folks here...
Quote from: studiowi33 on August 03, 2011, 05:09:22 PM
Hi all--

Running 2.0 and I need to add  the age field (as well as gender) to the registration page. The gender field is easy, but I don't need to add a custom age field as this is already included in the Ultimate Profile mod. (I'm assuming that checking the "Show on Registration" checkbox will add that (gender) information to a new user's profile.)

I need to do this with the age field as well. Any ideas?

As always, thanks for any insight.

-s.w
SMF 2.0.2

mforum

#2655
I put a youtube html link code on Media but nothing shows  ::)

studiowi33

Quote from: mforum on August 04, 2011, 03:16:14 AM
I put a youtube html link code on Media but nothing shows  ::)

I have to use the "Use old embed code" option @ Utube for it to show up in my Media Box.

hth

-s.w
SMF 2.0.2

mforum

in deed !
thanks for the tip  :)

ကိုေန

I m admin ...using smf2.0rc5 with Ultimate Profile 2.0rc4

But I go >>>> Profilr >>>> Ultimate Profile
I get the error " You are not allowed to access this section "

Please Help Me .....

Engel

#2659
Can someone tell me what file should I use to change the look of the tables on the profile? Thank you
Also, is there a way so unused profile fields aren't shown?

待ち合わせはいつも曲がり角んとこ 赤いポストに寄りかかって待ってたの
[ hellsketch ]

Advertisement: