We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Events | Forum

Benjamin
Benjamin Jun 8 '11
Hi all,

For my site I had to customize the 'Event'-plugin a little bit. Because I want to use the plugin for casting calls I had to add a contact form posibility. Everything is working now, but I have the following question;

I want to hide the contact form block when a event is a past event, so that users don't have the posibility to reply on past events anymore.
I think it is easy to manage using a {if}{/if} function in the /ow_plugins/event/views/controllers/base_view.html, but I can't figure it out exactly.

Hopefully somebody can help me out! :D

Regards,
Benjamin

The Forum post is edited by Benjamin Jun 8 '11
Attachments:
  New Picture.bmp (991.51Kb)
Den Team
Den Jun 8 '11
HI
In this template, find out var $info.endDate. It contains end date of current event. Compare it with current date (using smarty function {$smarty.now|date_format} ) and hide your contact form if event was already finished
The Forum post is edited by Den Jun 8 '11
Benjamin
Benjamin Jun 8 '11
Thank you very much for your reply!

I'm not really experienced with smarty but... Will it be something like:

{if ($smarty.now|date_format) < $info.endDate}
Blabla1
{else}
Blabla2
{/if}

?
Benjamin
Benjamin Jun 8 '11
I found it out! :D (I'm not using a endDate in every event so that's why nothing changed the first time...)

{if ($info.date) <= ($smarty.now|date_format) }
Den Team
Den Jun 9 '11
Nice job Banjamin!
Benjamin
Benjamin Jun 9 '11
Thanks! I really appreciate the complete and friendly support.

I'm really happy with Oxwall. It's just so much fun to play with it.
Benjamin
Benjamin Jun 9 '11
A little problem...

I just found out the following:

I use {if ($info.date) <= ($smarty.now|date_format) } to exclude the contact form on past events. But...it only works when the event is more then a month old. Till that time the contact form shows up.

Example:
$info.date = Jun 1 '11, 09:00AM / $smarty.now = Jun 9 '11, 09:00AM
The contact form should now be excluded! But...the contact form is still there.
When I change the $info.date to May 29 '11 09:00AM, the contact form disapear as it should.

I really need the contact form to be hidden when the current date is equal or later than the {$info.date} on daily base, not per month.

What should I do?

Maybe I have to change the $info.date format? Now, the month is on the front. Maybe I have to get the day of the month on the front? (In the Netherlands that's the way we use dates)
The Forum post is edited by Benjamin Jun 9 '11
Benjamin
Benjamin Jun 9 '11
Fixed!

I found out that there went something wrong with the display of the month.

Smarty can't understand if the month 'Jun' is greater or less than 'Oct'. But...it can understand that month '06' is less than '10'. So...I used the following code to get the right {if}........{else}.......{/if}:

{if ($info.date|date_format:"%D") >= ($smarty.now|date_format:"%D") }

Day, month and year are now written as numbers [02,03,10,12,29, etc.] in stead of letters [Mar, Jun, Oct, etc.] so smarty easily check if the event-date is equal or less than the current date.

Pfff...it was a pain in the &*$^@# but I'm so glad it's working!!! :D
Benjamin
Benjamin Jun 9 '11
I have one big question in order to complete my Event plugin modification:

Wich variable do I have to use when I want to hide a div for users with a specified AccountType?

I really hope somebody (I think it will be Addenster ;D) can help me out, because it's the last thing I have to get to work!

Kind regards,
Benjamin
Benjamin
Benjamin Jun 10 '11
Anybody? I'm so curious!
Benjamin
Benjamin Jun 10 '11
Thnx for the reply, but... I can't find anything about userroles and userpermissions in combination with {if}{/if} rules.

Can you give me a hand with this parameters and variables?

Something like:

{if ($accountType) == ($accountType|company) }
Something
{else}
Nothing
{/if}

I don't know really wich variables I need to use. I can't find them within the documentation you referred.
Benjamin
Benjamin Jun 10 '11
That is to give you an idea what I want...

I want to hide a div for users with a specified accountype.
Benjamin
Benjamin Jun 10 '11
Addenster does (I hope) :)
Den Team
Den Jun 13 '11
Sorry for a long response :)
Do you need to determine accountType or user roles?
Benjamin
Benjamin Jun 13 '11
No problem! Great to hear from you!

I need to determine accountType.
Michael I.
Michael I. Dec 18 '12
Topic was moved from Plugins.
James Walter
James Walter Jan 2
Nor does one relish the idea of fishing a 2 week old roast beef sandwich out from under the seat. Richmond Mobile Truck Repair
herryjoseph
herryjoseph Jan 9
Let Us Create Your Dream Event with Minimal Mom, where we turn your event visions into a stunning reality. Our expert team specializes in crafting memorable and personalized experiences tailored to your preferences. With meticulous attention to detail, we handle every aspect of event planning, from conceptualization to flawless execution. Whether it's a birthday bash, corporate event, or wedding celebration, we work closely with you to understand your desires and translate them into a unique and unforgettable event. By entrusting your event to us, you can relax and enjoy the process, knowing that every element, from decor to logistics, is expertly managed. Home Organizing Gilbert specializes in providing professional organization services specifically within the Gilbert area.Let Minimal Mom bring your dream event to life, creating cherished moments that exceed your expectations and leave a lasting impression on you and your guests.