Jump to content

LimitCS este una dintre comunitatile de gaming din Romania care îşi are infiintarea în anul 2014. Scopul nostru este de a crea un mediu placut în care jucatorii sa se poată distra, sa-si petreaca timpul,sa-si faca noi prieteni si sa socializeze. Principiile noastre sunt profesionalismul si seriozitatea.
FORUM
Sign in to follow this  
  • entries
    8
  • comments
    0
  • views
    167

[Project][P3] Event System LimitCS - Editare Pagina Profil Membru

D0WN3D

33 views

LimitCS Events --  Part 3

 

//Pentru pagina profil membru (cand dai click pe numele/imaginea unui membru, te duce pe profil).

Imagine: aici

Intram in ACP la Customization > Themes > Edit HTML and CSS la tema pe care o avem pe forum.

Cautam  "elProfileInfoColumn" si adaugam codul de mai jos sub ultimul "</div>" de sub "{$member->birthday}"

<!-- Edit by D0WN3D -->
<div class="ipsWidget ipsWidget_vertical cProfileSidebarBlock ipsBox ipsSpacer_bottom"> 
  <!-- Syntax ?? : {christmas_on="$xmas_event->on"}{{if christmas_on == 1}} HTML CHRISTMAS {{endif}} -->
<h2 class="ipsWidget_title ipsType_reset">Event: Christmas</h2> <!-- Edit: Adaugare variabila {Event} in DB. V-a aparea Event: Christmas/Easter/Halloween in functie de ce event e pornit in DB -->
	<div class="ipsWidget_inner ipsPad">
		<ul class="ipsDataList ipsDataList_reducedSpacing cProfileFields">
			<li class="ipsDataItem">
				<span class="ipsDataItem_generic ipsDataItem_size3 ipsType_break"><strong>Globuri Rosii:</strong></span> <!-- Edit: Globuri/Oua/Bomboane in functie de ce event e pornit in DB -->
				<span class="ipsDataItem_main"> {number="$member->member_posts"} </span> <!-- Momentan Posts == Globuri Rosii | globuri_r == Globuri Rosii //fix this -->
				<!-- Syntax: {number="$member->globuri_r"} -->	
          </li>
			<li class="ipsDataItem">
				<span class="ipsDataItem_generic ipsDataItem_size3 ipsType_break"><strong>Globuri Verzi:</strong></span> <!-- Edit: Globuri/Oua/Bomboane in functie de ce event e pornit in DB -->
				<span class="ipsDataItem_main"> {number="$member->pp_reputation_points"} </span> <!-- Momentan Reputation == Globuri Verzi | globuri_v == Globuri Verzi //fix this -->
				<!-- Syntax: {number="$member->globuri_v"} -->
          </li>
                        <li class="ipsDataItem">
				<span class="ipsDataItem_generic ipsDataItem_size3 ipsType_break"><strong>Globuri Aurii:</strong></span> <!-- Edit: Globuri/Oua/Bomboane in functie de ce event e pornit in DB -->
				<span class="ipsDataItem_main"> 0 </span> <!-- Edit aici cu date DB | globuri_a == Globuri Aurii //fix this -->
				<!-- Syntax: {number="$member->globuri_a"} -->	
          </li>
		 </ul>
	</div>
</div>
<!-- Edit by D0WN3D -->

Deci practic codul nostru v-a arata asa:

{{if !\IPS\Request::i()->isAjax()}}
<!-- When altering this template be sure to also check for similar in the hovercard -->
<div data-controller='core.front.profile.main'>
	{template="profileHeader" app="core" location="front" group="profile" params="$member, false"}
	<div data-role="profileContent">
{{endif}}
		<div class='ipsColumns ipsColumns_noSpacing ipsColumns_collapseTablet' data-controller="core.front.profile.body">
			<div class='ipsColumn ipsColumn_fixed ipsColumn_veryWide' id='elProfileInfoColumn'>
				<div class='ipsAreaBackground_light ipsPad'>
					{{if settings.reputation_enabled and settings.reputation_show_profile}}
						{{if settings.reputation_leaderboard_on and settings.reputation_show_days_won_trophy and $lastDayWon = $member->getReputationLastDayWon()}}
							{{$formattedDate = $lastDayWon['date']->dayAndMonth() . (  $lastDayWon['date']->format('Y') == \IPS\DateTime::ts( time() )->format('Y' ) ? '' : " " . $lastDayWon['date']->format('Y') );}}
							<div class='ipsLeaderboard_trophy_1 cProfileSidebarBlock ipsSpacer_bottom '>
								<div class="ipsGrid">
									<span class="ipsGrid_span2 ipsType_center">
										<span class='ipsLeaderboard_trophy ipsLeaderboard_trophy_1'>
											<i class="fa fa-trophy"></i>
										</span>
									</span>
									<span class="ipsGrid_span10">
										<p class='ipsType_reset ipsType_medium'>
											<strong>
												<a class='ipsType_blendLinks' href="{url="app=core&module=discover&controller=popular&tab=leaderboard&custom_date_start={$lastDayWon['date']->getTimeStamp()}&custom_date_end={$lastDayWon['date']->getTimeStamp()}" seoTemplate="leaderboard_leaderboard"}">
													{{if $member->member_id == \IPS\Member::loggedIn()->member_id}}
														{lang="profile_you_won" sprintf="$formattedDate"}
													{{else}}
														{lang="profile_member_won" sprintf="$member->name, $formattedDate"}
													{{endif}}
												</a>
											</strong>
										</p>
										<p class='ipsType_reset ipsType_small'>{{if $member->member_id == \IPS\Member::loggedIn()->member_id}}{lang="profile_you_congrats"}{{else}}{lang="profile_member_congrats" sprintf="$member->name"}{{endif}}</p>
									</span>
								</div>
							</div>
						{{endif}}
						<div class='cProfileSidebarBlock ipsBox ipsSpacer_bottom'>
							{{if member.group['gbw_view_reps']}}
								<a href="{url="app=core&module=members&controller=profile&id={$member->member_id}&do=reputation" seoTemplate="profile_reputation" seoTitle="$member->members_seo_name"}" data-action="repLog" title="{lang="members_reputation" sprintf="$member->name"}">
							{{endif}}
								<div class='cProfileRepScore ipsPad_half {{if $member->pp_reputation_points > 1}}cProfileRepScore_positive{{elseif $member->pp_reputation_points < 0}}cProfileRepScore_negative{{else}}cProfileRepScore_neutral{{endif}}'>
									<h2 class='ipsType_minorHeading'>{lang="profile_reputation"}</h2>
									<span class='cProfileRepScore_points'>{number="$member->pp_reputation_points"}</span>
									{{if $member->reputation()}}
										<span class='cProfileRepScore_title'>{$member->reputation()}</span>
									{{endif}}
									{{if $member->reputationImage()}}
										<div class='ipsAreaBackground_reset ipsAreaBackground_rounded ipsPad_half ipsType_center'>
											<img src='{file="$member->reputationImage()" extension="core_Theme"}' alt=''>
										</div>
									{{endif}}
								</div>
							{{if member.group['gbw_view_reps']}}
								<p class='ipsType_reset ipsPad_half ipsType_right ipsType_light ipsType_small'>
									{lang="replog_show_activity"} <i class='fa fa-caret-right'></i>
								</p>
							</a>
							{{endif}}
						</div>
					{{endif}}
					
					{{if \IPS\Settings::i()->warn_on and !$member->inGroup( explode( ',', \IPS\Settings::i()->warn_protected ) ) and ( \IPS\Member::loggedIn()->modPermission('mod_see_warn') or ( \IPS\Settings::i()->warn_show_own and \IPS\Member::loggedIn()->member_id == $member->member_id ) )}}
						<div class='cProfileSidebarBlock ipsBox ipsSpacer_bottom'>
							<div id='elWarningInfo' class='ipsPad {{if $member->mod_posts || $member->restrict_post || $member->temp_ban}}ipsAreaBackground_negative{{endif}} ipsClearfix'>
								<i class='ipsPos_left {{if $member->warn_level > 0 || $member->mod_posts || $member->restrict_post || $member->temp_ban}}fa fa-exclamation-triangle{{else}}fa fa-circle-o ipsType_light{{endif}}'></i>
								<div>
									<h2 class='ipsType_sectionHead'>{lang="member_warn_level" pluralize="$member->warn_level"}</h2>
									<br>
									{{if !$member->mod_posts && !$member->restrict_post && !$member->temp_ban}}
										<span>{lang="no_restrictions_applied"}</span>
										<br>
									{{else}}
										<span>{lang="restrictions_applied"}</span>
										<ul class='ipsList_bullets ipsSpacer_top ipsSpacer_half'>
											{{if $member->mod_posts}}
												<li data-ipsTooltip title="{{if $member->mod_posts == -1}}{lang="moderation_modq_perm"}{{else}}{lang="moderation_modq_temp" sprintf="\IPS\DateTime::ts( $member->mod_posts )"}{{endif}}">
													{lang="moderation_modq"}
												</li>
											{{endif}}
											{{if $member->restrict_post}}
												<li data-ipsTooltip title="{{if $member->restrict_post == -1}}{lang="moderation_nopost_perm"}{{else}}{lang="moderation_nopost_temp" sprintf="\IPS\DateTime::ts( $member->restrict_post )"}{{endif}}">
													{lang="moderation_nopost"}
												</li>
											{{endif}}
											{{if $member->temp_ban}}
												<li data-ipsTooltip title="{{if $member->temp_ban == -1}}{lang="moderation_banned_perm"}{{else}}{lang="moderation_banned_temp" sprintf="\IPS\DateTime::ts( $member->temp_ban )"}{{endif}}">
													{lang="moderation_banned"}
												</li>
											{{endif}}
										</ul>
									{{endif}}
									{{if ( member.canWarn( $member ) || ( member.modPermission('can_flag_as_spammer') and !$member->modPermission() and !$member->isAdmin() ) ) and $member->member_id != member.member_id }}
										<br>
										<ul class='{{if member.canWarn( $member ) && member.modPermission('can_flag_as_spammer') and $member->member_id != member.member_id and !$member->modPermission() and !$member->isAdmin()}} ipsButton_split {{else}} ipsList_inline {{endif}}'>
											{{if member.canWarn( $member )}}
												<li>
													<a href='{$addWarningUrl}' id='elWarnUserButton' data-ipsDialog data-ipsDialog-title="{lang="warn_member" sprintf="$member->name"}" class='ipsButton ipsButton_light ipsButton_verySmall' title='{lang="warn_member" sprintf="$member->name"}'>{lang="warn_user"}</a>
												</li>
											{{endif}}
											{{if member.modPermission('can_flag_as_spammer') and $member->member_id != member.member_id and !$member->modPermission() and !$member->isAdmin()}}
												<li>
													{{if $member->members_bitoptions['bw_is_spammer']}}
														<a href='{url="app=core&module=system&controller=moderation&do=flagAsSpammer&id={$member->member_id}&s=0" seoTemplate="flag_as_spammer" seoTitle="$member->members_seo_name" csrf="true"}' class='ipsButton ipsButton_light ipsButton_verySmall' title='{lang="spam_unflag"}' data-confirm data-confirmSubMessage="{lang="spam_unflag_confirm"}">{lang="spam_unflag"}</a>
													{{else}}
														<a href='{url="app=core&module=system&controller=moderation&do=flagAsSpammer&id={$member->member_id}&s=1" seoTemplate="flag_as_spammer" seoTitle="$member->members_seo_name" csrf="true"}' class='ipsButton ipsButton_light ipsButton_verySmall' title='{lang="spam_flag"}' data-confirm>{lang="spam_flag"}</a>
													{{endif}}
												</li>
											{{endif}}
										</ul>
									{{endif}}
								</div>
							</div>
							{{if count( $member->warnings( 1 ) )}}
								<div data-role="recentWarnings" class=''>
									<ol class='ipsDataList'>
										{{foreach $member->warnings( 2 ) as $warning}}
											<li class="ipsDataItem" id='elWarningOverview_{$warning->id}'>
												<div class='ipsDataItem_icon ipsType_center'>
													<a href="{url="app=core&module=system&controller=warnings&do=view&id={$member->member_id}&w={$warning->id}" seoTemplate="warn_view" seoTitle="$member->members_seo_name"}" data-ipsDialog data-ipsDialog-size='narrow' class="ipsType_blendLinks" data-ipsTooltip title='{lang="wan_action_points" pluralize="$warning->points"}'>
														<span class="ipsPoints">{$warning->points}</span>
													</a>
												</div>
												<div class='ipsDataItem_main'>
													{{if $warning->canDelete()}}
														<a href="{$warning->url('delete')->csrf()}" title='{lang="revoke_this_warning"}' data-ipsTooltip data-action="revoke" class='ipsPos_right ipsButton ipsButton_small ipsButton_light ipsButton_narrow' data-ipsDialog data-ipsDialog-title='{lang="revoke_this_warning"}' data-ipsDialog-size='medium'><i class="fa fa-undo"></i></a>
													{{endif}}
													<a href="{url="app=core&module=system&controller=warnings&do=view&id={$member->member_id}&w={$warning->id}" seoTemplate="warn_view" seoTitle="$member->members_seo_name"}" data-ipsDialog data-ipsDialog-showFrom='#elWarningOverview_{$warning->id}' data-ipsDialog-size='narrow' class="ipsType_blendLinks" title=''>
														<h4 class="ipsType_reset ipsType_medium ipsType_unbold">
															{{if \IPS\Settings::i()->warnings_acknowledge}}
																{{if $warning->acknowledged}}
																	<strong class='ipsType_success' title='{lang="warning_acknowledged"}' data-ipsTooltip><i class='fa fa-check-circle'></i></strong>
																{{else}}
																	<strong class='ipsType_light' title='{lang="warning_not_acknowledged"}' data-ipsTooltip><i class='fa fa-circle-o'></i></strong>
																{{endif}}
															{{endif}}
															{lang="core_warn_reason_{$warning->reason}"}
														</h4>
														<p class='ipsDataItem_meta ipsType_light'>
															{lang="byline" sprintf="\IPS\Member::load( $warning->moderator )->name"}{datetime="$warning->date"}
														</p>
													</a>
												</div>
											</li>
										{{endforeach}}
									</ol>
									<p class='ipsType_reset ipsType_center ipsType_small ipsPad_half'>
										<a href='{url="app=core&module=system&controller=warnings&id={$member->member_id}" seoTemplate="warn_list" seoTitle="$member->members_seo_name"}' class='ipsButton ipsButton_verySmall ipsButton_light ipsButton_fullWidth' title='{lang="see_all_warnings"}' data-ipsDialog data-ipsDialog-remoteVerify='false' data-ipsDialog-remoteSubmit='false' data-ipsDialog-title="{lang="members_warnings" sprintf="$member->name"}">{lang="see_all_c"}</a>
									</p>
								</div>
							{{endif}}
						</div>
					{{else}}
                        {{if \IPS\Member::loggedIn()->modPermission('can_flag_as_spammer') and !$member->inGroup( explode( ',', \IPS\Settings::i()->warn_protected ) ) and \IPS\Member::loggedIn()->member_id != $member->member_id}}
                            {{if $member->members_bitoptions['bw_is_spammer']}}
                                <a href='{url="app=core&module=system&controller=moderation&do=flagAsSpammer&id={$member->member_id}&s=0" seoTemplate="flag_as_spammer" seoTitle="$member->members_seo_name" csrf="true"}' class='ipsButton ipsButton_light ipsButton_verySmall ipsButton_fullWidth' title='{lang="spam_unflag"}' data-confirm data-confirmSubMessage="{lang="spam_unflag_confirm"}">{lang="spam_unflag"}</a>
                            {{else}}
                                <a href='{url="app=core&module=system&controller=moderation&do=flagAsSpammer&id={$member->member_id}&s=1" seoTemplate="flag_as_spammer" seoTitle="$member->members_seo_name" csrf="true"}' class='ipsButton ipsButton_light ipsButton_verySmall ipsButton_fullWidth' title='{lang="spam_flag"}' data-confirm>{lang="spam_flag"}</a>
                            {{endif}}
                        {{endif}}
                    {{endif}}
					{{if count( $followers ) || \IPS\Member::loggedIn()->member_id === $member->member_id}}
						<div class='ipsWidget ipsWidget_vertical cProfileSidebarBlock ipsBox ipsSpacer_bottom' id='elFollowers' data-feedID='member-{$member->member_id}' data-controller='core.front.profile.followers'>
							{template="followers" group="profile" app="core" params="$member, $followers"}
						</div>
	 				{{endif}}

					<div class='ipsWidget ipsWidget_vertical cProfileSidebarBlock ipsBox ipsSpacer_bottom'>
						<h2 class='ipsWidget_title ipsType_reset'>{lang='profile_about' sprintf='$member->name'}</h2>
						<div class='ipsWidget_inner ipsPad'>
							{{if $member->group['g_icon'] }}
								<div class='ipsType_center ipsPad_half'><img src='{file="$member->group['g_icon']" extension="core_Theme"}' alt=''></div>
							{{endif}}
							<ul class='ipsDataList ipsDataList_reducedSpacing cProfileFields'>
								{{if $member->isOnline() AND $member->location}}
									<li class="ipsDataItem">
										<span class="ipsDataItem_generic ipsDataItem_size3 ipsType_break"><strong>{lang="online_users_location_lang"}</strong></span>
										<span class="ipsDataItem_main">{$member->location()|raw}</span>
									</li>
								{{endif}}
								{{if $member->member_title || $member->rank['title'] || $member->rank['image']}}
									<li class='ipsDataItem'>
										<span class='ipsDataItem_generic ipsDataItem_size3 ipsType_break'><strong>{lang="profile_rank"}</strong></span>
										<div class='ipsDataItem_generic ipsType_break'>
											{{if $member->member_title}}
												{$member->member_title}
												<br>
											{{elseif $member->rank['title']}}
												{$member->rank['title']}
												<br>
											{{endif}}
											{$member->rank['image']|raw}
										</div>
									</li>
								{{endif}}
								{{if $member->birthday AND \IPS\Settings::i()->profile_birthday_type == 'public' or ( \IPS\Settings::i()->profile_birthday_type == 'private' and \IPS\Member::loggedIn()->member_id == $member->member_id )}}
									<li class='ipsDataItem'>
										<span class='ipsDataItem_generic ipsDataItem_size3 ipsType_break'><strong>{lang="bday"}</strong></span>
										<span class='ipsDataItem_generic'>{$member->birthday}</span>
									</li>
								{{endif}}
							</ul>
						</div>
					</div>
<!-- Edit by D0WN3D -->
<div class="ipsWidget ipsWidget_vertical cProfileSidebarBlock ipsBox ipsSpacer_bottom"> 
  <!-- Syntax ?? : {christmas_on="$xmas_event->on"}{{if christmas_on == 1}} HTML CHRISTMAS {{endif}} -->
<h2 class="ipsWidget_title ipsType_reset">Event: Christmas</h2> <!-- Edit: Adaugare variabila {Event} in DB. V-a aparea Event: Christmas/Easter/Halloween in functie de ce event e pornit in DB -->
	<div class="ipsWidget_inner ipsPad">
		<ul class="ipsDataList ipsDataList_reducedSpacing cProfileFields">
			<li class="ipsDataItem">
				<span class="ipsDataItem_generic ipsDataItem_size3 ipsType_break"><strong>Globuri Rosii:</strong></span> <!-- Edit: Globuri/Oua/Bomboane in functie de ce event e pornit in DB -->
				<span class="ipsDataItem_main"> {number="$member->member_posts"} </span> <!-- Momentan Posts == Globuri Rosii | globuri_r == Globuri Rosii //fix this -->
				<!-- Syntax: {number="$member->globuri_r"} -->	
          </li>
			<li class="ipsDataItem">
				<span class="ipsDataItem_generic ipsDataItem_size3 ipsType_break"><strong>Globuri Verzi:</strong></span> <!-- Edit: Globuri/Oua/Bomboane in functie de ce event e pornit in DB -->
				<span class="ipsDataItem_main"> {number="$member->pp_reputation_points"} </span> <!-- Momentan Reputation == Globuri Verzi | globuri_v == Globuri Verzi //fix this -->
				<!-- Syntax: {number="$member->globuri_v"} -->
          </li>
                        <li class="ipsDataItem">
				<span class="ipsDataItem_generic ipsDataItem_size3 ipsType_break"><strong>Globuri Aurii:</strong></span> <!-- Edit: Globuri/Oua/Bomboane in functie de ce event e pornit in DB -->
				<span class="ipsDataItem_main"> 0 </span> <!-- Edit aici cu date DB | globuri_a == Globuri Aurii //fix this -->
				<!-- Syntax: {number="$member->globuri_a"} -->	
          </li>
		 </ul>
	</div>
</div>
<!-- Edit by D0WN3D -->
					{{foreach $sidebarFields as $group => $fields}}
						{{if count( $fields )}}
						<div class='ipsWidget ipsWidget_vertical cProfileSidebarBlock ipsBox ipsSpacer_bottom'>
							{{if $group != 'core_pfieldgroups_0'}}
                                <h2 class='ipsWidget_title ipsType_reset'>{lang="$group"}</h2>
                            {{endif}}
                            <div class='ipsWidget_inner ipsPad'>
								<ul class='ipsDataList ipsDataList_reducedSpacing cProfileFields'>
									{{foreach $fields as $field => $value}}
										<li class='ipsDataItem ipsType_break'>
											<span class='ipsDataItem_generic ipsDataItem_size3 ipsType_break'><strong>{lang="$field"}</strong></span>
											<span class='ipsDataItem_generic'><div class='ipsType_break ipsContained'>{$value|raw}</div></span>
										</li>
									{{endforeach}}
								</ul>
							</div>
						</div>
						{{endif}}
					{{endforeach}}
					{{if \IPS\Member::loggedIn()->modPermission('can_see_emails')}}
						<div class='ipsWidget ipsWidget_vertical cProfileSidebarBlock ipsBox ipsSpacer_bottom'>
							<h2 class='ipsWidget_title ipsType_reset'>{lang="profile_contact"}</h2>
							<div class='ipsWidget_inner ipsPad'>
								<ul class='ipsDataList ipsDataList_reducedSpacing'>
									<li class='ipsDataItem'>
										<span class='ipsDataItem_generic ipsDataItem_size3'><strong>{lang="profile_email"}</strong></span>
										<span class='ipsDataItem_generic'>
											<div class='ipsType_break ipsContained'><a href='mailto:{$member->email}' title='{lang="email_this_user"}'>{$member->email}</a></div>
											<span class='ipsType_light ipsType_small'>{lang="profile_email_addresses"}</span>
										</span>
									</li>
								</ul>
							</div>
						</div>
					{{endif}}
					{{if !empty( $visitors ) || \IPS\Member::loggedIn()->member_id == $member->member_id}}
						<div class='ipsWidget ipsWidget_vertical cProfileSidebarBlock ipsBox ipsSpacer_bottom' data-controller='core.front.profile.toggleBlock'>
							{template="recentVisitorsBlock" group="profile" params="$member, $visitors"}
						</div>
					{{endif}}
				</div>

			</div>
			<section class='ipsColumn ipsColumn_fluid'>
				{$mainContent|raw}
			</section>
		</div>
{{if !\IPS\Request::i()->isAjax()}}
	</div>
</div>
{{endif}}

Eventual putem adauga un style="color:culoare" la fiecare <span> tag si sa definim o culoare cu care sa scrie "Globuri Rosii/Aurii/Verzi" sau culaorea cu care sa apara numarul de globuri.

<span class="ipsDataItem_generic ipsDataItem_size3 ipsType_break" style="color:red"><strong>Globuri Rosii:</strong></span> // Globuri Rosii va fi scris cu rosu.

<span class="ipsDataItem_main" style="color:red"> {number="$member->member_posts"} </span> // Numarul globurilor rosii va fi scris cu rosu. 

 

//De adaugat pe viitor

-> Syntax Event: Daca eventul pornit este Christmas, sa apara Christmas, Daca eventul pornit este Easter sa apara Easter, Daca eventul pornit este Halloween sa apara Halloween
-> Syntax Date Event: globuri_r == Globuri Rosii || globuri_v == Globuri Verzi || globuri_a == Globuri Aurii
-> Adaugare in tabel-ul core_members noile coloane numite: globuri_r || globuri_v || globuri_a (respectiv oua si bomboane pentru celelealte eventuri)
-> Adaugare in DB tabel-ul xmas_event || easter_event || haloween_event care sa stocheze diferite date (Event pornit/oprit, Data inceput/sfarsit // +eventual si cate globuri/oua/bomboane sa ofere pe postare/reputatie)

 

"Everyone should know how to program a computer, because it teaches you how to think! - Steve Jobs"



0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×