Home
Download
Add-ons
Help
Forum
Organisation
Project
Welcome,
Guest
. Please
login
or
register
.
March 21, 2010, 12:52:51 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Wollen Sie dem Website Baker Team beitreten?
Nähere Informationen finden Sie unter
hier
und auf unserer
neuen Webseite
.
110585
Posts in
15968
Topics by
9313
Members
Latest Member:
Gudrun
WebsiteBaker Community Forum
English
Modules
(Moderators:
Argos
,
BerndJM
)
New Module (Editable WYSIWYG module)
Pages:
[
1
]
2
3
Author
Topic: New Module (Editable WYSIWYG module) (Read 12203 times)
vizmotion
Offline
Posts: 96
New Module (Editable WYSIWYG module)
«
on:
June 21, 2007, 04:27:03 PM »
Hey Gang,
There has been some talk about a module that allows you to edit a WYSIWYG page on the page. I just created a new module called WYSIWYG Edit based on the default WYSIWYG module. This is a hybrid between a Wiki page and a static web page. You can edit the page from your website and each save creates a revision page that you can view. You can even revert to back to a prior page. This is a module I am putting here for the community to modify, grow and use. Right now the module is limited to English but can be extended to other languages with a little more programming. I am probably not going to do a lot of additional development on this current module because it handles my current needs but you are welcome to change it any way that you want. Thanks to the website baker community for making this platform available to us all.
Robert
Logged
dihakz
Offline
Posts: 23
Re: New Module (Editable WYSIWYG module)
«
Reply #1 on:
June 21, 2007, 09:17:45 PM »
Awesome idea! I'm not having much luck, though -- when clicking on 'Edit this Page', I get:
Warning: get_template_name(../../config.php) [function.get-template-name]: failed to open stream: No such file or directory in /home3/blackb/blackburnsmed-www/prototype/cms/wb/modules/fckeditor/include.php on line 34
Fatal error: get_template_name() [function.require]: Failed opening required '../../config.php' (include_path='./:/usr/local/lib/php') in /home3/blackb/blackburnsmed-www/prototype/cms/wb/modules/fckeditor/include.php on line 34
--- when clicking on 'See Revisions', I get:
Fatal error: Call to a member function on a non-object in /home3/blackb/blackburnsmed-www/prototype/cms/wb/modules/wysiwyg_edit/revisions_page.php on line 53
Any ideas?
Logged
vizmotion
Offline
Posts: 96
Re: New Module (Editable WYSIWYG module)
«
Reply #2 on:
June 21, 2007, 10:33:49 PM »
Hey dihakz,
Not sure what is going on with your setup. You could try a different editor although I have been able to get it to work with fckeditor. I will think about it some more.. You could try to uninstall and install the module.
In the meantime I have put up a temporary website for you to see the module's user interface. It is at
http://dev.vizmotion.com
. Give it a try and let me know what you think. Thanks for downloading and trying it out the first time.
Robert
Logged
pcwacht
Guest
Re: New Module (Editable WYSIWYG module)
«
Reply #3 on:
June 22, 2007, 07:52:22 AM »
The demo site works like a charm.
I could, and will, use this in the near future!
John
Logged
kweitzel
Forum administrator
Offline
Posts: 5561
Re: New Module (Editable WYSIWYG module)
«
Reply #4 on:
June 22, 2007, 07:30:00 PM »
Yepp ... also I see the benefits of this ...
cheers
Klaus
Logged
http://www.weitzel.biz
PM has been disabled
Waldschwein
Forum Team
Offline
Posts: 1291
Re: New Module (Editable WYSIWYG module)
«
Reply #5 on:
June 22, 2007, 09:21:47 PM »
Hi!
It works awsome. I waited long time for a frontend edit. Especially for editors or authors it would be really, really great, so they mustn't/don't have to/ can't access the administration panel but only the frontend editing.
EDIT: When using HTMLArea/no editor as default WYSIWYG editor, everything is fine. But when I use FCKEditor (V 2.7.3), the following error is displayed:
Code:
Warning: require_once(../../config.php) [function.require-once]: failed to open stream: No such file or directory in C:\xampp\htdocs\html\WB\modules\fckeditor\include.php on line 34
Fatal error: require_once() [function.require]: Failed opening required '../../config.php' (include_path='.;C:\xampp\php\pear\') in C:\xampp\htdocs\html\WB\modules\fckeditor\include.php on line 34
The error is only when editing in frontpage, when editing through adminpanel or viewing it everything works fine.
EDIT #2: I posted this error because it slightly different of the above one.
AND EDIT #3 (hope it will end some time....)
The following error is presented when clicking on "See Revisions".
It is always displayed, doesn't matter which editor or if one is used.
(Using PHP5.2/MySQL5/Apache2 (Well XAMPP 1.6.1)
Code:
Warning: require(C:\xampp\htdocs\html\WB/modules//view.php) [function.require]: failed to open stream: No such file or directory in C:\xampp\htdocs\html\WB\framework\frontend.functions.php on line 172
Fatal error: require() [function.require]: Failed opening required 'C:\xampp\htdocs\html\WB/modules//view.php' (include_path='.;C:\xampp\php\pear\') in C:\xampp\htdocs\html\WB\framework\frontend.functions.php on line 172
Regards Michael
«
Last Edit: June 22, 2007, 09:42:07 PM by Waldschwein
»
Logged
Help! What's a survey? Read my blog ->
www.zweiwelt.com
| " Make no small plans for they have not the power to stir men`s blood." - Niccolo Machiavelli
Get here the new WebsiteBaker logo! It's the only one.
macsmet
Offline
Posts: 157
Re: New Module (Editable WYSIWYG module)
«
Reply #6 on:
June 23, 2007, 01:07:50 PM »
Hi there,
I love it but have the same problem with FCKEditor.
greetings,
MacSmet
Logged
vizmotion
Offline
Posts: 96
Re: New Module (Editable WYSIWYG module)
«
Reply #7 on:
June 24, 2007, 05:57:43 AM »
I am not sure I understand the last post because the most current release of FCKEditor is 2.4.3 not 2.7.3. Maybe the 7 was a mistake. At any rate is there a system that someone has where I can test this error out on or I can give you some code that has debugging in it to run and see what is going on. I can not seem to reproduce the error here. It works fine on my systems.
Logged
Waldschwein
Forum Team
Offline
Posts: 1291
Re: New Module (Editable WYSIWYG module)
«
Reply #8 on:
June 24, 2007, 06:14:27 AM »
Hi!
Nope, the 7 was correct. I meant the version number of the WB-module which includes FCK.
Greets Michael
Logged
Help! What's a survey? Read my blog ->
www.zweiwelt.com
| " Make no small plans for they have not the power to stir men`s blood." - Niccolo Machiavelli
Get here the new WebsiteBaker logo! It's the only one.
kickarse
Offline
Posts: 64
Re: New Module (Editable WYSIWYG module)
«
Reply #9 on:
June 25, 2007, 09:29:44 PM »
Works like a charm! On the latest version of FKCEdit.
Is it too much to put the link to edit and revisioning at the top? Sometimes it's really annoying to go all the way to the bottom to edit a page. Perhaps a div that floats somewhere on the top?
One problem... even after I log out I can still edit the pages... can we say security issue?
«
Last Edit: June 25, 2007, 09:35:13 PM by kickarse
»
Logged
mickpage
Guest
Re: New Module (Editable WYSIWYG module)
«
Reply #10 on:
June 25, 2007, 10:27:58 PM »
I think it is
meant
for
anyone
to edit - not just those logged in.
Logged
kickarse
Offline
Posts: 64
Re: New Module (Editable WYSIWYG module)
«
Reply #11 on:
June 26, 2007, 02:13:24 PM »
^^ Ahh... I think it'd be nice to add some sort of security feature... either we can allow people to edit or not..
Logged
nbonline
Offline
Posts: 9
Re: New Module (Editable WYSIWYG module)
«
Reply #12 on:
July 06, 2007, 07:19:54 AM »
Hi all..
I had the same problem with FCK editorn, even with the latest edition.
I've changed the include.php in FCK in function get_template_name():
Code:
// returns the template name of the current displayed page
define('FCK_PATH', dirname(__FILE__));
require_once(FCK_PATH. '/../../config.php');
This line was is the old line:
Code:
// returns the template name of the current displayed page
require_once('../../config.php');
Hope this could help. It works for me.
/Niclas
«
Last Edit: July 06, 2007, 07:27:13 AM by nbonline
»
Logged
--------------------------------------------------
PajalaNET - Web & Data
--------------------------------------------------
artlader
Offline
Posts: 12
Re: New Module (Editable WYSIWYG module)
«
Reply #13 on:
July 07, 2007, 02:40:36 AM »
Quote from: kickarse on June 26, 2007, 02:13:24 PM
^^ Ahh... I think it'd be nice to add some sort of security feature... either we can allow people to edit or not..
Yes, that would be a useful feature.
-- Art
Logged
marathoner
Offline
Posts: 491
Re: New Module (Editable WYSIWYG module)
«
Reply #14 on:
July 07, 2007, 04:19:19 AM »
@vizmotion
Thanks for the great module. I agree that it would be helpful to offer the ability to limit who can make the changes to the page. While I haven't looked at your code I would suspect that simply checking the user or group before displaying the "Edit Page"...maybe some code similar to the "edit this page link" snippet at:
http://forum.websitebaker.org/index.php/topic,2352.0.html
Has anyone already explored this idea?
Logged
nbonline
Offline
Posts: 9
Re: New Module (Editable WYSIWYG module)
«
Reply #15 on:
July 08, 2007, 03:37:49 PM »
Hi there..
I'm looking at one solution for who can edit page in frontend.
I will post any ideas here.
/Niclas
Logged
--------------------------------------------------
PajalaNET - Web & Data
--------------------------------------------------
glogo
Offline
Posts: 22
Re: New Module (Editable WYSIWYG module)
«
Reply #16 on:
July 16, 2007, 06:52:27 PM »
Hello,
I got so far:
The module works when you are logged in. when you are logged out, the "edit page" and "revisions" links don't show. BUT, the content also does not show. It seems another conditional statement is needed to show the content when the conditions of being logged out is there. Everything else works. I tried to hack around a bit with the code, but unfortunately, I don't know php at all! So, I did not get it to work yet. Maybe someone has an idea how this can be fixed. This would be great, then everyone could have a module where the edit links show up only for authorized groups/users!
Here is my code:
page is of course view.php from the wysiwyg_edit module.
Code:
<?php
// $Id: view.php 399 2006-12-24 07:50:44Z Ruebenwurzel $
/*
Website Baker Project <http://www.websitebaker.org/>
Copyright (C) 2004-2007, Ryan Djurovich
Website Baker 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.
Website Baker 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.
You should have received a copy of the GNU General Public License
along with Website Baker; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// Get content
$get_content
=
$database
->
query
(
"SELECT content FROM "
.
TABLE_PREFIX
.
"mod_wysiwyg_edit WHERE section_id = '$section_id'"
);
$fetch_content
=
$get_content
->
fetchRow
();
$content
= (
$fetch_content
[
'content'
]);
if(!isset(
$wysiwyg_editor_loaded
)) {
$wysiwyg_editor_loaded
=
true
;
if (!
defined
(
'WYSIWYG_EDITOR'
) OR
WYSIWYG_EDITOR
==
"none"
OR !
file_exists
(
WB_PATH
.
'/modules/'
.
WYSIWYG_EDITOR
.
'/include.php'
)) {
function
show_wysiwyg_editor
(
$name
,
$id
,
$content
,
$width
,
$height
) {
echo
'<textarea name="'
.
$name
.
'" id="'
.
$id
.
'" style="width: '
.
$width
.
'; height: '
.
$height
.
';">'
.
$content
.
'</textarea>'
;
}
} else {
$id_list
=array();
$query_wysiwyg
=
$database
->
query
(
"SELECT section_id FROM "
.
TABLE_PREFIX
.
"sections WHERE page_id = '$page_id' AND module = 'wysiwyg_edit'"
);
if(
$query_wysiwyg
->
numRows
() >
0
) {
while(
$wysiwyg_section
=
$query_wysiwyg
->
fetchRow
()) {
$entry
=
'content'
.
$wysiwyg_section
[
'section_id'
];
array_push
(
$id_list
,
$entry
);
}
require(
WB_PATH
.
'/modules/'
.
WYSIWYG_EDITOR
.
'/include.php'
);
}
}
}
$url
=
$_SERVER
[
'PHP_SELF'
];
if (
is_numeric
(
$wb
->
get_session
(
'USER_ID'
))) {
// Get permissons
if (
$page_id
) {
$this_page
=
$page_id
; }
else {
$this_page
=
$wb
->
default_page_id
; }
$database
= new
database
();
$results
=
$database
->
query
(
"SELECT * FROM "
.
TABLE_PREFIX
.
"pages WHERE page_id = '$this_page'"
);
$results_array
=
$results
->
fetchRow
();
$old_admin_groups
=
explode
(
','
,
$results_array
[
'admin_groups'
]);
$old_admin_users
=
explode
(
','
,
$results_array
[
'admin_users'
]);
$this_user
=
$wb
->
get_session
(
'GROUP_ID'
);
if (
is_numeric
(
array_search
(
$this_user
,
$old_admin_groups
)) )
{
if(
$_GET
[
'button'
] ==
''
and
$_POST
[
'button'
] ==
''
) {
$wb
->
preprocess
(
$content
);
$editPage
=
"<hr><a href=$url?button=edit>Edit Page</a>"
;
$revision
=
"<a href="
.
WB_URL
.
"/modules/wysiwyg_edit/revisions.php?section_id=$section_id&cmd=all&page_id=$page_id>See Revisions</a>"
;
echo
"$content<br>$editPage | $revision<br>"
;
} else if(
$_GET
[
'button'
] ==
'edit'
) {
$oldcontentname
=
'old_content'
.
$section_id
;
$oldcontent
=
htmlspecialchars
(
$content
);
echo <<<END
<form name="wysiwyg_edit<?php echo $section_id; ?>
" action="$url" method="post">
<input type="hidden" name="page_id" value="$page_id" />
<input type="hidden" name="section_id" value="$section_id" />
<input type="hidden" name="$oldcontentname" value="$oldcontent" />
END;
show_wysiwyg_editor('content'.$section_id,'content'.$section_id,$content,'100%','500px');
echo <<<END
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="padding-bottom: 10px;">
<tr>
<td align="left">
<input type="submit" name=button value="SAVE" style="width: 100px; margin-top: 5px;" />
</td>
<td align="right">
<input type="button" value="CANCEL" onclick="javascript: window.location = '$url';" style="width: 100px; margin-top: 5px;" />
</td>
</tr>
</table>
</form>
END;
}
} else if($_POST['button'] == 'SAVE') {
echo "Save goes here";
// Update the mod_wysiwygs table with the contents
if(isset($_POST['content'.$section_id])) {
$content = $admin->add_slashes($_POST['content'.$section_id]);
$text = strip_tags($content);
$database = new database();
$query = "UPDATE ".TABLE_PREFIX."mod_wysiwyg_edit SET content = '$content', text = '$text' WHERE section_id = '$section_id'";
$database->query($query);
$userid = $wb->get_user_id();
$oldcontent = $admin->add_slashes($_POST['old_content'.$section_id]);
$oldtext = strip_tags($oldcontent);
$queryversion = "INSERT ".TABLE_PREFIX."mod_wysiwyg_edit_version SET content = '$oldcontent', text = '$oldtext', section_id = '$section_id', user='$userid'";
$database->query($queryversion);
// Check if there is a database error, otherwise say successful
if($database->is_error()) {
$admin->print_error($database->get_error(), $js_back);
} else {
$admin->print_success($MESSAGE['PAGES']['SAVED'], $url);
}
}
}
else if ($get_content = $database->query("SELECT content FROM ".TABLE_PREFIX."mod_wysiwyg_edit WHERE section_id = '$section_id'"));
$fetch_content = $get_content->fetchRow();
$content = ($fetch_content['content']);
{echo '.$content.';}
}
?>
This bit at the bottom is what I added, trying to get it to show the content, but I am a hopeless n00b when it comes to php coding. Help, somebody!
Code:
else if ($get_content = $database->query("SELECT content FROM ".TABLE_PREFIX."mod_wysiwyg_edit WHERE section_id = '$section_id'"));
$fetch_content = $get_content->fetchRow();
$content = ($fetch_content['content']);
{echo '.$content.';}
Good luck and thanks if you can fix it.
Greetings
Glogo
Logged
glogo
Offline
Posts: 22
Re: New Module (Editable WYSIWYG module)
«
Reply #17 on:
July 16, 2007, 07:12:27 PM »
Oh, by the way,
n00b or not, I *did* figure out how to make the fckeditor work. I think someone else had found 1 solution. Anyway, my solution was :
in the include.php file on line 34 (that was giving the error), the person who coded this file assumed you would always call the editor from the admin side (backend).
Calling the editor from the front end means you are one directory higher than you would be normally. So, all you have to do to get the editor to work is to change the line from:
Code:
require_once('/../../config.php');
to make the php engine compute the entire path, like so:
Code:
require_once(WB_PATH.'/config.php');
That worked for me. It now works from front and back end, happily, as htmlarea does not allow copy/pasting in gecko browsers.
Greetings
G
Logged
glogo
Offline
Posts: 22
Re: New Module (Editable WYSIWYG module)
«
Reply #18 on:
July 20, 2007, 11:10:41 AM »
Okay,
I got it to work ... BUT ... it doesn't work. Ahem. I mean: that, which I wanted to accomplish, I have accomplished. Somehow, I fooled with the code until it worked.
When you are logged out all you see is the page. when you are logged in, you get the edit links etc.
HOWEVER, the revisions thingy does not work. And I went to another site where I had this installed and tried it, the original wysiwyg_edit module, before any of my fooling with the code, and it also does not work. It does not revert to the previous version. It says that it is reverting, but the text remains as previously edited. Whereupon this may lie, I do not have a clue.
So, silly of me to work on this for so long when I had not thoroughly tested it, hmmm??? Trusting soul that I am, I assumed it would work. In the meantime, I cannot say that I have learned much, but there is the satisfaction that I got what I was after, even if the module is for all intents and purposes practically a dud.
Now, I am not sure if this is going to stop me from trying to fix the module and turn it into something usable. it would be nice if the original poster and author of the snippet could comment. I really was looking forward to using this on a few of my sites where I would like my client to be able to edit his own stuff from the front end.
Anyway, to whom it may concern, it might be worth something to someone, here is the code:
Code:
<?php
// $Id: view.php 399 2006-12-24 07:50:44Z Ruebenwurzel $
/*
Website Baker Project <http://www.websitebaker.org/>
Copyright (C) 2004-2007, Ryan Djurovich
Website Baker 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.
Website Baker 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.
You should have received a copy of the GNU General Public License
along with Website Baker; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
// Get content
$get_content
=
$database
->
query
(
"SELECT content FROM "
.
TABLE_PREFIX
.
"mod_wysiwyg_edit WHERE section_id = '$section_id'"
);
$fetch_content
=
$get_content
->
fetchRow
();
$content
= (
$fetch_content
[
'content'
]);
if (
FRONTEND_LOGIN
==
'enabled'
AND
is_numeric
(
$wb
->
get_session
(
'USER_ID'
))) {
// Get permissons
if (
$page_id
) {
$this_page
=
$page_id
; }
else {
$this_page
=
$wb
->
default_page_id
; }
$database
= new
database
();
$results
=
$database
->
query
(
"SELECT * FROM "
.
TABLE_PREFIX
.
"pages WHERE page_id = '$this_page'"
);
$results_array
=
$results
->
fetchRow
();
$old_admin_groups
=
explode
(
','
,
$results_array
[
'admin_groups'
]);
$old_admin_users
=
explode
(
','
,
$results_array
[
'admin_users'
]);
$this_user
=
$wb
->
get_session
(
'GROUP_ID'
);
if (
is_numeric
(
array_search
(
$this_user
,
$old_admin_groups
)) )
if(!isset(
$wysiwyg_editor_loaded
)) {
$wysiwyg_editor_loaded
=
true
;
if (!
defined
(
'WYSIWYG_EDITOR'
) OR
WYSIWYG_EDITOR
==
"none"
OR !
file_exists
(
WB_PATH
.
'/modules/'
.
WYSIWYG_EDITOR
.
'/include.php'
)) {
function
show_wysiwyg_editor
(
$name
,
$id
,
$content
,
$width
,
$height
) {
echo
'<textarea name="'
.
$name
.
'" id="'
.
$id
.
'" style="width: '
.
$width
.
'; height: '
.
$height
.
';">'
.
$content
.
'</textarea>'
;
}
} else {
$id_list
=array();
$query_wysiwyg
=
$database
->
query
(
"SELECT section_id FROM "
.
TABLE_PREFIX
.
"sections WHERE page_id = '$page_id' AND module = 'wysiwyg_edit'"
);
if(
$query_wysiwyg
->
numRows
() >
0
) {
while(
$wysiwyg_section
=
$query_wysiwyg
->
fetchRow
()) {
$entry
=
'content'
.
$wysiwyg_section
[
'section_id'
];
array_push
(
$id_list
,
$entry
);
}
require(
WB_PATH
.
'/modules/'
.
WYSIWYG_EDITOR
.
'/include.php'
);
}
}
}
$url
=
$_SERVER
[
'PHP_SELF'
];
{
if(
$_GET
[
'button'
] ==
''
and
$_POST
[
'button'
] ==
''
) {
$wb
->
preprocess
(
$content
);
$editPage
=
"<hr><a href=$url?button=edit>Edit Page</a>"
;
$revision
=
"<a href="
.
WB_URL
.
"/modules/wysiwyg_edit/revisions.php?section_id=$section_id&cmd=all&page_id=$page_id>See Revisions</a>"
;
echo
"$content<br>$editPage | $revision<br>"
;
} else if(
$_GET
[
'button'
] ==
'edit'
) {
$oldcontentname
=
'old_content'
.
$section_id
;
$oldcontent
=
htmlspecialchars
(
$content
);
echo <<<END
<form name="wysiwyg_edit<?php echo $section_id; ?>
" action="$url" method="post">
<input type="hidden" name="page_id" value="$page_id" />
<input type="hidden" name="section_id" value="$section_id" />
<input type="hidden" name="$oldcontentname" value="$oldcontent" />
END;
show_wysiwyg_editor('content'.$section_id,'content'.$section_id,$content,'100%','500px');
echo <<<END
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="padding-bottom: 10px;">
<tr>
<td align="left">
<input type="submit" name=button value="SAVE" style="width: 100px; margin-top: 5px;" />
</td>
<td align="right">
<input type="button" value="CANCEL" onclick="javascript: window.location = '$url';" style="width: 100px; margin-top: 5px;" />
</td>
</tr>
</table>
</form>
END;
}
else if($_POST['button'] == 'SAVE') {
echo "Save goes here";
// Update the mod_wysiwygs table with the contents
if(isset($_POST['content'.$section_id])) {
$content = $admin->add_slashes($_POST['content'.$section_id]);
$text = strip_tags($content);
$database = new database();
$query = "UPDATE ".TABLE_PREFIX."mod_wysiwyg_edit SET content = '$content', text = '$text' WHERE section_id = '$section_id'";
$database->query($query);
$userid = $wb->get_user_id();
$oldcontent = $admin->add_slashes($_POST['old_content'.$section_id]);
$oldtext = strip_tags($oldcontent);
$queryversion = "INSERT ".TABLE_PREFIX."mod_wysiwyg_edit_version SET content = '$oldcontent', text = '$oldtext', section_id = '$section_id', user='$userid'";
$database->query($queryversion);
// Check if there is a database error, otherwise say successful
if($database->is_error()) {
$admin->print_error($database->get_error(), $js_back);
} else {
$admin->print_success($MESSAGE['PAGES']['SAVED'], $url);
}
}
}
}
}else
echo "$content";
?>
If anyone is interested, I would so like to see this module work properly.
Greetings
glogo
Logged
pcwacht
Guest
Re: New Module (Editable WYSIWYG module)
«
Reply #19 on:
July 20, 2007, 01:04:40 PM »
So your wanted logic is something like:
(pseudo code)
if save // User requested save content
update current content in db as revision
insert new content and make it latest revision
end if
(end pseudo code)
You could maybe add timestamp to your table and fetch the youngest content to show
When reverting back just set the timestamp to now()
Or isn't this what you are after?
Did look at the latest view.php (the pos above this one) and can't see how you want the revision mechanism to be working.
John
Logged
glogo
Offline
Posts: 22
Re: New Module (Editable WYSIWYG module)
«
Reply #20 on:
July 20, 2007, 01:11:23 PM »
Hi John,
nice that you answered so speedily.
Maybe I am not at all understanding how that mod is supposed to work.
I *thought* when you hit the "revert" button, it is supposed to give you the version you are going back to, not the current version. Am I missing something?
When I hit the revert button, it just sends me right back to the version I am currently on, or maybe I did not understand. I will try it again.
Greetings
glogo
PS. perhaps you can try the code I have posted and see if it works for you. It was requested to have this module check if the user is logged in and authorized to make changes. Otherwise it should show no edit link. that is what it was doing for me...
g
Logged
glogo
Offline
Posts: 22
Re: New Module (Editable WYSIWYG module)
«
Reply #21 on:
July 20, 2007, 01:22:48 PM »
Dear John,
no, the module is not working at all the way it is supposed to work, as far as I can tell, with regard to the revisions. It does not revert to any earlier version. I checked it again. It does not revert at all. This is okay if it is not promising to revert, but that revert link is there. I suppose I could edit it out. but it kind of defeats the whole purpose of the module.
Did I mention that I am a complete n00b? I think I said that somewhere 3 or 4 times. In any case, I don't get your shorthand. I will have to sit down and think on this a while.
But, is this not supposed to revert to old versions???
Greetings
glogo
Logged
vizmotion
Offline
Posts: 96
Re: New Module (Editable WYSIWYG module)
«
Reply #22 on:
July 20, 2007, 02:27:00 PM »
Hey Guys,
I am working on a fix. Will post it shortly.
Robert
Logged
vizmotion
Offline
Posts: 96
Re: New Module (Editable WYSIWYG module)
«
Reply #23 on:
July 20, 2007, 02:37:45 PM »
OK saw posting requesting this feature and added it. Hope this solves your problem. There is now a settings section in the module that allows you to specify on a section basis if someone has the ability to edit the page only if they are logged in or if anyone is on the site. The code is below.
In terms of revert it will set the current page to whatever old version of the page you click on to revert to.
Logged
glogo
Offline
Posts: 22
Re: New Module (Editable WYSIWYG module)
«
Reply #24 on:
July 20, 2007, 02:53:18 PM »
Hi Robert,
here's what the new upgrade gets me:
Code:
Fatal error: Call to a member function fetchRow() on a non-object in /home/gitayoga/public_html/wb/modules/wysiwyg_edit/view.php on line 53
Okay, well, I guess we're working on it. Maybe I have to uninstall the old mod before installing the upgrade? But that might be complicated, because I would have to take all those sections out of my pages before uninstalling... or perhaps I could upload manually and just reload the modules?
Not sure, the message was "upgrade successful". So... and I don't see anything abnormal about line 53.
see what you can find out. I'm going to fool with it, too.
Greetings
glogo
Logged
Pages:
[
1
]
2
3
Jump to:
Please select a destination:
-----------------------------
General
-----------------------------
=> General Announcements
=> Security Announcements
=> Documentation
=> Guest Area & Off-Topic
-----------------------------
English
-----------------------------
=> Help & Support
=> Modules
=> Droplets (PHP code for use with Droplet module) & Snippets (raw PHP code)
=> jQuery
=> Templates, Menus & Design
=> WebsiteBaker Language Files
=> WebsiteBaker 2.x discussion
=> WebsiteBaker 3
=> Archive (posts up to 2007)
-----------------------------
Deutsch (German)
-----------------------------
=> Ankündigungen
=> Hilfe/Support
=> Module & Snippets
=> Templates & Design
=> Tutorials
=> jQuery
=> Diskussion über WB
=> Off-Topic
=> Archiv für Themen bis 2007
-----------------------------
Nederlands (Dutch)
-----------------------------
=> Aankondigingen
=> Hulp & Ondersteuning
=> Niet-Terzake (Off Topic)
-----------------------------
Francais (French)
-----------------------------
=> Help/Support
-----------------------------
Italiano (Italian)
-----------------------------
=> Help/Support
Loading...