Add the username to each image in the view class. (SOLVED) 11 years 1 month ago #1

  • Depreter
  • Localtime: 16:18
  • Europe/Bucharest
  • Posts: 6
Hello,
I would like to add the user name to each image in the view category, can you help me?
Thanking you in advance.
link to my cat view :
http://glamhotl.cluster015.ovh.net/concours/index.php/component/hotornot/?task=categorypictures&id=2&Itemid=122 (it's a fake site)
The administrator has disabled public write access.

Re: Add the username to each image in the view class. 11 years 1 month ago #2

  • Alexandru
  • Alexandru's Avatar
  • Senior Developer
  • Bucharest
  • Localtime: 16:18
  • Europe/Bucharest
  • Posts: 4856
Hello!

Edit:
- [Joomla dir]\components\com_hotornot\models\browse.php and change line 97 from:
$query = ' SELECT DISTINCT i.id, i.hits, i.rank, i.folder, i.extension, "hotornot" as source, i.user_id AS user_id, i.date_added AS date_added'

to:
$query = ' SELECT DISTINCT i.id, i.hits, i.rank, i.folder, i.extension, "hotornot" as source, i.user_id AS user_id, i.date_added AS date_added, u.username'

- [Joomla dir]\components\com_hotornot\views\browse\tmpl\_list.php and change line 15 from:
<a class="hotornot-thumnbail" href="<?php echo JRoute::_('index.php?option=com_hotornot&task=show&id=' . $image->id . '&source=' . $image->source . '&Itemid=' . $this->Itemid); ?>"><div class="hotornot-thumb-wrapper"><div class="hotornot-thumbnail" style="height: <?php echo $this->settings->thumbnail_max_height; ?>px; width: <?php echo $this->settings->thumbnail_max_width; ?>px; background-image:url(<?php echo ($image->source == 'hotornot') ? Helper::imageSrc($image->id, $image->extension, $image->folder, 'thumb') : JURI::root() . 'components/com_lovefactory/storage/photos/' . $image->user_id . '/thumb_' . $image->extension; ?>);"></div><?php echo isset($image->rank)? $image->rank : '0.00'; ?><img class="hotornot-icon3" src="<?php echo JURI::root(); ?>components/com_hotornot/assets/images/star_on.png" /></div></a>

to:
<a class="hotornot-thumnbail" href="<?php echo JRoute::_('index.php?option=com_hotornot&task=show&id=' . $image->id . '&source=' . $image->source . '&Itemid=' . $this->Itemid); ?>"><div class="hotornot-thumb-wrapper"><div class="hotornot-thumbnail" style="height: <?php echo $this->settings->thumbnail_max_height; ?>px; width: <?php echo $this->settings->thumbnail_max_width; ?>px; background-image:url(<?php echo ($image->source == 'hotornot') ? Helper::imageSrc($image->id, $image->extension, $image->folder, 'thumb') : JURI::root() . 'components/com_lovefactory/storage/photos/' . $image->user_id . '/thumb_' . $image->extension; ?>);"></div><?php echo isset($image->rank)? $image->rank : '0.00'; ?><img class="hotornot-icon3" src="<?php echo JURI::root(); ?>components/com_hotornot/assets/images/star_on.png" /><br /><?php echo $image->username; ?></div></a>
thePHPfactory Customer Support
The administrator has disabled public write access.

Re: Add the username to each image in the view class. 11 years 1 month ago #3

  • Depreter
  • Localtime: 16:18
  • Europe/Bucharest
  • Posts: 6
Thx you a lot !
The administrator has disabled public write access.