| 
      1
     | 
    
      <?php
 
     | 
  
  
    | 
      2
     | 
    
      
 
     | 
  
  
    | 
      3
     | 
    
      // $Id: modify_group.php 915 2009-01-21 19:27:01Z Ruebenwurzel $
 
     | 
  
  
    | 
      4
     | 
    
      
 
     | 
  
  
    | 
      5
     | 
    
      /*
 
     | 
  
  
    | 
      6
     | 
    
      
 
     | 
  
  
    | 
      7
     | 
    
       Website Baker Project <http://www.websitebaker.org/>
 
     | 
  
  
    | 
      8
     | 
    
       Copyright (C) 2004-2009, Ryan Djurovich
 
     | 
  
  
    | 
      9
     | 
    
      
 
     | 
  
  
    | 
      10
     | 
    
       Website Baker is free software; you can redistribute it and/or modify
 
     | 
  
  
    | 
      11
     | 
    
       it under the terms of the GNU General Public License as published by
 
     | 
  
  
    | 
      12
     | 
    
       the Free Software Foundation; either version 2 of the License, or
 
     | 
  
  
    | 
      13
     | 
    
       (at your option) any later version.
 
     | 
  
  
    | 
      14
     | 
    
      
 
     | 
  
  
    | 
      15
     | 
    
       Website Baker is distributed in the hope that it will be useful,
 
     | 
  
  
    | 
      16
     | 
    
       but WITHOUT ANY WARRANTY; without even the implied warranty of
 
     | 
  
  
    | 
      17
     | 
    
       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
     | 
  
  
    | 
      18
     | 
    
       GNU General Public License for more details.
 
     | 
  
  
    | 
      19
     | 
    
      
 
     | 
  
  
    | 
      20
     | 
    
       You should have received a copy of the GNU General Public License
 
     | 
  
  
    | 
      21
     | 
    
       along with Website Baker; if not, write to the Free Software
 
     | 
  
  
    | 
      22
     | 
    
       Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     | 
  
  
    | 
      23
     | 
    
      
 
     | 
  
  
    | 
      24
     | 
    
      */
 
     | 
  
  
    | 
      25
     | 
    
      
 
     | 
  
  
    | 
      26
     | 
    
      require('../../config.php');
     | 
  
  
    | 
      27
     | 
    
      
 
     | 
  
  
    | 
      28
     | 
    
      // Get id
 
     | 
  
  
    | 
      29
     | 
    
      if(!isset($_GET['group_id']) OR !is_numeric($_GET['group_id'])) {
     | 
  
  
    | 
      30
     | 
    
      	header("Location: ".ADMIN_URL."/pages/index.php");
     | 
  
  
    | 
      31
     | 
    
      	exit(0);
 
     | 
  
  
    | 
      32
     | 
    
      } else {
     | 
  
  
    | 
      33
     | 
    
      	$group_id = $_GET['group_id'];
 
     | 
  
  
    | 
      34
     | 
    
      }
 
     | 
  
  
    | 
      35
     | 
    
      
 
     | 
  
  
    | 
      36
     | 
    
      // Include WB admin wrapper script
 
     | 
  
  
    | 
      37
     | 
    
      require(WB_PATH.'/modules/admin.php');
 
     | 
  
  
    | 
      38
     | 
    
      
 
     | 
  
  
    | 
      39
     | 
    
      // Get header and footer
 
     | 
  
  
    | 
      40
     | 
    
      $query_content = $database->query("SELECT * FROM ".TABLE_PREFIX."mod_news_groups WHERE group_id = '$group_id'");
     | 
  
  
    | 
      41
     | 
    
      $fetch_content = $query_content->fetchRow();
 
     | 
  
  
    | 
      42
     | 
    
      
 
     | 
  
  
    | 
      43
     | 
    
      ?>
 
     | 
  
  
    | 
      44
     | 
    
      
 
     | 
  
  
    | 
      45
     | 
    
      <h2><?php echo $TEXT['ADD'].'/'.$TEXT['MODIFY'].' '.$TEXT['GROUP']; ?></h2>
 
     | 
  
  
    | 
      46
     | 
    
      
 
     | 
  
  
    | 
      47
     | 
    
      <form name="modify" action="<?php echo WB_URL; ?>/modules/news/save_group.php" method="post" enctype="multipart/form-data" style="margin: 0;">
 
     | 
  
  
    | 
      48
     | 
    
      
 
     | 
  
  
    | 
      49
     | 
    
      <input type="hidden" name="section_id" value="<?php echo $section_id; ?>">
 
     | 
  
  
    | 
      50
     | 
    
      <input type="hidden" name="page_id" value="<?php echo $page_id; ?>">
 
     | 
  
  
    | 
      51
     | 
    
      <input type="hidden" name="group_id" value="<?php echo $group_id; ?>">
 
     | 
  
  
    | 
      52
     | 
    
      
 
     | 
  
  
    | 
      53
     | 
    
      <table class="row_a" cellpadding="2" cellspacing="0" border="0" width="100%">
 
     | 
  
  
    | 
      54
     | 
    
      <tr>
 
     | 
  
  
    | 
      55
     | 
    
      	<td width="80"><?php echo $TEXT['TITLE']; ?>:</td>
 
     | 
  
  
    | 
      56
     | 
    
      	<td>
 
     | 
  
  
    | 
      57
     | 
    
      		<input type="text" name="title" value="<?php echo (htmlspecialchars($fetch_content['title'])); ?>" style="width: 98%;" maxlength="255" />
 
     | 
  
  
    | 
      58
     | 
    
      	</td>
 
     | 
  
  
    | 
      59
     | 
    
      </tr>
 
     | 
  
  
    | 
      60
     | 
    
      <tr>
 
     | 
  
  
    | 
      61
     | 
    
      	<td><?php echo $TEXT['IMAGE']; ?>:</td>
 
     | 
  
  
    | 
      62
     | 
    
      	<?php if(file_exists(WB_PATH.MEDIA_DIRECTORY.'/.news/image'.$group_id.'.jpg')) { ?>
     | 
  
  
    | 
      63
     | 
    
      	<td>
 
     | 
  
  
    | 
      64
     | 
    
      		<a href="<?php echo WB_URL.MEDIA_DIRECTORY; ?>/.news/image<?php echo $group_id; ?>.jpg" target="_blank">View</a>
 
     | 
  
  
    | 
      65
     | 
    
      		 
 
     | 
  
  
    | 
      66
     | 
    
      		<input type="checkbox" name="delete_image" id="delete_image" value="true" />
 
     | 
  
  
    | 
      67
     | 
    
      		<label for="delete_image">Delete</label>
 
     | 
  
  
    | 
      68
     | 
    
      	</td>
 
     | 
  
  
    | 
      69
     | 
    
      	<?php } else { ?>
     | 
  
  
    | 
      70
     | 
    
      	<td>
 
     | 
  
  
    | 
      71
     | 
    
      		<input type="file" name="image" />
 
     | 
  
  
    | 
      72
     | 
    
      	</td>
 
     | 
  
  
    | 
      73
     | 
    
      	<?php } ?>
 
     | 
  
  
    | 
      74
     | 
    
      </tr>
 
     | 
  
  
    | 
      75
     | 
    
      <tr>
 
     | 
  
  
    | 
      76
     | 
    
      	<td><?php echo $TEXT['ACTIVE']; ?>:</td>
 
     | 
  
  
    | 
      77
     | 
    
      	<td>
 
     | 
  
  
    | 
      78
     | 
    
      		<input type="radio" name="active" id="active_true" value="1" <?php if($fetch_content['active'] == 1) { echo ' checked'; } ?> />
     | 
  
  
    | 
      79
     | 
    
      		<a href="#" onclick="javascript: document.getElementById('active_true').checked = true;">
     | 
  
  
    | 
      80
     | 
    
      		<?php echo $TEXT['YES']; ?>
 
     | 
  
  
    | 
      81
     | 
    
      		</a>
 
     | 
  
  
    | 
      82
     | 
    
      		-
 
     | 
  
  
    | 
      83
     | 
    
      		<input type="radio" name="active" id="active_false" value="0" <?php if($fetch_content['active'] == 0) { echo ' checked'; } ?> />
     | 
  
  
    | 
      84
     | 
    
      		<a href="#" onclick="javascript: document.getElementById('active_false').checked = true;">
     | 
  
  
    | 
      85
     | 
    
      		<?php echo $TEXT['NO']; ?>
 
     | 
  
  
    | 
      86
     | 
    
      		</a>
 
     | 
  
  
    | 
      87
     | 
    
      	</td>
 
     | 
  
  
    | 
      88
     | 
    
      </tr>
 
     | 
  
  
    | 
      89
     | 
    
      </table>
 
     | 
  
  
    | 
      90
     | 
    
      
 
     | 
  
  
    | 
      91
     | 
    
      <table cellpadding="0" cellspacing="0" border="0" width="100%">
 
     | 
  
  
    | 
      92
     | 
    
      <tr>
 
     | 
  
  
    | 
      93
     | 
    
      	<td align="left">
 
     | 
  
  
    | 
      94
     | 
    
      		<input name="save" type="submit" value="<?php echo $TEXT['SAVE']; ?>" style="width: 100px; margin-top: 5px;"></form>
 
     | 
  
  
    | 
      95
     | 
    
      	</td>
 
     | 
  
  
    | 
      96
     | 
    
      	<td align="right">
 
     | 
  
  
    | 
      97
     | 
    
      		<input type="button" value="<?php echo $TEXT['CANCEL']; ?>" onclick="javascript: window.location = '<?php echo ADMIN_URL; ?>/pages/modify.php?page_id=<?php echo $page_id; ?>';" style="width: 100px; margin-top: 5px;" />
 
     | 
  
  
    | 
      98
     | 
    
      	</td>
 
     | 
  
  
    | 
      99
     | 
    
      </tr>
 
     | 
  
  
    | 
      100
     | 
    
      </table>
 
     | 
  
  
    | 
      101
     | 
    
      
 
     | 
  
  
    | 
      102
     | 
    
      
 
     | 
  
  
    | 
      103
     | 
    
      <?php
 
     | 
  
  
    | 
      104
     | 
    
      
 
     | 
  
  
    | 
      105
     | 
    
      // Print admin footer
 
     | 
  
  
    | 
      106
     | 
    
      $admin->print_footer();
 
     | 
  
  
    | 
      107
     | 
    
      
 
     | 
  
  
    | 
      108
     | 
    
      ?>
 
     |