Announcement

#1 2007-03-27 19:42:01

lorenzop
Guest

more information

I'm trying to add more information than author and the date of creation of a picture, may someone help me to know which file have I to modify?
I've already add the fields in the phpwebgallery_image table.
Thanks.
lorenzo

 

#2 2007-03-27 20:07:55

VDigital
Former Piwigo Team
Paris (FR)
2005-05-04
17680

Re: more information

Show what you have now in your phpwebgallery_image table.
How new columns would be filled?

8-)


Piwigo.com: Start and run your own photo gallery. Signup and get 30 days to try for free, no commitment.
8-)

Offline

 

#3 2007-03-27 20:27:21

lorenzop
Guest

Re: more information

I've add these new fields in the table phpwebgallery_image

id_catalogo => int(11)
titolo => varchar(255)
tecnica => varchar(255)
dimensioni => varchar(255)
supporto => varchar(255)
anno => varchar(255)
mostre => varchar(255)
note => varchar(255)

 

#4 2007-03-27 20:48:14

VDigital
Former Piwigo Team
Paris (FR)
2005-05-04
17680

Re: more information

Maybe, it would be better to create another table phpwebgallery_image_infos. I don't know right now.

id =>  mediumint(8) /* will be the same value than id in the phpwebgallery_images table */     
id_catalogo => int(11)
titolo => varchar(255)
tecnica => varchar(255)
dimensioni => varchar(255)
supporto => varchar(255)
anno => varchar(255)
mostre => varchar(255)
note => varchar(255)

How these columns would be filled?

8-)


Piwigo.com: Start and run your own photo gallery. Signup and get 30 days to try for free, no commitment.
8-)

Offline

 

#5 2007-03-27 21:24:25

lorenzop
Guest

Re: more information

Thanks in advance for the reply:-)

For the first time I think to fill the records using the data I have stored in another db.
Than I'd like to use a web form like the one is used to insert the name of the author.
About using another table with an esternal key (id) there are no problem.
I'd like to show the new fields under the field author.
If you like, you can take a look here:

http://perone.homelinux.org/gennaro

Bye

 

#6 2007-03-27 21:52:35

VDigital
Former Piwigo Team
Paris (FR)
2005-05-04
17680

Re: more information

Very nice Photon usage and an excellent sample for many people.

Back to your subject, not for tomorrow but in few days we can do it.
Because data is not coming from IPTC fields but from another db.
Yes, it would be better to create the phpwebgallery_image_infos table.

Mains lines:

1 - Picture.php will include a select on the new table and the "assign_block_vars" for them.
2 - We will modify the tpl to include the new fields
3 - Some css to show them correctly maybe.
4 - Some language change for them.

And that's it.

Be back soon.
8-)


Piwigo.com: Start and run your own photo gallery. Signup and get 30 days to try for free, no commitment.
8-)

Offline

 

#7 2007-03-29 09:47:03

VDigital
Former Piwigo Team
Paris (FR)
2005-05-04
17680

Re: more information

I am time limited a bit.
Don't hesitate to Up the topic from time to time.
8-)


Piwigo.com: Start and run your own photo gallery. Signup and get 30 days to try for free, no commitment.
8-)

Offline

 

#8 2007-03-29 10:15:08

lorenzop
Guest

Re: more information

Don't warry.
Thank you for your interest.
Bye.
lorenzo

 

#9 2007-03-29 19:39:34

VDigital
Former Piwigo Team
Paris (FR)
2005-05-04
17680

Re: more information

All followings would be placed somewhere.
We will study where exactly at the end.

I show just the logic.

1 - Define a constant for the name of phpwebgallery_image_infos table... (Where are the others?)

define('IMAGE_INFOS_TABLE', $prefixeTable.'image_infos');

2 - Build the query, excute and build the block (In which module? Where can we have $picture['current']['id'] available?)

$query = '
SELECT *
  FROM '.IMAGE_INFOS_TABLE.'
  WHERE id = '.$picture['current']['id'].'
;';

$result = pwg_query($query);
$row = mysql_fetch_assoc($result);
if (isset($row['id_catalogo']))
{
  $template->assign_block_vars(
    'catalogo',
    array (
        'CATALOGO' => $row['id_catalogo'],
        'TITOLO'      => $row['titolo'],
        'TECNICA'    => $row['tecnica'],
        'DIMENSIONI' => $row['dimensioni'],
        'SUPPORTO'  => $row['supporto'],
        'ANNO'         => $row['anno'],
        'MOSTRE'     => $row['mostre'],
        'NOTE'         => $row['note'],      )
    );
}

3 - Display the related information (Where?)

<!-- BEGIN catalogo -->
<!-- for example hereunder is a table but it can be something else -->
<table class="infoTable catalogo" summary="Some info about">
  <tr>
    <td class="label">{lang:Catalogo}</td>
    <td class="value">{catalogo.CATALOGO}</td>
  </tr>
  <tr>
    <td class="label">{lang:Titolo}</td>
    <td class="value">{catalogo.TITOLO}</td>
  </tr>
  <tr>
    <td class="label">{lang:Tecnica}</td>
    <td class="value">{catalogo.TECNICA}</td>
  </tr>
  <tr>
    <td class="label">{lang:Dimensioni}</td>
    <td class="value">{catalogo.DIMENSIONI}</td>
  </tr>
  <tr>
    <td class="label">{lang:Supporto}</td>
    <td class="value">{catalogo.SUPPORTO}</td>
  </tr>
  <tr>
    <td class="label">{lang:Anno}</td>
    <td class="value">{catalogo.ANNO}</td>
  </tr>
  <tr>
    <td class="label">{lang:Mostre}</td>
    <td class="value">{catalogo.MOSTRE}</td>
  </tr>
  <tr>
    <td class="label">{lang:Note}</td>
    <td class="value">{catalogo.NOTE}</td>
  </tr>
</table>
<!-- END catalogo -->

You don't have all information but YOU can find the right answers.
I prefer you understand than just doing  ...
Ask if you can't find the responses or if you have a doubt.

8-)

PS: CSS and language can be also found easily (or can be already sufficient for you).


Piwigo.com: Start and run your own photo gallery. Signup and get 30 days to try for free, no commitment.
8-)

Offline

 

#10 2007-03-30 18:54:34

lorenzop
Guest

Re: more information

I've tried doing the following steps, but perhaps I need a little more help  :-)

1) I've add thist line

define('IMAGE_INFOS_TABLE', $prefixeTable.'image_infos');

in ./include/constants.php

------------------------------------------------------------------------------------------
2) I've changed my image_infos coloumns name in:

id
id_catalog
title
technique
size
support
year
exhibitions
note

------------------------------------------------------------------------------------------
3) I've add this line

include(PHPWG_ROOT_PATH.'include/picture_infos.inc.php');

in ./picture.php

------------------------------------------------------------------------------------------
4) I've created  ./include/picture_infos.inc.php with

<?php

/**
* This file is included by the picture page to manage image infos
*
*/

$query = '
SELECT *
  FROM '.IMAGE_INFOS_TABLE.'
  WHERE id = '.$picture['current']['id'].'
;';

$result = pwg_query($query);
$row = mysql_fetch_assoc($result);
if (isset($row['id_catalog']))
{
  $template->assign_block_vars(
    'catalog',
    array (
        'CATALOG' => $row['id_catalog'],
        'TITLE'      => $row['title'],
        'TECHNIQUE'    => $row['technique'],
        'SIZE' => $row['size'],
        'SUPPORT'  => $row['support'],
        'YEAR'         => $row['year'],
        'EXHIBITIONS'     => $row['exhibitions'],
        'NOTE'         => $row['note'],      )
    );
}

?>

------------------------------------------------------------------------------------------
5) I've inserted these lines

<!-- BEGIN catalogo -->
<!-- for example hereunder is a table but it can be something else -->
<table class="infoTable catalog" summary="Some info about">
  <tr>
    <td class="label">{lang:Catalog}</td>
    <td class="value">{catalog.CATALOG}</td>
  </tr>
  <tr>
    <td class="label">{lang:Title}</td>
    <td class="value">{catalog.TITLE}</td>
  </tr>
  <tr>
    <td class="label">{lang:Technique}</td>
    <td class="value">{catalog.TECHNIQUE}</td>
  </tr>
  <tr>
    <td class="label">{lang:Size}</td>
    <td class="value">{catalog.SIZE}</td>
  </tr>
  <tr>
    <td class="label">{lang:Support}</td>
    <td class="value">{catalog.SUPPORT}</td>
  </tr>
  <tr>
    <td class="label">{lang:Year}</td>
    <td class="value">{catalog.YEAR}</td>
  </tr>
  <tr>
    <td class="label">{lang:Exhibitions}</td>
    <td class="value">{catalog.EXHIBITIONS}</td>
  </tr>
  <tr>
    <td class="label">{lang:Note}</td>
    <td class="value">{catalog.NOTE}</td>
  </tr>
</table>
<!-- END catalogo -->

in ./template/photon/picture.tpl

 

#11 2007-03-30 23:19:37

VDigital
Former Piwigo Team
Paris (FR)
2005-05-04
17680

Re: more information

It seems to look perfect at all.

But there is a but.

Where is :

include(PHPWG_ROOT_PATH.'include/picture_infos.inc.php');

in ./picture.php ?
Maybe not in the right place.
So please propose some lines before to add it.
8-)


Piwigo.com: Start and run your own photo gallery. Signup and get 30 days to try for free, no commitment.
8-)

Offline

 

#12 2007-04-02 13:42:26

lorenzop
Guest

Re: more information

I've made a test, but I think I'm not "driving" in the right way...

1) I've moved include(PHPWG_ROOT_PATH.'include/picture_infos.inc.php');
in the first part of picture.php

define('PHPWG_ROOT_PATH','./');
include_once(PHPWG_ROOT_PATH.'include/common.inc.php');
include(PHPWG_ROOT_PATH.'include/section_init.inc.php');
include(PHPWG_ROOT_PATH.'include/picture_infos.inc.php');

----------------------------------------------------------------------------------------------
2) I've tried to put before 

//--------------------------------------------------------- picture information

this code

//--------------------------------------------------------- picture catalog
// catalog number
if (isset($catalog['current']['id_catalog'])
    and !empty($catalog['current']['id_catalog']))
{
  $template->assign_block_vars(
    'catalog',
    array(
      'CATALOG' => nl2br($catalog['current']['id_catalogo'])
      ));
}

But it doesn't seem right....

 

#13 2007-04-03 11:47:17

VDigital
Former Piwigo Team
Paris (FR)
2005-05-04
17680

Re: more information

lorenzop wrote:

//--------------------------------------------------------- picture catalog
// catalog number
if (isset($catalog['current']['id_catalog'])
    and !empty($catalog['current']['id_catalog']))
{
  $template->assign_block_vars(
    'catalog',
    array(
      'CATALOG' => nl2br($catalog['current']['id_catalogo'])
      ));
}

But it doesn't seem right....

Bold text means nothing to me.

From your post on 2007-03-30 18:54:34 *
I will :
include(PHPWG_ROOT_PATH.'include/picture_infos.inc.php');
between
//--------------------------------------------------------- picture information
and
// legend
Like this

//--------------------------------------------------------- picture information
// Add information
   include(PHPWG_ROOT_PATH.'include/picture_infos.inc.php');
// legend

More...
In the template...
Change:
<!-- BEGIN catalogo -->
by <!-- BEGIN catalog -->

<!-- END catalogo -->
by <!-- END catalog -->

I didn't test it but it would work.

8-)


Piwigo.com: Start and run your own photo gallery. Signup and get 30 days to try for free, no commitment.
8-)

Offline

 

#14 2007-04-04 15:04:37

lorenzop
Guest

Re: more information

I'll try during the next weekend.
Thanks.
lorenzo

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact