├── .gitignore ├── COPYING ├── INSTALL ├── config.php.example ├── control.php ├── dirbrowser.php ├── favicon.ico ├── feedread.php ├── functions.php ├── images ├── addtorrent.gif ├── completeactive.gif ├── completeinactive.gif ├── delete.gif ├── downarrow.gif ├── file.gif ├── folder.gif ├── hashcheck.gif ├── incompleteactive.gif ├── incompleteinactive.gif ├── percentbar.gif ├── refresh.gif ├── rss.gif ├── start.gif ├── stop.gif ├── uparrow.gif ├── view.gif └── weblink.gif ├── index.php ├── json.php ├── rssfeed.php ├── rtgui.js ├── settings.php ├── style.css ├── submodal ├── CHANGELOG ├── close.gif ├── common.js ├── index.html ├── loading.gif ├── loading.html ├── maskBG.png ├── modalContent.html ├── style.css ├── subModal.css └── subModal.js └── view.php /.gitignore: -------------------------------------------------------------------------------- 1 | config.php 2 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | #summary About rtGui 2 | 3 | = rtGui - A web based front-end for rTorrent = 4 | 5 | rtGui is a web based front end for rTorrent - the Linux command line BitTorrent client. It's written in PHP and uses XML-RPC to communicate with the rTorrent client. 6 | 7 | For more information on rTorrent, see the home page: http://libtorrent.rakshasa.no/ 8 | 9 | == Features == 10 | * List all torrent downloads or by started/stopped/complete/incomplete/seeding status. 11 | * Ajax-style refresh information without reloading page. 12 | * Sort view by any of the displayed columns. 13 | * View detailed torrent information. 14 | * Stop/start/hash-check torrent. 15 | * Set upload/download speed cap. 16 | * Add torrents by URL. 17 | * Upload torrent to rtorrent watch-directory. 18 | * Set priority per torrent or file. 19 | * Peer listing. 20 | * RSS Feed of completed torrents (rssfeed.php). 21 | * Does not require mySQL or any other database. 22 | * Bulk Stop/Start/Delete/Priority set. 23 | * Tracker URL display with configurable colouring. 24 | * Integrated RSS News Feed reader - download torrents directly to rTorrent (still work-in-progress). 25 | 26 | 27 | == Requirements == 28 | * rTorrent minium 0.8.2 / libtorrent 0.12.2 complied with XML-RPC library support - see http://libtorrent.rakshasa.no/ (rTorrent 0.8.4 / libtorrent 0.12.4 also supported) 29 | * XML-RPC library - see http://xmlrpc-c.sourceforge.net/ 30 | * Apache webserver configured with XML-RPC - see http://libtorrent.rakshasa.no/wiki/RTorrentXMLRPCGuide 31 | * PHP 5 with XML-RPC module - see http://www.php.net/ 32 | * A web browser - see http://www.mozilla.com/ 33 | 34 | == Installation == 35 | * Modify your Apache and rTorrent installations to work with XML-RPC 36 | - see http://code.google.com/p/rtgui/wiki/ubuntu_rtgui 37 | * Change to your webserver root directory, eg: 38 | cd /srv/www/htdocs 39 | * Extract the files from the archive you downloaded: 40 | tar xvzf rtgui-x.x.x.tgz 41 | * If this is a new installation, copy example config file: 42 | cp config.php.example config.php 43 | * Check settings: 44 | gedit config.php 45 | * Point your web browser to the directory, eg: 46 | http://localhost/rtgui 47 | * Enjoy :) 48 | 49 | == Known Problems == 50 | Incorrect file size display on torrents over 4GB - see http://code.google.com/p/rtgui/wiki/CompilingRtorrent and http://code.google.com/p/rtgui/issues/detail?id=1&can=1 51 | 52 | == Security considerations == 53 | Absolutely no thought whatsoever has been given to security in rtGui - do not run this on a publicly available website. rtGui is intended for 'home' use where users can be considered as trusted. A basic authentication mechanism is planned for future releases. At the very least, you should password protect your webserver using .htaccess or similar (see http://en.wikipedia.org/wiki/Htaccess for more info). 54 | 55 | == In Development == 56 | * More torrent file management - move directory, delete from disk, etc. 57 | 58 | == Wanted! == 59 | Feedback! 60 | 61 | == Other information == 62 | * rtGui incorporates the excellent subModal script by Seth Banks for the cool 'Web 2.0' background-dimming/dialog effect - included version 1.5 by permission - see http://www.subimage.com/dhtml/subModal/ 63 | * Also uses some icons from http://www.famfamfam.com/ 64 | -------------------------------------------------------------------------------- /config.php.example: -------------------------------------------------------------------------------- 1 | . 18 | 19 | // Connect string for your local RPC/rTorrent connection: 20 | $rpc_connect="http://localhost/RPC2"; 21 | 22 | // rtorrent 'watch' directory (used for upload torrent) 23 | $watchdir="/Torrents/TorrentFiles/Auto/"; 24 | 25 | // Path to report disk usage 26 | $downloaddir="/Torrents"; 27 | 28 | // Threshold for disk usage alert (%) 29 | $alertthresh=15; 30 | 31 | // Time between ajax calls - default 5000 (5 secs). Disable with 0 32 | $defaultrefresh=5000; 33 | 34 | // Display tracker URL for each torrent on main page - you might want to disable this if you run lots (ie 30+ ?) 35 | // torrents - To get the tracker URL requires another RPC call for every torrent displayed. 36 | // If it's disabled, it only requires one RPC call to list all the torrents. 37 | $displaytrackerurl=TRUE; 38 | 39 | // URL to your rtGui installation (used in RSS feed). Include trailing slash. 40 | $rtguiurl="http://192.168.0.1/rtgui/"; 41 | 42 | // Speeds for the download cap settings dialog. 43 | $defspeeds=array(5,10,15,20,30,40,50,60,70,80,90,100,125,150,200,250,300,400,500,600,700,800,900,1000,1500,2000,5000,10000); 44 | 45 | // Start download immediately after loading torrent 46 | $load_start=FALSE; 47 | 48 | // Enable debug tabs 49 | $debugtab=FALSE; 50 | 51 | // Tracker colour hilighting... 52 | // Format is array(hexcolour, URL, URL, ...) The URL is a string to match identifiy tracker URL 53 | // Add as many arrays as needed. 54 | $tracker_hilite_default="#900"; // Default colour 55 | $tracker_hilite[]=array("#990000","ibiblio.org","etree.org"); 56 | $tracker_hilite[]=array("#006699","another.com","tracker.mytracker.net","mytracker.com"); 57 | $tracker_hilite[]=array("#996600","moretrackers.com"); 58 | 59 | 60 | // Define your RSS feeds here - you can have as many as you like. Used in the feedreader 61 | // Feed name, feed URL, Direct download links? (0/1) 62 | $feeds[]=array("ibiblio.org","http://torrent.ibiblio.org/feed.php?blockid=3",0); 63 | $feeds[]=array("etree","http://bt.etree.org/rss/bt_etree_org.rdf",0); 64 | $feeds[]=array("Utwente","http://borft.student.utwente.nl/%7Emike/oo/bt.rss",1); 65 | 66 | ?> 67 | -------------------------------------------------------------------------------- /control.php: -------------------------------------------------------------------------------- 1 | . 18 | 19 | include "functions.php"; 20 | include "config.php"; 21 | //import_request_variables("gp","r_"); 22 | 23 | $r_bulkaction = isset($_POST['bulkaction']) ? $_POST['bulkaction'] : null; 24 | $r_select = isset($_POST['select']) ? $_POST['select'] : null; 25 | $r_cmd = isset($_POST['cmd']) ? $_POST['cmd'] : null; 26 | $r_set_fpriority = isset($_POST['set_fpriority']) ? $_POST['set_fpriority'] : array(); 27 | $r_hash = isset($_POST['hash']) ? $_POST['hash'] : null; 28 | $r_set_tpriority = isset($_POST['set_tpriority']) ? $_POST['set_tpriority'] : null; 29 | $r_addurl = isset($_POST['addurl']) ? $_POST['addurl'] : null; 30 | $r_uploadtorrent = isset($_POST['uploadtorrent']) ? $_POST['uploadtorrent'] : null; 31 | $r_newdir = isset($_POST['newdir']) ? $_POST['newdir'] : null; 32 | 33 | // Bulk stop/start/delete torrents... 34 | if ($r_bulkaction && is_array($r_select)) { 35 | foreach($r_select as $hash) { 36 | switch($r_bulkaction) { 37 | case "stop": 38 | $response = do_xmlrpc(xmlrpc_encode_request("d.stop",array("$hash"))); 39 | break; 40 | 41 | case "start": 42 | $response = do_xmlrpc(xmlrpc_encode_request("d.start",array("$hash"))); 43 | break; 44 | 45 | case "delete": 46 | $response = do_xmlrpc(xmlrpc_encode_request("d.erase",array("$hash"))); 47 | break; 48 | 49 | case "pri_high": 50 | $response=do_xmlrpc(xmlrpc_encode_request("d.priority.set",array($hash,3))); 51 | break; 52 | 53 | case "pri_normal": 54 | $response=do_xmlrpc(xmlrpc_encode_request("d.priority.set",array($hash,2))); 55 | break; 56 | 57 | case "pri_low": 58 | $response=do_xmlrpc(xmlrpc_encode_request("d.priority.set",array($hash,1))); 59 | break; 60 | 61 | case "pri_off": 62 | $response=do_xmlrpc(xmlrpc_encode_request("d.priority.set",array($hash,0))); 63 | break; 64 | } 65 | } 66 | $r_cmd=""; 67 | } 68 | 69 | 70 | 71 | // Set file priorities... 72 | if (!empty($r_set_fpriority)) { 73 | $index=0; 74 | foreach($r_set_fpriority as $item) { 75 | $response=do_xmlrpc(xmlrpc_encode_request("f.priority.set",array("$r_hash:f$index","$item"))); 76 | $index++; 77 | } 78 | $response=do_xmlrpc(xmlrpc_encode_request("d.update_priorities","$r_hash")); 79 | $r_cmd=""; 80 | } 81 | 82 | // Set torrent priorities... 83 | if ($r_set_tpriority != '') { 84 | $response=do_xmlrpc(xmlrpc_encode_request("d.priority.set",array($r_hash,$r_set_tpriority))); 85 | $r_cmd=""; 86 | } 87 | 88 | // Add torrent URL... 89 | if ($r_addurl != '') { 90 | //global $load_start; 91 | if ($load_start) 92 | $response = do_xmlrpc(xmlrpc_encode_request("load.start",array("",$r_addurl))); 93 | else 94 | $response = do_xmlrpc(xmlrpc_encode_request("load.normal",array("",$r_addurl))); 95 | } 96 | 97 | // Upload torrent file... 98 | if (isset($r_uploadtorrent)) { 99 | if ($_FILES['uploadtorrent']['name']!="") { 100 | $tmpfile=$_FILES['uploadtorrent']['name']; 101 | if (move_uploaded_file($_FILES['uploadtorrent']['tmp_name'], $watchdir.basename($_FILES['uploadtorrent']['name']))) { 102 | $response = do_xmlrpc(xmlrpc_encode_request("load.start",array("",$watchdir.basename($_FILES['uploadtorrent']['name'])))); 103 | header("Location: index.php"); 104 | } else { 105 | echo "Error moving file - check permissions etc! Continue.\n"; 106 | } 107 | die(); 108 | } 109 | } 110 | 111 | // Move torrent dir 112 | if ($r_newdir != '') { 113 | $response=do_xmlrpc(xmlrpc_encode_request("d.directory.set",array($r_hash,$r_newdir))); 114 | } 115 | 116 | switch($r_cmd) { 117 | case "stop": 118 | $response = do_xmlrpc(xmlrpc_encode_request("d.stop",array("$r_hash"))); 119 | break; 120 | case "start": 121 | $response = do_xmlrpc(xmlrpc_encode_request("d.start",array("$r_hash"))); 122 | break; 123 | case "delete": 124 | $response = do_xmlrpc(xmlrpc_encode_request("d.erase",array("$r_hash"))); 125 | break; 126 | case "hashcheck": 127 | $response = do_xmlrpc(xmlrpc_encode_request("d.check_hash",array("$r_hash"))); 128 | break; 129 | } 130 | $referer=parse_url($_SERVER['HTTP_REFERER']); 131 | $script=basename($referer['path']); 132 | if (($script!='index.php' && $script!='view.php' && $script!='feedread.php' && $script!='settings.php') || $r_cmd=="delete" ) $script='index.php'; 133 | header("Location: $script?".$referer['query']); 134 | ?> 135 | -------------------------------------------------------------------------------- /dirbrowser.php: -------------------------------------------------------------------------------- 1 | . 18 | 19 | extract($_REQUEST, EXTR_PREFIX_ALL|EXTR_REFS, 'r'); 20 | if ($r_dir=="" || !isset($r_dir)) $r_dir="/"; 21 | if (!isset($r_hilitedir)) $r_hilitedir=""; 22 | ?> 23 | 24 | 25 | 26 | 27 | 28 | 29 | \n"; 31 | echo "
\n"; 32 | if ($r_dir!="/" ) echo "[..]
"; 33 | 34 | $files=array(); 35 | if ($dirarray=@scandir($r_dir)) { 36 | foreach($dirarray as $file) { 37 | if ($r_dir=="/") { 38 | $truedir=$r_dir.$file; 39 | } else { 40 | $truedir=$r_dir."/".$file; 41 | } 42 | if ($file!="." && $file!="..") { 43 | if (is_dir($truedir)) { 44 | if (substr($r_hilitedir,1)==$file) echo ""; 45 | echo " ".htmlentities($file,ENT_QUOTES,"UTF-8")."
"; 46 | if (substr($r_hilitedir,1)==$file) echo "
"; 47 | } else { 48 | $files[]=$file; 49 | } 50 | } 51 | } 52 | foreach($files as $file) { 53 | echo " ".htmlentities($file,ENT_QUOTES,"UTF-8")."
\n"; 54 | } 55 | } else { 56 | echo "!Invalid directory!"; 57 | } 58 | ?> 59 |
60 | 61 | 62 | -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshasa/rtgui/746e6186e306243960e2f4fea61b450e8bb10aeb/favicon.ico -------------------------------------------------------------------------------- /feedread.php: -------------------------------------------------------------------------------- 1 | . 18 | 19 | include "config.php"; 20 | include "functions.php"; 21 | 22 | $count=0; 23 | 24 | function startElement($parser, $name, $attrs) { 25 | global $insideitem, $tag, $title, $description, $link, $pubdate, $category; 26 | if ($insideitem) { 27 | $tag = $name; 28 | } elseif ($name == "ITEM") { 29 | $insideitem = true; 30 | } 31 | } 32 | 33 | function endElement($parser, $name) { 34 | global $insideitem, $tag, $title, $description, $link, $category, $pubdate, $count, $ddl; 35 | if ($name == "ITEM") { 36 | echo "

\n"; 37 | 38 | echo "\n"; 39 | 40 | if ($ddl) { 41 | echo "Download torrent"; 42 | } else { 43 | echo "Visit web link"; 44 | } 45 | 46 | echo " ".htmlspecialchars(trim($title))."\n"; 47 | if (trim($category!="")) echo " (".$category.")"; 48 | echo "

".$pubdate."
".trim($description)."
\n"; 49 | echo "

\n"; 50 | $title=""; 51 | $description=""; 52 | $link=""; 53 | $category=""; 54 | $pubdate=""; 55 | $insideitem=false; 56 | $count++; 57 | } 58 | } 59 | 60 | function characterData($parser, $data) { 61 | global $insideitem, $tag, $title, $description, $link, $pubdate, $category; 62 | if ($insideitem) { 63 | switch ($tag) { 64 | case "TITLE": 65 | $title .= $data; 66 | break; 67 | case "DESCRIPTION": 68 | $description .= $data; 69 | break; 70 | case "COMMENTS": 71 | $description .= $data; 72 | break; 73 | case "PUBDATE": 74 | $pubdate.=$data; 75 | break; 76 | case "LINK": 77 | $link .= $data; 78 | break; 79 | case "CATEGORY": 80 | $category .= $data; 81 | break; 82 | } 83 | } 84 | } 85 | 86 | ?> 87 | 88 | 89 | 90 | 91 | 92 | rtGui 93 | 94 | 95 | 96 | 97 | 98 | 101 | 102 | This feed reader feature of rtGui is 'work-in-progress' - please don't report bugs regarding it!

"; 104 | 105 | echo "
    \n"; 106 | foreach($feeds as $feed) { 107 | if (trim($feed[1])!="") { 108 | echo "
  • ".$feed[0]."
  • "; 109 | } 110 | } 111 | echo "
"; 112 | 113 | foreach($feeds as $feed) { 114 | echo "
"; 115 | echo "

".$feed[0]."

\n"; 116 | echo "

".$feed[1]."

"; 117 | echo "
\n"; 118 | 119 | $insideitem = false; 120 | $tag=""; 121 | $title=""; 122 | $description=""; 123 | $link=""; 124 | $pubdate=""; 125 | $category=""; 126 | $ddl=$feed[2]; 127 | 128 | $xml_parser = xml_parser_create(); 129 | xml_set_element_handler($xml_parser, "startElement", "endElement"); 130 | xml_set_character_data_handler($xml_parser, "characterData"); 131 | if (!($fp = @fopen($feed[1],"r"))) { 132 | echo "Couldn't read URL"; 133 | } else { 134 | while ($data = fread($fp, 4096)) { 135 | if (!xml_parse($xml_parser, $data, feof($fp))) { 136 | sprintf("XML error: %s at line %d", xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser)); 137 | } 138 | } 139 | fclose($fp); 140 | xml_parser_free($xml_parser); 141 | } 142 | ob_flush(); 143 | } 144 | ?> 145 | 146 | 147 | 148 | -------------------------------------------------------------------------------- /functions.php: -------------------------------------------------------------------------------- 1 | . 18 | 19 | // Optionally use alternative XMLRPC library from http://sourceforge.net/projects/phpxmlrpc/ 20 | // See http://code.google.com/p/rtgui/issues/detail?id=19 21 | if(!function_exists('xml_parser_create')) { 22 | include("xmlrpc.inc"); 23 | include("xmlrpc_extension_api.inc"); 24 | } 25 | 26 | function do_xmlrpc($request) { 27 | global $rpc_connect; 28 | $context = stream_context_create(array('http' => array('method' => "POST",'header' =>"Content-Type: text/xml",'content' => $request))); 29 | if ($file = @file_get_contents($rpc_connect, false, $context)) { 30 | $file=str_replace("i8","double",$file); 31 | $file = utf8_encode($file); 32 | return xmlrpc_decode($file); 33 | } else { 34 | die ("

Cannot connect to rtorrent :(

"); 35 | } 36 | } 37 | 38 | // Get full list - retrieve full list of torrents 39 | function get_full_list($view) { 40 | $request = xmlrpc_encode_request("d.multicall2", 41 | array("",$view,"d.base_filename=","d.base_path=","d.bytes_done=","d.chunk_size=","d.chunks_hashed=","d.complete=","d.completed_bytes=","d.completed_chunks=","d.connection_current=","d.connection_leech=","d.connection_seed=","d.creation_date=","d.directory=","d.down.rate=","d.down.total=","d.free_diskspace=","d.hash=","d.hashing=","d.ignore_commands=","d.left_bytes=","d.local_id=","d.local_id_html=","d.max_file_size=","d.message=","d.peers_min=","d.name=","d.peer_exchange=","d.peers_accounted=","d.peers_complete=","d.peers_connected=","d.peers_max=","d.peers_not_connected=","d.priority=","d.priority_str=","d.ratio=","d.size_bytes=","d.size_chunks=","d.size_files=","d.skip.rate=","d.skip.total=","d.state=","d.state_changed=","d.tied_to_file=","d.tracker_focus=","d.tracker_numwant=","d.tracker_size=","d.up.rate=","d.up.total=","d.uploads_max=","d.is_active=","d.is_hash_checked=","d.is_hash_checking=","d.is_multi_file=","d.is_open=","d.is_private=")); 42 | $response = do_xmlrpc($request); 43 | 44 | if (xmlrpc_is_fault($response)) { 45 | trigger_error("xmlrpc: $response[faultString] ($response[faultCode])"); 46 | } else { 47 | $index=0; 48 | foreach($response AS $item) { 49 | $retarr[$index]['base_filename']=$item[0]; 50 | $retarr[$index]['base_path']=$item[1]; 51 | $retarr[$index]['bytes_done']=$item[2]; 52 | $retarr[$index]['chunk_size']=$item[3]; 53 | $retarr[$index]['chunks_hashed']=$item[4]; 54 | $retarr[$index]['complete']=$item[5]; 55 | $retarr[$index]['completed_bytes'] = $item[7] * $item[3]; // completed_chunks * chunk_size 56 | $retarr[$index]['completed_chunks']=$item[7]; 57 | $retarr[$index]['connection_current']=$item[8]; 58 | $retarr[$index]['connection_leech']=$item[9]; 59 | $retarr[$index]['connection_seed']=$item[10]; 60 | $retarr[$index]['creation_date']=$item[11]; 61 | $retarr[$index]['directory']=$item[12]; 62 | $retarr[$index]['down_rate']=$item[13]; 63 | $retarr[$index]['down_total']=$item[14]; 64 | $retarr[$index]['free_diskspace']=$item[15]; 65 | $retarr[$index]['hash']=$item[16]; 66 | $retarr[$index]['hashing']=$item[17]; 67 | $retarr[$index]['ignore_commands']=$item[18]; 68 | $retarr[$index]['left_bytes']=$item[19]; 69 | $retarr[$index]['local_id']=$item[20]; 70 | $retarr[$index]['local_id_html']=$item[21]; 71 | $retarr[$index]['max_file_size']=$item[22]; 72 | $retarr[$index]['message']=$item[23]; 73 | $retarr[$index]['peers_min']=$item[24]; 74 | $retarr[$index]['name']=$item[25]; 75 | $retarr[$index]['peer_exchange']=$item[26]; 76 | $retarr[$index]['peers_accounted']=$item[27]; 77 | $retarr[$index]['peers_complete']=$item[28]; 78 | $retarr[$index]['peers_connected']=$item[29]; 79 | $retarr[$index]['peers_max']=$item[30]; 80 | $retarr[$index]['peers_not_connected']=$item[31]; 81 | $retarr[$index]['priority']=$item[32]; 82 | $retarr[$index]['priority_str']=$item[33]; 83 | $retarr[$index]['ratio']=$item[34]; 84 | $retarr[$index]['size_bytes']=$item[36] * $item[3]; // size_chunks * chunk_size 85 | $retarr[$index]['size_chunks']=$item[36]; 86 | $retarr[$index]['size_files']=$item[37]; 87 | $retarr[$index]['skip_rate']=$item[38]; 88 | $retarr[$index]['skip_total']=$item[39]; 89 | $retarr[$index]['state']=$item[40]; 90 | $retarr[$index]['state_changed']=$item[41]; 91 | $retarr[$index]['tied_to_file']=$item[42]; 92 | $retarr[$index]['tracker_focus']=$item[43]; 93 | $retarr[$index]['tracker_numwant']=$item[44]; 94 | $retarr[$index]['tracker_size']=$item[45]; 95 | $retarr[$index]['up_rate']=$item[46]; 96 | $retarr[$index]['up_total']=$item[7] * $item[3] * ($item[34]/1000); 97 | $retarr[$index]['uploads_max']=$item[48]; 98 | $retarr[$index]['is_active']=$item[49]; 99 | $retarr[$index]['is_hash_checked']=$item[50]; 100 | $retarr[$index]['is_hash_checking']=$item[51]; 101 | $retarr[$index]['is_multi_file']=$item[52]; 102 | $retarr[$index]['is_open']=$item[53]; 103 | $retarr[$index]['is_private']=$item[54]; 104 | 105 | $retarr[$index]['percent_complete']=@floor(($retarr[$index]['completed_bytes'])/($retarr[$index]['size_bytes'])*100); 106 | $retarr[$index]['bytes_diff']=($retarr[$index]['size_bytes']-$retarr[$index]['completed_bytes']); 107 | 108 | if ($retarr[$index]['is_active']==0) $retarr[$index]['status_string']="Stopped"; 109 | if ($retarr[$index]['complete']==1) $retarr[$index]['status_string']="Complete"; 110 | if ($retarr[$index]['is_active']==1 && $retarr[$index]['connection_current']=="leech") $retarr[$index]['status_string']="Leeching"; 111 | if ($retarr[$index]['is_active']==1 && $retarr[$index]['complete']==1) $retarr[$index]['status_string']="Seeding"; 112 | if ($retarr[$index]['hashing']>0) { 113 | $retarr[$index]['status_string']="Hashing"; 114 | $retarr[$index]['percent_complete']=@round(($retarr[$index]['chunks_hashed'])/($retarr[$index]['size_chunks'])*100); 115 | } 116 | $retarr[$index]['filemtime']=@filectime($retarr[$index]['base_path']); 117 | 118 | $index++; 119 | } 120 | if (isset($retarr)) { 121 | return $retarr; 122 | } else { 123 | return FALSE; 124 | } 125 | } 126 | } 127 | 128 | // Get list of files associated with a torrent... 129 | function get_file_list($hash) { 130 | $globalstats=get_global_stats(); 131 | if($globalstats['client_version']=="0.7.9") { 132 | $cmdarray=array($hash,"","f.completed_chunks=","f.frozen_path=","f.is_created=","f.is_open=","f.last_touched=","f.match_depth_next=","f.match_depth_prev=","f.offset=","f.path=","f.path_components=","f.path_depth=","f.priority=","f.range_first=","f.range_second=","f.size_bytes=","f.size_chunks="); 133 | } else { 134 | $cmdarray=array($hash,"","f.completed_chunks=","f.frozen_path=","f.is_created=","f.is_open=","f.last_touched=","f.match_depth_next=","f.match_depth_prev=","f.offset=","f.path=","f.path_components=","f.path_depth=","f.priority=","f.range_first=","f.range_second=","f.size_bytes=","f.size_chunks="); 135 | } 136 | $request = xmlrpc_encode_request("f.multicall",$cmdarray); 137 | $response = do_xmlrpc($request); 138 | if (xmlrpc_is_fault($response)) { 139 | trigger_error("xmlrpc: $response[faultString] ($response[faultCode])"); 140 | } else { 141 | $index=0; 142 | foreach($response AS $item) { 143 | $retarr[$index]['completed_chunks']=$item[0]; 144 | $retarr[$index]['frozen_path']=$item[1]; 145 | $retarr[$index]['is_created']=$item[2]; 146 | $retarr[$index]['is_open']=$item[3]; 147 | $retarr[$index]['last_touched']=$item[4]; 148 | $retarr[$index]['match_depth_next']=$item[5]; 149 | $retarr[$index]['match_depth_prev']=$item[6]; 150 | $retarr[$index]['offset']=$item[7]; 151 | $retarr[$index]['path']=$item[8]; 152 | $retarr[$index]['path_components']=$item[9]; 153 | $retarr[$index]['path_depth']=$item[10]; 154 | $retarr[$index]['priority']=$item[11]; 155 | $retarr[$index]['range_first']=$item[12]; 156 | $retarr[$index]['range_second']=$item[13]; 157 | $retarr[$index]['size_bytes']=$item[14]; 158 | $retarr[$index]['size_chunks']=$item[15]; 159 | $index++; 160 | } 161 | return $retarr; 162 | } 163 | } 164 | 165 | // Get list of trackers associated with torrent... 166 | function get_tracker_list($hash) { 167 | $request = xmlrpc_encode_request("t.multicall", 168 | array($hash,"","t.group=","t.id=","t.min_interval=","t.normal_interval=","t.scrape_complete=","t.scrape_downloaded=","t.scrape_time_last=","t.type=","t.url=","t.is_enabled=","t.is_open=","t.scrape_incomplete=")); 169 | $response = do_xmlrpc($request); 170 | if (xmlrpc_is_fault($response)) { 171 | trigger_error("xmlrpc: $response[faultString] ($response[faultCode])"); 172 | } else { 173 | $index=0; 174 | foreach($response AS $item) { 175 | $retarr[$index]['group'] =$item[0]; 176 | $retarr[$index]['id'] =$item[1]; 177 | $retarr[$index]['min_interval'] =$item[2]; 178 | $retarr[$index]['normal_interval'] =$item[3]; 179 | $retarr[$index]['scrape_complete'] =$item[4]; 180 | $retarr[$index]['scrape_downloaded']=$item[5]; 181 | $retarr[$index]['scrape_time_last'] =$item[6]; 182 | $retarr[$index]['type'] =$item[7]; 183 | $retarr[$index]['url'] =$item[8]; 184 | $retarr[$index]['is_enabled'] =$item[9]; 185 | $retarr[$index]['is_open'] =$item[10]; 186 | $retarr[$index]['scrape_incomplete']=$item[11]; 187 | $index++; 188 | } 189 | return $retarr; 190 | } 191 | } 192 | // Get list of peers associated with torrent... 193 | function get_peer_list($hash) { 194 | $globalstats=get_global_stats(); 195 | if($globalstats['client_version']=="0.7.9") { 196 | return array(); 197 | } else { 198 | $cmdarray=array($hash,"","p.address=","p.client_version=","p.completed_percent=","p.down_rate=","p.down_total=","p.id=","p.id_html=","p.options_str=","p.peer_rate=","p.peer_total=","p.port=","p.up_rate=","p.up_total=","p.is_encrypted=","p.is_incoming=","p.is_obfuscated=","p.is_snubbed="); 199 | } 200 | 201 | $request = xmlrpc_encode_request("p.multicall",$cmdarray); 202 | $response = do_xmlrpc($request); 203 | if (xmlrpc_is_fault($response)) { 204 | trigger_error("xmlrpc: $response[faultString] ($response[faultCode])"); 205 | } else { 206 | $index=0; 207 | foreach($response AS $item) { 208 | $retarr[$index]['address'] =$item[0]; 209 | $retarr[$index]['client_version'] =$item[1]; 210 | $retarr[$index]['completed_percent'] =$item[2]; 211 | $retarr[$index]['down_rate'] =$item[3]; 212 | $retarr[$index]['down_total'] =$item[4]; 213 | $retarr[$index]['id'] =$item[5]; 214 | $retarr[$index]['id_html'] =$item[6]; 215 | $retarr[$index]['options_str'] =$item[7]; 216 | $retarr[$index]['peer_rate'] =$item[8]; 217 | $retarr[$index]['peer_total'] =$item[9]; 218 | $retarr[$index]['port'] =$item[10]; 219 | $retarr[$index]['up_rate'] =$item[11]; 220 | $retarr[$index]['up_total'] =$item[12]; 221 | $retarr[$index]['is_encrypted'] =$item[13]; 222 | $retarr[$index]['is_incoming'] =$item[14]; 223 | $retarr[$index]['is_obfuscated'] =$item[15]; 224 | $retarr[$index]['is_snubbed'] =$item[16]; 225 | $index++; 226 | } 227 | if (!isset($retarr)) $retarr=array(); 228 | return $retarr; 229 | } 230 | } 231 | 232 | // Get gloabal stats 233 | function get_global_stats() { 234 | $retarr['upload_cap'] = do_xmlrpc(xmlrpc_encode_request("throttle.global_up.max_rate",array(""))); 235 | $retarr['download_cap'] = do_xmlrpc(xmlrpc_encode_request("throttle.global_down.max_rate",array(""))); 236 | $retarr['library_version'] = do_xmlrpc(xmlrpc_encode_request("system.library_version",array(""))); 237 | $retarr['client_version'] = do_xmlrpc(xmlrpc_encode_request("system.client_version",array(""))); 238 | return $retarr; 239 | } 240 | 241 | // Get overall download/upload rates... (Surely there's a better way of doing this!) 242 | function get_global_rates() { 243 | global $downloaddir; 244 | $retarr[0]['ratedown']=do_xmlrpc(xmlrpc_encode_request("throttle.global_down.rate",array(""))); 245 | $retarr[0]['rateup']=do_xmlrpc(xmlrpc_encode_request("throttle.global_up.rate",array(""))); 246 | $retarr[0]['diskspace']=@disk_free_space($downloaddir); 247 | return $retarr; 248 | } 249 | 250 | // Format no.bytes nicely... 251 | function format_bytes($bytes) { 252 | if ($bytes==0) return ""; 253 | $unim = array("B","KB","MB","GB","TB","PB"); 254 | $c = 0; 255 | while ($bytes>=1024) { 256 | $c++; 257 | $bytes = $bytes/1024; 258 | } 259 | return number_format($bytes,($c ? 1 : 0),".",",")." ".$unim[$c]; 260 | } 261 | 262 | // Function to sort second key in array (ascending) 263 | function sort_matches_asc($left,$right) { 264 | global $sortkey; 265 | if(strtolower($left["$sortkey"])==strtolower($right["$sortkey"])) return 0; 266 | return strtolower($left["$sortkey"]) < strtolower($right["$sortkey"]) ? -1 : 1 ; 267 | } 268 | 269 | // Function to sort second key in array (descending) 270 | function sort_matches_desc($left,$right) { 271 | global $sortkey; 272 | if(strtolower($left["$sortkey"])==strtolower($right["$sortkey"])) return 0; 273 | return strtolower($left["$sortkey"]) > strtolower($right["$sortkey"]) ? -1 : 1 ; 274 | } 275 | 276 | // Draw the percent bar using a table... 277 | function percentbar($percent) { 278 | $retvar=""; 280 | $retvar.="
"; 279 | $retvar.="
"; 281 | return $retvar; 282 | } 283 | 284 | // Format ETA time 285 | function formateta($eta) { 286 | if ($eta==0) return ""; 287 | if ($eta<60) return round($eta)." sec".($eta>1 ? "s" : ""); 288 | if ($eta>=60 && $eta<3600) return round($eta/60)." min".(round($eta/60)>1 ? "s" : ""); 289 | if ($eta>=3600 && $eta<86400) return round($eta/3600)." hour".(round($eta/3600)>1 ? "s" : ""); 290 | if ($eta>=86400) return round($eta/86400)." day".(round($eta/86400)>1 ? "s" : ""); 291 | } 292 | 293 | function age($date) { 294 | if ($date==0) return "(File not found)"; 295 | $periods=array("sec", "min", "hour", "day", "week", "month", "year"); 296 | $lengths=array("60","60","24","7","4.35","12"); 297 | $now=time(); 298 | // is it future date or past date 299 | if($now > $date) { 300 | $diff=$now-$date; 301 | } 302 | for($j = 0; $diff >= $lengths[$j] && $j < count($lengths)-1; $j++) { 303 | $diff /= $lengths[$j]; 304 | } 305 | $diff=round($diff); 306 | if($diff != 1) { 307 | $periods[$j].= "s"; 308 | } 309 | return "$diff $periods[$j] old"; 310 | } 311 | 312 | 313 | // Format Completed bytes - total bytes diff 314 | function completed_bytes_diff($total,$completed ) { 315 | if ($total > $completed ) { 316 | $diff="- ".format_bytes($total-$completed); 317 | } else { 318 | $diff="+ ".format_bytes($completed-$total); 319 | } 320 | if ($total==$completed) $diff=""; 321 | return $diff; 322 | } 323 | 324 | // Return formated (coloured) Tracker URL 325 | function tracker_url($hash) { 326 | global $tracker_hilite,$tracker_hilite_default; 327 | $response = do_xmlrpc(xmlrpc_encode_request("t.multicall",array($hash,"","t.url="))); 328 | $url=@parse_url($response[0][0],PHP_URL_HOST); 329 | return $url; 330 | } 331 | 332 | // multibyte-safe replacement for wordwrap. (See http://code.google.com/p/rtgui/issues/detail?id=71 - Thanks llamaX) 333 | function mb_wordwrap($string, $width=75, $break="\n", $cut=false) { 334 | if (!$cut) { 335 | $regexp = '#^(?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){'.$width.',}\b#U'; 336 | } else { 337 | $regexp = '#^(?:[\x00-\x7F]|[\xC0-\xFF][\x80-\xBF]+){'.$width.'}#'; 338 | } 339 | $string_length = mb_strlen($string,'UTF-8'); 340 | $cut_length = ceil($string_length / $width); 341 | $i = 1; 342 | $return = ''; 343 | while ($i < $cut_length) { 344 | preg_match($regexp, $string,$matches); 345 | $new_string = $matches[0]; 346 | $return .= $new_string.$break; 347 | $string = substr($string, strlen($new_string)); 348 | $i++; 349 | } 350 | return $return.$string; 351 | } 352 | ?> 353 | -------------------------------------------------------------------------------- /images/addtorrent.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshasa/rtgui/746e6186e306243960e2f4fea61b450e8bb10aeb/images/addtorrent.gif -------------------------------------------------------------------------------- /images/completeactive.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshasa/rtgui/746e6186e306243960e2f4fea61b450e8bb10aeb/images/completeactive.gif -------------------------------------------------------------------------------- /images/completeinactive.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshasa/rtgui/746e6186e306243960e2f4fea61b450e8bb10aeb/images/completeinactive.gif -------------------------------------------------------------------------------- /images/delete.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshasa/rtgui/746e6186e306243960e2f4fea61b450e8bb10aeb/images/delete.gif -------------------------------------------------------------------------------- /images/downarrow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshasa/rtgui/746e6186e306243960e2f4fea61b450e8bb10aeb/images/downarrow.gif -------------------------------------------------------------------------------- /images/file.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshasa/rtgui/746e6186e306243960e2f4fea61b450e8bb10aeb/images/file.gif -------------------------------------------------------------------------------- /images/folder.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshasa/rtgui/746e6186e306243960e2f4fea61b450e8bb10aeb/images/folder.gif -------------------------------------------------------------------------------- /images/hashcheck.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshasa/rtgui/746e6186e306243960e2f4fea61b450e8bb10aeb/images/hashcheck.gif -------------------------------------------------------------------------------- /images/incompleteactive.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshasa/rtgui/746e6186e306243960e2f4fea61b450e8bb10aeb/images/incompleteactive.gif -------------------------------------------------------------------------------- /images/incompleteinactive.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshasa/rtgui/746e6186e306243960e2f4fea61b450e8bb10aeb/images/incompleteinactive.gif -------------------------------------------------------------------------------- /images/percentbar.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshasa/rtgui/746e6186e306243960e2f4fea61b450e8bb10aeb/images/percentbar.gif -------------------------------------------------------------------------------- /images/refresh.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshasa/rtgui/746e6186e306243960e2f4fea61b450e8bb10aeb/images/refresh.gif -------------------------------------------------------------------------------- /images/rss.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshasa/rtgui/746e6186e306243960e2f4fea61b450e8bb10aeb/images/rss.gif -------------------------------------------------------------------------------- /images/start.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshasa/rtgui/746e6186e306243960e2f4fea61b450e8bb10aeb/images/start.gif -------------------------------------------------------------------------------- /images/stop.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshasa/rtgui/746e6186e306243960e2f4fea61b450e8bb10aeb/images/stop.gif -------------------------------------------------------------------------------- /images/uparrow.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshasa/rtgui/746e6186e306243960e2f4fea61b450e8bb10aeb/images/uparrow.gif -------------------------------------------------------------------------------- /images/view.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshasa/rtgui/746e6186e306243960e2f4fea61b450e8bb10aeb/images/view.gif -------------------------------------------------------------------------------- /images/weblink.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshasa/rtgui/746e6186e306243960e2f4fea61b450e8bb10aeb/images/weblink.gif -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | . 18 | 19 | $execstart=$start=microtime(true); 20 | session_start(); 21 | include "config.php"; 22 | include "functions.php"; 23 | //import_request_variables("gp","r_"); 24 | 25 | $r_setsortkey = isset($_GET['setsortkey']) ? trim($_GET['setsortkey']) : null; 26 | $r_setsortord = isset($_GET['setsortord']) ? trim($_GET['setsortord']) : null; 27 | $r_setview = isset($_GET['setview']) ? trim($_GET['setview']) : null; 28 | $r_settrackerfilter = isset($_GET['settrackerfilter']) ? trim($_GET['settrackerfilter']) : null; 29 | $r_setfilterinvert = isset($_GET['setfilterinvert']) ? trim($_GET['setfilterinvert']) : null; 30 | $r_reload = isset($_GET['reload']) ? trim($_GET['reload']) : null; 31 | $r_debug = isset($_GET['debug']) ? trim($_GET['debug']) : null; 32 | 33 | // Try using alternative XMLRPC library from http://sourceforge.net/projects/phpxmlrpc/ (see http://code.google.com/p/rtgui/issues/detail?id=19) 34 | if(!function_exists('xml_parser_create')) { 35 | include("xmlrpc.inc"); 36 | include("xmlrpc_extension_api.inc"); 37 | } 38 | 39 | // Sort out the session variables for sort order, sort key and current view... 40 | if (!isset($_SESSION['sortkey'])) $_SESSION['sortkey']="name"; 41 | if ($r_setsortkey) $_SESSION['sortkey']=$r_setsortkey; 42 | 43 | if (!isset($_SESSION['sortord'])) $_SESSION['sortord']="asc"; 44 | if ($r_setsortord) $_SESSION['sortord']=$r_setsortord; 45 | 46 | if (!isset($_SESSION['view'])) $_SESSION['view']="main"; 47 | if ($r_setview) $_SESSION['view']=$r_setview; 48 | 49 | if (!isset($_SESSION['tracker_filter'])) $_SESSION['tracker_filter']=""; 50 | if ($r_settrackerfilter) $_SESSION['tracker_filter']=$r_settrackerfilter; 51 | 52 | if (!isset($_SESSION['filter_invert'])) $_SESSION['filter_invert']=0; 53 | if ($r_setfilterinvert) $_SESSION['filter_invert']=$r_setfilterinvert; 54 | 55 | if ($r_reload) unset($_SESSION['lastget']); 56 | 57 | if (!isset($_SESSION['refresh'])) $_SESSION['refresh']=$defaultrefresh; 58 | 59 | if (!$r_debug) $r_debug=0; 60 | ?> 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 77 | <?php echo php_uname('n') ?>::rtGui 78 | 79 | 80 | \n"; 82 | echo "
\n"; 83 | 84 | $globalstats=get_global_stats(); 85 | $rates=get_global_rates(); 86 | 87 | // Title Block... 88 | echo "\n"; // end of header div 142 | // Title Block End 143 | 144 | // Get the list of torrents downloading 145 | $data=get_full_list($_SESSION['view']); 146 | 147 | // Get tracker URL for each torrent - this does an RPC query for every torrent - might be heavy on server so you might want to disable in config.php 148 | if ($displaytrackerurl==TRUE && is_array($data)) { 149 | foreach($data as $key=>$item) { 150 | $data[$key]['tracker_url']=tracker_url($item['hash']); 151 | } 152 | } 153 | 154 | // Sort the list 155 | if (is_array($data)) { 156 | if (strtolower($_SESSION['sortord']=="asc")) { 157 | $sortkey=$_SESSION['sortkey']; 158 | usort($data,'sort_matches_asc'); 159 | } else { 160 | $sortkey=$_SESSION['sortkey']; 161 | usort($data,'sort_matches_desc'); 162 | } 163 | } else { 164 | $data=array(); 165 | } 166 | 167 | echo "
"; 168 | 169 | // View selection... 170 | echo "\n"; 185 | 186 | echo "
\n"; 187 | 188 | // The headings, with sort links... 189 | $uparr="Descending"; 190 | $downarr="Ascending"; 191 | echo "
Name ".($_SESSION['sortkey']=="name" ? ($_SESSION['sortord']=="asc" ? "$downarr" : "$uparr") :""); 192 | echo " / age ".($_SESSION['sortkey']=="filemtime" ? ($_SESSION['sortord']=="asc" ? "$downarr" : "$uparr") :""); 193 | echo "
\n"; 194 | echo "
Status ".($_SESSION['sortkey']=="status_string" ? ($_SESSION['sortord']=="asc" ? "$downarr" : "$uparr") :"")."
\n"; 195 | echo "
Done ".($_SESSION['sortkey']=="percent_complete" ? ($_SESSION['sortord']=="asc" ? "$downarr" : "$uparr") :"")."
\n"; 196 | echo "
Remain ".($_SESSION['sortkey']=="bytes_diff" ? ($_SESSION['sortord']=="asc" ? "$downarr" : "$uparr") :"")."
\n"; 197 | echo "
Size ".($_SESSION['sortkey']=="size_bytes" ? ($_SESSION['sortord']=="asc" ? "$downarr" : "$uparr") :"")."
\n"; 198 | echo "
Down ".($_SESSION['sortkey']=="down_rate" ? ($_SESSION['sortord']=="asc" ? "$downarr" : "$uparr") :"")."
\n"; 199 | echo "
Up ".($_SESSION['sortkey']=="up_rate" ? ($_SESSION['sortord']=="asc" ? "$downarr" : "$uparr") :"")."
\n"; 200 | echo "
Seeded ".($_SESSION['sortkey']=="up_total" ? ($_SESSION['sortord']=="asc" ? "$downarr" : "$uparr") :"")."
\n"; 201 | echo "
Ratio ".($_SESSION['sortkey']=="ratio" ? ($_SESSION['sortord']=="asc" ? "$downarr" : "$uparr") :"")."
\n"; 202 | echo "
Peers ".($_SESSION['sortkey']=="peers_connected" ? ($_SESSION['sortord']=="asc" ? "$downarr" : "$uparr") :"")."
\n"; 203 | echo "
"; 204 | echo "Pri ".($_SESSION['sortkey']=="priority_str" ? ($_SESSION['sortord']=="asc" ? "$downarr" : "$uparr") :""); 205 | if ($displaytrackerurl==TRUE) { 206 | echo "/ Trk ".($_SESSION['sortkey']=="tracker_url" ? ($_SESSION['sortord']=="asc" ? "$downarr" : "$uparr") :""); 207 | } 208 | echo "
\n"; 209 | // End of headings 210 | 211 | echo "
\n"; 212 | 213 | if ($r_debug==1) { 214 | echo "
";
215 |    echo htmlspecialchars(var_export($data));
216 |    echo "
"; 217 | } 218 | 219 | // List the torrents... 220 | $totdisp=0; 221 | $thisrow="row1"; 222 | $tottorrents=0; 223 | foreach($data AS $item) { 224 | $tottorrents++; 225 | $displaythis=FALSE; 226 | if ($_SESSION['tracker_filter']=="") { 227 | $displaythis=TRUE; 228 | } 229 | if ($_SESSION['filter_invert']==0) { 230 | // Filter by tracker URL 231 | if (@stristr($item['tracker_url'],$_SESSION['tracker_filter'])==TRUE) { 232 | $displaythis=TRUE; 233 | } 234 | // Filter by group (defined in config) 235 | if (substr($_SESSION['tracker_filter'],0,7)=="_group_") { 236 | $groupid=str_replace("_group_","",$_SESSION['tracker_filter']); 237 | foreach($tracker_hilite[$groupid] as $tracker) { 238 | if (stristr($item['tracker_url'],$tracker)) { 239 | $displaythis=TRUE; 240 | } 241 | } 242 | } 243 | } else { 244 | // Filter by NOT tracker URL 245 | if (@stristr($item['tracker_url'],$_SESSION['tracker_filter'])==FALSE) { 246 | $displaythis=TRUE; 247 | } 248 | // Filter by NOT group 249 | if (substr($_SESSION['tracker_filter'],0,7)=="_group_") { 250 | $displaythis=TRUE; 251 | $groupid=str_replace("_group_","",$_SESSION['tracker_filter']); 252 | foreach($tracker_hilite[$groupid] as $tracker) { 253 | if (stristr($item['tracker_url'],$tracker)) { 254 | $displaythis=FALSE; 255 | } 256 | } 257 | } 258 | 259 | } 260 | if ($displaythis) { 261 | $totdisp++; 262 | echo "
\n"; 263 | 264 | if ($item['complete']==1) { $statusstyle="complete"; } else { $statusstyle="incomplete"; } 265 | if ($item['is_active']==1) { $statusstyle.="active"; } else { $statusstyle.="inactive"; } 266 | $eta=""; 267 | if ($item['down_rate']>0) { 268 | $eta=formateta(($item['size_bytes']-$item['completed_bytes'])/$item['down_rate']); 269 | } 270 | 271 | echo "
\n"; 272 | // Tracker URL 273 | if ($displaytrackerurl==TRUE) { 274 | // echo $item['tracker_url']; 275 | $urlstyle=$tracker_hilite_default; 276 | foreach($tracker_hilite as $hilite) { 277 | foreach ($hilite as $thisurl) { 278 | if (stristr($item['tracker_url'],$thisurl)==TRUE) { $urlstyle=$hilite[0]; } 279 | } 280 | } 281 | echo ""; 282 | } 283 | 284 | // Torrent name 285 | echo " "; 286 | echo "".htmlspecialchars($item['name'], ENT_QUOTES)." "; 287 | echo "".age($item['filemtime'])."\n"; 288 | echo "
\n"; 289 | 290 | // message... 291 | echo "
\n"; 292 | if ($eta!="") echo $eta." Remaining... "; 293 | if ($item['message']!="") echo $item['message']."\n"; 294 | echo "
\n"; 295 | 296 | // Stop/start controls... 297 | echo "
\n"; 298 | echo "".($item['is_active']==1 ? "Stop torrent" : "Start torrent")." \n"; 299 | echo "Delete torrent \n"; 300 | echo "Torrent info
\n"; 301 | echo "
\n"; 302 | 303 | // Stats row... 304 | echo "
Status".$item['status_string']."
\n"; 305 | echo "
".$item['percent_complete']." %
".percentbar(@round(($item['percent_complete']/2)))."
\n"; 306 | echo "
".completed_bytes_diff($item['size_bytes'],$item['completed_bytes'])."
\n"; 307 | echo "
".format_bytes($item['size_bytes'])."
\n"; 308 | echo "
".format_bytes($item['down_rate'])."
\n"; 309 | echo "
".format_bytes($item['up_rate'])."
\n"; 310 | echo "
".format_bytes($item['up_total'])."
\n"; 311 | echo "
".@round(($item['ratio']/1000),2)."
\n"; 312 | echo "
".$item['peers_connected']."/".$item['peers_not_connected']." (".$item['peers_complete'].")"."
\n"; 313 | echo "
".$item['priority_str']."
\n"; 314 | echo "
\n"; 315 | 316 | echo "
\n"; // end of thisrow div 317 | if ($thisrow=="row1") {$thisrow="row2";} else {$thisrow="row1";} 318 | } 319 | } 320 | 321 | // Display message if no torrents to list... 322 | if (!$data || $totdisp==0 ) { 323 | echo "
\n"; 324 | echo "

 

No torrents to display.

 

\n"; 325 | echo "
\n"; 326 | } 327 | 328 | echo "
\n"; // end of container div 329 | 330 | // Bulk control... 331 | echo "
"; 332 | echo "
\n"; 333 | echo "\n"; 334 | echo "\n"; 335 | 336 | echo "\n"; 349 | echo "\n"; 350 | echo "
"; 351 | 352 | // Number of torrents displayed/total torrents for this view 353 | echo "
\n"; 354 | echo $totdisp."/".$tottorrents; 355 | echo "
"; 356 | 357 | echo "
"; 358 | echo "
\n"; 359 | 360 | // Footer... 361 | echo "

 

"; 362 | echo "
\n"; 363 | echo "rTorrent ".$globalstats['client_version']."/".$globalstats['library_version']." | "; 364 | echo "RSS Feed | "; 365 | echo "Page created in ".$restime=round(microtime(true)-$execstart,3)." secs.
\n"; 366 | echo "rtGui v0.2.8 - by Simon Hall 2007-2011\n"; 367 | echo "
\n"; 368 | ?> 369 |
370 | 371 | 372 | -------------------------------------------------------------------------------- /json.php: -------------------------------------------------------------------------------- 1 | . 18 | 19 | session_start(); 20 | include "config.php"; 21 | include "functions.php"; 22 | //import_request_variables("gp","r_"); 23 | 24 | $r_view = $_GET['view']; 25 | 26 | if (!isset($r_view)) $r_view="main"; 27 | $data=get_full_list("$r_view"); 28 | 29 | // If tracker_filter is set, get tracker URL for each torrent 30 | if ($_SESSION['tracker_filter']!="") { 31 | if ($displaytrackerurl==TRUE && is_array($data)) { 32 | foreach($data as $key=>$item) { 33 | $data[$key]['tracker_url']=tracker_url($item['hash']); 34 | } 35 | } 36 | } 37 | 38 | $totcount=0; 39 | if ($data) { 40 | foreach($data as $subitem) { 41 | $displaythis=FALSE; 42 | if ($_SESSION['tracker_filter']=="") { 43 | $displaythis=TRUE; 44 | } 45 | if (@stristr($subitem['tracker_url'],$_SESSION['tracker_filter'])==TRUE) { 46 | $displaythis=TRUE; 47 | } 48 | if ($displaythis) { 49 | if ($subitem['complete']==1) { $statusstyle="complete"; } else { $statusstyle="incomplete"; } 50 | if ($subitem['is_active']==1) { $statusstyle.="active"; } else { $statusstyle.="inactive"; } 51 | $subdata[$totcount]['control']=($subitem['is_active']==1 ? "stop" : "start" ); 52 | $eta=""; 53 | if ($subitem['down_rate']>0) { 54 | $eta=formateta(($subitem['size_bytes']-$subitem['completed_bytes'])/$subitem['down_rate'])." Remaining... "; 55 | } 56 | $subdata[$totcount]['name']=" ".$subitem['name'].""; 57 | $subdata[$totcount]['message']=$eta.$subitem['message']; 58 | $subdata[$totcount]['status_string']="Status".$subitem['status_string']; 59 | $subdata[$totcount]['percent_complete']=$subitem['percent_complete']." %
".percentbar(@round(($subitem['percent_complete']/2))); 60 | $subdata[$totcount]['size_bytes']=format_bytes($subitem['size_bytes']); 61 | $subdata[$totcount]['down_rate']=format_bytes($subitem['down_rate']); 62 | $subdata[$totcount]['up_rate']=format_bytes($subitem['up_rate']); 63 | $subdata[$totcount]['up_total']=format_bytes($subitem['up_total']); 64 | $subdata[$totcount]['peers']=$subitem['peers_connected']."/".$subitem['peers_not_connected']." (".$subitem['peers_complete'].")"; 65 | $subdata[$totcount]['ratio']=@round(($subitem['ratio']/1000),2); 66 | $subdata[$totcount]['priority_str']=$subitem['priority_str']; 67 | $subdata[$totcount]['hash']=$subitem['hash']; 68 | $subdata[$totcount]['bytes_diff']=completed_bytes_diff($subitem['size_bytes'],$subitem['completed_bytes']); 69 | $subdata[$totcount]['filemtime']=age($subitem['filemtime']); 70 | 71 | $totcount++; 72 | } 73 | } 74 | } 75 | 76 | // Get overall download/upload speed... 77 | $rates=get_global_rates(); 78 | $subdata[$totcount]['glob_down_rate']=(format_bytes($rates[0]['ratedown'])=="" ? "0 KB" : format_bytes($rates[0]['ratedown'])."/sec" ); 79 | $subdata[$totcount]['glob_up_rate']=(format_bytes($rates[0]['rateup'])=="" ? "0 KB" : format_bytes($rates[0]['rateup'])."/sec" ); 80 | //$subdata[$totcount]['glob_diskfree']=format_bytes($rates[0]['diskspace'])." / ".format_bytes(disk_total_space($downloaddir))." (".(round($rates[0]['diskspace']/disk_total_space($downloaddir)*100))."%)"; 81 | $subdata[$totcount]['glob_diskfree']="
"; 82 | $subdata[$totcount]['glob_diskfree'].="Disk Free: ".format_bytes($rates[0]['diskspace'])." / ".format_bytes(disk_total_space($downloaddir))." (".(round($rates[0]['diskspace']/disk_total_space($downloaddir)*100))."%)"; 83 | $subdata[$totcount]['glob_diskfree'].="
"; 84 | // echo "Disk Free: ".format_bytes($rates[0]['diskspace'])." / ".format_bytes(disk_total_space($downloaddir))." (".(round($rates[0]['diskspace']/disk_total_space($downloaddir)*100))."%)\n"; 85 | // echo "\n"; 86 | 87 | 88 | if (@is_array($_SESSION['lastget'])) { 89 | $last=$_SESSION['lastget']; 90 | } else { 91 | $last=array(); 92 | } 93 | 94 | // Write out JSON format string... 95 | echo "{"; 96 | $count=0; 97 | foreach($subdata as $item => $val) { 98 | if (isset($last[$item])) { 99 | $diff=array_diff_assoc($val,$last[$item]); 100 | foreach($diff as $changes => $cval) { 101 | if (isset($val['hash'])) { 102 | $div="t".$val['hash'].$changes; 103 | } else { 104 | $div=$changes; 105 | } 106 | echo '"change'.$count.'": { '; 107 | echo ' "div" : "'.$div.'",'; 108 | echo ' "val" : "'.str_replace('"','\"',$cval).'"'; 109 | echo '},'."\n"; 110 | $count++; 111 | } 112 | } 113 | } 114 | echo '"total":"'.$count.'" '; 115 | echo '}'; 116 | 117 | // Copy subdata array to session var, so we can compare it for changes on next call of this page... 118 | $_SESSION['lastget']=$subdata; 119 | ?> 120 | -------------------------------------------------------------------------------- /rssfeed.php: -------------------------------------------------------------------------------- 1 | . 18 | 19 | // By default, only completed torrents returned. 20 | // To change, use: 21 | // rssfeed.php?view=xxx 22 | // Where xxx= 23 | // main (all torrents) 24 | // started 25 | // stopped 26 | // complete 27 | // incomplete 28 | // seeding 29 | 30 | include "config.php"; 31 | include "functions.php"; 32 | extract($_REQUEST, EXTR_PREFIX_ALL|EXTR_REFS, 'r'); 33 | 34 | if (!isset($r_view)) { 35 | $r_view="complete"; 36 | } 37 | 38 | // header: 39 | header('Content-Type: text/xml'); 40 | echo "\n"; 41 | echo "\n"; 42 | echo "\n"; 43 | echo "rtGui rss feed\n"; 44 | echo "Latest info from your rTorrent/rtGui system\n"; 45 | echo "rtGui - http://rtgui.googlecode.com/ \n"; 46 | echo "".$rtguiurl.""; 47 | echo "".date("r")."\n"; 48 | 49 | $data=get_full_list($r_view); 50 | 51 | if (is_array($data)) { 52 | $sortkey="state_changed"; 53 | usort($data,'sort_matches_desc'); 54 | 55 | foreach($data AS $item) { 56 | echo "\n"; 57 | echo "".($item['complete']==1 ? "[Complete] " : "[Incomplete] ").htmlspecialchars($item['name'])."\n"; 58 | echo "\n"; 59 | echo htmlspecialchars($item['tied_to_file'])." (".format_bytes($item['size_bytes']).")"; 60 | echo "\n"; 61 | echo "".date("r",$item['state_changed'])."\n"; 62 | echo "".$rtguiurl."view.php?hash=".$item['hash']."\n"; 63 | echo "\n"; 64 | } 65 | } 66 | echo "\n"; 67 | echo "\n"; 68 | ?> 69 | -------------------------------------------------------------------------------- /rtgui.js: -------------------------------------------------------------------------------- 1 | // 2 | // This file is part of rtGui. http://rtgui.googlecode.com/ 3 | // Copyright (C) 2007-2011 Simon Hall. 4 | // 5 | // rtGui is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // rtGui is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU General Public License 16 | // along with rtGui. If not, see . 17 | 18 | function ajax(view) { 19 | var req = null; 20 | if (window.XMLHttpRequest) { 21 | req = new XMLHttpRequest(); 22 | if (req.overrideMimeType) { 23 | req.overrideMimeType('text/plain'); 24 | } 25 | } else if (window.ActiveXObject) { 26 | try { 27 | req = new ActiveXObject("Msxml2.XMLHTTP"); 28 | } catch (e) { 29 | try { 30 | req = new ActiveXObject("Microsoft.XMLHTTP"); 31 | } catch (e) {} 32 | } 33 | } 34 | 35 | req.onreadystatechange = function() { 36 | if(req.readyState == 4) { 37 | if(req.status == 200) { 38 | resp = eval( "(" + req.responseText + ")" ); 39 | i=0; 40 | while (i < resp.total) { 41 | div = eval ("resp.change"+i+"['div']"); 42 | val = eval ("resp.change"+i+"['val']"); 43 | if (!document.getElementById(div)) { 44 | document.location='index.php?reload=2'; 45 | } 46 | document.getElementById(div).innerHTML = val; 47 | i+=1; 48 | } 49 | } else { 50 | document.write="Javascript Ajax Error: returned status code " + req.status + " " + req.statusText; 51 | } 52 | } 53 | }; 54 | req.open("GET", "json.php?view="+view, true); 55 | req.send(null); 56 | } 57 | 58 | function checkAll(field) { 59 | for (i = 0; i < field.length; i++) 60 | field[i].checked = true ; 61 | } 62 | 63 | function uncheckAll(field) { 64 | for (i = 0; i < field.length; i++) 65 | field[i].checked = false ; 66 | } 67 | 68 | function toggleLayer( whichLayer ) { 69 | var elem, vis; 70 | if( document.getElementById ) 71 | elem = document.getElementById( whichLayer ); 72 | else if( document.all ) 73 | elem = document.all[whichLayer]; 74 | else if( document.layers ) 75 | elem = document.layers[whichLayer]; 76 | vis = elem.style; 77 | if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined) 78 | vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none'; 79 | vis.display = (vis.display==''||vis.display=='block')?'none':'block'; 80 | } 81 | -------------------------------------------------------------------------------- /settings.php: -------------------------------------------------------------------------------- 1 | . 18 | 19 | session_start(); 20 | $execstart=$start=microtime(true); 21 | include "functions.php"; 22 | include "config.php"; 23 | //import_request_variables("gp","r_"); 24 | 25 | $r_setrefresh = isset($_POST['setrefresh']) ? intval($_POST['setrefresh']) : null; 26 | $r_setmaxup = isset($_POST['setmaxup']) ? intval($_POST['setmaxup']) : null; 27 | $r_setmaxdown = isset($_POST['setmaxdown']) ? intval($_POST['setmaxdown']) : null; 28 | $r_submit = isset($_POST['submit']) ? trim($_POST['submit']) : null; 29 | 30 | if (!isset($_SESSION['refresh'])) $_SESSION['refresh']=$defaultrefresh; 31 | if ($r_setrefresh) $_SESSION['refresh']=$r_setrefresh; 32 | 33 | if ($r_setmaxup || $r_setmaxdown) { 34 | $response = do_xmlrpc(xmlrpc_encode_request("throttle.global_up.max_rate.set",array("", "$r_setmaxup"))); 35 | $response = do_xmlrpc(xmlrpc_encode_request("throttle.global_down.max_rate.set",array("", "$r_setmaxdown"))); 36 | } 37 | 38 | $globalstats=get_global_stats(); 39 | 40 | if ($r_submit != '') { 41 | echo ""; 42 | die(); 43 | } 44 | ?> 45 | 46 | 47 | 48 | 49 | 50 | rtGui 51 | 52 | 53 | 54 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /style.css: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of rtGui. http://rtgui.googlecode.com/ 3 | Copyright (C) 2007-2011 Simon Hall. 4 | 5 | rtGui is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation, either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | rtGui is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with rtGui. If not, see . 17 | */ 18 | 19 | body { 20 | font-family: sans-serif; 21 | color: #333; 22 | font-size:12px; 23 | background-color:#fff; 24 | text-align: center; 25 | } 26 | a { 27 | text-decoration:none; 28 | color:#17399C; 29 | } 30 | a:hover { 31 | text-decoration:underline; 32 | } 33 | th { 34 | font-family: sans-serif; 35 | } 36 | td { 37 | font-family: sans-serif; 38 | vertical-align:top; 39 | } 40 | h1,h2,h3,h4,h5,h6 { 41 | margin:0px 0px 0px 0px; 42 | } 43 | select,input { 44 | font-family: sans-serif; 45 | } 46 | img { 47 | border:0px solid #fff; 48 | } 49 | p { 50 | margin: 2px 0px 2px 0px; 51 | } 52 | 53 | select { 54 | color:#333; 55 | text-align: left; 56 | margin-left:10px; 57 | } 58 | form { 59 | margin: 0px 0px 0px 0px; 60 | } 61 | #wrap { 62 | background: #FFF; 63 | width: 976px; 64 | height: 100%; 65 | margin: 0 auto; 66 | padding: 5px; 67 | text-align: left; 68 | } 69 | 70 | #header { 71 | position: relative; 72 | height: 100px; 73 | } 74 | #header h1 { 75 | position: absolute; 76 | margin: 0; padding: 0; 77 | font: bolder 5.1em sans-serif; 78 | letter-spacing: -5px; 79 | top: 0; left: 0px; 80 | 81 | } 82 | #header a:hover { 83 | text-decoration:none; 84 | } 85 | #header #boxright { 86 | float:right; 87 | display:block; 88 | text-align:right; 89 | } 90 | 91 | #header input { 92 | font-size:80%; 93 | } 94 | 95 | #navlist { 96 | padding: 3px 0; 97 | margin: 0px 0px 0px 0px; 98 | border-bottom: 2px solid #7EA610; 99 | } 100 | 101 | #navlist li { 102 | list-style: none; 103 | margin: 0; 104 | display: inline; 105 | } 106 | 107 | #navlist li a { 108 | padding: 3px 0.5em; 109 | margin-left: 3px; 110 | border: 1px solid #7EA610; 111 | border-bottom: none; 112 | background: #666; 113 | text-decoration: none; 114 | font-weight: bold; 115 | 116 | } 117 | 118 | #navlist li a:link { color: #ccc; } 119 | #navlist li a:visited { color: #ccc; } 120 | 121 | #navlist li a:hover { 122 | color: #bbb; 123 | background: #333; 124 | border-bottom:2px solid #333; 125 | padding-top:5px; 126 | } 127 | 128 | #navlist li a#current { 129 | background: #333; 130 | border: 2px solid #7EA610; 131 | border-bottom: 2px solid #333; 132 | font-weight:bold; 133 | color:#fff; 134 | padding-top:5px; 135 | } 136 | div { 137 | margin:0px 0px 0px 0px; 138 | padding: 0px; 139 | } 140 | div.container { 141 | margin: 0px 0px 0px 0px; 142 | padding: 0px 0px 0px 0px; 143 | background-color: #fff; 144 | border-left:1px solid #7EA610; 145 | border-right:1px solid #7EA610; 146 | } 147 | div.namecol { 148 | width:100%; 149 | margin: 3px 3px 3px 3px; 150 | } 151 | div.errorcol { 152 | margin-left: 2px; 153 | font-size:80%; 154 | color:#999; 155 | margin: 3px 3px 1px 3px; 156 | } 157 | 158 | div.headcol { 159 | float: left; 160 | font-weight: bold; 161 | padding-bottom:8px; 162 | padding-top:8px; 163 | text-align:center; 164 | color:#fff; 165 | background-color:#333; 166 | margin:0px; 167 | } 168 | div.headcol a, div.headrow a, div.headcollast a { 169 | color: #fff; 170 | } 171 | div.headcollast { 172 | float: left; 173 | width:74px; 174 | font-weight: bold; 175 | text-align:center; 176 | background-color:#333; 177 | } 178 | div.viewheadcol { 179 | background-color:#333; 180 | float:left; 181 | 182 | line-height:30px; 183 | font-size:80%; 184 | font-weight:bold; 185 | color:#fff; 186 | padding-left:3px; 187 | } 188 | div.floatright { 189 | float: right; 190 | margin-right:0px; 191 | } 192 | div.floatleft { 193 | float: left; 194 | margin-right:6px; 195 | } 196 | div.datacol { 197 | float: left; 198 | border-right: 1px dotted #aaa; 199 | text-align:center; 200 | min-height:1em; 201 | } 202 | div.datacollast { 203 | float: left; 204 | height:22px; 205 | border-right: none; 206 | text-align:center; 207 | min-height:1em; 208 | } 209 | div.spacer { 210 | clear: both; 211 | font-size:10%; 212 | height: 0px; 213 | margin:0px; 214 | padding:0px; 215 | } 216 | div.modal { 217 | text-align:left; 218 | padding: 5px 5px 5px 5px; 219 | } 220 | div.controls { 221 | float: left; 222 | } 223 | div.controlcontainer { 224 | text-align:center; 225 | } 226 | .trackerurl { 227 | float:right; 228 | font-size:90%; 229 | margin:2px; 230 | } 231 | .smalltext { 232 | font-size:80%; 233 | } 234 | .mediumtext { 235 | font-size:90%; 236 | } 237 | .completeactive { 238 | color: #393; 239 | font-weight:bold; 240 | } 241 | .incompleteactive { 242 | color: #339; 243 | } 244 | .completeinactive { 245 | color: #151; 246 | font-weight:bold; 247 | } 248 | .incompleteinactive { 249 | color: #555; 250 | } 251 | .age { 252 | font-size:90%; 253 | color: #456; 254 | } 255 | .datacol { 256 | border-right: 1px dotted #999; 257 | } 258 | .download { 259 | color: #393; 260 | } 261 | .upload { 262 | color: #993333; 263 | } 264 | .green { color: #7Ea610; } 265 | 266 | .gray { color: #666; } 267 | 268 | .row1 { 269 | background-color:#eee; 270 | padding:2px 0px 2px 0px; 271 | border-top:1px solid #eee; 272 | border-bottom:1px solid #eee; 273 | } 274 | .row2 { 275 | background-color:#ddd; 276 | padding:2px 0px 2px 0px; 277 | border-top:1px solid #ddd; 278 | border-bottom:1px solid #eee; 279 | } 280 | .row1:hover,.row2:hover { 281 | background-color:#ccc; 282 | border-top:1px solid #633; 283 | border-bottom:1px solid #633; 284 | } 285 | .buttonstart { 286 | background: url('images/start.gif') no-repeat center left; 287 | font-size: 80%; 288 | padding-left:18px; 289 | } 290 | .buttonstop { 291 | background: url('images/stop.gif') no-repeat center left; 292 | font-size: 80%; 293 | padding-left:18px; 294 | } 295 | .buttondel { 296 | background: url('images/delete.gif') no-repeat center left; 297 | font-size: 80%; 298 | padding-left:18px; 299 | } 300 | .buttonhashcheck { 301 | background: url('images/hashcheck.gif') no-repeat center left; 302 | font-size: 80%; 303 | padding-left:18px; 304 | } 305 | .buttonrefresh { 306 | background: url('images/refresh.gif') no-repeat center left; 307 | font-size: 80%; 308 | padding-left:18px; 309 | } 310 | .dirbrowse { 311 | background: #ddd; 312 | } 313 | .bottomtab { 314 | color:#fff; 315 | border-bottom: 2px solid #7EA610; 316 | background-color:#333; 317 | padding:5px; 318 | } 319 | .bottomthin { 320 | border-top:2px solid #7EA610; 321 | } 322 | .togglevis { 323 | display:none; 324 | background-color:#eee; 325 | padding: 3px; 326 | margin:0px ; 327 | border:1px solid #7EA610; 328 | } 329 | .diskalert { 330 | font-size:16px; 331 | color:red; 332 | font-weight:bold; 333 | } 334 | 335 | /* FeedReader styles */ 336 | .feedtitle { 337 | margin-top:5px; 338 | padding:8px 8px 3px 3px; 339 | font-weight:bold; 340 | color:#fff; 341 | background-color:#333; 342 | text-align: left; 343 | border-bottom:4px solid #7EA610; 344 | } 345 | .feeditem { 346 | background-color:#eee; 347 | margin:2px 0px 0px 0px; 348 | overflow:hidden; 349 | } 350 | 351 | .feedhilite { 352 | color:#c33; 353 | } 354 | .controlbut { 355 | font-size:80%; 356 | font-weight:bold; 357 | width:20px; 358 | } 359 | .feedlist { 360 | margin: 1px 15px 1px 1px; 361 | display: inline; 362 | } 363 | .feedlistul { 364 | margin: 0px 0px 0px 0px; 365 | padding: 0px 0px 0px 0px; 366 | } 367 | -------------------------------------------------------------------------------- /submodal/CHANGELOG: -------------------------------------------------------------------------------- 1 | v1.5 2 | =============================================================================== 3 | - Modal now displays properly again in Safari 4 | - Modal doesn't disable scrollbars 5 | - Modal scrolls with page 6 | 7 | v1.4 8 | =============================================================================== 9 | - Added CHANGELOG 10 | - Made sure modal is centered in IE 6 (was a bug before) 11 | - Added releases directory -------------------------------------------------------------------------------- /submodal/close.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshasa/rtgui/746e6186e306243960e2f4fea61b450e8bb10aeb/submodal/close.gif -------------------------------------------------------------------------------- /submodal/common.js: -------------------------------------------------------------------------------- 1 | /** 2 | * COMMON DHTML FUNCTIONS 3 | * These are handy functions I use all the time. 4 | * 5 | * By Seth Banks (webmaster at subimage dot com) 6 | * http://www.subimage.com/ 7 | * 8 | * Up to date code can be found at http://www.subimage.com/dhtml/ 9 | * 10 | * This code is free for you to use anywhere, just keep this comment block. 11 | */ 12 | 13 | /** 14 | * X-browser event handler attachment and detachment 15 | * TH: Switched first true to false per http://www.onlinetools.org/articles/unobtrusivejavascript/chapter4.html 16 | * 17 | * @argument obj - the object to attach event to 18 | * @argument evType - name of the event - DONT ADD "on", pass only "mouseover", etc 19 | * @argument fn - function to call 20 | */ 21 | function addEvent(obj, evType, fn){ 22 | if (obj.addEventListener){ 23 | obj.addEventListener(evType, fn, false); 24 | return true; 25 | } else if (obj.attachEvent){ 26 | var r = obj.attachEvent("on"+evType, fn); 27 | return r; 28 | } else { 29 | return false; 30 | } 31 | } 32 | function removeEvent(obj, evType, fn, useCapture){ 33 | if (obj.removeEventListener){ 34 | obj.removeEventListener(evType, fn, useCapture); 35 | return true; 36 | } else if (obj.detachEvent){ 37 | var r = obj.detachEvent("on"+evType, fn); 38 | return r; 39 | } else { 40 | alert("Handler could not be removed"); 41 | } 42 | } 43 | 44 | /** 45 | * Code below taken from - http://www.evolt.org/article/document_body_doctype_switching_and_more/17/30655/ 46 | * 47 | * Modified 4/22/04 to work with Opera/Moz (by webmaster at subimage dot com) 48 | * 49 | * Gets the full width/height because it's different for most browsers. 50 | */ 51 | function getViewportHeight() { 52 | if (window.innerHeight!=window.undefined) return window.innerHeight; 53 | if (document.compatMode=='CSS1Compat') return document.documentElement.clientHeight; 54 | if (document.body) return document.body.clientHeight; 55 | 56 | return window.undefined; 57 | } 58 | function getViewportWidth() { 59 | var offset = 17; 60 | var width = null; 61 | if (window.innerWidth!=window.undefined) return window.innerWidth; 62 | if (document.compatMode=='CSS1Compat') return document.documentElement.clientWidth; 63 | if (document.body) return document.body.clientWidth; 64 | } 65 | 66 | /** 67 | * Gets the real scroll top 68 | */ 69 | function getScrollTop() { 70 | if (self.pageYOffset) // all except Explorer 71 | { 72 | return self.pageYOffset; 73 | } 74 | else if (document.documentElement && document.documentElement.scrollTop) 75 | // Explorer 6 Strict 76 | { 77 | return document.documentElement.scrollTop; 78 | } 79 | else if (document.body) // all other Explorers 80 | { 81 | return document.body.scrollTop; 82 | } 83 | } 84 | function getScrollLeft() { 85 | if (self.pageXOffset) // all except Explorer 86 | { 87 | return self.pageXOffset; 88 | } 89 | else if (document.documentElement && document.documentElement.scrollLeft) 90 | // Explorer 6 Strict 91 | { 92 | return document.documentElement.scrollLeft; 93 | } 94 | else if (document.body) // all other Explorers 95 | { 96 | return document.body.scrollLeft; 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /submodal/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | subModal DHTML Modal Dialog / Modal Window Test Page 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |

subModal test page

15 |

16 | This is a test page for the subModal - a DHTML modal dialog solution. 17 |

18 |

19 | To check out a demonstration, click the button below. 20 |

21 | 22 |
23 | show modal window using class 24 |
25 | show modal window using class and overriding default size 26 |

27 | Download the latest code. 28 |

29 |

Interested to know how this works?

30 |

31 | Check out the explanation. 32 |

33 |

34 | This demo is known to work in IE 6.x, FireFox 1.x, Safari & Opera 7.x. 35 |

36 |

37 | CSS transparency is being used in IE, but is available on FireFox & Safari as well. 38 |

39 |

40 | Right now I'm using a 24bit transparent PNG for the background. This allows transparency to work in Opera as well, since their CSS support is a bit lacking. 41 |
42 | If you don't care about opera and want control of the color or opacity of the mask from the css, comment that section out. 43 |

44 |

45 |

46 | 49 |
50 |

51 |
52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /submodal/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshasa/rtgui/746e6186e306243960e2f4fea61b450e8bb10aeb/submodal/loading.gif -------------------------------------------------------------------------------- /submodal/loading.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Loading... 7 | 8 | 9 |

 

 

 

 

 

10 |

11 | Loading... 12 |

13 |

14 | 15 | Loading... 16 |

17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /submodal/maskBG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rakshasa/rtgui/746e6186e306243960e2f4fea61b450e8bb10aeb/submodal/maskBG.png -------------------------------------------------------------------------------- /submodal/modalContent.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | My Modal Content 6 | 7 | 8 | 9 |

10 | Content for the modal window. 11 |

12 |

13 | Notice you can't click anything on the previous page because of the semi-transparent div below..pretty slick huh? 14 |

15 |

16 | Try resizing your window and check out how the modal re-centers itself. 17 |

18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /submodal/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | background-color: #ffffff; 3 | } 4 | 5 | body, html, input { 6 | font-family:Verdana, Arial, Helvetica, sans-serif; 7 | font-size:11px; 8 | color: #333333; 9 | } 10 | 11 | .info { 12 | font-style:italic; 13 | font-size: 0.9em; 14 | color: #666666; 15 | } -------------------------------------------------------------------------------- /submodal/subModal.css: -------------------------------------------------------------------------------- 1 | /** 2 | * POPUP CONTAINER STYLES 3 | */ 4 | #popupMask { 5 | position: absolute; 6 | z-index: 200; 7 | top: 0px; 8 | left: 0px; 9 | width: 100%; 10 | height: 100%; 11 | opacity: .4; 12 | filter: alpha(opacity=70); 13 | /* this hack is so it works in IE 14 | * I find setting the color in the css gives me more flexibility 15 | * than the PNG solution. 16 | */ 17 | background-color:transparent !important; 18 | background-color: #333333; 19 | /* this hack is for opera support 20 | * you can uncomment the background-image if you don't care about opera. 21 | * this gives you the flexibility to use any bg color that you want, instead of the png 22 | */ 23 | background-image/**/: url("maskBG.png") !important; // For browsers Moz, Opera, etc. 24 | background-image:none; 25 | background-repeat: repeat; 26 | display:none; 27 | } 28 | #popupContainer { 29 | position: absolute; 30 | z-index: 201; 31 | top: 0px; 32 | left: 0px; 33 | display:none; 34 | padding: 0px; 35 | } 36 | #popupInner { 37 | border: 2px solid #7EA610; 38 | background-color: #ffffff; 39 | } 40 | 41 | #popupFrame { 42 | margin: 0px; 43 | width: 100%; 44 | height: 100%; 45 | position: relative; 46 | z-index: 202; 47 | } 48 | #popupTitleBar { 49 | background-color: #cccccc; 50 | color: #17399C; 51 | font-weight: bold; 52 | height: 1.3em; 53 | padding: 5px; 54 | border-bottom: 1px solid #999999; 55 | border-top: 0px solid #999999; 56 | border-left: 1px solid #999999; 57 | border-right: 1px solid #999999; 58 | position: relative; 59 | z-index: 203; 60 | } 61 | #popupTitle { 62 | float:left; 63 | font-size: 1.1em; 64 | font-weight:bolder; 65 | } 66 | #popupControls { 67 | float: right; 68 | cursor: pointer; 69 | cursor: hand; 70 | } -------------------------------------------------------------------------------- /submodal/subModal.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SUBMODAL v1.5 3 | * Used for displaying DHTML only popups instead of using buggy modal windows. 4 | * 5 | * By Seth Banks 6 | * http://www.subimage.com/ 7 | * 8 | * Contributions by: 9 | * Eric Angel - tab index code 10 | * Scott - hiding/showing selects for IE users 11 | * Todd Huss - inserting modal dynamically and anchor classes 12 | * 13 | * Up to date code can be found at http://www.subimage.com/dhtml/subModal 14 | * 15 | * 16 | * This code is free for you to use anywhere, just keep this comment block. 17 | */ 18 | 19 | // Popup code 20 | var gPopupMask = null; 21 | var gPopupContainer = null; 22 | var gPopFrame = null; 23 | var gReturnFunc; 24 | var gPopupIsShown = false; 25 | var gDefaultPage = "submodal/loading.html"; 26 | var gHideSelects = false; 27 | var gReturnVal = null; 28 | 29 | var gTabIndexes = new Array(); 30 | // Pre-defined list of tags we want to disable/enable tabbing into 31 | var gTabbableTags = new Array("A","BUTTON","TEXTAREA","INPUT","IFRAME"); 32 | 33 | // If using Mozilla or Firefox, use Tab-key trap. 34 | if (!document.all) { 35 | document.onkeypress = keyDownHandler; 36 | } 37 | 38 | 39 | 40 | /** 41 | * Initializes popup code on load. 42 | */ 43 | function initPopUp() { 44 | // Add the HTML to the body 45 | theBody = document.getElementsByTagName('BODY')[0]; 46 | popmask = document.createElement('div'); 47 | popmask.id = 'popupMask'; 48 | popcont = document.createElement('div'); 49 | popcont.id = 'popupContainer'; 50 | popcont.innerHTML = '' + 51 | '
' + 52 | '
' + 53 | '
rtgui
' + 54 | '
' + 55 | '' + 56 | '
' + 57 | '
' + 58 | '' + 59 | '
'; 60 | theBody.appendChild(popmask); 61 | theBody.appendChild(popcont); 62 | 63 | gPopupMask = document.getElementById("popupMask"); 64 | gPopupContainer = document.getElementById("popupContainer"); 65 | gPopFrame = document.getElementById("popupFrame"); 66 | 67 | // check to see if this is IE version 6 or lower. hide select boxes if so 68 | // maybe they'll fix this in version 7? 69 | var brsVersion = parseInt(window.navigator.appVersion.charAt(0), 10); 70 | if (brsVersion <= 6 && window.navigator.userAgent.indexOf("MSIE") > -1) { 71 | gHideSelects = true; 72 | } 73 | 74 | // Add onclick handlers to 'a' elements of class submodal or submodal-width-height 75 | var elms = document.getElementsByTagName('a'); 76 | for (i = 0; i < elms.length; i++) { 77 | if (elms[i].className.indexOf("submodal") == 0) { 78 | // var onclick = 'function (){showPopWin(\''+elms[i].href+'\','+width+', '+height+', null);return false;};'; 79 | // elms[i].onclick = eval(onclick); 80 | elms[i].onclick = function(){ 81 | // default width and height 82 | var width = 400; 83 | var height = 200; 84 | // Parse out optional width and height from className 85 | params = this.className.split('-'); 86 | if (params.length == 3) { 87 | width = parseInt(params[1]); 88 | height = parseInt(params[2]); 89 | } 90 | showPopWin(this.href,width,height,null); return false; 91 | } 92 | } 93 | } 94 | } 95 | addEvent(window, "load", initPopUp); 96 | 97 | /** 98 | * @argument width - int in pixels 99 | * @argument height - int in pixels 100 | * @argument url - url to display 101 | * @argument returnFunc - function to call when returning true from the window. 102 | * @argument showCloseBox - show the close box - default true 103 | */ 104 | 105 | function showPopWin(url, width, height, returnFunc, showCloseBox) { 106 | // show or hide the window close widget 107 | if (showCloseBox == null || showCloseBox == true) { 108 | document.getElementById("popCloseBox").style.display = "block"; 109 | } else { 110 | document.getElementById("popCloseBox").style.display = "none"; 111 | } 112 | gPopupIsShown = true; 113 | disableTabIndexes(); 114 | gPopupMask.style.display = "block"; 115 | gPopupMask.onclick = function() { hidePopWin(); } 116 | gPopupContainer.style.display = "block"; 117 | // calculate where to place the window on screen 118 | centerPopWin(width, height); 119 | 120 | var titleBarHeight = parseInt(document.getElementById("popupTitleBar").offsetHeight, 10); 121 | 122 | 123 | gPopupContainer.style.width = width + "px"; 124 | gPopupContainer.style.height = (height+titleBarHeight) + "px"; 125 | 126 | setMaskSize(); 127 | 128 | // need to set the width of the iframe to the title bar width because of the dropshadow 129 | // some oddness was occuring and causing the frame to poke outside the border in IE6 130 | gPopFrame.style.width = parseInt(document.getElementById("popupTitleBar").offsetWidth, 10) + "px"; 131 | gPopFrame.style.height = (height) + "px"; 132 | 133 | // set the url 134 | gPopFrame.src = url; 135 | 136 | gReturnFunc = returnFunc; 137 | // for IE 138 | if (gHideSelects == true) { 139 | hideSelectBoxes(); 140 | } 141 | 142 | window.setTimeout("setPopTitle();", 600); 143 | } 144 | 145 | // 146 | var gi = 0; 147 | function centerPopWin(width, height) { 148 | if (gPopupIsShown == true) { 149 | if (width == null || isNaN(width)) { 150 | width = gPopupContainer.offsetWidth; 151 | } 152 | if (height == null) { 153 | height = gPopupContainer.offsetHeight; 154 | } 155 | 156 | //var theBody = document.documentElement; 157 | var theBody = document.getElementsByTagName("BODY")[0]; 158 | //theBody.style.overflow = "hidden"; 159 | var scTop = parseInt(getScrollTop(),10); 160 | var scLeft = parseInt(theBody.scrollLeft,10); 161 | 162 | setMaskSize(); 163 | 164 | //window.status = gPopupMask.style.top + " " + gPopupMask.style.left + " " + gi++; 165 | 166 | var titleBarHeight = parseInt(document.getElementById("popupTitleBar").offsetHeight, 10); 167 | 168 | var fullHeight = getViewportHeight(); 169 | var fullWidth = getViewportWidth(); 170 | 171 | gPopupContainer.style.top = (scTop + ((fullHeight - (height+titleBarHeight)) / 2)) + "px"; 172 | gPopupContainer.style.left = (scLeft + ((fullWidth - width) / 2)) + "px"; 173 | //alert(fullWidth + " " + width + " " + gPopupContainer.style.left); 174 | } 175 | } 176 | addEvent(window, "resize", centerPopWin); 177 | addEvent(window, "scroll", centerPopWin); 178 | window.onscroll = centerPopWin; 179 | 180 | 181 | /** 182 | * Sets the size of the popup mask. 183 | * 184 | */ 185 | function setMaskSize() { 186 | var theBody = document.getElementsByTagName("BODY")[0]; 187 | 188 | var fullHeight = getViewportHeight(); 189 | var fullWidth = getViewportWidth(); 190 | 191 | // Determine what's bigger, scrollHeight or fullHeight / width 192 | if (fullHeight > theBody.scrollHeight) { 193 | popHeight = fullHeight; 194 | } else { 195 | popHeight = theBody.scrollHeight; 196 | } 197 | 198 | if (fullWidth > theBody.scrollWidth) { 199 | popWidth = fullWidth; 200 | } else { 201 | popWidth = theBody.scrollWidth; 202 | } 203 | 204 | gPopupMask.style.height = popHeight + "px"; 205 | gPopupMask.style.width = popWidth + "px"; 206 | } 207 | 208 | /** 209 | * @argument callReturnFunc - bool - determines if we call the return function specified 210 | * @argument returnVal - anything - return value 211 | */ 212 | function hidePopWin(callReturnFunc) { 213 | gPopupIsShown = false; 214 | var theBody = document.getElementsByTagName("BODY")[0]; 215 | theBody.style.overflow = ""; 216 | restoreTabIndexes(); 217 | if (gPopupMask == null) { 218 | return; 219 | } 220 | gPopupMask.style.display = "none"; 221 | gPopupContainer.style.display = "none"; 222 | if (callReturnFunc == true && gReturnFunc != null) { 223 | // Set the return code to run in a timeout. 224 | // Was having issues using with an Ajax.Request(); 225 | gReturnVal = window.frames["popupFrame"].returnVal; 226 | window.setTimeout('gReturnFunc(gReturnVal);', 1); 227 | } 228 | gPopFrame.src = gDefaultPage; 229 | // display all select boxes 230 | if (gHideSelects == true) { 231 | displaySelectBoxes(); 232 | } 233 | } 234 | 235 | /** 236 | * Sets the popup title based on the title of the html document it contains. 237 | * Uses a timeout to keep checking until the title is valid. 238 | */ 239 | function setPopTitle() { 240 | return; 241 | if (window.frames["popupFrame"].document.title == null) { 242 | window.setTimeout("setPopTitle();", 10); 243 | } else { 244 | document.getElementById("popupTitle").innerHTML = window.frames["popupFrame"].document.title; 245 | } 246 | } 247 | 248 | // Tab key trap. iff popup is shown and key was [TAB], suppress it. 249 | // @argument e - event - keyboard event that caused this function to be called. 250 | function keyDownHandler(e) { 251 | if (gPopupIsShown && e.keyCode == 9) return false; 252 | } 253 | 254 | // For IE. Go through predefined tags and disable tabbing into them. 255 | function disableTabIndexes() { 256 | if (document.all) { 257 | var i = 0; 258 | for (var j = 0; j < gTabbableTags.length; j++) { 259 | var tagElements = document.getElementsByTagName(gTabbableTags[j]); 260 | for (var k = 0 ; k < tagElements.length; k++) { 261 | gTabIndexes[i] = tagElements[k].tabIndex; 262 | tagElements[k].tabIndex="-1"; 263 | i++; 264 | } 265 | } 266 | } 267 | } 268 | 269 | // For IE. Restore tab-indexes. 270 | function restoreTabIndexes() { 271 | if (document.all) { 272 | var i = 0; 273 | for (var j = 0; j < gTabbableTags.length; j++) { 274 | var tagElements = document.getElementsByTagName(gTabbableTags[j]); 275 | for (var k = 0 ; k < tagElements.length; k++) { 276 | tagElements[k].tabIndex = gTabIndexes[i]; 277 | tagElements[k].tabEnabled = true; 278 | i++; 279 | } 280 | } 281 | } 282 | } 283 | 284 | 285 | /** 286 | * Hides all drop down form select boxes on the screen so they do not appear above the mask layer. 287 | * IE has a problem with wanted select form tags to always be the topmost z-index or layer 288 | * 289 | * Thanks for the code Scott! 290 | */ 291 | function hideSelectBoxes() { 292 | for(var i = 0; i < document.forms.length; i++) { 293 | for(var e = 0; e < document.forms[i].length; e++){ 294 | if(document.forms[i].elements[e].tagName == "SELECT") { 295 | document.forms[i].elements[e].style.visibility="hidden"; 296 | } 297 | } 298 | } 299 | } 300 | 301 | /** 302 | * Makes all drop down form select boxes on the screen visible so they do not reappear after the dialog is closed. 303 | * IE has a problem with wanted select form tags to always be the topmost z-index or layer 304 | */ 305 | function displaySelectBoxes() { 306 | for(var i = 0; i < document.forms.length; i++) { 307 | for(var e = 0; e < document.forms[i].length; e++){ 308 | if(document.forms[i].elements[e].tagName == "SELECT") { 309 | document.forms[i].elements[e].style.visibility="visible"; 310 | } 311 | } 312 | } 313 | } -------------------------------------------------------------------------------- /view.php: -------------------------------------------------------------------------------- 1 | . 18 | 19 | $execstart=$start=microtime(true); 20 | include "functions.php"; 21 | include "config.php"; 22 | //import_request_variables("gp","r_"); 23 | 24 | $r_select = isset($_GET['select']) ? trim($_GET['select']) : 'files'; 25 | $r_hash = isset($_GET['hash']) ? trim($_GET['hash']) : null; 26 | ?> 27 | 28 | 29 | 30 | 31 | 32 | rtGui 33 | 34 | 35 | 36 | 290 | 291 | 292 | --------------------------------------------------------------------------------