News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Forum - Info Center

Started by SNAFU0185, July 19, 2009, 09:06:09 AM

Previous topic - Next topic

Herman's Mixen

just before you call template_info_center(); copy the function template_info_center() from boardindex.template.php


function template_info_center()
{
global $context, $settings, $options, $txt, $scripturl, $modSettings;

// Info center collapse object.
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
// And create the info center object.
var infoHeader = new smfToggle("upshrinkIC", ', empty($options['collapse_header_ic']) ? 'false' : 'true', ');
infoHeader.useCookie(', $context['user']['is_guest'] ? 1 : 0, ');
infoHeader.setOptions("collapse_header_ic", "', $context['session_id'], '");
infoHeader.addToggleImage("upshrink_ic", "/collapse.gif", "/expand.gif");
infoHeader.addTogglePanel("upshrinkHeaderIC");
// ]]></script>';

// Here's where the "Info Center" starts...
echo '
<div class="tborder clearfix" id="infocenterframe">
<h3 class="catbg headerpadding">
<a href="#" onclick="infoHeader.toggle(); return false;"><img id="upshrink_ic" src="', $settings['images_url'], '/', empty($options['collapse_header_ic']) ? 'collapse.gif' : 'expand.gif', '" alt="*" title="', $txt['upshrink_description'], '" style="margin-right: 2ex;" align="right" /></a>
', sprintf($txt['info_center_title'], $context['forum_name_html_safe']), '
</h3>
<div id="upshrinkHeaderIC"', empty($options['collapse_header_ic']) ? '' : ' style="display: none;"', '>';

// This is the "Recent Posts" bar.
if (!empty($settings['number_recent_posts']))
{
echo '
<div class="infocenter_section">
<h4 class="headerpadding titlebg">', $txt['recent_posts'], '</h4>
<div class="windowbg">
<p class="section">
<a href="', $scripturl, '?action=recent"><img src="', $settings['images_url'], '/post/xx.gif" alt="', $txt['recent_posts'], '" /></a>
</p>
<div class="windowbg2 sectionbody hslice clearfix" id="recent_posts_content"><div class="entry-title" style="display: none;">', $context['forum_name_html_safe'], ' - ', $txt['recent_posts'], '</div><div class="entry-content" style="display: none;"><a rel="feedurl" href="', $scripturl, '?action=.xml;type=webslice">', $txt['subscribe_webslice'], '</a></div>';

// Only show one post.
if ($settings['number_recent_posts'] == 1)
{
// latest_post has link, href, time, subject, short_subject (shortened with...), and topic. (its id.)
echo '
<strong><a href="', $scripturl, '?action=recent">', $txt['recent_posts'], '</a></strong>
<p id="infocenter_onepost" class="smalltext">
', $txt['recent_view'], ' &quot;', $context['latest_post']['link'], '&quot; ', $txt['recent_updated'], ' (', $context['latest_post']['time'], ')<br />
</p>';
}
// Show lots of posts.
elseif (!empty($context['latest_posts']))
{
echo '
<dl id="infocenter_recentposts" class="middletext">';

/* Each post in latest_posts has:
board (with an id, name, and link.), topic (the topic's id.), poster (with id, name, and link.),
subject, short_subject (shortened with...), time, link, and href. */
foreach ($context['latest_posts'] as $post)
echo '
<dt><strong>', $post['link'], '</strong> ', $txt['by'], ' ', $post['poster']['link'], ' (', $post['board']['link'], ')</dt>
<dd>', $post['time'], '</dd>';
echo '
</dl>';
}
echo '
</div>
</div>
</div>';
}

// Show information about events, birthdays, and holidays on the calendar.
if ($context['show_calendar'])
{
echo '
<div class="infocenter_section">
<h4 class="headerpadding titlebg">', $context['calendar_only_today'] ? $txt['calendar_today'] : $txt['calendar_upcoming'], '</h4>
<div class="windowbg">
<p class="section">
<a href="', $scripturl, '?action=calendar' . '"><img src="', $settings['images_url'], '/icons/calendar.gif', '" alt="', $context['calendar_only_today'] ? $txt['calendar_today'] : $txt['calendar_upcoming'], '" /></a>
</p>
<div class="sectionbody windowbg2 middletext">';

// Holidays like "Christmas", "Chanukah", and "We Love [Unknown] Day" :P.
if (!empty($context['calendar_holidays']))
echo '
<span class="holiday">', $txt['calendar_prompt'], ' ', implode(', ', $context['calendar_holidays']), '</span><br />';

// People's birthdays. Like mine. And yours, I guess. Kidding.
if (!empty($context['calendar_birthdays']))
{
echo '
<span class="birthday">', $context['calendar_only_today'] ? $txt['birthdays'] : $txt['birthdays_upcoming'], '</span> ';
/* Each member in calendar_birthdays has:
id, name (person), age (if they have one set?), is_last. (last in list?), and is_today (birthday is today?) */
foreach ($context['calendar_birthdays'] as $member)
echo '
<a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['is_today'] ? '<b>' : '', $member['name'], $member['is_today'] ? '</b>' : '', isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] ? '<br />' : ', ';
}
// Events like community get-togethers.
if (!empty($context['calendar_events']))
{
echo '
<span class="event">', $context['calendar_only_today'] ? $txt['events'] : $txt['events_upcoming'], '</span> ';
/* Each event in calendar_events should have:
title, href, is_last, can_edit (are they allowed?), modify_href, and is_today. */
foreach ($context['calendar_events'] as $event)
echo '
', $event['can_edit'] ? '<a href="' . $event['modify_href'] . '" style="color: #FF0000;">*</a> ' : '', $event['href'] == '' ? '' : '<a href="' . $event['href'] . '">', $event['is_today'] ? '<b>' . $event['title'] . '</b>' : $event['title'], $event['href'] == '' ? '' : '</a>', $event['is_last'] ? '<br />' : ', ';

// Show a little help text to help them along ;).
if ($context['calendar_can_edit'])
echo '
(<a href="', $scripturl, '?action=helpadmin;help=calendar_how_edit" onclick="return reqWin(this.href);">', $txt['calendar_how_edit'], '</a>)';
}
echo '
</div>
</div>
</div>';
}


// Show statistical style information...
if ($settings['show_stats_index'])
{
echo '
<div class="infocenter_section">
<h4 class="headerpadding titlebg">', $txt['forum_stats'], '</h4>
<div class="windowbg">
<p class="section">
<a href="', $scripturl, '?action=stats"><img src="', $settings['images_url'], '/icons/info.gif" alt="', $txt['forum_stats'], '" /></a>
</p>
<div class="windowbg2 sectionbody middletext">
', $context['common_stats']['total_posts'], ' ', $txt['posts_made'], ' ', $txt['in'], ' ', $context['common_stats']['total_topics'], ' ', $txt['topics'], ' ', $txt['by'], ' ', $context['common_stats']['total_members'], ' ', $txt['members'], '. ', !empty($settings['show_latest_member']) ? $txt['latest_member'] . ': <b> ' . $context['common_stats']['latest_member']['link'] . '</b>' : '', '<br />
', (!empty($context['latest_post']) ? $txt['latest_post'] . ': <b>&quot;' . $context['latest_post']['link'] . '&quot;</b>  ( ' . $context['latest_post']['time'] . ' )<br />' : ''), '
<a href="', $scripturl, '?action=recent">', $txt['recent_view'], '</a>', $context['show_stats'] ? '<br />
<a href="' . $scripturl . '?action=stats">' . $txt['more_stats'] . '</a>' : '', '
</div>
</div>
</div>';
}

// "Users online" - in order of activity.
echo '
<div class="infocenter_section">
<h4 class="headerpadding titlebg">', $txt['online_users'], '</h4>
<div class="windowbg">
<p class="section">
', $context['show_who'] ? '<a href="' . $scripturl . '?action=who' . '">' : '', '<img src="', $settings['images_url'], '/icons/online.gif', '" alt="', $txt['online_users'], '" />', $context['show_who'] ? '</a>' : '', '
</p>
<div class="windowbg2 sectionbody">
', $context['show_who'] ? '<a href="' . $scripturl . '?action=who">' : '', $context['num_guests'], ' ', $context['num_guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ' . $context['num_users_online'], ' ', $context['num_users_online'] == 1 ? $txt['user'] : $txt['users'];

// Handle hidden users and buddies.
$bracketList = array();
if ($context['show_buddies'])
$bracketList[] = $context['num_buddies'] . ' ' . ($context['num_buddies'] == 1 ? $txt['buddy'] : $txt['buddies']);
if (!empty($context['num_spiders']))
$bracketList[] = $context['num_spiders'] . ' ' . ($context['num_spiders'] == 1 ? $txt['spider'] : $txt['spiders']);
if (!empty($context['num_users_hidden']))
$bracketList[] = $context['num_users_hidden'] . ' ' . $txt['hidden'];

if (!empty($bracketList))
echo ' (' . implode(', ', $bracketList) . ')';

echo $context['show_who'] ? '</a>' : '', '
<div class="smalltext">';

// Assuming there ARE users online... each user in users_online has an id, username, name, group, href, and link.
if (!empty($context['users_online']))
{
echo '
', sprintf($txt['users_active'], $modSettings['lastActive']), ':<br />', implode(', ', $context['list_users_online']);

// Showing membergroups?
if (!empty($settings['show_group_key']) && !empty($context['membergroups']))
echo '
<br />[' . implode(']&nbsp;&nbsp;[', $context['membergroups']) . ']';
}

echo '
</div>
<hr class="hrcolor" />
<div class="smalltext">
', $txt['most_online_today'], ': <b>', $modSettings['mostOnlineToday'], '</b>.
', $txt['most_online_ever'], ': ', $modSettings['mostOnline'], ' (' , timeformat($modSettings['mostDate']), ')
</div>
</div>
</div>
</div>';

// If they are logged in, but statistical information is off... show a personal message bar.
if ($context['user']['is_logged'] && !$settings['show_stats_index'])
{
echo '
<div class="infocenter_section">
<h4 class="headerpadding titlebg">', $txt['personal_message'], '</h4>
<div class="windowbg">
<p class="section">
', $context['allow_pm'] ? '<a href="' . $scripturl . '?action=pm">' : '', '<img src="', $settings['images_url'], '/message_sm.gif" alt="', $txt['personal_message'], '" />', $context['allow_pm'] ? '</a>' : '', '
</p>
<div class="windowbg2 sectionbody">
<strong><a href="', $scripturl, '?action=pm">', $txt['personal_message'], '</a></strong>
<div class="smalltext">
', $txt['you_have'], ' ', $context['user']['messages'], ' ', $context['user']['messages'] == 1 ? $txt['message_lowercase'] : $txt['msg_alert_messages'], '.... ', $txt['click'], ' <a href="', $scripturl, '?action=pm">', $txt['here'], '</a> ', $txt['to_view'], '
</div>
</div>
</div>
</div>';
}

// Show the login bar. (it's only true if they are logged out anyway.)
if ($context['show_login_bar'])
{
echo '
<div class="infocenter_section">
<h4 class="headerpadding titlebg">', $txt['login'], ' <a href="', $scripturl, '?action=reminder" class="smalltext">', $txt['forgot_your_password'], '</a></h4>
<div class="windowbg">
<p class="section">
<a href="', $scripturl,  '?action=login"><img src="', $settings['images_url'], '/icons/login.gif', '" alt="', $txt['login'], '" /></a>
</p>
<div class="windowbg2 sectionbody">
<form id="infocenter_login" action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '">
<ul class="horizlist clearfix">
<li>
<label for="user">', $txt['username'], ':<br />
<input type="text" name="user" id="user" size="15" /></label>
</li>
<li>
<label for="passwrd">', $txt['password'], ':<br />
<input type="password" name="passwrd" id="passwrd" size="15" /></label>
</li>
<li>
<label for="cookielength">', $txt['mins_logged_in'], ':<br />
<input type="text" name="cookielength" id="cookielength" size="4" maxlength="4" value="', $modSettings['cookieTime'], '" /></label>
</li>
<li>
<label for="cookieneverexp">', $txt['always_logged_in'], ':<br />
<input type="checkbox" name="cookieneverexp" id="cookieneverexp" checked="checked" class="check" /></label>
</li>
<li>
<input type="submit" value="', $txt['login'], '" />
</li>
</ul>
</form>
</div>
</div>
</div>';
}
echo '
</div>
</div>';
}


to the file you edit where you call  <?php template_info_center(); ?>
Met vriendelijke groet, The Burglar!

 House Mixes | Mixcloud | Any Intelligent fool can make things bigger, more complex, and more violent.
It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Albert Einstein

Former Godfather of our dutch community ;)

SNAFU0185

i did that its all in my last post

N3RVE

Any further concerns regarding this topic? :)
Did you try the Custom Actions mod Sinan recommended after my post in that topic? It certainly works very well and kills the need for this stress :).

-[n3rve]
Ralph "[n3rve]" Otowo
Former Marketing Co-ordinator, Simple Machines.
ralph [at] simplemachines [dot] org                       
Quote"Somewhere, something incredible is waiting to be known." - Carl Sagan

SNAFU0185

does it work on smf 2 and will it let me name the files what i want?

Norv

It seems it does work on 2.0, if this is the mod: http://custom.simplemachines.org/mods/index.php?mod=331.
I'm not sure about the rest, as I don't know the mod myself.
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

SNAFU0185

would have been nice but unfortunately its not suitable for the use i have in mind thanks though :)

SNAFU0185

#26
Quote from: The Burglar! on August 04, 2009, 08:36:56 AM
just before you call template_info_center(); copy the function template_info_center() from boardindex.template.php


function template_info_center()
{
global $context, $settings, $options, $txt, $scripturl, $modSettings;

// Info center collapse object.
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
// And create the info center object.
var infoHeader = new smfToggle("upshrinkIC", ', empty($options['collapse_header_ic']) ? 'false' : 'true', ');
infoHeader.useCookie(', $context['user']['is_guest'] ? 1 : 0, ');
infoHeader.setOptions("collapse_header_ic", "', $context['session_id'], '");
infoHeader.addToggleImage("upshrink_ic", "/collapse.gif", "/expand.gif");
infoHeader.addTogglePanel("upshrinkHeaderIC");
// ]]></script>';

// Here's where the "Info Center" starts...
echo '
<div class="tborder clearfix" id="infocenterframe">
<h3 class="catbg headerpadding">
<a href="#" onclick="infoHeader.toggle(); return false;"><img id="upshrink_ic" src="', $settings['images_url'], '/', empty($options['collapse_header_ic']) ? 'collapse.gif' : 'expand.gif', '" alt="*" title="', $txt['upshrink_description'], '" style="margin-right: 2ex;" align="right" /></a>
', sprintf($txt['info_center_title'], $context['forum_name_html_safe']), '
</h3>
<div id="upshrinkHeaderIC"', empty($options['collapse_header_ic']) ? '' : ' style="display: none;"', '>';

// This is the "Recent Posts" bar.
if (!empty($settings['number_recent_posts']))
{
echo '
<div class="infocenter_section">
<h4 class="headerpadding titlebg">', $txt['recent_posts'], '</h4>
<div class="windowbg">
<p class="section">
<a href="', $scripturl, '?action=recent"><img src="', $settings['images_url'], '/post/xx.gif" alt="', $txt['recent_posts'], '" /></a>
</p>
<div class="windowbg2 sectionbody hslice clearfix" id="recent_posts_content"><div class="entry-title" style="display: none;">', $context['forum_name_html_safe'], ' - ', $txt['recent_posts'], '</div><div class="entry-content" style="display: none;"><a rel="feedurl" href="', $scripturl, '?action=.xml;type=webslice">', $txt['subscribe_webslice'], '</a></div>';

// Only show one post.
if ($settings['number_recent_posts'] == 1)
{
// latest_post has link, href, time, subject, short_subject (shortened with...), and topic. (its id.)
echo '
<strong><a href="', $scripturl, '?action=recent">', $txt['recent_posts'], '</a></strong>
<p id="infocenter_onepost" class="smalltext">
', $txt['recent_view'], ' &quot;', $context['latest_post']['link'], '&quot; ', $txt['recent_updated'], ' (', $context['latest_post']['time'], ')<br />
</p>';
}
// Show lots of posts.
elseif (!empty($context['latest_posts']))
{
echo '
<dl id="infocenter_recentposts" class="middletext">';

/* Each post in latest_posts has:
board (with an id, name, and link.), topic (the topic's id.), poster (with id, name, and link.),
subject, short_subject (shortened with...), time, link, and href. */
foreach ($context['latest_posts'] as $post)
echo '
<dt><strong>', $post['link'], '</strong> ', $txt['by'], ' ', $post['poster']['link'], ' (', $post['board']['link'], ')</dt>
<dd>', $post['time'], '</dd>';
echo '
</dl>';
}
echo '
</div>
</div>
</div>';
}

// Show information about events, birthdays, and holidays on the calendar.
if ($context['show_calendar'])
{
echo '
<div class="infocenter_section">
<h4 class="headerpadding titlebg">', $context['calendar_only_today'] ? $txt['calendar_today'] : $txt['calendar_upcoming'], '</h4>
<div class="windowbg">
<p class="section">
<a href="', $scripturl, '?action=calendar' . '"><img src="', $settings['images_url'], '/icons/calendar.gif', '" alt="', $context['calendar_only_today'] ? $txt['calendar_today'] : $txt['calendar_upcoming'], '" /></a>
</p>
<div class="sectionbody windowbg2 middletext">';

// Holidays like "Christmas", "Chanukah", and "We Love [Unknown] Day" :P.
if (!empty($context['calendar_holidays']))
echo '
<span class="holiday">', $txt['calendar_prompt'], ' ', implode(', ', $context['calendar_holidays']), '</span><br />';

// People's birthdays. Like mine. And yours, I guess. Kidding.
if (!empty($context['calendar_birthdays']))
{
echo '
<span class="birthday">', $context['calendar_only_today'] ? $txt['birthdays'] : $txt['birthdays_upcoming'], '</span> ';
/* Each member in calendar_birthdays has:
id, name (person), age (if they have one set?), is_last. (last in list?), and is_today (birthday is today?) */
foreach ($context['calendar_birthdays'] as $member)
echo '
<a href="', $scripturl, '?action=profile;u=', $member['id'], '">', $member['is_today'] ? '<b>' : '', $member['name'], $member['is_today'] ? '</b>' : '', isset($member['age']) ? ' (' . $member['age'] . ')' : '', '</a>', $member['is_last'] ? '<br />' : ', ';
}
// Events like community get-togethers.
if (!empty($context['calendar_events']))
{
echo '
<span class="event">', $context['calendar_only_today'] ? $txt['events'] : $txt['events_upcoming'], '</span> ';
/* Each event in calendar_events should have:
title, href, is_last, can_edit (are they allowed?), modify_href, and is_today. */
foreach ($context['calendar_events'] as $event)
echo '
', $event['can_edit'] ? '<a href="' . $event['modify_href'] . '" style="color: #FF0000;">*</a> ' : '', $event['href'] == '' ? '' : '<a href="' . $event['href'] . '">', $event['is_today'] ? '<b>' . $event['title'] . '</b>' : $event['title'], $event['href'] == '' ? '' : '</a>', $event['is_last'] ? '<br />' : ', ';

// Show a little help text to help them along ;).
if ($context['calendar_can_edit'])
echo '
(<a href="', $scripturl, '?action=helpadmin;help=calendar_how_edit" onclick="return reqWin(this.href);">', $txt['calendar_how_edit'], '</a>)';
}
echo '
</div>
</div>
</div>';
}


// Show statistical style information...
if ($settings['show_stats_index'])
{
echo '
<div class="infocenter_section">
<h4 class="headerpadding titlebg">', $txt['forum_stats'], '</h4>
<div class="windowbg">
<p class="section">
<a href="', $scripturl, '?action=stats"><img src="', $settings['images_url'], '/icons/info.gif" alt="', $txt['forum_stats'], '" /></a>
</p>
<div class="windowbg2 sectionbody middletext">
', $context['common_stats']['total_posts'], ' ', $txt['posts_made'], ' ', $txt['in'], ' ', $context['common_stats']['total_topics'], ' ', $txt['topics'], ' ', $txt['by'], ' ', $context['common_stats']['total_members'], ' ', $txt['members'], '. ', !empty($settings['show_latest_member']) ? $txt['latest_member'] . ': <b> ' . $context['common_stats']['latest_member']['link'] . '</b>' : '', '<br />
', (!empty($context['latest_post']) ? $txt['latest_post'] . ': <b>&quot;' . $context['latest_post']['link'] . '&quot;</b>  ( ' . $context['latest_post']['time'] . ' )<br />' : ''), '
<a href="', $scripturl, '?action=recent">', $txt['recent_view'], '</a>', $context['show_stats'] ? '<br />
<a href="' . $scripturl . '?action=stats">' . $txt['more_stats'] . '</a>' : '', '
</div>
</div>
</div>';
}

// "Users online" - in order of activity.
echo '
<div class="infocenter_section">
<h4 class="headerpadding titlebg">', $txt['online_users'], '</h4>
<div class="windowbg">
<p class="section">
', $context['show_who'] ? '<a href="' . $scripturl . '?action=who' . '">' : '', '<img src="', $settings['images_url'], '/icons/online.gif', '" alt="', $txt['online_users'], '" />', $context['show_who'] ? '</a>' : '', '
</p>
<div class="windowbg2 sectionbody">
', $context['show_who'] ? '<a href="' . $scripturl . '?action=who">' : '', $context['num_guests'], ' ', $context['num_guests'] == 1 ? $txt['guest'] : $txt['guests'], ', ' . $context['num_users_online'], ' ', $context['num_users_online'] == 1 ? $txt['user'] : $txt['users'];

// Handle hidden users and buddies.
$bracketList = array();
if ($context['show_buddies'])
$bracketList[] = $context['num_buddies'] . ' ' . ($context['num_buddies'] == 1 ? $txt['buddy'] : $txt['buddies']);
if (!empty($context['num_spiders']))
$bracketList[] = $context['num_spiders'] . ' ' . ($context['num_spiders'] == 1 ? $txt['spider'] : $txt['spiders']);
if (!empty($context['num_users_hidden']))
$bracketList[] = $context['num_users_hidden'] . ' ' . $txt['hidden'];

if (!empty($bracketList))
echo ' (' . implode(', ', $bracketList) . ')';

echo $context['show_who'] ? '</a>' : '', '
<div class="smalltext">';

// Assuming there ARE users online... each user in users_online has an id, username, name, group, href, and link.
if (!empty($context['users_online']))
{
echo '
', sprintf($txt['users_active'], $modSettings['lastActive']), ':<br />', implode(', ', $context['list_users_online']);

// Showing membergroups?
if (!empty($settings['show_group_key']) && !empty($context['membergroups']))
echo '
<br />[' . implode(']&nbsp;&nbsp;[', $context['membergroups']) . ']';
}

echo '
</div>
<hr class="hrcolor" />
<div class="smalltext">
', $txt['most_online_today'], ': <b>', $modSettings['mostOnlineToday'], '</b>.
', $txt['most_online_ever'], ': ', $modSettings['mostOnline'], ' (' , timeformat($modSettings['mostDate']), ')
</div>
</div>
</div>
</div>';

// If they are logged in, but statistical information is off... show a personal message bar.
if ($context['user']['is_logged'] && !$settings['show_stats_index'])
{
echo '
<div class="infocenter_section">
<h4 class="headerpadding titlebg">', $txt['personal_message'], '</h4>
<div class="windowbg">
<p class="section">
', $context['allow_pm'] ? '<a href="' . $scripturl . '?action=pm">' : '', '<img src="', $settings['images_url'], '/message_sm.gif" alt="', $txt['personal_message'], '" />', $context['allow_pm'] ? '</a>' : '', '
</p>
<div class="windowbg2 sectionbody">
<strong><a href="', $scripturl, '?action=pm">', $txt['personal_message'], '</a></strong>
<div class="smalltext">
', $txt['you_have'], ' ', $context['user']['messages'], ' ', $context['user']['messages'] == 1 ? $txt['message_lowercase'] : $txt['msg_alert_messages'], '.... ', $txt['click'], ' <a href="', $scripturl, '?action=pm">', $txt['here'], '</a> ', $txt['to_view'], '
</div>
</div>
</div>
</div>';
}

// Show the login bar. (it's only true if they are logged out anyway.)
if ($context['show_login_bar'])
{
echo '
<div class="infocenter_section">
<h4 class="headerpadding titlebg">', $txt['login'], ' <a href="', $scripturl, '?action=reminder" class="smalltext">', $txt['forgot_your_password'], '</a></h4>
<div class="windowbg">
<p class="section">
<a href="', $scripturl,  '?action=login"><img src="', $settings['images_url'], '/icons/login.gif', '" alt="', $txt['login'], '" /></a>
</p>
<div class="windowbg2 sectionbody">
<form id="infocenter_login" action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '">
<ul class="horizlist clearfix">
<li>
<label for="user">', $txt['username'], ':<br />
<input type="text" name="user" id="user" size="15" /></label>
</li>
<li>
<label for="passwrd">', $txt['password'], ':<br />
<input type="password" name="passwrd" id="passwrd" size="15" /></label>
</li>
<li>
<label for="cookielength">', $txt['mins_logged_in'], ':<br />
<input type="text" name="cookielength" id="cookielength" size="4" maxlength="4" value="', $modSettings['cookieTime'], '" /></label>
</li>
<li>
<label for="cookieneverexp">', $txt['always_logged_in'], ':<br />
<input type="checkbox" name="cookieneverexp" id="cookieneverexp" checked="checked" class="check" /></label>
</li>
<li>
<input type="submit" value="', $txt['login'], '" />
</li>
</ul>
</form>
</div>
</div>
</div>';
}
echo '
</div>
</div>';
}


to the file you edit where you call  <?php template_info_center(); ?>
i tried your code just in case it was diferent to mine but its the same, i still  get the errors  its because the following indexes havent been defined first
show_who in
show_calendar in
num_guests in
num_users_online in
show_buddies in
show_login_bar in

as i said im unsure how to define them without breaking smf as all attemts thus far have done.
any and all help greatly appreated

SNAFU0185


Arantor

The reason that fails is because I'm pretty sure those are not defined in the page you're calling; I seem to recall they are generated in code in BoardIndex.php, which would also have to be moved.

N3RVE

Is this issue solved or do you require any further assistance?

-[n3rve]
Ralph "[n3rve]" Otowo
Former Marketing Co-ordinator, Simple Machines.
ralph [at] simplemachines [dot] org                       
Quote"Somewhere, something incredible is waiting to be known." - Carl Sagan

SNAFU0185

sorry haven had net for a while after we shifted will try now

SNAFU0185

all works well untill i try the calander one
show_calendar
so oin order to make the calander info display like it does at the bottom of smf ive insterted the following code
// Load the calendar?
if (!empty($modSettings['cal_enabled']) && allowedTo('calendar_view'))
{
// Retrieve the calendar data (events, birthdays, holidays).
$eventOptions = array(
'include_holidays' => $modSettings['cal_showholidays'] > 1,
'include_birthdays' => $modSettings['cal_showbdays'] > 1,
'include_events' => $modSettings['cal_showevents'] > 1,
'num_days_shown' => empty($modSettings['cal_days_for_index']) || $modSettings['cal_days_for_index'] < 1 ? 1 : $modSettings['cal_days_for_index'],
);
$context += cache_quick_get('calendar_index_offset_' . ($user_info['time_offset'] + $modSettings['time_offset']), 'Subs-Calendar.php', 'cache_getRecentEvents', array($eventOptions));

// Whether one or multiple days are shown on the board index.
$context['calendar_only_today'] = $modSettings['cal_days_for_index'] == 1;

// This is used to show the "how-do-I-edit" help.
$context['calendar_can_edit'] = allowedTo('calendar_edit_any');
}
else
$context['show_calendar'] = false;

$context['page_title'] = sprintf($txt['forum_index'], $context['forum_name']);
}

unfortunately i get an error
Parse error: syntax error, unexpected '}' in /smf/test.php on line 78
line 78 is
}

Norv

Please post as attachment here the file that gives you that error.
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

SNAFU0185

#33
as requested here is the file
many thanks in advance for the assistance

SNAFU0185

all fixed just needed an { about line 75ish thanks for looking though

Norv

Great to see you got it sorted out!
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

Advertisement: