Jump to content
  • 0

add items icon to control panel


Question

7 answers to this question

Recommended Posts

Posted

Which control panel? If Flux, this can be done by opening the /themes/default/item/view.php file, finding:


<td><?php echo htmlspecialchars($item->item_id) ?></td>
<?php if ($image=$this->itemImage($item->item_id)): ?>

And adding something along the lines of..

<th>
<img src="/media/item/<?php echo htmlspecialchars($item->item_id) ?>.gif" onerror="ImgError(this);"></th>

.. before that.

And in the top of the file, add:

<script>
function ImgError(source){
   source.src = "/media/item/missing.png";
   source.onerror = "";
   return true;
}</script>

Which will output an image instead of the red X image that displays whenever an item doesn't have an icon. Make a .png image with nothing in it, and save it to the path noted above.

You'll need ALL the icons uploaded to your webhost, though, which are at http://code.google.com/p/fluxcp/downloads/list

I personally will not provide anything further than this, as this should be a good learning experience for you and anyone else looking to do the same. Work it out and let us know how you do!

Posted

Ok I have a few questions:

1)The media/item/ folder must be inside th cp folder right?

2)To view the changes do I have to re-install the fluxCP?

3)the code should be like this?

<th><img src="/media/item/<?php echo htmlspecialchars($item->item_id) ?>.gif" onerror="ImgError(this);"></th>
 <td><?php echo htmlspecialchars($item->item_id) ?></td>
 <?php if ($image=$this->itemImage($item->item_id)): ?>

Thanks

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...