News:

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

Main Menu

Custom Greeting

Started by Diego Andrés, September 08, 2008, 03:05:09 AM

Previous topic - Next topic

Marcus Forsberg

What? Is that still there? Thought I fixed it. Will look later.

Tiribulus

#301
Hi NAS,

I've gotten passably good at making my own edits, but in this case the word greeting, nevermind that whole line, isn't even in the index.template.php for Aaron's Bright Forest theme. The mod works fine in the default theme.
I've had it working fine in my 1.1.11 forum forever. This is 2.0 rc3 If you could take a glance at this file and tell me where to put that one simple edit. I sure would appreciate it.
Thanks

Scratching my Head

Hi Nas.

My custom theme index.template.php uses this:

echo '<div class="profile_info"><h3>', $txt['hello_member_ndt'], ' <b>', $context['user']['name'], '</b></h3>';

rather than this:

<span style="font-size: 130%;"> ', $txt['hello_member_ndt'], ' <b>', $context['user']['name'] , '</b></span>

So putting this: <span style="font-size: 130%;"> ',$context['greeting'],'</span>

Gives me this error:

441: {
442: if (!empty($context['user']['avatar']))
443: {
444: $context['user']['avatar']['image'] = strtr($context['user']['avatar']['image'], array("class=\"avatar\"" => "class=\"avatar_t\""));
445: echo '<div style="margin-top: 15px; float: left;">', $context['user']['avatar']['image'], '</div>';
446: }
447: else
448: echo '<div style="margin-top: 15px; float: left;"><a href="' . $scripturl . '?action=profile;u=', $context['user']['id'], ';sa=forumProfile"><img src="' . $settings['images_url'] . '/noavatar.png" alt="missing avatar" alt="" width="65px" height="65px" /></a></div>';
449:
450: <span style="font-size: 130%;"> ',$context['greeting'],'</span>
451:
452: echo '<div id="useropts"><ul>';
453: // Only tell them about their messages if they can read their messages!
454: if ($context['allow_pm'])


Is there a work around?


Many, many thanks.

Marcus Forsberg

You've removed the echo().

echo'<span style="font-size: 130%;"> ',$context['greeting'],'</span>';

Should be like that.

Scratching my Head

Well... that broke the theme.
This worked:

echo '<div class="profile_info"><h3>',$context['greeting'],'</b></h3>';


That includes the theme specifications, but then? No change. It simply says:

Hello, ____


Any guesses?

Marcus Forsberg

Quote from: Scratching my Head on April 18, 2010, 04:12:57 PM
Well... that broke the theme.

I based it on what you posted, so that's why...

Quote from: Scratching my Head on April 18, 2010, 04:12:57 PM
That includes the theme specifications, but then? No change. It simply says:

Hello, ____

Any errors in the log? Is the mod properly installed?

Scratching my Head

I installed by hand on a test forum... good advice to anyone: Install test forum, test mods there first (wink)...

So everything installed fine. Just no change, Nas. I can't figure it out?

No errors.

JessyKa

#307
Hello Nas,
We installed Your mod and it technically works.

But:
while in the Admincenter the right messages are chosen (and therefore obviously the right time) on the starting page the wrong text is displayed.
Can you imagine how this difference can occur? Where can I check, which times are used?

I am sorry, Newby and not-native, hope you do understand what I mean anyway.
Thanks,
Jessy

[Edit: sorry, the problem is solved.
Somehow the inputs made in the administrator center directly are not written into the Modifications.german.php. Did this manually and it works fine
Jessy]

nosferatu

This is a great mod but will it be made compatible with RC4 as well. Just upgraded and lost the mod!

Many thanks
There's a certain joy in being mad that only madmen know

KE6IRJ

Okay, I read all 16 pages, but must have missed something.  I am using 1.1.12 and a custom theme based off default.  So when I install this mod, I use the package manager, then do the parse instructions for my version.  Only thing I did different was where parse instructions called for default/... I used my theme folder.

Is this right, because the mod is not working at all.  I get no errors, but I also get no custom greetings.

KE6IRJ


Akyhne

This mod contains a small bug:

./Themes/default/index.template.php

Find: [Select]
<li class="greeting">', $txt['hello_member_ndt'], ' <span>', $context['user']['name'], '</span></li>
Replace With: [Select]
<li class="greeting">', $context['greeting'], '</span></li>

should be:
Replace With: [Select]
<li class="greeting"><span>', $context['greeting'], '</span></li>

nosferatu

Hi Akyne. Will this be available for RC4 please?

Thanks
There's a certain joy in being mad that only madmen know

Akyhne


nosferatu

There's a certain joy in being mad that only madmen know

sharks

Hello

I am getting this error from several members in my error log:

Undefined index: greeting
File: /home/sharks/forum/Themes/default/Errors.template.php (main_above sub template - eval?)
Line: 222

KE6IRJ

Quote from: Akyhne on November 30, 2010, 05:28:35 AM
This mod contains a small bug:

./Themes/default/index.template.php

Find: [Select]
<li class="greeting">', $txt['hello_member_ndt'], ' <span>', $context['user']['name'], '</span></li>
Replace With: [Select]
<li class="greeting">', $context['greeting'], '</span></li>

should be:
Replace With: [Select]
<li class="greeting"><span>', $context['greeting'], '</span></li>

When I parse for version 1.1.12, I don't see this code modification at all... help?


sharks

I think we have another mod which has been abandoned. The SMF team should create a separate section for all those mods who could be picked up by others...

KE6IRJ


Spoogs

Quote from: sharks on December 23, 2010, 10:52:35 AM
I think we have another mod which has been abandoned. The SMF team should create a separate section for all those mods who could be picked up by others...
How many times have YOU already been told thats not how it works... the mod author has to give permission for someone to take over the mod... the team cannot just give someones mod away... be it abandoned or otherwise.

Advertisement: