Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Image Preview In Newthread And Editpost
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #11
RE: Image Preview In Newthread
If you mean by the "ready to copy" is, the text is copied to clipboard automatically by the button, unfortunately, no, Lee. The select button only select the entire text in the textbox.

   

We need to copy and paste it manually.

EDIT: The screenshot above comes from 1.6

(This post was last modified: 10-01-2010 03:49 AM by RateU.)
10-01-2010 03:47 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #12
RE: Image Preview In Newthread
(10-01-2010 03:47 AM)RateU Wrote:  If you mean by the "ready to copy" is, the text is copied to clipboard automatically by the button, unfortunately, no, Lee. The select button only select the entire text in the textbox.



We need to copy and paste it manually.

EDIT: The screenshot above comes from 1.6

Hi RateU - thanks for the screenshot.  What I mean is that when I press select then the text in the text box is not selected - that is it does not go blue. I also have a small formatting issue. I begin to think I have something ODD going on in my MYBB  installation.


Attached File(s) Thumbnail(s)
   


[Image: leelink.gif]
MYBB1.6 & XThreads
(This post was last modified: 10-01-2010 08:10 AM by leefish.)
10-01-2010 08:01 AM
Visit this user's website Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #13
RE: Image Preview In Newthread
May I know where exactly you put the variable in your newthread template, Lee?

10-02-2010 01:32 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #14
RE: Image Preview In Newthread
I did not add it to the newthread template as it is automatically included in newthreads.

Custom Thread Fields Wrote:The key through which this field is accessed through. Should be kept to alphanumeric characters, underscores (_) and hypens (-) only. Note that only inputs for this field on newthread/editpost are automatically added for you; forumdisplay/showthread etc templates aren't affected, so you will need to make changes to the relevant templates for this to be useful. Use {$GLOBALS['threadfields']['key']}  in templates to reference this field (this is slightly different for file inputs - more info given below if you choose to make a file input).

Its not using a separate template in the global templates, but the default template.  I have not yet tried with {$tfinputrow['key']}


[Image: leelink.gif]
MYBB1.6 & XThreads
(This post was last modified: 10-02-2010 02:01 AM by leefish.)
10-02-2010 02:00 AM
Visit this user's website Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #15
RE: Image Preview In Newthread
I mean the {$GLOBALS['threadfields']['key']['value']} variable. You didn't put it in your template?

10-02-2010 02:11 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #16
RE: Image Preview In Newthread
Well we dont need to. Its already in there - its automatic? In the newthread template there is {$extrathreadfields} and that covers this template. Right?

Hmm I put this in my template - and it selects the text correctly. BUT - I have the else function in there - so in theory I  will have to remake an entire newthreads template.

Why is that? Because I also use this field to make a little lightbox show....

I will work on it because
1) I really want it
2) I wanted to spruce up my newthreads template anyway Smile


[Image: leelink.gif]
MYBB1.6 & XThreads
(This post was last modified: 10-02-2010 03:47 AM by leefish.)
10-02-2010 03:20 AM
Visit this user's website Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #17
RE: Image Preview In Newthread
(10-02-2010 03:20 AM)leefish Wrote:  Well we dont need to. Its already in there - its automatic? In the newthread template there is {$extrathreadfields} and that covers this template. Right?

Really? What I know is:
{$GLOBALS['threadfields']['key']......} -> displaying the output.
{$extra_threadfields} -> displaying the input.

Because the thumbnail / preview is the output, and we put the layout in Display Format (output format), that's why we need to put the {$GLOBALS['threadfields']['key']......} variable there. The reason why I put this statement in first post:

(09-29-2010 04:37 AM)RateU Wrote:  We need to put {$GLOBALS['threadfields']['key']['value']} variable in our newthread or template_prefix_newthread template. In this example, because we use img1 as key, so, we need to put {$GLOBALS['threadfields']['img1']['value']} variable.

10-02-2010 04:02 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #18
RE: Image Preview In Newthread
Well, I just tested, and now on my newthreads template (in Post Preview mode) (by just adding the {$GLOBALS['threadfields']['key']['value']} variable) I now have the display twice. Remember I used the ELSE statement.

See Screenshots


Attached File(s) Thumbnail(s)
       


[Image: leelink.gif]
MYBB1.6 & XThreads
(This post was last modified: 10-02-2010 04:44 AM by leefish.)
10-02-2010 04:29 AM
Visit this user's website Find all posts by this user Quote this message in a reply
RateU Offline
Administrator
*******
Posts: 2,350
Joined: Mar 2010
Post: #19
RE: Image Preview In Newthread
I think I missed this edit:

(10-02-2010 03:20 AM)leefish Wrote:  Hmm I put this in my template - and it selects the text correctly. BUT - I have the else function in there - so in theory I  will have to remake an entire newthreads template.

Not always. We use the condition there just to get a new layout for newthread template. So, we can make it suitable with our newthread template. Try to make it has the same structure as newthread template.

(10-02-2010 03:20 AM)leefish Wrote:  Why is that? Because I also use this field to make a little lightbox show....

Do you mean you want the lightbox works in the preview too?


(10-02-2010 04:29 AM)leefish Wrote:  Well, I just tested, and now on my newthreads template (in Post Preview mode) (by just adding the {$GLOBALS['threadfields']['key']['value']} variable) I now have the display twice.

Where do you put the variable?

(10-02-2010 04:29 AM)leefish Wrote:  Remember I used the ELSE statement.

As said in the first post, we need to edit the Display Format, depends on how our Display Format layout before we change it. The else condition will make the change not affected to other layout for other page. So, basically, whatever you put in the else statement won't take any effect in newthread/editpost template.

About the attachment:
Could you post your newthread and the Display Format?

10-02-2010 05:03 AM
Find all posts by this user Quote this message in a reply
leefish Offline
Hamster
*****
Posts: 1,009
Joined: Apr 2010
Post: #20
RE: Image Preview In Newthread
Hi RateU

Display format:

HTML Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<if THIS_SCRIPT == 'newthread.php' OR THIS_SCRIPT == 'editpost.php' then>
	<tr>
		<td class="trow_sep" align="center" colspan="2"><strong>Image 1 Preview &amp; URL</strong></td>
	</tr>
	<tr>
		<td class="trow1" align="center">
			<img src="{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_pfpic_bbcode" type="text" size="40" value="[IMG]{$mybb->settings['bburl']}/{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="&lt;a href=&quot;{$mybb->settings['bburl']}/{URL}/thumb160x120&quot;&gt;{FILENAME}&lt;/a&gt;" 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="&lt;img src=&quot;{$mybb->settings['bburl']}/{URL}/thumb160x120&quot; alt=&quot;&quot; title=&quot;&quot; /&gt;" 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']}/{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>
<else>
<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></if>


Newthread

HTML Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<html>
<head>
<title>{$lang->newthread_in}</title>
{$headerinclude}
<script type="text/javascript" src="jscripts/post.js?ver=1400"></script>
</head>
<body>
{$header}
{$preview}
{$thread_errors}
{$attacherror}
{$newthread}
<form action="newthread.php?fid={$fid}&amp;processed=1" method="post" enctype="multipart/form-data" name="input">
<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead" colspan="2"><strong>{$lang->post_new_thread}</strong></td>
</tr>
{$loginbox}
<tr>
<td class="trow2" width="20%"><strong>{$lang->thread_subject}</strong></td>
<td class="trow2">{$prefixselect}<input type="text" class="textbox" name="subject" size="40" maxlength="85" value="{$subject}" tabindex="1" /></td>
</tr>
<if $GLOBALS['mybb']->user['usergroup'] == 4 || $GLOBALS['mybb']->user['usergroup'] == 8 then>{$tfinputrow['csbscr']}</if>
{$extra_threadfields}
{$GLOBALS['threadfields']['pfpic']['value']}
{$posticons}
<tr>
<td class="trow2" valign="top"><strong>{$lang->your_message}</strong>{$smilieinserter}</td>
<td class="trow2">
<textarea name="message" id="message" rows="20" cols="70" tabindex="2">{$message}</textarea>
{$codebuttons}
{$multiquote_external}
</td>
</tr>
<tr>
<td class="trow1" valign="top"><strong>{$lang->post_options}</strong></td>
<td class="trow1"><span class="smalltext">
<label><input type="checkbox" class="checkbox" name="postoptions[signature]" value="1" tabindex="7"{$postoptionschecked['signature']} /> {$lang->options_sig}</label>
{$disablesmilies}</span></td>
</tr>
{$modoptions}
{$subscriptionmethod}
{$pollbox}
{$captcha}
</table>
{$attachbox}
<br />
<div style="text-align:center"><input type="submit" class="button" name="submit" value="{$lang->post_thread}" tabindex="4" accesskey="s" />  <input type="submit" class="button" name="previewpost" value="{$lang->preview_post}" tabindex="5" />{$savedraftbutton}</div>
<input type="hidden" name="action" value="do_newthread" />
<input type="hidden" name="posthash" value="{$posthash}" />
<input type="hidden" name="attachmentaid" value="" />
<input type="hidden" name="attachmentact" value="" />
<input type="hidden" name="quoted_ids" value="{$quoted_ids}" />
<input type="hidden" name="tid" value="{$tid}" />
{$editdraftpid}
</form>
{$forumrules}
{$footer}
</body>
</html>


I was thinking of changing the else statement to include an "<if THIS_SCRIPT == 'showthread.php'  then>" to try and get round it.

No, I dont want the lightbox in the Post Preview, I just want the lightbox in the post Smile



[Image: leelink.gif]
MYBB1.6 & XThreads
10-02-2010 05:34 AM
Visit this user's website Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: