Channels.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?PHP
  2. /*
  3. OmnomIRC COPYRIGHT 2010,2011 Netham45
  4. This file is part of OmnomIRC.
  5. OmnomIRC 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. OmnomIRC is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with OmnomIRC. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. include("Source/sign.php");
  17. //Set the channels here.
  18. //$channels[]=Array("#channel",AlwaysShow);
  19. $channels=Array();
  20. $channels[]=Array("#main",true);//Default chan, 'cause it's the first in the array.
  21. $exChans=Array();
  22. $exChans[]=Array("#main2",false);
  23. ?>
  24. <?PHP
  25. if (!isset($IRCBOT))
  26. {
  27. //Output for Javascript.
  28. header('Content-type: text/javascript');
  29. $chanStr = "";
  30. foreach ($channels as $chan)
  31. if ($chan[1])$chanStr = $chanStr . '"'.base64_url_encode($chan[0]).'",';
  32. $chanStr = substr($chanStr,0,-1);
  33. echo "var channels=[";
  34. echo $chanStr;
  35. echo "];";
  36. $exChanStr = "";
  37. foreach ($channels as $chan)
  38. if (!$chan[1])$exChanStr = $exChanStr . '"'.base64_url_encode($chan[0]).'",';
  39. $exChanStr = substr($exChanStr,0,-1);
  40. echo "var exChannels=[";
  41. echo $exChanStr;
  42. echo "];";
  43. }
  44. else
  45. {
  46. //Output for PHP
  47. $chanStr = "";
  48. foreach ($exChans as $chan)
  49. $channels[] = $chan;
  50. foreach ($channels as $chan)
  51. $chanStr = $chanStr .$chan[0].',';
  52. $chanStr = substr($chanStr,0,-1);
  53. }
  54. ?>