Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: [plugin] [ORPHAN] nhn_livecommentpreview: JavaScript live comment preview
So, I’m back in the internet at my new home. I hope to find some time the next days to fix this problems and add some features that have been requested via email.
Offline
Re: [plugin] [ORPHAN] nhn_livecommentpreview: JavaScript live comment preview
@zoeglingjulian: One question about your request. Does “magic quotes” mean, that “” is changed to “”?! I have to look in the javascript to see if it’s possible, but it should be.
Yeah, exactly. "something" would get converted into “something”. And regarding the dashes, that would be word1 -- word2 becomes “word1 — word2” and word1 - word2 becomes “word1 – word2”. Just like textile does. You could look the exact replacements in /textpattern/libs/textile.php (or something like that) at around line 750.
Oh, and, but that’s not really necessary as I could just edit the source, could you think about <txp:nhn_comments_form openquote="»" closequote="«"/> e.g., that you change the format of the quotes like that? Great for non-english users like me ;)
Last edited by zoeglingjulian (2005-10-08 08:14:36)
Offline
Re: [plugin] [ORPHAN] nhn_livecommentpreview: JavaScript live comment preview
No worky.
I checked and double checked everything. The live comment form seems to show up, but the preview doesn’t occur. The submit button, spamsave checkbox don’t show up at all?
I thought I had this stuff down. Obviously not.
Here are my forms:
Comments_display:
<code>
<txp:if_comments_allowed>
<txp:comments />
</txp:if_comments_allowed>
<txp:if_comments_allowed>
<txp:nhn_comments_form />
</txp:if_comments_allowed>
</code>
Comment_form:
<code>
<div id=“commentform”>
<h3 class=“commentform”>feedback form</h3>
<br/>
<br/>
<txp:if_cookie>
<i>Welcome back, <?php echo pcs(‘name’); ?>.</i>
<input type=“hidden” id=“name” name=“name” value=”<?php echo pcs(‘name’); ?>” size=“54” tabindex=“1” /><br/>
<input type=“hidden” id=“email” name=“email” value=”<?php echo pcs(‘email’); ?>” size=“54” tabindex=“2” /><br/>
<input type=“hidden” id=“web” name=“web” value=”<?php echo pcs(‘web’); ?>” size=“54” tabindex=“3” /><br/>
</txp:if_cookie>
<div class=“input”>
<txp:if_no_cookie>
<span><label for=“name”>Name:</label><input type=“text” id=“name” name=“name” value=”<?php echo pcs(‘name’); ?>” style=“width:430px;height:20px” tabindex=“1” /></span><br/>
<span><label for=“email”>Email:</label><input type=“text” id=“email” name=“email” value=”<?php echo pcs(‘email’); ?>” style=“width:430px;height:20px” tabindex=“2” /></span><br/>
<span><label for=“web”>http://</label><input type=“text” id=“web” name=“web” value=”<?php echo pcs(‘web’); ?>” style=“width:430px;height:20px” tabindex=“3” /></span><br/>
</txp:if_no_cookie>
</div><!— close input —>
<p class=“commentform”>
<b><label for=“message”>Thanks for speaking up:</label></b></p>
<span><textarea id=“message” name=“message” cols=“30” rows=“12” style=“width:430px;height:200px” tabindex=“4”><?php echo pcs(‘message’); ?></textarea><p class=“commentform”>Add <a href=“http://textism.com/tools/textile/”>Style</a> to your comment.
Get a <a href=“http://gravatar.com/”>Gravatar</a>.
Email addresses will remain private.<br/><br/>
<txp:comment_remember />
<txp:nhn_comment_spamsave />
</p>
</span>
<txp:nhn_livecommentpreview />
<txp:nhn_comment_submit />
</div><!— close commentform —>
</code>
nhn_live_comments_preview:
<code>
<h3>preview</h3>
<txp:nhn_lcp_preview />
</code>
Any Ideas,
Thanks.
Matthew
Last edited by ma_smith (2005-10-08 15:28:15)
- I am Squared Eye and I
am launchinghave launched Pattern Tap
Offline
Re: [plugin] [ORPHAN] nhn_livecommentpreview: JavaScript live comment preview
The plugin has been updated – current version: 0.3
- fixed bug in
<txp:nhn_comment_spamsave /> - added magic quotes and n-dash support in the javascript
To do:
- adding textarea tools
- look through changes sent in via email by Jeroen Coumans
- adding gravatar support (?)
@ma_smith: I check your problem tomorrow
Last edited by Skubidu (2005-10-08 21:36:16)
Offline
Re: [plugin] [ORPHAN] nhn_livecommentpreview: JavaScript live comment preview
That’s cool! Works on my local server (Apache 2 with php5 on windows) but on the real server the following error message displays if I try to view an article (with the comment form):
“Fatal error: Call to undefined function: stripos() in /www/htdocs/exzoegli/textpattern/lib/txplib_misc.php(455) : eval()’d code on line 266”
Offline
Re: [plugin] [ORPHAN] nhn_livecommentpreview: JavaScript live comment preview
I’ve been getting that txp_misc error too! And I thought it was just me because I hacked up my textpattern install quite extensively. If you can fix it Skub I’d be really happy. Thanks!
Offline
Re: [plugin] [ORPHAN] nhn_livecommentpreview: JavaScript live comment preview
Okay! I can’t reproduce the error at the moment, but I’ll see what I can do :)
Offline
Re: [plugin] [ORPHAN] nhn_livecommentpreview: JavaScript live comment preview
I’ll post the diagnostics, perhaps that’ll help. These are on the “real” webserver where it doesn’t work. The local test server runs on windows, php5, apache2.
<pre><code>
Version Textpattern: 4.0.1 (r996)
last_update: 2005-10-04 20:10:41/2005-10-04 20:09:28
Absoluter Pfad der Seite: /www/htdocs/exzoegli/ (/www/htdocs/exzoegli)
$path_to_site: /www/htdocs/exzoegli
Pfad Textpattern: /www/htdocs/exzoegli/textpattern
Schema der URLs: section_title
open_basedir: /www/htdocs/exzoegli/:/tmp:/usr/bin:/www/htdocs/exzoegli:/bin:/usr/local/bin:/usr/share/php
Temporäres Verzeichnis: /tmp
Seiten-URL: ex.zoegling.de
PHP-Version: 4.3.1
Register globals: 1
server_time: 2005-10-09 11:36:45
MySQL: 4.0.24-Max-log
Regionale Einstellungen: de_DE.UTF-8
Server: Apache/1.3.27 (Linux/SuSE) mod_fastcgi/2.4.2 FrontPage/4.0.4.3 PHP/4.3.1 mod_perl/1.27 mod_ssl/2.8.12 OpenSSL/0.9.6i
Inhalt der .htaccess-Datei:
————————————
#DirectoryIndex index.php index.html
#Options +FollowSymLinks
#RewriteBase /relative/web/path/
AddDefaultCharset utf-8
<IfModule mod_rewrite.c> RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^(.+) – [PT,L] RewriteRule ^textpattern/(login|schreiben|profil)/?(.*)$ textpattern/user_config/index.php$2 [NC,L] RewriteRule ^(.*) index.php </IfModule> ———————————— </code></pre>Last edited by zoeglingjulian (2005-10-09 09:44:54)
Offline
Re: [plugin] [ORPHAN] nhn_livecommentpreview: JavaScript live comment preview
Can you please download the plugin again (version 0.3.1) and tell me if this fixes the problem?
Offline
Re: [plugin] [ORPHAN] nhn_livecommentpreview: JavaScript live comment preview
Works! Thanks!
Offline
#41 2005-10-11 06:05:22
- rgx
- New Member
- Registered: 2005-02-25
- Posts: 2
Re: [plugin] [ORPHAN] nhn_livecommentpreview: JavaScript live comment preview
How can I prevent the 2 div’s from showing up after the comment is submitted and it says “Thank you for adding your comment.” ?
edit: oh yeah, I’m also on debugging mode and I am getting this error on the page after installing this pluin : Notice: Undefined variable: out in /home/.odzanends/username/domain.com/textpattern/lib/txplib_misc.php(429) : eval()’d code on line 277
Last edited by rgx (2005-10-11 06:08:01)
Offline
Re: [plugin] [ORPHAN] nhn_livecommentpreview: JavaScript live comment preview
@ rgx: What do you mean? “The 2 div’s”?! The notice has been fixed and won’t appear in the next releases.
@ ma_smith: I totally forget about that one.
The main problem is, that you are not using the build in textpattern tags to create the input boxes – that why some attributes are missing.
If you want to use the comment form the way it seems, please add the attributes “id” and “onkeyup” to your textarea:
<textarea class="txpCommentInputMessage" name="message" cols="25" rows="5" tabindex="1" id="nhn_message" onkeyup="ReloadTextDiv();"></textarea>
After that make sure that you have inserted the javascript in the right page template (<txp:nhn_livecommentpreview_js />).
Last edited by Skubidu (2005-10-11 07:56:54)
Offline
#43 2005-10-11 13:52:53
- rgx
- New Member
- Registered: 2005-02-25
- Posts: 2
Re: [plugin] [ORPHAN] nhn_livecommentpreview: JavaScript live comment preview
Skubidu,
Sorry, it’s actually one div.
I edited this part of the plugin to output as so, instead of the comment class.
<code>$nhn_form = parse(fetch(‘form’,‘txp_form’,‘name’,doSlash(‘nhn_livecommentpreview’)));
return ‘<div class=“commwrap”>’.$nhn_form.’</div>’;</code>
There is a <code><div></code> outputted before the <code><div class=“commwrap”></div></code> only after submit is hit.
Last edited by rgx (2005-10-11 14:11:20)
Offline
Re: [plugin] [ORPHAN] nhn_livecommentpreview: JavaScript live comment preview
Hm, I can’t see another div there or I’m still not really understanding what you’re talking about…
There is the div that wraps the live comment preview: <div class="comment"></div>. You are not talking about that one, right? But I don’t see any other…
Offline
Re: [plugin] [ORPHAN] nhn_livecommentpreview: JavaScript live comment preview
Hi Skubidu,
I hacked your plugin a bit and changed the tabindex of the comment form because the weird tabindex order (described here and here).
Since nhn_comments_form overides the default comments form, perhaps you may want to include the small hacks and package it as an additional ‘feature’ of your plugin, ie live_commentspreview also fixes the weird tabindex for the comments form.
it’s just my small suggestion, something for you to consider. Anyway, thanks for the great plugin!
Offline