[ PHPXref.com ] [ Generated: Sun Jul 20 20:57:59 2008 ] [ vtiger Forums 1.1 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/ -> vtcrm_topicsanywhere.php (source)

   1  <?php
   2  /***************************************************************************
   3   *                            topics_anywhere.php
   4   *                            -------------------
   5   *   begin                : Wednesday, Aug 28, 2002
   6   *   copyright            : (C) 2001 The phpBB Group
   7   *   email                : support@phpbb.com
   8   *
   9   *   $Id: vtcrm_topicsanywhere.php,v 1.1 2004/10/14 10:50:44 isaac Exp $
  10   *
  11   ***************************************************************************/
  12  
  13  /***************************************************************************
  14   *
  15   *   This program is free software; you can redistribute it and/or modify
  16   *   it under the terms of the GNU General Public License as published by
  17   *   the Free Software Foundation; either version 2 of the License, or
  18   *   (at your option) any later version.
  19   *
  20   ***************************************************************************/
  21  
  22  //
  23  // Config Section
  24  //
  25  
  26  // Who may view the Topics Anywhere setup page and generate scripts to copy and paste?
  27  // Everybody: 0
  28  // Administrators only: 1
  29  // Moderators only: 2
  30  // Administrators and moderators: 3
  31  // All registered users: 4
  32  $topics_anywhere_authlevel = 0;
  33  
  34  // By default, only public forums are shown in the picklist. If you want, you can let
  35  // Topics Anywhere show all forums in the picklist (this is including private and hidden forums).
  36  // To do this, change 'true' to 'false' below.
  37  // You can still exclude specific forums from the picklist by changing next config option.
  38  $public_only = true;
  39  
  40  // Don't show following forums in the picklist on the setup page.
  41  // This is an array of numbers which are the forum ID's.
  42  // For example use "$hide_forums = array(1, 5, 10);" to hide forums with ID 1, 5 and 10
  43  // Leave the array empty (as below) to show all the forums.
  44  // Note: it is never possible to let Topics Anywhere show topics from excluded forums,
  45  // not even by modifying the URL generated by Topics Anywhere.
  46  $hide_forums = array();
  47  
  48  // You can change the format of date and time here...
  49  // For American type dates you probably want to use the other array below
  50  // You can also make your own formats, as long as you use the syntax of PHP's function date()
  51  // Of course, do not add or remove any quotes! (unless escaped)
  52  $date_formats = array('d/m/y', 'd/m/Y', 'd/m/Y H:i:s', 'D d-M-y', 'D d-M-Y', 'D d-M-Y H:i:s', 'l j F Y', 'l j F Y H:i:s');
  53  
  54  // Some American style date formats - to enable them uncomment following line by removing the '// '
  55  // $date_formats = array('m/d/y', 'm/d/Y', 'm/d/Y g:i:s A', 'D M d, y', 'D M d, Y', 'D M d, Y g:i:s A', 'l, F jS, Y', 'l, F jS, Y g:i:s A');
  56  
  57  // Array of possible bullets
  58  // You can add your own bullets if you want.
  59  // Do not add or remove any quotes! (unless escaped)
  60  $bullets = array('-', '+', '&gt;', '&#155;', '&#187;', '°', '*');
  61  
  62  //
  63  // End of Config Section - nothing needs to be modified below...
  64  //
  65  
  66  define('IN_PHPBB', true);
  67  
  68  $phpbb_root_path = './';
  69  
  70  include ($phpbb_root_path . 'extension.inc');
  71  include($phpbb_root_path . 'common.'.$phpEx);
  72  
  73  include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_main.' . $phpEx);
  74  include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_topics_anywhere.' . $phpEx);
  75  
  76  $server_protocol = ($board_config['cookie_secure']) ? 'https://' : 'http://';
  77  $server_name = preg_replace('#^\/?(.*?)\/?$#', '\1', trim($board_config['server_name']));
  78  $server_port = ($board_config['server_port'] <> 80) ? ':' . trim($board_config['server_port']) : '';
  79  $script_location = preg_replace('#^\/?(.*?)\/?$#', '\1', trim($board_config['script_path']));
  80  $script_location = ($script_location == '') ? $script_location : '/' . $script_location;
  81  
  82  $full_url = $server_protocol . $server_name . $server_port . $script_location;
  83  
  84  //
  85  // Start session management
  86  //
  87  $userdata = session_pagestart($user_ip, PAGE_INDEX);
  88  init_userprefs($userdata);
  89  //
  90  // End session management
  91  //
  92  
  93  $lang['Topics_anywhere'] = 'Topics Anywhere';
  94  
  95  define('TA_SCRIPT_NAME', 'vtcrm_topicsanywhere');
  96  define('TA_VERSION', '1.11.0');
  97  
  98  $lastpostby_formats = array($lang['Username'], $lang['Lastpost_from'] . ' ' . $lang['Username']);
  99  
 100  // General functions
 101  function output_die($msg)
 102  {
 103      global $out, $phpEx, $full_url, $version;
 104  
 105      $error = true;
 106  
 107      if ($out == 'js')
 108      {
 109          if (is_array($msg))
 110          {
 111              $output = implode('<br>', $msg);
 112          }
 113          else
 114          {
 115              $output = $msg;
 116          }
 117  
 118          $output = '<b>' . $output . '<br>' . sprintf($lang['Error'], TA_SCRIPT_NAME . $phpEx) . '</b><br><br>TA_VERSION ' . TA_VERSION;
 119          exit("document.writeln('$output');\n");
 120      }
 121      else if ($out == 'rss')
 122      {
 123          $output = generate_rss_header($version);
 124  
 125          $link = ($version == '0.91') ? substr($full_url, 0, 500) : $full_url;
 126  
 127          if (is_array($msg))
 128          {
 129              while ($error = array_shift($msg))
 130              {
 131                  $output .= '<item>' . "\n";;
 132                  $output .= '<title>' . $error . '</title>' . "\n";
 133                  $output .= '<link>' . $link . '</link>' . "\n";
 134                  $output .= '<description>' . sprintf($lang['Error'], TA_SCRIPT_NAME . $phpEx) . ' (TA_VERSION ' . TA_VERSION . ')</description>' . "\n";
 135                  $output .= '</item>' . "\n";
 136              }
 137          }
 138          else
 139          {
 140              $output .= '<item>' . "\n";;
 141              $output .= '<title>' . $msg . '</title>' . "\n";
 142              $output .= '<link>' . $link . '</link>' . "\n";
 143              $output .= '<description>' . sprintf($lang['Error'], TA_SCRIPT_NAME . $phpEx) . ' (TA_VERSION ' . TA_VERSION . ')</description>' . "\n";
 144              $output .= '</item>' . "\n";
 145          }
 146  
 147          $output .= generate_rss_footer();
 148  
 149          header("Content-type: text/xml");
 150          exit($output);
 151      }
 152  }
 153  
 154  function forum_select() // generates select of all available forums (modified make_jumpbox()-function)
 155  {
 156      global $template, $lang, $db, $SID, $nav_links, $phpEx, $hide_forums;
 157  
 158      $sql = "SELECT c.cat_id, c.cat_title, c.cat_order
 159          FROM " . CATEGORIES_TABLE . " c, " . FORUMS_TABLE . " f
 160          WHERE f.cat_id = c.cat_id
 161          GROUP BY c.cat_id, c.cat_title, c.cat_order
 162          ORDER BY c.cat_order";
 163      if ( !($result = $db->sql_query($sql)) )
 164      {
 165          message_die(GENERAL_ERROR, "Couldn't obtain category list.", "", __LINE__, __FILE__, $sql);
 166      }
 167  
 168      $category_rows = array();
 169      while ( $row = $db->sql_fetchrow($result) )
 170      {
 171          $category_rows[] = $row;
 172      }
 173  
 174      if ( $total_categories = count($category_rows) )
 175      {
 176          $sql = "SELECT *
 177              FROM " . FORUMS_TABLE . "
 178              ORDER BY cat_id, forum_order";
 179          if ( !($result = $db->sql_query($sql)) )
 180          {
 181              message_die(GENERAL_ERROR, 'Could not obtain forums information', '', __LINE__, __FILE__, $sql);
 182          }
 183  
 184          $forum_rows = array();
 185          while ( $row = $db->sql_fetchrow($result) )
 186          {
 187              $forum_rows[] = $row;
 188          }
 189  
 190          $boxstring = '<select multiple name="' . POST_FORUM_URL . '[]" size=6>';
 191  
 192          if ( $total_forums = count($forum_rows) )
 193          {
 194              for($i = 0; $i < $total_categories; $i++)
 195              {
 196                  $boxstring_forums = '';
 197                  for($j = 0; $j < $total_forums; $j++)
 198                  {
 199                      if ( $forum_rows[$j]['cat_id'] == $category_rows[$i]['cat_id'])
 200                      {
 201                          if (!in_array($forum_rows[$j]['forum_id'], $hide_forums))
 202                          {
 203                              $boxstring_forums .=  '<option value="' . $forum_rows[$j]['forum_id'] . '">' . $forum_rows[$j]['forum_name'] . '</option>';
 204                          }
 205                      }
 206                  }
 207  
 208                  if ( $boxstring_forums != '')
 209                  {
 210                      if ($i != 0)
 211                      {
 212                          $boxstring .= '<option value="-1">&nbsp;</option>';
 213                      }
 214                      $boxstring .= '<option value="cat' . $category_rows[$i]['cat_id'] . '">' . $category_rows[$i]['cat_title'] . '</option>';
 215                      $boxstring .= '<option value="-1">----------------</option>';
 216                      $boxstring .= $boxstring_forums;
 217                  }
 218              }
 219          }
 220  
 221          $boxstring .= '</select>';
 222      }
 223      else
 224      {
 225          $boxstring .= '<select multiple name="' . POST_FORUM_URL . '[]" size=1></select>';
 226      }
 227      $data = array($boxstring, $total_forums);
 228      return $data;
 229  }
 230  
 231  function bullet_select($bullets) // generates select of all available bullets from array $bullets
 232  {
 233      global $lang;
 234      $select = '<select name="bullet_type">';
 235      $select .= '<option value="non">' . $lang['None'] . '</option>';
 236      $select .= '<option value="dis">HTML ' . $lang['disc'] . '</option>';
 237      $select .= '<option value="cir">HTML ' . $lang['circle'] . '</option>';
 238      $select .= '<option value="squ">HTML ' . $lang['square'] . '</option>';
 239      $select .= '<option value="num">HTML ' . $lang['numbered'] . '</option>';
 240      for ($i = 0; $i < count($bullets); $i++)
 241      {
 242          $select .= '<option value="' . $i . '">' . $bullets[$i] . '</option>';
 243      }
 244      $select .= '</select>';
 245      return $select;
 246  }
 247  
 248  function lastpostby_select($lastpostby_formats) // generates select of "last post by" text formats
 249  {
 250      global $lang;
 251      $select = '<select name="lastpostby_format">';
 252      for ($i = 0; $i < count($lastpostby_formats); $i++)
 253      {
 254          $select .= '<option value="' . $i . '">' . $lastpostby_formats[$i] . '</option>';
 255      }
 256      $select .= '</select>';
 257      return $select;
 258  }
 259  
 260  function lastpostdate_select($date_formats) // generates select of date formats from array $dateformats
 261  {
 262      global $lang;
 263      $now = time();
 264      $select = '<select name="lastpostdate_format">';
 265      for ($i = 0; $i < count($date_formats); $i++)
 266      {
 267          $select .= '<option value="' . $i . '">' . create_date($date_formats[$i], $now, $board_config['board_timezone']) . '</option>';
 268      }
 269      $select .= '</select>';
 270      return $select;
 271  }
 272  
 273  function output_select()
 274  {
 275      $select = '<select name="out">';
 276      $select .= '<option value="js">JavaScript</option>';
 277      $select .= '<option value="rss0.91">RSS 0.91</option>';
 278      $select .= '<option value="rss2.0">RSS 2.0</option>';
 279      $select .= '</select>';
 280      return $select;
 281  }
 282  
 283  function show_the_page()
 284  {
 285      global $template, $lang, $db, $SID, $nav_links, $phpEx, $phpbb_root_path, $theme, $images, $date_formats, $lastpostby_formats, $bullets, $board_config, $full_url;
 286  
 287      $page_title = $lang['Topics_anywhere'];
 288  
 289      include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_admin.' . $phpEx);
 290  
 291      include($phpbb_root_path . 'includes/page_header.'.$phpEx);
 292  
 293      $template->set_filenames(array(
 294          'body' => 'topics_anywhere_body.tpl')
 295      );
 296  
 297      $outputarray = forum_select();
 298  
 299      if ($board_config['allow_html'])
 300      {
 301          $html_allowed_append = ' (' . strip_tags($lang['HTML_is_ON']) . ' - ' . $lang['Allowed_tags'] . ': &lt;' . str_replace(',', '&gt;, &lt;', $board_config['allow_html_tags']) . '&gt;)';
 302      }
 303      else
 304      {
 305          $html_allowed_append = ' (' . strip_tags($lang['HTML_is_OFF']) . ')';
 306      }
 307  
 308      $template->assign_vars(array(
 309          'L_TOPICS_ANYWHERE' => $lang['Topics_anywhere'] . ' ' . TA_VERSION,
 310          'L_TOPICS_ANYWHERE_EXPLAIN' => $lang['Topics_anywhere_explain'] . ' ' . $lang['Topics_anywhere_explain_more'],
 311          'L_OUTPUT' => $lang['Output'],
 312          'L_OUTPUT_EXPLAIN' => $lang['Output_explain'],
 313          'OUTPUT_SELECT' => output_select($languages, $langs),
 314          'L_SELECT_FORUM' => $lang['Forum_select'] . $lang['Category_select'],
 315          'L_SELECT_FORUM_EXPLAIN' => $lang['Select_forum_explain'] . $lang['Category_explain'],
 316          'SELECT_FORUM_SELECT' => $outputarray[0],
 317          'L_OR' => $lang['Or'],
 318          'L_CHECK_ALLFORA' => $lang['All_available'],
 319          'L_AMOUNT_TOPICS' => $lang['Amount_topics'],
 320          'L_AMOUNT_TOPICS_EXPLAIN' => $lang['Amount_topics_explain'],
 321          'L_TOPICS_LIFESPAN' => $lang['Topics_lifespan'],
 322          'L_TOPICS_LIFESPAN_EXPLAIN' => $lang['Topics_lifespan_explain'],
 323          'L_TOPICS_LIFESPAN_NOREPLY' => $lang['Topics_lifespan_noreply'],
 324          'L_TOPICS_LIFESPAN_STARTDATE' => $lang['Topics_lifespan_startdate'],
 325          'L_HOURS' => strtolower($lang['Hours']),
 326          'L_DAYS' => strtolower($lang['Days']),
 327          'L_JUMP_LAST_POST' => $lang['Url_last_post'],
 328          'L_JUMP_LAST_POST_EXPLAIN' => $lang['Url_last_post_explain'],
 329          'L_SHOW_FORUM_NAME' => $lang['Show_forum_name'],
 330          'L_SHOW_FORUM_NAME_EXPLAIN' => $lang['Show_forum_name_explain'],
 331          'L_LINK_FORUM_NAME' => $lang['Link_forum_name'],
 332          'L_LINK_FORUM_NAME_EXPLAIN' => $lang['Link_forum_name_explain'] . ' (*)',
 333          'L_SHOW_REPLIES' => $lang['Show_replies'],
 334          'L_SHOW_REPLIES_EXPLAIN' => $lang['Show_replies_explain'],
 335          'L_SHOW_REPLIES_WORD' => $lang['Show_replies_word'],
 336          'L_SHOW_REPLIES_WORD_EXPLAIN' => $lang['Show_replies_word_explain'],
 337          'L_SHOW_ANNOUNCEMENTS' => $lang['Show_announce'],
 338          'L_SHOW_STICKYS' => $lang['Show_sticky'],
 339          'L_SHOW_LOCKED' => $lang['Show_locked'],
 340          'L_SHOW_MOVED' => $lang['Show_moved'],
 341          'L_SHOW_REGULAR' => $lang['Show_regular'],
 342          'L_HIDE_LABELS' => $lang['Hide_labels'],
 343          'L_HIDE_LABELS_EXPLAIN' => $lang['Hide_labels_explain'],
 344          'O_ANNOUNCEMENT' => strip_tags($lang['Topic_Announcement']),
 345          'O_STICKY' => strip_tags($lang['Topic_Sticky']),
 346          'O_MOVED' => strip_tags($lang['Topic_Moved']),
 347          'O_POLL' => strip_tags($lang['Topic_Poll']),
 348          'O_LOCKED' => strip_tags($lang['Topic_Locked']),
 349          'L_SORT_ORDER' => $lang['Sort_order'],
 350          'L_SORT_ORDER_EXPLAIN' => $lang['Sort_order_explain'],
 351          'O_PRIORITY' => $lang['Priority'],
 352          'O_ON_DATE' => $lang['On_date'],
 353          'L_BULLET_TYPE' => $lang['Bullet_type'],
 354          'L_BULLET_TYPE_EXPLAIN' => $lang['Bullet_type_explain'] . ' (*)',
 355          'BULLET_TYPE_SELECT' => bullet_select($bullets),
 356          'L_SHOW_LASTPOSTBY' => $lang['Show_lastpostby'],
 357          'L_SHOW_LASTPOSTBY_EXPLAIN' => $lang['Show_lastpostby_explain'],
 358          'L_LASTPOSTBY_FORMAT' => $lang['Lastpostby_format'],
 359          'L_LASTPOSTBY_FORMAT_EXPLAIN' => $lang['Lastpostby_format_explain'],
 360          'LASTPOSTBY_FORMAT_SELECT' => lastpostby_select($lastpostby_formats),
 361          'L_SHOW_LASTPOSTDATE' => $lang['Show_lastpostdate'],
 362          'L_SHOW_LASTPOSTDATE_EXPLAIN' => $lang['Show_lastpostdate_explain'],
 363          'L_LASTPOSTDATE_FORMAT' => $lang['Lastpostdate_format'],
 364          'L_LASTPOSTDATE_FORMAT_EXPLAIN' => $lang['Lastpostdate_format_explain'],
 365          'LASTPOSTDATE_FORMAT_SELECT' => lastpostdate_select($date_formats),
 366          'L_SHOW_LASTPOSTICON' => $lang['Show_lastposticon'],
 367          'L_SHOW_LASTPOSTICON_EXPLAIN' => $lang['Show_lastposticon_explain'] . ' (*)',
 368          'L_LASTPOSTICON_AS_BULLET' => $lang['Lastposticon_as_bullet'],
 369          'L_LASTPOSTICON_AS_BULLET_EXPLAIN' => $lang['Lastposticon_as_bullet_explain'] . ' (*)',
 370          'L_ADD_BREAK' => $lang['Add_break'],
 371          'L_ADD_BREAK_EXPLAIN' => $lang['Add_break_explain'] . ' (*)',
 372          'L_ADD_BLANK_LINE' => $lang['Add_blank_line'],
 373          'L_ADD_BLANK_LINE_EXPLAIN' => $lang['Add_blank_line_explain'] . ' (*)',
 374          'L_LIMIT_LENGTH' => $lang['Limit_title_length'],
 375          'L_LIMIT_LENGTH_EXPLAIN' => $lang['Limit_title_length_explain'],
 376          'L_LIMIT_WHERE' => $lang['Limit_title_where'],
 377          'L_LIMIT_WHERE_EXPLAIN' => $lang['Limit_title_where_explain'],
 378          'L_PREVIOUS_SPACE' => $lang['Limit_title_previous_space'],
 379          'L_EXACT' => $lang['Limit_title_exact'],
 380          'L_NEXT_SPACE' => $lang['Limit_title_next_space'],
 381          'L_CSS_LINK' => $lang['CSS_link'],
 382          'L_CSS_LINK_EXPLAIN' => $lang['CSS_link_explain'] . ' (*)',
 383          'L_CSS_TEXT' => $lang['CSS_text'],
 384          'L_CSS_TEXT_EXPLAIN' => $lang['CSS_text_explain'] . ' (*)',
 385          'L_TARGET_LINK' => $lang['Target_link'],
 386          'L_TARGET_LINK_EXPLAIN' => $lang['Target_link_explain'] . ' (*)',
 387          'L_ADV_FORM' => $lang['Advanced_formatter'],
 388          'L_ADV_FORM_EXPLAIN' => $lang['Advanced_formatter_explain'],
 389          'L_ADV_FORM_STRING' => $lang['Advanced_formatter_string'],
 390          'L_ADV_FORM_STRING_EXPLAIN' => $lang['Advanced_formatter_string_explain'],
 391          'L_ADV_FORM_DEFAULT' => '§lbl§ §tt§ §fn§ §rep§ - §lpa§, §lpt§ §lpi§',
 392          'L_ADV_FORM_VARS' => $lang['Advanced_formatter_variables'] . '<br /><br />' . $lang['Advanced_formatter_variables_extra'] . $html_allowed_append,
 393          'L_YES' => $lang['Yes'],
 394          'L_NO' => $lang['No'],
 395          'L_SUBMIT' => $lang['Submit'],
 396          'L_RESET' => $lang['Reset'],
 397          'H_TOTAL_FORUMS' => $outputarray[1],
 398          'S_FORM_ACTION' => append_sid(TA_SCRIPT_NAME . ".$phpEx?mode=generate"))
 399      );
 400  
 401      $template->pparse('body');
 402  
 403      include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
 404  }
 405  
 406  function generate_rss_header($version)
 407  {
 408      global $db, $lang, $board_config, $full_url;
 409  
 410      $sql = "SELECT template_name
 411          FROM " . THEMES_TABLE . "
 412          WHERE themes_id = " . $board_config['default_style'];
 413      if ( !($result = $db->sql_query($sql)) )
 414      {
 415          message_die(CRITICAL_ERROR, 'Could not query database for theme info');
 416      }
 417  
 418      if ( !($row = $db->sql_fetchrow($result)) )
 419      {
 420          message_die(CRITICAL_ERROR, "Could not get theme data for themes_id [$style]");
 421      }
 422  
 423      $dir = $row['template_name'];
 424  
 425      $langs = array('albanian', 'arabic', 'bulgarian', 'catalan', 'chinese_simplified', 'chinese_traditional', 'croatian', 'czech', 'danish', 'dutch', 'english', 'finnish', 'french', 'galego', 'german', 'german_sie', 'greek', 'hebrew', 'hungarian', 'icelandic', 'indonesian', 'italian', 'japanese', 'korean', 'kurdish', 'lithuanian', 'macedonian', 'norwegian', 'polish', 'portuguese', 'portuguese_brazil', 'romanian', 'romanian_no_diacritics', 'russian', 'russian_tu', 'serbian', 'slovak', 'slovenian', 'spanish', 'spanish_argentina', 'swedish', 'thai', 'turkish', 'ukrainian', 'welsh');
 426      $codes = array('SQ', 'AR', 'BG', 'CA', 'ZH-CN', 'ZH-TW', 'HR', 'CS', 'DA', 'NL', 'EN', 'FI', 'FR', 'GL', 'DE', 'DE', 'EL', 'HE', 'HU', 'IS', 'ID', 'IT', 'JA', 'KO', 'KU', 'LT', 'MK', 'NO', 'PL', 'PT', 'PT-BR', 'RO', 'RO', 'RU', 'RU', 'SR', 'SK', 'SL', 'ES', 'ES-AR', 'SV', 'TH', 'TR', 'UK', 'CY');
 427  
 428      if (($index = array_search($board_config['default_lang'], $langs)) !== FALSE) {
 429          $langcode = strtolower($codes[$index]);
 430      }
 431      else
 432      {
 433          $langcode = 'en';
 434      }
 435  
 436      unset($langs, $codes, $index);
 437  
 438      $title = ($version == '0.91') ? substr($board_config['sitename'], 0, 100) : $board_config['sitename'];
 439      $link = ($version == '0.91') ? substr($full_url, 0, 500) : $full_url;
 440      $description = ($version == '0.91') ? substr($board_config['site_desc'], 0, 500) : $board_config['site_desc'];
 441      $url = ($version == '0.91') ? substr(($full_url . '/templates/' . $dir . '/images/logo_phpBB.gif'), 0, 500) : ($full_url . '/templates/' . $dir . '/images/logo_phpBB.gif');
 442      $copy = ($version == '0.91') ? substr(('Copyright ' . date('Y', $board_config['board_startdate']) . '-' . date('Y') . ', ' . $board_config['sitename']), 0, 100) : ('Copyright ' . date('Y', $board_config['board_startdate']) . '-' . date('Y') . ', ' . $board_config['sitename']);
 443      $mail = ($version == '0.91') ? substr($board_config['board_email'], 0, 100) : $board_config['board_email'];
 444      $docs = ($version == '0.91') ? 'http://backend.userland.com/stories/rss091' : 'http://blogs.law.harvard.edu/tech/rss';
 445      $date = date('r');
 446  
 447      $output = '<?xml version="1.0" encoding="' . $lang['ENCODING'] . '" ?>' . "\n";
 448      $output .= '<rss version="' . $version . '">' . "\n";
 449      $output .= '<channel>' . "\n";
 450      $output .= '<title>' . $title . '</title>' . "\n";
 451      $output .= '<link>' . $link . '</link>' . "\n";
 452      $output .= '<description>' . $description . '</description>' . "\n";
 453      $output .= '<language>' . $langcode . '</language>' . "\n";
 454      $output .= '<managingEditor>' . $mail . '</managingEditor>' . "\n";
 455      $output .= '<webMaster>' . $mail . '</webMaster>' . "\n";
 456      $output .= '<pubDate>' . $date . '</pubDate>' . "\n";
 457      $output .= '<lastBuildDate>' . $date . '</lastBuildDate>' . "\n";
 458      $output .= '<copyright>' . $copy . '</copyright>' . "\n";
 459  
 460      if ($version == '2.0')
 461      {
 462          $output .= '<generator>' . $lang['Topics_anywhere'] . ' ' . TA_VERSION . '</generator>' . "\n";
 463      }
 464  
 465      $output .= '<docs>' . $docs . '</docs>' . "\n";
 466  
 467      $output .= '<image>' . "\n";
 468      $output .= '<url>' . $url . '</url>' . "\n";
 469      $output .= '<title>' . $title . '</title>' . "\n";
 470      $output .= '<link>' . $link . '</link>' . "\n";
 471      $output .= '</image>' . "\n";
 472  
 473      return $output;
 474  }
 475  
 476  function generate_rss_footer()
 477  {
 478      $output = '</channel>' . "\n";
 479      $output .= '</rss>' . "\n";
 480  
 481      return $output;
 482  }
 483  
 484  if ($public_only) // adds all non-public forum id's to the