News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Two questions re: calendar events...

Started by lemur21, September 29, 2006, 09:39:49 AM

Previous topic - Next topic

[SiNaN]

Find:

            foreach($holiday as $day)

Replace:

            $index = explode('-', $index);
            $new[0] = $index[1];
            $new[1] = $index[2];
            $new[2] = $index[0];
            $index = implode('-', $new);
            foreach($holiday as $day)
Former SMF Core Developer | My Mods | SimplePortal

MoreBloodWine

I have my site set to 120 days advance on the index so I can see alot o stuff and be able to test everything out good, well...

2008-09-01 - Labor Day
2008-09-22 - Autumnal Equinox
2008-10-24 - United Nations Day
2008-10-31 - Halloween
2008-11-11 - Veterans Day
2008-11-27 - Thanksgiving

Those are the holidays that are currently showing with a 120 advance, and with yor last modification it does put time in a MDY format but it does it only for the last holiday which in this case is Thankgiving. So after adapting you modification this is what I get. It removes all holidays but the last... if that makes sense.

11-27-2008 - Thanksgiving
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


[SiNaN]

Sorry, I forgot the brackets. Now;

Find:

            $index = explode('-', $index);

Replace:

            {
            $index = explode('-', $index);


Find:

               echo $index, ' - ', $day, '<br />';

Replace:

               echo $index, ' - ', $day, '<br />';
               }
Former SMF Core Developer | My Mods | SimplePortal

MoreBloodWine

Thx, now aside from Johnny B's code which only half worked. You have any suggestions to MDY birthdays & events easy like we just did with holidays ?
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


[SiNaN]

Maybe... If you paste here your current codes to show them.
Former SMF Core Developer | My Mods | SimplePortal

MoreBloodWine

#45
Quote from: [SiNaN] on August 20, 2008, 09:05:21 AM
Maybe... If you paste here your current codes to show them.
I'll just attach my entire BoardIndex.template.php file, might just make things easier. The only code I've applied regarding the calendar stuff is whats been posted in this post minus Johnny's suggestions because like I said while his code does work it breaks the current formatting (how its displayed)... I can go into more detail if you wish.

Also if you find a workable method post the changes here so I can reference this post for future use and so can anyone else who may be interested.
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


[SiNaN]

Will do but I need your BoardIndex.php too.
Former SMF Core Developer | My Mods | SimplePortal

MoreBloodWine

Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


[SiNaN]

I did the same thing for the holidays, exactly the same. :)

Can you check it?
Former SMF Core Developer | My Mods | SimplePortal

MoreBloodWine

Looks like it did the trick... what were the exact changes. Could you post some fine, add, replace lines so I can reference it for future use when I update the theme / site... Thx.
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


[SiNaN]

Find:

foreach ($context['calendar_birthdays'] as $member)
    echo ' ', $member['date'], ' -
    <a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['is_today'] ? '' : '', $member['name'], $member['is_today'] ? '' : '', isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a> <br /> ';


Replace:

foreach ($context['calendar_birthdays'] as $member) {
$member['date'] = explode('-', $member['date']);           
$new[0] = $member['date'][1];           
$new[1] = $member['date'][2];           
$new[2] = $member['date'][0];           
$member['date'] = implode('-', $new);
    echo ' ', $member['date'], ' -
    <a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['is_today'] ? '' : '', $member['name'], $member['is_today'] ? '' : '', isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a> <br /> ';
}


Find:

foreach ($context['calendar_events'] as $event)
echo '
', $event['date'], ' - ', $event['can_edit'] ? ' ' : '', $event['href'] == '' ? '' : '<a href="' . $event['href'] . '">', $event['is_today'] ? '' . $event['title'] . '' : $event['title'], $event['href'] == '' ? '' : '</a>', $event['is_last'] ? '<br />' : ' <br /> ';


Replace:

foreach ($context['calendar_events'] as $event) {
$event['date'] = explode('-', $event['date']);           
$new[0] = $event['date'][1];           
$new[1] = $event['date'][2];           
$new[2] = $event['date'][0];           
$event['date'] = implode('-', $new);
echo '
', $event['date'], ' - ', $event['can_edit'] ? ' ' : '', $event['href'] == '' ? '' : '<a href="' . $event['href'] . '">', $event['is_today'] ? '' . $event['title'] . '' : $event['title'], $event['href'] == '' ? '' : '</a>', $event['is_last'] ? '<br />' : ' <br /> ';
}
Former SMF Core Developer | My Mods | SimplePortal

MoreBloodWine

Thx man, now me and everyone else who ever had questions about this now finally have the EXACT answers they were lookin for ;-)
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


MoreBloodWine

Would you by chance wana go one further and make a mod out of it ? I know at one point someone said this would make a nice package if all the kinks could be worked out and I gotta agree. The mod would basically consist of of all the cnages mentioned in this post minus Johnny B's and the code about making event titles longer but I suppose that would make a nice addition as well to the mod.
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


[SiNaN]

Why don't you try that? :)

I have 19 mods (one of them waiting approval) and I'm really having difficulties about giving support for them. Means we need some new mod authors.
Former SMF Core Developer | My Mods | SimplePortal

MoreBloodWine

Quote from: [SiNaN] on August 20, 2008, 02:33:17 PM
Why don't you try that? :)

I have 19 mods (one of them waiting approval) and I'm really having difficulties about giving support for them. Means we need some new mod authors.
I tried that once before and long story short it didnt go so well.
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


[SiNaN]

Well, the first mod I've sent to Mod Site waited there for 4 months. Cause I didn't know how to do modifications that Customizer asked me to do. But after 4 months, I tried that again. I manage that luckily and then got addictted. :)
Former SMF Core Developer | My Mods | SimplePortal

MoreBloodWine

Hey Sin, not sure if this is related or not but I dont recall seen em til after your edits went in.

http://www.simplemachines.org/community/index.php?topic=256788.0
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


[SiNaN]

Yeah, you are right. Sorry about that I had to remove 2 lines to use in my test site. Fixed now.

BTW, what's that collapse script you are using? Is that something default on the theme or you applied manually? I a good collapse script too.
Former SMF Core Developer | My Mods | SimplePortal

MoreBloodWine

Quote from: [SiNaN] on August 21, 2008, 12:22:57 AM
Yeah, you are right. Sorry about that I had to remove 2 lines to use in my test site. Fixed now.

BTW, what's that collapse script you are using? Is that something default on the theme or you applied manually? I a good collapse script too.
Collapse script ?

Also, what were the changes you forgot / just made ?
Want a sig like mine for your BTCGuild stats ? Then check this out: Spend-ur-Bits


[SiNaN]

Added these two lines back:

$dhtml_collapsed = get_collapsed_state("category_" . $category['href']);

$dhtml_collapsed = get_collapsed_state("info_center");

As I didn't had the "get_collapsed_state()" function, the page was broken, so I removed these to lines while using the file.

Probably theme uses a different collapse script than the default one. I'll check it myself.
Former SMF Core Developer | My Mods | SimplePortal

Advertisement: