Popup Comments Preview

Download plugins, language packs and stuff.

Popup Comments Preview

Postby DarkSlim » Tue Nov 17, 2009 4:14 pm

Ah huh! this is my newest invention lol that I want to share with you. :)

I was trying to make the comment preview plugin work, but for some reason
it wasn't working, also, I prefered showing the comment preview in a popup,
that is why I wrote this code! :D

What do you get
A new button near the submit comment in the comment form, when clicked
it opens a new popup (you can change the size and attributes) with a nice
table that shows the correct comment preview with linebreaks bbcodes and smilies!
It is also checking if the comment is empty, it shows a message accordingly,
and last it has a 'close' button that will close the popup.

What took me a bit time was making the button open the popup and send the information
there, and then making the submit button work too, it is all done and works perfectly! :)

Installation

1. Download th .rar file and extract the file "commpreview.php" in your site's root folder.

2. Enter CNR, then Templates, your wanted template, and then choose "Comment Form"

3. Now look for the submit button (should start with <input type="submit"... etc')

And Replace it with the following code:
Code: Select all
<script type="text/javascript">

function normals()
{
    document.form.setAttribute('target', '_self');
    document.form.setAttribute('action', '');
    document.form.setAttribute('onClick', 'form.action="";');
    document.form.submit();
}

function process()
{
    window.open('commpreview.php', 'popup', 'width=420,height=310,resizeable=yes,scrollbars=yes');
    document.form.setAttribute('target', 'popup');
    document.form.setAttribute('action', 'commpreview.php');
    document.form.setAttribute('onClick', 'form.action="commpreview.php";');
    document.form.submit();
}
</script>

<input type="submit" tabindex="4" name="submit" value="Submit" onClick="normals()"  />

<input type="submit" tabindex="5" name="preview" value="Preivew" onClick="process()" />
<br>


* You can change the code as you like, check that the relative path to 'commpreview.php' is right
* You can also change the commpreview.php design as you like

Edit: Fixed the bug in IE, now it works perfectly (was checked in FireFox and Chrome too)

That's it! now you have a neat awesome comments preview! :wink:
Hope you liked it, I'de be glad to hear what you think, if it all works for you etc


DarkSlim
Attachments
commpreview.rar
Popup Comments Preview Addon!
(855 Bytes) Downloaded 93 times
Last edited by DarkSlim on Wed Nov 18, 2009 11:46 am, edited 1 time in total.
User avatar
DarkSlim
 
Posts: 298
Joined: Thu Aug 06, 2009 4:18 pm
Location: IL

Postby DarkSlim » Tue Nov 17, 2009 5:52 pm

Hmm for some reason it has a problem in the popup window when
I test it on IE on my comp, I will check it again to make sure

FireFox works 100%

Edit: Fixed the bug (was in the javascript), not it works perfectly
I have updated the code in the first post. :)
User avatar
DarkSlim
 
Posts: 298
Joined: Thu Aug 06, 2009 4:18 pm
Location: IL

Postby eberswine » Thu Nov 19, 2009 3:33 am

DAMN DarkSlim!

YOU ROCK!

you are tearing it up here! great job!

How can I donate to you?

Where have you been this whole time?
User avatar
eberswine
 
Posts: 289
Joined: Thu Apr 26, 2007 7:23 pm

Postby DarkSlim » Thu Nov 19, 2009 10:15 am

eberswine wrote:DAMN DarkSlim!

YOU ROCK!

you are tearing it up here! great job!

How can I donate to you?

Where have you been this whole time?


Thank you very much, I'm really glad to hear that! :)
I have many more plugins and mods to share
and make, also I want to work on bringing some
stuff, fixes and hacks from Strawberry to CNR for us. ;)
If you want to donate here is the link: Thanks
I have also added it to my signature
User avatar
DarkSlim
 
Posts: 298
Joined: Thu Aug 06, 2009 4:18 pm
Location: IL


Return to Additional Downloads



Who is online

Users browsing this forum: No registered users and 0 guests

cron