[ Index ] |
PHP Cross Reference of phpwcms V1.5.0 _r431 (28.01.12) |
[Summary view] [Print] [Text view]
1 <?php 2 /************************************************************************************* 3 Copyright notice 4 5 (c) 2002-2012 Oliver Georgi <oliver@phpwcms.de> // All rights reserved. 6 7 This script is part of PHPWCMS. The PHPWCMS web content management system is 8 free software; you can redistribute it and/or modify it under the terms of 9 the GNU General Public License as published by the Free Software Foundation; 10 either version 2 of the License, or (at your option) any later version. 11 12 The GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html 13 A copy is found in the textfile GPL.txt and important notices to the license 14 from the author is found in LICENSE.txt distributed with these scripts. 15 16 This script is distributed in the hope that it will be useful, but WITHOUT ANY 17 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 18 PARTICULAR PURPOSE. See the GNU General Public License for more details. 19 20 This copyright notice MUST APPEAR in all copies of the script! 21 *************************************************************************************/ 22 23 // ---------------------------------------------------------------- 24 // obligate check for phpwcms constants 25 if (!defined('PHPWCMS_ROOT')) { 26 die("You Cannot Access This Script Directly, Have a Nice Day."); 27 } 28 // ---------------------------------------------------------------- 29 30 31 // keyword administration 32 33 include_once (PHPWCMS_ROOT.'/include/inc_lib/lib.keywords.inc.php'); 34 35 echo '<h3 class="title">'.$BL['be_admin_keywords'].'</h3>'.LF; 36 37 // check if rights to edit keywords 38 if(!IS_ADMIN) { 39 40 echo '<p>Sorry, you have no rights to edit keywords</p>'; 41 42 43 // list keywords 44 } elseif(empty($_POST['keyword_action'])) { 45 46 echo backend_list_keywords(); 47 48 // new keyword 49 } elseif($_POST['keyword_action'] == 'update') { 50 51 52 53 // update keyword 54 } elseif($_POST['keyword_action'] == 'edit') { 55 56 echo backend_edit_keywords(); 57 58 // delete keyword 59 } elseif($_POST['keyword_action'] == 'delete') { 60 61 62 63 64 // error 65 } else { 66 67 echo '<p>There seems to be a problem editing keywords. Contact admin.</p>'; 68 69 } 70 71 72 // old 73 $keyword["id"] = 0; 74 75 ?> 76 77 <!-- 78 <table width="538" border="0" cellpadding="0" cellspacing="0"> 79 <tr><td colspan="2" class="title"><?php echo $BL['be_admin_keywords'] ?></td></tr> 80 <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="4"></td></tr> 81 <?php 82 if(isset($_GET["keyid"])) { 83 ?> 84 <tr><td colspan="2"><img src="img/lines/l538_70.gif" alt="" width="538" height="1"></td></tr> 85 <tr bgcolor="#F0F2F4"><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="10"></td></tr> 86 <?php 87 $keyword["id"] = intval($_GET["keyid"]); 88 if($keyword["id"]) { 89 $sql = "SELECT * FROM ".DB_PREPEND."phpwcms_keyword WHERE keyword_id=".$keyword["id"]." LIMIT 1;"; 90 if($result = mysql_query($sql, $db) or die("error while retrieving keywords")) { 91 if($row = mysql_fetch_array($result)) { 92 $keyword["name"] = $row["keyword_name"]; 93 } 94 mysql_free_result($result); 95 } 96 $sendbutton = $BL['be_admin_fcat_button1']; 97 } else { 98 $sendbutton = $BL['be_admin_fcat_button2']; 99 } 100 101 if(isset($_POST["keyword_aktion"]) && intval($_POST["keyword_aktion"])) { // show form for editing keywords 102 103 $keyword["name"] = clean_slweg($_POST["keyword_name"], 250); 104 $keyword["id"] = intval($_POST["keyword_id"]); 105 106 $keyword["name"] = str_replace(';', ' ', $keyword["name"]); 107 $keyword["name"] = str_replace(',', ' ', $keyword["name"]); 108 $keyword["name"] = preg_replace('/\s{1,}/', ' ', $keyword["name"]); 109 110 if(empty($keyword["name"])) { 111 $keyword["error"] = 1; 112 } else { 113 if(!$keyword["id"]) { 114 $sql = "INSERT INTO ".DB_PREPEND."phpwcms_keyword SET "; 115 $sql .= "keyword_name = '".aporeplace($keyword["name"])."'"; 116 } else { 117 $sql = "UPDATE ".DB_PREPEND."phpwcms_keyword SET "; 118 $sql .= "keyword_name='".aporeplace($keyword["name"]); 119 $sql .= "' WHERE keyword_id=".$keyword["id"]; 120 } 121 if($result = mysql_query($sql, $db) or die("error while inserting/updating keyword")) { 122 if(!$keyword["id"]) $keyword["id"] = mysql_insert_id($db); 123 headerRedirect(PHPWCMS_URL."phpwcms.php?do=admin&p=5"); 124 } 125 } 126 127 } 128 129 ?> 130 <form action="phpwcms.php?do=admin&p=5&keyid=<?php echo $keyword["id"] ?>" method="post" name="keywords"> 131 <tr align="center" bgcolor="#F0F2F4"><td colspan="2"><table border="0" cellspacing="0" cellpadding="0"> 132 <?php if(!empty($keyword["error"])) { ?> 133 <tr> 134 <td align="right" class="chatlist"><font color="#FF3300"><?php echo $BL['be_admin_usr_err'] ?>:</font> </td> 135 <td class="error"><strong><?php echo $BL['be_admin_keywords_err'] ?></strong></td> 136 </tr> 137 <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="3"></td></tr> 138 <?php } ?> 139 <tr> 140 <td align="right" class="chatlist"><?php echo $BL['be_admin_keywords_key'] ?>: </td> 141 <td><input name="keyword_name" type="text" id="keyword_name" class="f11b" style="width: 430px" value="<?php echo empty($keyword["name"]) ? '' : html_specialchars($keyword["name"]) ?>" size="40" maxlength="250"></td> 142 </tr> 143 <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="10"></td></tr> 144 <tr> 145 <td><input name="keyword_id" type="hidden" id="keyword_id" value="<?php echo intval($keyword["id"]) ?>"><input name="keyword_aktion" type="hidden" id="keyword_aktion" value="1"></td> 146 <td><input name="Submit" type="submit" class="button10" style="width: 150px;" value="<?php echo $sendbutton ?>"> <input name="donotsubmit" type="button" class="button10" style="width: 80px;" value="<?php echo $BL['be_admin_fcat_exit'] ?>" onclick="location.href='phpwcms.php?do=admin&p=5';"></td> 147 </tr> 148 </table></td> 149 </tr> 150 <tr bgcolor="#F0F2F4"><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="15"></td></tr> 151 </form> 152 <?php 153 } //Ende Anzeige Category Name Formular 154 ?> 155 <tr><td colspan="2"><img src="img/lines/l538_70.gif" alt="" width="538" height="1"></td></tr> 156 <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="5"></td></tr> 157 <?php 158 $sql = "SELECT * FROM ".DB_PREPEND."phpwcms_keyword WHERE keyword_trash=0 ORDER BY keyword_name;"; 159 if($result = mysql_query($sql, $db) or die("error while browsing keyword list")) { 160 while($row = mysql_fetch_assoc($result)) { 161 162 echo "<tr onMouseOver=\"this.bgColor='#CCFF00';\" onMouseOut=\"this.bgColor='#FFFFFF';\">\n"; 163 echo "<td width=\"483\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tr>\n"; 164 165 echo "<td>"; 166 echo "<img src=\"img/symbole/plus_empty.gif\" width=\"15\" height=\"15\" border=\"0\"></td>\n"; 167 168 echo "<td><img src=\"img/leer.gif\" width=\"2\" height=\"15\"></td>\n"; 169 echo "<td class=\"dir\"><strong>".html_specialchars($row["keyword_name"])."</strong></td>\n"; 170 echo "</tr>\n</table></td>\n<td width=\"55\" align=\"right\">"; 171 172 echo "<a href=\"phpwcms.php?do=admin&p=5&keyid=".$row["keyword_id"]."\" title =\"".$BL['be_admin_keyword_edit']."\">"; 173 echo "<img src=\"img/button/edit_22x11.gif\" width=\"22\" height=\"11\" border=\"0\"></a>"; 174 175 echo "<a href=\"include/inc_act/act_filecat.php?do=8,".$row["keyword_id"]."\" title =\"".$BL['be_admin_keyword_del']."\" "; 176 echo "onclick=\"return confirm('".$BL['be_admin_keyword_delmsg']."\\n[".html_specialchars($row["keyword_name"])."] ');\">"; 177 echo "<img src=\"img/button/del_11x11.gif\" width=\"11\" height=\"11\" border=\"0\"></a>"; 178 179 echo "</td>\n</tr>\n"; 180 181 } 182 mysql_free_result($result); 183 } 184 ?> 185 <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="5"></td></tr> 186 <tr><td colspan="2"><img src="img/lines/l538_70.gif" alt="" width="538" height="1"></td></tr> 187 <tr> 188 <td><img src="img/leer.gif" alt="" width="483" height="1"></td> 189 <td><img src="img/leer.gif" alt="" width="55" height="5"></td> 190 </tr> 191 <tr><td colspan="2"><form action="phpwcms.php?do=admin&p=5&keyid=0" method="post"><input type="submit" value="<?php echo $BL['be_admin_keyword_add'] ?>" class="button10" title="<?php echo $BL['be_admin_keyword_add'] ?>"></form></td></tr> 192 </table> 193 // -->
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Sun Jan 29 16:31:14 2012 | Cross-referenced by PHPXref 0.7.1 |