- Timestamp:
- 09/02/08 14:19:52 (3 months ago)
- Location:
- trunk
- Files:
-
- 7 modified
-
plog-admin/js/ajax_editing.js (modified) (2 diffs)
-
plog-admin/plog-admin-functions.php (modified) (4 diffs)
-
plog-admin/plog-feedback.php (modified) (2 diffs)
-
plog-admin/plog-rpc.php (modified) (5 diffs)
-
plog-globals.php (modified) (1 diff)
-
plog-includes/plog-functions.php (modified) (8 diffs)
-
plog-load-config.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/plog-admin/js/ajax_editing.js
r555 r574 1 2 1 function makeEditable(id){ 3 2 Event.observe(id, 'click', function(){edit($(id))}, false); … … 17 16 Element.hide(obj); 18 17 19 var textarea ='<div id="' + obj.id + '_editor"><textarea id="' + obj.id + '_edit" name="' + obj.id + '" rows="4" cols="60">'+ obj.innerHTML + '</textarea>';18 var textarea ='<div id="' + obj.id + '_editor"><textarea id="' + obj.id + '_edit" name="' + obj.id + '" rows="4" cols="60">'+ obj.innerHTML.replace(/ /gi,' ') + '</textarea>'; 20 19 21 20 var button = '<br /><input id="' + obj.id + '_save" type="button" value="Save" /> <input id="' + obj.id + '_cancel" type="button" value="Cancel" /></div>'; -
trunk/plog-admin/plog-admin-functions.php
r572 r574 1382 1382 $output .= "\n\t\t\t\t" . '<td><div class="img-shadow"><a href="'.plogger_get_picture_thumb(THUMB_LARGE).'" rel="lightbox" title="'.plogger_get_picture_caption().'">'.$imgtag.'</a></div></td>'; 1383 1383 $output .= "\n\t\t\t\t".'<td><strong><a class="folder" href="'.$_SERVER['PHP_SELF'].'?level=comments&id=' . $id . '">' . basename(plogger_get_source_picture_path()) . '</a></strong><br /><span style="margin-left: 20px;">' . sprintf(plog_tr('Comments: %d'), plogger_picture_comment_count()) . '</span></td>'; 1384 $output .= "\n\t\t\t\t<td><p id=\"picture-caption-" . plogger_get_picture_id() ."\">" . plogger_get_picture_caption() . " </p></td>";1385 $output .= "\n\t\t\t\t<td><p id=\"picture-description-" . plogger_get_picture_id() ."\">" . plogger_get_picture_description() . " </p></td>";1384 $output .= "\n\t\t\t\t<td><p id=\"picture-caption-" . plogger_get_picture_id() ."\">" . plogger_get_picture_caption() . "</p></td>"; 1385 $output .= "\n\t\t\t\t<td><p id=\"picture-description-" . plogger_get_picture_id() ."\">" . plogger_get_picture_description() . "</p></td>"; 1386 1386 $allow_comments = (1 == plogger_picture_allows_comments()) ? plog_tr("Yes") : plog_tr("No"); 1387 1387 $output .= "\n\t\t\t\t<td>" . $allow_comments . "</td>"; … … 1467 1467 $output .= "\n\t\t\t\t".'<td><input type="checkbox" name="selected[]" value="'.$id.'" /></td>'; 1468 1468 $output .= "\n\t\t\t\t".'<td><a class="folder" href="'.$_SERVER['PHP_SELF'].'?level=pictures&id='.$id.'"><span id="album-name-'.plogger_get_album_id().'"><strong>'.plogger_get_album_name().'</strong></span></a> — ' . sprintf(plog_tr('contains %d picture(s)'), plogger_album_picture_count()) . '</td>'; 1469 $output .= "\n\t\t\t\t".'<td><p id="album-description-'.plogger_get_album_id().'">'.plogger_get_album_description().' </p></td>';1469 $output .= "\n\t\t\t\t".'<td><p id="album-description-'.plogger_get_album_id().'">'.plogger_get_album_description().'</p></td>'; 1470 1470 $output .= "\n\t\t\t\t".'<td style="text-align: center;"><a href="'.$_SERVER['PHP_SELF'].'?action=edit-album&id='.$id.'"><img style="display: inline;" src="'.$config['gallery_url'].'plog-admin/images/edit.gif" alt="' . plog_tr('Edit') . '" title="' . plog_tr('Edit') . '" /></a>'; 1471 1471 $output .= ' <a href="'.$_SERVER['PHP_SELF'].'?action=move-delete&selected%5B%5D='.$id.'&level=albums&delete_checked=1&id='.$_REQUEST['id']; … … 1540 1540 $output .= "\n\t\t\t\t<td><input type='checkbox' name='selected[]' value='" . $id . "' /></td>"; 1541 1541 $output .= "\n\t\t\t\t<td><a class='folder' href='?level=albums&id=" .$id . "'><span id='collection-name-" . plogger_get_collection_id()."'><strong>".plogger_get_collection_name()."</strong></span></a> — " . sprintf(plog_tr('contains %d albums'), plogger_collection_album_count()) . "</td>"; 1542 $output .= "\n\t\t\t\t<td><p id='collection-description-" . plogger_get_collection_id() . "'>" . plogger_get_collection_description()." </p></td>";1542 $output .= "\n\t\t\t\t<td><p id='collection-description-" . plogger_get_collection_id() . "'>" . plogger_get_collection_description()."</p></td>"; 1543 1543 $output .= "\n\t\t\t\t" . '<td style="text-align: center;"><a href="?action=edit-collection&id=' . $id . '"><img style="display: inline;" src="'.$config['gallery_url'].'plog-admin/images/edit.gif" alt="' . plog_tr('Edit') . '" title="' . plog_tr('Edit') . '" /></a>'; 1544 1544 $output .= ' <a href="?action=move-delete&selected%5B%5D=' . $id . '&level=collections&delete_checked=1&'; … … 1610 1610 $output .= "\n\t\t\t<tr class=\"$table_row_color\">"; 1611 1611 $output .= "\n\t\t\t\t<td><input type=\"checkbox\" name=\"selected%5B%5D\" value=\"' . $id . '\" /></td>"; 1612 $output .= "\n\t\t\t\t<td><p id=\"comment-author-" . $id ."\">" . plogger_get_comment_author() . " </p></td>"; 1613 $email = plogger_get_comment_email(); 1614 $output .= "\n\t\t\t\t<td><p id=\"comment-email-" . $id ."\">" . $email . " </p></td>"; 1615 $output .= "\n\t\t\t\t<td><p id=\"comment-url-" . $id ."\">" . plogger_get_comment_url() . " </p></td>"; 1612 $output .= "\n\t\t\t\t<td><p id=\"comment-author-" . $id ."\">" . plogger_get_comment_author() . "</p></td>"; 1613 $output .= "\n\t\t\t\t<td><p id=\"comment-email-" . $id ."\">" . plogger_get_comment_email() . "</p></td>"; 1614 $output .= "\n\t\t\t\t<td><p id=\"comment-url-" . $id ."\">" . plogger_get_comment_url() . "</p></td>"; 1616 1615 $output .= "\n\t\t\t\t<td>" . plogger_get_comment_date("n.j.Y H:i:s") . "</td>"; 1617 $output .= "\n\t\t\t\t<td><p id=\"comment-comment-" . $id ."\">" . plogger_get_comment_text() . " </p></td>";1616 $output .= "\n\t\t\t\t<td><p id=\"comment-comment-" . $id ."\">" . plogger_get_comment_text() . "</p></td>"; 1618 1617 $output .= "\n\t\t\t\t" . '<td style="text-align: center;"><a href="?action=edit-comment&id=' . $id . '"><img style="display: inline;" src="'.$config['gallery_url'].'plog-admin/images/edit.gif" alt="' . plog_tr('Edit') . '" title="' . plog_tr('Edit') . '" /></a>'; 1619 1618 $output .= ' <a href="?action=delete-comment&id=' . $id . '" onclick="return confirm(\'' . plog_tr('Are you sure you want to delete this item?') . '\');"><img style="display: inline;" src="'.$config['gallery_url'].'plog-admin/images/x.gif" alt="' . plog_tr('Delete') . '" title="' . plog_tr('Delete') . '" /></a></td>'; -
trunk/plog-admin/plog-feedback.php
r571 r574 213 213 214 214 foreach ($row as $key => $value) { 215 $value = htmlspecialchars($value); 216 $value = SmartStripSlashes($value); 215 $value = SmartStripSlashes(htmlspecialchars($value)); 216 if ($value == '') { 217 $value = ' '; 218 } 217 219 218 220 if ($key == "unix_date") { … … 230 232 else { 231 233 if (in_array($key, $allowedCommentKeys)) 232 $output .= "\n\t\t\t\t".'<td><p id="comment-'.$key.'-'.$row['id'].'">'.$value.' </p></td>';234 $output .= "\n\t\t\t\t".'<td><p id="comment-'.$key.'-'.$row['id'].'">'.$value.'</p></td>'; 233 235 } 234 236 } -
trunk/plog-admin/plog-rpc.php
r555 r574 15 15 16 16 // With what? 17 $content = trim($_POST['content']); 17 $content = str_replace(array(' ', '%20', '%26nbsp%3B'), ' ', $_POST['content']); 18 $content = trim($content); 18 19 19 20 // Now we parse the field to be updated and the id number from the field variable … … 28 29 $result = update_picture_field($id, $field, $content); 29 30 if ($result['output']) { 31 if (empty($content)) { 32 $content = ' '; 33 } 30 34 print stripslashes($content); 31 35 } else { … … 36 40 $result = update_album_field($id, $field, $content); 37 41 if ($result['output']) { 42 if (empty($content)) { 43 $content = ' '; 44 } 38 45 print stripslashes($content); 39 46 } else { … … 44 51 $result = update_collection_field($id, $field, $content); 45 52 if ($result['output']) { 53 if (empty($content)) { 54 $content = ' '; 55 } 46 56 print stripslashes($content); 47 57 } else { … … 52 62 $result = update_comment_field($id, $field, $content); 53 63 if ($result['output']) { 64 if (empty($content)) { 65 $content = ' '; 66 } 54 67 print stripslashes($content); 55 68 } else { -
trunk/plog-globals.php
r568 r574 37 37 $language = strtolower(substr($locale,0,2)); 38 38 39 $mofile = dirname(__FILE__)."/plog-content/translations/".$locale.".mo";39 $mofile = PLOGGER_DIR."plog-content/translations/".$locale.".mo"; 40 40 41 41 // If the mo file does not exist or is not readable, or if the locale is -
trunk/plog-includes/plog-functions.php
r573 r574 2174 2174 function plogger_get_comment_email() { 2175 2175 $comment = $GLOBALS["current_comment"]; 2176 if ($comment['email'] == '') { 2177 return ' '; 2178 } 2176 2179 return $comment["email"]; 2177 2180 } … … 2179 2182 function plogger_get_comment_url() { 2180 2183 $comment = $GLOBALS["current_comment"]; 2184 if ($comment['url'] == '') { 2185 return ' '; 2186 } 2181 2187 return htmlspecialchars($comment["url"]); 2182 2188 } … … 2184 2190 function plogger_get_comment_author() { 2185 2191 $comment = $GLOBALS["current_comment"]; 2186 return htmlspecialchars(SmartStripSlashes($comment["author"])); 2192 if ($comment['author'] == '') { 2193 return ' '; 2194 } 2195 return htmlspecialchars(SmartStripSlashes($comment['author'])); 2187 2196 } 2188 2197 2189 2198 function plogger_get_comment_text($specialchars = false) { 2190 2199 $comment = $GLOBALS["current_comment"]; 2191 return htmlspecialchars(SmartStripSlashes($comment["comment"])); 2200 if ($comment['comment'] == '') { 2201 return ' '; 2202 } 2203 return htmlspecialchars(SmartStripSlashes($comment['comment'])); 2192 2204 } 2193 2205 … … 2247 2259 return SmartStripSlashes($GLOBALS['current_picture']['caption']); 2248 2260 } else { 2249 return " ";2261 return ' '; 2250 2262 } 2251 2263 } … … 2281 2293 2282 2294 function plogger_get_picture_description($specialchars = false) { 2283 if ( isset($GLOBALS['current_picture']['description'])){2295 if (!empty($GLOBALS['current_picture']['description'])){ 2284 2296 if ($specialchars) { 2285 2297 return htmlspecialchars(SmartStripSlashes($GLOBALS['current_picture']['description'])); … … 2287 2299 return SmartStripSlashes($GLOBALS['current_picture']['description']); 2288 2300 } else { 2289 return false;2301 return ' '; 2290 2302 } 2291 2303 } … … 2502 2514 2503 2515 function plogger_get_collection_description($specialchars = false) { 2516 if ($GLOBALS['current_collection']['description'] == '') { 2517 return ' '; 2518 } 2504 2519 if ($specialchars){ 2505 2520 return htmlspecialchars(SmartStripSlashes($GLOBALS['current_collection']['description'])); … … 2581 2596 2582 2597 function plogger_get_album_description($specialchars = false) { 2598 if ($GLOBALS['current_album']['description'] == '') { 2599 return ' '; 2600 } 2583 2601 if ($specialchars) { 2584 2602 return htmlspecialchars(SmartStripSlashes($GLOBALS['current_album']['description'])); -
trunk/plog-load-config.php
r567 r574 20 20 $thumbnail_config = array(); 21 21 22 $plog_basedir = dirname(__FILE__)."/"; 23 24 if (is_file($plog_basedir."plog-config.php")){ 25 require_once($plog_basedir."plog-config.php"); 26 } else if (is_file($plog_basedir."plog-config-sample.php")) { 27 require_once($plog_basedir."plog-config-sample.php"); 22 require_once(PLOGGER_DIR."/plog-globals.php"); 23 if (is_file(PLOGGER_DIR."plog-config.php")){ 24 require_once(PLOGGER_DIR."plog-config.php"); 25 } else if (is_file(PLOGGER_DIR."plog-config-sample.php")) { 26 require_once(PLOGGER_DIR."plog-config-sample.php"); 28 27 } else { 29 28 die("Could not find any config file!"); 30 29 } 31 require_once($plog_basedir."plog-globals.php"); 32 require_once($plog_basedir."plog-includes/plog-functions.php"); 30 require_once(PLOGGER_DIR."plog-includes/plog-functions.php"); 33 31 connect_db(); 34 32 35 33 $query = "SELECT * FROM `".TABLE_PREFIX."config`"; 36 $result = mysql_query($query) or die(mysql_error() .'<br /><br />'.$query);34 $result = run_query($query); 37 35 38 36 if (mysql_num_rows($result) == 0){ … … 42 40 $config = mysql_fetch_assoc($result); 43 41 44 $config['basedir'] = $plog_basedir;42 $config['basedir'] = PLOGGER_DIR; 45 43 46 44 $url_parts = parse_url($_SERVER['REQUEST_URI']); … … 85 83 // remove plog-admin/ from the end, if present .. is there a better way to determine the full url? 86 84 // had to update this for new use of links without mod_rewrite turned on (only affects the View gallery greybox in Admin) 87 if (strpos($config['baseurl'], "plog-admin/")) {88 $config['baseurl'] = substr($config['baseurl'], 0, strpos($config['baseurl'], "plog-admin/"));85 if (strpos($config['baseurl'], 'plog-admin/')) { 86 $config['baseurl'] = substr($config['baseurl'], 0, strpos($config['baseurl'], 'plog-admin/')); 89 87 } 90 88 … … 111 109 112 110 $query = "SELECT * FROM `".TABLE_PREFIX."thumbnail_config`"; 113 $result = mysql_query($query) or die(mysql_error() .'<br /><br />'.$query);111 $result = run_query($query); 114 112 115 113 if (mysql_num_rows($result) == 0){
