📄 index.php
字号:
echo "<tr><td align=\"center\" colspan=\"7\">" ._MD_NOREGVOTES."<br /></td></tr>\n"; } $x=0; $colorswitch="dddddd"; while(list($ratingid, $ratinguser, $rating, $ratinghostname, $ratingtimestamp)=$xoopsDB->fetchRow($result5)) { // $ratingtimestamp = formatTimestamp($ratingtimestamp); //Individual user information $result2=$xoopsDB->query("SELECT rating FROM ".$xoopsDB->prefix("mylinks_votedata")." WHERE ratinguser = '$ratinguser'"); $uservotes = $xoopsDB->getRowsNum($result2); $useravgrating = 0; while ( list($rating2) = $xoopsDB->fetchRow($result2) ) { $useravgrating = $useravgrating + $rating2; } $useravgrating = $useravgrating / $uservotes; $useravgrating = number_format($useravgrating, 1); $ratingusername = XoopsUser::getUnameFromId($ratinguser); echo "<tr><td bgcolor=\"".$colorswitch."\">".$ratingusername."</td><td bgcolor=\"$colorswitch\">".$ratinghostname."</td><td bgcolor=\"$colorswitch\">$rating</td><td bgcolor=\"$colorswitch\">".$useravgrating."</td><td bgcolor=\"$colorswitch\">".$uservotes."</td><td bgcolor=\"$colorswitch\">".$ratingtimestamp."</td><td bgcolor=\"$colorswitch\" align=\"center\"><b>".myTextForm("index.php?op=delVote&lid=$lid&rid=$ratingid", "X")."</b></td></tr>\n"; $x++; if ( $colorswitch == "dddddd" ) { $colorswitch="ffffff"; } else { $colorswitch="dddddd"; } } // Show Unregistered Users Votes $result5=$xoopsDB->query("SELECT ratingid, rating, ratinghostname, ratingtimestamp FROM ".$xoopsDB->prefix("mylinks_votedata")." WHERE lid = $lid AND ratinguser = 0 ORDER BY ratingtimestamp DESC"); $votes = $xoopsDB->getRowsNum($result5); echo "<tr><td colspan=7><b><br /><br />"; printf(_MD_ANONTOTALVOTES,$votes); echo "</b><br /><br /></td></tr>\n"; echo "<tr><td colspan=2><b>" ._MD_IP." </b></td><td colspan=3><b>" ._MD_RATING." </b></td><td><b>" ._MD_DATE." </b></b></td><td align=\"center\"><b>" ._MD_DELETE."</b></td><br /></tr>"; if ( $votes == 0 ) { echo "<tr><td colspan=\"7\" align=\"center\">" ._MD_NOUNREGVOTES."<br /></td></tr>"; } $x=0; $colorswitch="dddddd"; while ( list($ratingid, $rating, $ratinghostname, $ratingtimestamp)=$xoopsDB->fetchRow($result5) ) { $formatted_date = formatTimestamp($ratingtimestamp); echo "<td colspan=\"2\" bgcolor=\"$colorswitch\">$ratinghostname</td><td colspan=\"3\" bgcolor=\"$colorswitch\">$rating</td><td bgcolor=\"$colorswitch\">$formatted_date</td><td bgcolor=\"$colorswitch\" aling=\"center\"><b>".myTextForm("index.php?op=delVote&lid=$lid&rid=$ratingid", "X")."</b></td></tr>"; $x++; if ( $colorswitch == "dddddd" ) { $colorswitch="ffffff"; } else { $colorswitch="dddddd"; } } echo "<tr><td colspan=\"6\"> <br /></td></tr>\n"; echo "</table>\n"; echo"</td></tr></table>"; xoops_cp_footer();}function delVote(){ global $xoopsDB, $_GET, $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); redirect_header("index.php",1,_MD_VOTEDELETED); exit();}function listBrokenLinks(){ global $xoopsDB, $eh; $result = $xoopsDB->query("select * from ".$xoopsDB->prefix("mylinks_broken")." group by lid order by reportid DESC"); $totalbrokenlinks = $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_BROKENREPORTS." ($totalbrokenlinks)</h4><br />"; if ( $totalbrokenlinks == 0 ) { echo _MD_NOBROKEN; } else { echo "<center> "._MD_IGNOREDESC."<br /> "._MD_DELETEDESC."</center><br /><br /><br />"; $colorswitch="dddddd"; echo "<table align=\"center\" width=\"90%\">"; echo " <tr> <td><b>Link Name</b></td> <td><b>" ._MD_REPORTER."</b></td> <td><b>" ._MD_LINKSUBMITTER."</b></td> <td><b>" ._MD_IGNORE."</b></td> <td><b>" ._EDIT."</b></td> <td><b>" ._MD_DELETE."</b></td> </tr>"; while ( list($reportid, $lid, $sender, $ip)=$xoopsDB->fetchRow($result) ) { $result2 = $xoopsDB->query("select title, url, submitter from ".$xoopsDB->prefix("mylinks_links")." where lid=$lid"); if ( $sender != 0 ) { $result3 = $xoopsDB->query("select uname, email from ".$xoopsDB->prefix("users")." where uid=$sender"); list($uname, $email)=$xoopsDB->fetchRow($result3); } list($title, $url, $ownerid)=$xoopsDB->fetchRow($result2); // $url=urldecode($url); $result4 = $xoopsDB->query("select uname, email from ".$xoopsDB->prefix("users")." where uid='$ownerid'"); list($owner, $owneremail)=$xoopsDB->fetchRow($result4); echo "<tr><td bgcolor=$colorswitch><a href=$url target='_blank'>$title</a></td>"; if ( $email=='' ) { echo "<td bgcolor=\"".$colorswitch."\">".$sender." (".$ip.")"; } else { echo "<td bgcolor=\"".$colorswitch."\"><a href=\"mailto:".$email."\">".$uname."</a> (".$ip.")"; } echo "</td>"; if ( $owneremail == '' ) { echo "<td bgcolor=\"".$colorswitch."\">".$owner.""; } else { echo "<td bgcolor=\"".$colorswitch."\"><a href=\"mailto:".$owneremail."\">".$owner."</a>"; } echo "</td><td bgcolor='$colorswitch' align='center'>\n"; echo myTextForm("index.php?op=ignoreBrokenLinks&lid=$lid" , "X"); echo "</td><td bgcolor='$colorswitch' align='center'>\n"; echo myTextForm("index.php?op=modLink&lid=$lid" , "X"); echo "</td><td align='center' bgcolor='$colorswitch'>\n"; echo myTextForm("index.php?op=delBrokenLinks&lid=$lid" , "X"); echo "</td></tr>\n"; if ( $colorswitch == "#dddddd" ) { $colorswitch="#ffffff"; } else { $colorswitch="#dddddd"; } } echo "</table>"; } echo"</td></tr></table>"; xoops_cp_footer();}function delBrokenLinks(){ global $xoopsDB, $_GET, $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); $xoopsDB->query($sql) or $eh->show("0013"); redirect_header("index.php",1,_MD_LINKDELETED); exit();}function ignoreBrokenLinks(){ global $xoopsDB, $_GET, $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();}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> <table width=100% bgcolor=dddddd> <tr> <td valign=top width=45%><b>"._MD_ORIGINAL."</b></td> <td rowspan=14 valign=top align=left><small><br />"._MD_DESCRIPTIONC."<br />$origdescription</small></td> </tr> <tr><td valign=top width=45%><small>"._MD_SITETITLE."$origtitle</small></td></tr> <tr><td valign=top width=45%><small>"._MD_SITEURL."".$origurl."</small></td></tr> <tr><td valign=top width=45%><small>"._MD_CATEGORYC."$origcidtitle</small></td></tr> <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> </table></td></tr><tr><td> <table width=100%> <tr> <td valign=top width=45%><b>"._MD_PROPOSED."</b></td> <td rowspan=14 valign=top align=left><small><br />"._MD_DESCRIPTIONC."<br />$description</small></td> </tr> <tr><td valign=top width=45%><small>"._MD_SITETITLE."$title</small></td></tr> <tr><td valign=top width=45%><small>"._MD_SITEURL."".$url."</small></td></tr> <tr><td valign=top width=45%><small>"._MD_CATEGORYC."$cidtitle</small></td></tr> <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> </table></td></tr></table> <table align=center width=450> <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 changeModReq(){ global $xoopsDB, $_GET, $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) ) { if ( get_magic_quotes_runtime() ) { $title = stripslashes($title); $url = stripslashes($url); $logourl = stripslashes($logourl); $description = stripslashes($description); } $title = addslashes($title); $url = addslashes($url); $logourl = addslashes($logourl); $description = addslashes($description); $sql= sprintf("UPDATE %s SET cid = %u, title = '%s', url = '%s', logourl = '%s', status = 2, date = %u WHERE lid = %u", $xoopsDB->prefix("mylinks_links"), $cid, $title, $url, $logourl, time(), $lid); $xoopsDB->query($sql) or $eh->show("0013"); $sql = sprintf("UPDATE %s SET description = '%s' WHERE lid = %u", $xoopsDB->prefix("mylinks_text"), $description, $lid); $xoopsDB->query($sql) or $eh->show("0013"); $sql = sprintf("DELETE FROM %s WHERE requestid = %u", $xoopsDB->prefix("mylinks_mod"), $requestid); $xoopsDB->query($sql) or $eh->show("0013"); } redirect_header("index.php",1,_MD_DBUPDATED); exit();}function ignoreModReq(){ global $xoopsDB, $_GET, $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();}function modLinkS(){ global $xoopsDB, $_POST, $myts, $eh; $cid = $_POST["cid"]; if ( ($_POST["url"]) || ($_POST["url"]!="") ) { // $url = $myts->formatURL($_POST["url"]); // $url = urlencode($url); $url = $myts->makeTboxData4Save($_POST["url"]); } $logourl = $myts->makeTboxData4Save($_POST["logourl"]); $title = $myts->makeTboxData4Save($_POST["title"]); $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, $_GET, $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"), $_GET['lid']); $xoopsDB->query($sql) or $eh->show("0013");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -