Author |
Message |
Gremmie
Former Moderator in Good Standing

Joined: Apr 06, 2006
Posts: 2415
Location: Iowa, USA
|
Posted:
Thu Mar 22, 2007 5:27 pm |
|
I would like to provide an option in my calendar module to use the editor in RN2.10.
I glanced at the code, and is it as simple as making a call to wysiwyg_textarea() (or wysiwyg_textarea_html())?
Unfortunately, my current textarea needs an ID attribute, and there doesn't seem to be a way to provide that. I can probably code around that though.
Thanks! |
_________________ Only registered users can see links on this board! Get registered or login! - An Event Calendar for PHP-Nuke
Only registered users can see links on this board! Get registered or login! - A Google Maps Nuke Module |
|
|
 |
CodyG
Life Cycles Becoming CPU Cycles

Joined: Jan 02, 2003
Posts: 714
Location: Vancouver Island
|
Posted:
Thu Mar 22, 2007 8:37 pm |
|
Using wysiwyg in your calendar module would be great.
btw, I just got the latest release and that calendar center-block rocks, Gremmie!
Good job. |
_________________ "We want to see if life is ubiquitous." D.Goldin |
|
|
 |
montego
Site Admin

Joined: Aug 29, 2004
Posts: 9457
Location: Arizona
|
Posted:
Thu Mar 22, 2007 10:19 pm |
|
Gremmie, if you have not already, you might want to PM kguske for help on this... he may or may not see this as it is kind of buried inside the Modules forum. |
_________________ Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! |
|
|
 |
kguske
Site Admin

Joined: Jun 04, 2004
Posts: 6437
|
Posted:
Fri Mar 23, 2007 8:33 am |
|
Not sure it will work since the WYSIWYG is implemented through a frame, not a textarea. |
_________________ I search, therefore I exist...
Only registered users can see links on this board! Get registered or login! |
|
|
 |
Gremmie

|
Posted:
Fri Mar 23, 2007 10:48 am |
|
CodyG, thanks, glad it worked. I'm thinking about your RSVP idea now...
kguske, I'm confused about that. Maybe we are talking about 2 different things. I was looking at the Submit_News module in RN2.10. It just makes a call to one of those functions instead of spitting out it's own textarea. It pretty much has to use a textarea, right? Otherwise how does the info get posted back to the module? I thought I saw in the FCK class that it was echoing out a textarea. Thanks. |
|
|
|
 |
kguske

|
Posted:
Fri Mar 23, 2007 11:23 am |
|
Sorry, I should have been more specific. I meant that it wouldn't work if you required the ID. The WYSIWYG function will output a textarea if the page is being accessed by a search engine or if the editor is turned off. |
|
|
|
 |
Gremmie

|
Posted:
Fri Mar 23, 2007 9:40 pm |
|
Well calling one of those functions seems to work. It is too bad you can't pass in an ID like you do the name and value, but I think I can code around that on my end. |
|
|
|
 |
kguske

|
Posted:
Sat Mar 24, 2007 12:58 am |
|
I'll check it out. Are you using it for some JS function? |
|
|
|
 |
Gremmie

|
Posted:
Sat Mar 24, 2007 10:06 am |
|
I am using a <label> tag with a "for" attribute. Its probably not a big deal, but for completeness it would be nice. |
|
|
|
 |
Gremmie

|
Posted:
Sat Mar 24, 2007 12:03 pm |
|
Here are some more lessons learned:
Without the advanced editor, I called htmlentities when doing preview type things, or editing existing text. With the advanced editor on, you don't do that.
I was also doing nl2br() on text that I was saving without the editor. With the editor this is not needed.
GCalendar is using it's own html filtering because I developed it under 7.9, and I had some doubts about the correctness and efficiency of the 7.9 check_html system. So I maintained my own allowable HTML and attributes. But the advanced editor makes use of a lot more tags. I decided to compromise and if GCalendar admins turn on the advanced editor option I will use whatever check_html facility is available instead of my own. I can trust RavenNukes.
BTW, that editor is awesome! I like how it fixes HTML compliancy errors. Thank you for making it available in RavenNuke. I think it will really be a big win-win for module authors who take advantage of it. |
|
|
|
 |
kguske

|
Posted:
Sat Mar 24, 2007 8:28 pm |
|
In your module, you could check for the existence of the wysiwyg function to determine if nukeWYSIWYG is installed. |
|
|
|
 |
Gremmie

|
Posted:
Tue Apr 17, 2007 7:30 am |
|
I integrated it into GCalendar and it is rocking!
One nagging question though...I could never seem to change the width. It seemed like it was ignoring my width argument to wysiwyg_textarea_html(). However the Submit_News module, etc, always had a very wide frame, much wider than mine. How was that accomplished? |
|
|
|
 |
montego

|
Posted:
Tue Apr 17, 2007 7:31 am |
|
Check your table widths. If you use 100%, it should expand to the full size of that table.
I know. I had the same question of Kguske many moons ago, and this was his response. Of course, he was right. (At least it was so for the HTML Newsletter...) |
|
|
|
 |
kevinkap
Involved


Joined: Apr 22, 2006
Posts: 356
|
Posted:
Tue Apr 24, 2007 5:16 pm |
|
I love it gremmie.
great work
Thanks. |
_________________ Kevin Kappes |
|
|
 |
kevinkap

|
Posted:
Tue Apr 24, 2007 5:45 pm |
|
One suggestion that was given to me by montego when I was trying to clean up a module I use on one site.
1) We changed many double-quotes to single-quotes as in PHP, this is a much, much, much quicker, performance-wise, way of assigning string values. Using double-quotes forces PHP to analyze/parse the string, looking for variables to replace. Even if there are no variables, it still has to parse through it all. Very slow. But, it served no other function than speed. |
|
|
|
 |
kevinkap

|
Posted:
Tue Apr 24, 2007 6:08 pm |
|
I am sure this is in the wrong place. Not to butcher your work, but I changed the edit for the mainfile.php to meet what is being used. I hope you do not mind.
This is what I made the code addition to look like.
$num = $db->sql_numrows($db->sql_query('SELECT * FROM '.$prefix.'_gcal_event WHERE approved = 0'));
$content .= '<strong><big>·</big></strong> <a href="'.$admin_file.'.php?op=gcalendar">'._CALENDAREVENTS.'</a>: '.$num.'<br />';
Then in english.php I added: define('_CALENDAREVENTS','Calendar Events');
Once again, I hope you do not take offense to it. I am really suprised that I managed to get it to work as I am not very good at it. |
|
|
|
 |
Gremmie

|
Posted:
Tue Apr 24, 2007 7:15 pm |
|
|
|
 |
kguske

|
Posted:
Tue Apr 24, 2007 9:03 pm |
|
Keep up the great work! Thanks to Montego and Raven for the performance recommendations - it just keeps getting better... |
|
|
|
 |
Gremmie

|
Posted:
Wed Apr 25, 2007 9:45 am |
|
I should mention that the rest of GCalendar is coded with a preference for single quotes. The changes to mainfile.php were based on the PHP-Nuke 7.9 code, which is still using double quotes. I did not feel it was necessary to add a language constant in there since this is an add-on and the admin will know what to put there for his own native language. And I didn't want to introduce another point where the novice admin could mess things up. To be complete, you need to add _CALENDAREVENTS to all the language files, and I didn't think that was worth it. |
|
|
|
 |
hunnydusst
New Member


Joined: Apr 05, 2007
Posts: 18
|
Posted:
Wed Jun 06, 2007 4:30 pm |
|
Gremmie........ it's BEAUUUUUUUUUTIFUL!!!!! Awesome work. My users are lovin it! I particularly like that I can view just one type of event at a time if I want.
This may be off the wall..... but is there a way to make it possible to view the entire year and make THAT printable???? |
|
|
|
 |
Gremmie

|
Posted:
Wed Jun 06, 2007 6:30 pm |
|
|
|
 |
|