Welcome to Geeklog, Anonymous Sunday, December 22 2024 @ 12:11 am EST

Geeklog Forums

Extending the Journal Plugin?


Status: offline

destr0yr

Forum User
Full Member
Registered: 07/06/02
Posts: 324
caffeinated
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.
-- destr0yr
"I love deadlines. I like the whooshing sound they make as they fly by." -- Douglas Adams
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
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
 Quote

Status: offline

destr0yr

Forum User
Full Member
Registered: 07/06/02
Posts: 324
Thank you again.
-- destr0yr
"I love deadlines. I like the whooshing sound they make as they fly by." -- Douglas Adams
 Quote

Status: offline

destr0yr

Forum User
Full Member
Registered: 07/06/02
Posts: 324
Quote by Dirk: It filters all HTML somewhere (search for "strip_tags"). This should probably be changed to call Geeklog's COM_checkHTML() instead.
it looks like it passed through the following line:
Text Formatted Code

$je_summary = addslashes(htmlspecialchars(strip_tags(COM_checkWords($je_summary))));
which i changed to:
Text Formatted Code

$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:
Text Formatted Code
$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...
-- destr0yr
"I love deadlines. I like the whooshing sound they make as they fly by." -- Douglas Adams
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
You were on the right track - htmlspecialchars converts < into &lt; (amongst other things) ... bye, Dirk
 Quote

Status: offline

destr0yr

Forum User
Full Member
Registered: 07/06/02
Posts: 324
Quote by Dirk: You were on the right track - htmlspecialchars converts $retval .= nl2br($A["je_text"]); [/code] However, i get the same result... a view source shows the following...
Text Formatted Code
 <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.

-- destr0yr
"I love deadlines. I like the whooshing sound they make as they fly by." -- Douglas Adams
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
I meant that you should remove the call to that function Cool bye, Dirk
 Quote

Status: offline

destr0yr

Forum User
Full Member
Registered: 07/06/02
Posts: 324
Quote by Dirk: I meant that you should remove the call to that function Cool
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.
-- destr0yr
"I love deadlines. I like the whooshing sound they make as they fly by." -- Douglas Adams
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
In function savejournalentry() I now have
Text Formatted Code
$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
 Quote

Status: offline

destr0yr

Forum User
Full Member
Registered: 07/06/02
Posts: 324
cheerful
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... Wink
-- destr0yr
"I love deadlines. I like the whooshing sound they make as they fly by." -- Douglas Adams
 Quote

DJDevon3

Anonymous
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.
 Quote

Status: offline

Blaine

Forum User
Moderator
Registered: 07/16/02
Posts: 1232
Location:Canada
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 Smile with the HTML img code.
Text Formatted 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.
Text Formatted Code

echo msg_showsmilies();

 


Geeklog components by PortalParts -- www.portalparts.com
 Quote

All times are EST. The time is now 12:11 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content