PDA

View Full Version : V3arcade - Show Last Score News


MioTraGusa
02-28-2006, 10:00 PM
This Modification show the last scores and the games played in V3arcade main page.
I do not know if the next version of v3arcade taught also the latest scores, but this modification is a way for it.

Fully phrased modification.
Tested in Vbulletin 3.5.3 and V3arcade 1.0.2

Products to import: (1) - product-v3arcade_score_news_english.xml or product-v3arcade_score_news_spanish.xml
Templates to edit: (1) - arcade_main
Templates Added: (2) - arcade_scor_bit & arcade_scor_bit_first
Phrases Added: (4)
DB changes: Add new fields in arcade_news_scor

Instructions...
Download the attached product and install it in Admin CP -> Plugin System -> Manage Products -> [Add/Import Product]
Edit the template "arcade_main"Search
<tbody id="collapseobj_newsandevents" style="$vbcollapse[collapseobj_newsandevents]">
<tr align="center">
<td class="alt1" valign="top" style="padding: 0px">
<table cellpadding="0" cellspacing="0" border="0" width="100%" align="center">
$newsbits
</table>
</td>
</tr>
</tbody>
Bellow add
<thead>
<tr align="center">
<td class="thead"><a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('newscorevents')"><img id="collapseimg_newscorevents" src="$stylevar/collapse_thead$vbcollapse[collapseimg_newscorevents].gif" alt="" border="0" /></a>$vbphrase[newscorevents]</td>
</tr>
</thead>
<tbody id="collapseobj_newscorevents" style="$vbcollapse[collapseobj_newscorevents]">
<tr align="center">
<td class="alt1" valign="top" style="padding: 0px">
<table cellpadding="0" cellspacing="0" border="0" width="100%" align="center">
$scorbits
</table>
</td>
</tr>
</tbody>
Edit arcade.php file in /forumroot/Search

'arcade_news_bit',

Bellow add

'arcade_scor_bit_first',
'arcade_scor_bit',


Search

eval('$newsbits .= "' . fetch_template('arcade_news_bit') . '";');
}

Bellow add

// MioTraGuSa Modification Last Scores
// Fetch the latest scores.
$scorbits = '';
$scorquery = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "arcade_news_scor AS arcade_news_scor ORDER BY datescor DESC LIMIT " . $vbulletin->options['quicksearchresults']);
while ($scor = $db->fetch_array($scorquery))
{
exec_switch_bg();

// Format the score news date/time.

$scor['date'] = vbdate($vbulletin->options['logdateformat'], $scor['datescor']);
$scor['newstext'] = unhtmlspecialchars($parser->do_parse($scor['scortext'], false, true, true, false, true, false));
if ($scor['scorid'] == "1")
{
eval('$scorbits .= "' . fetch_template('arcade_scor_bit_first') . '";');
} else {
eval('$scorbits .= "' . fetch_template('arcade_scor_bit') . '";');
}
}


Search

// Save the session.
$db->query_write("UPDATE " . TABLE_PREFIX . "arcade_sessions SET ping='$difference', valid=$validate WHERE sessionid=" . $vbulletin->GPC['id'] . " AND userid=" . $vbulletin->userinfo['userid']);

Bellow add

// MioTraGuSa Modification Last Scores
$gamescornews['score'] = sprintf((float)$game['score']);
if ($gamescornews['score'] <= 1) {
$db->query_write("INSERT INTO " . TABLE_PREFIX . "arcade_news_scor (scortext, scortype, scorgame, scoruserid, datescor) VALUES ('" . addslashes(construct_phrase($vbphrase['x_points_in_the_y_gamezero'], $vbulletin->userinfo['username'], $gamescornews['score'], $game['title'])) . "', 'auto', '$game[gameid]', " .$vbulletin->userinfo['userid']. ", " . TIMENOW . ")");
} else {
$db->query_write("INSERT INTO " . TABLE_PREFIX . "arcade_news_scor (scortext, scortype, scorgame, scoruserid, datescor) VALUES ('" . addslashes(construct_phrase($vbphrase['x_points_in_the_y_game'], $vbulletin->userinfo['username'], $gamescornews['score'], $game['title'])) . "', 'auto', '$game[gameid]', " .$vbulletin->userinfo['userid']. ", " . TIMENOW . ")");
}
// MioTraGuSa END Modification Last Scores

Upload modified file
Enjoy!![I]
If your like this modification, please click Install (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=109239)

Sorry for my very bad english ...:nervous:

Omranic
03-01-2006, 11:59 PM
hey thanks

there is two issues
the first code error here

your code must be

// MioTraGuSa Modification Last Scores
// Fetch the latest scores.
$scorbits = '';
$scorquery = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "arcade_news_scor AS arcade_news_scor ORDER BY datescor DESC LIMIT " . $vbulletin->options['quicksearchresults']);
while ($scor = $db->fetch_array($scorquery))
{
exec_switch_bg();

// Format the score news date/time.

$scor['date'] = vbdate($vbulletin->options['logdateformat'], $scor['datescor']);
$scor['newstext'] = unhtmlspecialchars($parser->do_parse($scor['scortext'], false, true, true, false, true, false));
if ($scor['scorid'] == "1")
{
eval('$scorbits .= "' . fetch_template('arcade_scor_bit_first') . '";');
} else {
if ($scor['scorgame'] <= "1")
{
eval('$scorbits .= "' . fetch_template('arcade_scor_bit') . '";');
}
}
}
// MioTraGuSa END Modification Last Scores


notice the additional
}
at the end

if not it will give error

the second thing Is that the Last Scores menu doesn't show any thing exept "Instalation of Show last Scores - Done!!" phrase knowing that i have played some games & get in some hight scores & in some not hight score
this is my arcade (http://phpkd.com/vb/arcade.php)

Hornstar
03-02-2006, 01:57 AM
Ok great work, been waiting on some new mods for the arcade, cant wait til the actual arcade gets its next update this month.

MioTraGusa
03-02-2006, 05:27 AM
yes the code is bad .. sorry.

The code is
// MioTraGuSa Modification Last Scores
// Fetch the latest scores.
$scorbits = '';
$scorquery = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "arcade_news_scor AS arcade_news_scor ORDER BY datescor DESC LIMIT " . $vbulletin->options['quicksearchresults']);
while ($scor = $db->fetch_array($scorquery))
{
exec_switch_bg();

// Format the score news date/time.

$scor['date'] = vbdate($vbulletin->options['logdateformat'], $scor['datescor']);
$scor['newstext'] = unhtmlspecialchars($parser->do_parse($scor['scortext'], false, true, true, false, true, false));
if ($scor['scorid'] == "1")
{
eval('$scorbits .= "' . fetch_template('arcade_scor_bit_first') . '";');
} else {
eval('$scorbits .= "' . fetch_template('arcade_scor_bit') . '";');
}
}
// MioTraGuSa END Modification Last Scores

and

// MioTraGuSa Modification Last Scores
$gamescornews['score'] = sprintf((float)$game['score']);
if ($gamescornews['score'] <= 1) {
$db->query_write("INSERT INTO " . TABLE_PREFIX . "arcade_news_scor (scortext, scortype, scorgame, scoruserid, datescor) VALUES ('" . addslashes(construct_phrase($vbphrase['x_points_in_the_y_gamezero'], $vbulletin->userinfo['username'], $gamescornews['score'], $game['title'])) . "', 'auto', '$game[gameid]', " .$vbulletin->userinfo['userid']. ", " . TIMENOW . ")");
} else {
$db->query_write("INSERT INTO " . TABLE_PREFIX . "arcade_news_scor (scortext, scortype, scorgame, scoruserid, datescor) VALUES ('" . addslashes(construct_phrase($vbphrase['x_points_in_the_y_game'], $vbulletin->userinfo['username'], $gamescornews['score'], $game['title'])) . "', 'auto', '$game[gameid]', " .$vbulletin->userinfo['userid']. ", " . TIMENOW . ")");
}
// MioTraGuSa END Modification Last Scores


Updated .. sorry

test it ..

soulface
03-30-2006, 08:31 AM
its not working on 1.0.5 anymore :S

MioTraGusa
03-30-2006, 12:23 PM
its not working on 1.0.5 anymore :S

Exactly, that is what does not work? At present I have installed the version 1.05 of v3arcade and work for me.

soulface
04-06-2006, 01:03 PM
ummm its working on 1.0.6 now lol... don know whats the reason that was not working in 1.0.5 :/

MioTraGusa
04-06-2006, 05:04 PM
I don't have neither idea, because it work for my well with the version 1.0.5 .The version 1.0.6 isn't most different.:confused:

Intex
10-14-2006, 07:02 PM
How do you amend how many last scores show? At the moment, there's 10 by default and I only want to display 5.