Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
question2answer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
outils
question2answer
Commits
4d8804c5
Commit
4d8804c5
authored
Feb 24, 2015
by
Scott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move content change to WYSIWYG editor plugin
parent
fb48600a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
0 deletions
+46
-0
qa-wysiwyg-ajax.php
qa-plugin/wysiwyg-editor/qa-wysiwyg-ajax.php
+46
-0
No files found.
qa-plugin/wysiwyg-editor/qa-wysiwyg-ajax.php
0 → 100644
View file @
4d8804c5
<?php
/*
Question2Answer by Gideon Greenspan and contributors
http://www.question2answer.org/
File: qa-plugin/wysiwyg-editor/qa-wysiwyg-editor.php
Description: Editor module class for WYSIWYG editor plugin
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
More about this license: http://www.question2answer.org/license.php
*/
class
qa_wysiwyg_ajax
{
public
function
match_request
(
$request
)
{
return
$request
==
'wysiwyg-editor-ajax'
;
}
// Fix path to WYSIWYG editor smilies
public
function
process_request
(
$request
)
{
// todo: lock tables?
$sql
=
'SELECT postid, title, content FROM ^posts WHERE format="html" AND content LIKE "%/wysiwyg-editor/plugins/smiley/images/%" LIMIT 5'
;
$result
=
qa_db_query_sub
(
$sql
);
while
((
$post
=
qa_db_read_one_assoc
(
$result
,
true
))
!==
null
)
{
$search
=
'#<(img|a)([^>]+)(src|href)="([^"]+)/wysiwyg-editor/plugins/smiley/images/([^"]+)"#'
;
$replace
=
'<$1$2$3="$4/wysiwyg-editor/ckeditor/plugins/smiley/images/$5"'
;
$newcontent
=
preg_replace
(
$search
,
$replace
,
$post
[
'content'
]);
qa_post_set_content
(
$post
[
'postid'
],
$post
[
'title'
],
$newcontent
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment