[ PHPXref.com ] [ Generated: Sun Jul 20 16:35:25 2008 ] [ bBlog 0.7.6 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/bblog/bBlog_plugins/ -> admin.rss.php (source)

   1  <?php
   2  // admin.rss.php - administer rss
   3  function identify_admin_rss () {
   4  $help = '
   5  <p>
   6  <i>function </i><b>Get RSS</b><br>
   7  </p>
   8  <p><b><i>example: </b></i>{getrss} - select random RSS Feed<br>
   9  <p><b><i>example: </b></i>{getrss id=1} - select defined RSS Feed
  10  </p>';
  11  
  12  return array (
  13      'name'           =>'rss',
  14      'type'             =>'admin',
  15      'nicename'     =>'RSS Fetcher',
  16      'description'   =>'Edit RSS Feeds',
  17      'authors'        =>'Martin Konicek <martin.konicek@atlas.cz>',
  18      'licence'         =>'GPL',
  19      'template'     => 'rss.html',
  20      'help'        => $help
  21    );
  22  }
  23  
  24  
  25  function admin_plugin_rss_run(&$bBlog) {
  26  
  27      $pole = "";
  28      for($i=1; $i<10; $i++) 
  29      {
  30          if ((isset($_POST['sending'])) && ($_POST['sending']=="true"))
  31          {
  32              $id = $_POST[id.$i];
  33              $ch = $_POST[ch.$i];
  34              $update_query = "UPDATE ".T_RSS." SET `url` = '".$id."',`input_charset` = '".$ch."' WHERE `id` = '".$i."' LIMIT 1 ;";
  35              $bBlog->query($update_query);
  36          }
  37  
  38          $query = "select * from ".T_RSS." where id=".$i.";";
  39          $row = $bBlog->get_row($query);
  40          $rssurl = $row->url;
  41          $w1250 = "";
  42          if ($row->input_charset=="W1250") {$w1250=" selected";}
  43          $utf8 = "";        
  44          if ($row->input_charset=="UTF8") {$utf8=" selected";}
  45  
  46          if ($i / 2 == floor($i /2)) $class = 'high';
  47          else $class = 'low';
  48  
  49          $pole.='<tr class="'.$class.'"><td>'.$i.'</td><td><input type="text" name="id'.$i.'" size="20" value="'.$rssurl.'" class="text" /></td><td><select name="ch'.$i.'">';
  50          $pole.='<option>I88592</option>';
  51          $pole.='<option'.$w1250.'>W1250</option>';
  52          $pole.='<option'.$utf8.'>UTF8</option>';
  53          $pole.='</select></td></tr>';
  54      }
  55  
  56      $bBlog->assign('pole',$pole);
  57  }
  58  ?>


[ Powered by PHPXref - Served by Debian GNU/Linux ]