MyBB.de Forum

Normale Version: Related Threads
Du siehst gerade eine vereinfachte Darstellung unserer Inhalte. Normale Ansicht mit richtiger Formatierung.
Seiten: 1 2
Eine neue Erweiterung wurde veröffentlicht: Related Threads

Zitat:This plugin checks to see if there are already similar threads when we write new topic (using AJAX).
If yes, we can simply check them.

Admin can configure:
  • Additional (X)HTML code before related threads list (in global template)

  • Fulltext / LIKE search mode

  • Minimum length of phrase

  • Open links on new / the same window or tab

  • Excluded forums

  • Excluded words

  •  Search on the same forum

  • Max search threads age

  • Display forum info

  • Delay from press last key to search

  • Change all plugin templates    

INFO: This plugin add link to author website (only for web spiders). If you do not want this, do not use plugin, or make donate and contact author.
Eine neue Version wurde veröffentlicht: Related Threads 1.0.1
Hallo zusammen, ich bekomme das Plugin bei einen meiner Themes nicht zum Laufen genauer gesagt beim Netpen Theme. Das es bei manchen Plugins mit dem Theme nicht so einfach ist habe ich schon bemerkt, habe aber alle irgendwie zum Laufen bekommen, nur bei diesem Plugin schaffe ich es irgendwie nicht.

Das newthread Template sieht wie folgt aus:


PHP-Code:
<html>
<
head>
<
title>{$lang->newthread_in}</title>
{
$headerinclude}
<
script type="text/javascript" src="{$mybb->asset_url}/jscripts/post.js?ver=1800"></script>
{
$relatedThreadsJavaScript}</head>
<
body>
{
$header}
{
$preview}
{
$thread_errors}
{
$attacherror}
{
$moderation_notice}

<
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}/>
<
div class="reply-header">
<
h2>{$lang->thread_subject}</h2>
</
div>
<
div class="panel-body padding_0 trow1" style="border-radius: 3px;">
<
div class="col-sm-12 my_ptop" style="padding-left: 0px; padding-right: 0px;"  
 
<div class="col-sm-10 input-group-sm">
 <div class="re-subject">
       <input type="text" style="border: 2px solid rgba(91, 130, 164, 0.5);" name="subject" onkeyup="return relatedThreads.init(this.value);" class="form-control" placeholder="Erstelle ein neuen Thread " tabindex="1"><br />   <tr id="relatedThreadsRow" style="display:none;"><td class="trow2" valign="top"><strong>{$lang->relatedThreadsTitle}</strong></td><td class="trow2" id="relatedThreads">{$relatedThreads}</td></tr><br />
 </div>
     </div>
 <div class="col-sm-12" style="padding-bottom: 10px;">{$prefixselect}</div>
 </div>
<
div class="col-sm-8">
<
div class="panel-body padding_0 trow1" style="border-radius: 3px;">
<
textarea id="message" name="message" rows="25" style="width: 100%;" tabindex="2" >{$message}</textarea>
{
$codebuttons}
{
$multiquote_external
</
div>
<
div class="form-bottom"
{
$pollbox}
{
$captcha}
</
div>
</
div>
<
div class="col-sm-4 my_pbottom"
<
div class="post-icons">
<
h3><strong>{$lang->post_icon}</strong></h3>
<
div class="postico">
{
$extra_threadfields}{$posticons}
</
div>
</
div>
<
div class="text-left" 
<label><input type="checkbox" class="modal-check" name="postoptions[signature]" value="1" tabindex="7"{$postoptionschecked['signature']} /> {$lang->options_sig}</label>
{
$disablesmilies 
{$modoptions}
{
$subscriptionmethod}
</
div>
</
div>
</
div>
<
div class="attach-box">
{
$attachbox}{$guestterms}
</
div>
<
div class="actions-bottom" 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}
<
script type="text/javascript">
$(
".author_avatar img").error(function () {
$(
this).unbind("error").closest('.author_avatar').remove();
});
</
script>
</
body>
</
html


Wenn man nun aber ein Thread Titel einfügt wird keine Suche ausgeführt wie bei meinen anderen Themes. Komisch ist auch das schon ohne Eingabe eines Titels der Text "Ähnliche Themen" angezeigt wird. Dieser erscheint ja eigentlich erst wenn man ein Betreff eingibt der Ähnlich mit anderen Thread Titeln ist.

[attachment=12119]

Hat jemand eine Idee woran es liegen könnte?
Hast Du in dem Template newthread mal
Code:
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/post.js?ver=1800"></script>
durch
Code:
{$post_javascript}
gemaß Änderung in MyBB 1.8.18 ersetzt?

Funktioniert das Plugin ein einem anderen Theme und wenn ja, hast Du die Templates mal verglichen?
In mein anderen Theme funktioniert das Plugin ohne Probleme.

Dort ist das Template:
PHP-Code:
<html>
<
head>
<
title>{$lang->newthread_in}</title>
{
$headerinclude}
<
script type="text/javascript" src="{$mybb->asset_url}/jscripts/post.js?ver=1813"></script>
{
$relatedThreadsJavaScript}</head>
<
body>
{
$header}
{
$preview}
{
$thread_errors}
{
$attacherror}
{
$moderation_notice}
<
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" onkeyup="return relatedThreads.init(this.value);" size="40" maxlength="85" value="{$subject}tabindex="1" /></td>
</
tr>
<
tr id="relatedThreadsRow" style="display:none;"><td class="trow2" valign="top"><strong>{$lang->relatedThreadsTitle}</strong></td><td class="trow2" id="relatedThreads">{$relatedThreads}</td></tr>{$extra_threadfields}{$posticons}
<
tr>
<
td class="trow2" valign="top"><strong>{$lang->your_message}</strong>{$smilieinserter}<!-- TableGenerator -->{$tabgen_button}<!-- /TableGenerator --></td>
<
td class="trow2">
<
textarea name="message" id="message" rows="20" cols="70" tabindex="2">{$message}</textarea>
{
$codebuttons}
{
$multiquote_external}
</
td>
</
tr>
{
$postoptions}
{
$modoptions}
{
$subscriptionmethod}
{
$pollbox}
{
$captcha}
</
table>
{
$attachbox}{$guestterms}
<
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}
<
script type="text/javascript">
$(
".author_avatar img").error(function () {
$(
this).unbind("error").closest('.author_avatar').remove();
});
</
script>
</
body>
</
html

Das einzige was mir auffällt ist die etwas andere Anordnung der Codes und das

PHP-Code:
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/post.js?ver=1800"></script

dort

PHP-Code:
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/post.js?ver=1813"></script
ist habe es geändert aber es geht trotzdem nicht, auch mit
PHP-Code:
{$post_javascript
passiert nix
Es könnte am dem Javascript des Plugins liegen. Dort wird eine HTML Ersetzung vorgenommen, die es so bei dem NetPen Theme u.U. nicht gibt.....
MyBB nutzt noch die Table-Struktur, während das NetPen Theme alles mit div's macht.
Ok ich habe jetzt einfach mal das komplette Netpen newthread Template gegen das Template von Theme wo das Plugin geht getauscht.

Jetzt ist die Frage kann es zu Probleme im Netpen Theme kommen, wenn das newthread Template jetzt table anstelle von div´s benutzt? Wenn ich das table Template nutze, geht das Plugin auch im Netpen Theme. Was aber dann komisch dargestellt wird, sind die Optionen Thema schließen usw., die werden anstelle unter dem Editor über dem Editor angezeigt, wird die Position dafür über ein anderes Template definiert?


[attachment=12123]
(02.09.2018, 18:56)lenox schrieb: [ -> ]....kann es zu Probleme im Netpen Theme kommen, wenn das newthread Template jetzt table anstelle von div´s benutzt?
Kann ich nicht 100%ig sagen, aber responsive wird das Theme dann vermutlich nicht mehr sein....
(02.09.2018, 18:56)lenox schrieb: [ -> ]Was aber dann komisch dargestellt wird, sind die Optionen Thema schließen usw., die werden anstelle unter dem Editor über dem Editor angezeigt, wird die Position dafür über ein anderes Template definiert?
Du könntest mal den Quelltext der Seite (die im Screenshot) durch einen HTML-Validator laufen und mögliche Fehler dadurch ermitteln lassen.....
@lenox probier mal dieses Template für Netpen

Code:
<html>
<head>
<title>{$lang->newthread_in}</title>
{$headerinclude}
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/post.js?ver=1800"></script>
{$relatedThreadsJavaScript}</head>
<body>
{$header}
{$preview}
{$thread_errors}
{$attacherror}
{$moderation_notice}

<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}" />
<div class="reply-header">
<h2>{$lang->thread_subject}</h2>
</div>
<div class="panel-body padding_0 trow1" style="border-radius: 3px;">
<div class="col-sm-12 my_ptop" style="padding-left: 0px; padding-right: 0px;">  
  <div class="col-sm-10 input-group-sm">
      <div class="re-subject">
        <input type="text" style="border: 2px solid rgba(91, 130, 164, 0.5);" name="subject" onkeyup="return relatedThreads.init(this.value);" class="form-control" placeholder="Create New Thread " tabindex="1"><br />
      </div>
      </div>
  <div class="col-sm-2" style="padding-bottom: 10px;">{$prefixselect}<input type="text" class="textbox" name="subject" onkeyup="return relatedThreads.init(this.value);" size="40" maxlength="85" value="{$subject}" tabindex="1" /></div>
  </div>
<div class="col-sm-8">
<div class="panel-body padding_0 trow1" style="border-radius: 3px;">
<textarea id="message" name="message" rows="25" style="width: 100%;" tabindex="2" >{$message}</textarea>
{$codebuttons}
{$multiquote_external}
</div>
<div class="form-bottom">
{$pollbox}
{$captcha}
</div>
</div>
<div class="col-sm-4 my_pbottom">
<div class="post-icons">
<h3><strong>{$lang->post_icon}</strong></h3>
<div class="postico">
{$posticons}
</div>
</div>
    
    <div id="relatedThreadsRow" style="display:none;">
        <div class="post-icons" valign="top"><h3><strong>{$lang->relatedThreadsTitle}</strong></h3></div>
        <div class="postico" id="relatedThreads">{$relatedThreads}</div>
    </div>

<div class="text-left">  
<label><input type="checkbox" class="modal-check" name="postoptions[signature]" value="1" tabindex="7"{$postoptionschecked['signature']} /> {$lang->options_sig}</label>
{$disablesmilies}  
{$modoptions}
{$subscriptionmethod}
</div>
</div>
</div>
<div class="attach-box">
{$attachbox}
</div>
<div class="actions-bottom" 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}
<script type="text/javascript">
    $(".author_avatar img").error(function () {
        $(this).unbind("error").closest('.author_avatar').remove();
    });
</script>
</body>
</html>

Ich weiß nicht, wie weit das Netpen-Theme gepflegt ist und die Anpassungen der Upgrades gemacht wurden. Hab mit dem aktuellen Download etwas herum gespielt. Ggf. musst du also noch MyBB-Anpassungen nachpflegen; so, hab mal kurz gecheckt im Vergleich zur 1.8.1, da sind alle Änderungen drin; waren ja nicht so viele Wink
(02.09.2018, 21:48)bv64 schrieb: [ -> ]@lenox probier mal dieses Template für Netpen

Code:
<html>
<head>
<title>{$lang->newthread_in}</title>
{$headerinclude}
<script type="text/javascript" src="{$mybb->asset_url}/jscripts/post.js?ver=1800"></script>
{$relatedThreadsJavaScript}</head>
<body>
{$header}
{$preview}
{$thread_errors}
{$attacherror}
{$moderation_notice}

<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}" />
<div class="reply-header">
<h2>{$lang->thread_subject}</h2>
</div>
<div class="panel-body padding_0 trow1" style="border-radius: 3px;">
<div class="col-sm-12 my_ptop" style="padding-left: 0px; padding-right: 0px;">  
 <div class="col-sm-10 input-group-sm">
 <div class="re-subject">
       <input type="text" style="border: 2px solid rgba(91, 130, 164, 0.5);" name="subject" onkeyup="return relatedThreads.init(this.value);" class="form-control" placeholder="Create New Thread " tabindex="1"><br />
 </div>
     </div>
 <div class="col-sm-2" style="padding-bottom: 10px;">{$prefixselect}<input type="text" class="textbox" name="subject" onkeyup="return relatedThreads.init(this.value);" size="40" maxlength="85" value="{$subject}" tabindex="1" /></div>
 </div>
<div class="col-sm-8">
<div class="panel-body padding_0 trow1" style="border-radius: 3px;">
<textarea id="message" name="message" rows="25" style="width: 100%;" tabindex="2" >{$message}</textarea>
{$codebuttons}
{$multiquote_external}
</div>
<div class="form-bottom">
{$pollbox}
{$captcha}
</div>
</div>
<div class="col-sm-4 my_pbottom">
<div class="post-icons">
<h3><strong>{$lang->post_icon}</strong></h3>
<div class="postico">
{$posticons}
</div>
</div>

<div id="relatedThreadsRow" style="display:none;">
<div class="post-icons" valign="top"><h3><strong>{$lang->relatedThreadsTitle}</strong></h3></div>
<div class="postico" id="relatedThreads">{$relatedThreads}</div>
</div>

<div class="text-left">  
<label><input type="checkbox" class="modal-check" name="postoptions[signature]" value="1" tabindex="7"{$postoptionschecked['signature']} /> {$lang->options_sig}</label>
{$disablesmilies}  
{$modoptions}
{$subscriptionmethod}
</div>
</div>
</div>
<div class="attach-box">
{$attachbox}
</div>
<div class="actions-bottom" 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}
<script type="text/javascript">
$(".author_avatar img").error(function () {
$(this).unbind("error").closest('.author_avatar').remove();
});
</script>
</body>
</html>

Ich weiß nicht, wie weit das Netpen-Theme gepflegt ist und die Anpassungen der Upgrades gemacht wurden. Hab mit dem aktuellen Download etwas herum gespielt. Ggf. musst du also noch MyBB-Anpassungen nachpflegen; so, hab mal kurz gecheckt im Vergleich zur 1.8.1, da sind alle Änderungen drin; waren ja nicht so viele Wink

Du bist der beste Big Grin  Ähnliche Themen werden angezeigt, danke dir herzlich.

[attachment=12125]
Seiten: 1 2