frold wrote:CocoVFR wrote:An other question.
How can i make enable/disable the calendar (not mini_cal) in the ACP ?
You are not able to do so - this is a dirty hack
I think i've done this, but if someone can say if i am totally right. (i'm a noob in phpbb and modding, but i know well php. This snippets work well for me, so...)
So, that's i have done:
First, i've apply the snippets from frold (in first post).
In adm/acp/info/acp_portal.php
After:
Code: Select all
'minicalendar' => array('title' => 'ACP_PORTAL_MINICALENDAR_INFO', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')),
add:
Code: Select all
'calendarevent' => array('title' => 'ACP_PORTAL_CALENDAR_EVENT_INFO', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')),
In Langage/fr/Mods/lang_portal_acp.php
After
Code: Select all
'PORTAL_VIEW_PERS_ALBUMS' => 'Voir les images des albums personnels ?',
Add
Code: Select all
'ACP_PORTAL_CALENDAR_EVENT_INFO' => 'Calendrier des evenements',
'ACP_PORTAL_CALENDAR_EVENT_SETTINGS' => 'Parametres du calendrier des evenements',
'PORTAL_CALENDAR_EVENT' => 'Afficher ce bloc sur le portail',
'MINI_CAL_CALENDAR' => 'Calendrier evenement',
In include/acp/acp_portal.php
After
Code: Select all
case 'minicalendar':
$display_vars = array(
'title' => 'ACP_PORTAL_MINICALENDAR_SETTINGS',
'vars' => array(
'legend1' => 'ACP_PORTAL_MINICALENDAR_SETTINGS',
'portal_minicalendar' => array('lang' => 'PORTAL_MINICALENDAR' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'portal_minicalendar_today_color' => array('lang' => 'PORTAL_MINICALENDAR_TODAY_COLOR' , 'validate' => 'string', 'type' => 'text:10:10', 'explain' => true),
'portal_minicalendar_day_link_color' => array('lang' => 'PORTAL_MINICALENDAR_DAY_LINK_COLOR' , 'validate' => 'string', 'type' => 'text:10:10', 'explain' => true),
)
);
break;
Add
Code: Select all
case 'calendarevent':
$display_vars = array(
'title' => 'ACP_PORTAL_CALENDAR_EVENT_SETTINGS',
'vars' => array(
'legend1' => 'ACP_PORTAL_CALENDAR_EVENT_SETTINGS',
'portal_calendar_event' => array('lang' => 'PORTAL_CALENDAR_EVENT' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
)
);
break;
In root/Portal.php
After
Code: Select all
if ($portal_config['portal_change_style'])
{
include($phpbb_root_path . 'portal/block/change_style.'.$phpEx);
}
ADD
Code: Select all
if ($portal_config['portal_calendar_event'])
{
include($phpbb_root_path . 'portal/block/calendar.'.$phpEx);
}
In root/portal/block/calendar.php
AFTER
Code: Select all
'U_CALENDAR' => append_sid("{$phpbb_root_path}calendar.$phpEx"),
ADD
Code: Select all
'S_DISPLAY_CALENDAR_EVENT' => true,
In root/styles/prosilver/template/portal/portal_body.html
ADD
Code: Select all
<!-- IF S_DISPLAY_CALENDAR_EVENT -->
<!-- INCLUDE portal/block/calendar.html -->
<!-- ENDIF -->
In where you want your block appear. (right block, left bloc or center block
In your database, execute this sql query:
Code: Select all
INSERT INTO xxxxx_portal_config VALUES("portal_calendar_event","1");
where xxxxx is the extension of your phpbb database table.
Go to ACP, and add a new module in portal bloc settings, and add "ACP_PORTAL_CALENDAR_EVENT_INFO" module.
That's all.
Now, in your ACP, you can display or not the "calendar event".
Any comment ? It's works for me, but perhaps, i've make some error, and/or i've forget someting ?