coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: bas943 on December 18, 2008, 07:50:43 PM

Title: Move ratings to above picture
Post by: bas943 on December 18, 2008, 07:50:43 PM
I'm using the Rainy Day theme, and I'd like to move the ratings to above the picture, instead of below the film strip.

Thanks
Title: Re: Move ratings to above picture
Post by: bas943 on December 18, 2008, 10:00:07 PM
Anybody know how to do this??

Thanks again
Title: Re: Move ratings to above picture
Post by: Hein Traag on December 18, 2008, 10:07:25 PM
I am impressed.. you waited a whole 2 hours and 10 minutes. Keep in mind that this support board is done by volunteers. We do not get paid so do not expect split second replies.. give it a few days.

I assume you have done some searching before posting?
Title: Re: Move ratings to above picture
Post by: bas943 on December 18, 2008, 10:09:00 PM
Yes I have and there have been a few related posts, but I could not find the code that people suggested I look for to alter in theme.php
Title: Re: Move ratings to above picture
Post by: Hein Traag on December 18, 2008, 10:38:54 PM
Did a quick search and got this: http://forum.coppermine-gallery.net/index.php/topic,27184.0.html (http://forum.coppermine-gallery.net/index.php/topic,27184.0.html)

Looks like a winner if you take the time to red through it.
Title: Re: Move ratings to above picture
Post by: bas943 on December 19, 2008, 12:51:53 AM
This was helpful, but I'm a little unsure which text from the include themes folder to copy, and where to put it in the theme.php folder, here the second one is...

<?php
/*************************
  Coppermine Photo Gallery
  ************************
  Copyright (c) 2003-2008 Dev Team
  v1.1 originally written by Gregory DEMAR

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License version 3
  as published by the Free Software Foundation.
 
  ********************************************
  Coppermine version: 1.4.19
  $HeadURL: https://coppermine.svn.sourceforge.net/svnroot/coppermine/trunk/cpg1.4.x/themes/rainy_day/theme.php $
  $Revision: 4392 $
  $Author: gaugau $
  $Date: 2008-04-16 09:25:35 +0200 (Mi, 16 Apr 2008) $
**********************************************/

// ------------------------------------------------------------------------- //
// This theme has had all redundant CORE items removed                           //
// ------------------------------------------------------------------------- //

define('THEME_HAS_RATING_GRAPHICS', 1);
define('THEME_IS_XHTML10_TRANSITIONAL',1);


// HTML template for sys_menu
$template_sys_menu = <<<EOT
  <div class="topmenu">
          <table border="0" cellpadding="0" cellspacing="0">
                  <tr>
  {BUTTONS}
                  </tr>
          </table>
  </div>

EOT;

// HTML template for template sys_menu buttons
$template_sys_menu_button = <<<EOT
<!-- BEGIN {BLOCK_ID} -->
  <td><img src="images/spacer.gif" width="5" height="25" border="0" alt="" /></td>
  <td><img src="themes/rainy_day/images/button1_r1_c1.gif" width="5" height="25" border="0" alt="" /></td>
  <td style="background-image:url(themes/rainy_day/images/button1_r1_c2.gif)">
          <a href="{HREF_TGT}" title="{HREF_TITLE}">{HREF_LNK}</a>
  </td>
  <td><img src="themes/rainy_day/images/button1_r1_c3.gif" width="5" height="25" border="0" alt="" /></td>

<!-- END {BLOCK_ID} -->
EOT;

?>






where would I put the new text in to change the order?

Thanks
Title: Re: Move ratings to above picture
Post by: Hein Traag on December 19, 2008, 08:19:59 AM
QuoteYou can copy the function theme_display_image() from include/themes.inc.php into your theme's theme.php and change the ordering of the sections there.

if (!function_exists('theme_display_image')) {  //{THEMES}
function theme_display_image($nav_menu, $picture, $votes, $pic_info, $comments, $film_strip)
{
    global $CONFIG;

    $width = $CONFIG['picture_table_width'];

    starttable();
    echo $nav_menu;
    endtable();

    starttable();
    echo $picture;
    endtable();
    if ($CONFIG['display_film_strip'] == 1) {
        echo $film_strip;
    }


    echo $votes;



    $picinfo = isset($_COOKIE['picinfo']) ? $_COOKIE['picinfo'] : ($CONFIG['display_pic_info'] ? 'block' : 'none');
    echo "<div id=\"picinfo\" style=\"display: $picinfo;\">\n";
    starttable();
    echo $pic_info;
    endtable();
    echo "</div>\n";

    echo "<div id=\"comments\">\n";
        echo $comments;
        echo "</div>\n";

}
}  //{THEMES}


Change the order in this line:
function theme_display_image($nav_menu, $picture, $votes, $pic_info, $comments, $film_strip)

to:
function theme_display_image($nav_menu, $votes, $picture, $pic_info, $comments, $film_strip)
Title: Re: Move ratings to above picture
Post by: bas943 on December 19, 2008, 04:41:21 PM
I have that all ready to go, but I'm not positive where to put it within the theme.php folder, what code should I put it after? Sorry I'm new at this..

Thanks a lot everybody for the help
Title: Re: Move ratings to above picture
Post by: Joachim Müller on December 22, 2008, 01:30:12 PM
Don't copy stuff from include/themes.inc.php, but from themes/sample/theme.php, as suggested in the docs (http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#theme_sample). The codeif (!function_exists('theme_display_image')) {  //{THEMES}
function theme_display_image($nav_menu, $picture, $votes, $pic_info, $comments, $film_strip)
{
    global $CONFIG;

    $width = $CONFIG['picture_table_width'];

    starttable();
    echo $nav_menu;
    endtable();

    starttable();
    echo $picture;
    endtable();
    if ($CONFIG['display_film_strip'] == 1) {
        echo $film_strip;
    }


    echo $votes;



    $picinfo = isset($_COOKIE['picinfo']) ? $_COOKIE['picinfo'] : ($CONFIG['display_pic_info'] ? 'block' : 'none');
    echo "<div id=\"picinfo\" style=\"display: $picinfo;\">\n";
    starttable();
    echo $pic_info;
    endtable();
    echo "</div>\n";

    echo "<div id=\"comments\">\n";
        echo $comments;
        echo "</div>\n";

}
}  //{THEMES}
is actually nonsense and should read function theme_display_image($nav_menu, $picture, $votes, $pic_info, $comments, $film_strip)
{
    global $CONFIG;

    $width = $CONFIG['picture_table_width'];

    starttable();
    echo $nav_menu;
    endtable();

    starttable();
    echo $picture;
    endtable();
    if ($CONFIG['display_film_strip'] == 1) {
        echo $film_strip;
    }


    echo $votes;



    $picinfo = isset($_COOKIE['picinfo']) ? $_COOKIE['picinfo'] : ($CONFIG['display_pic_info'] ? 'block' : 'none');
    echo "<div id=\"picinfo\" style=\"display: $picinfo;\">\n";
    starttable();
    echo $pic_info;
    endtable();
    echo "</div>\n";

    echo "<div id=\"comments\">\n";
        echo $comments;
        echo "</div>\n";

}
in themes/yourtheme/theme.php.
The file include/themes/inc.php is not the right file to copy from. The proper file to copy from is themes/sample/theme.php, and only that file!!!