Topic: Add thumbnails to index page

How can I add automated thumbs to the auto generated index page?

Re: Add thumbnails to index page

Your question is very similar to the one from mskuma about adding a 'new' gif. Please take a look at my reply to mskuma's post and then read on.

To add the first two thumbnails would require something along the lines of:

#svlinks tr td {
  padding-top: 65px;
}
#svlinks tr.r1 td.c1 {
  background: url(g1/oneofmyfilenames.jpg) center top no-repeat;
}
#svlinks tr.r1 td.c2 {
  background: url(g2/anotherfilename.jpg) center top no-repeat;
}

It would take a little while to get it set-up the first time. Once it's looking good, you'd just need to copy and paste another css block and edit one line every time you add a gallery.

Just to repeat what I said to mskuma. I can't possibly please everyone in the matter of presentation. I will give some thought to how we might make this sort of thing easier for those with limited css skills but I want to keep hold of two principles: keep it flexible and keep it simple.

jack

Jack Hardie
SimpleViewer Support Team.

Re: Add thumbnails to index page

Ok, i have an idea. I hope it's ok to post it.

What you get:
A randomized Thumbnail for each gallery each time you refresh the page.

For a example look here: pictures dot 16qm dot de

You have to made a few changes in the code.
First in the classes/indexpage.php:
You have to add this at in the makeTable function under $keys = array($data).

require 'includes/constants.php';
require 'classes/manager.php';
require 'classes/gallery.php';
require 'classes/xmlcheck.php';
require 'classes/pathparser.php';

and then in the second for loop under  $key = $keys[$n]

$gallery = &new Gallery($data[$key]['path'], $rootPath);          
$images = $gallery->scanImageData();          
$rand = rand(0,count($images)-1);
$randImage = '.'.$data[$key]['rootPath'].DEFAULT_THUMB_PATH.$images[$rand]['fileName'];    

at last (in the indexpage.php) you have to change the line where the actual <td>link to my gallery</td> is built into:

$td = '<td><a href="'.$data&#91;$key&#93;&#91;'path'&#93;.'"><img src="'.$randImage.'" />'.$data&#91;$key&#93;&#91;'title'&#93;.'</a></td>';

the only new thing in the <td> is the img-tag

Second changes in the index.php in the root folder of svmanager:
The CSS-Code should look like this:

<style type="text/css">
      body &#123;
        font-family&#58; arial, helvetica, sans-serif;       
        color&#58; #FFFFFF;
        background-color&#58; #181818;
        padding&#58; 10px;
        font-size&#58; medium;
        /*line-height&#58; 1.2em;*/
      &#125;
      table &#123;
        width&#58; 650px;
        table-layout&#58; fixed; /* needed to cope with very long words */
      &#125;
      td &#123;
        font-size&#58; 1em;
        overflow&#58; hidden; /* very long words will be truncated */
        padding&#58; 0 0.5em 1.8em 0.5em;
        vertical-align&#58; top;
      &#125;
      h1 &#123;        
        color&#58; #CCCCCC;
        font-size&#58; x-large;
        padding&#58; 19px 0 17px 0;
      &#125;
      #wrapper &#123;   
        width&#58; 650px;    
        margin&#58; 0 auto; /* centre page content */       
        text-align&#58; center;
      &#125;
      
    a &#123;
      text-align&#58; left;
      display&#58; block;
      border&#58; 1px solid #c2e1ef;
      margin&#58;0 7px 0 0;
      width&#58; 100%;
      font-family&#58;"Lucida Grande", Tahoma, Arial, Verdana, sans-serif;
      text-decoration&#58;none;
      font-weight&#58;bold;
      color&#58;#565656;
      cursor&#58;pointer;
      font-size&#58;12px;
      padding&#58;0px 10px 0px 0px;
    &#125;
    
    a&#58;hover &#123;
      color&#58;#336699;
    &#125;
    
    a img &#123;
      margin&#58;0 15px 0px 0 !important;
      padding&#58;0;
      border-right&#58;1px solid #c2e1ef;
      border-left&#58; none;
      border-top&#58; none;
      border-bottom&#58; none;
      width&#58;30px;
      height&#58;30px;
      vertical-align&#58; middle;
    &#125;
    p.adminlink a &#123;
      text-align&#58; right; 
      font-size&#58; small;
      border&#58; none;
    &#125;
</style>

Now it should look like my example page.

Nedan  roll

Re: Add thumbnails to index page

Sure, it's always good to post ideas. Thanks for explaining your idea so people can try it if they want to.

Just one word of caution. Modifications to the code like this one are not guaranteed to work in future releases of svManager (and there is a new release due shortly). If you understand php, like Nedan does, then this won't be a problem for you but if you are not too hot on php then you might want to think twice.

jack

Jack Hardie
SimpleViewer Support Team.

Re: Add thumbnails to index page

SvManager version 1.2.0 now produces automatic thumbnails on the index page. The thumbnail for each gallery is the first in the current sort order. If you have just upgraded to 1.2.0 from an earlier version of svManager, you will probably see an 'X' image instead of your thumbnails in the galleries index page. For each of your galleries, go to one of the edit screens (customize, sort, or images screen) and press the Update button. This will save the gallery and create the new thumbnail.

Obviously, if you have previously customized your index page, you'll need to copy your changes across to the new index.php file – you did take a backup before you upgraded, didn't you?

jack

Jack Hardie
SimpleViewer Support Team.