Jump to content

Последние фотографии для сообщества


Recommended Posts

Возможно кому то понадобиться хак, обязательно установите модуль альбомы сообществ иначе хак не будет работать

 

 image.png.5419f9ffb02d76f77d0fe0caa3be2189.png

 

1.Открываем public.php 

находим 

		if(!$row['adres']) $row['adres'] = 'public'.$row['id'];
		$tpl->set('{adres}', $row['adres']);

и ниже вставляем 

		//################### Последние фотографии ###################//
	$photos_view_albumsalbums_count = $db->super_query("SELECT COUNT(*) AS cnt FROM `".PREFIX."_communities_photos` WHERE pid = '{$row['id']}'", false);
			$photos_view_albumsalbums_count_system = $db->super_query("SELECT COUNT(*) AS cnt FROM `".PREFIX."_communities_photos` WHERE pid = '{$row['id']}' and position = '1'", false);
			

			$photos_view_albumssql_albums = $db->super_query("SELECT SQL_CALC_FOUND_ROWS id, photo_name, album_id FROM `".PREFIX."_communities_photos` WHERE pid = '{$row['id']}'  ORDER by `date` DESC LIMIT 6", true);
			if($photos_view_albumssql_albums){
				foreach($photos_view_albumssql_albums as $photos_view_albumsrow_albums){
					$photos_view_albumsrow_albums['name'] = stripslashes($photos_view_albumsrow_albums['name']);
					$photos_view_albumsalbum_date = megaDateNoTpl(strtotime($photos_view_albumsrow_albums['adate']));
					$photos_view_albumsalbums_photonums = gram_record($photos_view_albumsrow_albums['photo_num'], 'photos');
					if($photos_view_albumsrow_albums['cover']) $photos_view_albumsalbum_cover = "/uploads/groups/{$row['id']}/albums/{$row_albums['aid']}/{$row_albums['cover']}";
					else $photos_view_albumsalbum_cover = '{theme}/images/no_cover.png';
					if($photos_view_albumsrow_albums['descr']) $photos_view_albumsdescrs = 'page_album_title_wrap_descr';
					else $photos_view_albumsdescrs = '';
					$photos_view_albumsalbums .= "<a onclick=\"PhotoGroups.Show(this.href); return false\" href=\"/photo-{$row['id']}_{$photos_view_albumsrow_albums['id']}_{$photos_view_albumsrow_albums['album_id']}\">
					<img style=\"margin-right:9px;\" src=\"/uploads/groups/{$row['id']}/albums/{$photos_view_albumsrow_albums['album_id']}/c_{$photos_view_albumsrow_albums['photo_name']}\" height:=\"80\" width=\"80\" ></a>";
				}
			}
			$tpl->set('{photos_view_albums}', $photos_view_albumsalbums);
			$cnt = $photos_view_albumsalbums_count['cnt']-$photos_view_albumsalbums_count_system['cnt'];
			$tpl->set('{photos_num}', $cnt.' '.gram_record($cnt,'albums'));
			if($cnt){
				$tpl->set('[photos]', '');
				$tpl->set('[/photos]', '');
			} else
				$tpl->set_block("'\\[photos\\](.*?)\\[/photos\\]'si","");

2.Открываем  templates/Default/public/main.tpl и вставляете код туда где хотите видеть последние 5 фото

[photos]<a href="/albums-{id}" onClick="Page.Go(this.href); return false" style="text-decoration:none"><div class="albtitle" style="margin-top:10px">Фотографии <span></span><div><b></b></div></div></a>
<div id="my_photo" class="" style="margin-top:5px;margin-left:7px;">
 <center>{photos_view_albums}</center><div class="clear"></div></div>[/photos]

 

Вот и все установка хака закончена)))

от + в репу не откажусь)

Демо хака можно увидеть здесь https://druzi.info/public2

 

 

 

  • Upvote 1
  • Downvote 1
Link to comment
Share on other sites

  • 1 year later...
14 часов назад, artem201920191 сказал:

лучшеб сделали для обычного профиля... (хак который уже есть он не выводит фотки а только кпопку фотографии)

Возьми сборку слупи и вырежи

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...