Posted on: 07/23/03 09:39am
By: destr0yr
Just a random thought I had tonight... would anybody know the degree of difficulty editing the Journal plugin so that it can include smiles, URL\'s and images in the posts? Similar to posting a story in GL w/htmlarea or the forum plugin.
I was able to edit the plugins/journal/functions.inc and had htmlarea taking control of the textarea, however, saving the journal entry resulted in a blank page and that entry just not saving.
Re:Extending the Journal Plugin?
Posted on: 07/23/03 09:47am
By: Dirk
It filters all HTML somewhere (search for \"strip_tags\"). This should probably be changed to call Geeklog\'s COM_checkHTML() instead.
From there, it shouldn\'t be to complicated to replace the editor with something like HTMLarea. Just make sure to include all hidden and visible input fields of the original editor.
bye, Dirk
Re:Extending the Journal Plugin?
Posted on: 07/23/03 09:48am
By: destr0yr
Thank you again.
Re:Extending the Journal Plugin?
Posted on: 07/23/03 12:04pm
By: destr0yr
[QUOTE BY= Dirk] It filters all HTML somewhere (search for \"strip_tags\"). This should probably be changed to call Geeklog\'s COM_checkHTML() instead.
[/QUOTE]
it looks like it passed through the following line:
$je_summary = addslashes(htmlspecialchars(strip_tags(COM_checkWords($je_summary))));
which i changed to:
$je_summary = addslashes(htmlspecialchars(COM_checkWords($je_summary)));
and that saves all the data properly into the table (this is with the HTMLarea hack). So all the HTML code does showup in the table.
However, when i go to view the journal entry it just takes whats in the DB and spits it out so that you see the HTML...
the line that outputs the journal info is the following:
$retval .= nl2br(stripslashes($A[\"je_text\"]));
i\'ve been reading the PHP manual and can\'t find anything that will convert the HTML into actual code, rather than displaying it as text... i was looking at things such as htmlspecialchars, htmlentities...
Re:Extending the Journal Plugin?
Posted on: 07/23/03 12:44pm
By: Dirk
You were on the right track - htmlspecialchars converts < into < (amongst other things) ...
bye, Dirk
Re:Extending the Journal Plugin?
Posted on: 07/23/03 01:19pm
By: destr0yr
[QUOTE BY= Dirk] You were on the right track - htmlspecialchars converts
$retval .= nl2br($A[\"je_text\"]);
However, i get the same result...
a view source shows the following...
<br><P><STRONG>blah blah</STRONG></P><br />
<P> <A href=\"http://www.okanagangirlz.com\">http://www.okanagangirlz.com</A></P><br />
i\'m trying to understand it... but @ the moment i dont see how the htmlspecialchars will help.
pls advise.
Re:Extending the Journal Plugin?
Posted on: 07/23/03 01:32pm
By: Dirk
I meant that you should remove the call to that function
bye, Dirk
Re:Extending the Journal Plugin?
Posted on: 07/23/03 01:58pm
By: destr0yr
[QUOTE BY= Dirk] I meant that you should remove the call to that function
[/QUOTE]
i did, and it still doesn\'t work?! plain and simple, this is what i have:
$retval .= nl2br($A[\"je_text\"]);
but displaying the journal entry still shows the code on the page.
Re:Extending the Journal Plugin?
Posted on: 07/23/03 02:36pm
By: Dirk
In function savejournalentry() I now have
$je_text = addslashes(COM_checkWords($je_text));
and it works as expected ...
Oh, and of course you need to test that with
new entries.
bye, Dirk
Re:Extending the Journal Plugin?
Posted on: 07/23/03 03:27pm
By: destr0yr
i apologize for being such an inquisitive id10t.
must come naturally.
Thank you Dirk.
p.s.: this somewhat breaks the journal block, but i wont bug ya about that...
Extending the Journal Plugin?
Posted on: 01/25/04 06:29pm
By: Anonymous (DJDevon3)
I'm looking for something that extends the Journal plugin as well so it will include a photo that a user wants to put into the journal using a browse upload or even html. Yes, adding smileys and images would make the journal script one that every site would probably use. I can't code pure gl to save my life so could someone who knows gl take a shot at doing it? Peace.
Extending the Journal Plugin?
Posted on: 01/25/04 07:11pm
By: Blaine
If you have glMessenger installed you can use the smilie function and benefit from the online smilie library editor. Forum 2.3 will also detect if glMessenger is installed and allow you to use the glMessenger smilie functions.
The following code handles replacing the emoticon with the HTML img code.
$message = msg_replaceEmoticons( $message );
Additionally this funtions will display all the unique smilies in your library and can be used in your posting journal page or pop-up smilie help.
echo msg_showsmilies();