<?php
/*
Plugin Tagpad
(c) 2007 by Jesse Labrocca
Website: http://www.mybbcentral.com
*/
//PLUGIN HOOKS
// $plugins->add_hook("postbit", "tagpad");
// The information that shows up on the plugin manager
function tagpad_info()
{
return array(
"name" => "Tagpad",
"description" => "Dieses Plugin wird ein kleines, cooles Tagpad in das Forum setzen.",
"website" => "http://www.talkvideogames.com",
"author" => "Jesse Labrocca",
"authorsite" => "http://www.mybbcentral.com",
"version" => "1.0",
'guid' => '8b70f38a8a887c63659ebfd865c1d24c'
);
}
// This function runs when the plugin is activated.
function tagpad_activate()
{
// Feststellen, dass Benutzer angemeldet ist
if($mybb->user['usergroup'] == '9' || $mybb->user['usergroup'] == '4' || $mybb->user['usergroup'] == '3' || $mybb->user['usergroup'] == '6') {
// Code umwandeln
global $db;
$tagpad_group = array(
"gid" => "NULL",
"name" => "tagpad",
"title" => "Tagpad",
"description" => "Tagpad-Einstellungen für das Board",
"disporder" => "29",
"isdefault" => "no",
);
$db->insert_query(TABLE_PREFIX."settinggroups", $tagpad_group);
$gid = $db->insert_id();
$tagpad_1 = array(
"sid" => "NULL",
"name" => "tagpad_guests",
"title" => "Erlaube Gäste-Tagpad",
"description" => "Wähle \"Ja\", um Gästen den Zugriff auf das Tagpad zu erlauben.",
"optionscode" => "yesno",
"value" => "no",
"disporder" => "1",
"gid" => intval($gid),
);
$db->insert_query(TABLE_PREFIX."settings", $tagpad_1);
$tagpad_2 = array(
"sid" => "NULL",
"name" => "tagpad_badwords",
"title" => "Tagpad Badwords",
"description" => "Wähle \"Ja\", um den MyBB Badword-Filter anzuwenden.",
"optionscode" => "yesno",
"value" => "yes",
"disporder" => "2",
"gid" => intval($gid),
);
$db->insert_query(TABLE_PREFIX."settings", $tagpad_2);
$tagpad_3 = array(
"sid" => "NULL",
"name" => "tagpad_archive",
"title" => "Anzahl Tags für Archivierung",
"description" => "Dies ist die Anzahl an Tags, bevor eine Seite archiviert wird.",
"optionscode" => "text",
"value" => "32",
"disporder" => "3",
"gid" => intval($gid),
);
$db->insert_query(TABLE_PREFIX."settings", $tagpad_3);
$tagpad_template_1 = array(
"tid" => NULL,
"title" => 'tagpad',
"template" => '<html>
<head>
<title>{\$mybb->settings[bbname]} - Tagpad</title>
{\$headerinclude}
</head>
<body >
{\$header}
<table border="0" cellspacing="{\$theme[borderwidth]}" cellpadding="{\$theme[tablespace]}" class="tborder">
<tr>
<td class="thead"><strong>Klicke auf das Pad um ein Tag zu platzieren.</strong></td>
</tr>
<tr>
<td>
<div style="display:block; background:#fff; padding-left:100px;">
<div style="width:220px; padding-top:150px;float:left;visibility:{\$tagdisplay};">
<form action="tagpad.php" method="post">
Text: <input type="text" name="ps" maxlength="30" style="width: 100px;" /><br />
Farbe: <select name="tc" size="1">
<option value="black">Schwarz</option>
<option value="red">Rot</option>
<option value="green">Grün</option>
<option value="blue">Blau</option>
</select><br />
Font:
<select name="fn" size="1">
{\$fontlist}
</select><br />
Größe:
<select name="size" size="1">
<option value="12">klein</option>
<option value="16">medium</option>
<option value="20">groß</option>
</select>
<br />
Winkel (Grad): <input type="text" name="an" maxlength="3" style="width: 45px;" value="0" /><br />
<input type="submit" value="Tag!" />
<input type="hidden" value="{\$tagquery}" name="point" />
</form>
</div>
<div id="tagboard">
<img src="tagpad/tagpad_top.jpg" width="400" height="53" alt="tagtop" /><br />
<a href="tagpad.php"><img src="tagpad/tagpad.jpg?{\$tagrand}" ismap width="400" height="615" style="border: 0" alt="Klicke auf irgendeinen Bereich um den Text zu platzieren." /></a>
</div>
</div>
</td>
</tr>
</table>
{\$footer}
</body>
</html>',
"sid" => "-1",
"version" => "1.0",
"dateline" => time(),
);
$db->insert_query(TABLE_PREFIX."templates", $tagpad_template_1);
require "../inc/adminfunctions_templates.php";
find_replace_templatesets("header", '#toplinks_help}</a></li>#', "toplinks_help}</a></li>\n\n<li><a href=\"{\$mybb->settings[bburl]}/tagpad.php\"><img src=\"{\$mybb->settings[bburl]}/{\$theme[imgdir]}/toplinks/tagpad.png\" alt=\"tagpad\" />Tagpad</a></li>");
rebuildsettings();
}
// This function runs when the plugin is deactivated.
function tagpad_deactivate()
{
global $db;
$query = $db->query("SELECT gid FROM ".TABLE_PREFIX."settinggroups WHERE name='tagpad'");
$g = $db->fetch_array($query);
$db->query("DELETE FROM ".TABLE_PREFIX."settinggroups WHERE gid='".$g['gid']."'");
$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE gid='".$g['gid']."'");
$db->query("DELETE FROM ".TABLE_PREFIX."templates WHERE title = 'tagpad'");
require "../inc/adminfunctions_templates.php";
find_replace_templatesets("header", '#'.preg_quote('<li><a href="{$mybb->settings[bburl]}/tagpad.php"><img src="{$mybb->settings[bburl]}/{$theme[imgdir]}/toplinks/tagpad.png" alt="tagpad" />Tagpad</a></li>').'#', "",0);
rebuildsettings();
}
function tagpad()
{
global $mybb, $db;
}
?>