Changeset 147
- Timestamp:
- 12/12/06 12:29:11 (16 years ago)
- Files:
-
- 6 modified
Legend:
- Unmodified
- Added
- Removed
-
1.2.1/common/admin_feed.php
r146 r147 1 1 <? 2 2 3 // liq's feed syndication mod v1. 13 // liq's feed syndication mod v1.2 4 4 5 5 @set_time_limit(0); … … 22 22 $feedcount = 3; 23 23 24 if ( $_POST['submit'] ) {25 24 26 if ( ctype_digit($_POST['fetch_feed_count']) ) { 25 if ( $_POST['submit'] || $_POST['fetch'] ) { 26 if ( ctype_digit($_POST['fetch_feed_count']) ) { 27 27 setConfig('fetch_feed_count', $_POST['fetch_feed_count']); 28 28 $feedcount = $_POST['fetch_feed_count']; … … 41 41 else 42 42 setConfig('fetch_comment', ''); 43 43 44 44 for ($i = 1; $i<=$feedcount; $i++) { 45 45 $url = "fetch_url_".$i; … … 50 50 setConfig($url, ''); 51 51 $feed[$i] = ''; 52 } 53 } 52 } 53 } 54 54 55 55 $feed = array(); … … 60 60 $time[$i] = $tmp[1]; 61 61 } 62 62 63 if ( $_POST['fetch'] ) { 63 if (CORP_ID) { 64 $corp = new Corporation(CORP_ID); 65 $myid = '&corp='.urlencode($corp->getName()); 66 } 67 if (ALLIANCE_ID) { 68 $alli = new Alliance(ALLIANCE_ID); 69 $myid = '&alli='.urlencode($alli->getName()); 70 } 64 if (CORP_ID) { 65 $corp = new Corporation(CORP_ID); 66 $myid = '&corp='.urlencode($corp->getName()); 67 } 68 if (ALLIANCE_ID) { 69 $alli = new Alliance(ALLIANCE_ID); 70 $myid = '&alli='.urlencode($alli->getName()); 71 } 72 71 73 for ($i=1; $i<=$feedcount; $i++) { 72 74 $feedfetch = new Fetcher(); 73 75 $cfg = "fetch_url_".$i; 74 if (preg_match($validurl , $feed[$i]) ) {76 if (preg_match($validurl , $feed[$i]) && $_POST["fetch_feed_".$i]) { 75 77 $str = ''; 76 78 if ($time[$i]) … … 85 87 } else 86 88 $html .= $feedfetch->grab( $feed[$i].$myid.$str ); 87 } 89 } 90 88 91 setConfig($cfg, $feed[$i].':::'.$lastkllid); 89 92 $time[$i] = $lastkllid; … … 91 94 } 92 95 93 $html .= "<br><form id=options name=options method=post action=?a=admin_feed>"; 94 $html .= "<input type=submit id=submit name=fetch value=\"Fetch\">"; 96 $html .= "<form id=options name=options method=post action=?a=admin_feed>"; 97 $html .= "</table>"; 98 99 $html .= "<div class=block-header2>Feeds</div><table>"; 100 101 for ($i = 1; $i<=$feedcount; $i++) { 102 $html .= "<tr><td width=85px><b>Feed url #".$i."</b></td><td><input type=text name=fetch_url_".$i." size=50 class=password value=\""; 103 if ( $feed[$i] ) 104 $html .= $feed[$i]; 105 $html .= "\"> "; 106 $html .= "<input type=checkbox name=fetch_feed_".$i." id=fetch_feed_".$i; 107 if ( $feed[$i] ) 108 $html .= " checked=\"checked\""; 109 $html .= "><b>Fetch?</b><br>"; 110 $html .= "</td></tr>"; 111 } 95 112 96 $html .= "<br><br><input type=checkbox name=fetch_losses id=fetch_losses>"; 97 $html .= "<b>Get Kills?</b> <br> <i>(by default only your losses get fetched, when ticked all kills where one of your pilots is involved get fetched instead)</i>"; 113 $html .= "</table><i>Example: http://killboard.eve-d2.com/?a=feed</i><br><br><br>"; 114 115 $html .= "<table><tr><td height=30px width=150px><b>Get kills instead of losses?</b></td>"; 116 $html .= "<td><input type=checkbox name=fetch_losses id=fetch_losses>"; 117 $html .= "<i> (by default only your losses get fetched, when ticked all kills where one of your pilots is involved get fetched instead)</i></td></tr>"; 98 118 99 $html .= "<br><br><input type=checkbox name=graball id=graball>"; 100 $html .= "<b>Grab ALL mails from the feed servers?</b> <br> <i>(fetches all mails from the feed servers! use this may take upto several hours depending on the amount of kills to import!)</i>"; 101 102 $html .= "</form></table><br><br>"; 103 104 $html .= "<table class=kb-subtable>"; 105 $html .= "<div class=block-header2>Feeds</div>"; 106 $html .= "<form id=options name=options method=post action=?a=admin_feed>"; 107 for ($i = 1; $i<=$feedcount; $i++) { 108 $html .= "<b>Feed url #".$i."</b><input type=text name=fetch_url_".$i." size=50 class=password value=\""; 109 if ( $feed[$i] ) 110 $html .= $feed[$i]; 111 $html .= "\"><br><br>"; 112 } 113 $html .= "<i>Example: http://killboard.eve-d2.com/?a=feed</i><br><br>"; 114 115 $html .= "<div class=block-header2>Options</div>"; 116 $html .= "<b>Number of feeds:</b> <input type=text name=fetch_feed_count size=2 maxlength=2 class=password value=\"".$feedcount."\"<br><br>"; 119 $html .= "<tr><td height=30px width=150px><b>Grab ALL mails from the feed servers?</b></td>"; 120 $html .= "<td><input type=checkbox name=graball id=graball>"; 121 $html .= "<i> (fetches all mails from the feed servers! use this may take upto several hours depending on the amount of kills to import!)</i></td>"; 122 $html .= "</tr></table><br><br>"; 117 123 118 $html .= "<input type=checkbox name=fetch_verbose id=fetch_verbose"; 119 if ( getConfig('fetch_verbose') ) 120 $html .= " checked=\"checked\""; 121 $html .= "><b>Verbose mode?</b> <br> <i>(display errormessages when the imported mail is malformed, already exists, is not related etc.)</i><br><br>"; 122 123 $html .= "<b>Comment for automatically parsed killmails?</b><br><br>"; 124 $html .= "<input type=text size=50 class=password name=fetch_comment id=fetch_comment value=\""; 124 $html .= "<input type=submit id=submit name=fetch value=\"Fetch!\"><br><br>"; 125 126 $html .= "<div class=block-header2>Options</div><table>"; 127 $html .= "<tr><td height=30px width=150px><b>Number of feeds:</b></td>"; 128 $html .= "<td><input type=text name=fetch_feed_count size=2 maxlength=2 class=password value=\"".$feedcount."\"</td></tr>"; 129 130 $html .= "<tr><td height=50px width=150px><b>Comment for automatically parsed killmails?</b></td>"; 131 $html .= "<td><input type=text size=50 class=password name=fetch_comment id=fetch_comment value=\""; 125 132 if ( getConfig('fetch_comment') ) 126 133 $html .= getConfig('fetch_comment'); 127 $html .= "\"><br><i>(leave blank for none)</i><br>"; 134 $html .= "\"><br><i> (leave blank for none)</i><br></td></tr>"; 135 136 $html .= "<tr><td height=30px width=150px><b>Verbose mode?</b></td>"; 137 $html .= "<td><input type=checkbox name=fetch_verbose id=fetch_verbose"; 138 if ( getConfig('fetch_verbose') ) 139 $html .= " checked=\"checked\""; 140 $html .= "><i> (displays errormessages when the imported mail is malformed, already exists, is not related etc.)</i></td>"; 141 $html .= "</tr></table><br><br>"; 128 142 129 $html .= "< br><br><br><input type=submit id=submit name=submit value=\"Save\">";130 $html .= "</form></table>";143 $html .= "<input type=submit id=submit name=submit value=\"Save\">"; 144 $html .= "</form>"; 131 145 132 146 $page->addContext( $menubox->generate() ); -
1.2.1/common/feed.php
r146 r147 1 1 <?php 2 2 3 // liq's feed syndication mod v1. 13 // liq's feed syndication mod v1.2 4 4 5 5 @set_time_limit(0); … … 83 83 84 84 if ( $_GET['losses']) { 85 $html .= "<description> Loss Feed </description>";85 $html .= "<description> Loss Feed v1.2</description>"; 86 86 if (CORP_ID) 87 87 $klist->addVictimCorp(new Corporation(CORP_ID)); … … 94 94 95 95 } else { 96 $html .= "<description> Kill Feed </description>";96 $html .= "<description> Kill Feed v1.2</description>"; 97 97 if (CORP_ID) 98 98 $klist->addInvolvedCorp(new Corporation(CORP_ID)); -
1.2.1/common/feed_fetcher.php
r146 r147 1 1 <?php 2 2 3 // liq's feed syndication mod v1. 13 // liq's feed syndication mod v1.2 4 4 5 5 @set_time_limit(0); … … 55 55 function grab($url) { 56 56 global $x, $fetchurl; 57 $x=0; 57 58 $fetchurl = $url; 58 59 $xml_parser = xml_parser_create(); … … 104 105 if (class_exists('Comments') && getConfig('fetch_comment')) { // for the Eve-Dev Comment Class 105 106 $comments = new Comments($killid); 106 $comments->addComment(" Automatic Kill Import", getConfig('fetch_comment')." (mail fetched from: ".$fetchurl.")");107 $comments->addComment("liq's feed syndication", getConfig('fetch_comment')." (mail fetched from: ".$fetchurl.")"); 107 108 } 108 109 if (class_exists('Comment') && getConfig('fetch_comment')) { // for the D2 Killboard Comment Class -
dev/common/admin_feed.php
r143 r147 1 1 <? 2 2 3 // liq's feed syndication mod v1. 13 // liq's feed syndication mod v1.2 4 4 5 5 @set_time_limit(0); … … 22 22 $feedcount = 3; 23 23 24 if ( $_POST['submit'] ) {25 24 26 if ( ctype_digit($_POST['fetch_feed_count']) ) { 25 if ( $_POST['submit'] || $_POST['fetch'] ) { 26 if ( ctype_digit($_POST['fetch_feed_count']) ) { 27 27 setConfig('fetch_feed_count', $_POST['fetch_feed_count']); 28 28 $feedcount = $_POST['fetch_feed_count']; … … 41 41 else 42 42 setConfig('fetch_comment', ''); 43 43 44 44 for ($i = 1; $i<=$feedcount; $i++) { 45 45 $url = "fetch_url_".$i; … … 50 50 setConfig($url, ''); 51 51 $feed[$i] = ''; 52 } 53 } 52 } 53 } 54 54 55 55 $feed = array(); … … 60 60 $time[$i] = $tmp[1]; 61 61 } 62 62 63 if ( $_POST['fetch'] ) { 63 if (CORP_ID) { 64 $corp = new Corporation(CORP_ID); 65 $myid = '&corp='.urlencode($corp->getName()); 66 } 67 if (ALLIANCE_ID) { 68 $alli = new Alliance(ALLIANCE_ID); 69 $myid = '&alli='.urlencode($alli->getName()); 70 } 64 if (CORP_ID) { 65 $corp = new Corporation(CORP_ID); 66 $myid = '&corp='.urlencode($corp->getName()); 67 } 68 if (ALLIANCE_ID) { 69 $alli = new Alliance(ALLIANCE_ID); 70 $myid = '&alli='.urlencode($alli->getName()); 71 } 72 71 73 for ($i=1; $i<=$feedcount; $i++) { 72 74 $feedfetch = new Fetcher(); 73 75 $cfg = "fetch_url_".$i; 74 if (preg_match($validurl , $feed[$i]) ) {76 if (preg_match($validurl , $feed[$i]) && $_POST["fetch_feed_".$i]) { 75 77 $str = ''; 76 78 if ($time[$i]) … … 85 87 } else 86 88 $html .= $feedfetch->grab( $feed[$i].$myid.$str ); 87 } 89 } 90 88 91 setConfig($cfg, $feed[$i].':::'.$lastkllid); 89 92 $time[$i] = $lastkllid; … … 91 94 } 92 95 93 $html .= "<br><form id=options name=options method=post action=?a=admin_feed>"; 94 $html .= "<input type=submit id=submit name=fetch value=\"Fetch\">"; 96 $html .= "<form id=options name=options method=post action=?a=admin_feed>"; 97 $html .= "</table>"; 98 99 $html .= "<div class=block-header2>Feeds</div><table>"; 100 101 for ($i = 1; $i<=$feedcount; $i++) { 102 $html .= "<tr><td width=85px><b>Feed url #".$i."</b></td><td><input type=text name=fetch_url_".$i." size=50 class=password value=\""; 103 if ( $feed[$i] ) 104 $html .= $feed[$i]; 105 $html .= "\"> "; 106 $html .= "<input type=checkbox name=fetch_feed_".$i." id=fetch_feed_".$i; 107 if ( $feed[$i] ) 108 $html .= " checked=\"checked\""; 109 $html .= "><b>Fetch?</b><br>"; 110 $html .= "</td></tr>"; 111 } 95 112 96 $html .= "<br><br><input type=checkbox name=fetch_losses id=fetch_losses>"; 97 $html .= "<b>Get Kills?</b> <br> <i>(by default only your losses get fetched, when ticked all kills where one of your pilots is involved get fetched instead)</i>"; 113 $html .= "</table><i>Example: http://killboard.eve-d2.com/?a=feed</i><br><br><br>"; 114 115 $html .= "<table><tr><td height=30px width=150px><b>Get kills instead of losses?</b></td>"; 116 $html .= "<td><input type=checkbox name=fetch_losses id=fetch_losses>"; 117 $html .= "<i> (by default only your losses get fetched, when ticked all kills where one of your pilots is involved get fetched instead)</i></td></tr>"; 98 118 99 $html .= "<br><br><input type=checkbox name=graball id=graball>"; 100 $html .= "<b>Grab ALL mails from the feed servers?</b> <br> <i>(fetches all mails from the feed servers! use this may take upto several hours depending on the amount of kills to import!)</i>"; 101 102 $html .= "</form></table><br><br>"; 103 104 $html .= "<table class=kb-subtable>"; 105 $html .= "<div class=block-header2>Feeds</div>"; 106 $html .= "<form id=options name=options method=post action=?a=admin_feed>"; 107 for ($i = 1; $i<=$feedcount; $i++) { 108 $html .= "<b>Feed url #".$i."</b><input type=text name=fetch_url_".$i." size=50 class=password value=\""; 109 if ( $feed[$i] ) 110 $html .= $feed[$i]; 111 $html .= "\"><br><br>"; 112 } 113 $html .= "<i>Example: http://killboard.eve-d2.com/?a=feed</i><br><br>"; 114 115 $html .= "<div class=block-header2>Options</div>"; 116 $html .= "<b>Number of feeds:</b> <input type=text name=fetch_feed_count size=2 maxlength=2 class=password value=\"".$feedcount."\"<br><br>"; 119 $html .= "<tr><td height=30px width=150px><b>Grab ALL mails from the feed servers?</b></td>"; 120 $html .= "<td><input type=checkbox name=graball id=graball>"; 121 $html .= "<i> (fetches all mails from the feed servers! use this may take upto several hours depending on the amount of kills to import!)</i></td>"; 122 $html .= "</tr></table><br><br>"; 117 123 118 $html .= "<input type=checkbox name=fetch_verbose id=fetch_verbose"; 119 if ( getConfig('fetch_verbose') ) 120 $html .= " checked=\"checked\""; 121 $html .= "><b>Verbose mode?</b> <br> <i>(display errormessages when the imported mail is malformed, already exists, is not related etc.)</i><br><br>"; 122 123 $html .= "<b>Comment for automatically parsed killmails?</b><br><br>"; 124 $html .= "<input type=text size=50 class=password name=fetch_comment id=fetch_comment value=\""; 124 $html .= "<input type=submit id=submit name=fetch value=\"Fetch!\"><br><br>"; 125 126 $html .= "<div class=block-header2>Options</div><table>"; 127 $html .= "<tr><td height=30px width=150px><b>Number of feeds:</b></td>"; 128 $html .= "<td><input type=text name=fetch_feed_count size=2 maxlength=2 class=password value=\"".$feedcount."\"</td></tr>"; 129 130 $html .= "<tr><td height=50px width=150px><b>Comment for automatically parsed killmails?</b></td>"; 131 $html .= "<td><input type=text size=50 class=password name=fetch_comment id=fetch_comment value=\""; 125 132 if ( getConfig('fetch_comment') ) 126 133 $html .= getConfig('fetch_comment'); 127 $html .= "\"><br><i>(leave blank for none)</i><br>"; 134 $html .= "\"><br><i> (leave blank for none)</i><br></td></tr>"; 135 136 $html .= "<tr><td height=30px width=150px><b>Verbose mode?</b></td>"; 137 $html .= "<td><input type=checkbox name=fetch_verbose id=fetch_verbose"; 138 if ( getConfig('fetch_verbose') ) 139 $html .= " checked=\"checked\""; 140 $html .= "><i> (displays errormessages when the imported mail is malformed, already exists, is not related etc.)</i></td>"; 141 $html .= "</tr></table><br><br>"; 128 142 129 $html .= "< br><br><br><input type=submit id=submit name=submit value=\"Save\">";130 $html .= "</form></table>";143 $html .= "<input type=submit id=submit name=submit value=\"Save\">"; 144 $html .= "</form>"; 131 145 132 146 $page->addContext( $menubox->generate() ); -
dev/common/feed.php
r144 r147 1 1 <?php 2 2 3 // liq's feed syndication mod v1. 13 // liq's feed syndication mod v1.2 4 4 5 5 @set_time_limit(0); … … 83 83 84 84 if ( $_GET['losses']) { 85 $html .= "<description> Loss Feed </description>";85 $html .= "<description> Loss Feed v1.2</description>"; 86 86 if (CORP_ID) 87 87 $klist->addVictimCorp(new Corporation(CORP_ID)); … … 94 94 95 95 } else { 96 $html .= "<description> Kill Feed </description>";96 $html .= "<description> Kill Feed v1.2</description>"; 97 97 if (CORP_ID) 98 98 $klist->addInvolvedCorp(new Corporation(CORP_ID)); -
dev/common/feed_fetcher.php
r143 r147 1 1 <?php 2 2 3 // liq's feed syndication mod v1. 13 // liq's feed syndication mod v1.2 4 4 5 5 @set_time_limit(0); … … 55 55 function grab($url) { 56 56 global $x, $fetchurl; 57 $x=0; 57 58 $fetchurl = $url; 58 59 $xml_parser = xml_parser_create(); … … 104 105 if (class_exists('Comments') && getConfig('fetch_comment')) { // for the Eve-Dev Comment Class 105 106 $comments = new Comments($killid); 106 $comments->addComment(" Automatic Kill Import", getConfig('fetch_comment')." (mail fetched from: ".$fetchurl.")");107 $comments->addComment("liq's feed syndication", getConfig('fetch_comment')." (mail fetched from: ".$fetchurl.")"); 107 108 } 108 109 if (class_exists('Comment') && getConfig('fetch_comment')) { // for the D2 Killboard Comment Class