NobuNobu
nobun****@users*****
2005年 8月 21日 (日) 13:16:53 JST
Index: xoops2jp/html/modules/mylinks/admin/index.php diff -u xoops2jp/html/modules/mylinks/admin/index.php:1.4.2.1 xoops2jp/html/modules/mylinks/admin/index.php:1.4.2.2 --- xoops2jp/html/modules/mylinks/admin/index.php:1.4.2.1 Sat Aug 13 23:47:42 2005 +++ xoops2jp/html/modules/mylinks/admin/index.php Sun Aug 21 13:16:53 2005 @@ -247,9 +247,9 @@ function modLink() { - global $xoopsDB, $HTTP_GET_VARS, $myts, $eh, $mytree, $xoopsConfig; + global $xoopsDB, $myts, $eh, $mytree, $xoopsConfig; $linkimg_array = XoopsLists::getImgListAsArray(XOOPS_ROOT_PATH."/modules/mylinks/images/shots/"); - $lid = $HTTP_GET_VARS['lid']; + $lid = $_GET['lid']; xoops_cp_header(); echo "<h4>"._MD_WEBLINKSCONF."</h4>"; echo"<table width='100%' border='0' cellspacing='1' class='outer'>" @@ -378,9 +378,9 @@ function delVote() { - global $xoopsDB, $HTTP_GET_VARS, $eh; - $rid = $HTTP_GET_VARS['rid']; - $lid = $HTTP_GET_VARS['lid']; + global $xoopsDB, $eh; + $rid = $_GET['rid']; + $lid = $_GET['lid']; $sql = sprintf("DELETE FROM %s WHERE ratingid = %u", $xoopsDB->prefix("mylinks_votedata"), $rid); $xoopsDB->query($sql) or $eh->show("0013"); updaterating($lid); @@ -462,8 +462,8 @@ function delBrokenLinks() { - global $xoopsDB, $HTTP_GET_VARS, $eh; - $lid = $HTTP_GET_VARS['lid']; + global $xoopsDB, $eh; + $lid = $_GET['lid']; $sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mylinks_broken"), $lid); $xoopsDB->query($sql) or $eh->show("0013"); $sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mylinks_links"), $lid); @@ -474,8 +474,8 @@ function ignoreBrokenLinks() { - global $xoopsDB, $HTTP_GET_VARS, $eh; - $sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mylinks_broken"), $HTTP_GET_VARS['lid']); + global $xoopsDB, $eh; + $sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mylinks_broken"), $_GET['lid']); $xoopsDB->query($sql) or $eh->show("0013"); redirect_header("index.php",1,_MD_BROKENDELETED); exit(); @@ -589,8 +589,8 @@ function changeModReq() { - global $xoopsDB, $HTTP_GET_VARS, $eh, $myts; - $requestid = $HTTP_GET_VARS['requestid']; + global $xoopsDB, $eh, $myts; + $requestid = $_GET['requestid']; $query = "select lid, cid, title, url, logourl, description from ".$xoopsDB->prefix("mylinks_mod")." where requestid=".$requestid.""; $result = $xoopsDB->query($query); while ( list($lid, $cid, $title, $url, $logourl, $description)=$xoopsDB->fetchRow($result) ) { @@ -617,8 +617,8 @@ function ignoreModReq() { - global $xoopsDB, $HTTP_GET_VARS, $eh; - $sql = sprintf("DELETE FROM %s WHERE requestid = %u", $xoopsDB->prefix("mylinks_mod"), $HTTP_GET_VARS['requestid']); + global $xoopsDB, $eh; + $sql = sprintf("DELETE FROM %s WHERE requestid = %u", $xoopsDB->prefix("mylinks_mod"), $_GET['requestid']); $xoopsDB->query($sql) or $eh->show("0013"); redirect_header("index.php",1,_MD_MODREQDELETED); exit(); @@ -626,36 +626,36 @@ function modLinkS() { - global $xoopsDB, $HTTP_POST_VARS, $myts, $eh; - $cid = $HTTP_POST_VARS["cid"]; - if ( ($HTTP_POST_VARS["url"]) || ($HTTP_POST_VARS["url"]!="") ) { - // $url = $myts->formatURL($HTTP_POST_VARS["url"]); + global $xoopsDB, $myts, $eh; + $cid = $_POST["cid"]; + if ( ($_POST["url"]) || ($_POST["url"]!="") ) { + // $url = $myts->formatURL($_POST["url"]); // $url = urlencode($url); - $url = $myts->makeTboxData4Save($HTTP_POST_VARS["url"]); + $url = $myts->makeTboxData4Save($_POST["url"]); } - $logourl = $myts->makeTboxData4Save($HTTP_POST_VARS["logourl"]); - $title = $myts->makeTboxData4Save($HTTP_POST_VARS["title"]); + $logourl = $myts->makeTboxData4Save($_POST["logourl"]); + $title = $myts->makeTboxData4Save($_POST["title"]); - $description = $myts->makeTareaData4Save($HTTP_POST_VARS["description"]); - $xoopsDB->query("update ".$xoopsDB->prefix("mylinks_links")." set cid='$cid', title='$title', url='$url', logourl='$logourl', status=2, date=".time()." where lid=".$HTTP_POST_VARS['lid']."") or $eh->show("0013"); - $xoopsDB->query("update ".$xoopsDB->prefix("mylinks_text")." set description='$description' where lid=".$HTTP_POST_VARS['lid']."") or $eh->show("0013"); + $description = $myts->makeTareaData4Save($_POST["description"]); + $xoopsDB->query("update ".$xoopsDB->prefix("mylinks_links")." set cid='$cid', title='$title', url='$url', logourl='$logourl', status=2, date=".time()." where lid=".$_POST['lid']."") or $eh->show("0013"); + $xoopsDB->query("update ".$xoopsDB->prefix("mylinks_text")." set description='$description' where lid=".$_POST['lid']."") or $eh->show("0013"); redirect_header("index.php",1,_MD_DBUPDATED); exit(); } function delLink() { - global $xoopsDB, $HTTP_GET_VARS, $eh, $xoopsModule; - $sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mylinks_links"), $HTTP_GET_VARS['lid']); + global $xoopsDB, $eh, $xoopsModule; + $sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mylinks_links"), $_GET['lid']); $xoopsDB->query($sql) or $eh->show("0013"); - $sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mylinks_text"), $HTTP_GET_VARS['lid']); + $sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mylinks_text"), $_GET['lid']); $xoopsDB->query($sql) or $eh->show("0013"); - $sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mylinks_votedata"), $HTTP_GET_VARS['lid']); + $sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mylinks_votedata"), $_GET['lid']); $xoopsDB->query($sql) or $eh->show("0013"); // delete comments - xoops_comment_delete($xoopsModule->getVar('mid'), $HTTP_GET_VARS['lid']); + xoops_comment_delete($xoopsModule->getVar('mid'), $_GET['lid']); // delete notifications - xoops_notification_deletebyitem ($xoopsModule->getVar('mid'), 'link', $HTTP_GET_VARS['lid']); + xoops_notification_deletebyitem ($xoopsModule->getVar('mid'), 'link', $_GET['lid']); redirect_header("index.php",1,_MD_LINKDELETED); exit(); @@ -663,8 +663,8 @@ function modCat() { - global $xoopsDB, $HTTP_POST_VARS, $myts, $eh, $mytree; - $cid = $HTTP_POST_VARS["cid"]; + global $xoopsDB, $myts, $eh, $mytree; + $cid = $_POST["cid"]; xoops_cp_header(); echo "<h4>"._MD_WEBLINKSCONF."</h4>"; echo"<table width='100%' border='0' cellspacing='1' class='outer'>" @@ -690,15 +690,15 @@ function modCatS() { - global $xoopsDB, $HTTP_POST_VARS, $myts, $eh; - $cid = $HTTP_POST_VARS['cid']; - $pid = $HTTP_POST_VARS['pid']; - $title = $myts->makeTboxData4Save($HTTP_POST_VARS['title']); + global $xoopsDB, $myts, $eh; + $cid = $_POST['cid']; + $pid = $_POST['pid']; + $title = $myts->makeTboxData4Save($_POST['title']); if (empty($title)) { redirect_header("index.php", 2, _MD_ERRORTITLE); } - if ( ($HTTP_POST_VARS["imgurl"]) || ($HTTP_POST_VARS["imgurl"]!="") ) { - $imgurl = $myts->makeTboxData4Save($HTTP_POST_VARS["imgurl"]); + if ( ($_POST["imgurl"]) || ($_POST["imgurl"]!="") ) { + $imgurl = $myts->makeTboxData4Save($_POST["imgurl"]); } $xoopsDB->query("update ".$xoopsDB->prefix("mylinks_cat")." set pid=$pid, title='$title', imgurl='$imgurl' where cid=$cid") or $eh->show("0013"); redirect_header("index.php",1,_MD_DBUPDATED); @@ -706,9 +706,9 @@ function delCat() { - global $xoopsDB, $HTTP_GET_VARS, $HTTP_POST_VARS, $eh, $mytree, $xoopsModule; - $cid = isset($HTTP_POST_VARS['cid']) ? intval($HTTP_POST_VARS['cid']) : intval($HTTP_GET_VARS['cid']); - $ok = isset($HTTP_POST_VARS['ok']) ? intval($HTTP_POST_VARS['ok']) : 0; + global $xoopsDB, $eh, $mytree, $xoopsModule; + $cid = isset($_POST['cid']) ? intval($_POST['cid']) : intval($_GET['cid']); + $ok = isset($_POST['ok']) ? intval($_POST['ok']) : 0; if ( $ok == 1 ) { //get all subcategories under the specified category $arr=$mytree->getAllChildId($cid); @@ -761,31 +761,31 @@ function delNewLink() { - global $xoopsDB, $HTTP_GET_VARS, $eh, $xoopsModule; - $sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mylinks_links"), $HTTP_GET_VARS['lid']); + global $xoopsDB, $eh, $xoopsModule; + $sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mylinks_links"), $_GET['lid']); $xoopsDB->query($sql) or $eh->show("0013"); - $sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mylinks_text"), $HTTP_GET_VARS['lid']); + $sql = sprintf("DELETE FROM %s WHERE lid = %u", $xoopsDB->prefix("mylinks_text"), $_GET['lid']); $xoopsDB->query($sql) or $eh->show("0013"); // delete comments - xoops_comment_delete($xoopsModule->getVar('mid'), $HTTP_GET_VARS['lid']); + xoops_comment_delete($xoopsModule->getVar('mid'), $_GET['lid']); // delete notifications - xoops_notification_deletebyitem($xoopsModule->getVar('mid'), 'link', $HTTP_GET_VARS['lid']); + xoops_notification_deletebyitem($xoopsModule->getVar('mid'), 'link', $_GET['lid']); redirect_header("index.php",1,_MD_LINKDELETED); } function addCat() { - global $xoopsDB, $HTTP_POST_VARS, $myts, $eh; - $pid = $HTTP_POST_VARS["cid"]; - $title = $myts->makeTboxData4Save($HTTP_POST_VARS["title"]); + global $xoopsDB, $myts, $eh; + $pid = $_POST["cid"]; + $title = $myts->makeTboxData4Save($_POST["title"]); if (empty($title)) { redirect_header("index.php",2,_MD_ERRORTITLE); exit(); } - if ( ($HTTP_POST_VARS["imgurl"]) || ($HTTP_POST_VARS["imgurl"]!="") ) { - // $imgurl = $myts->formatURL($HTTP_POST_VARS["imgurl"]); + if ( ($_POST["imgurl"]) || ($_POST["imgurl"]!="") ) { + // $imgurl = $myts->formatURL($_POST["imgurl"]); // $imgurl = urlencode($imgurl); - $imgurl = $myts->makeTboxData4Save($HTTP_POST_VARS["imgurl"]); + $imgurl = $myts->makeTboxData4Save($_POST["imgurl"]); } $newid = $xoopsDB->genId($xoopsDB->prefix("mylinks_cat")."_cid_seq"); $sql = sprintf("INSERT INTO %s (cid, pid, title, imgurl) VALUES (%u, %u, '%s', '%s')", $xoopsDB->prefix("mylinks_cat"), $newid, $pid, $title, $imgurl); @@ -804,15 +804,15 @@ function addLink() { - global $xoopsConfig, $xoopsDB, $myts, $xoopsUser, $xoopsModule, $eh, $HTTP_POST_VARS; - if ( ($HTTP_POST_VARS["url"]) || ($HTTP_POST_VARS["url"]!="") ) { - // $url=$myts->formatURL($HTTP_POST_VARS["url"]); + global $xoopsConfig, $xoopsDB, $myts, $xoopsUser, $xoopsModule, $eh, $_POST; + if ( ($_POST["url"]) || ($_POST["url"]!="") ) { + // $url=$myts->formatURL($_POST["url"]); // $url = urlencode($url); - $url = $myts->makeTboxData4Save($HTTP_POST_VARS["url"]); + $url = $myts->makeTboxData4Save($_POST["url"]); } - $logourl = $myts->makeTboxData4Save($HTTP_POST_VARS["logourl"]); - $title = $myts->makeTboxData4Save($HTTP_POST_VARS["title"]); - $description = $myts->makeTareaData4Save($HTTP_POST_VARS["description"]); + $logourl = $myts->makeTboxData4Save($_POST["logourl"]); + $title = $myts->makeTboxData4Save($_POST["title"]); + $description = $myts->makeTareaData4Save($_POST["description"]); $submitter = $xoopsUser->uid(); $result = $xoopsDB->query("select count(*) from ".$xoopsDB->prefix("mylinks_links")." where url='$url'"); list($numrows) = $xoopsDB->fetchRow($result); @@ -842,8 +842,8 @@ xoops_cp_footer(); exit(); } - if ( !empty($HTTP_POST_VARS['cid']) ) { - $cid = $HTTP_POST_VARS['cid']; + if ( !empty($_POST['cid']) ) { + $cid = $_POST['cid']; } else { $cid = 0; } @@ -871,20 +871,20 @@ function approve() { - global $xoopsConfig, $xoopsDB, $HTTP_POST_VARS, $myts, $eh; - $lid = $HTTP_POST_VARS['lid']; - $title = $HTTP_POST_VARS['title']; - $cid = $HTTP_POST_VARS['cid']; + global $xoopsConfig, $xoopsDB, $myts, $eh; + $lid = $_POST['lid']; + $title = $_POST['title']; + $cid = $_POST['cid']; if ( empty($cid) ) { $cid = 0; } - $description = $HTTP_POST_VARS['description']; - if (($HTTP_POST_VARS["url"]) || ($HTTP_POST_VARS["url"]!="")) { - // $url=$myts->formatURL($HTTP_POST_VARS["url"]); + $description = $_POST['description']; + if (($_POST["url"]) || ($_POST["url"]!="")) { + // $url=$myts->formatURL($_POST["url"]); // $url = urlencode($url); - $url = $myts->makeTboxData4Save($HTTP_POST_VARS["url"]); + $url = $myts->makeTboxData4Save($_POST["url"]); } - $logourl = $myts->makeTboxData4Save($HTTP_POST_VARS["logourl"]); + $logourl = $myts->makeTboxData4Save($_POST["logourl"]); $title = $myts->makeTboxData4Save($title); $description = $myts->makeTareaData4Save($description); $query = "update ".$xoopsDB->prefix("mylinks_links")." set cid='$cid', title='$title', url='$url', logourl='$logourl', status=1, date=".time()." where lid=".$lid.""; @@ -906,10 +906,10 @@ $notification_handler->triggerEvent('link', $lid, 'approve', $tags); redirect_header("index.php",1,_MD_NEWLINKADDED); } -if(!isset($HTTP_POST_VARS['op'])) { - $op = isset($HTTP_GET_VARS['op']) ? $HTTP_GET_VARS['op'] : 'main'; +if(!isset($_POST['op'])) { + $op = isset($_GET['op']) ? $_GET['op'] : 'main'; } else { - $op = $HTTP_POST_VARS['op']; + $op = $_POST['op']; } switch ($op) { case "delNewLink":