1
0

Fixed most of the redundant br elements in the core.

This commit is contained in:
Matthias Mees
2012-12-03 13:35:59 +01:00
parent bd8c2bbda0
commit 7288ffdef8
28 changed files with 172 additions and 170 deletions

View File

@ -20,15 +20,15 @@ if ($serendipity['POST']['formAction'] == 'multiDelete' && sizeof($serendipity['
foreach ( $serendipity['POST']['delete'] as $k => $v ) {
$ac = serendipity_approveComment($k, $v, false, 'flip');
if ($ac > 0) {
$errormsg .= DONE . ': '. sprintf(COMMENT_APPROVED, (int)$k) . '<br />';
$errormsg .= DONE . ': '. sprintf(COMMENT_APPROVED, (int)$k);
} else {
$errormsg .= DONE . ': '. sprintf(COMMENT_MODERATED, (int)$k) . '<br />';
$errormsg .= DONE . ': '. sprintf(COMMENT_MODERATED, (int)$k);
}
}
} else {
foreach ( $serendipity['POST']['delete'] as $k => $v ) {
serendipity_deleteComment($k, $v);
$errormsg .= DONE . ': '. sprintf(COMMENT_DELETED, (int)$k) . '<br />';
$errormsg .= DONE . ': '. sprintf(COMMENT_DELETED, (int)$k);
}
}
}

View File

@ -648,7 +648,7 @@ switch ($serendipity['GET']['adminAction']) {
$data['case_scale'] = true;
$data['print_SCALING_IMAGE'] = sprintf(
SCALING_IMAGE . '<br />',
SCALING_IMAGE,
$file['path'] . $file['name'] .'.'. $file['extension'],
(int)$serendipity['GET']['width'],
(int)$serendipity['GET']['height']

View File

@ -39,9 +39,9 @@ class Serendipity_Import_Blogger extends Serendipity_Import {
function getImportNotes(){
if (empty($_REQUEST['token'])) {
$msg = 'In order to import your blog on Blogger, Serendipity needs to be able to access it via Google\'s Blogger Data APIs.<br />';
$msg .= 'Login to your Google/Blogger account and then click the link below.<br /><br />';
$msg .= '<a href="https://www.google.com/accounts/AuthSubRequest?scope=http%3A%2F%2Fwww.blogger.com%2Ffeeds%2F&session=1&secure=0&next='. urlencode('http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']) .'">Go to Google to grant access</a><br />';
$msg = 'In order to import your blog on Blogger, Serendipity needs to be able to access it via Google\'s Blogger Data APIs.';
$msg .= 'Login to your Google/Blogger account and then click the link below.';
$msg .= '<a class="block_level standalone" href="https://www.google.com/accounts/AuthSubRequest?scope=http%3A%2F%2Fwww.blogger.com%2Ffeeds%2F&session=1&secure=0&next='. urlencode('http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']) .'">Go to Google to grant access</a>';
return $msg;
} else {
return '';
@ -154,7 +154,7 @@ class Serendipity_Import_Blogger extends Serendipity_Import {
}
// Export success
echo 'Successfully exported entries from Blogger<br />';
echo '<span class="block_level">Successfully exported entries from Blogger</span>';
// Get Serendipity authors list
$authorList = array();
@ -247,29 +247,32 @@ class Serendipity_Import_Blogger extends Serendipity_Import {
}
// Report on resultant authors
echo '<br />Current list of authors: <br />'. join(', ', array_values($authorList)) .'<br /><br />';
echo '<span class="block_level">Current list of authors: </span>'. join(', ', array_values($authorList));
// Do cleanup and report on entries
echo 'The following entries were successfully imported:<br />';
echo '<span class="block_level">The following entries were successfully imported:</span>';
echo '<ul>';
foreach ($entryList as $eId => $eDetails) {
// Update comment count for entry in s9y
serendipity_db_query("UPDATE ". $serendipity['dbPrefix'] ."entries SET comments = ". $eDetails[2] ." WHERE id = ". $eDetails[0]);
echo '- '. $eDetails[1] .' comments('. $eDetails[2] .')<br />';
echo '<li>'. $eDetails[1] .' comments('. $eDetails[2] .')</li>';
}
echo '<br />';
echo '</ul>';
// Report fails
echo 'The following entries ran into trouble and was not imported:<br />';
echo '<span class="block_level">The following entries ran into trouble and was not imported:</span>';
echo '<ul>';
foreach ($entryFailList as $eId => $eDetails) {
echo '- '. $eDetails .'<br />';
echo '<li>'. $eDetails .'</li>';
}
echo '</ul>';
// Reset autodiscovery
$serendipity['noautodiscovery'] = $noautodiscovery;
// All done!
echo "Import finished.<br />";
echo '<span class="msg_notice">Import finished.</span>';
return true;
}
@ -277,4 +280,4 @@ class Serendipity_Import_Blogger extends Serendipity_Import {
return 'Serendipity_Import_Blogger';
?>
?>

View File

@ -143,18 +143,18 @@ class Serendipity_Import_Generic extends Serendipity_Import {
if (PEAR::isError($res) || $req->getResponseCode() != '200') {
serendipity_request_end();
echo IMPORT_FAILED . ': ' . htmlspecialchars($this->data['url']);
echo "<br />\n";
echo '<span class="block_level">' . IMPORT_FAILED . ': ' . htmlspecialchars($this->data['url']) . '</span>';
return false;
}
$fContent = $req->getResponseBody();
serendipity_request_end();
echo strlen($fContent) . " Bytes<br />\n";
echo '<span class="block_level">' . strlen($fContent) . " Bytes</span>";
if (version_compare(PHP_VERSION, '5.0') === -1) {
echo '<span class="block_level">';
printf(UNMET_REQUIREMENTS, 'PHP >= 5.0');
echo "<br />\n";
echo "</span>";
return false;
}
@ -194,9 +194,9 @@ class Serendipity_Import_Generic extends Serendipity_Import {
'parentid' => 0,
'category_left' => 0,
'category_right' => 0);
echo '<span class="block_level">';
printf(CREATE_CATEGORY, htmlspecialchars($cat_name));
echo "<br />\n";
echo "</span>";
if ($dry_run) {
$s9y_cat[$cat_name] = time();
} else {
@ -235,7 +235,7 @@ class Serendipity_Import_Generic extends Serendipity_Import {
foreach($item->category AS $idx => $category) {
$cstring=(string)$category;
if (!isset($s9y_cat[$cstring])) {
echo "WARNING: $category unset!<br />\n";
echo "<span class='msg_error'>WARNING: $category unset!</span>";
} else {
$entry['categories'][] = $s9y_cat[$cstring];
}
@ -252,8 +252,9 @@ class Serendipity_Import_Generic extends Serendipity_Import {
} else {
$s9y_users[$wp_user]['authorid'] = serendipity_addAuthor($wp_user, md5(time()), $wp_user, '', USERLEVEL_EDITOR);
}
echo '<span class="block_level">';
printf(CREATE_AUTHOR, htmlspecialchars($wp_user));
echo "<br />\n";
echo "</span>";
}
$entry['authorid'] = $s9y_users[$wp_user]['authorid'];
@ -308,7 +309,7 @@ class Serendipity_Import_Generic extends Serendipity_Import {
$s9y_cid[$c_id] = $cid;
}
echo "Entry '" . htmlspecialchars($entry['title']) . "' ($c_i comments) imported.<br />\n";
echo "<span class='msg_notice'>Entry '" . htmlspecialchars($entry['title']) . "' ($c_i comments) imported.</span>";
}
return true;
}

View File

@ -253,7 +253,7 @@ class Serendipity_Import_LiveJournalXML extends Serendipity_Import {
}
}
$id = serendipity_updertEntry($new_entry);
echo 'Inserted entry #' . $id . ', "' . htmlspecialchars($new_entry['title']) . '"<br />' . "\n";
echo '<span class="msg_notice">Inserted entry #' . $id . ', "' . htmlspecialchars($new_entry['title']) . '"</span>';
if (is_array($new_entry['comments'])) {
$cid_map = array();
$jids = array();
@ -265,7 +265,7 @@ class Serendipity_Import_LiveJournalXML extends Serendipity_Import {
$cid = serendipity_insertComment($id, $comment);
$cid_map[$comment['jtalkid']] = $cid;
}
echo 'Inserted comments for entry #' . $id . '<br />' . "\n";
echo '<span class="msg_notice">Inserted comments for entry #' . $id . '</span>';
}
if (function_exists('ob_flush')) {

View File

@ -67,7 +67,7 @@ class Serendipity_Import_MovableType extends Serendipity_Import {
if ($debug) {
$c++;
echo '#' . $c . ' [' . date('d.m.Y H:i.s') . '] ' . $string . "<br />\n";
echo '<span class="block_level">#' . $c . ' [' . date('d.m.Y H:i.s') . '] ' . $string . "</span>";
}
}
@ -139,7 +139,7 @@ class Serendipity_Import_MovableType extends Serendipity_Import {
$au_inf = serendipity_fetchAuthor($data);
if ( !is_array($au_inf) ) {
$tasks[] = sprintf(CREATE_AUTHOR, htmlspecialchars($data));
$tasks[] = 'Input array is: ' . print_r($data, true) . '<br />Return is: ' . print_r($au_inf, true) . '<br />';
$tasks[] = '<ul class="plainList"><li>Input array is: ' . print_r($data, true) . '</li><<li>Return is: ' . print_r($au_inf, true) . '</li></ul>';
$au_inf = serendipity_fetchAuthor($serendipity['authorid']);
}
$authors[$data] = $au_inf[0];
@ -183,7 +183,9 @@ class Serendipity_Import_MovableType extends Serendipity_Import {
$cat_found = false;
if (is_array($this->categories)) {
for ( $y=0 ; $y<sizeof($this->categories) ; $y++ ) {
echo '"' . $this->categories[$y]['category_name'] . '" == "' . $data . '"<br />';
echo '<span class="block_level">';
echo '"' . $this->categories[$y]['category_name'] . '" == "' . $data;
echo '</span>';
if ( $this->categories[$y]['category_name'] == $data ) {
$cat_found = true;
break;
@ -425,7 +427,7 @@ class Serendipity_Import_MovableType extends Serendipity_Import {
if ( !sizeof($tasks) || $force == true ) {
serendipity_db_begin_transaction();
foreach ($entries as $entry) {
#echo '<pre>' . printR_($entry, true) . '</pre><br />';
#echo '<pre>' . printR_($entry, true) . '</pre>';
#continue;
if (empty($entry['authorid'])) {
$entry['authorid'] = $serendipity['authorid'];
@ -472,4 +474,4 @@ class Serendipity_Import_MovableType extends Serendipity_Import {
}
}
return 'Serendipity_Import_MovableType';
?>
?>

View File

@ -59,7 +59,7 @@ class Serendipity_Import_OldBlogger extends Serendipity_Import {
<p class="style1">BLOGGER.COM to SERENDIPITY IMPORT</p>
<p class="style2">Version 0.1,( 29/10/2005 )</p>
<p class="style2"> <br />
<p class="style2">
1. First go to Blogger.com, login.</p>
<p class="style2">2. Go to the templates section. Set the following as your template. You should backup the current template if you want to reset it back after this operation. Click &quot;Save template changes&quot; button to save this new template.</p>
<p class="style2">
@ -97,10 +97,8 @@ ENDPOST
<p class="style2">9. Now in the box below type in the path to the &quot;index.html&quot; file blogger created under your &quot;blogger&quot; directory. File path should then look something like &quot;/httpdocs/blogger/index.html&quot;.</p>
<p class="style2">10. This script will create the users as from the blogger blog being imported. However if a user already exists, then that user will be used instead of creating a new user with similar name. For the new users that this script will create, you need to provide a default password. Type it in the box below.</p>
<p class="style2">11. Click &quot;Submit&quot;. Your posts and comments should be imported to serendipity!</p>
<p class="style2"> If you have questions or problems, feel free to drop me a mail at jaa at technova dot com dot mv.<br />
<br />
Jaa<br />
http://jaa.technova.com.mv</p>';
<p class="style2"> If you have questions or problems, feel free to drop me a mail at jaa at technova dot com dot mv.</p>
<p class="style2">Jaa, http://jaa.technova.com.mv</p>';
return $out;
}
@ -127,45 +125,45 @@ http://jaa.technova.com.mv</p>';
# locate the post title
if (preg_match("/TITLE:(.*)/", $post, $title)) {
$title = trim($title[1]);
echo "<b>" . htmlspecialchars($title) . "</b><br />";
echo "<b class='block_level'>" . htmlspecialchars($title) . "</b>";
} else {
$title = "";
echo "<b>Empty title</b><br />";
echo "<b class='block_level'>Empty title</b>";
}
# locate the post author
if (preg_match("/AUTHOR:(.*)/", $post, $author)) {
$author = trim($author[1]);
echo "<em>" . htmlspecialchars($author[1]) . "</em><br />";
echo "<em class='block_level'>" . htmlspecialchars($author[1]) . "</em>";
} else {
$author = "";
echo "<em>Unknown author</em><br />";
echo "<em class='block_level'>Unknown author</em>";
}
# locate the post date
if (preg_match("/DATE:(.*)/", $post, $date)) {
$date = strtotime(trim($date[1]));
echo "Posted on " . htmlspecialchars($date[1]) . ".<br />";
echo "<span class='block_level'>Posted on " . htmlspecialchars($date[1]) . ".</span>";
} else {
$date = time();
echo "Unknown posting time.<br />";
echo "<span class='block_level'>Unknown posting time.</span>";
}
# locate the post body
if (preg_match("/BODY:(.*)-----/sU", $post, $body)) {
$body = trim($body[1]);
echo strlen($body) . " Bytes of text.<br />";
echo '<span class="block_level">' . strlen($body) . " Bytes of text.</span>";
} else {
$body = "";
echo "<strong>Empty Body!</strong><br />";
echo "<span class='msg_error'>Empty Body!</span>";
}
# find all comments for the post using pattern matching
if (preg_match_all( "/COMMENT:(.*)----/sU", $post, $commentlist)) {
echo count($commentlist[1]) . " comments found.<br />";
echo '<span class="block_level">' . count($commentlist[1]) . " comments found.</span>";
} else {
$commentlist = array();
echo "No comments found.<br />";
echo "<span class='block_level'>No comments found.</span>";
}
$result = serendipity_db_query("SELECT authorid FROM ". $serendipity['dbPrefix'] ."authors WHERE username = '". serendipity_db_escape_string($author) ."' LIMIT 1", true, 'assoc');
@ -192,12 +190,12 @@ http://jaa.technova.com.mv</p>';
'authorid' => $authorid
);
echo "Entry insert...<br />";
echo "<span class='block_level'>Entry insert...</span>";
if (!is_int($id = serendipity_updertEntry($entry))) {
echo "Inserting entry failed.<br />";
echo "<span class='msg_error'>Inserting entry failed.</span>";
return $id;
} else {
echo "Entry $id inserted.<br />";
echo "<span class='msg_notice'>Entry $id inserted.</span>";
}
# iterate through all comments
@ -242,10 +240,10 @@ http://jaa.technova.com.mv</p>';
}
serendipity_db_query("UPDATE ". $serendipity['dbPrefix'] ."entries SET comments = ". $c ." WHERE id = ". $id);
echo "Comment count set to: ". $c ."<br />";
echo "<span class='block_level'>Comment count set to: ". $c ."</span>";
}
echo "Import finished.<br />";
echo "<span class='msg_success'>Import finished.</span>";
return true;
}
@ -254,4 +252,4 @@ http://jaa.technova.com.mv</p>';
return 'Serendipity_Import_OldBlogger';
/* vim: set sts=4 ts=4 expandtab : */
?>
?>

View File

@ -74,7 +74,7 @@ class Serendipity_Import_Pivot extends Serendipity_Import {
$this->data['pivot_path'] = $check_dir;
}
printf('<br />' . CHECKING_DIRECTORY . '<br /><br />', $this->data['pivot_path']);
printf('<span class="block_level">' . CHECKING_DIRECTORY . ': ', $this->data['pivot_path']) . '</span>';
if ($root = opendir($this->data['pivot_path'])) {
// Fetch category data:
$s9y_categories = serendipity_fetchCategories('all');
@ -83,6 +83,7 @@ class Serendipity_Import_Pivot extends Serendipity_Import {
'categories' => array()
);
echo '<ul>';
foreach($categories AS $pivot_category_id => $category) {
$found = false;
$pivot_category = trim(stripslashes($category[0]));
@ -94,10 +95,10 @@ class Serendipity_Import_Pivot extends Serendipity_Import {
}
if ($found) {
echo '&middot; Pivot Category "' . htmlspecialchars($pivot_category) . '" mapped to Serendipity ID ' . $found . '<br />';
echo '<li>Pivot Category "' . htmlspecialchars($pivot_category) . '" mapped to Serendipity ID ' . $found . '</li>';
$pivot_to_s9y['categories'][$pivot_category] = $found;
} else {
echo '&middot; Created Pivot Category "' . htmlspecialchars($pivot_category) . '".<br />';
echo '<li>Created Pivot Category "' . htmlspecialchars($pivot_category) . '".</li>';
$cat = array('category_name' => $pivot_category,
'category_description' => '',
'parentid' => 0,
@ -114,11 +115,11 @@ class Serendipity_Import_Pivot extends Serendipity_Import {
while (false !== ($dir = readdir($root))) {
if ($dir[0] == '.') continue;
if (substr($dir, 0, 8) == 'standard') {
printf('&nbsp;&nbsp;&middot; ' . CHECKING_DIRECTORY . '...<br />', $dir);
printf('<li>' . CHECKING_DIRECTORY . '...</li>', $dir);
$data = $this->unserialize($this->data['pivot_path'] . '/' . $dir . '/index-' . $dir . '.php');
if (empty($data) || !is_array($data) || count($data) < 1) {
echo '&nbsp;&nbsp;&nbsp;&nbsp;&middot; <strong style="color: red">FATAL: File <em>' . $dir . '/index-' . $dir . '.php</em> has no data!</strong><br />';
echo '<li><span class="msg_error">FATAL: File <em>' . $dir . '/index-' . $dir . '.php</em> has no data!</span></li>';
flush();
ob_flush();
continue;
@ -128,14 +129,14 @@ class Serendipity_Import_Pivot extends Serendipity_Import {
$entryid = str_pad($entry['code'], 5, '0', STR_PAD_LEFT);
if ($i >= $max_import) {
echo '&nbsp;&nbsp;&nbsp;&nbsp;&middot; Skipping entry data for #' . $entryid . '<br />';
echo '<li>Skipping entry data for #' . $entryid . '</li>';
continue;
}
echo '&nbsp;&nbsp;&nbsp;&nbsp;&middot; Fetching entry data for #' . $entryid . '<br />';
echo '<li>Fetching entry data for #' . $entryid . '</li>';
$entrydata = $this->unserialize($this->data['pivot_path'] . '/' . $dir . '/' . $entryid . '.php');
if (empty($entrydata) || !is_array($entrydata) || count($entrydata) < 1) {
echo '&nbsp;&nbsp;&nbsp;&nbsp;&middot; <strong style="color: red">FATAL: File <em>' . $dir . '/' . $entryid . '.php</em> has no data!</strong><br />';
echo '<li><span class="msg_error">FATAL: File <em>' . $dir . '/' . $entryid . '.php</em> has no data!</span></li>';
flush();
ob_flush();
continue;
@ -182,12 +183,13 @@ class Serendipity_Import_Pivot extends Serendipity_Import {
serendipity_db_insert('comments', $comment);
}
}
echo '&nbsp;&nbsp;&nbsp;&nbsp;&middot; <strong style="color: green">Entry #' . $entryid . ' imported</strong><br />';
echo '<li><span class="msg_success">Entry #' . $entryid . ' imported</span></li>';
flush();
ob_flush();
}
}
}
echo '</ul>';
} else {
return sprintf(ERROR_NO_DIRECTORY, $this->data['pivot_path']);
}

View File

@ -17,12 +17,11 @@ class Serendipity_Import_Serendipity extends Serendipity_Import {
function getImportNotes() {
// TODO: I18n!
return 'This importer is still work in progress. It can currently import most things of the database. HOWEVER it can NOT import previously installed plugins (including their configuration) or any database tables of installed plugins. Those must be migrated manually. Also, you must use FTP to transfer your uploaded images to the new location.<br />
Please do a test-run first if you are SQL-savvy. If you encounter any errors, save the message output you get - it will definitely help debugging!<br />
<br/>
This is <strong>NOT</strong> an importer meant for upgrading Serendipity. This importer assumes that both Serendipity installations use the same version.<br />
It is strongly advised that you test this importer in an isolated environment first, do not use it on a production blog unless you made sure it works in a cloned installation. Always make a backup of both the source and the target blog.<br /><br />
After these precautions: The importer code generally works very well for me and my purposes. Your mileage may vary.';
return '<p>This importer is still work in progress. It can currently import most things of the database. HOWEVER it can NOT import previously installed plugins (including their configuration) or any database tables of installed plugins. Those must be migrated manually. Also, you must use FTP to transfer your uploaded images to the new location.</p>
<p>Please do a test-run first if you are SQL-savvy. If you encounter any errors, save the message output you get - it will definitely help debugging!</p>
<p>This is <strong>NOT</strong> an importer meant for upgrading Serendipity. This importer assumes that both Serendipity installations use the same version.</p>
<p>It is strongly advised that you test this importer in an isolated environment first, do not use it on a production blog unless you made sure it works in a cloned installation. Always make a backup of both the source and the target blog.<p/>
<p>After these precautions: The importer code generally works very well for me and my purposes. Your mileage may vary.</p>';
}
function Serendipity_Import_Serendipity ($data) {
@ -96,7 +95,7 @@ class Serendipity_Import_Serendipity extends Serendipity_Import {
function import_table(&$s9ydb, $table, $primary_keys, $where = null, $dupe_check = false, $fix_relations = false, $skip_dupes = false) {
global $serendipity;
echo "<br /><br />Starting with table <strong>{$table}</strong>...<br />\n";
echo "<span class='block_level'>Starting with table <strong>{$table}</strong>...</span>";
if ($dupe_check) {
$dupes = serendipity_db_query("SELECT * FROM {$serendipity['dbPrefix']}" . $table . " " . $where, false, 'both', false, $dupe_check);
@ -161,7 +160,7 @@ class Serendipity_Import_Serendipity extends Serendipity_Import {
}
if (!$this->execute && $this->debug) {
echo "Fix relation from $fix_relation_table.$fix_relation_primary_key={$primary_vals[$fix_relation_primary_key]} to {$row[$primary_key]} (assoc_val: $assoc_val)<br />\n";
echo "<span>Fix relation from $fix_relation_table.$fix_relation_primary_key={$primary_vals[$fix_relation_primary_key]} to {$row[$primary_key]} (assoc_val: $assoc_val)</span>";
}
}
}
@ -170,7 +169,7 @@ class Serendipity_Import_Serendipity extends Serendipity_Import {
if ($insert) {
if ($dupe_check && isset($dupes[$row[$dupe_check]])) {
if ($this->debug) {
echo "Skipping duplicate: <pre>" . print_r($dupes[$row[$dupe_check]], true) . "</pre><br />\n";
echo "Skipping duplicate: <pre>" . print_r($dupes[$row[$dupe_check]], true) . "</pre>";
}
foreach($primary_vals AS $primary_key => $primary_val) {
$this->storage[$table][$primary_key][$primary_val] = $dupes[$row[$dupe_check]][$primary_key];
@ -182,7 +181,7 @@ class Serendipity_Import_Serendipity extends Serendipity_Import {
$dbid = serendipity_db_insert_id($table, $primary_key);
$this->storage[$table][$primary_key][$primary_val] = $dbid;
}
echo "Migrated entry #{$dbid} into {$table}.<br />\n";
echo "<span class='block_level'>Migrated entry #{$dbid} into {$table}.</span>";
} else {
if ($this->debug) {
echo 'DB Insert: <pre>' . print_r($row, true) . '</pre>';
@ -199,7 +198,7 @@ class Serendipity_Import_Serendipity extends Serendipity_Import {
}
} else {
if ($this->debug && !$this->execute) {
echo "Ignoring Duplicate.<br />\n";
echo "<span class='block_level'>Ignoring Duplicate.</span>";
}
}
}
@ -207,7 +206,7 @@ class Serendipity_Import_Serendipity extends Serendipity_Import {
if (!$this->execute) {
echo 'Storage on '. $table . ':<pre>' . print_r($this->storage[$table], true) . '</pre>';
} else {
echo "Finished table <strong>{$table}</strong><br />\n";
echo "<span class='block_level'>Finished table <strong>{$table}</strong></span>";
}
}
@ -470,4 +469,4 @@ class Serendipity_Import_Serendipity extends Serendipity_Import {
return 'Serendipity_Import_Serendipity';
/* vim: set sts=4 ts=4 expandtab : */
/* vim: set sts=4 ts=4 expandtab : */

View File

@ -13,7 +13,7 @@ class Serendipity_Import_smf extends Serendipity_Import {
var $categories = array();
function getImportNotes() {
return 'SMF uses salted MD5 passwords that Serendipity cannot import. Thus, those passwords are incompatible with the MD5 hashing of Serendipity. The passwords for all users have been set to a random string. <strong>You need to modify the passwords manually for each user</strong>, we are sorry for that inconvenience.<br />';
return '<p>SMF uses salted MD5 passwords that Serendipity cannot import. Thus, those passwords are incompatible with the MD5 hashing of Serendipity. The passwords for all users have been set to a random string. <strong>You need to modify the passwords manually for each user</strong>, we are sorry for that inconvenience.</p>';
}
function Serendipity_Import_smf($data) {

View File

@ -13,9 +13,8 @@ class Serendipity_Import_sunlog extends Serendipity_Import {
var $categories = array();
function getImportNotes() {
return 'Sunlog uses a crypted string to represent stored passwords. Thus, those passwords are incompatible with the MD5 hashing of Serendipity and can not be reconstructed. The passwords for all users have been set to "sunlog". <strong>You need to modify the passwords manually for each user</strong>, we are sorry for that inconvenience.<br />'
. '<br />'
. 'Sunlog has a granular control over access privileges which cannot be migrated to Serendipity. All Users will be migrated as Superusers, you may need to set them to editor or chief users manually after import.';
return '<p>Sunlog uses a crypted string to represent stored passwords. Thus, those passwords are incompatible with the MD5 hashing of Serendipity and can not be reconstructed. The passwords for all users have been set to "sunlog". <strong>You need to modify the passwords manually for each user</strong>, we are sorry for that inconvenience.</p>'
. '<p>Sunlog has a granular control over access privileges which cannot be migrated to Serendipity. All Users will be migrated as Superusers, you may need to set them to editor or chief users manually after import.</p>';
}
function Serendipity_Import_sunlog($data) {

View File

@ -13,7 +13,7 @@ class Serendipity_Import_textpattern extends Serendipity_Import {
var $categories = array();
function getImportNotes() {
return 'Textpattern uses MySQLs native PASSWORD() function to save passwords. Thus, those passwords are incompatible with the MD5 hashing of Serendipity. The passwords for all users have been set to "txp". <strong>You need to modify the passwords manually for each user</strong>, we are sorry for that inconvenience.<br />';
return '<p>Textpattern uses MySQLs native PASSWORD() function to save passwords. Thus, those passwords are incompatible with the MD5 hashing of Serendipity. The passwords for all users have been set to "txp". <strong>You need to modify the passwords manually for each user</strong>, we are sorry for that inconvenience.</p>';
}
function Serendipity_Import_textpattern($data) {

View File

@ -82,7 +82,7 @@ class Serendipity_Import_VoodooPad extends Serendipity_Import {
// Dependency on static pages
if (!class_exists('serendipity_event_staticpage')) {
die(IMPORTER_VOODOO_REQUIREMENTFAIL . '<br/>');
die('<span class="msg_error">' . IMPORTER_VOODOO_REQUIREMENTFAIL . '</span>');
}
// The selected file
@ -160,18 +160,18 @@ class Serendipity_Import_VoodooPad extends Serendipity_Import {
// Either replace or insert depending on previous existence
if (!isset($thispage['id'])) {
echo '<br/>'.IMPORTER_VOODOO_CREATINGPAGE.': '. $mykey;
echo '<span class="block_level">'.IMPORTER_VOODOO_CREATINGPAGE.': '. $mykey.'</span>';
serendipity_db_insert('staticpages', $thispage);
$serendipity["POST"]["staticpage"] = serendipity_db_insert_id("staticpages", 'id');
} elseif ($this->data['updateExisting'] == 'true') {
echo '<br/>'.IMPORTER_VOODOO_UPDATINGPAGE.': '. $mykey;
echo '<span class="block_level">'.IMPORTER_VOODOO_UPDATINGPAGE.': '. $mykey.'</span>';
serendipity_db_update("staticpages", array("id" => $thispage["id"]), $thispage);
} else {
echo '<br/>'.IMPORTER_VOODOO_NOTUPDATING.': '. $mykey;
echo '<span class="block_level">'.IMPORTER_VOODOO_NOTUPDATING.': '. $mykey.'</span>';
}
} else {
// If its a url, the content is the link instead
echo '<br/>'.IMPORTER_VOODOO_RECORDURL.': '.$thispage['headline'];
echo '<span class="block_level">'.IMPORTER_VOODOO_RECORDURL.': '.$thispage['headline'].'</span>';
$aliases[$thispage['headline']] = $thispage['content'];
}
break;
@ -179,7 +179,6 @@ class Serendipity_Import_VoodooPad extends Serendipity_Import {
}
// Now rewrite the permalinks
echo '<br/>';
if ($this->data['shouldWriteLinks'] == 'true') {
Serendipity_Import_VoodooPad::write_links($aliases);
}
@ -192,7 +191,7 @@ class Serendipity_Import_VoodooPad extends Serendipity_Import {
global $serendipity;
// **TODO** Change this to pull out only entries for the current wiki
echo '<br/><p>'.IMPORTER_VOODOO_WRITEINTRALINKS.'</p>';
echo '<p>'.IMPORTER_VOODOO_WRITEINTRALINKS.'</p>';
$pages= &serendipity_db_query("SELECT * FROM {$serendipity['dbPrefix']}staticpages ORDER BY pagetitle DESC");
@ -210,7 +209,7 @@ class Serendipity_Import_VoodooPad extends Serendipity_Import {
serendipity_db_update("staticpages", array("id" => $thispage["id"]), $thispage);
}
echo DONE . '<br />';
echo '<span class="msg_success">' . DONE . '</span>';
}
// Search and replace avoiding content of links

View File

@ -110,7 +110,7 @@ class Serendipity_Import_WordPress extends Serendipity_Import {
if (!$res) {
printf(COULDNT_SELECT_USER_INFO, mysql_error($wpdb));
} else {
if ($debug) echo "Importing users...<br />\n";
if ($debug) echo "<span class='block_level'>Importing users...</span>";
for ($x=0, $c = mysql_num_rows($res) ; $x < $c ; $x++) {
$users[$x] = mysql_fetch_assoc($res);
@ -137,7 +137,7 @@ class Serendipity_Import_WordPress extends Serendipity_Import {
// Set association.
$assoc['users'][$users[$x]['ID']] = $users[$x]['authorid'];
}
if ($debug) echo "Imported users.<br />\n";
if ($debug) echo "<span class='msg_success'>Imported users.</span>";
// Clean memory
unset($users);
@ -152,7 +152,7 @@ class Serendipity_Import_WordPress extends Serendipity_Import {
if (!$res) {
$no_cat = mysql_error($wpdb);
} else {
if ($debug) echo "Importing categories (WP 2.2 style)...<br />\n";
if ($debug) echo "<span class='block_level'>Importing categories (WP 2.2 style)...</span>";
// Get all the info we need
for ($x=0 ; $x<mysql_num_rows($res) ; $x++) {
@ -196,10 +196,10 @@ class Serendipity_Import_WordPress extends Serendipity_Import {
// Clean memory
unset($categories);
if ($debug) echo "Imported categories.<br />\n";
if ($debug) echo "Rebuilding category tree...<br />\n";
if ($debug) echo "<span class='block_level'>Imported categories.</span>";
if ($debug) echo "<span class='block_level'>Rebuilding category tree...</span>";
serendipity_rebuildCategoryTree();
if ($debug) echo "Rebuilt category tree.<br />\n";
if ($debug) echo "<span class='block_level'>Rebuilt category tree.</span>";
}
/* Categories (WP >= 2.3 style) */
@ -219,7 +219,7 @@ class Serendipity_Import_WordPress extends Serendipity_Import {
$no_cat = mysql_error($wpdb);
} elseif ($res) {
$no_cat = false;
if ($debug) echo "Importing categories (WP 2.3 style)...<br />\n";
if ($debug) echo "<span class='block_level'>Importing categories (WP 2.3 style)...</span>";
// Get all the info we need
for ($x=0 ; $x<mysql_num_rows($res) ; $x++) {
@ -263,10 +263,10 @@ class Serendipity_Import_WordPress extends Serendipity_Import {
// Clean memory
unset($categories);
if ($debug) echo "Imported categories.<br />\n";
if ($debug) echo "Rebuilding category tree...<br />\n";
if ($debug) echo "<span class='block_level'>Imported categories.</span>";
if ($debug) echo "<span class='block_level'>Rebuilding category tree...</span>";
serendipity_rebuildCategoryTree();
if ($debug) echo "Rebuilt category tree.<br />\n";
if ($debug) echo "<span class='block_level'>Rebuilt category tree.</span>";
}
if ($no_cat) {
printf(COULDNT_SELECT_CATEGORY_INFO, $no_cat);
@ -282,7 +282,7 @@ class Serendipity_Import_WordPress extends Serendipity_Import {
if (!$res) {
printf(COULDNT_SELECT_ENTRY_INFO, mysql_error($wpdb));
} else {
if ($debug) echo "Importing entries...<br />\n";
if ($debug) echo "<span class='block_level'>Importing entries...</span>";
for ($x=0, $c = mysql_num_rows($res) ; $x < $c ; $x++ ) {
$entries[$x] = mysql_fetch_assoc($res);
@ -300,13 +300,13 @@ class Serendipity_Import_WordPress extends Serendipity_Import {
if (!is_int($entries[$x]['entryid'] = serendipity_updertEntry($entry))) {
printf(COULDNT_SELECT_ENTRY_INFO, mysql_error($wpdb));
echo "ID: {$entries[$x]['ID']} - {$entry['title']}<br />\n";
echo "<span class='block_level'>ID: {$entries[$x]['ID']} - {$entry['title']}</span>";
return $entries[$x]['entryid'];
}
$assoc['entries'][$entries[$x]['ID']] = $entries[$x]['entryid'];
}
if ($debug) echo "Imported entries...<br />\n";
if ($debug) echo "<span class='msg_success'>Imported entries...</span>";
// Clean memory
unset($entries);
@ -318,13 +318,13 @@ class Serendipity_Import_WordPress extends Serendipity_Import {
if (!$res) {
$no_entrycat = mysql_error($wpdb);
} else {
if ($debug) echo "Importing category associations (WP 2.2 style)...<br />\n";
if ($debug) echo "<span class='block_level'>Importing category associations (WP 2.2 style)...</span>";
while ($a = mysql_fetch_assoc($res)) {
$data = array('entryid' => $assoc['entries'][$a['post_id']],
'categoryid' => $assoc['categories'][$a['category_id']]);
serendipity_db_insert('entrycat', $this->strtrRecursive($data));
}
if ($debug) echo "Imported category associations.<br />\n";
if ($debug) echo "<span class='msg_success'>Imported category associations.</span>";
}
/* Entry/category (WP > 2.3 style)*/
@ -335,13 +335,13 @@ class Serendipity_Import_WordPress extends Serendipity_Import {
$no_entrycat = mysql_error($wpdb);
} elseif ($res) {
$no_entrycat = false;
if ($debug) echo "Importing category associations (WP 2.3 style)...<br />\n";
if ($debug) echo "<span class='block_level'>Importing category associations (WP 2.3 style)...</span>";
while ($a = mysql_fetch_assoc($res)) {
$data = array('entryid' => $assoc['entries'][$a['post_id']],
'categoryid' => $assoc['categories'][$a['category_id']]);
serendipity_db_insert('entrycat', $this->strtrRecursive($data));
}
if ($debug) echo "Imported category associations.<br />\n";
if ($debug) echo "<span class='msg_success'>Imported category associations.</span>";
}
if ($no_entrycat) {
@ -354,7 +354,7 @@ class Serendipity_Import_WordPress extends Serendipity_Import {
printf(COULDNT_SELECT_COMMENT_INFO, mysql_error($wpdb));
} else {
$serendipity['allowSubscriptions'] = false;
if ($debug) echo "Importing comments...<br />\n";
if ($debug) echo "<span class='block_level'>Importing comments...</span>";
while ($a = mysql_fetch_assoc($res)) {
$comment = array('entry_id ' => $assoc['entries'][$a['comment_post_ID']],
'parent_id' => 0,
@ -373,7 +373,7 @@ class Serendipity_Import_WordPress extends Serendipity_Import {
serendipity_approveComment($cid, $assoc['entries'][$a['comment_post_ID']], true);
}
}
if ($debug) echo "Imported comments.<br />\n";
if ($debug) echo "<span class='msg_success'>Imported comments.</span>";
}
$serendipity['noautodiscovery'] = $noautodiscovery;

View File

@ -372,8 +372,8 @@ if (isset($_GET['serendipity']['plugin_to_conf'])) {
/* Load the new plugin */
$plugin = &serendipity_plugin_api::load_plugin($inst);
if (!is_object($plugin)) {
echo "DEBUG: Plugin $inst not an object: " . print_r($plugin, true) . ".<br />Input: " . print_r($serendipity['GET'], true) . ".<br /><br />\n\nThis error can happen if a plugin was not properly downloaded (check your plugins directory if the requested plugin was downloaded) or the inclusion of a file failed (permissions?)<br />\n";
echo "Backtrace:<br />\n" . implode("<br />\n", $serendipity['debug']['pluginload']) . "<br />";
echo "<dl><dt>DEBUG: Plugin $inst not an object: " . print_r($plugin, true) . ".</dt><dd>Input: " . print_r($serendipity['GET'], true) . ".</dd><dd>This error can happen if a plugin was not properly downloaded (check your plugins directory if the requested plugin was downloaded) or the inclusion of a file failed (permissions?)</dd>";
echo "<dt>Backtrace:</dt><dd>" . implode("<br />\n", $serendipity['debug']['pluginload']) . "<br /></dd></dl>";
}
$bag = new serendipity_property_bag;
$plugin->introspect($bag);

View File

@ -94,7 +94,7 @@ $tasks = array(array('version' => '0.5.1',
'function' => 'serendipity_removeFiles',
'title' => 'Removal of obsolete files',
'arguments' => array($obsolete_files),
'desc' => 'The directory structure has been reworked. The following files will be moved to a folder called "backup". If you made manual changes to those files, be sure to read the file docs/CHANGED_FILES to re-implement your changes.<br /><div style="font-size: x-small; margin: 15px">' . implode(', ', $obsolete_files) . '</div>'),
'desc' => '<p>The directory structure has been reworked. The following files will be moved to a folder called "backup". If you made manual changes to those files, be sure to read the file docs/CHANGED_FILES to re-implement your changes.</p><div style="font-size: x-small; margin: 15px">' . implode(', ', $obsolete_files) . '</div>'),
array('version' => '0.8-alpha4',
'function' => 'serendipity_removeFiles',
@ -142,9 +142,9 @@ $tasks = array(array('version' => '0.5.1',
'function' => 'serendipity_fixPlugins',
'arguments' => array('markup_column_names'),
'title' => 'Configuration options of markup plugins',
'desc' => 'Because of the latest multilingual improvements in Serendipity, the database key names for certain configuration directives only found in markup plugins need to be renamed.<br />'
. 'This will be automatically handled by Serendipity for all internally bundled and external plugins. If you are using the external plugins "GeShi" and "Markdown", please make sure you will upgrade to their latest versions!<br />'
. 'We also advise that you check the plugin configuration of all your markup plugins (like emoticate, nl2br, s9ymarkup, bbcode) and see if the settings you made are all properly migrated.'),
'desc' => '<p>Because of the latest multilingual improvements in Serendipity, the database key names for certain configuration directives only found in markup plugins need to be renamed.</p>'
. '<p>This will be automatically handled by Serendipity for all internally bundled and external plugins. If you are using the external plugins "GeShi" and "Markdown", please make sure you will upgrade to their latest versions!</p>'
. '<p>We also advise that you check the plugin configuration of all your markup plugins (like emoticate, nl2br, s9ymarkup, bbcode) and see if the settings you made are all properly migrated.</p>'),
array('version' => '0.8-beta5',
'function' => 'serendipity_smarty_purge',

View File

@ -936,14 +936,14 @@ function serendipity_displayTopUrlList($list, $limit, $use_links = true, $interv
foreach ($rows as $row) {
if ($use_links) {
printf(
'<a href="%1$s://%2$s" title="%2$s" >%2$s</a> (%3$s)<br />',
'<span class="block_level"><a href="%1$s://%2$s" title="%2$s" >%2$s</a> (%3$s)</span>',
htmlspecialchars($row['scheme']),
htmlspecialchars($row['host']),
htmlspecialchars($row['total'])
);
} else {
printf(
'%1$s (%2$s)<br />',
'<span class="block_level">%1$s (%2$s)</span>',
htmlspecialchars($row['host']),
htmlspecialchars($row['total'])
);

View File

@ -803,6 +803,7 @@ function serendipity_iframe(&$entry, $mode = null, $use_smarty = true) {
$show = false;
switch ($mode) {
case 'save':
echo '<div class="clearfix">';
echo '<div style="float: left; height: 75px"></div>';
$res = serendipity_updertEntry($entry);
@ -817,15 +818,16 @@ function serendipity_iframe(&$entry, $mode = null, $use_smarty = true) {
$entrylink = serendipity_archiveURL($res, $entry['title'], 'serendipityHTTPPath', true, array('timestamp' => $entry['timestamp']));
echo '<div class="serendipityAdminMsgSuccess msg_success"><img class="img_error" src="' . serendipity_getTemplateFile('admin/img/admin_msg_success.png') . '" alt="" />' . ENTRY_SAVED . ' (<a href="' . $entrylink . '" target="_blank">' . VIEW . '</a>)</div>';
}
echo '<br style="clear: both" />';
echo '</div>';
$show = true;
break;
case 'preview':
echo '<div class="clearfix">';
echo '<div id="serendipity_preview_spacer" style="float: left; height: 225px"></div>';
serendipity_printEntries(array($entry), ($entry['extended'] != '' ? 1 : 0), true);
echo '<br id="serendipity_preview_spacer2" style="clear: both" />';
echo '</div>';
$show = true;
break;
@ -879,7 +881,7 @@ function serendipity_iframe_create($mode, &$entry) {
echo '<iframe src="serendipity_admin.php?serendipity[is_iframe]=true&amp;serendipity[iframe_mode]=' . $mode . '" id="serendipity_iframe" name="serendipity_iframe" ' . $attr . ' width="100%" frameborder="0" marginwidth="0" marginheight="0" scrolling="auto" title="Serendipity">'
. IFRAME_WARNING
. '</iframe><br /><br />';
. '</iframe>';
}
/**

View File

@ -1500,7 +1500,7 @@ function serendipity_generateCategoryList($cats, $select = array(0), $type = 0,
if ($cat['parentid'] == $id) {
switch ($type) {
case 0:
$ret .= str_repeat('&nbsp;', $level * 2).'&bull;&nbsp;<span id="catItem_' . $cat['categoryid'] . '"' . (($cat['categoryid'] && in_array($cat['categoryid'], $select)) ? ' selected="selected"' : '') . '><a href="?serendipity[adminModule]=category&amp;serendipity[cat][catid]=' . $cat['categoryid'] . '">' . (!empty($cat['category_icon']) ? '<img style="vertical-align: middle;" src="' . $cat['category_icon'] . '" border="0" alt="' . $cat['category_name'] . '"/> ' : '') . htmlspecialchars($cat['category_name']) . (!empty($cat['category_description']) ? ' - ' . htmlspecialchars($cat['category_description']) : '') . '</a></span><br/>' . "\n";
$ret .= str_repeat('&nbsp;', $level * 2).'&bull;&nbsp;<span class="block_level" id="catItem_' . $cat['categoryid'] . '"' . (($cat['categoryid'] && in_array($cat['categoryid'], $select)) ? ' selected="selected"' : '') . '><a href="?serendipity[adminModule]=category&amp;serendipity[cat][catid]=' . $cat['categoryid'] . '">' . (!empty($cat['category_icon']) ? '<img style="vertical-align: middle;" src="' . $cat['category_icon'] . '" border="0" alt="' . $cat['category_name'] . '"/> ' : '') . htmlspecialchars($cat['category_name']) . (!empty($cat['category_description']) ? ' - ' . htmlspecialchars($cat['category_description']) : '') . '</a></span>';
break;
case 1:
case 2:
@ -1525,7 +1525,7 @@ function serendipity_generateCategoryList($cats, $select = array(0), $type = 0,
htmlspecialchars($cat['category_name']));
} else {
$ret .= sprintf(
'%s<a href="%s" title="%s">%s</a><br />',
'<span class="block_level">%s<a href="%s" title="%s">%s</a></span>',
str_repeat('&#160;', $level * 3),
serendipity_categoryURL($cat, 'serendipityHTTPPath'),
htmlspecialchars($cat['category_description']),

View File

@ -128,7 +128,7 @@ function serendipity_printEntryForm($targetURL, $hiddens = array(), $entry = arr
}
if (!empty($serendipity['GET']['url'])) {
$entry['body'] .= "\n" . '<br /><a href="' . htmlspecialchars(utf8_decode(urldecode($serendipity['GET']['url']))) . '">' . $entry['title'] . '</a>';
$entry['body'] .= "\n" . '<a class="block_level" href="' . htmlspecialchars(utf8_decode(urldecode($serendipity['GET']['url']))) . '">' . $entry['title'] . '</a>';
}
$hidden = '';
@ -423,16 +423,15 @@ function serendipity_printEntryForm($targetURL, $hiddens = array(), $entry = arr
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td align="left" width="70%">
<input class="input_checkbox" id="checkbox_allow_comments" type="checkbox" name="serendipity[allow_comments]" value="true" <?php echo $allow_comments; ?> /><label for="checkbox_allow_comments"><?php echo COMMENTS_ENABLE; ?></label><br />
<input class="input_checkbox" id="checkbox_allow_comments" type="checkbox" name="serendipity[allow_comments]" value="true" <?php echo $allow_comments; ?> /><label for="checkbox_allow_comments"><?php echo COMMENTS_ENABLE; ?></label>
<input class="input_checkbox" id="checkbox_moderate_comments" type="checkbox" name="serendipity[moderate_comments]" value="true" <?php echo $moderate_comments; ?> /><label for="checkbox_moderate_comments"><?php echo COMMENTS_MODERATE; ?></label>
</td>
<td align="right" rowspan="2" valign="middle" width="30%">
<input accesskey="p" type="submit" value="- <?php echo PREVIEW; ?> -" class="serendipityPrettyButton input_button" style="width: 150px" onclick="document.forms['serendipityEntry'].elements['serendipity[preview]'].value='true';" /><br />
<input accesskey="p" type="submit" value="- <?php echo PREVIEW; ?> -" class="serendipityPrettyButton input_button" style="width: 150px" onclick="document.forms['serendipityEntry'].elements['serendipity[preview]'].value='true';" />
<input accesskey="s" type="submit" onclick="return checkSave();" value="- <?php echo SAVE; ?> -" class="serendipityPrettyButton input_button" style="width: 150px" />
</td>
</tr>
</table>
<br />
</td>
</tr>
@ -491,7 +490,6 @@ if (!$serendipity['wysiwyg']) {
<tr>
<td colspan="3">
<br />
<fieldset>
<legend><b><?php echo ADVANCED_OPTIONS; ?></b></legend>
<?php

View File

@ -492,8 +492,8 @@ function serendipity_insertHotlinkedImageInDatabase($filename, $url, $authorid =
$sql = serendipity_db_query($query);
if (is_string($sql)) {
echo $query . '<br />';
echo $sql . '<br />';
echo '<span class="block_level">' . $query . '</span>';
echo '<span class="block_level">' . $sql . '</span>';
}
$image_id = serendipity_db_insert_id('images', 'id');
@ -580,8 +580,8 @@ function serendipity_insertImageInDatabase($filename, $directory, $authorid = 0,
$sql = serendipity_db_query($query);
if (is_string($sql)) {
echo $query . '<br />';
echo $sql . '<br />';
echo '<span class="block_level">' . $query . '</span>';
echo '<span class="block_level">' . $sql . '</span>';
}
$image_id = serendipity_db_insert_id('images', 'id');
@ -1493,10 +1493,10 @@ function serendipity_displayImageList($page = 0, $lineBreak = NULL, $manage = fa
);
foreach ($aResultSet AS $sKey => $sFile) {
if ($sFile['directory']) {
if ($debug) echo "{$sFile['relpath']} is a directory.<br />";
if ($debug) echo "<span class='block_level'>{$sFile['relpath']} is a directory.</span>";
array_push($paths, $sFile);
} else {
if ($debug) echo "{$sFile['relpath']} is a file.<br />";
if ($debug) echo "<span class='block_level'>{$sFile['relpath']} is a file.</span>";
// Store the file in our array, remove any ending slashes
$aFilesOnDisk[$sFile['relpath']] = 1;
}
@ -1530,13 +1530,13 @@ function serendipity_displayImageList($page = 0, $lineBreak = NULL, $manage = fa
}
$sFileName = $sFile['path'] . $sFile['name'] . (empty($sFile['extension']) ? '' : '.' . $sFile['extension']);
if ($debug) echo "<p>File name is $sFileName,<br />thumbnail is $sThumbNailFile</p>";
if ($debug) echo "<p>File name is $sFileName, thumbnail is $sThumbNailFile</p>";
unset($aResultSet[$sKey]);
if (isset($aFilesOnDisk[$sFileName])) {
unset($aFilesOnDisk[$sFileName]);
} else {
if ($debug) echo "Deleting Image {$sFile['id']}<br />\n";
if ($debug) echo "<span class='block_level'>Deleting Image {$sFile['id']}</span>";
serendipity_deleteImage($sFile['id']);
++$nCount;
}
@ -2065,7 +2065,7 @@ function serendipity_directoryACL(&$paths, $type = 'read') {
static $debug = false;
if ($debug) {
echo "Applying ACL for mode '$type'.<br />\n";
echo "<span class='block_level'>Applying ACL for mode '$type'.</span>";
}
if (!is_array($paths)) {
@ -2130,19 +2130,19 @@ function serendipity_directoryACL(&$paths, $type = 'read') {
if ($granted === false) {
// We are not allowed to access this element
if ($debug) {
echo "ACL for " . $info['relpath'] . " DENIED.<br />\n";
echo "<span class='msg_error'>ACL for " . $info['relpath'] . " DENIED.</span>";
}
unset($paths[$idx]);
} else {
if ($debug) {
echo "ACL for " . $info['relpath'] . " granted.<br />\n";
echo "<span class='msg_success'>ACL for " . $info['relpath'] . " granted.</span>";
}
}
}
if (count($paths) < $startCount) {
if ($debug) {
echo "ACL denied all.<br />\n";
echo "<span class='msg_error'>ACL denied all.</span>";
}
return false;
}
@ -2789,10 +2789,10 @@ function serendipity_prepareMedia(&$file, $url = '') {
if (!$mimeicon) {
$mimeicon = serendipity_getTemplateFile('admin/img/mime_unknown.png');
}
$file['preview'] .= '<img src="'. $mimeicon .'" title="' . $file['path'] . $file['name'] . ' (' . $file['mime'] . ')" alt="'. $file['mime'] .'" /><br /><span style="font-weight: bold; font-size: 8pt">- ' . (($file['hotlink']) ? MEDIA_HOTLINKED : $file['mime']) .' -</span>';
$file['preview'] .= '<img src="'. $mimeicon .'" title="' . $file['path'] . $file['name'] . ' (' . $file['mime'] . ')" alt="'. $file['mime'] .'" /><span class="block_level" style="font-weight: bold; font-size: 8pt">- ' . (($file['hotlink']) ? MEDIA_HOTLINKED : $file['mime']) .' -</span>';
if ($url) {
$file['preview_url'] = $url .'&amp;serendipity[image]='. $file['id'];
$file['preview'] .= '<br /><a href="' . $file['preview_url'] . '">' . $file['name'] . (empty($file['extension']) ? '' : '.' . $file['extension']) . '</a>';
$file['preview'] .= '<a class="block_level" href="' . $file['preview_url'] . '">' . $file['name'] . (empty($file['extension']) ? '' : '.' . $file['extension']) . '</a>';
}
}

View File

@ -155,7 +155,7 @@ function show_plugins($event_only = false, $sidebars = null)
$name = htmlspecialchars($bag->get('name'));
$desc = htmlspecialchars($bag->get('description'));
$desc .= '<br />' . VERSION . ': <em>' . $bag->get('version') . '</em>';
$desc .= '<span class="block_level">' . VERSION . ': <em>' . $bag->get('version') . '</em></span>';
$title = serendipity_plugin_api::get_plugin_title($plugin, '[' . $name . ']');

View File

@ -70,7 +70,7 @@ function serendipity_printEntries_rss(&$entries, $version, $comments = false, $f
$entry['body'] .= ' ' . $entry['extended'];
$ext = '';
} elseif ($entry['exflag']) {
$ext = '<br /><a href="' . $entry['feed_entryLink'] . '#extended">' . sprintf(VIEW_EXTENDED_ENTRY, htmlspecialchars($entry['title'])) . '</a>';
$ext = '<a class="block_level" href="' . $entry['feed_entryLink'] . '#extended">' . sprintf(VIEW_EXTENDED_ENTRY, htmlspecialchars($entry['title'])) . '</a>';
} else {
$ext = '';
}

View File

@ -673,7 +673,7 @@ function serendipity_handle_references($id, $author, $title, $text, $dry_run = f
$old_references = serendipity_db_query("SELECT * FROM {$serendipity['dbPrefix']}references WHERE (type = '' OR type IS NULL) AND entry_id = " . (int)$id, false, 'assoc');
if ($debug && is_string($old_references)) {
echo $old_references . "<br />\n";
echo '<span class="block_level">' . $old_references . "</span>";
}
if (is_array($old_references) && count($old_references) > 0) {
@ -684,15 +684,15 @@ function serendipity_handle_references($id, $author, $title, $text, $dry_run = f
$saved_urls[$old_reference['link']] = true;
}
}
if ($debug) echo "Got references in dry run: <pre>" . print_r($current_references, true) . "</pre><br />\n";
if ($debug) echo "Got references in dry run: <pre>" . print_r($current_references, true) . "</pre>\n";
} else {
// A dry-run was called previously and restorable references are found. Restore them now.
$del = serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}references WHERE (type = '' OR type IS NULL) AND entry_id = " . (int)$id);
if ($debug && is_string($del)) {
echo $del . "<br />\n";
echo '<span class="block_level">' . $del . "</span>";
}
if ($debug) echo "Deleted references.<br />\n";
if ($debug) echo "<span class='block_level'>Deleted references.</span>";
if (is_array($old_references) && count($old_references) > 0) {
$current_references = array();
@ -702,12 +702,12 @@ function serendipity_handle_references($id, $author, $title, $text, $dry_run = f
$q = serendipity_db_insert('references', $old_reference, 'show');
$cr = serendipity_db_query($q);
if ($debug && is_string($cr)) {
echo $cr . "<br />\n";
echo '<span class="block_level">' . $cr . "</span>";
}
}
}
if ($debug) echo "Got references in final run: <pre>" . print_r($current_references, true) . "</pre><br />\n";
if ($debug) echo "Got references in final run: <pre>" . print_r($current_references, true) . "</pre>\n";
}
if (!preg_match_all('@<a[^>]+?href\s*=\s*["\']?([^\'" >]+?)[ \'"][^>]*>(.+?)</a>@i', $text, $matches)) {
@ -729,13 +729,13 @@ function serendipity_handle_references($id, $author, $title, $text, $dry_run = f
$checked_locations = array();
serendipity_plugin_api::hook_event('backend_trackbacks', $locations);
for ($i = 0, $j = count($locations); $i < $j; ++$i) {
if ($debug) echo "Checking {$locations[$i]}...<br />\n";
if ($debug) echo "<span class='block_level'>Checking {$locations[$i]}...</span>";
if ($locations[$i][0] == '/') {
$locations[$i] = 'http' . (!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off' ? 's' : '') . '://' . $_SERVER['HTTP_HOST'] . $locations[$i];
}
if (isset($checked_locations[$locations[$i]])) {
if ($debug) echo "Already checked.<br />\n";
if ($debug) echo "<span class='block_level'>Already checked.</span>";
continue;
}
@ -756,7 +756,7 @@ function serendipity_handle_references($id, $author, $title, $text, $dry_run = f
$row = serendipity_db_query($query, true, 'num');
if ($debug && is_string($row)) {
echo $row . "<br />\n";
echo '<span class="block_level">' . $row . "</span>";
}
$names[$i] = strip_tags($names[$i]);
@ -766,31 +766,31 @@ function serendipity_handle_references($id, $author, $title, $text, $dry_run = f
}
if ($row[0] > 0 && isset($saved_references[$locations[$i] . $names[$i]])) {
if ($debug) echo "Found references for $id, skipping rest<br />\n";
if ($debug) echo "<span class='block_level'>Found references for $id, skipping rest</span>";
continue;
}
if (!isset($serendipity['noautodiscovery']) || !$serendipity['noautodiscovery']) {
if (!$dry_run) {
if (!isset($saved_urls[$locations[$i]])){
if ($debug) echo "Enabling autodiscovery.<br />\n";
if ($debug) echo "<span class='block_level'>Enabling autodiscovery.</span>";
serendipity_reference_autodiscover($locations[$i], $url, $author, $title, serendipity_trackback_excerpt($text));
}
elseif ($debug) echo "This reference was already used before in $id and therefore will not be trackbacked again.<br/>\n";
elseif ($debug) echo "<span class='block_level'>This reference was already used before in $id and therefore will not be trackbacked again.</span>";
} elseif ($debug) {
echo "Dry run: Skipping autodiscovery<br />\n";
echo "<span class='block_level'>Dry run: Skipping autodiscovery</span>";
}
$checked_locations[$locations[$i]] = true; // Store trackbacked link so that no further trackbacks will be sent to the same link
} elseif ($debug) {
echo "Skipping full autodiscovery<br />\n";
echo "<span class='block_level'>Skipping full autodiscovery</span>";
}
}
$del = serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}references WHERE entry_id=" . (int)$id . " AND (type = '' OR type IS NULL)");
if ($debug && is_string($del)) {
echo $del . "<br />\n";
echo '<span class="block_level">' . $del . "</span>";
}
if ($debug) echo "Deleted references again.<br />\n";
if ($debug) echo "<span class='block_level'>Deleted references again.</span>";
if (!is_array($old_references)) {
$old_references = array();
@ -811,7 +811,7 @@ function serendipity_handle_references($id, $author, $title, $text, $dry_run = f
$query .= (int)$current_references[$locations[$i] . $names[$i]]['id'] . ", " . (int)$id . ", '" . $i_link . "', '" . $i_location . "')";
$ins = serendipity_db_query($query);
if ($debug && is_string($ins)) {
echo $ins . "<br />\n";
echo '<span class="block_level">' . $ins . "</span>";
}
$duplicate_check[$locations[$i] . $names[$i]] = true;
} else {
@ -819,7 +819,7 @@ function serendipity_handle_references($id, $author, $title, $text, $dry_run = f
$query .= (int)$id . ", '" . $i_link . "', '" . $i_location . "')";
$ins = serendipity_db_query($query);
if ($debug && is_string($ins)) {
echo $ins . "<br />\n";
echo '<span class="block_level">' . $ins . "</span>";
}
$old_references[] = array(
@ -832,13 +832,13 @@ function serendipity_handle_references($id, $author, $title, $text, $dry_run = f
}
if ($debug) {
echo "Current lookup for {$locations[$i]}{$names[$i]} is <pre>" . print_r($current_references[$locations[$i] . $names[$i]], true) . "</pre><br />\n";
echo $query . "<br />\n";
echo "Current lookup for {$locations[$i]}{$names[$i]} is <pre>" . print_r($current_references[$locations[$i] . $names[$i]], true) . "</pre>\n";
echo '<span class="block_level">' . $query . "</span>";
}
}
if ($debug) {
echo "Old/Saved locations: <pre>" . print_r($old_references, true) . "</pre><br />\n";
echo "Old/Saved locations: <pre>" . print_r($old_references, true) . "</pre>\n";
}
// Add citations
@ -850,7 +850,7 @@ function serendipity_handle_references($id, $author, $title, $text, $dry_run = f
$cite = serendipity_db_query($query);
if ($debug && is_string($cite)) {
echo $cite . "<br />\n";
echo '<span class="block_level">' . $cite . "</span>";
}
}
}

View File

@ -171,7 +171,7 @@ class serendipity_plugin_api
$plugin->install();
} else {
$serendipity['debug']['pluginload'][] = "Loading plugin failed painfully. File not found?";
echo ERROR . ': ' . $key . ' (' . $pluginPath . ')<br />';
echo '<span class="msg_error">' . ERROR . ': ' . $key . ' (' . $pluginPath . ')</span>';
}
return $key;

View File

@ -1716,12 +1716,12 @@ class serendipity_categories_plugin extends serendipity_plugin {
}
if (!$smarty && $is_form) {
$html .= '<div class="category_submit"><br /><input type="submit" name="serendipity[isMultiCat]" value="' . GO . '" /></div>';
$html .= '<div class="category_submit"><input type="submit" name="serendipity[isMultiCat]" value="' . GO . '" /></div>';
}
if (!$smarty) {
$html .= sprintf(
'<div class="category_link_all"><br /><a href="%s" title="%s">%s</a></div>',
'<div class="category_link_all"><a href="%s" title="%s">%s</a></div>',
$serendipity['serendipityHTTPPath'] . $serendipity['indexFile'] . '?frontpage',
ALL_CATEGORIES,

View File

@ -129,7 +129,7 @@ class serendipity_smarty_emulator {
} elseif (function_exists($funcname)) {
return call_user_func($funcname, $params, $this);
} else {
return "ERROR: " . htmlspecialchars($funcname) . " NOT FOUND.<br />\n";
return "<span class='msg_error'>ERROR: " . htmlspecialchars($funcname) . " NOT FOUND.</span>";
}
}