[ Index ]
 

Code source de CMS made simple 1.0.5

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/admin/ -> addbookmark.php (source)

   1  <?php
   2  #CMS - CMS Made Simple
   3  #(c)2004 by Ted Kulp (wishy@users.sf.net)
   4  #This project's homepage is: http://cmsmadesimple.sf.net
   5  #
   6  #This program is free software; you can redistribute it and/or modify
   7  #it under the terms of the GNU General Public License as published by
   8  #the Free Software Foundation; either version 2 of the License, or
   9  #(at your option) any later version.
  10  #
  11  #This program is distributed in the hope that it will be useful,
  12  #but WITHOUT ANY WARRANTY; without even the implied warranty of
  13  #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14  #GNU General Public License for more details.
  15  #You should have received a copy of the GNU General Public License
  16  #along with this program; if not, write to the Free Software
  17  #Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  18  #
  19  #$Id: addbookmark.php 3352 2006-08-21 18:07:51Z wishy $
  20  
  21  $CMS_ADMIN_PAGE=1;
  22  
  23  require_once ("../include.php");
  24  
  25  check_login();
  26  
  27  $error = "";
  28  
  29  $title= "";
  30  if (isset($_POST["title"])) $title = $_POST["title"];
  31  $url = "";
  32  if (isset($_POST["url"])) $url = $_POST["url"];
  33  
  34  if (isset($_POST["cancel"])) {
  35      redirect("listbookmarks.php");
  36      return;
  37  }
  38  
  39  $userid = get_userid();
  40  
  41  if (isset($_POST["addbookmark"]))
  42      {
  43      $validinfo = true;
  44  
  45      if ($title == "")
  46          {
  47          $error .= lang('nofieldgiven', array('addbookmark'));
  48          $validinfo = false;
  49          }
  50  
  51      if ($validinfo)
  52          {
  53          global $gCms;
  54          $gCms->GetBookmarkOperations();
  55          $markobj =& new Bookmark();
  56          $markobj->title = $title;
  57          $markobj->url = $url;
  58          $markobj->user_id=$userid;
  59  
  60          $result = $markobj->save();
  61  
  62          if ($result)
  63              {
  64              redirect("listbookmarks.php");
  65              return;
  66              }
  67          else
  68              {
  69              $error .= lang('errorinsertingbookmark');
  70              }
  71          }
  72      }
  73  
  74  include_once ("header.php");
  75  
  76  if ($error != "")
  77      {
  78          echo '<div class="pageerrorcontainer"><p class="pageerror">'.$error.'</p></div>';
  79      }
  80  ?>
  81  
  82  <div class="pagecontainer">
  83      <div class="pageoverflow">
  84              <?php echo $themeObject->ShowHeader('addbookmark'); ?>
  85              <form method="post" action="addbookmark.php">
  86                  <div class="pageoverflow">
  87                      <p class="pagetext"><?php echo lang('title')?>:</p>
  88                      <p class="pageinput"><input type="text" name="title" maxlength="255" value="<?php echo $title?>" /></p>
  89                  </div>
  90                  <div class="pageoverflow">
  91                      <p class="pagetext"><?php echo lang('url')?>:</p>
  92                      <p class="pageinput"><input type="text" name="url" maxlength="255" value="<?php echo $url ?>" class="standard" /></p>
  93                  </div>
  94                  <div class="pageoverflow">
  95                      <p class="pagetext">&nbsp;</p>
  96                      <p class="pageinput">
  97                          <input type="hidden" name="addbookmark" value="true" />
  98                          <input type="submit" value="<?php echo lang('submit')?>" class="pagebutton" onmouseover="this.className='pagebuttonhover'" onmouseout="this.className='pagebutton'" />
  99                          <input type="submit" name="cancel" value="<?php echo lang('cancel')?>" class="pagebutton" onmouseover="this.className='pagebuttonhover'" onmouseout="this.className='pagebutton'" />
 100                      </p>
 101                  </div>        
 102              </form>
 103      </div>
 104  </div>
 105  <p class="pageback"><a class="pageback" href="<?php echo $themeObject->BackUrl(); ?>">&#171; <?php echo lang('back')?></a></p>
 106  
 107  <?php
 108  include_once ("footer.php");
 109  
 110  # vim:ts=4 sw=4 noet
 111  ?>


Généré le : Tue Apr 3 18:50:37 2007 par Balluche grâce à PHPXref 0.7