Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Search

 
Advanced search

8043 Posts in 1856 Topics- by 2099 Members - Latest Member: roi
Calendar Script CommunityCustomizationHacks and Mods (Moderators: scott, DanO, Marty)adding more than one icon to event title
Pages: [1]   Go Down
Print
Author Topic: adding more than one icon to event title  (Read 580 times)
0 Members and 1 Guest are viewing this topic.
cmiller
New Member
*

Karma: 0
Offline Offline

Posts: 0

owner of multimedia production studio


WWW
« on: August 03, 2006, 08:33:00 AM »

Hello All!
I am trying to modify the "adding icons to the title" code that has been much discussed on this board to incorporate the idea of having the possibility of more than one icon per event show up in the event grid on the calendar.

I successfully have used the icon code in the past for just one icon. I am working on this for a Deaf non-profit organization who categorizes their events by accessibility, such as being ASL interpreted, assistive listening device, captioned, etc. There is the possibility that an an event will be one or all of the above, and they want icons to represent that. Since the Deaf are so motivated by visual cues, like icons, they want to attract their attention immediately.

I tried duplicating the
if ($details->{'icon'} =~ /$bullet/) .... etc
code and created "icon2", "icon3", "icon4", but I don't know how to edit the "title" to add these icons in a row.

Right now it will only accept the icon from "icon" in the title and ignores the rest.

Does anyone have any suggestions??
My fallback method is to create every possible iteration of combinations and make the user select the correct one from the drop-down list (and make all the iterations of graphics - yikes!!), but this will be very confusing, especially for non-tech savvy volunteers at the non-profit.

What I want to do is have four drop-downs with the four categories of event types, then the user picks in sequential order which icons should display (event graphic1, event graphic2, event graphic3 etc.). If an event only has one icon, then the rest could be left as a default of none, which I could just make as a dummy icon of a 1x1 pixel graphic.

Thank you in advance for your advice!
-Catherine

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #1 on: August 03, 2006, 02:53:00 PM »

** "adding icons to the title" code that has been much discussed on this board **

Please provide a link to the message in question so others will be able to see the actual code you're attempting to use.

** I don't know how to edit the "title" to add these icons in a row.  **

Does it not say in the instructions?

** Right now it will only accept the icon from "icon" in the title and ignores the rest. **

I don't know what you mean by that. Please post some actual examples.

Dan O.

------------------

Logged
cmiller
New Member
*

Karma: 0
Offline Offline

Posts: 0

owner of multimedia production studio


WWW
« Reply #2 on: August 03, 2006, 05:12:00 PM »

Hi Dan,
So sorry that I was confusing with my post. I was referring to the adding of icons to the default template, discussed here:
http://www.calendarscript.com/support/forum/Forum5/HTML/000314.html

I have used this method successfully in the past. Here is the code I used in the default template:

$bullet = "asl|eye|interp|listen|oc|sub";

if ($details->{'icon'} =~ /$bullet/) {
   if ($details->{'title'} !~ /.gif/) {
      $details->{'title'} = "<img src=http://www.creativeaccess.org/images_calendar/" . $details->{'icon'} . ".gif border=0>" . $details->{'title'};
      }
   }

Logged
cmiller
New Member
*

Karma: 0
Offline Offline

Posts: 0

owner of multimedia production studio


WWW
« Reply #3 on: August 03, 2006, 05:22:00 PM »

Hi Again,
Sorry my message got cut off midway through!!!

So that code I mentioned in my last message successfully adds one icon to the event listing on the calendar itself (fine that it doesn't show up on the event page, I am just looking to make a visually appealing calendar grid with lots of icons.

Now I want to add more than one icon from the "$bullet" list to the same event listing. I want the user to have the option to choose from 1-4 icons per event. So I tried this:
$bullet = "asl|eye|interp|listen|oc|sub";

if ($details->{'icon'} =~ /$bullet/) {
   if ($details->{'title'} !~ /.gif/) {
      $details->{'title'} = "<img src=http://www.creativeaccess.org/images_calendar/" . $details->{'icon'} . ".gif border=0>" . $details->{'title'};
      }
   }
if ($details->{'icon2'} =~ /$bullet/) {
   if ($details->{'title'} !~ /.gif/) {
      $details->{'title'} = "<img src=http://www.creativeaccess.org/images_calendar/" . $details->{'icon2'} . ".gif border=0>" . $details->{'title'};
      }
   }
if ($details->{'icon3'} =~ /$bullet/) {
   if ($details->{'title'} !~ /.gif/) {
      $details->{'title'} = "<img src=http://www.creativeaccess.org/images_calendar/" . $details->{'icon3'} . ".gif border=0>" . $details->{'title'};
      }
   }
if ($details->{'icon4'} =~ /$bullet/) {
   if ($details->{'title'} !~ /.gif/) {
      $details->{'title'} = "<img src=http://www.creativeaccess.org/images_calendar/" . $details->{'icon4'} . ".gif border=0>" . $details->{'title'};
      }
   }

------------------

Logged
cmiller
New Member
*

Karma: 0
Offline Offline

Posts: 0

owner of multimedia production studio


WWW
« Reply #4 on: August 03, 2006, 05:24:00 PM »

Ugh... did it to me again, must be when I paste in code. Sorry for the many posts...Anyway...

Then I added extra event field select boxes with unique field ids icon2, icon3, etc. But this didn't work. I knew it that was too easy.  

What I did just duplicates the icon per event title, but doesn't add them cumulatively to the event title. Am I making any sense?  

Can you help me?
Thank you very much!!
-Catherine

------------------

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #5 on: August 03, 2006, 09:01:00 PM »

** What I did just duplicates the icon per event title, but doesn't add them cumulatively to the event title. **

I wouldn't think it wouldn't because (in several places) this line:

if ($details->{'title'} !~ /.gif/) {

is telling the script to the skip the rest of the conditionals if a ".gif" is already found in the title (which I assume it would be there if $details->{'icon'} - or any other icon - had already been given a value by the user).

JMO

Dan O.

------------------

Logged
cmiller
New Member
*

Karma: 0
Offline Offline

Posts: 0

owner of multimedia production studio


WWW
« Reply #6 on: August 03, 2006, 10:47:00 PM »

Hi,
I ended up making the 15 variations of graphics with the different combinations of icons and tried to organize it so it's pretty self-explanatory to the user adding events. At least this I know works.
Thank you for your help anyway!
Take care,
Catherine

------------------

Logged
DanO
Moderator
Full Member
*****

Karma: 13
Offline Offline

Posts: 230

Please don't PM me. Post in the open forum.


WWW
« Reply #7 on: August 04, 2006, 01:16:00 AM »

So removing those extra conditionals didn't fix the code?

Dan O.

------------------

Logged
Pages: [1]   Go Up
Print
Jump to: