- Timestamp:
- 01/11/07 13:45:30 (15 years ago)
- Location:
- dev
- Files:
-
- 1 added
- 1 removed
- 4 modified
Legend:
- Unmodified
- Added
- Removed
-
dev/common/feed.php
r170 r175 2 2 ////// 3 3 ////// ////// 4 ////// liq's feed syndication mod v1. 44 ////// liq's feed syndication mod v1.5 5 5 //////////// 6 6 //////////// … … 21 21 <title>" . KB_TITLE . "</title> 22 22 <link>http://" . KB_HOST . "</link> 23 <description>Kill Feed v1. 4</description>23 <description>Kill Feed v1.5</description> 24 24 <copyright>" . KB_TITLE . "</copyright>\n"; 25 25 -
dev/mods/feed_syndication/feed_fetcher.php
r170 r175 2 2 ////// 3 3 ////// ////// 4 ////// liq's feed syndication mod v1. 44 ////// liq's feed syndication mod v1.5 5 5 //////////// 6 6 //////////// -
dev/mods/feed_syndication/readme.txt
r170 r175 1 1 ////// 2 2 ////// ////// 3 ////// liq's feed syndication mod v1. 43 ////// liq's feed syndication mod v1.5 4 4 //////////// 5 5 //////////// … … 11 11 //INSTALLATION: 12 12 13 ### --> STANDALONE version: 13 14 15 ##### --> STANDALONE version: 16 17 14 18 1. put all files in your /common directory 15 19 16 20 2. add the following line to common/admin_menu.php: 17 21 $menubox->addOption( "Feeds", "?a=admin_feed" ); 18 orif you use eve-dev kilboard version 1.2.0 and above (using smarty templates):22 OR if you use eve-dev kilboard version 1.2.0 and above (using smarty templates): 19 23 $menubox->addOption("link", "Feeds", "?a=admin_feed"); 20 24 … … 24 28 25 29 26 ### --> MOD version: 27 1. create directory mods/feed 30 31 32 ###### --> MOD version: 33 34 35 1. create directory mods/feed_syndication 28 36 29 37 2. put the files settings.php and feed_fetcher.php in /mods/feed_syndication directory. … … 37 45 5. click 'Settings' in the 'Mods' menu to access the feed interface 38 46 39 additionally you can add the following line to common/admin_menu.php for directaccess:40 $menubox->addOption( "Feeds", "?a=settings_feed " );41 orif you use eve-dev kilboard version 1.2.0 and above (using smarty templates):42 $menubox->addOption("link", "Feeds", "?a=settings_feed ");47 additionally you can add the following line to common/admin_menu.php for faster access: 48 $menubox->addOption( "Feeds", "?a=settings_feed_syndication" ); 49 OR if you use eve-dev kilboard version 1.2.0 and above (using smarty templates): 50 $menubox->addOption("link", "Feeds", "?a=settings_feed_syndication"); 43 51 44 52 … … 58 66 -> enter feed urls in the format: http://killboard.eve-d2.com/?a=feed 59 67 68 -> if you enter a feed from a friendly corp/alliance have the 'friends' box checked else you will only be able to fetch friendly fire kills 69 60 70 -> a list of known feeds can be found here: http://myeve.eve-online.com/ingameboard.asp?a=topic&threadID=443506&page=1#2 61 71 … … 69 79 ** be patient. don't close your browser, don't reload. after doing a full fetch first, weekly updates are totally sufficient to keep your board uptodate ** 70 80 71 72 81 -> by default their kills aka. your losses get fetched unless you tick the 'get kills' 73 82 option in which case their losses aka. your kills get fetched 74 83 75 84 -> GZip compression is enabled by default because the board automatically 76 checks and decides if a fetched stream supports GZip compression - if not it uses regular html/rss output. 77 85 checks and decides if a fetched stream supports GZip compression - if not, it uses regular html/rss output. leave this enabled. 78 86 79 87 -> if you are running a master killboard (eg. to supply and share killdata with other killboards) edit settings.php and set 'MASTER' to 1. … … 87 95 88 96 97 89 98 //VERSION CHANGES: 99 //v1.5 100 101 feed.php: 102 - no changes 103 104 feed_fetcher.php: 105 - no changes 106 107 admin_feed.php / settings.php 108 - added a version check (checks my server for the actual version of the mod and gives you an update link if the versions differ) 109 - added 'select all/none' boxes for the friends and fetch checkbox rows, pretty handy with large feedlists 110 - fixed small bug with the timeframe selection options and a html bug 90 111 91 112 -
dev/mods/feed_syndication/settings.php
r170 r175 2 2 ////// 3 3 ////// ////// 4 ////// liq's feed syndication mod v1. 44 ////// liq's feed syndication mod v1.5 5 5 //////////// 6 6 //////////// … … 13 13 define( MASTER, 0 ); 14 14 15 $version = "v1.5"; 15 16 @set_time_limit(0); 16 require_once( "feed_fetcher.php");17 require_once( "common/class.page.php");18 require_once( "common/admin_menu.php");17 require_once( 'feed_fetcher.php' ); 18 require_once( 'common/class.page.php' ); 19 require_once( 'common/admin_menu.php' ); 19 20 require_once( 'common/class.corp.php' ); 20 21 require_once( 'common/class.alliance.php' ); 21 22 22 $page = new Page( "Administration - Feed Syndication v1.4" ); 23 24 $page = new Page( "Administration - Feed Syndication " . $version ); 25 $page->setCachable(false); 23 26 $page->setAdmin(); 24 27 25 28 $validurl = "/^(http|https):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}((:[0-9]{1,5})?\/.*)?$/i"; 29 $html .= "<script language=\"JavaScript\">function checkAll(checkname, exby) {for (i = 0; i < checkname.length; i++)checkname[i].checked = exby.checked? true:false}</script>"; 26 30 $html .= "<table class=kb-subtable>"; 31 32 //checking for updated versions 33 $versionserver = "http://tomx.org/feed/version.txt"; 34 if ( fopen($versionserver, "r") ) { 35 $versionfile = fopen($versionserver, "r"); 36 $remoteversion = fread($versionfile, 4); 37 fclose($versionfile); 38 if ( $remoteversion != $version ) 39 $html .= '<div class="kl-loss"><b>Your version ('.$version.') is outdated! </b></div><br>There is a newer version ('.$remoteversion.') available <a href="http://tomx.org/feed/mod_feed_'.$remoteversion.'.zip"><b>here</b></a>. <br>Please update!<br><br>'; 40 } else 41 $html .= '<div class="kl-loss">Cant retrieve version information from: '.$versionserver.'</div><br><br>'; 27 42 28 43 if (getConfig('fetch_feed_count')) … … 31 46 $feedcount = 3; 32 47 48 //saving urls and options 33 49 if ( $_POST['submit'] || $_POST['fetch'] ) { 34 50 if ( ctype_digit($_POST['fetch_feed_count']) && $_POST['fetch_feed_count'] > 0) { … … 56 72 for ($i = 1; $i<=$feedcount; $i++) { 57 73 $url = "fetch_url_".$i; 58 $friends = $_POST["friend_".$i];59 74 if ( preg_match($validurl ,$_POST[$url]) ) { 75 if ( $_POST['friend'] && in_array ($i, $_POST['friend']) ) 76 $friends = "on"; 77 else $friends = ""; 60 78 setConfig($url, $_POST[$url].':::'.$time[$i].':::'.$friends); 61 79 $feed[$i] = $_POST[$url]; … … 71 89 $feed[$i] = $tmp[0]; 72 90 $time[$i] = $tmp[1]; 73 $friend[$i] = $tmp[2]; 91 if ( $tmp[2] == "on") 92 $friend[$i] = $tmp[2]; 74 93 } 94 95 //building the request query and fetching of the feeds 75 96 if ( $_POST['fetch'] ) { 76 97 if (CORP_ID && !MASTER) { … … 85 106 $feedfetch = new Fetcher(); 86 107 $cfg = "fetch_url_".$i; 87 if ( preg_match($validurl , $feed[$i]) && $_POST["fetch_feed_".$i]) {108 if ( preg_match($validurl , $feed[$i]) && $_POST['fetch_feed'] && in_array ($i, $_POST['fetch_feed']) ) { 88 109 $str = ''; 89 110 //if ($time[$i]) … … 114 135 } 115 136 } 116 117 $html .= "<form id=options name=options method=post action=?a=settings_feed_syndication>";137 //generating the html 138 $html .= '<form id="options" name="options" method="post" action="?a=settings_feed_syndication">'; 118 139 $html .= "</table>"; 119 140 … … 123 144 if ( $feed[$i] ) 124 145 $html .= $feed[$i]; 125 $html .= "\"> "; 126 $html .= "<input type=checkbox name=friend_".$i." id=friend_".$i; 146 $html .= "\"></td>"; 147 148 $html .= "<td><input type=checkbox name=friend[] id=friend value=".$i; 127 149 if ( $friend[$i] ) 128 150 $html .= " checked=\"checked\""; 129 $html .= "><b>Friend?</b>"; 130 $html .= "<input type=checkbox name=fetch_feed_".$i." id=fetch_feed_".$i; 151 $html .= "><b>Friend?</b></td>"; 152 153 $html .= "<td><input type=checkbox name=fetch_feed[] id=fetch value=".$i; 131 154 if ( $feed[$i] ) 132 155 $html .= " checked=\"checked\""; … … 134 157 $html .= "</td></tr>"; 135 158 } 136 $html .= "</table><i>Example: http://killboard.eve-d2.com/?a=feed</i><br><br><br>"; 137 159 $html .= '<tr><td colspan=2><i>Example: http://killboard.eve-d2.com/?a=feed</i></td><td>'; 160 $html .= '<input type="checkbox" name="all" onclick="checkAll(this.form.friend,this)"><i>all/none</i></td><td>'; 161 $html .= '<input type="checkbox" name="all" onclick="checkAll(this.form.fetch,this)"><i>all/none</i>'; 162 $html .= "</td></tr><br></table><br><br><br>"; 163 138 164 $html .= "<table><tr><td height=20px width=150px><b>First week:</b></td>"; 139 165 $html .= '<td><select name="range1">'; 140 166 $now = date("W"); 141 for ($i = 1; $i<=52; $i++) { 167 for ($i = 1; $i<=52; $i++) { 142 168 if ( $now == $i ) 143 169 $html .= '<option selected="selected "value="'.$i.'">'.$i.'</option>'; … … 149 175 $html .= "<tr><td height=20px width=150px><b>Last week:</b></td>"; 150 176 $html .= '<td><select name="range2">'; 151 for ($i = 52; $i>=1; $i--) {177 for ($i = 1; $i<=52; $i++) { 152 178 if ( $now == $i ) 153 179 $html .= '<option selected="selected "value="'.$i.'">'.$i.'</option>'; … … 160 186 $html .= "<tr><td height=20px width=150px><b>Year:</b></td>"; 161 187 $html .= '<td><select name="year">'; 188 $html .= '<option "value="2005">2005</option>'; 189 $html .= '<option "value="2006">2006</option>'; 190 $html .= '<option selected="selected "value="2007">2007</option>'; 191 $html .= '<option "value="2008">2008</option>'; 162 192 $html .= '<option "value="2009">2009</option>'; 163 $html .= '<option "value="2008">2008</option>';164 $html .= '<option selected="selected "value="">2007</option>';165 $html .= '<option "value="2006">2006</option>';166 $html .= '<option "value="2005">2005</option>';167 193 $html .= '</select>'; 168 194 $html .= "</td></tr>"; … … 175 201 $html .= "<div class=block-header2>Options</div><table>"; 176 202 $html .= "<tr><td height=30px width=150px><b>Number of feeds:</b></td>"; 177 $html .= "<td><input type=text name=fetch_feed_count size=2 maxlength=2 class=password value=\"".$feedcount."\" </td></tr>";203 $html .= "<td><input type=text name=fetch_feed_count size=2 maxlength=2 class=password value=\"".$feedcount."\"></td></tr>"; 178 204 $html .= "<tr><td height=50px width=150px><b>Comment for automatically parsed killmails?</b></td>"; 179 205 $html .= "<td><input type=text size=50 class=password name=fetch_comment id=fetch_comment value=\"";