function listBrokenDownloads() { global $xoopsDB, $eh; $result = $xoopsDB->query("SELECT * FROM " . $xoopsDB->prefix("wfs_broken") . " ORDER BY reportid"); $totalbrokendownloads = $xoopsDB->getRowsNum($result); xoops_cp_header(); echo "<h4>" . _AM_DLCONF . "</h4>"; echo "<table width='100%' border='0' cellspacing='1' class='outer'><tr class='odd'><td>"; echo "<h4>" . _AM_BROKENREPORTS . " ({$totalbrokendownloads})</h4><br />"; if ($totalbrokendownloads == 0) { echo _AM_NOBROKEN; } else { echo "<center>" . _AM_IGNOREDESC . "<br />" . _AM_DELETEDESC . "</center><br /><br /><br />"; $colorswitch = "#dddddd"; echo "<table align='center' width='90%'>"; echo "\r\n\t\t<tr>\r\n\t\t\t<td><b>" . _AM_FILETITLE . "</b></td>\r\n\t\t\t<td><b>" . _AM_REPORTER . "</b></td>\r\n\t\t\t<td><b>" . _AM_IGNORE . "</b></td>\r\n\t\t\t<td><b>" . _AM_EDIT . "</b></td>\r\n\t\t\t<td><b>" . _AM_DELETE . "</b></td>\r\n\t\t</tr>"; while (list($reportid, $lid, $sender, $ip) = $xoopsDB->fetchRow($result)) { $result2 = $xoopsDB->query("SELECT fileshowname FROM " . $xoopsDB->prefix("wfs_files") . " WHERE fileid={$lid}"); if ($sender != 0) { $result3 = $xoopsDB->query("SELECT uname, email FROM " . $xoopsDB->prefix("users") . " WHERE uid=" . $sender . ""); list($sendername, $email) = $xoopsDB->fetchRow($result3); } list($fileshowname) = $xoopsDB->fetchRow($result2); $result4 = $xoopsDB->query("SELECT uname, email FROM " . $xoopsDB->prefix("users") . " WHERE uid=" . $owner . ""); list($ownername, $owneremail) = $xoopsDB->fetchRow($result4); echo "<tr><td bgcolor={$colorswitch}><a href=index.php?op=fileedit&fileid={$lid} target='_blank'>" . $fileshowname . "</a></td>"; if ($email == "") { echo "<td bgcolor={$colorswitch}>{$sendername} ({$ip})"; } else { echo "<td bgcolor={$colorswitch}><a href=mailto:{$email}>{$sendername}</a> ({$ip})"; } echo "</td>"; echo "</td><td bgcolor='{$colorswitch}' align='center'>"; echo myTextForm("brokendown.php?op=ignoreBrokenDownloads&lid={$lid}", "X"); echo "</td><td bgcolor='{$colorswitch}' align='center'>"; echo myTextForm("index.php?op=fileedit&fileid={$lid}", "X"); echo "</td><td bgcolor='{$colorswitch}' align='center'>"; echo myTextForm("brokendown.php?op=delBrokenDownloads&lid={$lid}", "X"); echo "</td></tr>"; if ($colorswitch == "#dddddd") { $colorswitch = "#ffffff"; } else { $colorswitch = "#dddddd"; } } echo "</table>"; } echo "</td></tr></table>"; }
<table border="0" cellpadding="10" cellspacing="0"> <?php while ($row = $xoopsDB->fetchArray($result)) { $post_text = $row['can_post'] ? "can" : "can't"; $post_text .= " post"; //$post_toggle_link = "<a href=\"".$HTTP_SERVER_VARS['PHP_SELF']."?forum=$forum&op_userid=".$row['uid']."&op="; $post_toggle_link = XOOPS_URL . "/modules/newbb/admin/admin_priv_forums.php?forum={$forum}&op_userid=" . $row['uid'] . "&op="; if ($row['can_post']) { $post_toggle_link .= "revokeuserpost"; $post_toggle_link = myTextForm($post_toggle_link, _MD_A_REVOKEPOSTING); } else { $post_toggle_link .= "grantuserpost"; $post_toggle_link = myTextForm($post_toggle_link, _MD_A_GRANTPOSTING); } $remove_link = myTextForm(XOOPS_URL . "/modules/newbb/admin/admin_priv_forums.php?forum={$forum}&op=deluser&op_userid=" . $row['uid'], _MD_A_REMOVE); ?> <tr> <td><b><?php echo $row['uname']; ?> </b> (<?php echo $post_text; ?> ) <?php echo $post_toggle_link; ?> <?php echo $remove_link;
function listModReq() { global $xoopsDB, $myts, $eh, $mytree, $xoopsModuleConfig; $result = $xoopsDB->query("select requestid,lid,cid,title,url,logourl,description,modifysubmitter from " . $xoopsDB->prefix("mylinks_mod") . " order by requestid"); $totalmodrequests = $xoopsDB->getRowsNum($result); xoops_cp_header(); echo "<h4>" . _MD_WEBLINKSCONF . "</h4>"; echo "<table width='100%' border='0' cellspacing='1' class='outer'>" . "<tr class=\"odd\"><td>"; echo "<h4>" . _MD_USERMODREQ . " ({$totalmodrequests})</h4><br />"; if ($totalmodrequests > 0) { echo "<table width='95%'><tr><td>"; $lookup_lid = array(); while (list($requestid, $lid, $cid, $title, $url, $logourl, $description, $submitterid) = $xoopsDB->fetchRow($result)) { $lookup_lid[$requestid] = $lid; $result2 = $xoopsDB->query("select cid, title, url, logourl, submitter from " . $xoopsDB->prefix("mylinks_links") . " where lid={$lid}"); list($origcid, $origtitle, $origurl, $origlogourl, $ownerid) = $xoopsDB->fetchRow($result2); $result2 = $xoopsDB->query("select description from " . $xoopsDB->prefix("mylinks_text") . " where lid={$lid}"); list($origdescription) = $xoopsDB->fetchRow($result2); $result7 = $xoopsDB->query("select uname, email from " . $xoopsDB->prefix("users") . " where uid='{$submitterid}'"); $result8 = $xoopsDB->query("select uname, email from " . $xoopsDB->prefix("users") . " where uid='{$ownerid}'"); $cidtitle = $mytree->getPathFromId($cid, "title"); $origcidtitle = $mytree->getPathFromId($origcid, "title"); list($submitter, $submitteremail) = $xoopsDB->fetchRow($result7); list($owner, $owneremail) = $xoopsDB->fetchRow($result8); $title = $myts->makeTboxData4Show($title); $url = $myts->makeTboxData4Show($url); // $url = urldecode($url); // use original image file to prevent users from changing screen shots file $origlogourl = $myts->makeTboxData4Show($origlogourl); $logourl = $origlogourl; // $logourl = urldecode($logourl); $description = $myts->makeTareaData4Show($description, 0); $origurl = $myts->makeTboxData4Show($origurl); // $origurl = urldecode($origurl); // $origlogourl = urldecode($origlogourl); $origdescription = $myts->makeTareaData4Show($origdescription, 0); if ($owner == "") { $owner = "administration"; } echo "<table border='1' bordercolor='black' cellpadding='5' cellspacing='0' align='center' width='450'><tr><td>\n <table width='100%' bgcolor='#dddddd'>\n <tr>\n <td valign='top' width='45%'><b>" . _MD_ORIGINAL . "</b></td>\n <td rowspan='14' valign='top' align='left'><small><br />" . _MD_DESCRIPTIONC . "<br />{$origdescription}</small></td>\n </tr>\n <tr><td valign='top' width='45%'><small>" . _MD_SITETITLE . "{$origtitle}</small></td></tr>\n <tr><td valign='top' width='45%'><small>" . _MD_SITEURL . "" . $origurl . "</small></td></tr>\n <tr><td valign='top' width='45%'><small>" . _MD_CATEGORYC . "{$origcidtitle}</small></td></tr>\n <tr><td valign='top' width='45%'><small>" . _MD_SHOTIMAGE . "</small>"; if ($xoopsModuleConfig['useshots'] && !empty($origlogourl)) { echo "<img src=\"" . XOOPS_URL . "/modules/mylinks/images/shots/" . $origlogourl . "\" width=\"" . $xoopsModuleConfig['shotwidth'] . "\" />"; } else { echo " "; } echo "</td></tr>\n </table></td></tr><tr><td>\n <table width=100%>\n <tr>\n <td valign='top' width='45%'><b>" . _MD_PROPOSED . "</b></td>\n <td rowspan='14' valign='top' align='left'><small><br />" . _MD_DESCRIPTIONC . "<br />{$description}</small></td>\n </tr>\n <tr><td valign='top' width='45%'><small>" . _MD_SITETITLE . "{$title}</small></td></tr>\n <tr><td valign='top' width='45%'><small>" . _MD_SITEURL . "" . $url . "</small></td></tr>\n <tr><td valign='top' width='45%'><small>" . _MD_CATEGORYC . "{$cidtitle}</small></td></tr>\n <tr><td valign='top' width='45%'><small>" . _MD_SHOTIMAGE . "</small>"; if ($xoopsModuleConfig['useshots'] == 1 && !empty($logourl)) { echo "<img src=\"" . XOOPS_URL . "/modules/mylinks/images/shots/" . $logourl . "\" width=\"" . $xoopsModuleConfig['shotwidth'] . "\" alt=\"/\" />"; } else { echo " "; } echo "</td></tr>\n </table></td></tr></table>\n <table align='center' width='450'>\n <tr>"; if ($submitteremail == "") { echo "<td align='left'><small>" . _MD_SUBMITTER . "{$submitter}</small></td>"; } else { echo "<td align='left'><small>" . _MD_SUBMITTER . "<a href=mailto:" . $submitteremail . ">" . $submitter . "</a></small></td>"; } if ($owneremail == "") { echo "<td align='center'><small>" . _MD_OWNER . "" . $owner . "</small></td>"; } else { echo "<td align='center'><small>" . _MD_OWNER . "<a href=mailto:" . $owneremail . ">" . $owner . "</a></small></td>"; } echo "<td align='right'><small>\n"; echo "<table><tr><td>\n"; echo myTextForm("index.php?op=changeModReq&requestid={$requestid}", _MD_APPROVE); echo "</td><td>\n"; echo myTextForm("index.php?op=modLink&lid={$lookup_lid[$requestid]}", _EDIT); echo "</td><td>\n"; echo myTextForm("index.php?op=ignoreModReq&requestid={$requestid}", _MD_IGNORE); echo "</td></tr></table>\n"; echo "</small></td></tr>\n"; echo "</table><br /><br />"; } echo "</td></tr></table>"; } else { echo _MD_NOMODREQ; } echo "</td></tr></table>"; xoops_cp_footer(); }
function listModReq() { global $xoopsDB, $myts, $eh, $mytree, $xoopsModuleConfig; $result = $xoopsDB->query("SELECT * FROM " . $xoopsDB->prefix("mydownloads_mod") . " ORDER BY requestid"); $totalmodrequests = $xoopsDB->getRowsNum($result); xoops_cp_header(); echo "<h4>" . _MD_DLCONF . "</h4>"; echo "<table width='100%' border='0' cellspacing='1' class='outer'>" . "<tr class=\"odd\"><td>"; echo "<h4>" . _MD_USERMODREQ . " ({$totalmodrequests})</h4><br />"; if ($totalmodrequests > 0) { echo "<table width='95%'><tr><td>"; $lookup_lid = array(); while (list($requestid, $lid, $cid, $title, $url, $homepage, $version, $size, $platform, $logourl, $description, $modifysubmitter) = $xoopsDB->fetchRow($result)) { $lookup_lid[$requestid] = $lid; $result2 = $xoopsDB->query("SELECT cid, title, url, homepage, version, size, platform, logourl, submitter FROM " . $xoopsDB->prefix("mydownloads_downloads") . " WHERE lid={$lid}"); list($origcid, $origtitle, $origurl, $orighomepage, $origversion, $origsize, $origplatform, $origlogourl, $owner) = $xoopsDB->fetchRow($result2); $result2 = $xoopsDB->query("SELECT description FROM " . $xoopsDB->prefix("mydownloads_text") . " WHERE lid={$lid}"); list($origdescription) = $xoopsDB->fetchRow($result2); $result7 = $xoopsDB->query("SELECT uname, email FROM " . $xoopsDB->prefix("users") . " WHERE uid={$modifysubmitter}"); $result8 = $xoopsDB->query("SELECT uname, email FROM " . $xoopsDB->prefix("users") . " WHERE uid={$owner}"); $cidtitle = $mytree->getPathFromId($cid, "title"); $origcidtitle = $mytree->getPathFromId($origcid, "title"); list($submittername, $submitteremail) = $xoopsDB->fetchRow($result7); list($ownername, $owneremail) = $xoopsDB->fetchRow($result8); $title = $myts->makeTboxData4Show($title); $url = $myts->makeTboxData4Show($url); $homepage = $myts->makeTboxData4Show($homepage); $version = $myts->makeTboxData4Show($version); $size = $myts->makeTboxData4Show($size); $platform = $myts->makeTboxData4Show($platform); // use original image file to prevent users from changing screen shots file $origlogourl = $myts->makeTboxData4Edit($origlogourl); $logourl = $origlogourl; $description = $myts->makeTareaData4Show($description, 0); $origurl = $myts->makeTboxData4Show($origurl); $orighomepage = $myts->makeTboxData4Show($orighomepage); $origversion = $myts->makeTboxData4Show($origversion); $origsize = $myts->makeTboxData4Show($origsize); $origplatform = $myts->makeTboxData4Show($origplatform); $origdescription = $myts->makeTareaData4Show($origdescription, 0); if (empty($ownername)) { $ownername = "administration"; } echo "<table border='1' bordercolor='black' cellpadding='5' cellspacing='0' align='center' width='450'><tr><td>\n <table width='100%' bgcolor='#dddddd'>\n <tr>\n <td valign='top' width='45%'><b>" . _MD_ORIGINAL . "</b></td>\n <td rowspan='14' valign='top' align='left'><br />" . _MD_DESCRIPTIONC . "<br />{$origdescription}</td>\n </tr>\n <tr><td valign='top' width='45%'><small>" . _MD_FILETITLE . " " . $origtitle . "</small></td></tr>\n <tr><td valign='top' width='45%'><small>" . _MD_DLURL . " " . $origurl . "</small></td></tr>\n <tr><td valign='top' width='45%'><small>" . _MD_CATEGORYC . " " . $origcidtitle . "</small></td></tr>\n <tr><td valign='top' width='45%'><small>" . _MD_HOMEPAGEC . " " . $orighomepage . "</small></td></tr>\n <tr><td valign='top' width='45%'><small>" . _MD_VERSIONC . " " . $origversion . "</small></td></tr>\n <tr><td valign='top' width='45%'><small>" . _MD_FILESIZEC . " " . $origsize . "</small></td></tr>\n <tr><td valign='top' width='45%'><small>" . _MD_PLATFORMC . " " . $origplatform . "</small></td></tr>\n <tr><td valign='top' width='45%'><small>" . _MD_SHOTIMAGE . "</small> "; if ($xoopsModuleConfig['useshots'] && !empty($origlogourl)) { echo "<img src=\"" . XOOPS_URL . "/modules/mydownloads/images/shots/" . $origlogourl . "\" width=\"" . $xoopsModuleConfig['shotwidth'] . "\" />"; } else { echo " "; } echo "</td></tr>\n </table></td></tr><tr><td>\n <table width='100%'>\n <tr>\n <td valign='top' width='45%'><b>" . _MD_PROPOSED . "</b></td>\n <td rowspan='14' valign='top' align='left'><br />" . _MD_DESCRIPTIONC . "<br />{$description}</td>\n </tr>\n <tr><td valign='top' width='45%'><small>" . _MD_FILETITLE . " " . $title . "</small></td></tr>\n <tr><td valign='top' width='45%'><small>" . _MD_DLURL . " " . $url . "</small></td></tr>\n <tr><td valign='top' width='45%'><small>" . _MD_CATEGORYC . " " . $cidtitle . "</small></td></tr>\n <tr><td valign='top' width='45%'><small>" . _MD_HOMEPAGEC . " " . $homepage . "</small></td></tr>\n <tr><td valign='top' width='45%'><small>" . _MD_VERSIONC . " " . $version . "</small></td></tr>\n <tr><td valign='top' width='45%'><small>" . _MD_FILESIZEC . " " . $size . "</small></td></tr>\n <tr><td valign='top' width='45%'><small>" . _MD_PLATFORMC . " " . $platform . "</small></td></tr>\n <tr><td valign='top' width='45%'><small>" . _MD_SHOTIMAGE . "</small> "; if ($xoopsModuleConfig['useshots'] && !empty($logourl)) { echo "<img src=\"" . XOOPS_URL . "/modules/mydownloads/images/shots/" . $logourl . "\" width=\"" . $xoopsModuleConfig['shotwidth'] . "\" />"; } else { echo " "; } echo "</td></tr>\n </table></td></tr></table>\n <table align='center' width='450'>\n <tr>"; if ($submitteremail == "") { echo "<td align='left'><small>" . _MD_SUBMITTER . " {$submittername}</small></td>"; } else { echo "<td align='left'><small>" . _MD_SUBMITTER . " <a href='mailto:{$submitteremail}'>{$submittername}</a></small></td>"; } if ($owneremail == "") { echo "<td align='center'><small>" . _MD_OWNER . " {$ownername}</small></td>"; } else { echo "<td align='center'><small>" . _MD_OWNER . " <a href=mailto:{$owneremail}>{$ownername}</a></small></td>"; } echo "<td align='right'><small>\n"; echo "<table><tr><td>\n"; echo myTextForm("index.php?op=changeModReq&requestid={$requestid}", _MD_APPROVE); echo "</td><td>\n"; echo myTextForm("index.php?op=modDownload&lid={$lookup_lid[$requestid]}", _EDIT); echo "</td><td>\n"; echo myTextForm("index.php?op=ignoreModReq&requestid={$requestid}", _MD_IGNORE); echo "</td></tr></table>\n"; echo "</small></td></tr>\n"; echo "</table><br /><br />"; } echo "</td></tr></table>"; } else { echo _MD_NOMODREQ; } echo "</td></tr></table>"; xoops_cp_footer(); }
function MyMenuDel($menuid, $ok = 0) { global $db, $xoopsConfig, $xoopsModule, $myts; if ($ok == 1) { $db->query("DELETE FROM " . $db->prefix(mymenu) . " WHERE menuid={$menuid}"); redirect_header("index.php?op=MyMenuAdmin", 1, _AM_DBUPDATED); exit; } else { xoops_cp_header(); OpenTable(); $result = $db->query("SELECT position, itemname, indent, margin, itemurl, bold, membersonly, status FROM " . $db->prefix("mymenu") . " WHERE menuid={$menuid}"); list($position, $itemname, $indent, $margin, $itemurl, $bold, $membersonly, $status) = $db->fetch_row($result); echo "<big><b>" . _AM_TITLE . "</big></b>"; echo "<h4 style='text-align:left;'>" . _AM_DELETEMENUITEM . "</h4>\r\n <form action='index.php' method='post'>\r\n <input type='hidden' name='menuid' value='{$menuid}' />\r\n <table border='0' cellpadding='0' cellspacing='0' valign='top' width='100%'>\r\n <tr>\r\n <td class='bg2'>\r\n <table width='100%' valign='top' border='0' cellpadding='4' cellspacing='1'>\r\n <tr>\r\n <td class='bg3' width='30%'><b>" . _AM_POS . "</b></td>\r\n <td class='bg1'>" . $position . "</td>\r\n </tr>\r\n <tr>\r\n <td class='bg3'><b>" . _AM_ITEMNAME . "</b></td>\r\n <td class='bg1'>" . $itemname . "</td>\r\n </tr>\r\n <tr>\r\n <td class='bg3'><b>" . _AM_ITEMURL . "</b></td>\r\n <td class='bg1'>" . $itemurl . "</td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n </table>\r\n </form>"; echo "<table valign='top'><tr>"; echo "<td width='30%'valign='top'><span style='color:#ff0000;'><b>" . _AM_WANTDEL . "</b></span></td>"; echo "<td width='3%'>\n"; echo myTextForm("index.php?op=MyMenuDel&menuid={$menuid}&ok=1", _AM_YES); echo "</td><td>\n"; echo myTextForm("index.php?op=MyMenuAdmin", _AM_NO); echo "</td></tr></table>\n"; CloseTable(); } }
//global $xoopsDB, $myts, $groupid; global $xoopsDB, $myts; switch($op){ case "delete": if ( $_GET['ok'] != 1 ) { xoops_cp_header(); echo"<table width='100%' border='0' cellpadding = '2' cellspacing='1' class = 'confirmMsg'><tr><td class='confirmMsg'>"; echo "<div class='confirmMsg'>"; echo "<h4>"; echo ""._AM_WAYSYWTDTTAL."</font></h4><br />"; echo "<table><tr><td>"; echo myTextForm("category.php?op=delete&id=".$_POST['id']."&ok=1", _AM_YES); echo "</td><td>"; echo myTextForm("category.php?op=default", _AM_NO); echo "</td></tr></table>"; echo "</div><br /><br />"; echo"</td></tr></table>"; } else { $xt = new WfsCategory($_GET['id']); //get all subtopics under the specified topic $topic_arr = $xt->getAllChild(); array_push($topic_arr, $xt); foreach($topic_arr as $eachtopic){ //get all stories in each topic $article_arr = WfsArticle::getByCategory($eachtopic->id()); foreach($article_arr as $eacharticle){ $eacharticle->delete(); } //all stories for each topic is deleted, now delete the topic data
function listBrokenDownloads() { global $xoopsDB, $eh; global $wfsTableFiles, $wfsTableBroken; // add // easy to rename module and table // $result = $xoopsDB->query("SELECT * FROM ".$xoopsDB->prefix("wfs_broken")." ORDER BY reportid"); $result = $xoopsDB->query("SELECT * FROM ".$xoopsDB->prefix($wfsTableBroken)." ORDER BY reportid"); $totalbrokendownloads = $xoopsDB->getRowsNum($result); xoops_cp_header(); // same title as admin menu // add adminmenu // echo "<h4>"._AM_DLCONF."</h4>"; echo "<h4>"._AM_LIST_BROKEN."</h4>"; global $wfsAdminMenu; if ($wfsAdminMenu) adminmenu(); echo"<table width='100%' border='0' cellspacing='1' class='outer'><tr class='odd'><td>"; echo "<h4>"._AM_BROKENREPORTS." ($totalbrokendownloads)</h4><br />"; if ($totalbrokendownloads==0) { echo _AM_NOBROKEN; } else { echo "<center>"._AM_IGNOREDESC."<br />"._AM_DELETEDESC."</center><br /><br /><br />"; $colorswitch="#dddddd"; echo "<table align='center' width='90%'>"; echo " <tr> <td><b>"._AM_FILETITLE."</b></td> <td><b>" ._AM_REPORTER."</b></td> <td><b>" ._AM_IGNORE."</b></td> <td><b>" ._AM_EDIT."</b></td> <td><b>" ._AM_DELETE."</b></td> </tr>"; while(list($reportid, $lid, $sender, $ip)=$xoopsDB->fetchRow($result)){ // easy to rename module and table // $result2 = $xoopsDB->query("SELECT fileshowname FROM ".$xoopsDB->prefix("wfs_files")." WHERE fileid=$lid"); $result2 = $xoopsDB->query("SELECT fileshowname FROM ".$xoopsDB->prefix($wfsTableFiles)." WHERE fileid=$lid"); if ($sender != 0) { $result3 = $xoopsDB->query("SELECT uname, email FROM ".$xoopsDB->prefix("users")." WHERE uid=".$sender.""); list($sendername, $email)=$xoopsDB->fetchRow($result3); } list($fileshowname)=$xoopsDB->fetchRow($result2); $result4 = $xoopsDB->query("SELECT uname, email FROM ".$xoopsDB->prefix("users")." WHERE uid=".$owner.""); list($ownername, $owneremail)=$xoopsDB->fetchRow($result4); echo "<tr><td bgcolor=$colorswitch><a href=index.php?op=fileedit&fileid=$lid target='_blank'>".$fileshowname."</a></td>"; if ($email=="") { echo "<td bgcolor=$colorswitch>$sendername ($ip)"; } else { echo "<td bgcolor=$colorswitch><a href=mailto:$email>$sendername</a> ($ip)"; } echo "</td>"; echo "</td><td bgcolor='$colorswitch' align='center'>"; echo myTextForm("brokendown.php?op=ignoreBrokenDownloads&lid=$lid" , "X"); echo "</td><td bgcolor='$colorswitch' align='center'>"; echo myTextForm("index.php?op=fileedit&fileid=$lid" , "X"); echo "</td><td bgcolor='$colorswitch' align='center'>"; echo myTextForm("brokendown.php?op=delBrokenDownloads&lid=$lid" , "X"); echo "</td></tr>"; if ($colorswitch=="#dddddd") { $colorswitch="#ffffff"; } else { $colorswitch="#dddddd"; } } echo "</table>"; } echo"</td></tr></table>"; }
function deletemsg() { list($mid, $ok) = pnVarCleanFromInput('mid', 'ok'); if (!isset($ok)) { $ok = 0; } list($dbconn) = pnDBGetConn(); $pntable = pnDBGetTables(); $column =& $pntable['message_column']; $result = $dbconn->Execute("SELECT {$column['title']}\n FROM {$pntable['message']}\n WHERE {$column['mid']} = '" . pnVarPrepForStore($mid) . "'"); list($title) = $result->fields; $result->Close(); if (!pnSecAuthAction(0, 'Messages::', "{$title}::{$mid}", ACCESS_DELETE)) { include 'header.php'; echo _MESSAGESDELNOAUTH; include 'footer.php'; return; } if ($ok) { if (!pnSecConfirmAuthKey()) { include 'header.php'; echo _BADAUTHKEY; include 'footer.php'; return; } $result = $dbconn->Execute("DELETE FROM {$pntable['message']}\n WHERE {$column['mid']}='" . pnVarPrepForStore($mid) . "'"); if ($dbconn->ErrorNo() != 0) { error_log("Error: " . $dbconn->ErrorMsg()); echo $dbconn->ErrorNo() . ": " . $dbconn->ErrorMsg() . "<br>"; return; } pnRedirect('admin.php?module=' . $GLOBALS['module'] . '&op=messages'); } else { include "header.php"; GraphicAdmin(); OpenTable(); echo "<center><font class=\"pn-title\"><b>" . _MESSAGESADMIN . "</b></font></center>"; CloseTable(); OpenTable(); echo "<center><font class=\"pn-normal\">" . _REMOVEMSG . " <b>{$mid} </font></b>"; echo "<table><tr><td>\n"; echo myTextForm("admin.php?module=" . $GLOBALS['module'] . "&op=messages", _NO); echo "</td><td>\n"; echo myTextForm("admin.php?module=" . $GLOBALS['module'] . "&op=deletemsg&mid={$mid}&ok=1&authid=" . pnSecGenAuthKey(), _YES); echo "</td></tr></table>\n"; echo "</center>\n"; CloseTable(); include "footer.php"; } }
$result = $xoopsDB->query("SELECT CID, pagetitle FROM " . $xoopsDB->prefix("wfschannel") . " "); if ($xoopsDB->getRowsNum($result) == 1) { redirect_header("index.php", 3, _AM_CANNOTDELETELASTONE); exit; } $result = $xoopsDB->query("SELECT CID, pagetitle FROM " . $xoopsDB->prefix("wfschannel") . " WHERE CID = {$CID}"); list($CID, $pagetitle) = $xoopsDB->fetchrow($result); xoops_cp_header(); echo "<table width='100%' border='0' cellpadding = '2' cellspacing='1' class = 'confirmMsg'><tr><td class='confirmMsg'>"; echo "<div class='confirmMsg'>"; echo "<h4>" . _AM_DELTHISCHAN . "</h4>"; echo "<h5>{$pagetitle}</h5>"; echo "<table><tr><td>"; echo myTextForm("index.php?op=del&CID=" . $CID . "&confirm=1&pagetitle={$pagetitle}", _AM_DELETE); echo "</td><td>"; echo myTextForm("index.php", _AM_CANCEL); echo "</td></tr></table>"; echo "</div><br /><br />"; echo "</td></tr></table>"; } xoops_cp_footer(); exit; break; case "save": global $xoopsUser, $xoopsDB, $HTTP_POST_VARS; $result = $xoopsDB->query("SELECT CID FROM " . $xoopsDB->prefix("wfschannel") . " WHERE defaultpage = '1'"); list($CIDOLD) = $xoopsDB->fetchrow($result); if ($xoopsDB->getRowsNum($result) >= 1) { if ($CIDOLD != $HTTP_POST_VARS['CID'] && $HTTP_POST_VARS['defaultpage'] == 1) { $xoopsDB->query("UPDATE " . $xoopsDB->prefix("wfschannel") . " SET defaultpage = '0'"); }
$file->delete(); redirect_header("index.php?op=edit&articleid=" . $articleid, 1, _AM_DBUPDATED); exit; } else { xoops_cp_header(); global $xoopsConfig, $wfsConfig; echo "<table width='100%' border='0' cellspacing='1'><tr><td>"; echo "<div class='confirmMsg'>"; echo "<h4>" . _AM_FILEDEL . "</h4>"; $file = new WfsFiles($fileid); $filename = XOOPS_URL . "/" . $wfsConfig['filesbasepath']; echo $filename . "/" . $file->getFileRealName() . " (" . $file->getDownloadname() . ")\n"; echo "<table><tr><td><br />"; echo myTextForm("index.php?op=delfile&fileid=" . $fileid . "&ok=1", _AM_YES); echo "</td><td><br />"; echo myTextForm("javascript:history.go(-1)", _AM_NO); echo "</td></tr></table>"; echo "</div>"; echo "</td></tr></table>"; } break; case "filesave": include_once "../class/wfsfiles.php"; if (!empty($fileid)) { $file = new WfsFiles($fileid); } else { $file = new WfsFiles(); } $file->loadPostVars(); $file->store(); redirect_header("wfsfilesshow.php", 1, _AM_DBUPDATED);
function file_delcomf($articleid,$fileid) { global $xoopsModule, $xoopsConfig, $wfsConfig; echo"<table width='100%' border='0' cellspacing='1'><tr><td>"; echo "<div class='confirmMsg'>"; echo "<h4>"._WFS_FILE_DELETE_COMFROM."</h4>"; $file = new WfsFiles($fileid); $filename = XOOPS_URL."/".$wfsConfig['filesbasepath']; echo $file->getDownloadname(); echo "<table><tr><td><br />"; echo myTextForm("modify.php?op=filedel&fileid=".$fileid."&articleid=".$articleid, _WFS_YES); echo "</td><td><br />"; echo myTextForm("javascript:history.go(-1)" , _WFS_NO); echo "</td></tr></table>"; echo "</div>"; echo"</td></tr></table>"; }