News:

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

Main Menu

Help please

Started by Satzi, August 25, 2015, 09:34:40 PM

Previous topic - Next topic

Satzi

Hi, I'm relative new to editing smf themes, and I don't really understand php codes so I hoped you guys could help me. ;D

## PROBLEM SOLVED ##

Diego Andrés

Issue is at the very bottom (I think)

<div id="toolbar">

should be

echo '
<div id="toolbar">

SMF Tricks - Free & Premium Responsive Themes for SMF.

Satzi


Kindred

In the future, please do not edit your posts to remove the original question.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Satzi

I get error on line 8 saying:

Parse error: syntax error, unexpected 'class' (T_CLASS), expecting ',' or ';'


{
echo '
<div id="header">
<div id="logo">
<a href="'.$scripturl.'" title=""></a>
</div>
echo '
<div class="user">
<p class="avatar">', $context['user']['avatar']['image'], '</p>';
<ul class="reset">
<li class="greeting">', $txt['hello_member_ndt'], ' <span>', $context['user']['name'], '</span></li>
<li><a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a></li>
<li><a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a></li>
<li>', $context['current_time'],'</li>';

</ul>';
</div>
</div>
}


Can someone help?

Kindred

Get rid of the second echo ' statement or add a closing '; on the line before it...

And be careful when editing the code in files
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Shambles

Blimey - a 2 year bump :)

Once you've made the recommended edit, you'll hit another issue at "<ul class="reset">" which you'll have to prefix with "echo '"

Satzi

Quote from: Kindred on November 06, 2017, 08:19:37 PM
Get rid of the second echo ' statement or add a closing '; on the line before it...

And be careful when editing the code in files

Quote from: sǝๅqɯɐɥS on November 07, 2017, 07:02:00 AM
Blimey - a 2 year bump :)

Once you've made the recommended edit, you'll hit another issue at "<ul class="reset">" which you'll have to prefix with "echo '"

After doing these changes, I get error on line 15 saying: Parse error: syntax error, unexpected '<'


{
echo '
<div id="header">
<div id="logo">
<a href="'.$scripturl.'" title=""></a>
</div>
<div class="user">
<p class="avatar">', $context['user']['avatar']['image'], '</p>';
    echo '
        <ul class="reset">
<li class="greeting">', $txt['hello_member_ndt'], ' <span>', $context['user']['name'], '</span></li>
<li><a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a></li>
<li><a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a></li>
<li>', $context['current_time'],'</li>';
</ul>';
</div>
</div>
}





btw. it is a 2 year bump because after you guys helped me the first time, everything used to work just fine and now all of a sudden it started showing me these errors haha :laugh:

Sir Osis of Liver

You've broken the echo statement in two places.

This -



    echo '
        <ul class="reset">
<li class="greeting">', $txt['hello_member_ndt'], ' <span>', $context['user']['name'], '</span></li>
<li><a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a></li>
<li><a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a></li>
<li>', $context['current_time'],'</li>';
</ul>';
</div>
</div>



  should be this -



    echo '
        <ul class="reset">
<li class="greeting">', $txt['hello_member_ndt'], ' <span>', $context['user']['name'], '</span></li>
<li><a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a></li>
<li><a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a></li>
<li>', $context['current_time'],'</li>
</ul>
</div>
</div>';

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Satzi

Thank you, now it doesn't show me error, at least not on that part of the file.

Now the error is at the very end:


// Generate a strip of buttons.
function template_button_strip($button_strip, $direction = 'top', $strip_options = array())
{
global $settings, $context, $txt, $scripturl;

if (!is_array($strip_options))
$strip_options = array();

// List the buttons in reverse order for RTL languages.
if ($context['right_to_left'])
$button_strip = array_reverse($button_strip, true);

// Create the buttons...
$buttons = array();
foreach ($button_strip as $key => $value)
{
if (!isset($value['test']) || !empty($context[$value['test']]))
$buttons[] = '
<li><a' . (isset($value['id']) ? ' id="button_strip_' . $value['id'] . '"' : '') . ' class="button_strip_' . $key . (isset($value['active']) ? ' active' : '') . '" href="' . $value['url'] . '"' . (isset($value['custom']) ? ' ' . $value['custom'] : '') . '><span>' . $txt[$value['text']] . '</span></a></li>';
}

// No buttons? No button strip either.
if (empty($buttons))
return;

// Make the last one, as easy as possible.
$buttons[count($buttons) - 1] = str_replace('<span>', '<span class="last">', $buttons[count($buttons) - 1]);

echo '
<div class="buttonlist', !empty($direction) ? ' float' . $direction : '', '"', (empty($buttons) ? ' style="display: none;"' : ''), (!empty($strip_options['id']) ? ' id="' . $strip_options['id'] . '"': ''), '>
<ul>',
implode('', $buttons), '
</ul>
</div>';
}

?>


Parse error: syntax error, unexpected end of file

Sir Osis of Liver

That code is correct, problem is elsewhere in the file.  You may have dropped a curly bracket somewhere further up.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Satzi


<?php

if ($context['user']['is_logged'])
{
echo '
<div id="header">
<div id="logo">
<a href="'
.$scripturl.'" title=""></a>
</div>
<div class="user">
<p class="avatar">'
$context['user']['avatar']['image'], '</p>';
    echo '
        <ul class="reset">
<li class="greeting">'
$txt['hello_member_ndt'], ' <span>'$context['user']['name'], '</span></li>
<li><a href="'
$scripturl'?action=unread">'$txt['unread_since_visit'], '</a></li>
<li><a href="'
$scripturl'?action=unreadreplies">'$txt['show_unread_replies'], '</a></li>
<li>'
$context['current_time'],'</li>
</ul>
</div>
</div>'
;
}
else
{
echo '
<div id="header_guest">
<div id="logo_guest">
<a href="'
.$scripturl.'" title=""></a>
</div>
</div>
}
<div id="toolbar">
'
,template_menu(),'
</div>
<div id="userinfo">
                </div>
<div id="searchfield">
<br>
</div>
<div id="mainarea">'
;

// Show the navigation tree.
theme_linktree();

?>



I think problem is somewhere here?

Kindred

instead of giving bits and having us look for error after error...

1- restore the original file from before your bad edits
or
2- attach (not paste code, use the attach file feature) the whole file
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Satzi

I found where the problem is and changed this:


<?php

else
{
echo '
<div id="header_guest">
<div id="logo_guest">
<a href="'
.$scripturl.'" title=""></a>
</div>
</div>
}
<div id="toolbar">
'
,template_menu(),'
</div>
<div id="userinfo">
                </div>
<div id="searchfield">
<br>
</div>
<div id="mainarea">'
;

// Show the navigation tree.
theme_linktree();

?>



into this:


<?php

else
{
echo '
<div id="header_guest">
<div id="logo_guest">
<a href="'
.$scripturl.'" title=""></a>
</div>
</div>'
;
}
echo '
<div id="toolbar">
'
,template_menu(),'
</div>
<div id="userinfo">
                </div>
<div id="searchfield">
<br>
</div>
<div id="mainarea">'
;

// Show the navigation tree.
theme_linktree();

?>




Thank you guys for the support :D

Kindred

if that php statement is actually there, then you have done something terribly wrong in your files, since SMF parses the whole file as php and does not use <?php anywhere except the start of the file
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Satzi

It isn't there, I have just put it here in code because I think it is easier to understand the code when it is in colors instead of everything being black

Arantor

This is why providing the whole file as an attachment as previously requested would help, because then people can help you by looking at all of it, rather than just one tiny broken bit.

Satzi

Ok, next time I will attach a file if needed.
Anyway, my problem is now solved. Thanks for help. :)

Advertisement: