News:

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

Main Menu

Custom Greeting

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

Previous topic - Next topic

Marcus Forsberg

john123

I'm just chansing now as I have no site to test this on currently.Open index.template.php

Find:
// Start CGDT Mod by Nascar

$date = date('H', forum_time());

if ($date < 6)


Replace whit:
[/]
// Start CGDT Mod by Nascar

$date = date('H', forum_time());
if($context['user']['is_logged'])
if ($date < 6)
It's probably wrong, I'll have a better look at it when my test site is up running again. O:)

SISA                         
Glad it works :)

Mystiquo & asudhakar                   
I'll try to help you as soon as my test forum is working again.

Have a nice day
Nascar


Cal O'Shaw

Hello,

Very interesting MOD, but at the risk of asking something that may have already been addressed, are you looking at adding an Admin CP setting set to, at least, allow the messages displayed to be edited by the Admins.  Ideally, to also allow the Admins to set the start times of each of those greetings (the end time would be the start time of the next greeting, minus one minute, so Admin input would not be needed, the first greeting, starting at 00:00, would also not be open to editing by Admins, the last one ending at 23:59).

I'm just not comfortable with the greetings that start at 22:00 and end at 06:59, otherwise I'd be incorporating it in my site as well (the greetings are really a nice touch!).

Thank you for working to make SMF more useful and, well, fun!

Marcus Forsberg

Cal O'Shaw
Yes, that would truly be great, but I think that's beyond my skills right now.
Maybe in the future.

gamgam

please if u can customize this mod for clan wars theme it would be great!

Marcus Forsberg


the_underworld

Awesome mod!  I have a question though...  im using more style and I can't find the place to add the code to.  I was wondering if you could help with that.  Thanks!



Marcus Forsberg

the_underworld
I'll have a look at that in a moment.

gamgam
No problem. I'll fix it soon.

Have a nice day
Nascar

Marcus Forsberg

the_underworld
Try the attached file. Remember to backup the original file first, in case I did a mistake.

Have a nice day
Nascar

Marcus Forsberg

gamgam
Try this:
Themes/ClanWar/Index.template.php
(Backup file first)

Find:
   if($context['user']['is_logged'])
      echo '
            <td  height="32">
               <span style="font-size: 130%;"> ', $txt['hello_member_ndt'], ' <b>', $context['user']['name'] , '</b></span>
            </td>';


And replace whit:   if($context['user']['is_logged'])
      echo '
            <td  height="32"><span style="font-size: 130%;">';

// Start CGDT Mod by Nascar

$date = date('H', forum_time());

if ($date < 6)
   echo $txt['up_late_arent_we'];
elseif ($date < 7)
   echo $txt['are_you_the_early_bird'];
elseif ($date < 12)
   echo $txt['good_morning'];
elseif ($date < 18)
   echo $txt['good_afternoon'];
elseif ($date < 22)
   echo $txt['good_evening'];
elseif ($date < 24)
   echo $txt['shouldnt_you_be_going_to_bed_soon'];

echo ', <b>', $context['user']['name'] , '</b>
</span>
            </td>';
// End CGDT Mod by Nascar


Have a nice day.
Nascar

gamgam


Marcus Forsberg

Sry, your theme must be using a cutsom Modifications.english.php file.

Find:
?>

Add before:
// Start CGDT Mod by Nascar
$txt['up_late_arent_we'] = 'Up Late Aren\'t We';
$txt['are_you_the_early_bird'] = 'Are you the early bird';
$txt['good_morning'] = 'Good Morning';
$txt['good_afternoon'] = 'Good Afternoon';
$txt['good_evening'] = 'Good Evening';
$txt['shouldnt_you_be_going_to_bed_soon'] = 'Shouldn\'t You Be Going To Bed Soon';
// End CGDT Mod by Nascar



Marcus Forsberg

MY test forum will be back running again tomorrow. I'll try to fix it right then.

the_underworld

Quote from: Nascar on September 15, 2008, 08:58:49 AM
the_underworld
Try the attached file. Remember to backup the original file first, in case I did a mistake.

Have a nice day
Nascar
thanks for your time.... but... what file?  lol  i didn't see an attached one.....

Simplemachines Cowboy

Installed correctly with no shown errors.
Manually installed in my custom theme and it is fine.
On my default theme when logged out there is a problem.
Please refer to the screenshot.
My SMF forum: The Open Range

Marcus Forsberg

Quote from: the_underworld on September 15, 2008, 05:19:11 PM
Quote from: Nascar on September 15, 2008, 08:58:49 AM
the_underworld
Try the attached file. Remember to backup the original file first, in case I did a mistake.

Have a nice day
Nascar
thanks for your time.... but... what file?  lol  i didn't see an attached one.....

My bad.. here it goes...

Marcus Forsberg


Advertisement: