{strip}
{if $events.events}
	{foreach from=$events.events item=e key=key}
		{if $e.user_info}
			{assign var=event_count value=$e.data_format|@count}
			{if $event_count > 1}{assign var=lang_gid value=$e.gid|cat:'_m'}{else}{assign var=lang_gid value=$e.gid}{/if}
			<div id="wall_events_item_{$e.id}" class="wall_events_item">
				<div class="wall_events_user_icon">
					<a href="{$e.user_info.profile_link}" class="imgcanvas_container"><img class="imgcanvas" src="{$e.user_info.icon_url}{if !$e.user_info.icon_default}main_thumb_{/if}{$e.user_info.icon_file}" title="avatar" /></a>
				</div>
				<div class="wall_events_descr">
					<div>
						<span><a href="{$e.user_info.profile_link}">{$e.user_info.name}</a></span>
						&nbsp;<span>({$e.date_str})</span>
						{if $e.id_del}<a class="float_right" href="javascript:void(0);" onclick="wall_events.deleteWallPost({$e.id_del});">{$lang.button.delete}</a>{/if}
					</div>
					<div class="wall_events_event">
						<div class="wall_events_text">{$lang.wall_events[$lang_gid]}</div>
						{foreach from=$e.data_format item=item name=fe}
							{assign var=item_n value=$smarty.foreach.fe.iteration}
							{if $e.gid == 'upload_f'}
								<div class="wall_events_upload_f wall_events_upload_f_{if $item_n < 4}first{else}last{/if} imgcanvas_container" onclick="launchWindow('{$server}/ajax_backend.php', 'sel=photo_popup&id_photo={$item.id}', 800, 550);">
									<img class="imgcanvas" src="{$item.upload_path_url}{if $item_n < 4}big_thumb_{else}thumb_{/if}{$item.upload_file}" title="photo" />
								</div>
							{elseif $e.gid == 'upload_a'}
								<div class="audio_item">
									<span>
										<a class="play_audio_btn" href="javascript:void(0)" onclick="playAudio('{$item.upload_url}', '{$item.song_author|escape:javascript} - {$item.song_name|escape:javascript}', this);">
										<img src="{$site_root}{$template_root}{$template_images_root}/albums_listen_audio.gif" alt="" /></a>
									</span>
									<span class="song_author">{$item.song_author}</span> - {$item.song_name}&nbsp;&nbsp;&nbsp;<b>{$item.song_length}</b>
								</div>
							{elseif $e.gid == 'upload_v'}
								<div class="float_left">
									{if $item.thumb_file eq 'default'}
										<a class="imgcanvas_container wall_event_one_video" href="javascript:void(0)" onclick="launchWindow('{$site_root}/{$seo.viewprofile}','sel=start_video&type=v&id_item={$item.id_album}&id_subitem={$item.id}&id_user={$e.id_user}',600,400, true); return false;">
											<div class="one_video_icon"></div>
										</a>
									{else}
										<a class="imgcanvas_container wall_event_one_video" href="javascript:void(0)" onclick="launchWindow('{$site_root}/{$seo.viewprofile}','sel=start_video&type=v&id_item={$item.id_album}&id_subitem={$item.id}&id_user={$e.id_user}',600,400, true); return false;">
											<img src="{$item.thumb_file}" alt="" class="imgcanvas" />
										</a>
									{/if}
									<div class="text-overflow wall_events_upload_title">{$item.upload_title}</div>
								</div>
							{elseif $e.gid == 'avatar'}
								<div class="wall_events_upload_f wall_events_upload_f_first imgcanvas_container" onclick="launchWindow('{$server}/ajax_backend.php', 'sel=photo_popup&id_photo={$item.id}', 800, 550);">
									<img class="imgcanvas" src="{$item.upload_path_url}big_thumb_{$item.upload_file}" title="photo" />
								</div>
							{elseif $e.gid == 'event_new' || $e.gid == 'event_join'}
								<div class="wall_events_text">
									<p><a href="{$server}/{$seo.events}?sel=event&id_event={$item.id}">{$item.title}</a></p>
									{if $item.icon_name}
										<p>
											<a class="imgcanvas_container" href="{$server}/{$seo.events}?sel=event&id_event={$item.id}">
												<img class="imgcanvas" src="{$item.icon_path}thumb_{$item.icon_name}" />
											</a>
										</p>
										<p><a href="{$server}/{$seo.events}?sel=event&id_event={$item.id}">{$lang.wall_events.read_more}</a></p>
									{/if}
								</div>
							{elseif $e.gid == 'club_new' || $e.gid == 'club_join'}
								<div class="wall_events_text">
									<div><a href="{$server}/{$seo.club}?sel=club&id_club={$item.id}">{$item.title}</a></div>
									{if $item.icon_name}
										<p>
											<a class="imgcanvas_container" href="{$server}/{$seo.club}?sel=club&id_club={$item.id}">
												<img class="imgcanvas" src="{$item.icon_path}thumb_{$item.icon_name}" />
											</a>
										</p>
										<p><a href="{$server}/{$seo.club}?sel=join_club&id_club={$item.id}">{$lang.wall_events.join}</a></p>
									{/if}
								</div>
							{elseif $e.gid == 'blog_new'}
								<div class="wall_events_text">
									<p><a href="{$server}/{$seo.blog}{if !$e.is_self}?sel=friends{/if}">{$item.title}</a></p>
									<p>{$item.descr}</p>
								</div>
							{elseif $e.gid == 'blog_post'}
								<div class="wall_events_text">
									<p><a href="{$server}/{$seo.blog}?sel=add_comment&id_post={$item.id}">{$item.title}</a></p>
									<p>{$item.text}</p>
								</div>
							{elseif $e.gid == 'forum_new' || $e.gid == 'forum_post'}
								<div class="wall_events_text">
									<p><a href="{$server}/{$seo.forum}?sel=subcategory&id_subcategory={$item.id_subcategory}">{$item.subcategory}</a></p>
									<p>{$item.text}</p>
									<p><a href="{$server}/{$seo.forum}?sel=subcategory&id_subcategory={$item.id_subcategory}">{$lang.wall_events.read_more}</a></p>
								</div>
							{elseif $e.gid == 'poll_new'}
								<div class="wall_events_text">
									<p><a href="{$server}/{$seo.poll}?sel=polls&par=user&id_user={$e.id_user}">{$item.title}</a></p>
								</div>
							{elseif $e.gid == 'friend_acc'}
							{elseif $e.gid == 'friend_dec'}
							{elseif $e.gid == 'friend_del'}
							{elseif $e.gid == 'wall'}
								<div class="wall_events_text">
									{if $item.text_short}
										<p>{$item.text_short|nl2br}</p>
										<p style="display:none;">{$item.text|nl2br}</p>
										<a href="" onclick="$(this).parent().find('p:first').remove(); $(this).parent().find('p').show(); $(this).remove(); return false;">{$lang.wall_events.read_more}</a>
									{else}
										<p>{$item.text|nl2br}</p>
									{/if}
									<div class="wall_events_text">
										<a href="javascript:void(0);" onclick="wall_events.showComments({$e.id}, '{$e.gid}');">{$lang.wall_events.comments}</a>&nbsp;<span>({if $e.comments_count}{$e.comments_count}{else}0{/if})</span>
									</div>
									<div id="wall_events_item_comments_{$e.id}"></div>
								</div>
							{/if}
						{/foreach}
					</div>
				</div>
			</div>
		{/if}
	{/foreach}
{/if}
{/strip}