If this is your first visit, check our documentation. To post, register or login.
Forums / Templates, Stylesheets, Page Layout / Remove Message Stack graphic

Remove Message Stack graphic

Started by hell_guapo on 10 Jun 2012, 12:33 AM · Views: 1,002

Results 1 to 8 of 8
10 Jun 2012, 12:33 AM
#1
hell_guapo avatar

hell_guapo

Zen Follower

Join Date:
Jul 2011
Posts:
106
Plugin Contributions:
0

Remove Message Stack graphic

I'd like to comment out the reference to the icon/graphics used in message stack warnings.

I found where to edit the text, no problem.

I know the folder the icons are in, can someone help me find where the code referring to the icons resides? :frusty:

10 Jun 2012, 2:15 AM
#3
hell_guapo avatar

hell_guapo

Zen Follower

Join Date:
Jul 2011
Posts:
106
Plugin Contributions:
0

Re: Remove Message Stack graphic

gjh42:

What about just replacing the graphics with transparent gifs so they will not be visible?

They will still take space. I'd prefer them removed. I found where they are referenced and renamed them. In firefox, the missing/renamed images have no negative effect, but in safari there is an image placeholder for the missing image and it causes an alignment issue because of the extra width of the placeholder. :huh:

11 Jun 2012, 3:34 PM
#4
hell_guapo avatar

hell_guapo

Zen Follower

Join Date:
Jul 2011
Posts:
106
Plugin Contributions:
0

Re: Remove Message Stack graphic

Anyone know? :frusty:

11 Jun 2012, 4:11 PM
#5
hell_guapo avatar

hell_guapo

Zen Follower

Join Date:
Jul 2011
Posts:
106
Plugin Contributions:
0

Re: Remove Message Stack graphic

I want to get rid of the icons because they take too much space for my purposes. Once I get rid of them I will use an even smaller font so that the messages are smaller and less intrusive, but still, completely noticeable.

Firefox deals well with the renamed icons:

Internet Explorer, Opera and Safari dont...

IE
:blink:

Opera
:huh:

Safari
:frusty:

11 Jun 2012, 5:24 PM
#6
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,140
Plugin Contributions:
56

Re: Remove Message Stack graphic

The icons associated with the messages are controlled by the add function in /includes/classes/message_stack.php:

  function add($class, $message, $type = 'error') {
    global $template, $current_page_base;
    $message = trim($message);
    $duplicate = false;
    if (strlen($message) > 0) {
      if ($type == 'error') {
        $theAlert = array('params' => 'class="messageStackError larger"', 'class' => $class, 'text' => zen_image($template->get_template_dir(ICON_IMAGE_ERROR, DIR_WS_TEMPLATE, $current_page_base,'images/icons'). '/' . ICON_IMAGE_ERROR, ICON_ERROR_ALT) . '  ' . $message);
      } elseif ($type == 'warning') {
        $theAlert = array('params' => 'class="messageStackWarning larger"', 'class' => $class, 'text' => zen_image($template->get_template_dir(ICON_IMAGE_WARNING, DIR_WS_TEMPLATE, $current_page_base,'images/icons'). '/' . ICON_IMAGE_WARNING, ICON_WARNING_ALT) . '  ' . $message);
      } elseif ($type == 'success') {
        $theAlert = array('params' => 'class="messageStackSuccess larger"', 'class' => $class, 'text' => zen_image($template->get_template_dir(ICON_IMAGE_SUCCESS, DIR_WS_TEMPLATE, $current_page_base,'images/icons'). '/' . ICON_IMAGE_SUCCESS, ICON_SUCCESS_ALT) . '  ' . $message);
      } elseif ($type == 'caution') {
        $theAlert = array('params' => 'class="messageStackCaution larger"', 'class' => $class, 'text' => zen_image($template->get_template_dir(ICON_IMAGE_WARNING, DIR_WS_TEMPLATE, $current_page_base,'images/icons'). '/' . ICON_IMAGE_WARNING, ICON_WARNING_ALT) . '  ' . $message);
      } else {
        $theAlert = array('params' => 'class="messageStackError larger"', 'class' => $class, 'text' => $message);
      }

      for ($i=0, $n=sizeof($this->messages); $i<$n; $i++) {
        if ($theAlert['text'] == $this->messages[$i]['text'] && $theAlert['class'] == $this->messages[$i]['class']) $duplicate = true;
      }
      if (!$duplicate) $this->messages[] = $theAlert;
    }
  }

You'll want to remove (or comment out) the stuff I've highlighted in red and note that you're making a change to a CORE file (i.e. no override possibilities exist).

11 Jun 2012, 7:24 PM
#7
hell_guapo avatar

hell_guapo

Zen Follower

Join Date:
Jul 2011
Posts:
106
Plugin Contributions:
0

Re: Remove Message Stack graphic

Ooooh that worked! :laugh:

I made a copy of the original file, but i completely removed the code and it works well. thank you. :cool:

Fixed IE screen:
:thumbsup:

11 Jun 2012, 9:31 PM
#8
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,140
Plugin Contributions:
56

Re: Remove Message Stack graphic

You're very welcome, I'm happy to have helped.