Jump to the post that solved this thread.
Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not Solved Most variables not working on forumdisplay_thread
#21
Not Solved
		else
		{
			$attachment_count = '';
		}

		$plugins->run_hooks("forumdisplay_thread_end");
		
$query = $db->simple_select("users", "avatar, avatardimensions, username", "uid = {$thread['uid']}");
$avatar = $db->fetch_array($query);
$profilelink = get_profile_link($thread['uid']);
$thread['avatar'] = "";
if ($avatar['avatar'] != "")
{
    $useravatar = format_avatar($avatar['avatar'], $avatar['avatardimensions'], $mybb->settings['postmaxavatarsize']);
    $thread['avatar'] = "<div class=\"author_avatar\"><a href=\"{$profilelink}\"><img src=\"{$useravatar['image']}\" alt=\"\" {$useravatar['width_height']} /></a></div>";
} 


		eval("\$threads .= \"".$templates->get("forumdisplay_thread")."\";");
	}

	$customthreadtools = $standardthreadtools = '';
	if($ismod)
	{

Yes.

By the way, I also want it to work on forumdisplay_showthread
I'm new to MyBB, has been using WordPress and only know HTML/CSS.
Reply
#22
Not Solved
This is the code for the avatar, without the 2 lines for the fid. Put these after the $plugin->run_hooks line

(08-16-2015, 02:22 PM)XP Mai Wrote: By the way, I also want it to work on forumdisplay_showthread

Of course, I asked you to show your forumdisplay_showthread template.
Regards, Ad Bakker (NL)
Reply
#23
Not Solved
(08-16-2015, 02:36 PM)Ad Bakker Wrote: Of course, I asked you to show your forumdisplay_showthread template.
Oh, I read wrongly. I thought you were confirming.

forumdisplay_thread

<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="clear: both;">
	<tr>
		<td class="thead" align="center" colspan="{$colspan}">
			<div><strong><a href="{$thread['threadlink']}" class="{$inline_edit_class} {$new_class}" id="tid_{$inline_edit_tid}">{$thread['subject']}</a></strong></div>
			<div class="author smalltext">Trader: {$thread['profilelink']}</div>
		</td>
	</tr>
	<tr>
		<td class="{$bgcolor}" width="50%">
			<br class="clear" />
			<table width="100%" border="0">
				<tr>
					<td width="200px"><b><font size="5px">Trading (Offering)</font></b></td>
					<td><font size=5px">:</font></td>
					<td><font size="5px">{$GLOBALS['threadfields']['stockpileoffering']} {$GLOBALS['threadfields']['trade_offer']}</font></td>
				</tr>
				<tr>
					<td><b><font size="5">For (Needing)</font></b></td>
					<td><font size="5">:</font></td>
					<td><font size="5">{$GLOBALS['threadfields']['stockpileneeding']} {$GLOBALS['threadfields']['trade_need']}</font></td>
				</tr>
				{$GLOBALS['threadfields']['scflang']}
				{$GLOBALS['threadfields']['scffounded']}
				<tr>
					<td><b><font size="5px">Fee</h3></font></b></td>
					<td><font size="5px">:</font></td>
					<td><b><font size="5px"></font></b></td>
				</tr>
				{$GLOBALS['threadfields']['scfslogan']}
			</table>
		</td>
	
		<td class="{$bgcolor}" width="50%">
			<table width="100%" border="0">
				<tr>
					<td align="center" valign="middle">
						<div class="author_avatar"><a href="{$post['profilelink_plain']}"><img src="{$useravatar['image']}" alt="" max-width="100px" max-height="100px" /></a></div>
					</td>
<td><table width="50%" colspan="{$colspan}">
<br class="clear" />
<tr>
<td><b><font size="4px">Ruler Name</font></b></td>
<td>:</td>
<td>{$thread['profilelink']}</td>
</tr>
<tr>
<td><b><font size="4px">Nation Name</font</b></td>
<td>:</td>
<td>{$memprofile['fid10']}</td>
</tr>
<tr>
<td><b><font size="4px">Link</font></b></td>
<td>:</td>
<td>Ans</td>
</table></td>
				</tr>
			</table>
		</td>
		{$modbit}
	</tr>
	<tr>
		<td class="tfoot" colspan="{$colspan}" align="center">
			{$thread['views']} {$lang->views},
			<a href="javascript:MyBB.whoPosted({$thread['tid']});">{$thread['replies']}</a>{$unapproved_posts} {$lang->replies},
			<a href="{$thread['lastpostlink']}">{$lang->lastpost}</a>: {$lastposterlink}, {$lastpostdate} {$lastposttime}
		</td>
	</tr>
</table>
<br />

Result: http://forum.international-union.com/for...php?fid=27

The custom profile field ID is 10, and it's Nations Nation Name. I tried all sorts of variables (excluding yours) but it don't work.

Your variable can't be tried because once I add the code to .php, it's a complete blank for the forum so there's no way to try while having the code in .php.
I'm new to MyBB, has been using WordPress and only know HTML/CSS.
Reply
#24
Not Solved
In your opening post you mentioned fid5. Try it then again with 10:


$query = $db->simple_select("userfields", "fid10", "ufid = {$thread['uid']}");
$thread['fid10'] = $db->fetch_array($query)['fid10'];


and change the following line in your template


<td>{$memprofile['fid10']}</td>

to:


<td>{$thread['fid10']}</td>
Regards, Ad Bakker (NL)
Reply
#25
Not Solved
Blackout!

Line 1311 to 1330

		{
			$attachment_count = '';
		}

		$plugins->run_hooks("forumdisplay_thread_end");
		
		$query = $db->simple_select("userfields", "fid10", "ufid = {$thread['uid']}");
$thread['fid10'] = $db->fetch_array($query)['fid10']; 
$query = $db->simple_select("users", "avatar, avatardimensions, username", "uid = {$thread['uid']}");
$avatar = $db->fetch_array($query);
$profilelink = get_profile_link($thread['uid']);
$thread['avatar'] = "";
if ($avatar['avatar'] != "")
{
    $useravatar = format_avatar($avatar['avatar'], $avatar['avatardimensions'], $mybb->settings['postmaxavatarsize']);
    $thread['avatar'] = "<div class=\"author_avatar\"><a href=\"{$profilelink}\"><img src=\"{$useravatar['image']}\" alt=\"\" {$useravatar['width_height']} /></a></div>";
} 


		eval("\$threads .= \"".$templates->get("forumdisplay_thread")."\";");
I'm new to MyBB, has been using WordPress and only know HTML/CSS.
Reply
#26
Not Solved
I see it go blank now, did you also make the change in the template?
Regards, Ad Bakker (NL)
Reply
#27
Not Solved
Yes, this time I remain all changes you asked me to, to show you it's blank.
I'm new to MyBB, has been using WordPress and only know HTML/CSS.
Reply
#28
Not Solved
OK, can you remove these 2 lines again, so that I can see the site again?
Regards, Ad Bakker (NL)
Reply
#29
Not Solved
(08-16-2015, 04:58 PM)Ad Bakker Wrote: OK, can you remove these 2 lines again, so that I can see the site again?

Done.
I'm new to MyBB, has been using WordPress and only know HTML/CSS.
Reply
#30
Not Solved
I am in your AdminCP now. But when I go to the forumdisplay_thread template of the Vienna theme, I see a completely different template than the one you posted some messages ago. Has this something to do with the XThreads plugin?
I can nowhere find any settings related to this plugin.
Regards, Ad Bakker (NL)
Reply
Jump to the post that solved this thread.


Forum Jump:


Users browsing this thread: 1 Guest(s)