Post by Ben Goodman on May 6, 2018 2:50:11 GMT -8
So I have code which is triggered by a button next to quick reply. It simply creates a fixed div next to the forum content with the posts in it:
It is placed inside my post list template. Full code:
My "thread" template, if it is required:
Please help!
<div id="side-post" style="
display:none;
bottom: 20%;
right: 3%;
position:fixed;
width:18%;
background-color:black;
max-height:60%;
overflow:auto;
border-radius:6px;
overflow-x: hidden;
border-top: #ccc 1px solid;
border-right: #ccc 1px solid;
border-bottom: #ccc 1px solid;
border-left: #ccc 1px solid;
">{foreach $[post]}$[post.created_by]:<br><br><br>$[post.message]</div> {/foreach}
It is placed inside my post list template. Full code:
{foreach $[post]}
<tr id="$[post.content_id]" class="$[post.content_class]{if $[post.even]} even{/if}{if $[viewing_recent_posts]} recent{/if}">
<td class="$[post.thread.first_post.unblocked_class]">
<table role="grid">
<tr>
<td class="left-panel" rowspan="2">
$[post.created_by.miniprofile]
</td>
<td class="content">
<article>
<div class="content-head ui-helper-clearfix">
<div class="info">
$[post.thread]
<span class="date">$[post.created_on]</span>
{if $[post.how_posted]}
<span class="post-method">via $[post.how_posted]</span>
{/if}
$[post.likes]
</div>
<div class="controls">
$[post.quote_button]
$[post.edit_button]
$[post.likes.button]
$[post.select_options]
</div>
</div>
<h3 class="title aria-hidden"> $[post.created_by.name] - $[post.created_on]</h3>
<div class="message">$[post.message]</div>
</article>
</td>
</tr>
<tr>
<td class="foot">
{if $[post.edited]}
<div class="edited_by"><span class="italic">Utoljรกra szerkesztve:</span> $[post.edited.by_user] รกltal, ekkor: $[post.edited.date]{if $[post.edited.reason]}. Indok: $[post.edited.reason]{/if}</div>
{/if}
{if $[post.created_by.signature]}
<hr>
<div class="signature"><center>$[post.created_by.signature]</center></div>
{/if}
</td>
</tr>
</table>
</td>
{if $[post.is_blocked]}
<td class="$[post.blocked_class] content center">
<div class="message note pad-bottom">Kedves jรกtรฉkos! <br><br> Mivel blokkoltad a felhasznรกlรณt, ezรฉrt elrejtettรผk a hozzรกszรณlรกsรกt.</div>
$[post.display_blocked_post_button]
</td>
{/if}
</tr>
{/foreach}
{if !$[post]}
<tr class="last"><td class="last center" colspan="1">Nem talรกlhatรณ hozzรกszรณlรกs.</td></tr>
{/if}
<div id="side-post" style="
display:none;
bottom: 20%;
right: 3%;
position:fixed;
width:18%;
background-color:black;
max-height:60%;
overflow:auto;
border-radius:6px;
overflow-x: hidden;
border-top: #ccc 1px solid;
border-right: #ccc 1px solid;
border-bottom: #ccc 1px solid;
border-left: #ccc 1px solid;
">{foreach $[post]}$[post.created_by]:<br><br><br>$[post.message]</div> {/foreach}
But even if it set to "display:none" by default, the code messes up my forum.My "thread" template, if it is required:
<script>
$("body").bind('copy', function (e) {
if (typeof window.getSelection == "undefined") return; //IE8 or earlier...
var body_element = document.getElementsByTagName('body')[0];
var selection = window.getSelection();
//if the selection is short let's not annoy our users
if (("" + selection).length < 800) return;
//create a div outside of the visible area
//and fill it with the selected text
var newdiv = document.createElement('div');
newdiv.style.position = 'absolute';
newdiv.style.left = '-99999px';
body_element.appendChild(newdiv);
newdiv.appendChild(selection.getRangeAt(0).cloneContents());
//we need a <pre> tag workaround
//otherwise the text inside "pre" loses all the line breaks!
if (selection.getRangeAt(0).commonAncestorContainer.nodeName == "PRE") {
newdiv.innerHTML = "<pre>" + newdiv.innerHTML + "</pre>";
}
newdiv.innerHTML += "<br /><br />Olvass tรถbbet itt: <a href='"
+ document.location.href + "'>"
+ document.location.href + "</a> © Fantรกzia Birodalma";
selection.selectAllChildren(newdiv);
window.setTimeout(function () { body_element.removeChild(newdiv); }, 200);
});
</script>
{if $[thread.id]==902}
<meta http-equiv="refresh" content="0; url=http://fantaziabirodalma.boards.net/page/gyik" />
{/if}
{if $[thread.id]==852}
<body style="background-image:url(https://i.imgur.com/XGkQyJV.png);background-attachment: fixed !important;">
{/if}
{if $[thread.id]==275}
<body style="background-image:url(https://i.imgur.com/uZX0KcZ.png);background-attachment: fixed !important;">
{/if}
<body style="{foreach $[current_user.mini_custom_field]}{if $[current_user.mini_custom_field.name] == "Profil hรกttรฉr"}background-image:url('$[current_user.mini_custom_field.value]');background-attachment: fixed;background-repeat: repeat; {/if}{/foreach}">
<div class="container posts">
<a name="teteje"></a>
<div align="right"><a href="#alja"><img title="Az oldal aljรกra" src="https://s25.postimg.cc/okuxcunhb/down_2_zpsk7pysii1.png"></a></div> <a href="javascript:fbshareCurrentPage()" target="_blank" alt="Megosztรกs a Facebookon"><div style="background-color:black; width:110px; height:25px; border-radius: 10px; border: 1px solid grey;"><table>
<tr>
<th><img src="http://cdn.mysitemyway.com/icons-watermarks/flat-circle-white-on-black/social-media/social-media_facebook-square/social-media_facebook-square_flat-circle-white-on-black_512x512.png" style="height: 25px;"></th>
<th><font color="white"><b>Megosztรกs</b></font></th>
</tr>
</table></div></a><br>
{if $[thread.id]==792}{if $[current_user.is_member]}<br><center><div style="background-color:black; border:solid 2px blue";>
<table><tr><td><img stlye="box-shadow: 0px 0px 10px blue;" src="https://s25.postimg.cc/o78ulmndr/whispering.png"></td> <td><i>Shhh...!<br><br> Ezen a jรกtรฉktรฉren rejtett hozzรกszรณlรกsok talรกlhatรณk, hogy minden jรกtรฉkos egyenl? esรฉllyel tudjon jรกtszani. Amennyiben olvasni szeretnรฉd a tรถrtรฉnรฉseket, รญrj egy privรกt รผzenetet a <a href="http://fantaziabirodalma.boards.net/user/8">vilรกgvezet?nek</a>.</i></td></tr></table></div></center><br>
{/if}{/if}
<div class="title-bar">
{if $[reply_button]}
<ul class="controls"><li>$[reply_button]</li></ul>
{/if}
<h1>$[thread.subject]</h1>
</div>
<div class="control-bar ui-helper-clearfix $[scroll_class]">
$[search]
<div class="controls">
$[action_menu]
</div>
<div class="float-left">$[thread.icons]</div>
$[pagination]
</div>
<div class="content cap-bottom">
$[thread.labels]
$[poll]
<table class="list" role="presentation">
<tbody class="$[list_class]">
$[post_list]
</tbody>
</table>
{if !$[quick_reply]}{if $[bottom_reply_button]}
<div class="reply_button pad-all-double">$[bottom_reply_button]<br class="clear" /></div>
{/if}{/if}
</div>
</div>
<a name="alja"></a>
<div align="right"><a href="#teteje"><img title="Az oldal tetejรฉre" src="https://s25.postimg.cc/9japvzs67/up_zpsbokdhbje.png"></a></div>
{if $[thread.id]==145}{if $[current_user.is_member]}<br><center><div style="background-color:black; border:solid 2px green";>
<table><tr><td><img stlye="box-shadow: 0px 0px 10px blue;" src="http://i.imgur.com/ja3edvI.png"></td> <td>Ha huzamosabb ideig leszel tรกvol, ne felejtsd el bekapcsolni a <b>Szabadsรกg mรณdot</b> a <a href="http://fantaziabirodalma.boards.net/user/$[current_user.id]/personal">Profilodon</a>!</td></tr></table></div></center><br>
{/if}{/if}
$[quick_reply]
Please help!