Board3 and arcade mod by JRSweets
Forum rules
Before creating a new support thread, please take a look in the board3 Portal FAQ and use the search!
Many questions have already been answered.
Before creating a new support thread, please take a look in the board3 Portal FAQ and use the search!
Many questions have already been answered.
-
Topic author - Active Member
- Posts: 17
- Joined: 12. March 2008 14:16
- Location: Nottingham UK
- Contact:
Board3 and arcade mod by JRSweets
Hi I have JRSweets arcade mod and would like to have a block display latest stats within board 3, I have found this link by Thundercrew who made a block for phpBB3 portal and wondered what I would have to do to make this work on Board 3
http://www.phpbb.com/community/viewtopi ... k#p4786955
Any ideas....
http://www.phpbb.com/community/viewtopi ... k#p4786955
Any ideas....
Forum for Lone Parents http://www.lone-parents.net a phpbb3 Forum
-
- Site Admin
- Posts: 2989
- Joined: 7. January 2006 20:11
- phpBB.de User: Saint
- phpBB.com User: Saint_hh
- Location: Hamburg
- Contact:
Re: Board3 and arcade mod by JRSweets
At first look it seems like you could use it straight away.
Have you tried this already?
Have you tried this already?
~~~ They say the definition of madness is doing the same thing and expecting a different result ~~~
Kein Support per PN / No support via PM!
Kein Support per PN / No support via PM!
-
Topic author - Active Member
- Posts: 17
- Joined: 12. March 2008 14:16
- Location: Nottingham UK
- Contact:
Re: Board3 and arcade mod by JRSweets
Yeah! I thought same and have tried but isn't working and was wondering do I have to activate it somehow...??
Forum for Lone Parents http://www.lone-parents.net a phpbb3 Forum
-
- Site Admin
- Posts: 2989
- Joined: 7. January 2006 20:11
- phpBB.de User: Saint
- phpBB.com User: Saint_hh
- Location: Hamburg
- Contact:
Re: Board3 and arcade mod by JRSweets
Okay, let's try a little workaround.
The Code is from ThunderCrews post on phpbb.com.
*edit*
If it works we could make the template a bit nicer.
The Code is from ThunderCrews post on phpbb.com.
- create a new file in root/portal/block/ named arcade.php
Fill it with this code:Code: Select all
<?php if (!defined('IN_PHPBB') or !defined('IN_PORTAL')) { die('Hacking attempt'); exit; } if (file_exists($phpbb_root_path . 'includes/arcade/arcade_class.' . $phpEx)) { include($phpbb_root_path . 'includes/arcade/arcade_class.' . $phpEx); $arcade = new arcade(false); // Start of Top 3 Arcade Players $real_leaders_count = sizeof($arcade->leaders); $leaders_count = ($real_leaders_count > 3) ? 3 : $real_leaders_count; $arcade_leaders_img = array(); $arcade_leaders_img[0] = ''; $arcade_leaders_img[1] = $phpbb_root_path . $arcade->config['image_path'] . '1st.gif'; $arcade_leaders_img[2] = $phpbb_root_path . $arcade->config['image_path'] . '2nd.gif'; $arcade_leaders_img[3] = $phpbb_root_path . $arcade->config['image_path'] . '3rd.gif'; $arcade_leaders_img_alt = array(); $arcade_leaders_img_alt[0] = ''; $arcade_leaders_img_alt[1] = $user->lang['ARCADE_FIRST']; $arcade_leaders_img_alt[2] = $user->lang['ARCADE_SECOND']; $arcade_leaders_img_alt[3] = $user->lang['ARCADE_THIRD']; if ($leaders_count > 0) { $rank = 0; $actual_rank = 0; $previous_wins = 0; for ($i = 0; $i < $leaders_count; $i++) { //This code is used to calculate the actual rank. //For example if there are ties... $actual_rank++; if ($previous_wins != $arcade->leaders[$i]['total_wins']) { $rank = $actual_rank; } $previous_wins = $arcade->leaders[$i]['total_wins']; $user_link = $arcade->format_username('full', $arcade->leaders[$i]['user_id'], $arcade->leaders[$i]['username'], $arcade->leaders[$i]['user_colour']); $template->assign_block_vars('arcade_leaders', array( 'ARCADE_LEADERS_RANK' => $rank, 'ARCADE_LEADERS' => $user_link, 'ARCADE_LEADERS_IMAGE' => (isset($arcade_leaders_img[$rank])) ? $arcade_leaders_img[$rank] : '', 'ARCADE_LEADERS_IMAGE_ALT' => (isset($arcade_leaders_img_alt[$rank])) ? $arcade_leaders_img_alt[$rank] : '', 'VICTORIES' => $arcade->leaders[$i]['total_wins'] )); } } // End of Top 3 Arcade Players //Newest Game if (sizeof($arcade->newest_games)) { $template->assign_vars(array( 'S_HAS_NEWEST_GAME' => true, 'U_NEWEST_GAME_PLAY' => append_sid("{$phpbb_root_path}arcade.$phpEx", 'mode=play&g=' . $arcade->newest_games[0]['game_id']), 'NEWEST_GAME_IMAGE' => ($arcade->newest_games[0]['game_image'] != '') ? $phpbb_root_path . "arcade.$phpEx?img=" . $arcade->newest_games[0]['game_image'] : '', 'NEWEST_GAME_NAME' => $arcade->newest_games[0]['game_name'], )); } //Newest Game //Total Games, Time and Plays $total_games = sizeof($arcade->games); if ($total_games > 1) { $total_games = sprintf($user->lang['ARCADE_TOTAL_GAMES'], $total_games); } else if ($total_games == 1) { $total_games = sprintf($user->lang['ARCADE_TOTAL_GAME'], $total_games); } $template->assign_vars(array( 'S_DISPLAY_ARCADE' => true, 'TOTAL_GAMES_PLAYED' => ($arcade->totals['games_played']) ? sprintf($user->lang['ARCADE_TOTAL_PLAYED'], $arcade->totals['games_played'], $arcade->format_time($arcade->totals['games_time'])) : '', 'TOTAL_GAMES' => $total_games, )); //Total Games } ?>
- create a new file in root/styles/prosilver/template/portal/block/ named arcade.html
Fill it with this code:Open root/portal.phpCode: Select all
<h3>Arcade Stats</h3> <div class="panel"> <div class="inner"><span class="corners-top"><span></span></span> <div class="content"> <!-- IF S_HAS_NEWEST_GAME --> <p style="margin: 4px;"><!-- IF NEWEST_GAME_IMAGE --><a href="{U_NEWEST_GAME_PLAY}">Newest Game:<br /><img src="{NEWEST_GAME_IMAGE}" alt="{NEWEST_GAME_NAME}" width="20" height="20" style="vertical-align: middle;" /></a><!-- ENDIF --> {NEWEST_GAME_NAME}</p> <!-- ENDIF --> <!-- IF .arcade_leaders --> <br /> <div> <b>{L_ARCADE_LEADERS_HEADER}</b><br /> <!-- BEGIN arcade_leaders --> <!-- IF arcade_leaders.S_ROW_COUNT > 0 --> <!-- ENDIF --><!-- IF arcade_leaders.ARCADE_LEADERS_IMAGE --><img src="{arcade_leaders.ARCADE_LEADERS_IMAGE}" alt="{arcade_leaders.ARCADE_LEADERS_IMAGE_ALT}" style="vertical-align: middle;" /><!-- ENDIF --> {arcade_leaders.ARCADE_LEADERS_RANK}: {arcade_leaders.ARCADE_LEADERS} ({arcade_leaders.VICTORIES}) <!-- END arcade_leaders --> </div> <!-- ENDIF --> <!-- IF TOTAL_GAMES --> <br /> <p style="font-size: 12px;">{TOTAL_GAMES}<br />{TOTAL_GAMES_PLAYED}</p> <!-- ENDIF --> </div> <span class="corners-bottom"><span></span></span></div> </div>
Search for:after add:Code: Select all
if ($portal_config['portal_recent']) { include($phpbb_root_path . 'portal/block/recent.'.$phpEx); }
Code: Select all
include($phpbb_root_path . 'portal/block/arcade.'.$phpEx);
- Open root/styles/prosilver/template/portal/portal_body.html[
Search for:after add:Code: Select all
<!-- IF S_DISPLAY_MAINMENU --> <!-- INCLUDE portal/block/main_menu.html --> <!-- ENDIF -->
Code: Select all
<!-- IF S_DISPLAY_ARCADE --> <!-- INCLUDE portal/block/arcade.html --> <!-- ENDIF -->
*edit*
If it works we could make the template a bit nicer.
~~~ They say the definition of madness is doing the same thing and expecting a different result ~~~
Kein Support per PN / No support via PM!
Kein Support per PN / No support via PM!
Re: Board3 and arcade mod by JRSweets
get error with portal.php
Fatal error: Cannot redeclare class arcade in /srv/www/httpd/phost/d/com/pytalhost/dienstagstruppe/web/includes/arcade/arcade_class.php on line 24
Fatal error: Cannot redeclare class arcade in /srv/www/httpd/phost/d/com/pytalhost/dienstagstruppe/web/includes/arcade/arcade_class.php on line 24
-
- Site Admin
- Posts: 2989
- Joined: 7. January 2006 20:11
- phpBB.de User: Saint
- phpBB.com User: Saint_hh
- Location: Hamburg
- Contact:
Re: Board3 and arcade mod by JRSweets
Hm, try removing this line from the arcade.php
Code: Select all
include($phpbb_root_path . 'includes/arcade/arcade_class.' . $phpEx);
~~~ They say the definition of madness is doing the same thing and expecting a different result ~~~
Kein Support per PN / No support via PM!
Kein Support per PN / No support via PM!
Re: Board3 and arcade mod by JRSweets
Fatal error: Class 'arcade' not found in /srv/www/httpd/phost/d/com/pytalhost/dienstagstruppe/web/portal/block/arcade.php on line 11
-
Topic author - Active Member
- Posts: 17
- Joined: 12. March 2008 14:16
- Location: Nottingham UK
- Contact:
Re: Board3 and arcade mod by JRSweets
Okay I did it... and is cool...really wanted this block.
Will do my best to explain how but warn you I have not done any coding and work purely on logic...
If I make a mistake please point it out as it helps in the learning process...
lets start with arcade.php
create a new file in root/portal/block/ named arcade.php
Fill it with this code:
create a new file in root/styles/prosilver/template/portal/block/ named arcade.html
Fill it with this code:
Now go to styles/prosilver/template/portal/portal_body.html
and find
Add after on a new line
Now this is the bit that I figured out
open up: includes/acp/acp_portal.php
and find
Add before on a new line:
Open up: language/en/mods/lang_portal_acp.php
and find
After on a new line add
Now open up portal.php
and find
add after on a new line
Okay thats the code part done.
now go to acp and refresh your styles template
then go to Admin control panel/mods/portal and enter portal general settings click box to display arcade... and submit
Thats it should work and is working on mine...
let me know ok
Will do my best to explain how but warn you I have not done any coding and work purely on logic...
If I make a mistake please point it out as it helps in the learning process...
lets start with arcade.php
create a new file in root/portal/block/ named arcade.php
Fill it with this code:
Code: Select all
<?php
if (!defined('IN_PHPBB') or !defined('IN_PORTAL'))
{
die('Hacking attempt');
exit;
}
if (file_exists($phpbb_root_path . 'includes/arcade/arcade_class.' . $phpEx))
{
include($phpbb_root_path . 'includes/arcade/arcade_class.' . $phpEx);
$arcade = new arcade(false);
// Start of Top 3 Arcade Players
$real_leaders_count = sizeof($arcade->leaders);
$leaders_count = ($real_leaders_count > 3) ? 3 : $real_leaders_count;
$arcade_leaders_img = array();
$arcade_leaders_img[0] = '';
$arcade_leaders_img[1] = $phpbb_root_path . $arcade->config['image_path'] . '1st.gif';
$arcade_leaders_img[2] = $phpbb_root_path . $arcade->config['image_path'] . '2nd.gif';
$arcade_leaders_img[3] = $phpbb_root_path . $arcade->config['image_path'] . '3rd.gif';
$arcade_leaders_img_alt = array();
$arcade_leaders_img_alt[0] = '';
$arcade_leaders_img_alt[1] = $user->lang['ARCADE_FIRST'];
$arcade_leaders_img_alt[2] = $user->lang['ARCADE_SECOND'];
$arcade_leaders_img_alt[3] = $user->lang['ARCADE_THIRD'];
if ($leaders_count > 0)
{
$rank = 0;
$actual_rank = 0;
$previous_wins = 0;
for ($i = 0; $i < $leaders_count; $i++)
{
//This code is used to calculate the actual rank.
//For example if there are ties...
$actual_rank++;
if ($previous_wins != $arcade->leaders[$i]['total_wins'])
{
$rank = $actual_rank;
}
$previous_wins = $arcade->leaders[$i]['total_wins'];
$user_link = $arcade->format_username('full', $arcade->leaders[$i]['user_id'], $arcade->leaders[$i]['username'], $arcade->leaders[$i]['user_colour']);
$template->assign_block_vars('arcade_leaders', array(
'ARCADE_LEADERS_RANK' => $rank,
'ARCADE_LEADERS' => $user_link,
'ARCADE_LEADERS_IMAGE' => (isset($arcade_leaders_img[$rank])) ? $arcade_leaders_img[$rank] : '',
'ARCADE_LEADERS_IMAGE_ALT' => (isset($arcade_leaders_img_alt[$rank])) ? $arcade_leaders_img_alt[$rank] : '',
'VICTORIES' => $arcade->leaders[$i]['total_wins']
));
}
}
// End of Top 3 Arcade Players
//Newest Game
if (sizeof($arcade->newest_games))
{
$template->assign_vars(array(
'S_HAS_NEWEST_GAME' => true,
'U_NEWEST_GAME_PLAY' => append_sid("{$phpbb_root_path}arcade.$phpEx", 'mode=play&g=' . $arcade->newest_games[0]['game_id']),
'NEWEST_GAME_IMAGE' => ($arcade->newest_games[0]['game_image'] != '') ? $phpbb_root_path . "arcade.$phpEx?img=" . $arcade->newest_games[0]['game_image'] : '',
'NEWEST_GAME_NAME' => $arcade->newest_games[0]['game_name'],
));
}
//Newest Game
//Total Games, Time and Plays
$total_games = sizeof($arcade->games);
if ($total_games > 1)
{
$total_games = sprintf($user->lang['ARCADE_TOTAL_GAMES'], $total_games);
}
else if ($total_games == 1)
{
$total_games = sprintf($user->lang['ARCADE_TOTAL_GAME'], $total_games);
}
$template->assign_vars(array(
'S_DISPLAY_ARCADE' => true,
'TOTAL_GAMES_PLAYED' => ($arcade->totals['games_played']) ? sprintf($user->lang['ARCADE_TOTAL_PLAYED'], $arcade->totals['games_played'], $arcade->format_time($arcade->totals['games_time'])) : '',
'TOTAL_GAMES' => $total_games,
));
//Total Games
}
?>
Fill it with this code:
Code: Select all
<h3>Arcade Stats</h3>
<div class="panel">
<div class="inner"><span class="corners-top"><span></span></span>
<div class="content">
<!-- IF S_HAS_NEWEST_GAME -->
<p style="margin: 4px;"><!-- IF NEWEST_GAME_IMAGE --><a href="{U_NEWEST_GAME_PLAY}">Newest Game:<br /><img src="{NEWEST_GAME_IMAGE}" alt="{NEWEST_GAME_NAME}" width="20" height="20" style="vertical-align: middle;" /></a><!-- ENDIF --> {NEWEST_GAME_NAME}</p>
<!-- ENDIF -->
<!-- IF .arcade_leaders -->
<br />
<div>
<b>{L_ARCADE_LEADERS_HEADER}</b><br />
<!-- BEGIN arcade_leaders -->
<!-- IF arcade_leaders.S_ROW_COUNT > 0 --> <!-- ENDIF --><!-- IF arcade_leaders.ARCADE_LEADERS_IMAGE --><img src="{arcade_leaders.ARCADE_LEADERS_IMAGE}" alt="{arcade_leaders.ARCADE_LEADERS_IMAGE_ALT}" style="vertical-align: middle;" /><!-- ENDIF --> {arcade_leaders.ARCADE_LEADERS_RANK}: {arcade_leaders.ARCADE_LEADERS} ({arcade_leaders.VICTORIES})
<!-- END arcade_leaders -->
</div>
<!-- ENDIF -->
<!-- IF TOTAL_GAMES -->
<br />
<p style="font-size: 12px;">{TOTAL_GAMES}<br />{TOTAL_GAMES_PLAYED}</p>
<!-- ENDIF -->
</div>
<span class="corners-bottom"><span></span></span></div>
</div>
and find
Code: Select all
<!-- IF not S_IS_BOT and S_USER_LOGGED_IN and S_ZEBRA_ENABLED and S_DISPLAY_FRIENDS -->
<!-- INCLUDE portal/block/online_friends.html -->
<!-- ENDIF -->
Code: Select all
<!-- IF S_DISPLAY_ARCADE -->
<!-- INCLUDE portal/block/arcade.html -->
<!-- ENDIF -->
open up: includes/acp/acp_portal.php
and find
Code: Select all
'portal_clock' => array('lang' => 'PORTAL_CLOCK' , 'validate' => 'bool' , 'type' => 'radio:yes_no' , 'explain' => true),
Code: Select all
'portal_arcade' => array('lang' => 'PORTAL_ARCADE' , 'validate' => 'bool' , 'type' => 'radio:yes_no' , 'explain' => true),
and find
Code: Select all
'PORTAL_LEADERS_EXPLAIN' => 'Display this block on portal.',
Code: Select all
'PORTAL_ARCADE' => 'Arcade block',
'PORTAL_ARCADE_EXPLAIN' => 'Display this block on portal.',
and find
Code: Select all
if ($portal_config['portal_change_style'])
{
include($phpbb_root_path . 'portal/block/change_style.'.$phpEx);
}
Code: Select all
if ($portal_config['portal_arcade'])
{
include($phpbb_root_path . 'portal/block/arcade.'.$phpEx);
$template->assign_vars(array(
'S_DISPLAY_ARCADE' => true,
));
}
now go to acp and refresh your styles template
then go to Admin control panel/mods/portal and enter portal general settings click box to display arcade... and submit
Thats it should work and is working on mine...
let me know ok
Forum for Lone Parents http://www.lone-parents.net a phpbb3 Forum
Re: Board3 and arcade mod by JRSweets
when i enable arcade-block in acp - portal i get the error :
Fatal error: Cannot redeclare class arcade in /srv/www/httpd/phost/d/com/pytalhost/dienstagstruppe/web/includes/arcade/arcade_class.php on line 24
Part of arcade_class.php
......
class arcade
{ *
var $config = array();
var $games = array();
var $cats = array();
var $users
......
* = line 24
@lonepare
i saw your tabs ( Portal - Main Forum - About Us ) in your portal , is it a MOD ?
Fatal error: Cannot redeclare class arcade in /srv/www/httpd/phost/d/com/pytalhost/dienstagstruppe/web/includes/arcade/arcade_class.php on line 24
Part of arcade_class.php
......
class arcade
{ *
var $config = array();
var $games = array();
var $cats = array();
var $users
......
* = line 24
@lonepare
i saw your tabs ( Portal - Main Forum - About Us ) in your portal , is it a MOD ?
-
Topic author - Active Member
- Posts: 17
- Joined: 12. March 2008 14:16
- Location: Nottingham UK
- Contact:
Re: Board3 and arcade mod by JRSweets
Am not sure what that is...maybe Kevin can help here as am just a newb.... am using JRSweets Arcade 0.4.5 and is working on my portal.... I have only followed the code I have displayed in my last post...when i enable arcade-block in acp - portal i get the error :
Fatal error: Cannot redeclare class arcade in /srv/www/httpd/phost/d/com/pytalhost/dienstagstruppe/web/includes/arcade/arcade_class.php on line 24
Part of arcade_class.php
......
class arcade
{ *
var $config = array();
var $games = array();
var $cats = array();
var $users
......
* = line 24
The tabs are from the easy menu mod and will get you the link if you hang tight....@lonepare
i saw your tabs ( Portal - Main Forum - About Us ) in your portal , is it a MOD ?
Forum for Lone Parents http://www.lone-parents.net a phpbb3 Forum
-
Topic author - Active Member
- Posts: 17
- Joined: 12. March 2008 14:16
- Location: Nottingham UK
- Contact:
Re: Board3 and arcade mod by JRSweets
:derkubi
http://www.phpbb.com/community/viewtopi ... ilver+menu
Here you go this is where you will find the easy menu styles...@lonepare
i saw your tabs ( Portal - Main Forum - About Us ) in your portal , is it a MOD ?
http://www.phpbb.com/community/viewtopi ... ilver+menu
Forum for Lone Parents http://www.lone-parents.net a phpbb3 Forum
Re: Board3 and arcade mod by JRSweets
Hmmm funny cause i have this in overall_header for tabs , but i can only see them on forum-index , not in portal !?!
Code: Select all
<div id="tabs">
<ul>
<li<!-- IF basename($_SERVER['SCRIPT_NAME']) == 'portal.php' --> class="activetab"<!-- ENDIF -->><a href="{U_PORTAL}"><span>{L_PORTAL}</span></a></li>
<li<!-- IF basename($_SERVER['SCRIPT_NAME']) == 'index.php' or basename($_SERVER['SCRIPT_NAME']) == 'viewforum.php' or basename($_SERVER['SCRIPT_NAME']) == 'viewtopic.php' --> class="activetab"<!-- ENDIF -->><a href="{U_INDEX}"><span>{L_INDEX}</span></a></li>
<li<!-- IF basename($_SERVER['SCRIPT_NAME']) == 'gallery/index.php' --> class="activetab"<!-- ENDIF -->><a href="{U_GALLERY_MOD}"><span>Fotogalerie</span></a></li>
<li<!-- IF basename($_SERVER['SCRIPT_NAME']) == 'arcade.php' --> class="activetab"<!-- ENDIF -->><a href="{U_ARCADE}"<span>Spiele</span></a></li>
<li<!-- IF basename($_SERVER['SCRIPT_NAME']) == 'calendar.php' --> class="activetab"<!-- ENDIF -->><a href="calendar.php"<span>Kalender</span></a></li>
<!-- IF S_DISPLAY_SEARCH --><li<!-- IF basename($_SERVER['SCRIPT_NAME']) == 'search.php' --> class="activetab"<!-- ENDIF -->><a href="{U_SEARCH}" title="{L_SEARCH_ADV_EXPLAIN}"><span>{L_SEARCH}</span></a></li><!-- ENDIF -->
<!-- IF S_DISPLAY_MEMBERLIST --><li<!-- IF basename($_SERVER['SCRIPT_NAME']) == 'memberlist.php' --> class="activetab"<!-- ENDIF -->><a href="{U_MEMBERLIST}" title="{L_MEMBERLIST_EXPLAIN}"><span>{L_MEMBERLIST}</span></a></li><!-- ENDIF -->
<li<!-- IF basename($_SERVER['SCRIPT_NAME']) == 'faq.php' --> class="activetab"<!-- ENDIF -->><a href="{U_FAQ}" title="{L_FAQ_EXPLAIN}"><span>{L_FAQ}</span></a></li>
</ul>
</div>
-
Topic author - Active Member
- Posts: 17
- Joined: 12. March 2008 14:16
- Location: Nottingham UK
- Contact:
Re: Board3 and arcade mod by JRSweets
Not sure what it is you are asking.... had some teething problems with my intergration of portal, which was kindly resolved here http://www.phpbb.com/community/viewtopi ... 5#p4614725 which might be of help to you.derkubi wrote:Hmmm funny cause i have this in overall_header for tabs , but i can only see them on forum-index , not in portal !?!
Code: Select all
Forum for Lone Parents http://www.lone-parents.net a phpbb3 Forum
Re: Board3 and arcade mod by JRSweets
Klick on my website-button ->lonepare wrote:Not sure what it is you are asking....
You have TABs on Portal AND Index , i have TABs on Index want them on Portal too ... but not sooo important .
-
Topic author - Active Member
- Posts: 17
- Joined: 12. March 2008 14:16
- Location: Nottingham UK
- Contact:
Re: Board3 and arcade mod by JRSweets
Yes thought that was what you were asking and posted a link which shows you how to display your tab menu (nav) in portal.... here is link to the part that tells you... please read.. http://www.phpbb.com/community/viewtopi ... 0#p4619435 ..hope that helps you.derkubi wrote:Klick on my website-button ->lonepare wrote:Not sure what it is you are asking....
You have TABs on Portal AND Index , i have TABs on Index want them on Portal too ... but not sooo important .
kindest regards
Micheal.
Forum for Lone Parents http://www.lone-parents.net a phpbb3 Forum