[ PHPXref.com ] [ Generated: Sun Jul 20 19:57:11 2008 ] [ PHP-Update 2.7 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/admin/ -> content.php (source)

   1  <?
   2  extract($HTTP_POST_VARS); 
   3  extract($HTTP_GET_VARS); 
   4  extract($HTTP_COOKIE_VARS); 
   5  $adminsect = 1;
   6  include  "protection.php";
   7  if(file_exists("languages/$language.php")) include "languages/$language.php";
   8  else {
   9  echo "<b>Critical error</b><br>Language file <i>$language</i> could not be found.<p>";
  10  exit;
  11  }
  12  $pagetitle = "$sitetitle $split $title_content";
  13  $thispagetitle = "$title_content";
  14  if(file_exists("../code/templates/$template}_h.php") && file_exists("../code/templates/$template}_f.php")) {
  15  $tempfilename = "../code/templates/$template}_h.php";
  16  $handle = fopen($tempfilename, "r");
  17  $temp = fread($handle, filesize ($tempfilename));
  18  fclose($handle);
  19  include  "../code/menucode.php";
  20  include  "../code/parsetemplate.php";
  21  parsetemplate($temp, $menucode, $thispagetitle, $pagetitle);
  22  if($w == 1 && !isset($content)) echo "<head>
  23  <script type=\"text/javascript\" src=\"../wysi/fckeditor.js\"></script>
  24  <script type=\"text/javascript\">
  25        window.onload = function()
  26        {
  27          var oFCKeditor = new FCKeditor( 'content' ) ;
  28          oFCKeditor.BasePath = '../wysi/' ;
  29          oFCKeditor.Width = '100%' ;
  30          oFCKeditor.Height = '100%' ;
  31          oFCKeditor.ReplaceTextarea() ;
  32        }
  33      </script>
  34  </head>";
  35  if($rights[1] == "1") {
  36  
  37  echo "<b>$title_content $split ";
  38  if(isset($f)) {
  39  echo "$title_content_edit ($f)</b><br><img src=\"../gfx/blank.gif\" width=1 height=6><br>";
  40  if((!file_exists("../content/$f.txt") && $create != "1") || ($fileacc == "b" && stristr($files, "$f")) || ($fileacc == "a" && !stristr($files, "$f"))) $err = 1;
  41  if($err != "1") {
  42  if(isset($content)) {
  43  $content = str_replace("/rte/", "/", $content);
  44  if($contentnewline == "1" && $w != "1") $content = str_replace("\n", "<br/>", $content);
  45  $table_def = "'', '$f', '$newtitle', '$content'";
  46  if(!mysql_query("REPLACE INTO $table_prefix}content VALUES($table_def)")) $err = 1;
  47  
  48  if($err == 1) echo "<b>$txt_error</b><br><img src=\"../gfx/blank.gif\" width=1 height=6><br>$txt_noaccess<br><img src=\"../gfx/blank.gif\" width=1 height=6><br>$txt_home";
  49  else echo "$txt_saved<br><img src=\"../gfx/blank.gif\" width=1 height=6><br>$txt_viewchanged<br><img src=\"../gfx/blank.gif\" width=1 height=6><br>$txt_home";
  50  
  51  }
  52  else {
  53  $query = mysql_query("SELECT * FROM $table_prefix}content WHERE filename='$f'");
  54  if(mysql_num_rows($query) == "1") {
  55  $thistitle = mysql_result($query, 0, "title");
  56  $pagetext = mysql_result($query, 0, "content");
  57  $thistitle = str_replace("\"", "&quot;", $thistitle);
  58  $thistitle = str_replace("<", "&lt;", $thistitle);
  59  $thistitle = str_replace(">", "&gt;", $thistitle);
  60  $pagetext = str_replace("<", "&lt;", $pagetext);
  61  $pagetext = str_replace(">", "&gt;", $pagetext);
  62  }
  63  
  64  if($w == 1) {
  65  echo "<table align=center height=\"555\" width=\"600\" border=0 cellspacing=0 cellpadding=0 background=C0C0C0><form id=theform method=post action=\"content.php?f=$f&w=1\" name='post' onsubmit='return checkForm(this)'>$txt_pagetitle: <input type=text name=newtitle value=\"$thistitle\"><tr><td height=\"555\" width=\"600\" valign=\"top\">
  66  
  67  <textarea id=\"content\" name=\"content\">$pagetext</textarea>
  68  </td>
  69  </tr>
  70  <tr><td>
  71  </td></tr>
  72  </form>
  73  </table>";
  74  }
  75  else {
  76  
  77  if($contentnewline == "1") $pagetext = str_replace("&lt;br&gt;", "\n", $pagetext);
  78  if($contentnewline == "1") $pagetext = str_replace("&lt;br/&gt;", "\n", $pagetext);
  79  
  80  echo "<script language=javascript src=html.js></script><table border=0 cellspacing=1 cellpadding=2><form name=post method=post action=\"content.php?f=$f\"><tr><td>$txt_pagetitle: <input type=text name=newtitle value=\"$thistitle\"></td></tr></table>";
  81  
  82  echo "<table border=0 cellspacing=1 cellpadding=0><tr><td valign=top><table border=0 cellspacing=1 cellpadding=2><tr><td><textarea name=content cols=50 rows=15 wrap='virtual' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'>$pagetext</textarea></td></tr>
  83  <tr><td><input type=submit value=\"$txt_save\"></td></tr>
  84  </table></td><td valign=top>Add HTML<br>
  85  <img src=../gfx/blank.gif width=1 height=7><br>
  86  <input type='button' class='button' name='addbbcode0' value=' Bold ' onClick='bbstyle(0)'>
  87  <input type='button' class='button' name='addbbcode1' value=' /B ' onClick='bbstyle(1)'><br>
  88  <input type='button' class='button' name='addbbcode2' value=' Italics ' onClick='bbstyle(2)'>
  89  <input type='button' class='button' name='addbbcode3' value=' /I ' onClick='bbstyle(3)'><br>
  90  <input type='button' class='button' name='addbbcode4' value=' Underline ' onClick='bbstyle(4)'>
  91  <input type='button' class='button' name='addbbcode5' value=' /U ' onClick='bbstyle(5)'><br>
  92  <img src=../gfx/blank.gif width=1 height=7><br>
  93  <input type='button' class='button' name='addbbcode10' value='URL (page)' onClick='bbstyle(10)'><br>
  94  <input type='button' class='button' name='addbbcode12' value='URL (file)' onClick='bbstyle(12)'><br>
  95  <input type='button' class='button' name='addbbcode14' value='URL (remote)' onClick='bbstyle(14)'><br>
  96  <input type='button' class='button' name='addbbcode16' value='/URL' onClick='bbstyle(16)'><br>
  97  <img src=../gfx/blank.gif width=1 height=7><br>
  98  <input type='button' class='button' name='addbbcode6' value='List' onClick='bbstyle(6)'>
  99  <input type='button' class='button' name='addbbcode8' value='Image' onClick='bbstyle(8)'><br>
 100  <img src=../gfx/blank.gif width=1 height=7><br>
 101  <input type='button' class='button' name='addbbcode18' value='<br>' onClick='bbstyle(18)'>
 102  <input type='button' class='button' name='addbbcode20' value='<p>' onClick='bbstyle(20)'>
 103  </td></tr>
 104  </form></table><p>
 105  
 106  $title_content_files: <a href=\"javascript:window.open('files.php?s=files','','status=no,width=300,height=400,left=20,top=20,scrollbars=yes');void('w');\">files/</a> $split <a href=\"javascript:window.open('files.php?s=gfx','','status=no,width=300,height=400,left=20,top=20,scrollbars=yes');void('w');\">gfx/</a>";
 107  }
 108  }
 109  }
 110  else echo "<b>$txt_error</b><br>$txt_norights<br><img src=\"../gfx/blank.gif\" width=1 height=6><br>$txt_home<p>";
 111  }
 112  else {
 113  echo "$title_content_files</b><br><img src=\"../gfx/blank.gif\" width=1 height=6><br>";
 114  $query = mysql_query("SELECT * FROM $table_prefix}content ORDER BY filename ASC");
 115  
 116  echo "<table border=0 cellspacing=1 cellpadding=2 class=filebg><tr><td class=filelist width=75%><i>$txt_filename</td><td class=filelist width=15%><i>$txt_size</td>";
 117  if(file_exists("../wysi/fckeditor.js")) echo "<td class=filelist width=10%>&nbsp;</td>";
 118  echo "</tr>";
 119  
 120  for($i = 0; $i < mysql_num_rows($query); $i++) {
 121  $file = mysql_result($query, $i, "filename");
 122  if(($fileacc == "b" && !stristr($files, $file)) || ($fileacc == "a" && stristr($files, $file))) $filename[] = $file;
 123  }
 124  
 125  if(count($filename) > 0) {
 126  for($i = 0; $i < count($filename); $i++) {
 127  $content = mysql_query("SELECT content FROM $table_prefix}content WHERE filename='$filename[$i]'");
 128  $content = mysql_result($content, 0, 0);
 129  $size = strlen($content);
 130  echo "<tr><td class=filelist><a href=\"content.php?f=$filename[$i]\">$filename[$i]</a></td><td class=filelist>$size</td>";
 131  if(file_exists("../wysi/fckeditor.js")) echo "<td class=filelist><a href=\"content.php?f=$filename[$i]&w=1\">$txt_wysiwyg</a></td>";
 132  echo "</tr>";
 133  }
 134  }
 135  else {
 136  echo "<tr><td colspan=";
 137  
 138  if(file_exists("../wysi/fckeditor.js")) echo "3";
 139  else echo "2";
 140  
 141  echo " class=filelist align=center><i>$txt_empty</i></td></tr>";
 142  }
 143  echo "</table>";
 144  
 145  if($create == 1) {
 146  
 147  if(file_exists("../wysi/fckeditor.js")) echo "<img src=\"../gfx/blank.gif\" width=1 height=6><br>
 148  <table border=0 cellspacing=0 cellpadding=0><form method=get action=content.php><tr><td colspan=2>$txt_create: <input type=text name=f></td></tr><tr><td><input type=checkbox name=w value=1> $txt_wysiwyg</td><td align=right><input type=submit value=\"$txt_create\"></td></tr></form></table>";
 149  
 150  else echo "<img src=\"../gfx/blank.gif\" width=1 height=6><br>
 151  <table border=0 cellspacing=0 cellpadding=0><form method=get action=content.php><tr><td>$txt_create: <input type=text name=f> <input type=submit value=\"$txt_create\"></td></tr></form></table>";
 152  
 153  }
 154  
 155  }
 156  }
 157  else echo "<b>$txt_error</b><br>$txt_norights<br><img src=\"../gfx/blank.gif\" width=1 height=6><br>$txt_home<p>";
 158  $tempfilename = "../code/templates/$template}_f.php";
 159  $handle = fopen($tempfilename, "r");
 160  $temp = fread($handle, filesize ($tempfilename));
 161  fclose($handle);
 162  parsetemplate($temp, $menucode, $thispagetitle, $pagetitle);
 163  }
 164  else echo "<b>$txt_error</b><br>$txt_tempnofound<p>";
 165  ?>


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