News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Smf user Menu Beta Mod

Started by Faevilangel, August 11, 2009, 07:02:08 AM

Previous topic - Next topic

Arantor

Modify the install from:
<div class="menu" id="profile',$message['id'],'">

To:
<div class="menu" style="display:none;" id="profile',$message['id'],'">

Ugly but works. Though it sounds like the style isn't kicking in. Might be better to assign a less generic name than 'menu'.

Faevilangel

ok now it doesn't show (the div was asking for a class, but i had defined the css in id's)

the js doesn't work, it doesn't show the user menu when you click the name

this is starting to bug me now ahaha :P
I am available for theme work, pm me for info

Arantor

No, because you're not passing in the message id into the function. Fixes:


<add><![CDATA[
function profile_menu(id) {
  var d = document.getElementById(id);
  if(d.style.display == 'none') {
    d.style.display = 'block';
  } else {
    d.style.display = 'none';
  }
}
]]></add>


<add><![CDATA[
<a href="#" onclick="profile_menu(\'profile', $message['id'], '\'); return false;">',$message['member']['name'],'</a>
<br />
<div class="menu" id="profile',$message['id'],'">
<ul id="menu2">
<li><a href="', $scripturl, '?action=profile;u=',$context['member']['id'],'">View Profile</a></li>
<li><a href="', $scripturl, '?action=pm;sa=send;u=', $context['member']['id'], '">Send Mesage</a></li>
<li><a href="', $scripturl, '?action=buddy;u=', $context['member']['id'], ';sesc=', $context['session_id'], '">[', $txt['buddy_' . ($context['member']['is_buddy'] ? 'remove' : 'add')], ']</a> </li>
</ul>
</div>

]]></add>

Antechinus

You should set up a test account with basic permissions, or enable viewing profile for guests. ;)

Faevilangel

#64
yeah i will do that in a sec antechinus

still not working, im pulling my hair out here  :-[ think im gonna stick to themes

user = test_account, pw is 123456789
I am available for theme work, pm me for info

Arantor


Faevilangel

I am available for theme work, pm me for info

Antechinus

It's working now. :D

ETA: The OP is from a guest account == no profile. :P

Faevilangel

Quote from: Antechinus on August 11, 2009, 08:43:37 PM
It's working now. :D

ETA: The OP is from a guest account == no profile. :P

not working on my admin account  >:(

I am available for theme work, pm me for info

Faevilangel

I am available for theme work, pm me for info

Antechinus


Faevilangel

im off to bed, thanks for the help guys, will pick this up in the morning
I am available for theme work, pm me for info

Arantor

I doubt I'll get to look at this tonight unfortunately, but you're definitely mostly there with it as far as I can see.

Antechinus

Ok, I have it running on a fresh 1.1.10 installation on local and it is fine in Firefox 3 but non-functional in 3.5. I know for a fact that there are some js problems with SMF and 3.5. I'll test some other browsers now.

By the way, the id="menu2" gives duplicate ID html validation errors so something will need to be done about that. The mod approval team wont pass it with validation errors. Easy fix though.

Antechinus

Works on Opera 10, IE7 and Chrome. Looking good. Could do with a bit of styling but that's no big deal. Best would be to give it some z-index so it didn't shunt the avatar down the page. Much smoother look that way.  Also a background, etc. Like vB, in other words. It's pretty much there though as it does work in most browsers.

Arantor

If you're going into z-index, also style it for position=relative (or absolute? always get those mixed), to break it out of the DOM, so it pops up, rather than forces its way on the layout.

Antechinus

#76
Yeah that was what I was thinking but I can never remember which one it is either. The thing is that people may want to add extra links and having it coming down over the avatar with z-index would be the best solution. Anyway the damned thing works so that's the main point.

ETA: Oh and it should also have a conditional statement so that the profile links are not displayed to guests unless permissions are set that way in admin. That's an easy addition too so no prob.

Just tested in FF2 and IE6 and it works in those. Looks like FF3.5 is the only problem child. Should be fixable.

Faevilangel

Quote from: Antechinus on August 11, 2009, 09:28:39 PM
Yeah that was what I was thinking but I can never remember which one it is either. The thing is that people may want to add extra links and having it coming down over the avatar with z-index would be the best solution. Anyway the damned thing works so that's the main point.

ETA: Oh and it should also have a conditional statement so that the profile links are not displayed to guests unless permissions are set that way in admin. That's an easy addition too so no prob.

Just tested in FF2 and IE6 and it works in those. Looks like FF3.5 is the only problem child. Should be fixable.

wow guys thanks, i have no idea why it won't work on my forum, i have ff 3 but only smf 1.1.9

I can sort the validation errors pretty simple
i can add a z-index etc so thats easy, i know how to make a conditional in php but not using smf but would be like


if (user=guest) {
  display menu without profile
}
else
{
display full menu
}

I am available for theme work, pm me for info

Antechinus

It does work on your fourm, or at least it did for me once I made a test post from a non-guest account. The OP in that thread was from the automatic SMF user and that one is ranked as a guest, therefore it has no profile information.

The conditional used in index.template for the profile tab is this one:

if ($context['allow_edit_profile'])
        echo '

Faevilangel

Quote from: Antechinus on August 12, 2009, 09:29:53 AM
It does work on your fourm, or at least it did for me once I made a test post from a non-guest account. The OP in that thread was from the automatic SMF user and that one is ranked as a guest, therefore it has no profile information.

The conditional used in index.template for the profile tab is this one:

if ($context['allow_edit_profile'])
        echo '


wasn't for me, maybe my firefox.... i will add the conditional and make the zindex also, will also add some colour
I am available for theme work, pm me for info

Advertisement: