problems with converting wordpress 2011 theme to coppermine - Page 2 problems with converting wordpress 2011 theme to coppermine - Page 2
 

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]

Main Menu

problems with converting wordpress 2011 theme to coppermine

Started by trevorpenfold, August 07, 2012, 01:18:00 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Jeff Bailey

are you talking about footer.php from the theme?

<?php
/**
 * The template for displaying the footer.
 *
 * Contains the closing of the id=main div and all content after
 *
 * @package WordPress
 * @subpackage Twenty_Eleven
 * @since Twenty Eleven 1.0
 */
?>


</div><!-- #main -->

<footer id="colophon" role="contentinfo">

<?php
/* A sidebar in the footer? Yep. You can can customize
 * your footer with three columns of widgets.
 */
if ( ! is_404() )
get_sidebar'footer' );
?>


<div id="site-generator">
<?php do_action'twentyeleven_credits' ); ?>
<a href="<?php echo esc_url__'http://wordpress.org/''twentyeleven' ) ); ?>" title="<?php esc_attr_e'Semantic Personal Publishing Platform''twentyeleven' ); ?>" rel="generator"><?php printf__'Proudly powered by %s''twentyeleven' ), 'WordPress' ); ?></a>
</div>
</footer><!-- #colophon -->
</div><!-- #page -->

<?php wp_footer(); ?>

</body>
</html>


Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

Jeff Bailey

You can add this to theme.php if you want. I'll add it in later anyway.

/******************************************************************************
** Section <<<theme_credits>>> - START
******************************************************************************/

/******************************************************************************
// Function for the credits-section
In previous versions of Coppermine the "Powered by Coppermine" used to be
obfuscated to make it hard for non-coders to remove the tag. The reason behind
this was an additional license add-on that disallowed users to change the line.
The dev team has reviewed this policy for cpg1.5.x and decided that end users
ARE allowed to change or remove the line in legal terms.
HOWEVER: We have a forum policy for the support board instead: support will
only be given for galleries that show the "Powered by Coppermine" tag
unobfuscated.
Before removing the credits, please consider this as well:
Coppermine is free software, the dev team ASKS you to keep the footer intact.
We're convinced that you should give credit where credit is due. So please think
twice before you decide to remove the tag.
******************************************************************************/
function theme_credits() {
    $return = <<< EOT

<div class="footer" align="center" style="padding:10px;display:block;visibility:visible; font-family: Verdana,Arial,sans-serif;">Powered by <a href="http://coppermine-gallery.net/" title="Coppermine Photo Gallery" rel="external">Coppermine Photo Gallery</a> | Ported by Jeff Bailey | Based on <a href="http://wordpress.org" rel="external">Wordpress</a> theme <a href="http://wordpress.org/extend/themes/twentyeleven" rel="external">Twenty Eleven</a></div>
EOT;
    return $return;
}
/******************************************************************************
** Section <<<theme_credits>>> - END
******************************************************************************/
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

trevorpenfold

Hi Jeff,

I was just trying to change the style of the footer so that it was the same as the w/p 2011 theme. And in that footer there's the credit to w/p in the <div id="site-generator">  (where the coppermine credit now site) but the whole footer is within the <footer id="colophon" role="contentinfo"> div which I guess gives it it's styling - well it did in my one, but it doesn't in your one...so maybe the footer id="colophon" isn't active somehow?? Though it looks like you have the whole w/p 2011 style.css as the theme style.css, so that's why I couldn't work out why it wasn't showing up??

Hope that makes it clearer? Thanks.

Jeff Bailey

Oh ok, I haven't gotten to the footers style yet. I'll change that tomorrow.
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

Jeff Bailey

So far today. Attached.

Edit:
Fixed a small typo. Attached.
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

Jeff Bailey

Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

trevorpenfold

Thanks Jeff, I'm afraid I haven't been able to look at it at all today, but I'll check it out tomorrow afternoon.
Cheers.

trevorpenfold

Hi Jeff,

I've managed to have a good look this afternoon and have made just very minor edits to your files - just added in the footer divs to the template.html and removed them from the theme.php so there doesn't seem to be any need for the 'Custom Footer' token and it all works well now - though how you had it worked too of course!

I've also had another go at putting it together like it was suggested in the tutorial by Gizmo ( http://forum.coppermine-gallery.net/index.php/topic,38508.0.html ) as I want to try and keep the wordpress syle as intact as possible so I can easily update it if there are issues with it, or even be able to more easily change to another wordpress style in the future. So I've used your theme.php file (with my small edits as above in re the footer/credit styling) as mine didn't work before, and I've taken the original cpg Curve style.css as you suggested and commented out any items that duplicate ones in the wordpress style (which I've titled 'style_wp.css). So I've also linked to both stylesheets in template.html (in fact to x3 stylesheets, as the original coppermine style.css is referenced too in the above tutorial, but not sure if it's necessary/good to do here??). I've also just moved the 'Message' token, to just above the 'Gallery' one, as I prefer the look i think.

Overall they both seem to work well now, just styling tweaks once I've uploaded all images and set out the categories for real.

The one thing that I still can't change though is how the lefthand sidebar menus gets over-written by the content when the browser window becomes very narrow. If you can think of an obvious fix for this that'd be great - but it's probably not worth a lot of time spent on it.

See what you think - thanks.

Jeff Bailey

I won't have time to continue on this for a few days.

The one thing I haven't gotten to that really needs work is displayimage.php
You can find the theme.php functions to edit here:
http://documentation.coppermine-gallery.net/en/theme_theme_php.htm#theme_create_theme_var_display_media
http://documentation.coppermine-gallery.net/en/theme_theme_php.htm#theme_create_theme_display_image
http://documentation.coppermine-gallery.net/en/theme_theme_php.htm#theme_create_theme_var_film_strip
And there are probably a couple of others that may need a tweak.

Adding the footer divs to the template.html or the theme.php works either way, as you can see, it's just a habit of mine to do most of the edits in theme.php.

Using two style sheets is a fine idea, but when I port a theme I usally change all the classes and ids to match the original. Again either way works as long as you can follow where you've made the appropriate changes.

Glad you are getting the hang of it. If you get this to a completed phase before I can return to it please use the naming scheme I have been using with a version number of 1.x and I will add it to the theme contributions thread.
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

trevorpenfold

Hi Jeff,

Well, I had a good look at all the docs re theme editing and the 'displayimage' bits, but I'm afraid I just don't get it at all and can't see what to do or where to do it or even what the problem is!! - and just when I thought I was starting to understand how to edit the theme.php with the footer edits, as they were easy... So I'm afraid I haven't done anything on this bit.

But I've done what I can - I've reinstated your info in the template & theme files re showing the theme footer and credits, as that's obviously more how coppermine is formatted. And I've tried to tidy up the template.html file with 'comments' marking the end of each div, as recommended in the docs, so hopefully that should save you some time? But you'd better have a quick check of it in case I've messed it up somewhere - though it still works fine.

I've re-named it as per your version nos and uploaded again. I'll stick with editing your 2011 theme files here, as that's probably more useful for others trying to convert the 2011 wordpress theme, and will try and incorporate any changes you make into my tpp_cutom file to keep my stylesheets separate as mentioned before.

Cheers.

trevorpenfold

Hi Jeff,

just wondered if you'd had some spare time to look at issues in the theme.php file that you mentioned on Aug 11th (re: displayimage bits I think?)?

If your hard pressed for time at present perhaps someone else with experience of php files could take at look at it??

Many thanks.  :)

Jeff Bailey

I will be starting again soon, probably around wednesday. I'm just in the middle of finishing some college courses, and this project is a little more involved then standard support.
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

trevorpenfold

Hi Jeff,

Thanks for that - i do realise that it's 'above and beyond' a normal support query, so everything is very much appreciated. So whenever suits you...

Cheers.

trevorpenfold

Hi Jeff,
Not sure if you have time to continue what you'd started helping me with (develpoing a coppermine child theme of the wordpress twenty eleven theme)? The initial look seemed fine to me, but you said there were some issues with the image displays which still needed attention: see info from your post Aug 11th...
QuoteThe one thing I haven't gotten to that really needs work is displayimage.php
You can find the theme.php functions to edit here:
http://documentation.coppermine-gallery.net/en/theme_theme_php.htm#theme_create_theme_var_display_media
http://documentation.coppermine-gallery.net/en/theme_theme_php.htm#theme_create_theme_display_image
http://documentation.coppermine-gallery.net/en/theme_theme_php.htm#theme_create_theme_var_film_strip
And there are probably a couple of others that may need a tweak.

As I said, this is way beyond my skills I'm afraid, so if you have some time to look at it again I'd be really grateful - or if anyone else could help too??

Many thanks.

Jeff Bailey

Sorry I forgot all about this. Let me take a fresh look today and see what I can come up with.
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

Jeff Bailey

#35
Take a look at this one, I think I hit everything.

[Edit]
Forgot to mention, the style sheet could have a lot of things cleaned out of it. I just didn't spend the time to look through it all.
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

trevorpenfold

Thanks Jeff - that was SUPER quick! - and you're obviously not based around NY (poor things)! I've just got in and will have a look at it this evening (I hope) or tomorrow am for definite...
Cheers.

trevorpenfold

Hi Jeff,

Well I've tried adjusting a few things, namely:

  • added padding to the t/nails as they were colliding
    added padding to the t/nails in the filmstrip for same reason
    tried to increase the space for the gallery by increasing the %age width of the 'content' div (in main w/press part of css under 'Structure')
    and decreased the width/margin a bit of the sidebar div (in main w/press part of css under 'Structure')
what I've tried to do but totally failed with, is to decrease the filmstrip width from 816 to 616 or thereabouts, so that it apprears to sit within the 'content' container - at present it escapes. I've put it in under film and element.style, but it won't work - I don't think I've labeled them correctly, so would appreciate it if you could look at this?

The other problem that I just can't fix, is that my portrait thumbnails are always left aligned, whereas the landscape ones are centered. I've spent hours trying to work it out with Firebug, but it all says center aligned already, and it doesn't change no matter what I put in it!!

Anyway, I've uploaded it as version 1.2 and would appreciate your input.

Also you mentioned that there was a lot of unnecessary code in the css - do you mean the w/press features that aren't being used? If so I can clear them out.

Thanks a lot for your ongoing help.

Jeff Bailey

I'm not seeing any colliding, unless I zoom in. The theme uses percentages to set the width of columns, maybe your resolution is low?

To adjust the widths of the content and secondary columns try this (already adjusted):

.left-sidebar #content {
margin: 0 7.6% 0 20%;
width: 78%;
}
.left-sidebar #secondary {
float: left;
margin-right: 0;
margin-left: 2%;
width: 17%;
}


The filmstrip doesn't escape for me. Find this in theme.php and try adjusting.
$CONFIG['max_film_strip_items'] = 4;

The thumbs in the flimstrip are half controled by the function theme_display_film_strip and by displayimage.js, remove float: left; from the inline styles.

When I mentioned the style.css I was talking about the wordpress styles.

I'm afraid this project has gone much farther than I expected it to and I have other things I'm currently working on. I won't be uploading any newer versions any time soon but feel free to ask if you run into a major issue.

The way I put this together was pretty sloppy but everything you need to know in order to build a decent version of this is in there. Feel free to rebuild using fixed widths and other things that would fix the issues you're having and you can also remove my credit.

When you do get it running the way you want, we would be grateful if you posted a theme contribution thread.
Thinking is the hardest work there is, which is probably the reason why so few engage in it. - Henry Ford

trevorpenfold

Hi Jeff,

Thanks so much for all your work and ideas - I'll continue with this as I develop my new site, and I'll definitely post what I end up with! I'm sure it won't be brilliantly coded, but hopefully it will give a jump-start to anyone else.

Many thanks again!