[ Index ] |
|
Code source de Mantis 1.1.0rc3 |
1 <?php 2 /* vim: set expandtab tabstop=4 shiftwidth=4: */ 3 //+----------------------------------------------------------------------+ 4 //| WAMP (XP-SP1/1.3.27/4.0.12/4.3.2) | 5 //+----------------------------------------------------------------------+ 6 //| Copyright (c) 1992-2003 Michael Wimmer | 7 //+----------------------------------------------------------------------+ 8 //| I don't have the time to read through all the licences to find out | 9 //| what the exactly say. But it's simple. It's free for non commercial | 10 //| projects, but as soon as you make money with it, i want my share :-) | 11 //| (License : Free for non-commercial use) | 12 //| | 13 //| *** LICENSE CHANGED TO GPL, see news post by owner at: ***** | 14 //| http://sourceforge.net/forum/forum.php?forum_id=694707 | 15 //+----------------------------------------------------------------------+ 16 //| Authors: Michael Wimmer <flaimo@gmx.net> | 17 //+----------------------------------------------------------------------+ 18 // 19 // $Id: class.RSSBuilder.inc.php,v 1.5 2007-05-12 06:21:38 vboctor Exp $ 20 21 /** 22 * @package RSSBuilder 23 * @category FLP 24 */ 25 /** 26 * Abstract class for getting ini preferences 27 * 28 * Tested with WAMP (XP-SP1/1.3.27/4.0.12/4.3.2) 29 * Last change: 2003-06-26 30 * 31 * @desc Abstract class for the RSS classes 32 * @access protected 33 * @author Michael Wimmer <flaimo 'at' gmx 'dot' net> 34 * @copyright Michael Wimmer 35 * @link http://www.flaimo.com/ 36 * @global array $GLOBALS['_TICKER_ini_settings'] 37 * @abstract 38 * @package RSSBuilder 39 * @category FLP 40 * @version 1.002 41 */ 42 class RSSBase { 43 44 /*-----------------------*/ 45 /* C O N S T R U C T O R */ 46 /*-----------------------*/ 47 48 /** 49 * Constructor 50 * 51 * @desc Constructor 52 * @return void 53 * @access private 54 */ 55 function RSSBase() { 56 } // end constructor 57 58 } // end class RSSBase 59 60 //--------------------------------------------------------------------------- 61 62 /** 63 * Class for creating a RSS file 64 * 65 * Tested with WAMP (XP-SP1/1.3.27/4.0.12/4.3.2) 66 * Last change: 2003-06-26 67 * 68 * @desc Class for creating a RSS file 69 * @access public 70 * @author Michael Wimmer <flaimo@gmx.net> 71 * @copyright Michael Wimmer 72 * @link http://www.flaimo.com/ 73 * @example rss_sample_script.php Sample script 74 * @package RSSBuilder 75 * @category FLP 76 * @version 1.002 77 */ 78 class RSSBuilder extends RSSBase { 79 80 /*-------------------*/ 81 /* V A R I A B L E S */ 82 /*-------------------*/ 83 84 /**#@+ 85 * @access private 86 * @var string 87 */ 88 /** 89 * encoding of the XML file 90 * 91 * @desc encoding of the XML file 92 */ 93 var $encoding; 94 95 /** 96 * URL where the RSS document will be made available 97 * 98 * @desc URL where the RSS document will be made available 99 */ 100 var $about; 101 102 /** 103 * title of the rss stream 104 * 105 * @desc title of the rss stream 106 */ 107 var $title; 108 109 /** 110 * description of the rss stream 111 * 112 * @desc description of the rss stream 113 */ 114 var $description; 115 116 /** 117 * publisher of the rss stream (person, an organization, or a service) 118 * 119 * @desc publisher of the rss stream 120 */ 121 var $publisher; 122 123 /** 124 * creator of the rss stream (person, an organization, or a service) 125 * 126 * @desc creator of the rss stream 127 */ 128 var $creator; 129 130 /** 131 * creation date of the file (format: 2003-05-29T00:03:07+0200) 132 * 133 * @desc creation date of the file (format: 2003-05-29T00:03:07+0200) 134 */ 135 var $date; 136 137 /** 138 * iso format language 139 * 140 * @desc iso format language 141 */ 142 var $language; 143 144 /** 145 * copyrights for the rss stream 146 * 147 * @desc copyrights for the rss stream 148 */ 149 var $rights; 150 151 /** 152 * URL to an small image 153 * 154 * @desc URL to an small image 155 */ 156 var $image_link; 157 158 /** 159 * spatial location, temporal period or jurisdiction 160 * 161 * spatial location (a place name or geographic coordinates), temporal 162 * period (a period label, date, or date range) or jurisdiction (such as a 163 * named administrative entity) 164 * 165 * @desc spatial location, temporal period or jurisdiction 166 */ 167 var $coverage; 168 169 /** 170 * person, an organization, or a service 171 * 172 * @desc person, an organization, or a service 173 */ 174 var $contributor; 175 176 /** 177 * 'hourly' | 'daily' | 'weekly' | 'monthly' | 'yearly' 178 * 179 * @desc 'hourly' | 'daily' | 'weekly' | 'monthly' | 'yearly' 180 */ 181 var $period; 182 183 /** 184 * date (format: 2003-05-29T00:03:07+0200) 185 * 186 * Defines a base date to be used in concert with updatePeriod and 187 * updateFrequency to calculate the publishing schedule. 188 * 189 * @desc base date to calculate from (format: 2003-05-29T00:03:07+0200) 190 */ 191 var $base; 192 193 /** 194 * category (rss 2.0) 195 * 196 * @desc category (rss 2.0) 197 * @since 1.001 - 2003-05-30 198 */ 199 var $category; 200 201 /** 202 * compiled outputstring 203 * 204 * @desc compiled outputstring 205 */ 206 var $output; 207 /**#@-*/ 208 209 /**#@+ 210 * @access private 211 */ 212 /** 213 * every X hours/days/weeks/... 214 * 215 * @desc every X hours/days/weeks/... 216 * @var int 217 */ 218 var $frequency; 219 220 /** 221 * caching time in minutes (rss 2.0) 222 * 223 * @desc caching time in minutes (rss 2.0) 224 * @var int 225 * @since 1.001 - 2003-05-30 226 */ 227 var $cache; 228 229 /** 230 * array wich all the rss items 231 * 232 * @desc array wich all the rss items 233 * @var array 234 */ 235 var $items = array(); 236 237 /** 238 * use DC data 239 * 240 * @desc use DC data 241 * @var boolean 242 */ 243 var $use_dc_data = FALSE; 244 245 /** 246 * use SY data 247 * 248 * @desc use SY data 249 * @var boolean 250 */ 251 var $use_sy_data = FALSE; 252 /**#@-*/ 253 254 /*-----------------------*/ 255 /* C O N S T R U C T O R */ 256 /*-----------------------*/ 257 258 /**#@+ 259 * @return void 260 */ 261 /** 262 * Constructor 263 * 264 * @desc Constructor 265 * @param string $encoding encoding of the xml file 266 * @param string $about URL where the RSS document will be made available 267 * @param string $title 268 * @param string $description 269 * @param string $image_link URL 270 * @uses setEncoding() 271 * @uses setAbout() 272 * @uses setTitle() 273 * @uses setDescription() 274 * @uses setImageLink() 275 * @uses setCategory() 276 * @uses etCache() 277 * @access private 278 */ 279 function RSSBuilder($encoding = '', 280 $about = '', 281 $title = '', 282 $description = '', 283 $image_link = '', 284 $category = '', 285 $cache = '') { 286 $this->setEncoding($encoding); 287 $this->setAbout($about); 288 $this->setTitle($title); 289 $this->setDescription($description); 290 $this->setImageLink($image_link); 291 $this->setCategory($category); 292 $this->setCache($cache); 293 } // end constructor 294 295 /*-------------------*/ 296 /* F U N C T I O N S */ 297 /*-------------------*/ 298 299 /** 300 * add additional DC data 301 * 302 * @desc add additional DC data 303 * @param string $publisher person, an organization, or a service 304 * @param string $creator person, an organization, or a service 305 * @param string $date format: 2003-05-29T00:03:07+0200 306 * @param string $language iso-format 307 * @param string $rights copyright information 308 * @param string $coverage spatial location (a place name or geographic coordinates), temporal period (a period label, date, or date range) or jurisdiction (such as a named administrative entity) 309 * @param string $contributor person, an organization, or a service 310 * @uses setPublisher() 311 * @uses setCreator() 312 * @uses setDate() 313 * @uses setLanguage() 314 * @uses setRights() 315 * @uses setCoverage() 316 * @uses setContributor() 317 * @access public 318 */ 319 function addDCdata($publisher = '', 320 $creator = '', 321 $date = '', 322 $language = '', 323 $rights = '', 324 $coverage = '', 325 $contributor = '') { 326 $this->setPublisher($publisher); 327 $this->setCreator($creator); 328 $this->setDate($date); 329 $this->setLanguage($language); 330 $this->setRights($rights); 331 $this->setCoverage($coverage); 332 $this->setContributor($contributor); 333 $this->use_dc_data = (boolean) TRUE; 334 } // end function 335 336 /** 337 * add additional SY data 338 * 339 * @desc add additional DC data 340 * @param string $period 'hourly' | 'daily' | 'weekly' | 'monthly' | 'yearly' 341 * @param int $frequency every x hours/days/weeks/... 342 * @param string $base format: 2003-05-29T00:03:07+0200 343 * @uses setPeriod() 344 * @uses setFrequency() 345 * @uses setBase() 346 * @access public 347 */ 348 function addSYdata($period = '', $frequency = '', $base = '') { 349 $this->setPeriod($period); 350 $this->setFrequency($frequency); 351 $this->setBase($base); 352 $this->use_sy_data = (boolean) TRUE; 353 } // end function 354 /**#@-*/ 355 356 /**#@+ 357 * @return void 358 * @access private 359 */ 360 /** 361 * Sets $encoding variable 362 * 363 * @desc Sets $encoding variable 364 * @param string $encoding encoding of the xml file 365 * @see $encoding 366 */ 367 function setEncoding($encoding = '') { 368 if (!isset($this->encoding)) { 369 $this->encoding = (string) ((strlen(trim($encoding)) > 0) ? trim($encoding) : 'UTF-8'); 370 } // end if 371 } // end function 372 373 /** 374 * Sets $about variable 375 * 376 * @desc Sets $about variable 377 * @param string $about 378 * @see $about 379 */ 380 function setAbout($about = '') { 381 if (!isset($this->about) && strlen(trim($about)) > 0) { 382 $this->about = (string) trim($about); 383 } // end if 384 } // end function 385 386 /** 387 * Sets $title variable 388 * 389 * @desc Sets $title variable 390 * @param string $title 391 * @see $title 392 */ 393 function setTitle($title = '') { 394 if (!isset($this->title) && strlen(trim($title)) > 0) { 395 $this->title = (string) trim($title); 396 } // end if 397 } // end function 398 399 /** 400 * Sets $description variable 401 * 402 * @desc Sets $description variable 403 * @param string $description 404 * @see $description 405 */ 406 function setDescription($description = '') { 407 if (!isset($this->description) && strlen(trim($description)) > 0) { 408 $this->description = (string) trim($description); 409 } // end if 410 } // end function 411 412 /** 413 * Sets $publisher variable 414 * 415 * @desc Sets $publisher variable 416 * @param string $publisher 417 * @see $publisher 418 */ 419 function setPublisher($publisher = '') { 420 if (!isset($this->publisher) && strlen(trim($publisher)) > 0) { 421 $this->publisher = (string) trim($publisher); 422 } // end if 423 } // end function 424 425 /** 426 * Sets $creator variable 427 * 428 * @desc Sets $creator variable 429 * @param string $creator 430 * @see $creator 431 */ 432 function setCreator($creator = '') { 433 if (!isset($this->creator) && strlen(trim($creator)) > 0) { 434 $this->creator = (string) trim($creator); 435 } // end if 436 } // end function 437 438 /** 439 * Sets $date variable 440 * 441 * @desc Sets $date variable 442 * @param string $date format: 2003-05-29T00:03:07+0200 443 * @see $date 444 */ 445 function setDate($date = '') { 446 if (!isset($this->date) && strlen(trim($date)) > 0) { 447 $this->date = (string) trim($date); 448 } // end if 449 } // end function 450 451 /** 452 * Sets $language variable 453 * 454 * @desc Sets $language variable 455 * @param string $language 456 * @see $language 457 * @uses isValidLanguageCode() 458 */ 459 function setLanguage($language = '') { 460 if (!isset($this->language) && $this->isValidLanguageCode($language) === TRUE) { 461 $this->language = (string) trim($language); 462 } // end if 463 } // end function 464 465 /** 466 * Sets $rights variable 467 * 468 * @desc Sets $rights variable 469 * @param string $rights 470 * @see $rights 471 */ 472 function setRights($rights = '') { 473 if (!isset($this->rights) && strlen(trim($rights)) > 0) { 474 $this->rights = (string) trim($rights); 475 } // end if 476 } // end function 477 478 /** 479 * Sets $coverage variable 480 * 481 * @desc Sets $coverage variable 482 * @param string $coverage 483 * @see $coverage 484 */ 485 function setCoverage($coverage = '') { 486 if (!isset($this->coverage) && strlen(trim($coverage)) > 0) { 487 $this->coverage = (string) trim($coverage); 488 } // end if 489 } // end function 490 491 492 /** 493 * Sets $contributor variable 494 * 495 * @desc Sets $contributor variable 496 * @param string $contributor 497 * @see $contributor 498 */ 499 function setContributor($contributor = '') { 500 if (!isset($this->contributor) && strlen(trim($contributor)) > 0) { 501 $this->contributor = (string) trim($contributor); 502 } // end if 503 } // end function 504 505 /** 506 * Sets $image_link variable 507 * 508 * @desc Sets $image_link variable 509 * @param string $image_link 510 * @see $image_link 511 */ 512 function setImageLink($image_link = '') { 513 if (!isset($this->image_link) && strlen(trim($image_link)) > 0) { 514 $this->image_link = (string) trim($image_link); 515 } // end if 516 } // end function 517 518 /** 519 * Sets $period variable 520 * 521 * @desc Sets $period variable 522 * @param string $period 'hourly' | 'daily' | 'weekly' | 'monthly' | 'yearly' 523 * @see $period 524 */ 525 function setPeriod($period = '') { 526 if (!isset($this->period) && strlen(trim($period)) > 0) { 527 switch ($period) { 528 case 'hourly': 529 case 'daily': 530 case 'weekly': 531 case 'monthly': 532 case 'yearly': 533 $this->period = (string) trim($period); 534 break; 535 default: 536 $this->period = (string) ''; 537 break; 538 } // end switch 539 } // end if 540 } // end function 541 542 /** 543 * Sets $frequency variable 544 * 545 * @desc Sets $frequency variable 546 * @param int $frequency 547 * @see $frequency 548 */ 549 function setFrequency($frequency = '') { 550 if (!isset($this->frequency) && strlen(trim($frequency)) > 0) { 551 $this->frequency = (int) $frequency; 552 } // end if 553 } // end function 554 555 /** 556 * Sets $base variable 557 * 558 * @desc Sets $base variable 559 * @param string $base 560 * @see $base 561 */ 562 function setBase($base = '') { 563 if (!isset($this->base) && strlen(trim($base)) > 0) { 564 $this->base = (string) trim($base); 565 } // end if 566 } // end function 567 568 /** 569 * Sets $category variable 570 * 571 * @desc Sets $category variable 572 * @param string $category 573 * @see $category 574 * @since 1.001 - 2003-05-30 575 */ 576 function setCategory($category = '') { 577 if (strlen(trim($category)) > 0) { 578 $this->category = (string) trim($category); 579 } // end if 580 } // end function 581 582 /** 583 * Sets $cache variable 584 * 585 * @desc Sets $cache variable 586 * @param int $cache 587 * @see $cache 588 * @since 1.001 - 2003-05-30 589 */ 590 function setCache($cache = '') { 591 if (strlen(trim($cache)) > 0) { 592 $this->cache = (int) $cache; 593 } // end if 594 } // end function 595 /**#@-*/ 596 597 /**#@+ 598 * @access public 599 */ 600 /** 601 * Checks if a given string is a valid iso-language-code 602 * 603 * @desc Checks if a given string is a valid iso-language-code 604 * @param string $code String that should validated 605 * @return boolean $isvalid If string is valid or not 606 * @static 607 */ 608 function isValidLanguageCode($code = '') { 609 return (boolean) ((preg_match('(^([a-zA-Z]{2})$)',$code) > 0) ? TRUE : FALSE); 610 } // end function 611 612 /** 613 * Returns $encoding variable 614 * 615 * @desc Returns $encoding variable 616 * @return string $encoding 617 * @see $image_link 618 */ 619 function getEncoding() { 620 return (string) $this->encoding; 621 } // end function 622 623 /** 624 * Returns $about variable 625 * 626 * @desc Returns $about variable 627 * @return string $about 628 * @see $about 629 */ 630 function getAbout() { 631 return (string) $this->about; 632 } // end function 633 634 /** 635 * Returns $title variable 636 * 637 * @desc Returns $title variable 638 * @return string $title 639 * @see $title 640 */ 641 function getTitle() { 642 return (string) $this->title; 643 } // end function 644 645 /** 646 * Returns $description variable 647 * 648 * @desc Returns $description variable 649 * @return string $description 650 * @see $description 651 */ 652 function getDescription() { 653 return (string) $this->description; 654 } // end function 655 656 /** 657 * Returns $publisher variable 658 * 659 * @desc Returns $publisher variable 660 * @return string $publisher 661 * @see $publisher 662 */ 663 function getPublisher() { 664 return (string) $this->publisher; 665 } // end function 666 667 /** 668 * Returns $creator variable 669 * 670 * @desc Returns $creator variable 671 * @return string $creator 672 * @see $creator 673 */ 674 function getCreator() { 675 return (string) $this->creator; 676 } // end function 677 678 /** 679 * Returns $date variable 680 * 681 * @desc Returns $date variable 682 * @return string $date 683 * @see $date 684 */ 685 function getDate() { 686 return (string) $this->date; 687 } // end function 688 689 /** 690 * Returns $language variable 691 * 692 * @desc Returns $language variable 693 * @return string $language 694 * @see $language 695 */ 696 function getLanguage() { 697 return (string) $this->language; 698 } // end function 699 700 /** 701 * Returns $rights variable 702 * 703 * @desc Returns $rights variable 704 * @return string $rights 705 * @see $rights 706 */ 707 function getRights() { 708 return (string) $this->rights; 709 } // end function 710 711 /** 712 * Returns $coverage variable 713 * 714 * @desc Returns $coverage variable 715 * @return string $coverage 716 * @see $coverage 717 */ 718 function getCoverage() { 719 return (string) $this->coverage; 720 } // end function 721 722 /** 723 * Returns $contributor variable 724 * 725 * @desc Returns $contributor variable 726 * @return string $contributor 727 * @see $contributor 728 */ 729 function getContributor() { 730 return (string) $this->contributor; 731 } // end function 732 733 /** 734 * Returns $image_link variable 735 * 736 * @desc Returns $image_link variable 737 * @return string $image_link 738 * @see $image_link 739 */ 740 function getImageLink() { 741 return (string) $this->image_link; 742 } // end function 743 744 /** 745 * Returns $period variable 746 * 747 * @desc Returns $period variable 748 * @return string $period 749 * @see $period 750 */ 751 function getPeriod() { 752 return (string) $this->period; 753 } // end function 754 755 /** 756 * Returns $frequency variable 757 * 758 * @desc Returns $frequency variable 759 * @return string $frequency 760 * @see $frequency 761 */ 762 function getFrequency() { 763 return (int) $this->frequency; 764 } // end function 765 766 /** 767 * Returns $base variable 768 * 769 * @desc Returns $base variable 770 * @return string $base 771 * @see $base 772 */ 773 function getBase() { 774 return (string) $this->base; 775 } // end function 776 777 /** 778 * Returns $category variable 779 * 780 * @desc Returns $category variable 781 * @return string $category 782 * @see $category 783 * @since 1.001 - 2003-05-30 784 */ 785 function getCategory() { 786 return (string) $this->category; 787 } // end function 788 789 /** 790 * Returns $cache variable 791 * 792 * @desc Returns $cache variable 793 * @return int $cache 794 * @see $cache 795 * @since 1.001 - 2003-05-30 796 */ 797 function getCache() { 798 return (int) $this->cache; 799 } // end function 800 801 /** 802 * Adds another rss item to the object 803 * 804 * @desc Adds another rss item to the object 805 * @param string $about URL 806 * @param string $title 807 * @param string $link URL 808 * @param string $description (optional) 809 * @param string $subject some sort of category (optional dc value - only shows up if DC data has been set before) 810 * @param string $date format: 2003-05-29T00:03:07+0200 (optional dc value - only shows up if DC data has been set before) 811 * @param string $author some sort of category author of item 812 * @param string $comments url to comment page rss 2.0 value 813 * @param string $image optional mod_im value for dispaying a different pic for every item 814 * @return void 815 * @see $items 816 * @uses RSSItem 817 */ 818 function addItem($about = '', 819 $title = '', 820 $link = '', 821 $description = '', 822 $subject = '', 823 $date = '', 824 $author = '', 825 $comments = '', 826 $image = '') { 827 828 $item = new RSSItem($about, 829 $title, 830 $link, 831 $description, 832 $subject, 833 $date, 834 $author, 835 $comments, 836 $image); 837 $this->items[] = $item; 838 } // end function 839 840 /** 841 * Deletes a rss item from the array 842 * 843 * @desc Deletes a rss item from the array 844 * @param int $id id of the element in the $items array 845 * @return boolean true if item was deleted 846 * @see $items 847 */ 848 function deleteItem($id = -1) { 849 if (array_key_exists($id, $this->items)) { 850 unset($this->items[$id]); 851 return (boolean) TRUE; 852 } else { 853 return (boolean) FALSE; 854 } // end if 855 } // end function 856 857 /** 858 * Returns an array with all the keys of the $items array 859 * 860 * @desc Returns an array with all the keys of the $items array 861 * @return array array with all the keys of the $items array 862 * @see $items 863 */ 864 function getItemList() { 865 return (array) array_keys($this->items); 866 } // end function 867 868 /** 869 * Returns the $items array 870 * 871 * @desc Returns the $items array 872 * @return array $items 873 */ 874 function getItems() { 875 return (array) $this->items; 876 } // end function 877 878 /** 879 * Returns a single rss item by ID 880 * 881 * @desc Returns a single rss item by ID 882 * @param int $id id of the element in the $items array 883 * @return mixed RSSItem or FALSE 884 * @see RSSItem 885 */ 886 function getItem($id = -1) { 887 if (array_key_exists($id, $this->items)) { 888 return (object) $this->items[$id]; 889 } else { 890 return (boolean) FALSE; 891 } // end if 892 } // end function 893 /**#@-*/ 894 895 /**#@+ 896 * @return void 897 * @access private 898 */ 899 /** 900 * creates the output based on the 0.91 rss version 901 * 902 * @desc creates the output based on the 0.91 rss version 903 * @see $output 904 */ 905 function createOutputV090() { 906 // not implemented 907 $this->createOutputV100(); 908 } // end function 909 910 /** 911 * creates the output based on the 0.91 rss version 912 * 913 * @desc creates the output based on the 0.91 rss version 914 * @see $output 915 * @since 1.001 - 2003-05-30 916 */ 917 function createOutputV091() { 918 $this->output = (string) '<!DOCTYPE rss SYSTEM "http://my.netscape.com/publish/formats/rss-0.91.dtd">' . "\n"; 919 $this->output .= (string) '<rss version="0.91">' . "\n"; 920 $this->output .= (string) '<channel>' . "\n"; 921 922 if (strlen($this->rights) > 0) { 923 $this->output .= (string) '<copyright>' . $this->rights . '</copyright>' . "\n"; 924 } // end if 925 926 if (strlen($this->date) > 0) { 927 $this->output .= (string) '<pubDate>' .$this->date . '</pubDate>' . "\n"; 928 $this->output .= (string) '<lastBuildDate>' .$this->date . '</lastBuildDate>' . "\n"; 929 } // end if 930 931 if (strlen($this->about) > 0) { 932 $this->output .= (string) '<docs>' . $this->about . '</docs>' . "\n"; 933 } // end if 934 935 if (strlen($this->description) > 0) { 936 $this->output .= (string) '<description>' . $this->description . '</description>' . "\n"; 937 } // end if 938 939 if (strlen($this->about) > 0) { 940 $this->output .= (string) '<link>' . $this->about . '</link>' . "\n"; 941 } // end if 942 943 if (strlen($this->title) > 0) { 944 $this->output .= (string) '<title>' . $this->title . '</title>' . "\n"; 945 } // end if 946 947 if (strlen($this->image_link) > 0) { 948 $this->output .= (string) '<image>' . "\n"; 949 $this->output .= (string) '<title>' . $this->title . '</title>' . "\n"; 950 $this->output .= (string) '<url>' . $this->image_link . '</url>' . "\n"; 951 $this->output .= (string) '<link>' . $this->about . '</link>' . "\n"; 952 if (strlen($this->description) > 0) { 953 $this->output .= (string) '<description>' . $this->description . '</description>' . "\n"; 954 } // end if 955 $this->output .= (string) '</image>' . "\n"; 956 } // end if 957 958 if (strlen($this->publisher) > 0) { 959 $this->output .= (string) '<managingEditor>' . $this->publisher . '</managingEditor>' . "\n"; 960 } // end if 961 962 if (strlen($this->creator) > 0) { 963 $this->output .= (string) '<webMaster>' . $this->creator . '</webMaster>' . "\n"; 964 } // end if 965 966 if (strlen($this->language) > 0) { 967 $this->output .= (string) '<language>' . $this->language . '</language>' . "\n"; 968 } // end if 969 970 if (count($this->getItemList()) > 0) { 971 foreach ($this->getItemList() as $id) { 972 $item =& $this->items[$id]; 973 974 if (strlen($item->getTitle()) > 0 && strlen($item->getLink()) > 0) { 975 $this->output .= (string) '<item>' . "\n"; 976 $this->output .= (string) '<title>' . $item->getTitle() . '</title>' . "\n"; 977 $this->output .= (string) '<link>' . $item->getLink() . '</link>' . "\n"; 978 if (strlen($item->getDescription()) > 0) { 979 $this->output .= (string) '<description>' . $item->getDescription() . '</description>' . "\n"; 980 } // end if 981 $this->output .= (string) '</item>' . "\n"; 982 } // end if 983 } // end foreach 984 } // end if 985 986 $this->output .= (string) '</channel>' . "\n"; 987 $this->output .= (string) '</rss>' . "\n"; 988 } // end function 989 990 /** 991 * creates the output based on the 1.0 rss version 992 * 993 * @desc creates the output based on the 1.0 rss version 994 * @see $output 995 */ 996 function createOutputV100() { 997 $this->output = (string) '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:im="http://purl.org/rss/1.0/item-images/" '; 998 999 if ($this->use_dc_data === TRUE) { 1000 $this->output .= (string) 'xmlns:dc="http://purl.org/dc/elements/1.1/" '; 1001 } // end if 1002 1003 if ($this->use_sy_data === TRUE) { 1004 $this->output .= (string) 'xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" '; 1005 } // end if 1006 1007 $this->output .= (string) 'xmlns="http://purl.org/rss/1.0/">' . "\n"; 1008 1009 if (strlen($this->about) > 0) { 1010 $this->output .= (string) '<channel rdf:about="' . $this->about . '">' . "\n"; 1011 } else { 1012 $this->output .= (string) '<channel>' . "\n"; 1013 } // end if 1014 1015 if (strlen($this->title) > 0) { 1016 $this->output .= (string) '<title>' . $this->title . '</title>' . "\n"; 1017 } // end if 1018 1019 if (strlen($this->about) > 0) { 1020 $this->output .= (string) '<link>' . $this->about . '</link>' . "\n"; 1021 } // end if 1022 1023 if (strlen($this->description) > 0) { 1024 $this->output .= (string) '<description>' . $this->description . '</description>' . "\n"; 1025 } // end if 1026 1027 // additional dc data 1028 if (strlen($this->publisher) > 0) { 1029 $this->output .= (string) '<dc:publisher>' . $this->publisher . '</dc:publisher>' . "\n"; 1030 } // end if 1031 1032 if (strlen($this->creator) > 0) { 1033 $this->output .= (string) '<dc:creator>' . $this->creator . '</dc:creator>' . "\n"; 1034 } // end if 1035 1036 if (strlen($this->date) > 0) { 1037 $this->output .= (string) '<dc:date>' .$this->date . '</dc:date>' . "\n"; 1038 } // end if 1039 1040 if (strlen($this->language) > 0) { 1041 $this->output .= (string) '<dc:language>' . $this->language . '</dc:language>' . "\n"; 1042 } // end if 1043 1044 if (strlen($this->rights) > 0) { 1045 $this->output .= (string) '<dc:rights>' . $this->rights . '</dc:rights>' . "\n"; 1046 } // end if 1047 1048 if (strlen($this->coverage) > 0) { 1049 $this->output .= (string) '<dc:coverage>' . $this->coverage . '</dc:coverage>' . "\n"; 1050 } // end if 1051 1052 if (strlen($this->contributor) > 0) { 1053 $this->output .= (string) '<dc:contributor>' . $this->contributor . '</dc:contributor>' . "\n"; 1054 } // end if 1055 1056 // additional SY data 1057 if (strlen($this->period) > 0) { 1058 $this->output .= (string) '<sy:updatePeriod>' . $this->period . '</sy:updatePeriod>' . "\n"; 1059 } // end if 1060 1061 if (strlen($this->frequency) > 0) { 1062 $this->output .= (string) '<sy:updateFrequency>' . $this->frequency . '</sy:updateFrequency>' . "\n"; 1063 } // end if 1064 1065 if (strlen($this->base) > 0) { 1066 $this->output .= (string) '<sy:updateBase>' . $this->base . '</sy:updateBase>' . "\n"; 1067 } // end if 1068 1069 if (strlen($this->image_link) > 0) { 1070 $this->output .= (string) '<image rdf:about="' . $this->image_link . '">' . "\n"; 1071 $this->output .= (string) '<title>' . $this->title . '</title>' . "\n"; 1072 $this->output .= (string) '<url>' . $this->image_link . '</url>' . "\n"; 1073 $this->output .= (string) '<link>' . $this->about . '</link>' . "\n"; 1074 if (strlen($this->description) > 0) { 1075 $this->output .= (string) '<description>' . $this->description . '</description>' . "\n"; 1076 } // end if 1077 $this->output .= (string) '</image>' . "\n"; 1078 } // end if 1079 1080 if (count($this->getItemList()) > 0) { 1081 $this->output .= (string) '<items><rdf:Seq>' . "\n"; 1082 foreach ($this->getItemList() as $id) { 1083 $item =& $this->items[$id]; 1084 if (strlen($item->getAbout()) > 0) { 1085 $this->output .= (string) ' <rdf:li resource="' . $item->getAbout() . '" />' . "\n"; 1086 } // end if 1087 } // end foreach 1088 $this->output .= (string) '</rdf:Seq></items>' . "\n"; 1089 } // end if 1090 $this->output .= (string) '</channel>' . "\n"; 1091 1092 if (count($this->getItemList()) > 0) { 1093 foreach ($this->getItemList() as $id) { 1094 $item =& $this->items[$id]; 1095 1096 if (strlen($item->getTitle()) > 0 && strlen($item->getLink()) > 0) { 1097 if (strlen($item->getAbout()) > 0) { 1098 $this->output .= (string) '<item rdf:about="' . $item->getAbout() . '">' . "\n"; 1099 } else { 1100 $this->output .= (string) '<item>' . "\n"; 1101 } // end if 1102 1103 $this->output .= (string) '<title>' . $item->getTitle() . '</title>' . "\n"; 1104 $this->output .= (string) '<link>' . $item->getLink() . '</link>' . "\n"; 1105 1106 if (strlen($item->getDescription()) > 0) { 1107 $this->output .= (string) '<description>' . $item->getDescription() . '</description>' . "\n"; 1108 } // end if 1109 1110 if ($this->use_dc_data === TRUE && strlen($item->getSubject()) > 0) { 1111 $this->output .= (string) '<dc:subject>' . $item->getSubject() . '</dc:subject>' . "\n"; 1112 } // end if 1113 1114 if ($this->use_dc_data === TRUE && strlen($item->getDate()) > 0) { 1115 $this->output .= (string) '<dc:date>' . $item->getDate() . '</dc:date>' . "\n"; 1116 } // end if 1117 1118 if (strlen($item->getImage()) > 0) { 1119 $this->output .= (string) '<im:image>' . $item->getImage() . '</im:image>' . "\n"; 1120 } // end if 1121 1122 $this->output .= (string) '</item>' . "\n"; 1123 } // end if 1124 } // end foreach 1125 } // end if 1126 1127 $this->output .= (string) '</rdf:RDF>'; 1128 } // end function 1129 1130 /** 1131 * creates the output based on the 2.0 rss draft 1132 * 1133 * @desc creates the output based on the 0.91 rss draft 1134 * @see $output 1135 * @since 1.001 - 2003-05-30 1136 */ 1137 function createOutputV200() { 1138 $this->output = (string) '<rss version="2.0" xmlns:im="http://purl.org/rss/1.0/item-images/" '; 1139 1140 if ($this->use_dc_data === TRUE) { 1141 $this->output .= (string) 'xmlns:dc="http://purl.org/dc/elements/1.1/" '; 1142 } // end if 1143 1144 if ($this->use_sy_data === TRUE) { 1145 $this->output .= (string) 'xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" '; 1146 } // end if 1147 1148 $this->output .= (string) '>' . "\n"; 1149 1150 $this->output .= (string) '<channel>' . "\n"; 1151 1152 if (strlen($this->rights) > 0) { 1153 $this->output .= (string) '<copyright>' . $this->rights . '</copyright>' . "\n"; 1154 } // end if 1155 1156 if (strlen($this->date) > 0) { 1157 $this->output .= (string) '<pubDate>' .$this->date . '</pubDate>' . "\n"; 1158 $this->output .= (string) '<lastBuildDate>' .$this->date . '</lastBuildDate>' . "\n"; 1159 } // end if 1160 1161 if (strlen($this->about) > 0) { 1162 $this->output .= (string) '<docs>' . $this->about . '</docs>' . "\n"; 1163 } // end if 1164 1165 if (strlen($this->description) > 0) { 1166 $this->output .= (string) '<description>' . $this->description . '</description>' . "\n"; 1167 } // end if 1168 1169 if (strlen($this->about) > 0) { 1170 $this->output .= (string) '<link>' . $this->about . '</link>' . "\n"; 1171 } // end if 1172 1173 if (strlen($this->title) > 0) { 1174 $this->output .= (string) '<title>' . $this->title . '</title>' . "\n"; 1175 } // end if 1176 1177 if (strlen($this->image_link) > 0) { 1178 $this->output .= (string) '<image>' . "\n"; 1179 $this->output .= (string) '<title>' . $this->title . '</title>' . "\n"; 1180 $this->output .= (string) '<url>' . $this->image_link . '</url>' . "\n"; 1181 $this->output .= (string) '<link>' . $this->about . '</link>' . "\n"; 1182 if (strlen($this->description) > 0) { 1183 $this->output .= (string) '<description>' . $this->description . '</description>' . "\n"; 1184 } // end if 1185 $this->output .= (string) '</image>' . "\n"; 1186 } // end if 1187 1188 if (strlen($this->publisher) > 0) { 1189 $this->output .= (string) '<managingEditor>' . $this->publisher . '</managingEditor>' . "\n"; 1190 } // end if 1191 1192 if (strlen($this->creator) > 0) { 1193 $this->output .= (string) '<webMaster>' . $this->creator . '</webMaster>' . "\n"; 1194 $this->output .= (string) '<generator>' . $this->creator . '</generator>' . "\n"; 1195 } // end if 1196 1197 if (strlen($this->language) > 0) { 1198 $this->output .= (string) '<language>' . $this->language . '</language>' . "\n"; 1199 } // end if 1200 1201 if (strlen($this->category) > 0) { 1202 $this->output .= (string) '<category>' . $this->category . '</category>' . "\n"; 1203 } // end if 1204 1205 if (strlen($this->cache) > 0) { 1206 $this->output .= (string) '<ttl>' . $this->cache . '</ttl>' . "\n"; 1207 } // end if 1208 1209 1210 // additional dc data 1211 if (strlen($this->publisher) > 0) { 1212 $this->output .= (string) '<dc:publisher>' . $this->publisher . '</dc:publisher>' . "\n"; 1213 } // end if 1214 1215 if (strlen($this->creator) > 0) { 1216 $this->output .= (string) '<dc:creator>' . $this->creator . '</dc:creator>' . "\n"; 1217 } // end if 1218 1219 if (strlen($this->date) > 0) { 1220 $this->output .= (string) '<dc:date>' .$this->date . '</dc:date>' . "\n"; 1221 } // end if 1222 1223 if (strlen($this->language) > 0) { 1224 $this->output .= (string) '<dc:language>' . $this->language . '</dc:language>' . "\n"; 1225 } // end if 1226 1227 if (strlen($this->rights) > 0) { 1228 $this->output .= (string) '<dc:rights>' . $this->rights . '</dc:rights>' . "\n"; 1229 } // end if 1230 1231 if (strlen($this->coverage) > 0) { 1232 $this->output .= (string) '<dc:coverage>' . $this->coverage . '</dc:coverage>' . "\n"; 1233 } // end if 1234 1235 if (strlen($this->contributor) > 0) { 1236 $this->output .= (string) '<dc:contributor>' . $this->contributor . '</dc:contributor>' . "\n"; 1237 } // end if 1238 1239 // additional SY data 1240 if (strlen($this->period) > 0) { 1241 $this->output .= (string) '<sy:updatePeriod>' . $this->period . '</sy:updatePeriod>' . "\n"; 1242 } // end if 1243 1244 if (strlen($this->frequency) > 0) { 1245 $this->output .= (string) '<sy:updateFrequency>' . $this->frequency . '</sy:updateFrequency>' . "\n"; 1246 } // end if 1247 1248 if (strlen($this->base) > 0) { 1249 $this->output .= (string) '<sy:updateBase>' . $this->base . '</sy:updateBase>' . "\n"; 1250 } // end if 1251 1252 if (count($this->getItemList()) > 0) { 1253 foreach ($this->getItemList() as $id) { 1254 $item =& $this->items[$id]; 1255 1256 if (strlen($item->getTitle()) > 0 && strlen($item->getLink()) > 0) { 1257 $this->output .= (string) '<item>' . "\n"; 1258 $this->output .= (string) '<title>' . $item->getTitle() . '</title>' . "\n"; 1259 $this->output .= (string) '<link>' . $item->getLink() . '</link>' . "\n"; 1260 1261 if (strlen($item->getDescription()) > 0) { 1262 $this->output .= (string) '<description>' . $item->getDescription() . '</description>' . "\n"; 1263 } // end if 1264 1265 if ($this->use_dc_data === TRUE && strlen($item->getSubject()) > 0) { 1266 $this->output .= (string) '<category>' . $item->getSubject() . '</category>' . "\n"; 1267 } // end if 1268 1269 if ($this->use_dc_data === TRUE && strlen($item->getDate()) > 0) { 1270 $this->output .= (string) '<pubDate>' . $item->getDate() . '</pubDate>' . "\n"; 1271 } // end if 1272 1273 if (strlen($item->getAbout()) > 0) { 1274 $this->output .= (string) '<guid>' . $item->getAbout() . '</guid>' . "\n"; 1275 } // end if 1276 1277 if (strlen($item->getAuthor()) > 0) { 1278 $this->output .= (string) '<author>' . $item->getAuthor() . '</author>' . "\n"; 1279 } // end if 1280 1281 if (strlen($item->getComments()) > 0) { 1282 $this->output .= (string) '<comments>' . $item->getComments() . '</comments>' . "\n"; 1283 } // end if 1284 1285 if (strlen($item->getImage()) > 0) { 1286 $this->output .= (string) '<im:image>' . $item->getImage() . '</im:image>' . "\n"; 1287 } // end if 1288 $this->output .= (string) '</item>' . "\n"; 1289 } // end if 1290 } // end foreach 1291 } // end if 1292 1293 $this->output .= (string) '</channel>' . "\n"; 1294 $this->output .= (string) '</rss>' . "\n"; 1295 } // end function 1296 1297 /** 1298 * creates the output 1299 * 1300 * @desc creates the output 1301 * @uses createOutputV090() 1302 * @uses createOutputV091() 1303 * @uses createOutputV200() 1304 * @uses createOutputV100() 1305 */ 1306 function createOutput($version = '') { 1307 if (strlen(trim($version)) === 0) { 1308 $version = (string) '1.0'; 1309 } // end if 1310 1311 switch ($version) { 1312 case '0.9': 1313 $this->createOutputV090(); 1314 break; 1315 case '0.91': 1316 $this->createOutputV091(); 1317 break; 1318 case '2.00': 1319 $this->createOutputV200(); 1320 break; 1321 case '1.0': 1322 default: 1323 $this->createOutputV100(); 1324 break; 1325 } // end switch 1326 } // end function 1327 /** 1328 * echos the output 1329 * 1330 * use this function if you want to directly output the rss stream 1331 * 1332 * @desc echos the output 1333 * @return void 1334 * @access public 1335 * @uses createOutput() 1336 */ 1337 function outputRSS($version = '') { 1338 if (!isset($this->output)) { 1339 $this->createOutput($version); 1340 } // end if 1341 1342 # Mantis: text/xml -> application/xml 1343 header ('content-type: application/xml'); 1344 header('Content-Disposition: inline; filename=rss_' . str_replace(' ','',$this->title) . '.xml'); 1345 $this->output = '<?xml version="1.0" encoding="' . $this->encoding . '"?>' . "\n" . 1346 '<!-- RSS generated by Flaimo.com RSS Builder [' . date('Y-m-d H:i:s') .'] --> ' . $this->output; 1347 echo $this->output; 1348 } // end function 1349 1350 /** 1351 * returns the output 1352 * 1353 * use this function if you want to have the output stream as a string (for example to write it in a cache file) 1354 * 1355 * @desc returns the output 1356 */ 1357 function getRSSOutput($version = '') { 1358 if (!isset($this->output)) { 1359 $this->createOutput($version); 1360 } // end if 1361 return (string) '<?xml version="1.0" encoding="' . $this->encoding . '"?>' . "\n" . 1362 '<!-- RSS generated by Flaimo.com RSS Builder [' . date('Y-m-d H:i:s') .'] --> ' . $this->output; 1363 } // end function 1364 /**#@-*/ 1365 } // end class RSSBuilder 1366 1367 //--------------------------------------------------------------------------- 1368 1369 /** 1370 * single rss item object 1371 * 1372 * Tested with WAMP (XP-SP1/1.3.27/4.0.12/4.3.2) 1373 * Last change: 2003-06-26 1374 * 1375 * @desc single rss item object 1376 * @access private 1377 * @author Michael Wimmer <flaimo@gmx.net> 1378 * @copyright Michael Wimmer 1379 * @link http://www.flaimo.com/ 1380 * @package RSSBuilder 1381 * @category FLP 1382 * @version 1.002 1383 */ 1384 class RSSItem extends RSSBase { 1385 1386 /*-------------------*/ 1387 /* V A R I A B L E S */ 1388 /*-------------------*/ 1389 1390 /**#@+ 1391 * @access private 1392 * @var string 1393 */ 1394 /** 1395 * URL 1396 * 1397 * @desc URL 1398 */ 1399 var $about; 1400 1401 /** 1402 * headline 1403 * 1404 * @desc headline 1405 */ 1406 var $title; 1407 1408 /** 1409 * URL to the full item 1410 * 1411 * @desc URL to the full item 1412 */ 1413 var $link; 1414 1415 /** 1416 * optional description 1417 * 1418 * @desc optional description 1419 */ 1420 var $description; 1421 1422 /** 1423 * optional subject (category) 1424 * 1425 * @desc optional subject (category) 1426 */ 1427 var $subject; 1428 1429 /** 1430 * optional date 1431 * 1432 * @desc optional date 1433 */ 1434 var $date; 1435 1436 /** 1437 * author of item 1438 * 1439 * @desc author of item 1440 * @since 1.001 - 2003-05-30 1441 */ 1442 var $author; 1443 1444 /** 1445 * url to comments page (rss 2.0) 1446 * 1447 * @desc url to comments page (rss 2.0) 1448 * @since 1.001 - 2003-05-30 1449 */ 1450 var $comments; 1451 1452 /** 1453 * imagelink for this item (mod_im only) 1454 * 1455 * @desc imagelink for this item (mod_im only) 1456 * @since 1.002 - 2003-06-26 1457 */ 1458 var $image; 1459 /**#@-*/ 1460 1461 /*-----------------------*/ 1462 /* C O N S T R U C T O R */ 1463 /*-----------------------*/ 1464 1465 /**#@+ 1466 * @access private 1467 * @return void 1468 */ 1469 /** 1470 * Constructor 1471 * 1472 * @desc Constructor 1473 * @param string $about URL 1474 * @param string $title 1475 * @param string $link URL 1476 * @param string $description (optional) 1477 * @param string $subject some sort of category (optional) 1478 * @param string $date format: 2003-05-29T00:03:07+0200 (optional) 1479 * @param string $author some sort of category author of item 1480 * @param string $comments url to comment page rss 2.0 value 1481 * @param string $image optional mod_im value for dispaying a different pic for every item 1482 * @uses setAbout() 1483 * @uses setTitle() 1484 * @uses setLink() 1485 * @uses setDescription() 1486 * @uses setSubject() 1487 * @uses setDate() 1488 * @uses setAuthor() 1489 * @uses setComments() 1490 * @uses setImage() 1491 */ 1492 function RSSItem($about = '', 1493 $title = '', 1494 $link = '', 1495 $description = '', 1496 $subject = '', 1497 $date = '', 1498 $author = '', 1499 $comments = '', 1500 $image = '') { 1501 $this->setAbout($about); 1502 $this->setTitle($title); 1503 $this->setLink($link); 1504 $this->setDescription($description); 1505 $this->setSubject($subject); 1506 $this->setDate($date); 1507 $this->setAuthor($author); 1508 $this->setComments($comments); 1509 $this->setImage($image); 1510 } // end constructor 1511 1512 1513 /** 1514 * Sets $about variable 1515 * 1516 * @desc Sets $about variable 1517 * @param string $about 1518 * @see $about 1519 */ 1520 function setAbout($about = '') { 1521 if (!isset($this->about) && strlen(trim($about)) > 0) { 1522 $this->about = (string) trim($about); 1523 } // end if 1524 } // end function 1525 1526 /** 1527 * Sets $title variable 1528 * 1529 * @desc Sets $title variable 1530 * @param string $title 1531 * @see $title 1532 */ 1533 function setTitle($title = '') { 1534 if (!isset($this->title) && strlen(trim($title)) > 0) { 1535 $this->title = (string) trim($title); 1536 } // end if 1537 } // end function 1538 1539 /** 1540 * Sets $link variable 1541 * 1542 * @desc Sets $link variable 1543 * @param string $link 1544 * @see $link 1545 */ 1546 function setLink($link = '') { 1547 if (!isset($this->link) && strlen(trim($link)) > 0) { 1548 $this->link = (string) trim($link); 1549 } // end if 1550 } // end function 1551 1552 /** 1553 * Sets $description variable 1554 * 1555 * @desc Sets $description variable 1556 * @param string $description 1557 * @see $description 1558 */ 1559 function setDescription($description = '') { 1560 if (!isset($this->description) && strlen(trim($description)) > 0) { 1561 $this->description = (string) trim($description); 1562 } // end if 1563 } // end function 1564 1565 /** 1566 * Sets $subject variable 1567 * 1568 * @desc Sets $subject variable 1569 * @param string $subject 1570 * @see $subject 1571 */ 1572 function setSubject($subject = '') { 1573 if (!isset($this->subject) && strlen(trim($subject)) > 0) { 1574 $this->subject = (string) trim($subject); 1575 } // end if 1576 } // end function 1577 1578 /** 1579 * Sets $date variable 1580 * 1581 * @desc Sets $date variable 1582 * @param string $date 1583 * @see $date 1584 */ 1585 function setDate($date = '') { 1586 if (!isset($this->date) && strlen(trim($date)) > 0) { 1587 $this->date = (string) trim($date); 1588 } // end if 1589 } // end function 1590 1591 /** 1592 * Sets $author variable 1593 * 1594 * @desc Sets $author variable 1595 * @param string $author 1596 * @see $author 1597 * @since 1.001 - 2003-05-30 1598 */ 1599 function setAuthor($author = '') { 1600 if (!isset($this->author) && strlen(trim($author)) > 0) { 1601 $this->author = (string) trim($author); 1602 } // end if 1603 } // end function 1604 1605 /** 1606 * Sets $comments variable 1607 * 1608 * @desc Sets $comments variable 1609 * @param string $comments 1610 * @see $comments 1611 * @since 1.001 - 2003-05-30 1612 */ 1613 function setComments($comments = '') { 1614 if (!isset($this->comments) && strlen(trim($comments)) > 0) { 1615 $this->comments = (string) trim($comments); 1616 } // end if 1617 } // end function 1618 1619 /** 1620 * Sets $image variable 1621 * 1622 * @desc Sets $image variable 1623 * @param string $image 1624 * @see $image 1625 * @since 1.002 - 2003-06-26 1626 */ 1627 function setImage($image = '') { 1628 if (!isset($this->image) && strlen(trim($image)) > 0) { 1629 $this->image = (string) trim($image); 1630 } // end if 1631 } // end function 1632 /**#@-*/ 1633 1634 /**#@+ 1635 * @access public 1636 */ 1637 /** 1638 * Returns $about variable 1639 * 1640 * @desc Returns $about variable 1641 * @return string $about 1642 * @see $about 1643 */ 1644 function getAbout() { 1645 return (string) $this->about; 1646 } // end function 1647 1648 /** 1649 * Returns $title variable 1650 * 1651 * @desc Returns $title variable 1652 * @return string $title 1653 * @see $title 1654 */ 1655 function getTitle() { 1656 return (string) $this->title; 1657 } // end function 1658 1659 /** 1660 * Returns $link variable 1661 * 1662 * @desc Returns $link variable 1663 * @return string $link 1664 * @see $link 1665 */ 1666 function getLink() { 1667 return (string) $this->link; 1668 } // end function 1669 1670 /** 1671 * Returns $description variable 1672 * 1673 * @desc Returns $description variable 1674 * @return string $description 1675 * @see $description 1676 */ 1677 function getDescription() { 1678 return (string) $this->description; 1679 } // end function 1680 1681 /** 1682 * Returns $subject variable 1683 * 1684 * @desc Returns $subject variable 1685 * @return string $subject 1686 * @see $subject 1687 */ 1688 function getSubject() { 1689 return (string) $this->subject; 1690 } // end function 1691 1692 /** 1693 * Returns $date variable 1694 * 1695 * @desc Returns $date variable 1696 * @return string $date 1697 * @see $date 1698 */ 1699 function getDate() { 1700 return (string) $this->date; 1701 } // end function 1702 1703 /** 1704 * Returns $author variable 1705 * 1706 * @desc Returns $author variable 1707 * @return string $author 1708 * @see $author 1709 * @since 1.001 - 2003-05-30 1710 */ 1711 function getAuthor() { 1712 return (string) $this->author; 1713 } // end function 1714 1715 /** 1716 * Returns $comments variable 1717 * 1718 * @desc Returns $comments variable 1719 * @return string $comments 1720 * @see $comments 1721 * @since 1.001 - 2003-05-30 1722 */ 1723 function getComments() { 1724 return (string) $this->comments; 1725 } // end function 1726 1727 /** 1728 * Returns $image variable 1729 * 1730 * @desc Returns $image variable 1731 * @return string $image 1732 * @see $image 1733 * @since 1.002 - 2003-06-26 1734 */ 1735 function getImage() { 1736 return (string) $this->image; 1737 } // end function 1738 /**#@-*/ 1739 } // end class RSSItem 1740 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Thu Nov 29 09:42:17 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |