Need Help with ACP Portion of a Block

Post Reply

Topic author
Darkicon
Active Member
Posts: 2
Joined: 15. September 2009 19:58
phpBB.com User: Darkicon

Need Help with ACP Portion of a Block

Post by Darkicon »

I'm making a donator block for my portal. It's basically finished so now I'm working on making it modifiable via the ACP.

In language/en/mods/ I made a file called donor_test.php which has:

Code: Select all

<?php
/**
*
* @package acp
* @version $Id: donor_test.php,v 1.0.0 2009/17/09 13:35 Havok   $
* @copyright (c) 2009 Serious Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
if (!defined('IN_PHPBB'))
{
	exit;
}
if (empty($lang) || !is_array($lang))
{
	$lang = array();
}

$lang = array_merge($lang, array(
	// Donor Block
	'ACP_PORTAL_DONOR_INFO'		=> 'Donor',
	'ACP_DONOR_INFO'			=> 'Donor',
	'ACP_DONOR_SETTINGS'			=> 'Donor block settings',
	'ACP_DONOR_SETTINGS_EXPLAIN'		=> 'Here you can change the status of the donor block.',
	'ACP_DONOR_BLOCK_SETTINGS'		=> 'Donor block display settings',
	'PORTAL_DISPLAY_DONOR'		=> 'Display Donor Block',
	'PORTAL_DISPLAY_DONOR_EXPLAIN'	=> 'Display the donor block on your portal.',
	'PORTAL_DONOR_GOAL'			=> 'Monthly Goal',
	'PORTAL_DONOR_GOAL_EXPLAIN'		=> 'Your monthly donation goal.',
	'PORTAL_DONOR_DATE'			=> 'Due date',
	'PORTAL_DONOR_DATE_EXPLAIN'		=> 'Your monthly goal due date.',
	'PORTAL_DONOR_TOTAL_OVER		=> 'Total earnings',
	'PORTAL_DONOR_TOTAL_OVER_EXPLAIN	=> 'Your total earnings for the month.',
));

?>
In my root folder, I edited portal.php and added:

Code: Select all

if ($config['portal_donor'])
{
	$template->assign_vars(array(
		'S_DISPLAY_DONOR' => true,
		'PORTAL_DONOR_GOAL'	=> $config['portal_donor_goal'],
		'PORTAL_DONOR_DATE'	=> $config['portal_donor_date'],
		'PORTAL_DONOR_TOTAL_OVER'	=> $config['portal_donor_total_over'],
	));
}
In portal/block I made donor.php which has:

Code: Select all

<?php
/*
*
* @version $Id: donor.php,v 1.0.0 2009/17/09 13:35 Havok $
* @copyright (c) 2009 Serious Grouo
* @license http://opensource.org/licenses/gpl-license.php GNU Public License 
*
*/
if (!defined('IN_PHPBB') or !defined('IN_PORTAL'))
{
	die('Hacking attempt');
	exit;
}

/**
*/

$template->assign_vars(array(
	'S_DISPLAY_DONOR' => true,
));

?>
In includes/acp I edited acp_portal.php and added:

Code: Select all

         case 'donormod':
            $display_vars = array(
               'title'   => 'ACP_PORTAL_DONOR_SETTINGS',
               'vars'   => array(
	              'legend1'                     		=> 'ACP_PORTAL_DONOR_SETTINGS',
             	  'portal_display_donor'               	=> array('lang' => 'PORTAL_DISPLAY_DONOR'             ,   'validate' => 'bool',  	'type' => 'radio:yes_no',   'explain' => true),
                  'portal_donor_goal'           	=> array('lang' => 'PORTAL_DONOR_GOAL'         ,   'validate' => 'string',   	'type' => 'textarea:1:1',       'explain' => true),
             	  'portal_donor_date'        	=> array('lang' => 'PORTAL_DONOR_DATE'      ,   'validate' => 'string',   	'type' => 'textarea:1:1',       'explain' => true),
             	  'portal_donor_total_over'           	=> array('lang' => 'PORTAL_DONOR_TOTAL_OVER'         ,   'validate' => 'string',   	'type' => 'textarea:1:1',       'explain' => true),
               )
            );
         break;
In includes/acp/info I edited acp_portal.php and added:

Code: Select all

				'donormod'	=> array('title' => 'ACP_DONOR_INFO', 'auth' => 'acl_a_board', 'cat' => array('ACP_DONOR_CONFIGURATION')),

And of course I made the necessary edits to styles/prosilver/template/portal/portal_body.html and put the block's html file in styles/prosilver/template/portal/block/.


My problem is in the ACP it displays the settings like:

PORTAL_DISPLAY_DONOR:
PORTAL_DONOR_GOAL:
etc...

Rather than what I set it to in donor_test.php in the mods folder.

I also added the ACP stuff to the Portal Administration part of the Portal ACP, they show up like that, but the custom section for the block does not show up in the ACP at all.

Did I forget something or do something wrong or what?

Thanks and sorry for this being so sloppy, lol.

Teksonic
Portal Enthusiast
Posts: 142
Joined: 4. June 2009 21:50
phpBB.com User: Teksonic
Contact:

Re: Need Help with ACP Portion of a Block

Post by Teksonic »

the language file for the acp is different then the one for the board. this is the portal's lang file. lang_portal.php this is the portal's acp lang file lang_portal_acp.php

you will notice a line at the top of the acp_portal.php file

Code: Select all

$user->add_lang('mods/lang_portal_acp');
this tells the acp where to look for it's languages. put your stuff in that file and it will work. but remember as of the new version of board 3 you should be adding mods according to the guidelines listed here

viewtopic.php?f=9&t=1851

which basically say's don't edit any of the portal's base files. create new files and include them.
Cylithina - Undead Warlock (Retired)
Guild - Iron Circle
Server - Llane

My mods are available at http://www.teksonicmods.com
Post Reply

Return to “Modifications Support”