|
Feeds
- Downloads
- FAQ
- News
- Tutorials
|
|
|
View previous topic :: View next topic |
Author |
Message |
checksum Guest
|
Posted: Mon Jan 16, 2006 9:19 pm Post subject: Adding wysiwyg for My_eGallery comment |
|
|
Hi,
I have installed you wysiwyg from the raven distro in my site. I would like to use it with a module (My_eGallery) comment section. I have followed the instruction, but everytime I try to load the page I get a blank page.
This is what I did:
Code:if (is_user($user)) {
$userdata=cookiedecode($user);
$out .=
'<center><p align="center"><form action="'.$baseurl.'" method="POST">'
.'<input type="hidden" name="do" value="Post">'
.'<font class="'.$font['title'].'">'._GALNAME.'</font> <b>'.$userdata[1].'</b>'
.'<input type="hidden" name="gname" value="'.$userdata[1].'">'
.'<input type="hidden" name="member" value="1"><br>'
.'<font class="'.$font['title'].'">'._GALCOMMENT.'</font><br>'
.'<textarea wrap="virtual" cols="40" rows="10" name="comment" type="text" maxlength="70"></textarea><br>'
.'<input class="textbox" type="hidden" name="pid" value="'.$pid.'"> '
.'<input type="submit" value="Envoyer">'
.'</form>'
.'<font class="option">'._GALNOTE.'</font></p></center>';
}
|
I replaced it with this code to get the wysiwyg editor in the comment section, but everytime I load the page it is blank:
Code:if (is_user($user)) {
$userdata=cookiedecode($user);
$out .=
'<center><p align="center"><form action="'.$baseurl.'" method="POST">'
.'<input type="hidden" name="do" value="Post">'
.'<font class="'.$font['title'].'">'._GALNAME.'</font> <b>'.$userdata[1].'</b>'
.'<input type="hidden" name="gname" value="'.$userdata[1].'">'
.'<input type="hidden" name="member" value="1"><br>'
.'<font class="'.$font['title'].'">'._GALCOMMENT.'</font><br>'
wysiwyg_textarea("comment", "", "NukeUser", "50", "12");
.'<input class="textbox" type="hidden" name="pid" value="'.$pid.'"> '
.'<input type="submit" value="Envoyer">'
.'</form>'
.'<font class="option">'._GALNOTE.'</font></p></center>';
}
|
|
|
Back to top |
|
|
kguske Site Admin
Joined: May 12, 2005 Posts: 876
|
Posted: Tue Jan 17, 2006 12:05 am Post subject: Re: Adding wysiwyg for My_eGallery comment |
|
|
It's a parsing error. Try this:
Code:if (is_user($user)) {
$userdata=cookiedecode($user);
$out .=
'<center><p align="center"><form action="'.$baseurl.'" method="POST">'
.'<input type="hidden" name="do" value="Post">'
.'<font class="'.$font['title'].'">'._GALNAME.'</font> <b>'.$userdata[1].'</b>'
.'<input type="hidden" name="gname" value="'.$userdata[1].'">'
.'<input type="hidden" name="member" value="1"><br>'
.'<font class="'.$font['title'].'">'._GALCOMMENT.'</font><br>';
wysiwyg_textarea("comment", "", "NukeUser", "50", "12");
$out2 = '<input class="textbox" type="hidden" name="pid" value="'.$pid.'"> '
.'<input type="submit" value="Envoyer">'
.'</form>'
.'<font class="option">'._GALNOTE.'</font></p></center>';
}
|
But that still won't work because you're probably ECHOing the $out variable somewhere else. You'll have to break the $out into 2 variables, then echo the first variable, execute the wysiwyg_textarea function, then echo the second variable. |
|
Back to top |
|
|
Guest
|
Posted: Tue Jan 17, 2006 9:50 pm Post subject: Re: Adding wysiwyg for My_eGallery comment |
|
|
Thanks,
I now see the html area, but it is not where it is supposed to be and I do not see the submit button.
Quote: | But that still won't work because you're probably ECHOing the $out variable somewhere else. You'll have to break the $out into 2 variables, then echo the first variable, execute the wysiwyg_textarea function, then echo the second variable. |
How do I do that? I am not an expert when it comes to PHP...
Here is the file in question Only registered users can see links on this board! Get registered or login!
Thanks again |
|
Back to top |
|
|
checksum Guest
|
Posted: Tue Jan 17, 2006 9:57 pm Post subject: Re: Adding wysiwyg for My_eGallery comment |
|
|
The code for the text area starts at line 306. |
|
Back to top |
|
|
kguske
|
Posted: Tue Jan 17, 2006 10:15 pm Post subject: Re: Adding wysiwyg for My_eGallery comment |
|
|
The problem is that the textarea is abstracted such that replacing the textarea using the nukeWYSIWYG approach will be very difficult. The text area is returned from a function that is used in another function, that is used in a template, that is printed. We could take one of several approaches, including:
- since the functions are only used once, we could denormalize them by moving the code from the function to a higher level. This would require a significant change to this file.
- instead of replacing the textarea inline, we could break the template into pre- and post -textarea variables and display the pre variable, start the wysiwyg editor, then display the post variable (this is sort of the way TinyMCE was implemented.
I'd prefer the first as it would be much easier to support. Let me see what I can come up with and I will email it to you. Have you registered here - I forgot to set the permissions on this forum to require membership before posting... If not, please do so and post a follow up here so I know the correct email address. |
|
Back to top |
|
|
checksum webmaster
Joined: Jan 17, 2006 Posts: 6
|
Posted: Tue Jan 17, 2006 10:25 pm Post subject: Re: Adding wysiwyg for My_eGallery comment |
|
|
Ok, I see what you are saying.
Thanks |
|
Back to top |
|
|
kguske
|
Posted: Tue Jan 17, 2006 10:45 pm Post subject: Re: Adding wysiwyg for My_eGallery comment |
|
|
Wouldn't you know it?! There is a MUCH easier way to do this... FCKeditor provides support for templates!
I guess I'll need to add this in nukeWYSIWYG. Please email your mainfile to kguske at nukeSEO dot com, and I will return a prototype, along with an updated displayMedia.php file. |
|
Back to top |
|
|
checksum
|
Posted: Wed Jan 18, 2006 2:49 am Post subject: Re: Adding wysiwyg for My_eGallery comment |
|
|
Are you talking about the module files?
I just sent it.
If you could please tell me the changes that you made, so I know what you did. |
|
Back to top |
|
|
kguske
|
Posted: Wed Jan 18, 2006 8:44 am Post subject: Re: Adding wysiwyg for My_eGallery comment |
|
|
Actually, I just need the mainfile.php. I need to add an extra function to support using a template approach like the one used in your module. The new function will allow us to use a simple modification to the displayMedia.php to support using the WYSIWYG editor. |
|
Back to top |
|
|
checksum
|
Posted: Wed Jan 18, 2006 1:03 pm Post subject: Re: Adding wysiwyg for My_eGallery comment |
|
|
Good job Kevin, It works perfect.
I wanted to add some modification to the textarea, I am using also this text area for my admin news and my submit news. I wanted to make the text area in the gallery comment section smaller ( in width and height ) and remove some of the toolbar menu like the text justification without affecting the textarea in the submit news for users and admin. I just want to leave the basic formating like B, I, U, Smillies, etc... Is this possible?
Also (this has nothing to do with the text area), I thought the text area would have fix it, but I am still seeing the problem. Whenever I enter an apostrophe in the text area ' , as in I'am, it does not go into the database comment, the page just refreshes without the text. It was working before until I installed raven nuke 2.0 distro. I posted that question in raven forum 2 days ago, but did not get any answer, was wondering if you know what might be the problem.
Forgot to sign in b4 I made the donation, but I wanted my name listed.
Thank you again! |
|
Back to top |
|
|
kguske
|
Posted: Wed Jan 18, 2006 1:45 pm Post subject: Re: Adding wysiwyg for My_eGallery comment |
|
|
The ability to define the size is included in the updated version nukeWYSIWYG, which is included in the updated version of RavenNuke. In order to remove tools from the toolbar, you would need to specify a different toolbar set (and may need to create a custom toolbar set) when initiating the WYSIWYG editor. I *think* there is a predefined toolbar set that limits the tools to basic formatting...but it's not handy at the moment so I'll have to check and followup.
I'll also check on the apostrophe issue - I hadn't noticed that post on RavenPHPScripts, but I'll follow up on both places.
Not sure why the donation isn't showing (even without listing your name), but I'll look into that and get it posted, too.
Thanks!
Kevin |
|
Back to top |
|
|
checksum
|
Posted: Thu Jan 19, 2006 12:28 am Post subject: Re: Adding wysiwyg for My_eGallery comment |
|
|
fckeditor.php is where I try to change the size
For the toolbar set:
I tried 2 things in fckeditor.js:
1st, I tried modifying the basic toobar set, by adding 'smiley'
Code:FCKConfig.ToolbarSets["Basic"] = [
['Bold','Italic','-','OrderedList','Smiley','UnorderedList','-','Link','Unlink','-','About']
] ;
|
That did not work, I did not see the smiley toolbar.
I then tried to add another toobar 'Basic1'
Code:
FCKConfig.ToolbarSets["Basic1"] = [
['Bold','Italic','-','OrderedList','Smiley','UnorderedList','-','Link','Unlink','-','About']
] ;
|
That did not work either, it said "cannot find toolbar 'Basic1'. |
|
Back to top |
|
|
checksum
|
Posted: Thu Jan 19, 2006 12:49 am Post subject: Re: Adding wysiwyg for My_eGallery comment |
|
|
Never mind, I see the changes I made for the toolbar 'Basic', I just needed to clear my cache to see the changes.
Now my only problem is that damn apostrophe. |
|
Back to top |
|
|
kguske
|
Posted: Thu Jan 19, 2006 6:45 am Post subject: Re: Adding wysiwyg for My_eGallery comment |
|
|
I'm glad you got it working. Thank you for posting the update - that may help others!
I'll test the apostrophe issue this weekend or sooner, if possible. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001-2008 phpBB Group
|
|
|