Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: from categories to images  (Read 5408 times)

0 Members and 1 Guest are viewing this topic.

Hadar

  • Coppermine newbie
  • Offline Offline
  • Gender: Female
  • Posts: 11
from categories to images
« on: May 18, 2007, 04:28:12 pm »

hey, I want to know how can I change my categories like : Photoshoot to an image ?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: from categories to images
« Reply #1 on: May 18, 2007, 06:10:29 pm »

hey, I want to know what you're talking about. Use even less words ::). Don't post links ::). Don't read the docs ::).
Logged

Hadar

  • Coppermine newbie
  • Offline Offline
  • Gender: Female
  • Posts: 11
Re: from categories to images
« Reply #2 on: May 22, 2007, 11:42:11 am »

I want to put a image under the category...
like this : http://www.bepbrazil.com/galeria/
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: from categories to images
« Reply #3 on: May 22, 2007, 01:08:44 pm »

That's a custom piece of code they appear to be using on that page unless they're just using the bbcode ([ i m g ] tag) in the category description field, which should basically do the same you're up to without needing to fiddle with the code.

I can't remember having seen custom code posted anywhere that does exactly what you're up to, so here goes: Edit themes/yourtheme/theme.php, find
Code: [Select]
// HTML template for the category list
$template_cat_list = <<<EOT
and edit the stuff benaeth it as you see fit. If that piece of code doesn't exist in your custom theme, copy
Code: [Select]
// HTML template for the category list
$template_cat_list = <<<EOT
<!-- BEGIN header -->
        <tr>
                <td class="tableh1" width="80%" align="left"><b>{CATEGORY}</b></td>
                <td class="tableh1" width="10%" align="center"><b>{ALBUMS}</b></td>
                <td class="tableh1" width="10%" align="center"><b>{PICTURES}</b></td>
        </tr>
<!-- END header -->
<!-- BEGIN catrow_noalb -->
        <tr>
                <td class="catrow_noalb" colspan="3"><table border="0"><tr><td align="left">{CAT_THUMB}</td><td align="left"><span class="catlink"><b>{CAT_TITLE}</b></span>{CAT_DESC}</td></tr></table></td>
        </tr>
<!-- END catrow_noalb -->
<!-- BEGIN catrow -->
        <tr>
                <td class="catrow" align="left"><table border="0"><tr><td>{CAT_THUMB}</td><td><span class="catlink"><b>{CAT_TITLE}</b></span>{CAT_DESC}</td></tr></table></td>
                <td class="catrow" align="center">{ALB_COUNT}</td>
                <td class="catrow" align="center">{PIC_COUNT}</td>
        </tr>
        <tr>
            <td class="tableb" colspan="3">{CAT_ALBUMS}</td>
        </tr>
<!-- END catrow -->
<!-- BEGIN footer -->
        <tr>
                <td colspan="3" class="tableh1" align="center"><span class="statlink">{STATISTICS}</span></td>
        </tr>
<!-- END footer -->
<!-- BEGIN spacer -->
        <img src="images/spacer.gif" width="1" height="7" border="" alt="" /><br />
<!-- END spacer -->

EOT;
from themes/sample/theme.php into a new line before
Code: [Select]
?>of themes/yourtheme/theme.php and then edit this stuff. You will have to come up with some custom PHP code that determines what picture to display. Something like
Code: [Select]
// HTML template for the category list
$template_cat_list = <<<EOT
<!-- BEGIN header -->
        <tr>
                <td class="tableh1" width="80%" align="left"><b>{CATEGORY}</b></td>
                <td class="tableh1" width="10%" align="center"><b>{ALBUMS}</b></td>
                <td class="tableh1" width="10%" align="center"><b>{PICTURES}</b></td>
        </tr>
<!-- END header -->
<!-- BEGIN catrow_noalb -->
        <tr>
                <td class="catrow_noalb" colspan="3"><table border="0"><tr><td align="left">{CAT_THUMB}</td><td align="left"><span class="catlink"><b>{CAT_TITLE}</b></span>{CAT_DESC}
EOT;
  //your custom code here that determines what image to display for which category. For demonstration purposes, I have added a simple if/then construct
  if ($cat==1) {
    $template_cat_list .= '<img src="your/first/category/image.jpg" border="0" width="50" height="100" alt="" />';
  } else {
    $template_cat_list .= '<img src="your/second/category/image.jpg" border="0" width="50" height="100" alt="" />';
  }
$template_cat_list .= <<<EOT
                </td></tr></table></td>
        </tr>
<!-- END catrow_noalb -->
<!-- BEGIN catrow -->
        <tr>
                <td class="catrow" align="left"><table border="0"><tr><td>{CAT_THUMB}</td><td><span class="catlink"><b>{CAT_TITLE}</b></span>{CAT_DESC}</td></tr></table></td>
                <td class="catrow" align="center">{ALB_COUNT}</td>
                <td class="catrow" align="center">{PIC_COUNT}</td>
        </tr>
        <tr>
            <td class="tableb" colspan="3">{CAT_ALBUMS}</td>
        </tr>
<!-- END catrow -->
<!-- BEGIN footer -->
        <tr>
                <td colspan="3" class="tableh1" align="center"><span class="statlink">{STATISTICS}</span></td>
        </tr>
<!-- END footer -->
<!-- BEGIN spacer -->
        <img src="images/spacer.gif" width="1" height="7" border="" alt="" /><br />
<!-- END spacer -->

EOT;
should do the trick.

However, as you appear to be a newbie, I suggest using the bbcode solution.

Joachim

Logged

Hadar

  • Coppermine newbie
  • Offline Offline
  • Gender: Female
  • Posts: 11
Re: from categories to images
« Reply #4 on: May 22, 2007, 08:04:27 pm »

Ok I did it, but it's not finding the pic. I put the image in a folder that called "images" and my code is :     
Code: [Select]
  if ($cat==1) {
    $template_cat_list .= '<img src="images/7290418.jpg" border="0" width="50" height="100" alt="" />';
  } else {
    $template_cat_list .= '<img src="images/7290419.jpg" border="0" width="50" height="100" alt="" />';
  }
but it's not working.
and thanks for your help  :) really thanks !
Logged

Hadar

  • Coppermine newbie
  • Offline Offline
  • Gender: Female
  • Posts: 11
Re: from categories to images
« Reply #5 on: May 22, 2007, 09:16:06 pm »

Ok, nevermind. it's works but in the 2 categories it is the same pic ??? and i put 2 pics  :-\
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: from categories to images
« Reply #6 on: May 23, 2007, 07:47:06 am »

The if/then switch was just an example (pseudo code). You'll have to figure this out depending on the categories that you actually have. Posting a link to your gallery might help as well.
Logged

Hadar

  • Coppermine newbie
  • Offline Offline
  • Gender: Female
  • Posts: 11
Re: from categories to images
« Reply #7 on: May 23, 2007, 12:13:18 pm »

This is my gallery: http://mufra.5gbfree.com/
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: from categories to images
« Reply #8 on: May 23, 2007, 12:47:02 pm »

I'm getting
Quote
Parse error: syntax error, unexpected '<' in /www/5gbfree.com/m/u/f/mufra/htdocs/themes/water_drop/theme.php on line 61
there. Fix this first.
Logged

Hadar

  • Coppermine newbie
  • Offline Offline
  • Gender: Female
  • Posts: 11
Re: from categories to images
« Reply #9 on: May 23, 2007, 01:06:28 pm »

I fix it
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: from categories to images
« Reply #10 on: May 23, 2007, 01:13:26 pm »

Post the actual code you used - the output on your page shows that you haven't applied the code mentioned above, but something else.
Logged

Hadar

  • Coppermine newbie
  • Offline Offline
  • Gender: Female
  • Posts: 11
Re: from categories to images
« Reply #11 on: May 23, 2007, 01:16:51 pm »

I changed it to this :
Code: [Select]
  if ($cat==6) {
    $template_cat_list .= '<img src="http://mufra.5gbfree.com/themes/water_drop/images/7290419.jpg" border="0" alt="" />';
  } else {
    $template_cat_list .= '<img src="http://mufra.5gbfree.com/themes/water_drop/images/pic1.jpg" border="0" alt="" />';
  }

6 is the number of the "photoshoots" category...
Logged

Hadar

  • Coppermine newbie
  • Offline Offline
  • Gender: Female
  • Posts: 11
Re: from categories to images
« Reply #12 on: May 26, 2007, 06:47:37 pm »

Help ? ::)
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 15 queries.