Page 1 of 1

Custon Block ACP

Posted: 16. February 2013 19:07
by talonos
Your Portal Version: 2.0.1
Your phpBB Type: Standard phpBB3
MODs installed: Yes
Your knowledge: Advanced Knowledge
Boardlink: http://demo.pretereo-stormrage.co.uk/board2

What have you done before the problem was there?
Created a new module using the template system from the knowledge base.

What have you already tryed to solve the problem?
knowledgeboard with no prevail and also internet research still with no luck

Description and Message
Created a new portal module with acp. if i use

Code: Select all

	public function install($module_id)
	{
		set_config('board3_wowheroesregion_' . $module_id, 'eu');
		set_config('board3_wowheroesrealm_' . $module_id, 'stormrage');
		set_config('board3_wowheroesguild_' . $module_id, 'pretereo');
		return true;
	}
in the module it will work without problems.

trying to change them settings from ACP is not working at all.

here a snippet of my acp file.

Code: Select all

<form id="acp_portal_wowheroes" method="post" action="{U_ACTION}">


		
	<fieldset>
              <legend>{L_PORTAL_WOWHEROES_TITLE}</legend>
			  
		<dl>
			<dt><label>{L_WOWHEROES_REGION}:</label><br />{L_WOWHEROES_REGION_EXPLAIN}</dt>
			<dd><input maxlength="3" size="3" type="text" name="wowregion" id="wowregion" value="{WOWREGION}"/>
		</dl>
        <dl>
			<dt><label>{L_WOWHEROES_REALM}:</label><br />{L_WOWHEROES_REALM_EXPLAIN}</dt>
			<dd><input maxlength="30" size="30" type="text" name="wowrealm" id="wowrealm" value="{WOWREALM}"/>
		</dl>
		<dl>
			<dt><label>{L_WOWHEROES_GUILD}:</label><br />{L_WOWHEROES_GUILD_EXPLAIN}</dt>
			<dd><input maxlength="30" size="30" type="text" name="wowguild" id="wowguild" value="{WOWGUILD}"/>
		</dl>
       
	<p class="submit-buttons">
		<input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp;
		<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
	</p>
	{S_FORM_TOKEN}
	</fieldset>
	</form>
the {WOW*****} values are set in the module file like so

Code: Select all

	public function get_template_side($module_id)
	{
		global $config, $template;

		$template->assign_vars(array(
			'WOWREGION'			=> $config['board3_wowheroesregion_' . $module_id],
			'WOWREALM'			=> $config['board3_wowheroesrealm_' . $module_id],
			'WOWGUILD'			=> $config['board3_wowheroesguild_' . $module_id],
		));

		return 'wowheroes.html';
	}
please could i get some help on this as once i've worked out what the problem is i can start converting allot of my old 1.0.6 mods over to 2.0.1[/i]

Re: Custon Block ACP

Posted: 17. February 2013 12:03
by Marc
You don't need an extra HTML file for the acp settings. Just set get_template_acp() to what you need (similar to this):

Code: Select all

	public function get_template_acp($module_id)
	{
		return array(
			'title'	=> 'ACP_PORTAL_WOWHEROES_SETTINGS',
			'vars'	=> array(
				'legend1'							=> 'ACP_PORTAL_WOWHEROES_SETTINGS',
				'board3_wowheroesregion_' . $module_id					=> array('lang' => 'PORTAL_WOWHEROES_REGION',	'validate' => 'string',		'type' => 'text:15:30',	'explain' => true),
			)
		);
	}
Function get_template_side() is for the actual output in the side columns of the portal and not for the ACP (hence the name).

Re: Custon Block ACP

Posted: 17. February 2013 15:11
by talonos
ahh ok so thats where my problem was. thanks for that Marc it works great now :)