Jump to content



Photo

Last / Best score mod


  • Please log in to reply
3 replies to this topic

Poll: Default feature

Do you think this should be added to the arcade as a default feature?

You cannot see the results of the poll until you have voted. Please login and cast your vote to see the results of this poll.
Vote Guests cannot vote

#1 Josh D.

Josh D.

    Advanced Member

  • Members
  • PipPipPip
  • 78 posts
  • LocationInternet

Posted 14 April 2012 - 05:16 AM

Here's the mod.

iArcade-scores.jpg

Tested on: 1.2 Beta 2 / 1.2 Beta 3 / 1.3 Beta 1

File edit:

Open ./admin/applications_addon/other/iArcade/modules_public/arcade/play.php

Find:
			/* See if the user likes this game */
			if( $this->memberData['member_id'] )
			{
				$gameInfo['member_fav'] = $this->DB->buildAndFetch( array( 		
												'select'	=> '*',
												'from'		=> 'iarcade_favs',
												'where'		=> "member_id = {$this->memberData['member_id']} AND gameid = {$this->request['game']}"
											  ) );
			}

Add below:
/* Members best score */
			$gameInfo['member_score']	= $this->DB->buildAndFetch( array(
											'select'	=> '*',
											'from'		=> 'iarcade_scores',
											'where'		=> "member_id = {$this->memberData['member_id']} AND game_id = {$this->request['game']}",
											'order'		=> "score DESC",
											'limit'		=> array( 0, 1 )
										) );
										
			/* Members last score */
			$gameInfo['member_last_score']	= $this->DB->buildAndFetch( array(
											'select'	=> '*',
											'from'		=> 'iarcade_scores',
											'where'		=> "member_id = {$this->memberData['member_id']} AND game_id = {$this->request['game']}",
											'order'		=> "time DESC",
											'limit'		=> array( 0, 1 )
										) );
										
			/* Last game score */
			$gameInfo['last_score'] = $this->DB->buildAndFetch( array( 		
											'select'	=> '*',
											'from'		=> 'iarcade_scores',
											'where'		=> "game_id = {$this->request['game']}",
											'order'		=> "time DESC",
											'limit'		=> array( 0, 1 )
										) );
											  
			/* Sort out the member profile */
			$gameInfo['last_score']['member']				= IPSMember::load( $gameInfo['last_score']['member_id'] );
			
			/* Photo */
			$gameInfo['last_score']['member']				= IPSMember::buildProfilePhoto( $gameInfo['last_score']['member']['member_id'] );
			
			$gameInfo['last_score']['score']				= str_replace( '<#SCORE#>', $gameInfo['last_score']['score'], $this->lang->words['iarcade_cp_score'] );

Template edit:
Template > skin_iArcade > playGame

Find:
<span class='desc'>{$gameInfo['highscore']['score']}</span><br />
							<span class='desc ipsType_smaller'>{parse date="$gameInfo['highscore']['time']" format="short" relative="true"}</span>
						</div>
					</li>
				</ul>
			</div>
		</if>

Add below:
<if test="$gameInfo['last_score']['score'] && $gameInfo['last_score']['time']">
			<div class='ipsSideBlock'>
				<h3>Most Recent Score</h3>
				<ul class='ipsList_withminiphoto'>
					<li class='clearfix'>
						<a href="{parse url="showuser={$gameInfo['last_score']['member']['member_id']}" template="showuser" base="public" seotitle="{$gameInfo['last_score']['member']['members_seo_name']}"}" title='' class='ipsUserPhotoLink left'>
							<img src='{$gameInfo['last_score']['member']['pp_small_photo']}' alt='' class='ipsUserPhoto ipsUserPhoto_medium' />
						</a>
						<div class='list_content' style='margin-left: 60px;'>
								<a hovercard-ref="member" hovercard-id="{$gameInfo['last_score']['member']['member_id']}" class="_hovertrigger url fn" href="{parse url="showuser={$gameInfo['last_score']['member']['member_id']}" template="showuser" base="public" seotitle="{$gameInfo['last_score']['member']['members_seo_name']}"}">{$gameInfo['last_score']['member']['members_display_name']}</a><br />
							<span class='desc'>{$gameInfo['last_score']['score']}</span><br />
							<span class='desc ipsType_smaller'>{parse date="$gameInfo['last_score']['time']" format="short" relative="true"}</span>
						</div>
					</li>
				</ul>
			</div>
		</if>
		<if test="$gameInfo['member_score']['score'] && $gameInfo['member_last_score']['score']">
			<div class='ipsSideBlock'>
				<h3>My Scores</h3>
				<ul class='ipsList'>
					<li class='clearfix'>
							<span class='desc'>Best Score: <b>{$gameInfo['member_score']['score']}</b> - <i>{parse date="$gameInfo['member_score']['time']" format="short" relative="true"}</i></span><br />
							<span class='desc'>Last Score: <b>{$gameInfo['member_last_score']['score']}</b> - <i>{parse date="$gameInfo['member_last_score']['time']" format="short" relative="true"}</i></span><br />
					</li>
				</ul>
			</div>
		</if>

Since posts require approval it would probably be best to keep support to this topic, I just wanted the mod here so it would be easier to find for now.

Edited by Josh D., 29 April 2012 - 06:17 AM.

iArcade 1.3 Beta 1

#2 Axel Wers

Axel Wers

    Advanced Member

  • Members
  • PipPipPip
  • 116 posts

Posted 31 May 2012 - 08:14 AM

This must be in the next version.

#3 SerioussPL

SerioussPL

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 14 July 2012 - 04:25 PM

thx

#4 ozeneu

ozeneu

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 25 September 2012 - 10:54 AM

can you please create all in a single file like a hook ?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Google Analytics Alternative