Menu

Themes

Anonymous
2009-05-10
2013-05-30
  • Anonymous

    Anonymous - 2009-05-10

    Before you get too far into this, I just want to clarify this is not intended to sound like a complaint...

    So I thought I would take a stab at creating a theme for PGV. To start, I copied a theme directory and renamed it, then started snooping around the theme files.  At first it seemed like it wasn't going to be too difficult... As I started uploading and referencing some new icons, I soon began to realize some of the images are hard coded into functions, making them static to the site no mater what theme is chosen.  At this point I realized if I wanted to change the "look" of the site by creating my own theme, I would have to edit various function files, block files, ... which basically defeats the purpose of creating separate themes.  And then if I upgraded when the next PGV release comes out, I would lose my changes outside of the theme files.

    PGV is a great script and does a great job at presenting genealogy information.  I think it would also be great if the script is meant to have different themes, to make it possible for all icons/buttons/images to be defined by individual themes.

    And I do realize this is not a high priority.  I give props to those contributors that do give high priority to actual bugs!

    Here is my sample site: http://area51.my-genealogy.us/4.2.2/
    My experimental theme is listed as "aesthetica"
    In order to specifiy the file type icons, I had to edit function files.  And if you notice, I only changed some of the scripts as some of the file type icons still show the script default icon.

    Anyhow... I suppose I've been on the rant box enough.  Maybe one of these days, after I better grasp the various functions and classes of the script, I'll be able to provide more than just rants.

    Thanks PGV!

     
    • Anonymous

      Anonymous - 2009-05-11

      Tom, I won't disagree with you, but as I've been playing with themes here for a few years now I may be able to help.

      You are right that a number of icons are "fixed", in that they are stored in the core images directory rather than individual themes. This could be changed though. Let us know which are an issue for you. Note that this can also vary according to the theme you use as a starting point. Standard is not the best, as it uses many more "core" images than (say) Xenia or Cloudy.

      My own solution has been quite basic. As I have developed a very individual theme, I don't feel inclined to allow users to choose a different one, so I removed the option. This means that changing the 'core' icons isn't a problem, as no other themes are effected. (that said, my 'new' theme, yet to be completed, will hardly use any icons at all - giving a very clean overall style).

      I also run a web site called www.pgvthemes.com. Its a place those of us interested in this area can discuss issues like this without clogging up these pages that are best kept for the more generic code / implementation issues. It also allows those who want to to share their own designs with others. Yours is coming on well, so hopefully you will feel like sharing that with a wider audience at some time.

      My own current theme is at www.our-families.info.

       
      • Veit

        Veit - 2009-05-11

        Hi kiwi,
        could it be your sites are offline? Both are not reachable for me for the last 2 days.

         
    • KosherJava

      KosherJava - 2009-05-11

      Thanks for your feedback. Such "rants" are actually very helpful to the developers. What would be very helpful would be an itemized list of the exact items that you feel are hard coded in functions, and include file name and line number. Be un touch with Kiwi who has a lot of expertise in the subject.

       
    • Anonymous

      Anonymous - 2009-05-11

      No, both are working fine. No down time ever that I'm aware of.

       
      • Veit

        Veit - 2009-05-11

        Very interesting. Looks like my provider Arcor here in Germany is blocking your sites. Using an open US proxy I can connect to.

         
    • Anonymous

      Anonymous - 2009-05-11

      Viet, I should also add that my current site is not the one using the getMenusAsList  function and css menus that I mentioned. That is so far only on my test (offline, xampp) site. I hope to have it ready for "public release' in a week or so.

      I don't know of any reason Arcor should block these sites, but these things do happen. The server they are on is here in NZ, and is privately controlled. Definitely no spam issues.

       
    • KosherJava

      KosherJava - 2009-05-12

      Tom,
      Have a look at the latest SVN. Gerry checked in code that makes the file type icons themable. What other areas do you find hardcoded?

       
      • Anonymous

        Anonymous - 2009-05-13

        Thanks kosh and Gerry!  I totally give props to you guys for the response you all give to bugs and even suggestions.

        Unfortunately work has me quite busy this week so I have had time to browse through code for specifics, but I do know the Album tab and Media tab on the Individuals pages seemed to be hard coded for the file type images.  Also the Random Image block.

        I almost wonder if it wouldn't be easier to manage if a function or class was written to handle the images for file types.  That way the function or class could check if there is a user assigned thumbnail / system generated thumb for images, and if not then an icon could be assigned for Images, Videos, Audio, Documents, PDFs, ...  Then if someone wanted to get crazy enough to make an icon for WAV, MP3, AIFF, ... or just a default for all Audio.

        But I regress back to my initial comment that these are definitely not priorities on any list.  When I get some time to find the hard coded ones, I'll create a list.  Then when I get some more time, I do want to see what I can come up with in an attempt to go table-less.

        Thanks guys!

         
        • Anonymous

          Anonymous - 2009-05-13

          BTW, I know the whole table-less topic has it's own thread.

           
    • Gerry Kroll

      Gerry Kroll - 2009-05-13

      Tom:
      There's already a function that determines what icon/thumbnail should be used, depending on the file name extension.  This function is VERY easy to amend when new file name extensions warrant their own icons.

      The user is free to provide his own icon/thumbnail image for any media file, including those non-image ones.  When such a thumbnail is present, it will be used in preference to the system or theme default.

       
      • Anonymous

        Anonymous - 2009-05-13

        Canajun,

        I actually find 2 functions that try to do this.

        functions_mediadb.php has a switch() around line 1067.
        functions.php has a switch() around line 3967.

        functions_mediadb.php appears to do a good job using a theme defined image if defined whereas functions.php appears to be hard coded, not allowing or checking if there is a theme defined image.  Although I do like how functions.php has a different icon for media that is referenced off-site.

        I haven't browsed all of the functions, so there may be more.  This is why I said maybe 1 function should just handle this task.

        If I am missing something, please let me know what file I should be checking.
        Thanks!

        -Tom

         
    • Gerry Kroll

      Gerry Kroll - 2009-05-13

      Tom:
      The current SVN version of functions.php DOES look at the theme to see whether there's a definition for the icon.  The code, around line 3967, looks like this:

          switch ($type) {
              case 'url_flv':
                  $thumb = isset($PGV_IMAGES["media"]["flashrem"]) ? $PGV_IMAGE_DIR.'/'.$PGV_IMAGES["media"]["flashrem"] : 'images/media/flashrem.png';
                  break;
              case 'local_flv':
                  $thumb = isset($PGV_IMAGES["media"]["flash"]) ? $PGV_IMAGE_DIR.'/'.$PGV_IMAGES["media"]["flash"] : 'images/media/flash.png';
                  break;

      etc.

      You can see that if the theme's "theme.php" contains a definition for the icon, the theme's specification will be used.  If not, we use a hard-coded default.  This approach eliminates the need for old custom themes to be updated immediately.

      The same approach was put into "reportengine.php", where the only other hard-coded references to system default icons (pdf.gif, html.gif, and tex.gif) occurred.

       
      • Anonymous

        Anonymous - 2009-05-13

        Sweet!  I stand corrected.  I could make up some excuse about it being late at night when I was looking or I opened my stable directory instead of svn... but that's irrelevant.  Awesome canajun!  I may have to start my venture into attempting a table-less layout.

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.