MyBB Hacks

Full Version: Image Preview In Newthread And Editpost
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6
May I know what is the {$newthread} variable in line #12 for, Lee?
I have no idea - I just copied  this whole block from the main templates and gave it a prefix, added the variable and that was it........I shall try and edit it out.

EDIT I edited it out - no change
I'm not quite sure whether that's the problem or not, though.
Well, I think I am going to have to make a template for it......
So, the layout still not fixed?
Nope, not fixed. May I ask what result you get on your MYBB 1.6 install using that template and display value?
I think I know the problem, Lee. Give me a little time.
I'm sorry for bumping.

OK, Lee. Do you have the {$GLOBALS['threadfields']['key']['value']} variable in your postbit too?
Ok RateU. Its got me baffled I must admit Ouch
You mean my postbit first? Yes, its all in there, not showthread.

HTML Code
{$ignore_bit}
<a name="pid{$post['pid']}" id="pid{$post['pid']}"></a>
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="{$post_extra_style} {$post_visibility}" id="post_{$post['pid']}">
	<tbody>
		<tr>
			<td class="tcat">
				<div class="float_left smalltext">
					{$post['postdate']}, {$post['posttime']} <span id="edited_by_{$post['pid']}"></span>
				</div>
				{$post['posturl']}
			</td>
		</tr>

		<tr>
			<td class="trow1 {$unapproved_shade}">
				<table cellspacing="0" cellpadding="0" border="0" style="width: 100%;">
					<tr>
						<td class="post_avatar" width="1" valign="bottom" style="{$post['avatar_padding']}">
						<img src="{$GLOBALS['threadfields']['pfpic']['url']}/thumb240x180" alt="" title="{$GLOBALS['threadfields']['pfname']}" />
						</td>
						<td class="post_author">
							<table border="0" width="40%" class="mediumtext">
								<tr>
									<td valign="top">Posted By</td>
									<td width="1" valign="top">:</td>
									<td valign="top"><strong><span class="mediumtext">{$post['profilelink']}</span></strong></td>
								</tr>
                                                                <tr>
									<td valign="top">Game Type</td>
									<td width="1" valign="top">:</td>
									<td valign="top">{$GLOBALS['threadfields']['prefix']}</td>
								</tr>
								<tr>
									<td valign="top">Game Category</td>
									<td width="1" valign="top">:</td>
									<td valign="top">{$GLOBALS['threadfields']['pfcat']}</td>
								</tr>
								<tr>
									<td valign="top">EPs Required</td>
									<td width="1" valign="top">:</td>
									<td valign="top">{$GLOBALS['threadfields']['dld_ep_prefix']}</td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
			</td>
		</tr>

		<tr>
			<td class="trow2 post_content {$unapproved_shade}">
				<div class="largetext" align="center"><strong>{$post['subject']}</strong></div>
                                 
				<div class="post_body" id="pid_{$post['pid']}">
					{$post['message']}
					{$post['attachments']}<br />	

{$GLOBALS['threadfields']['fupload']['value']} 
{$GLOBALS['threadfields']['fupload2']['value']} 
{$GLOBALS['threadfields']['fupload4']['value']} 

<br />                        
<div class="tfoot" style="largetext"><strong>Screenshots<strong>
<div class="smalltext">Click on a thumbnail to bring up the light box</div></div>

 <div>
			{$GLOBALS['threadfields']['pfpic']['value']}
			{$GLOBALS['threadfields']['pfapic1']['value']}
			{$GLOBALS['threadfields']['pfapic2']['value']}
			{$GLOBALS['threadfields']['pfapic3']['value']}</div>


				<div class="post_meta" id="post_meta_{$post['pid']}">
				{$post['iplogged']}
				</div>
			</td>
		</tr>

		<tr>
			<td class="trow1 post_buttons {$unapproved_shade}">
				<div class="author">
					
				</div>
				<div class="postbutton">{$post['button_edit']}{$post['button_quickdelete']}{$post['button_quote']}{$post['button_report']}{$post['button_warn']}
				</div>
			</td>
   </tbody>
</table>

EDIT:

OK. In this case, you need to move the layout inside the conditional to your previewpost template. It is under Ungrouped Templates. Create a new previewpost with a prefix.

Example:

HTML Code
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="clear: both; border-bottom-width: 0;">
<tr>
<td class="thead" colspan="2"><strong>{$lang->post_preview}</strong></td>
</tr>
</table>
{$postbit}
<br />
<form>
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="clear: both; border-bottom-width: 0;">
	<tr><td class="thead" colspan="2"><strong>Images Preview</strong></td></tr>
	<tr><td class="tcat" align="center" colspan="2"><strong>Image 1 Preview &amp; URL</strong></td></tr>
	<tr>
		<td class="trow1" align="center">
			<img src="{$GLOBALS['threadfields']['pfpic']['url']}/thumb160x120" alt="" title="" />
		</td>
		<td class="trow1" valign="top">
			<div class="float_left" style="width: 50%;">
				<strong>BBCODE - 160 x 120 Thumbnail</strong>
				<input name="prev_img1_bbcode" type="text" size="40" value="[IMG]{$mybb->settings['bburl']}/{$GLOBALS['threadfields']['pfpic']['url']}/thumb160x120[/IMG]" readonly="readonly" />
				<input type="button" value="Select" onClick="javascript:this.form.prev_pfpic_bbcode.focus();this.form.prev_pfpic_bbcode.select();">
			</div>
			<div class="float_left" style="width: 50%;">
				<strong>Direct Link</strong><br />
				<input name="prev_pfpic_dl" type="text" size="40" value="<func htmlspecialchars_uni><a href="{$mybb->settings['bburl']}/{$GLOBALS['threadfields']['pfpic']['url']}/thumb160x120">{$GLOBALS['threadfields']['pfpic']['filename']}</a></func>" readonly="readonly" />
				<input type="button" value="Select" onClick="javascript:this.form.prev_pfpic_dl.focus();this.form.prev_pfpic_dl.select();">
			</div>
			<div class="float_left" style="width: 50%;">
				<strong>HTML Code - 160 x 120 Thumbnail</strong>
				<input name="prev_pfpic_html" type="text" size="40" value="<func htmlspecialchars_uni><img src="{$mybb->settings['bburl']}/{$GLOBALS['threadfields']['pfpic']['url']}/thumb160x120" alt="" title="" /></func>" readonly="readonly" />
				<input type="button" value="Select" onClick="javascript:this.form.prev_pfpic_html.focus();this.form.prev_pfpic_html.select();">
			</div>
			<div class="float_left" style="width: 50%;">
				<strong>Full Size Image URL</strong>
				<input name="prev_pfpic_full" type="text" size="40" value="{$mybb->settings['bburl']}/{$GLOBALS['threadfields']['pfpic']['url']}" readonly="readonly" />
				<input type="button" value="Select" onClick="javascript:this.form.prev_pfpic_full.focus();this.form.prev_pfpic_full.select();">
			</div>
		</td>
	</tr>
</table>
</form>
<br />


Leave the contents inside the else condition in your Display Format.
Remove other additional code there. So, it will like the code before you edit the Display Format.
The contents of your Display Format should be only like this:

HTML Code
<a href="{URL}" rel="lightbox[find]"><img src="{URL}/thumb160x120" alt="{$thread['subject']} Screenshot" title="{$GLOBALS['threadfields']['pfpicdesc']}" style="border: 1px solid #C1C1C1; padding: 3px; margin: 3px;" /></a>

Pages: 1 2 3 4 5 6
Reference URL's