22.04.2015, 16:14
Kann ich so leider nicht nachvollziehen. Local werden mir nur zwei Beschreibungsmöglichkeiten ausgegeben. Sicher das Du das Plugin deinstalliert hattest und nich nur deaktiviert ?
(22.04.2015, 16:14)MrBrechreiz schrieb: [ -> ]Kann ich so leider nicht nachvollziehen. Local werden mir nur zwei Beschreibungsmöglichkeiten ausgegeben. Sicher das Du das Plugin deinstalliert hattest und nich nur deaktiviert ?
<?php
/**
* Thread Description
* Copyright 2013 Starpaul20
*/
// Disallow direct access to this file for security reasons
if(!defined("IN_MYBB"))
{
die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}
// Neat trick for caching our custom template(s)
if(my_strpos($_SERVER['PHP_SELF'], 'forumdisplay.php'))
{
global $templatelist;
if(isset($templatelist))
{
$templatelist .= ',';
}
$templatelist .= 'forumdisplay_thread_description,forumdisplay_thread_description_2';
}
if(my_strpos($_SERVER['PHP_SELF'], 'newthread.php'))
{
global $templatelist;
if(isset($templatelist))
{
$templatelist .= ',';
}
$templatelist .= 'description,description_2';
}
if(my_strpos($_SERVER['PHP_SELF'], 'editpost.php'))
{
global $templatelist;
if(isset($templatelist))
{
$templatelist .= ',';
}
$templatelist .= 'description,description_2';
}
if(my_strpos($_SERVER['PHP_SELF'], 'search.php'))
{
global $templatelist;
if(isset($templatelist))
{
$templatelist .= ',';
}
$templatelist .= 'forumdisplay_thread_description,forumdisplay_thread_description_2';
}
// Tell MyBB when to run the hooks
$plugins->add_hook("forumdisplay_thread", "threaddescription_forum_description");
$plugins->add_hook("showthread_start", "threaddescription_description");
$plugins->add_hook("search_results_thread", "threaddescription_forum_description");
$plugins->add_hook("newthread_start", "threaddescription_newthread");
$plugins->add_hook("newthread_do_newthread_end", "threaddescription_do_newthread");
$plugins->add_hook("editpost_end", "threaddescription_editpost");
$plugins->add_hook("editpost_do_editpost_end", "threaddescription_do_editpost");
// The information that shows up on the plugin manager
function threaddescription_info()
{
return array(
"name" => "Thread Description",
"description" => "Allows users to enter a short description underneath the thread subject.",
"website" => "http://galaxiesrealm.com/index.php",
"author" => "Starpaul20",
"authorsite" => "http://galaxiesrealm.com/index.php",
"version" => "1.0",
"guid" => "c8ec620e5d6ef6208474dcba023d2219",
"compatibility" => "18*"
);
}
// This function runs when the plugin is installed.
function threaddescription_install()
{
global $db;
threaddescription_uninstall();
$db->add_column("threads", "description", "varchar(240) NOT NULL AFTER subject");
$db->add_column("threads", "description_2", "varchar(240) NOT NULL AFTER subject");
$db->add_column("threads", "description_3", "varchar(240) NOT NULL AFTER subject");
$db->add_column("threads", "description_4", "varchar(240) NOT NULL AFTER subject");
}
// Checks to make sure plugin is installed
function threaddescription_is_installed()
{
global $db;
if($db->field_exists("description", "threads"))
{
return true;
}
return false;
if($db->field_exists("description_2,description_3,description_4", "threads"))
{
return true;
}
return false;
}
// This function runs when the plugin is uninstalled.
function threaddescription_uninstall()
{
global $db;
if($db->field_exists("description", "threads"))
{
$db->drop_column("threads", "description");
}
if($db->field_exists("description_2,description_3,description_4", "threads"))
{
$db->drop_column("threads", "description_2,description_3,description_4");
}
}
// This function runs when the plugin is activated.
function threaddescription_activate()
{
global $db;
$insert_array = array(
'title' => 'description',
'template' => $db->escape_string('<tr>
<td class="trow2"><strong>{$lang->description}</strong></td>
<td class="trow2"><input type="text" class="textbox" name="description" size="40" maxlength="240" value="{$description}" tabindex="2" /></td>
</tr>'),
'sid' => '-1',
'version' => '',
'dateline' => TIME_NOW
);
$db->insert_query("templates", $insert_array);
$insert_array = array(
'title' => 'forumdisplay_thread_description',
'template' => $db->escape_string('<em><span class="smalltext" style="background: url(\'images/nav_bit.gif\') no-repeat left; padding-left: 18px;">{$description}</span></em><br />'),
'sid' => '-1',
'version' => '',
'dateline' => TIME_NOW
);
$db->insert_query("templates", $insert_array);
$insert_array = array(
'title' => 'description_2',
'template' => $db->escape_string('<tr>
<td class="trow2"><strong>{$lang->description}</strong></td>
<td class="trow2"><input type="text" class="textbox" name="description_2" size="40" maxlength="240" value="{$description_2}" tabindex="2" /></td>
</tr>'),
'sid' => '-1',
'version' => '',
'dateline' => TIME_NOW
);
$db->insert_query("templates", $insert_array);
$insert_array = array(
'title' => 'forumdisplay_thread_description_2',
'template' => $db->escape_string('<em><span class="smalltext" style="background: url(\'images/nav_bit.gif\') no-repeat left; padding-left: 18px;">{$description_2}</span></em><br />'),
'sid' => '-1',
'version' => '',
'dateline' => TIME_NOW
);
$db->insert_query("templates", $insert_array);
include MYBB_ROOT."/inc/adminfunctions_templates.php";
find_replace_templatesets("editpost", "#".preg_quote('{$posticons}')."#i", '{$threaddescription}{$threaddescription_2}{$posticons}');
find_replace_templatesets("newthread", "#".preg_quote('{$posticons}')."#i", '{$threaddescription}{$threaddescription_2}{$posticons}');
find_replace_templatesets("showthread", "#".preg_quote('{$thread[\'subject\']}</strong>')."#i", '{$thread[\'subject\']}</strong><br />{$thread[\'description\']}<br />{$thread[\'description_2\']}');
find_replace_templatesets("forumdisplay_thread", "#".preg_quote('{$thread[\'profilelink\']}')."#i", '{$thread[\'description\']}{$thread[\'description_2\']}{$thread[\'profilelink\']}');
find_replace_templatesets("search_results_threads_thread", "#".preg_quote('{$thread[\'profilelink\']}')."#i", '{$thread[\'description\']}{$thread[\'description_2\']}{$thread[\'profilelink\']}');
$insert_array = array(
'title' => 'description_3',
'template' => $db->escape_string('<tr>
<td class="trow2"><strong>{$lang->description}</strong></td>
<td class="trow2"><input type="text" class="textbox" name="description_3" size="40" maxlength="240" value="{$description_3}" tabindex="2" /></td>
</tr>'),
'sid' => '-1',
'version' => '',
'dateline' => TIME_NOW
);
$db->insert_query("templates", $insert_array);
$insert_array = array(
'title' => 'forumdisplay_thread_description_3',
'template' => $db->escape_string('<em><span class="smalltext" style="background: url(\'images/nav_bit.gif\') no-repeat left; padding-left: 18px;">{$description_3}</span></em><br />'),
'sid' => '-1',
'version' => '',
'dateline' => TIME_NOW
);
$db->insert_query("templates", $insert_array);
include MYBB_ROOT."/inc/adminfunctions_templates.php";
find_replace_templatesets("editpost", "#".preg_quote('{$posticons}')."#i", '{$threaddescription}{$threaddescription_3}{$posticons}');
find_replace_templatesets("newthread", "#".preg_quote('{$posticons}')."#i", '{$threaddescription}{$threaddescription_3}{$posticons}');
find_replace_templatesets("showthread", "#".preg_quote('{$thread[\'subject\']}</strong>')."#i", '{$thread[\'subject\']}</strong><br />{$thread[\'description\']}<br />{$thread[\'description_3\']}');
find_replace_templatesets("forumdisplay_thread", "#".preg_quote('{$thread[\'profilelink\']}')."#i", '{$thread[\'description\']}{$thread[\'description_3\']}{$thread[\'profilelink\']}');
find_replace_templatesets("search_results_threads_thread", "#".preg_quote('{$thread[\'profilelink\']}')."#i", '{$thread[\'description\']}{$thread[\'description_3\']}{$thread[\'profilelink\']}');
}
$insert_array = array(
'title' => 'description_4',
'template' => $db->escape_string('<tr>
<td class="trow2"><strong>{$lang->description}</strong></td>
<td class="trow2"><input type="text" class="textbox" name="description_2" size="40" maxlength="240" value="{$description_4}" tabindex="2" /></td>
</tr>'),
'sid' => '-1',
'version' => '',
'dateline' => TIME_NOW
);
$db->insert_query("templates", $insert_array);
$insert_array = array(
'title' => 'forumdisplay_thread_description_4',
'template' => $db->escape_string('<em><span class="smalltext" style="background: url(\'images/nav_bit.gif\') no-repeat left; padding-left: 18px;">{$description_4}</span></em><br />'),
'sid' => '-1',
'version' => '',
'dateline' => TIME_NOW
);
$db->insert_query("templates", $insert_array);
include MYBB_ROOT."/inc/adminfunctions_templates.php";
find_replace_templatesets("editpost", "#".preg_quote('{$posticons}')."#i", '{$threaddescription}{$threaddescription_4}{$posticons}');
find_replace_templatesets("newthread", "#".preg_quote('{$posticons}')."#i", '{$threaddescription}{$threaddescription_4}{$posticons}');
find_replace_templatesets("showthread", "#".preg_quote('{$thread[\'subject\']}</strong>')."#i", '{$thread[\'subject\']}</strong><br />{$thread[\'description\']}<br />{$thread[\'description_4\']}');
find_replace_templatesets("forumdisplay_thread", "#".preg_quote('{$thread[\'profilelink\']}')."#i", '{$thread[\'description\']}{$thread[\'description_4\']}{$thread[\'profilelink\']}');
find_replace_templatesets("search_results_threads_thread", "#".preg_quote('{$thread[\'profilelink\']}')."#i", '{$thread[\'description\']}{$thread[\'description_4\']}{$thread[\'profilelink\']}');
}
// This function runs when the plugin is deactivated.
function threaddescription_deactivate()
{
global $db;
$db->delete_query("templates", "title IN('description','forumdisplay_thread_description','description_2','forumdisplay_thread_description_2','description_3','forumdisplay_thread_description_3,'description_4','forumdisplay_thread_description_4'')");
include MYBB_ROOT."/inc/adminfunctions_templates.php";
find_replace_templatesets("forumdisplay_thread", "#".preg_quote('{$thread[\'description\']}{$thread[\'description_2\']}')."#i", '', 0);
find_replace_templatesets("search_results_threads_thread", "#".preg_quote('{$thread[\'description\']}{$thread[\'description_2\']}')."#i", '', 0);
find_replace_templatesets("showthread", "#".preg_quote('<br />{$thread[\'description\']}<br />{$thread[\'description_2\']}')."#i", '', 0);
find_replace_templatesets("newthread", "#".preg_quote('{$threaddescription}{$threaddescription_2}')."#i", '', 0);
find_replace_templatesets("editpost", "#".preg_quote('{$threaddescription}{$threaddescription_2}')."#i", '', 0);
include MYBB_ROOT."/inc/adminfunctions_templates.php";
find_replace_templatesets("forumdisplay_thread", "#".preg_quote('{$thread[\'description\']}{$thread[\'description_3\']}')."#i", '', 0);
find_replace_templatesets("search_results_threads_thread", "#".preg_quote('{$thread[\'description\']}{$thread[\'description_3\']}')."#i", '', 0);
find_replace_templatesets("showthread", "#".preg_quote('<br />{$thread[\'description\']}<br />{$thread[\'description_3\']}')."#i", '', 0);
find_replace_templatesets("newthread", "#".preg_quote('{$threaddescription}{$threaddescription_3}')."#i", '', 0);
find_replace_templatesets("editpost", "#".preg_quote('{$threaddescription}{$threaddescription_3}')."#i", '', 0);
include MYBB_ROOT."/inc/adminfunctions_templates.php";
find_replace_templatesets("forumdisplay_thread", "#".preg_quote('{$thread[\'description\']}{$thread[\'description_4\']}')."#i", '', 0);
find_replace_templatesets("search_results_threads_thread", "#".preg_quote('{$thread[\'description\']}{$thread[\'description_4\']}')."#i", '', 0);
find_replace_templatesets("showthread", "#".preg_quote('<br />{$thread[\'description\']}<br />{$thread[\'description_4\']}')."#i", '', 0);
find_replace_templatesets("newthread", "#".preg_quote('{$threaddescription}{$threaddescription_4}')."#i", '', 0);
find_replace_templatesets("editpost", "#".preg_quote('{$threaddescription}{$threaddescription_4}')."#i", '', 0);
}
// Show description on forumdisplay and search results
function threaddescription_forum_description()
{
global $thread, $templates;
if($thread['description'])
{
$description = htmlspecialchars_uni($thread['description']);
eval("\$thread['description'] = \"".$templates->get("forumdisplay_thread_description")."\";");
}
if($thread['description_2'])
{
$description_2 = htmlspecialchars_uni($thread['description_2']);
eval("\$thread['description_2'] = \"".$templates->get("forumdisplay_thread_description_2")."\";");
}
if($thread['description_3'])
{
$description_2 = htmlspecialchars_uni($thread['description_3']);
eval("\$thread['description_3'] = \"".$templates->get("forumdisplay_thread_description_3")."\";");
}
if($thread['description_4'])
{
$description_2 = htmlspecialchars_uni($thread['description_4']);
eval("\$thread['description_4'] = \"".$templates->get("forumdisplay_thread_description_4")."\";");
}
}
// Show description on showthread
function threaddescription_description()
{
global $thread;
if($thread['description'])
{
$description = htmlspecialchars_uni($thread['description']);
$thread['description'] = "<em><span class=\"smalltext\">{$description}</span></em>";
}
if($thread['description_2'])
{
$description_2 = htmlspecialchars_uni($thread['description_2']);
$thread['description_2'] = "<em><span class=\"smalltext\">{$description_2}</span></em>";
}
if($thread['description_3'])
{
$description_3 = htmlspecialchars_uni($thread['description_3']);
$thread['description_3'] = "<em><span class=\"smalltext\">{$description_3}</span></em>";
}
if($thread['description_4'])
{
$description_4 = htmlspecialchars_uni($thread['description_4']);
$thread['description_4'] = "<em><span class=\"smalltext\">{$description_4}</span></em>";
}
}
// Add description on new thread
function threaddescription_newthread()
{
global $db, $lang, $mybb, $templates, $post_errors, $thread, $threaddescription, $description, $threaddescription_2, $description_2;
$lang->load("description");
if($mybb->input['previewpost'] || $post_errors)
{
$description = htmlspecialchars_uni($mybb->input['description']);
}
else
{
$description = htmlspecialchars_uni($thread['description']);
}
eval("\$threaddescription = \"".$templates->get("description")."\";");
if($mybb->input['previewpost'] || $post_errors)
{
$description_2 = htmlspecialchars_uni($mybb->input['description_2']);
}
else
{
$description_2 = htmlspecialchars_uni($thread['description_2']);
}
eval("\$threaddescription_2 = \"".$templates->get("description_2")."\";");
if($mybb->input['previewpost'] || $post_errors)
{
$description_3 = htmlspecialchars_uni($mybb->input['description_3']);
}
else
{
$description_3 = htmlspecialchars_uni($thread['description_3']);
}
eval("\$threaddescription_3 = \"".$templates->get("description_3")."\";");
if($mybb->input['previewpost'] || $post_errors)
{
$description_4 = htmlspecialchars_uni($mybb->input['description_4']);
}
else
{
$description_4 = htmlspecialchars_uni($thread['description_4']);
}
eval("\$threaddescription_4 = \"".$templates->get("description_4")."\";");
}
// Add description
function threaddescription_do_newthread()
{
global $db, $mybb, $tid;
$description = array(
"description" => $db->escape_string($mybb->input['description'])
);
$db->update_query("threads", $description, "tid='{$tid}'");
$description_2 = array(
"description_2" => $db->escape_string($mybb->input['description_2'])
);
$db->update_query("threads", $description_2, "tid='{$tid}'");
$description_3 = array(
"description_3" => $db->escape_string($mybb->input['description_3'])
);
$db->update_query("threads", $description_3, "tid='{$tid}'");
$description_4 = array(
"description_4" => $db->escape_string($mybb->input['description_4'])
);
$db->update_query("threads", $description_4, "tid='{$tid}'");
}
// Show description on edit page
function threaddescription_editpost()
{
global $db, $lang, $mybb, $post, $thread, $templates, $post_errors, $threaddescription, $description, $threaddescription_2, $description_2;
$lang->load("description");
if($thread['firstpost'] == $mybb->input['pid'])
{
if($mybb->input['previewpost'] || $post_errors)
{
$description = htmlspecialchars_uni($mybb->input['description']);
}
else
{
$description = htmlspecialchars_uni($thread['description']);
}
eval("\$threaddescription = \"".$templates->get("description")."\";");
}
if($thread['firstpost'] == $mybb->input['pid'])
{
if($mybb->input['previewpost'] || $post_errors)
{
$description_2 = htmlspecialchars_uni($mybb->input['description_2']);
}
else
{
$description_2 = htmlspecialchars_uni($thread['description_2']);
}
eval("\$threaddescription_2 = \"".$templates->get("description_2")."\";");
if($mybb->input['previewpost'] || $post_errors)
{
$description_3 = htmlspecialchars_uni($mybb->input['description_3']);
}
else
{
$description_3 = htmlspecialchars_uni($thread['description_3']);
}
eval("\$threaddescription_3 = \"".$templates->get("description_3")."\";");
if($mybb->input['previewpost'] || $post_errors)
{
$description_4 = htmlspecialchars_uni($mybb->input['description_4']);
}
else
{
$description_4 = htmlspecialchars_uni($thread['description_4']);
}
eval("\$threaddescription_4 = \"".$templates->get("description_4")."\";");
}
}
// Update description
function threaddescription_do_editpost()
{
global $db, $mybb, $tid;
$description = array(
"description" => $db->escape_string($mybb->input['description'])
);
$db->update_query("threads", $description, "tid='{$tid}'");
$description_2 = array(
"description_2" => $db->escape_string($mybb->input['description_2'])
);
$db->update_query("threads", $description_2, "tid='{$tid}'");
$description_3 = array(
"description_2" => $db->escape_string($mybb->input['description_3'])
);
$db->update_query("threads", $description_3, "tid='{$tid}'");
$description_4 = array(
"description_2" => $db->escape_string($mybb->input['description_4'])
);
$db->update_query("threads", $description_4, "tid='{$tid}'");
}
?>
(26.02.2013, 05:15)MyBB.de Bot schrieb: [ -> ]Eine neue Erweiterung wurde veröffentlicht: Thread Description for MyBB
Zitat:Allows users to enter a short description that will appear underneath the thread subject on the forum display, show thread and search results pages.
This plugin offers full language support.
(10.07.2017, 17:03)FlederMaus schrieb: [ -> ]es gibt da NUR englisch, wiedermal wie üblich typisch .. ich hätte sowas gern funktionierend .. egal in welcher Sprache .. wenn es schon nur englisch unterstützt, wieso wird dann deutsche Sprachdatei abgefragt?Du erwartest nicht ernsthaft, dass Plugins bei MyBB.com, also einer englischsprachigen Website, auch deutsche Sprachdateien erhalten müssen?
wo bekomme ich nun die fehlenden Teile deser Erweiterung?
Da dies eine Auftragsarbeit werden sollte, stört mich das ein kleines bissle mehr als gewöhnlich, das die Erweiterungen nicht vor der Veröffentlchung auf zumindestens VOLLSTÄNDIGKEIT geprüft
(10.07.2017, 17:03)FlederMaus schrieb: [ -> ]falls das aber nicht klappt, ist übrigens Spannend, dass das gleiche Plugin wie oben schon beschrieben mehrfach Support-Threads hat?Hat es nicht, das eine Plugin ist für MyBB 1.6 und das andere für MyBB 1.8, was man anhand der Kategorie und der abweichenden Versions-Nummer gut erkennen kann. Da beide Einträge unabhängig von einander sind, gibt es eben auch 2 Themen.