Solved: 1 Year, 5 Months, 1 Week ago Volare-Theme PHP warning showthread.php
#1
Solved: 1 Year, 5 Months, 1 Week ago
Hello,

I get this PHP-warning when using the Volare-Theme on showthread:

Warning [2] Use of undefined constant username - assumed 'username' (this will throw an Error in a future version of PHP) - Line: 50 - File: showthread.php(1600) : eval()'d code PHP 7.3.28 (Linux)
/showthread.php(1600) : eval()'d code 50 errorHandler->error
/showthread.php 1600 eval

Only on thread view and only with this theme.

Something seems wrong here in the template maybe, any ideas?
Reply
#2
Solved: 1 Year, 5 Months, 1 Week ago
give me your show thread template
Reply
#3
Solved: 1 Year, 5 Months, 1 Week ago
<html>
<head>
<title>{$thread['subject']}</title>
{$headerinclude}
<script type="text/javascript">
<!--
	var quickdelete_confirm = "{$lang->quickdelete_confirm}";
	var quickrestore_confirm = "{$lang->quickrestore_confirm}";
	var allowEditReason = "{$mybb->settings['alloweditreason']}";
	lang.save_changes = "{$lang->save_changes}";
	lang.cancel_edit = "{$lang->cancel_edit}";
	lang.quick_edit_update_error = "{$lang->quick_edit_update_error}";
	lang.quick_reply_post_error = "{$lang->quick_reply_post_error}";
	lang.quick_delete_error = "{$lang->quick_delete_error}";
	lang.quick_delete_success = "{$lang->quick_delete_success}";
	lang.quick_delete_thread_success = "{$lang->quick_delete_thread_success}";
	lang.quick_restore_error = "{$lang->quick_restore_error}";
	lang.quick_restore_success = "{$lang->quick_restore_success}";
	lang.editreason = "{$lang->postbit_editreason}";
	lang.post_deleted_error = "{$lang->post_deleted_error}";
	lang.softdelete_thread = "{$lang->soft_delete_thread}";
	lang.restore_thread = "{$lang->restore_thread}";
// -->
</script>
<!-- jeditable (jquery) -->
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/report.js?ver=1820"></script>
<script src="{$mybb->asset_url}/jscripts/jeditable/jeditable.min.js"></script>
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/thread.js?ver=1822"></script>
</head>
<body>
	{$header}
	{$threadnotesbox}
	{$pollbox}
	<div class="float_left">
		{$multipage}
	</div>
	<div class="float_right">
		{$newreply}
	</div>
	
		<table border="0" cellspacing="0" cellpadding="0" width="100%">
    <tr>    
        <td class="thead"align="left"><strong>Subject İnformation <i class="float_right fas fa-gavel fa-lg"></i></strong></td>
    </tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" width="100%" style="border-left:1px solid #f5f6f7;border-right:1px solid #f5f6f7;text-align:center;">
<tr>
<td class="trow1" width="25%"align="left"><strong><i class="fas fa-users fa-lg"style="color:#3792B5;"></i> Author</strong></td>
<td class="trow1" width="25%">{$thread[username]}</td>
<td class="mobile-hide trow1" width="25%"align="left"><strong><i class=" fas fa-comments fa-lg"style="color:#4BB232;"></i> Replies</strong></td>
<td class="mobile-hide trow1" width="25%">{$thread['replies']}</td>
</tr>
<tr>
<td class="mobile-hide trow1" width="25%"align="left"><strong><i class="fas fa-share fa-lg"style="color:#E35798;"></i> Share</strong></td>
<td class="mobile-hide trow1" width="25%">
<a href="http://www.facebook.com/sharer.php?u={$mybb->settings['bburl']}/showthread.php?tid={$thread['tid']}" target=_blank><i class="fab fa-facebook" style="margin-left:15px;font-size:22px;"title="Facebook" align="center"></i></a>
<a href="http://twitter.com/home?status={$mybb->settings['bburl']}/showthread.php?tid={$thread['tid']}" target=_blank>
<i class="fab fa-twitter-square" title="Twitter" align="center"style="font-size:22px;"></i></a>  
<a href="https://plus.google.com/share?url={$mybb->settings['bburl']}/showthread.php?tid={$thread['tid']}" rel="nofollow" target="_blank">
<i class="fab fa-google-plus-square"title="Google+" align="center"style="font-size:22px;"></i></a>	
</td>
<td class="trow1" width="25%"align="left"><strong><i class="fas fa-eye fa-lg"style="color:#9B54E7;"></i> Views</strong></td>
<td class="trow1" width="25%">{$thread['views']}</td>
</tr>
<tr>
	<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder tfixed clear">
		<tr>
			<td class="thead">
				<div class="float_right">
					<span class="smalltext"><strong><a href="javascript:void(0)" id="thread_modes"><i class="fas fa-cog fa-lg"style="color:lightblue;padding-top: 2px;"></i></a>{$threadnoteslink}</strong></span>
				</div>{$ratethread}
				<div>
					<strong>{$thread['threadprefix']}{$thread['subject']}</strong>
				</div>
			</td>
		</tr>
<tr><td id="posts_container">
	<div id="posts">
		{$posts}
	</div>
</td></tr>
		<tr>
			<td class="tfoot">
				{$search_thread}
				<div>
					<strong><a href="{$next_oldest_link}"><i class="trow1 fas fa-arrow-circle-left"style=margin-top:3px;></i></a><a href="{$next_newest_link}"><i class="trow1 fas fa-arrow-circle-right"></i></a> </strong>
				</div>
			</td>
		</tr>
	</table>
	<div class="float_left">
		{$multipage}
	</div>
	<div style="padding-top: 4px;" class="float_right">
		{$newreply}
	</div>
	<br class="clear" />
	{$quickreply}
	{$threadexbox}
	{$similarthreads}
	<br />
	<div class="float_left">
		<ul class="thread_tools">
			{$printthread}
			{$sendthread}
			{$addremovesubscription}
			{$addpoll}
		</ul>
	</div>
	<div class="float_right" style="text-align: right;">
		{$moderationoptions}
		{$forumjump}
	</div>
	<br class="clear" />
	{$usersbrowsing}
	{$footer}
	<div id="thread_modes_popup" class="popup_menu" style="display: none;"><div class="popup_item_container"><a href="showthread.php?mode=linear&amp;tid={$tid}&amp;pid={$pid}#pid{$pid}" class="popup_item">{$lang->linear}</a></div><div class="popup_item_container"><a href="showthread.php?mode=threaded&amp;tid={$tid}&amp;pid={$pid}#pid{$pid}" class="popup_item">{$lang->threaded}</a></div></div>
	<script type="text/javascript">
	// <!--
		if(use_xmlhttprequest == "1")
		{
			$("#thread_modes").popupMenu();
		}
	// -->
	</script>
	<script type="text/javascript">
		var thread_deleted = "{$thread_deleted}";
		if(thread_deleted == "1")
		{
			$("#quick_reply_form, .new_reply_button, .thread_tools, .inline_rating").hide();
			$("#moderator_options_selector option.option_mirage").attr("disabled","disabled");
		}
	</script>
</body>
</html>

I have found the error:

<td class="trow1" width="25%">{$thread[username]}</td>

Please change above line 49 to this:

<td class="trow1" width="25%">{$thread['username']}</td>

...missing the quotation marks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)