<?php $dsp->NewContent(t('Turnier - Pausenverwaltung'), t('Trage Startzeitpunkt und dauer der Pause ein. Lansuite wird entsprechend spätere Rundenzeiten berechnen')); switch ($_GET['step']) { // Delete case 10: include_once 'inc/classes/class_masterdelete.php'; $md = new masterdelete(); $md->Delete('t2_breaks', 'breakid', $_GET['breakid']); break; default: include_once 'modules/mastersearch2/class_mastersearch2.php'; $ms2 = new mastersearch2('tournament'); $ms2->query['from'] = '%prefix%t2_breaks'; $ms2->query['where'] = 'tournamentid = ' . (int) $_GET['tournamentid']; $ms2->AddResultField(t('Start'), 'start'); $ms2->AddResultField(t('Dauer'), 'duration'); $ms2->AddIconField('edit', 'index.php?mod=tournament2&action=breaks&tournamentid=' . (int) $_GET['tournamentid'] . '&breakid=', t('Editieren')); $ms2->AddIconField('delete', 'index.php?mod=tournament2&action=breaks&tournamentid=' . (int) $_GET['tournamentid'] . '&step=10&breakid=', t('Löschen')); $ms2->PrintSearch('index.php?mod=tournament2&action=breaks&tournamentid=' . (int) $_GET['tournamentid'], 'breakid'); $t = $db->qry_first('SELECT name FROM %prefix%tournament_tournaments WHERE tournamentid = %int%', $_GET['tournamentid']); $dsp->AddFieldSetStart(t('Pause für Turnier %1 festlegen', $t['name'])); include_once 'inc/classes/class_masterform.php'; $mf = new masterform(); $mf->AddFix('tournamentid', $_GET['tournamentid']); $mf->AddField(t('Pause beginnen um'), 'start'); $mf->AddField(t('Dauer der Pause (in Minuten)'), 'duration'); $mf->SendForm('', 't2_breaks', 'breakid', $_GET['breakid']); $dsp->AddFieldSetEnd(); break; }
$dsp->NewContent(t('News verwalten'), t('Mit Hilfe des folgenden Formulars kannst du Neuigkeiten auf deiner Seite ergänzen und bearbeiten')); include_once 'inc/classes/class_masterform.php'; $mf = new masterform(); // Define the db filds, which should be written. The second argument must be a valid db field, of the table supplied to SendForm $mf->AddField(t('Überschrift (Knappe Zusammenfassung für die Startseite)'), 'caption'); $mf->AddField(t('Kategorie / Icon'), 'icon', IS_PICTURE_SELECT, 'ext_inc/news_icons', FIELD_OPTIONAL); $mf->AddField(t('Text'), 'text', '', LSCODE_ALLOWED); $selections = array(); $selections['0'] = t('Normal'); $selections['1'] = t('Wichtig'); $mf->AddField(t('Priorität'), 'priority', IS_SELECTION, $selections, FIELD_OPTIONAL); // Maybe some values should not be added by the user, but set to fix values $mf->AddFix('date', time()); $mf->AddFix('poster', $auth['userid']); // Sendform: 1) Current Link; 2) Affected data base table; 3) prim key in table; 4) ID to edit, if this is empty a new record will be added to the data base if ($mf->SendForm('index.php?mod=sample&action=show', 'news', 'newsid', $_GET['newsid'])) { // Add additional actions here, that should be called, after successfully adding an entry } ### Mastercomment ### // There are only two lines needed to add a comment function to the current table include 'inc/classes/class_mastercomment.php'; // Mastercomment: 1) which module should the comment belong to? 2) Which id should the comment referr to? new Mastercomment('news', $_GET['newsid']); ### Masterdelete ### // Use this, to delete entries from the data base include_once 'inc/classes/class_masterdelete.php'; $md = new masterdelete(); // Will delete from the table 'news', where the fild 'newsid' is '$_GET['newsid']' // However a security question will be displayed first $md->Delete('news', 'newsid', $_GET['newsid']);
<?php include_once 'inc/classes/class_masterdelete.php'; $md = new masterdelete(); // Delete post if ($_GET['pid']) { $md->DeleteIfEmpty['board_threads'] = 'tid'; $md->Delete('board_posts', 'pid', $_GET['pid']); // Delete thread } elseif ($_GET['tid']) { #$md->References['board_posts'] = ''; #$md->References['board_bookmark'] = ''; $md->Delete('board_threads', 'tid', $_GET['tid']); // Delete board } else { #$md->References['board_threads'] = ''; #$md->SubReferences['board_posts'] = 'tid'; #$md->SubReferences['board_bookmark'] = 'tid'; switch ($_GET['step']) { default: include_once 'modules/board/show.php'; break; case 2: $md->Delete('board_forums', 'fid', $_GET['fid']); break; case 10: $md->MultiDelete('board_forums', 'fid'); break; } }
<?php include_once 'inc/classes/class_masterdelete.php'; $md = new masterdelete(); $md->Delete('partylist', 'partyid', $_GET['partyid']);
<?php $dsp->NewContent(t('Statistiken'), $_GET['file']); // Delete if ($_GET['delfile'] and $auth['type'] >= 3) { include_once 'inc/classes/class_masterdelete.php'; $md = new masterdelete(); $md->Delete('download_stats', 'file', $_GET['delfile']); } // List if (!$_GET['file']) { include_once 'modules/mastersearch2/class_mastersearch2.php'; $ms2 = new mastersearch2('news'); $ms2->query['from'] = "%prefix%download_stats AS s"; $ms2->query['default_order_by'] = 's.file'; $ms2->AddResultField(t('Datei'), 's.file'); $ms2->AddResultField(t('Downloads'), 'SUM(s.hits) AS hits'); $ms2->AddIconField('details', 'index.php?mod=downloads&action=stats&file=', t('Details')); if ($auth['type'] >= 3) { $ms2->AddIconField('delete', 'index.php?mod=downloads&action=stats&delfile=', t('Löschen')); } $ms2->PrintSearch('index.php?mod=downloads&action=stats', 's.file'); // Details } else { switch ($_GET['time']) { default: $link = 'y'; $back = ''; $group_by = '%Y-00-00-00-00-00'; $where = '0000-00-00-00-00-00'; $where_back = '';
<?php include_once 'inc/classes/class_masterdelete.php'; $md = new masterdelete(); $md->References['rentuser'] = ''; $md->Delete('rentstuff', 'stuffid', $_GET['stuffid']);
if ($_GET['userid'] != '') { $bugtracker->AssignBugToUser($key, $_GET['userid']); } } elseif ($auth['login']) { // Change state if ($_GET['state'] != '' and ($_GET['state'] == 1 or $_GET['state'] == 2 or $_GET['state'] == 7)) { $bugtracker->SetBugState($key, $_GET['state']); } } } } if ($_GET['action'] == 'delete' and $auth['type'] >= 2) { if ($_GET['bugid'] != '') { include_once 'inc/classes/class_masterdelete.php'; $md = new masterdelete(); $md->Delete('bugtracker', 'bugid', $_GET['bugid']); } else { include_once 'inc/classes/class_masterdelete.php'; $md = new masterdelete(); $md->MultiDelete('bugtracker', 'bugid'); } } function FetchState($state) { global $bugtracker; return $bugtracker->stati[$state]; } function FetchType($type) { global $types, $line; $ret = $types[$type];
function Mastercomment($mod, $id, $update_table = array()) { global $framework, $dsp, $auth, $db, $func, $cfg; #echo '<ul class="Line">'; $dsp->AddFieldsetStart(t('Kommentare')); // Delete comments if ($_GET['mc_step'] == 10) { include_once 'inc/classes/class_masterdelete.php'; $md = new masterdelete(); $md->LogID = $id; $md->Delete('comments', 'commentid', $_GET['commentid']); unset($_GET['commentid']); } $CurentURLBase = $framework->get_clean_url_query('base'); $CurentURLBase = str_replace('&mc_step=10', '', $CurentURLBase); $CurentURLBase = str_replace('&mf_step=2', '', $CurentURLBase); $CurentURLBase = preg_replace('#&mf_id=[0-9]*#si', '', $CurentURLBase); $CurentURLBase = preg_replace('#&commentid=[0-9]*#si', '', $CurentURLBase); // No Order by in this MS, for it collidates with possible other MS on this page $order_by_tmp = $_GET['order_by']; $_GET['order_by'] = ''; // List current comments include_once 'modules/mastersearch2/class_mastersearch2.php'; $ms2 = new mastersearch2('bugtracker'); $ms2->query['from'] = "%prefix%comments AS c\n LEFT JOIN %prefix%user AS u ON c.creatorid = u.userid\n "; $ms2->query['where'] = "c.relatedto_item = '{$mod}' AND c.relatedto_id = '{$id}'"; $ms2->config['dont_link_first_line'] = 1; $ms2->AddSelect('UNIX_TIMESTAMP(c.date) AS date'); $ms2->AddSelect('c.creatorid'); $ms2->AddSelect('u.avatar_path'); $ms2->AddSelect('u.signature'); $ms2->AddSelect('u.userid'); $ms2->AddResultField('', 'u.username', 'FetchDataRow', '', 180); $ms2->AddResultField('', 'c.text', 'FetchPostRow'); $ms2->AddIconField('quote', 'javascript:document.getElementById(\'text\').value += \'[quote]\' + document.getElementById(\'post%id%\').innerHTML + \'[/quote]\'', t('Zitieren')); $ms2->AddIconField('edit', $CurentURLBase . '&commentid=%id%#dsp_form2', t('Editieren'), 'EditAllowed'); if ($auth['type'] >= 3) { $ms2->AddIconField('delete', $CurentURLBase . '&mc_step=10&commentid=', t('Löschen')); } $ms2->PrintSearch($CurentURLBase, 'c.commentid'); $_GET['order_by'] = $order_by_tmp; // Add new comments if ($cfg['mc_only_logged_in'] and !$auth['login']) { $func->information(t('Bitte loggen dich ein, bevor du einen Kommentar verfasst'), NO_LINK); } else { if ($_GET['commentid']) { $row = $db->qry_first("SELECT creatorid FROM %prefix%comments WHERE commentid = %int%", $_GET['commentid']); } if (!$_GET['commentid'] or $row['creatorid'] and $row['creatorid'] == $auth['userid'] or $auth['type'] >= 2) { include_once 'inc/classes/class_masterform.php'; $mf = new masterform(); $mf->LogID = $id; $mf->AddField(t('Kommentar'), 'text', '', LSCODE_BIG); if (!$auth['login']) { $mf->AddField('', 'captcha', IS_CAPTCHA); } $mf->AddFix('relatedto_item', $mod); $mf->AddFix('relatedto_id', $id); if (!$_GET['commentid']) { $mf->AddFix('date', 'NOW()'); } if (!$_GET['commentid']) { $mf->AddFix('creatorid', $auth['userid']); } if ($mf->SendForm('', 'comments', 'commentid', $_GET['commentid'])) { // Send email-notifications to thread-subscribers $path = substr($_SERVER['REQUEST_URI'], 0, strpos($_SERVER['REQUEST_URI'], "index.php")); include_once "modules/mail/class_mail.php"; $mail = new mail(); if (!$_GET['fid']) { $_GET['fid'] = $thread['fid']; } // Internet-Mail $subscribers = $db->qry('SELECT b.userid, u.firstname, u.name, u.email FROM %prefix%comments_bookmark AS b LEFT JOIN %prefix%user AS u ON b.userid = u.userid WHERE b.email = 1 AND b.relatedto_item = %string% AND b.relatedto_id = %int%', $mod, $id); while ($subscriber = $db->fetch_array($subscribers)) { if ($subscriber['userid'] != $auth['userid']) { $mail->create_inet_mail($subscriber["firstname"] . " " . $subscriber["name"], $subscriber["email"], t('Es gibt einen neuen Kommentar'), str_replace('%URL%', $_SERVER['HTTP_REFERER'], t('Es wurde ein neuer Kommentar in einem Lansuite-Modul geschrieben: %URL%')), $cfg["sys_party_mail"]); } } $db->free_result($subscribers); // Sys-Mail $subscribers = $db->qry('SELECT userid FROM %prefix%comments_bookmark AS b WHERE b.sysemail = 1 AND b.relatedto_item = %string% AND b.relatedto_id = %int%', $mod, $id); while ($subscriber = $db->fetch_array($subscribers)) { if ($subscriber['userid'] != $auth['userid']) { $mail->create_sys_mail($subscriber["userid"], t('Es gibt einen neuen Kommentar'), str_replace('%URL%', $_SERVER['HTTP_REFERER'], t('Es wurde ein neuer Kommentar in einem Lansuite-Modul geschrieben: %URL%'))); } } $db->free_result($subscribers); // Update LastChange in $update_table, if $update_table is set if ($update_table) { list($key, $val) = each($update_table); $db->qry('UPDATE %prefix%' . $key . ' SET changedate=NOW() WHERE ' . $val . ' = %int%', $id); } } } else { $func->error(t('Du bist nicht berechtigt, diesen Kommentar zu editieren')); } } $dsp->AddFieldsetEnd(); #echo '</ul>'; // Bookmarks and Auto-Mail if ($auth['login'] and $auth['type'] > 1) { if ($_GET['set_bm']) { $db->qry_first('DELETE FROM %prefix%comments_bookmark WHERE relatedto_id = %int% AND relatedto_item = %string%', $id, $mod); if ($_POST["check_bookmark"]) { $db->qry('INSERT INTO %prefix%comments_bookmark SET relatedto_id = %int%, relatedto_item = %string%, userid = %int%, email = %int%, sysemail = %int%', $id, $mod, $auth['userid'], $_POST['check_email'], $_POST['check_sysemail']); } } $bookmark = $db->qry_first('SELECT 1 AS found, email, sysemail FROM %prefix%comments_bookmark WHERE relatedto_id = %int% AND relatedto_item = %string% AND userid = %int%', $id, $mod, $auth['userid']); if ($bookmark['found']) { $_POST['check_bookmark'] = 1; } if ($bookmark['email']) { $_POST['check_email'] = 1; } if ($bookmark['sysemail']) { $_POST['check_sysemail'] = 1; } $dsp->SetForm($_SERVER['REQUEST_URI'] . '&set_bm=1'); $dsp->AddFieldsetStart(t('Monitoring')); $additionalHTML = "onclick=\"CheckBoxBoxActivate('email', this.checked)\""; $dsp->AddCheckBoxRow("check_bookmark", t('Lesezeichen'), t('Diesen Beitrag in meine Lesezeichen aufnehmen<br><i>(Lesezeichen ist Vorraussetzung, um Benachrichtigung per Mail zu abonnieren)</i>'), "", 1, $_POST["check_bookmark"], '', '', $additionalHTML); $dsp->StartHiddenBox('email', $_POST["check_bookmark"]); $dsp->AddCheckBoxRow("check_email", t('E-Mail Benachrichtigung'), t('Bei Antworten auf diesen Beitrag eine Internet-Mail an mich senden'), "", 1, $_POST["check_email"]); $dsp->AddCheckBoxRow("check_sysemail", t('System-E-Mail'), t('Bei Antworten auf diesen Beitrag eine System-Mail an mich senden'), "", 1, $_POST["check_sysemail"]); if ($bookmark["found"]) { $dsp->StopHiddenBox(); } $dsp->AddFormSubmitRow("edit"); if (!$bookmark["found"]) { $dsp->StopHiddenBox(); } $dsp->AddFieldsetEnd(); } }
} elseif ($auth["userid"] == $userid) { $func->error(t('Du kannst dich nicht selbst löschen'), "index.php?mod=usrmgr"); } else { $db->qry("UPDATE %prefix%seat_seats SET status = '1', userid='0' WHERE userid = %int%", $userid); return true; } return false; } switch ($_GET['step']) { default: include_once 'modules/usrmgr/search.inc.php'; break; case 2: // Do some checks, before calling MD if (CheckDeleteUser($_GET['userid'])) { $md->Delete('user', 'userid', $_GET['userid']); } break; case 10: $success = 1; // Do some checks, before calling MD foreach ($_POST['action'] as $key => $val) { if (!CheckDeleteUser($key)) { $success = 0; } } if ($success) { $md->MultiDelete('user', 'userid'); } break; }
<?php include_once 'inc/classes/class_masterdelete.php'; $md = new masterdelete(); $md->Delete('partys', 'party_id', $_GET['party_id']);
$selections['1'] = t('Nur für ausgeloggte'); $selections['2'] = t('Nur für eingeloggte'); $selections['3'] = t('Nur für Admins + Superadmins'); $selections['4'] = t('Nur für Superadmins'); $mf->AddField(t('Login benötigt'), 'login', IS_SELECTION, $selections, FIELD_OPTIONAL); $mf->AddField(t('Modul benötigt'), 'module', '', '', FIELD_OPTIONAL); $mf->AddField(t('Quelldatei'), 'source'); $mf->AddField(t('Callback'), 'callback', '', '', FIELD_OPTIONAL); $mf->SendForm('index.php?mod=boxes&step=20', 'boxes', 'boxid', $_GET['boxid']); break; // Delete // Delete case 30: include_once 'inc/classes/class_masterdelete.php'; $md = new masterdelete(); $md->Delete('boxes', 'boxid', $_GET['boxid']); break; } $dsp->NewContent(t('Box-Manager'), t('Hier kannst du die Anzeige und Position der Boxen verwalten')); include_once 'modules/mastersearch2/class_mastersearch2.php'; $ms2 = new mastersearch2(''); $ms2->query['from'] = "%prefix%boxes AS b"; $ms2->query['default_order_by'] = 'place ASC, pos ASC, name ASC'; $ms2->AddTextSearchDropDown(t('Internet-Modus'), 'b.internet', array('' => t('Egal'), '1' => t('Nur im Intranet-Modus'), '2' => t('Nur im Internet-Modus'))); $ms2->AddTextSearchDropDown(t('Login'), 'b.login', array('' => t('Egal'), '1' => t('Nur für ausgeloggte'), '2' => t('Nur für eingeloggte'), '3' => t('Nur für Admins + Superadminen'), '4' => t('Nur für Superadminen'))); function PlaceName($place) { if ($place == 0) { return t('Linke Seite'); } elseif ($place == 1) { return t('Rechte Seite');
<?php include_once 'inc/classes/class_masterdelete.php'; $md = new masterdelete(); $md->References['t2_teams'] = ''; $md->References['t2_teammembers'] = ''; $md->References['t2_games'] = ''; switch ($_GET['step']) { default: include_once 'modules/tournament2/search.inc.php'; break; case 2: $md->Delete('tournament_tournaments', 'tournamentid', $_GET['tournamentid']); break; case 10: $md->MultiDelete('tournament_tournaments', 'tournamentid'); break; }