Img Alt not changeable for Picasa

Phoca Gallery - image gallery extension
dip
Phoca Member
Phoca Member
Posts: 43
Joined: 09 Apr 2012, 16:33
Location: Russia

Img Alt not changeable for Picasa

Post by dip »

Hello. I have PG category imported from Picasa. And now, I need to show in image's alt value the description as set in Picasa. I change alt_value parameter to = 2 (PG control panel > Parameters > Alt value = description).
But, instead description it shows me in img alt the Title. In category with "local" PG images all OK. Problem only in picasa's category. All data successfully imported from Picasa, I check it in DB via SQL.
Help, please.

----
In "views\category\view.html.php" I found output string

Code: Select all

$altValue	= PhocaGalleryRenderFront::getAltValue($tmpl['altvalue'], $items[$iS]->title, $items[$iS]->description, $items[$iS]->metadesc);
Echo in picasa category show me:

Code: Select all

altvalue=2, title="File Name 1.jpg", description="File Name 1.jpg" alias="ImageName1jpg" metadesc=""
I.e. description=title. But in database for this image I have description = "My description 1".

Next I trace to

Code: Select all

$images	= $model->getData(1)
Maybe something wrong in model...
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49150
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Img Alt not changeable for Picasa

Post by Jan »

Hi, I will take a look at this, Picasa has no title and description - only caption, so maybe this is why this works this way. I will do some tests (to take into account when the description is added to Picasa images)

Jan
If you find Phoca extensions useful, please support the project
dip
Phoca Member
Phoca Member
Posts: 43
Joined: 09 Apr 2012, 16:33
Location: Russia

Re: Img Alt not changeable for Picasa

Post by dip »

I run phpmyadmin and check table *_phocagallery. In "description" field I can see the description text, what I see just under the image in Picasa (<textarea name="description"...). And in "title" field I see Picasa's file name.

As I find In "administrator\components\com_phocagallery\models\phocagalleryc.php":

Code: Select all

function picasaimages
...
$dataImg[$i]['title'] = $value->title->{$Ot};
$dataImg[$i]['description'] = $value->summary->{$Ot};
Data load from Picasa work good, I think...
dip
Phoca Member
Phoca Member
Posts: 43
Joined: 09 Apr 2012, 16:33
Location: Russia

Re: Img Alt not changeable for Picasa

Post by dip »

Jan?
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49150
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Img Alt not changeable for Picasa

Post by Jan »

Hi, still didn't find to test it, I think, the problem can be in outputing images - there is if clause where standard images get standard function and picasa images not :-(

components/com_phocagallery/views/category/tmpl/default_images.php

maybe this one:

Code: Select all

// IMG Start
				if ($extImage) {
					echo JHtml::_( 'image', $value->extm, $value->altvalue, array('width' => $correctImageRes['width'], 'height' => $correctImageRes['height'], 'class' => 'pg-image'));
				} else {
					echo JHtml::_( 'image', $value->linkthumbnailpath, $value->oimgalt, array('class' => $value->ooverlibclass ));
				}
If you find Phoca extensions useful, please support the project
dip
Phoca Member
Phoca Member
Posts: 43
Joined: 09 Apr 2012, 16:33
Location: Russia

Re: Img Alt not changeable for Picasa

Post by dip »

Thanks! fixed... but I don't remember how to fix it :oops:

I have some "efficiency suggestion" instead :)
1) always cut altvalue before display (PhocaGalleryText::wordDelete) and may be optionally use longdesc (see http://www.washington.edu/accessit/articles?1257 and http://www.456bereastreet.com/archive/2 ... ttributes/).
2) make image popup's <a title=... value changeable via "PG control panel > Parameters > Alt value" (perfect - via another option).
I.e. change com_phocagallery\views\category\tmpl\default.php

Code: Select all

		if ($value->type == 2) {
			if ($value->overlib == 0) {
				echo ' title="'. $value->title.'"';
			}
		}
to

Code: Select all

		if ($value->type == 2) {
			if ($value->overlib == 0) {
				echo ' title="'. $value->altvalue.'"'; //replace title
			}
		}
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49150
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Img Alt not changeable for Picasa

Post by Jan »

Hi, thank you for the ideas, but it is not so easy as it seems, as alt have specific function for specific popups, etc.

Jan
If you find Phoca extensions useful, please support the project
Post Reply