MyBB Community Forums

Full Version: Error When Viewing Specific posts.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I just installed a new theme on my forum (https://chhsforum.cf) everytime I visit a specific page it gives one error at the top saying "MyBB Internal: One or more warnings occurred. Please contact your administrator for assistance." My other theme never did this. One of the threads with the error is https://chhsforum.cf/showthread.php?tid=62 but it is most if not all threads

I check the error log and this is what it said.

If you require any additional info please let me know 

It's running MyBB 1.8.26, PHP 7.3 have also tried PHP 7.4 and MySQLi 8.0.24



Quote:<error>
<dateline>1619905761</dateline>
<script>showthread.php(1600) : eval()'d code</script>
<line>50</line>
<type>2</type>
<friendly_type>Warning</friendly_type>
<message>Use of undefined constant username - assumed 'username' (this will throw an Error in a future version of PHP)</message>
<back_trace>#0  errorHandler->error() called at [/showthread.php(1600) : eval()'d code:50]
#1  eval() called at [/showthread.php:1600]
</back_trace>
</error>

<error>
<dateline>1619905864</dateline>
<script>showthread.php(1600) : eval()'d code</script>
<line>50</line>
<type>2</type>
<friendly_type>Warning</friendly_type>
<message>Use of undefined constant username - assumed 'username' (this will throw an Error in a future version of PHP)</message>
<back_trace>#0  errorHandler->error() called at [/showthread.php(1600) : eval()'d code:50]
#1  eval() called at [/showthread.php:1600]
</back_trace>
</error>

<error>
<dateline>1619906226</dateline>
<script>showthread.php(1600) : eval()'d code</script>
<line>50</line>
<type>2</type>
<friendly_type>Warning</friendly_type>
<message>Use of undefined constant username - assumed 'username' (this will throw an Error in a future version of PHP)</message>
<back_trace>#0  errorHandler->error() called at [/showthread.php(1600) : eval()'d code:50]
#1  eval() called at [/showthread.php:1600]
</back_trace>
</error>

<error>
<dateline>1619906338</dateline>
<script>showthread.php(1600) : eval()'d code</script>
<line>50</line>
<type>2</type>
<friendly_type>Warning</friendly_type>
<message>Use of undefined constant username - assumed 'username' (this will throw an Error in a future version of PHP)</message>
<back_trace>#0  errorHandler->error() called at [/showthread.php(1600) : eval()'d code:50]
#1  eval() called at [/showthread.php:1600]
</back_trace>
</error>

<error>
<dateline>1619906391</dateline>
<script>showthread.php(1600) : eval()'d code</script>
<line>50</line>
<type>2</type>
<friendly_type>Warning</friendly_type>
<message>Use of undefined constant username - assumed 'username' (this will throw an Error in a future version of PHP)</message>
<back_trace>#0  errorHandler->error() called at [/showthread.php(1600) : eval()'d code:50]
#1  eval() called at [/showthread.php:1600]
</back_trace>
</error>
I'm no expert, but one problem seen is when I go to your link and view page source in current Firefox, I see lots of code in red. Pointing to highlighted code there are some tips, including no space between attributes. Maybe that's no big deal, but there are some "table started but previous table not closed."

I think you may have a theme problem.

[edit]
What theme? downloadable for test?
(2021-05-02, 04:03 PM)HLFadmin Wrote: [ -> ]I'm no expert, but one problem seen is when I go to your link and view page source in current Firefox, I see lots of code in red. Pointing to highlighted code there are some tips, including no space between attributes. Maybe that's no big deal, but there are some "table started but previous table not closed."

I think you may have a theme problem.

[edit]
What theme? downloadable for test?
It is Volare Dark https://community.mybb.com/mods.php?acti...w&pid=1425
Similar for me.

Continuing to evaluate.

Found it. It's always an adventure. Hopefully I learn something from it, and this time I did.
Mostly how to scrutinize the finest details. Big Grin

In the Show Thread templates, edit the showthread template, line 49.
<td class="trow1" width="25%">{$thread[username]}</td>

should have username in single quotes, like
<td class="trow1" width="25%">{$thread['username']}</td>

[edit to add]
The items I mentioned first about attributes and tables do not affect the ability of Firefox to render the page properly. I think it wants to see pretty styling. And it's mistaken about nested tables.
(2021-05-02, 04:47 PM)HLFadmin Wrote: [ -> ]Similar for me.

Continuing to evaluate.

Found it. It's always an adventure. Hopefully I learn something from it, and this time I did.
Mostly how to scrutinize the finest details. Big Grin

In the Show Thread templates, edit the showthread template, line 49.
<td class="trow1" width="25%">{$thread[username]}</td>

should have username in single quotes, like
<td class="trow1" width="25%">{$thread['username']}</td>
Just did that and it fixed it perfect. Thank you for all the help Smile