Uutiset:

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

Main Menu
Advertisement:

Error for slickpro, help!?

Aloittaja m3talc0re, elokuu 24, 2006, 01:09:25 IP

« edellinen - seuraava »

m3talc0re

8: Undefined variable: current_action
File: /home/m3talc0r/public_html/smfboard/Themes/SlickPro_Blue/BoardIndex.template.php (eval?)
Line: 204

8: Undefined variable: current_action
File: /home/m3talc0r/public_html/smfboard/Themes/SlickPro_Blue/Display.template.php (eval?)
Line: 204

8: Undefined variable: current_action
File: /home/m3talc0r/public_html/smfboard/Themes/SlickPro_Blue/MessageIndex.template.php (eval?)
Line: 204

I keep getting these errors over and over and I don't know what's causing it, anyone?
The real hell is your life gone wrong.

H

Well it is an undefined variable somewhere :P

Wrong version maybe or not upgraded for RC3?
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

Thantos

$current_action is used in template_menu() of the default theme, to help determine which tab to make the active tab.

Are you using $current_action anywhere else in your theme?  Search your templates for it and if you can find where its being used, post the code and we can probably help you more.

kilk

Lainaus käyttäjältä: huwnet - elokuu 24, 2006, 01:32:18 IP
Well it is an undefined variable somewhere :P

Wrong version maybe or not upgraded for RC3?

That is what I thought, since just other day he upgraded to RC3 when he was making it in RC2  ::)
Elddem The MMORPG - https://www.elddem.com | Denarius (D) Cryptocurrrency - https://www.denarius.io | BlockForums - Cryptocurrency Community Forums - https://www.blockforums.org

m3talc0re

I've just noticed that I'm even receiving the error from the default smf theme....
The real hell is your life gone wrong.

m3talc0re

I've upgraded the template files manually to rc3 to eliminate that as a possible problem. I am still getting the error. I haven't really changed it in any other templates and I get the error across every page visited. So it's got to be in a template file that's sourced in every single page, the index.template.php...

Here are some parts I've changed that may have something to do with that:


// display user name
echo '
<table width="100%" cellspacing="1" cellpadding="5" class="bordercolor" border="0" >
<tr>';

echo '
<td class="windowbg2" width="100%" valign="middle" align="left">', theme_newestlink(), '<br />
', theme_linktree2(), '
</td>';



// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
{
echo ($current_action == 'pm' || $context['browser']['is_ie4']) ? '' : '' , '
<a href="', $scripturl, '?action=pm">Private Messages</a>: ', $context['user']['unread_messages'], ' Unread, ', $context['user']['messages'], ' Total.<br />';
}



// If the user is logged in, display stuff like their  new messages, etc...
function theme_newestlink()
{
global $context, $settings, $options, $scripturl, $txt;

if ($context['user']['is_logged'])
{
echo '
<a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a>&nbsp;|&nbsp;<a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a>';

}
// Otherwise they're a guest - send them a lovely greating...
else
echo $txt['welcome_guest'];
}



function theme_linktree()
{
global $context, $settings, $options;

// Folder style or inline?  Inline has a smaller font.
echo '<br />';

}

function theme_linktree2()
{
global $context, $settings, $options;

// Folder style or inline?  Inline has a smaller font.
echo '<span class="nav-tree" style="font-size: smaller;">';

// Each tree item has a URL and name.  Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
// Show pretty folder
if ($link_num == 0)
{
echo '<img src="' . $settings['images_url'] . '/icons/folder_open.gif" alt="+" border="0" />&nbsp; ';
}
else if ($link_num == 1)
{
echo '<img src="' . $settings['images_url'] . '/icons/linktree_side.gif" alt="|-" border="0" /><img src="' . $settings['images_url'] . '/icons/folder_open.gif" alt="+" border="0" />&nbsp; ';
}
else
{
echo '&raquo; ';
}

// Show the link, including a URL if it should have one.
echo '<b>', $settings['linktree_link'] && isset($tree['url']) ? '<a href="' . $tree['url'] . '" class="nav-tree">' . $tree['name'] . '</a>' : $tree['name'], '</b>';

if ($link_num == 0)
{
echo '<br />';
}
}

echo '</span>';
}



// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;

// Work out where we currently are.
$current_action = 'home';
if (in_array($context['current_action'], array('admin', 'ban', 'boardrecount', 'cleanperms', 'detailedversion', 'dumpdb', 'featuresettings', 'featuresettings2', 'findmember', 'maintain', 'manageattachments', 'manageboards', 'managecalendar', 'managesearch', 'membergroups', 'modlog', 'news', 'optimizetables', 'packageget', 'packages', 'permissions', 'pgdownload', 'postsettings', 'regcenter', 'repairboards', 'reports', 'serversettings', 'serversettings2', 'smileys', 'viewErrorLog', 'viewmembers')))
$current_action = 'admin';
if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))
$current_action = $context['current_action'];
if ($context['current_action'] == 'search2')
$current_action = 'search';
if ($context['current_action'] == 'theme')
$current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';

// Are we using right-to-left orientation?
if ($context['right_to_left'])
{
$first = 'last';
$last = 'first';
}
else
{
$first = 'first';
$last = 'last';
}

// Show the start of the tab section.
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>';

// Show the [home] button.
echo '
<td class="main-navigation"><a href="', $scripturl, '">' , $txt[103] , '</a></td>';

// Show the [help] button.
echo '
<td class="main-navigation"><a href="', $scripturl, '?action=help">' , $txt[119] , '</a></td>';

// How about the [search] button?
if ($context['allow_search'])
echo '
<td class="main-navigation"><a href="', $scripturl, '?action=search">' , $txt[182] , '</a></td>';

// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
echo '
<td class="main-navigation"><a href="', $scripturl, '?action=admin">' , $txt[2] , '</a></td>';

// Edit Profile... [profile]
if ($context['allow_edit_profile'])
echo '
<td class="main-navigation"><a href="', $scripturl, '?action=profile">' , $txt[79] , '</a></td>';

// The [calendar]!
if ($context['allow_calendar'])
echo '
<td class="main-navigation"><a href="', $scripturl, '?action=calendar">' , $txt['calendar24'] , '</a></td>';

// the [member] list button
if ($context['allow_memberlist'])
echo '
<td class="main-navigation"><a href="', $scripturl, '?action=mlist">' , $txt[331] , '</a></td>';


// If the user is a guest, show [login] button.
if ($context['user']['is_guest'])
echo '
<td class="main-navigation"><a href="', $scripturl, '?action=login">' , $txt[34] , '</a></td>';


// If the user is a guest, also show [register] button.
if ($context['user']['is_guest'])
echo '
<td class="main-navigation"><a href="', $scripturl, '?action=register">' , $txt[97] , '</a></td>';


// Otherwise, they might want to [logout]...
if ($context['user']['is_logged'])
echo '
<td class="main-navigation"><a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a></td>';

// The end of tab section.
echo '
</tr>
</table>';

}
The real hell is your life gone wrong.

m3talc0re

My friend Andrew helped me get it fixed. It was something with the pm thing at the top:

Wrong:

echo ($current_action == 'pm' || $context['browser']['is_ie4']) ? '' : '' , '


Right:

((isset($current_action) && $curent_action == 'pm') || $context['browser']['is_ie4']) ? '' : '' ,
The real hell is your life gone wrong.

Advertisement: