other comments icon when a comment is present

Phoca Gallery - image gallery extension
HosHi
Phoca Member
Phoca Member
Posts: 21
Joined: 06 Jun 2008, 23:07
Location: Dessau/Germany
Contact:

other comments icon when a comment is present

Post by HosHi »

excuse my english. (translated by Google)
Stats:
- Joomla v1.6.3
- Phoca Gallery v3.0.0. rc5 for Joomla 1.6

I know it was already some post on the subject, but most of these were related to the JComments or facebook version.
But since JComments currently not available for 1.6 is the standard I wanted something Comment variant conversion.
If a comment is available for the image to display a different icon: Plan. (See picture)

Image

In part, I have it already. Different icons already in the "assets directory packed. Only when the DB query, I'm not really continue. Somehow he is in the wrong table (_phocagallery) and yes I need the values ​​from the table (_phocagallery_comments).
How can I query this table, so it must go as the modal box, too, this table queries. In this case, yes, the file ".. / components / com_phocagallery / views / comment / tmpl / default.php" is used.

Here's the "experiment"
(In file .. / components / com_phocagallery / views / category / tmpl / default.php):

Code: Select all

				echo ' >';
				// If you go from RSS or administration (e.g. jcomments) to category view, you will see already commented image (animated icon)
				$cimgid = JRequest::getVar( 'cimgid', 0, '', 'int');
				if($cimgid > 0) {
					echo JHTML::_('image', 'components/com_phocagallery/assets/images/icon-comment-a.jpg', JText::_('COM_PHOCAGALLERY_COMMENT_IMAGE'));
				} else {
					
					$commentImg = ($this->tmpl['externalcommentsystem'] == 2) ? 'icon-comment-fb-small' : 'icon-comment';
					if ($value->id != 138) {
						echo JHTML::_('image', 'components/com_phocagallery/assets/images/icon-comment-a.png', JText::_('COM_PHOCAGALLERY_COMMENT_IMAGE'));
					} else {
						echo JHTML::_('image', 'components/com_phocagallery/assets/images/icon-comment-b.png', JText::_('COM_PHOCAGALLERY_COMMENT_IMAGE'));
					}
				}
And here is the original line 429-438
(From file .. / components / com_phocagallery / views / category / tmpl / default.php):

Code: Select all

echo ' >';
				// If you go from RSS or administration (e.g. jcomments) to category view, you will see already commented image (animated icon)
				$cimgid = JRequest::getVar( 'cimgid', 0, '', 'int');
				if($cimgid > 0) {
					echo JHTML::_('image', 'components/com_phocagallery/assets/images/icon-comment-a.gif', JText::_('COM_PHOCAGALLERY_COMMENT_IMAGE'));
				} else {
					
					$commentImg = ($this->tmpl['externalcommentsystem'] == 2) ? 'icon-comment-fb-small' : 'icon-comment';
					echo JHTML::_('image', 'components/com_phocagallery/assets/images/'.$commentImg.'.'.$this->tmpl['formaticon'], JText::_('COM_PHOCAGALLERY_COMMENT_IMAGE'));
				}


Furthermore, I would like if you go with the mouse over the icon, an adapted text appears in the "title" field. (As seen on the two pictures)

Image

Image

But here the same problem as stated above. Wrong table.
Ideally, any comments right in the Title field, then read out from the DB. That something is clearly not every browser I realize, but I think it's beautiful. ;)
One would like to see what was written on mouseover.
My attempt (same php file):

Code: Select all

				if ($value->id != 138) {
					echo ' <a '.$tmplClass.' title="Es wurde noch kein Kommentar geschrieben"'
						.' href="'. JRoute::_('index.php?option=com_phocagallery&view=comment&catid='.$this->category->slug.'&id='.$value->slug.$tmplCom.'&Itemid='. JRequest::getVar('Itemid', 0, '', 'int') ).'"';
				} else {
					echo ' <a '.$tmplClass.' title="'.$value->id.' - '.$value->imgid.' - '.$value->cimgig.'&#10;&#13;----------&#10;&#13;hier könnten dann die Kommentare stehen&#10;&#13;---------&#10;&#13;von: Benutzername&#10;&#13;Kommentar 1&#10;&#13;--------&#10;&#13;von: Benutzername&#10;&#13;Kommentar 2&#10;&#13;---------&#10;&#13;u.s.w."'
						.' href="'. JRoute::_('index.php?option=com_phocagallery&view=comment&catid='.$this->category->slug.'&id='.$value->slug.$tmplCom.'&Itemid='. JRequest::getVar('Itemid', 0, '', 'int') ).'"';
				}
Original line 410-411:

Code: Select all

				echo ' <a '.$tmplClass.' title="'.JText::_('COM_PHOCAGALLERY_COMMENT_IMAGE').'"'
					.' href="'. JRoute::_('index.php?option=com_phocagallery&view=comment&catid='.$this->category->slug.'&id='.$value->slug.$tmplCom.'&Itemid='. JRequest::getVar('Itemid', 0, '', 'int') ).'"';
Maybe someone can give me on these little "problems" a little helping hand ...

Thanks in advance
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49190
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: other comments icon when a comment is present

Post by Jan »

Hi, you need to load the data from database, you need to do it in model of the comment view, but I don't know the exactly database query :-( :-( as I didn't do such customization :-(

components/com_phocagllery/models/comment.php

Jan
If you find Phoca extensions useful, please support the project
HosHi
Phoca Member
Phoca Member
Posts: 21
Joined: 06 Jun 2008, 23:07
Location: Dessau/Germany
Contact:

Re: other comments icon when a comment is present

Post by HosHi »

Ok. Thanks for the info. I've just looked at the file, that is a major undertaking. I'll get in a few weeks ... ;)
Post Reply