If you are seeing this message, it is possible the page did not load properly. Please hit reload/refresh on your browser.
If you still see this message, you probably do not have a browser that supports web standards, although its content is accessible to any browser or Internet device.

Cool Tips & Tricks Cool Tips & Tricks

Help Communities:
Help Forums Bug Base
<< Prev Topic | Next Topic >>
Cool Tips & Tricks ::: Javascript FAQ ::: Quick reply by phalen180
New Topic    Add Reply
Topic: Quick reply by phalen180  (?)  Click to receive email notification of replies Click to stop receiving email notification of replies email this topic to a friend
Nutrocker

ezboard Moderator
ezSupporter
Posts: 7078
Posted: 3/28/03 4:10 pm    
Quick reply by phalen180
This version of quick reply adds the following features/fixes:

[*]Changing the "Add Reply" button is no longer required.
[*]Option for HTML mode posts and for a dropdown to let the user select the posting mode
[*]Quick Reply appears (and works) from Prev/Next topic screens.

Please note the new support function that goes into the HEAD section and that you will still need ezURL installed if you want to use the emoticon list link.

Also please note that I'm soliciting donations, as I've just had to order a replacement server for GEKE.NET and am trying to offset the costs because I don't make any money from running any of the sites hosted on it, currently.

Summary: Add a form to reply to the topic from the topic page.

Details:
To use the "linkEmoticons" option, you must have the ezURL script in place on your board.

HEAD (box #1):
    <script type="text/javascript">
/* FUNCTION TO GET ELEMENTS WITH TAG/ATTRIBUTE/VALUE */
function getElementsByAttribute (tag, attr, value, stopat) {
        var re;
        var foundels;
        var iFound;
        var sAttrValue;

        checkels = document.getElementsByTagName(tag);
        foundels = new Array();

        for (el = 0; el < checkels.length; el++) {
                sAttrValue = checkels[el].getAttribute(attr, 2);
                re = new RegExp(value, "ig");
                if (re.test(sAttrValue) != 0) {
                        iFound = foundels.push(checkels[el]);
                        if (stopat > 0 && iFound >= (stopat)) {
                                el = checkels.length;
                        }
                }
        }
        
        return foundels;
}
/* END FUNCTION TO GET ELEMENTS WITH TAG/ATTRIBUTE/VALUE */
</script>

This is a new support function which gets the "add reply button" so that the Quick Reply can be placed where we want it.

FOOTER (box #4):
    <script type="text/javascript">
/* QUICK REPLY by phalen180 */
/*
        copyright 2005 phalen180
        Please email serverfund at geke.net for info on how to donate to keep the
        G E K E . N E T ezboard script archive going
*/

if ( document.location.href.indexOf(".showMessage") != -1 || 
        document.location.href.indexOf(".showPrevMessage") != -1 || 
        document.location.href.indexOf(".showNextMessage") != -1 || 
        document.location.href.indexOf(".deleteSingle") != -1) {

        /* Comment the lines below out or change the value to false
           to assume that we will NOT include personal photo
           or signature,
           or use emoticons
           or to show a link to the emoticon list
           or to hide the subject box */


        // For the following options
        // use 0 for never,
        // 1 for always,
        // 2 to show checkbox (unchecked),
        // 3 to show checkbox (checked)

        includePersonalPhoto = 1;
        includeSignature = 1;
        useEmoticons = 3;
        convertLinks = 3;
        stayInTopic = 2;
        showPreview = 2;
        linkEmoticonList = false;

        /*
        use "text" for plain text,
        "html" for HTML
        and "choose" to show a dropdown */

        // postType = "html";
        // postType = "text";
        // postType = "choose";
        postType = "ezcodes"; 

        showSubjectBox = true;
        subjectSize = 60;
        messageCols = 60;
        messageRows = 4;

        /* UNCOMMENT THIS ONE TO USE THE ORIGINAL STYLE */
        // addReplyButton = document.getElementsByName("addreplybutton").item(1);

        /* UNCOMMENT THIS ONE TO USE A TEXT ADD/REPLY BUTTON */
        // foundels = getElementsByAttribute("a", "href", ".showAddReplyScreenFromWeb?", 0);
        // addReplyButton = foundels[foundels.length - 1].childNodes[0];

        /* UNCOMMENT THIS ONE TO USE AN IMAGE ADD/REPLY BUTTON */
        addReplyButton = getElementsByAttribute("img", "alt", "Add Reply", 2)[1];

        QRCell = addReplyButton.parentNode;
        while ( QRCell.nodeName != "TR" ) {
                QRCell = QRCell.parentNode;
                }
        QRCell = QRCell.getElementsByTagName("td").item(0);

        QRForm = document.createElement("form");
        QRForm.method = "post";
        QRForm.action = addReplyButton.parentNode.href.replace(".showAddReplyScreenFromWeb", ".addReplyFromWeb");
        QRForm.name = "PostMessage";

        QRSubject = document.createElement("input");
        QRSubject.value = document.title.replace(" - www.ezboard.com", "");
        QRSubject.id = "quickreplysubject";
        QRSubject.name = "subject";
        if ( showSubjectBox ) { 
                QRSubject.type = "text";
                QRSubject.className = "inputbox";
                QRSubject.maxLength = 60;
                QRSubject.size = subjectSize;
                QRSubject.tabIndex = 3;
                QRSubject.style.marginRight = "3px";
                } else {
                QRSubject.type = "hidden";
                }

        QRBody = document.createElement("textarea");
        QRBody.rows = messageRows;
        QRBody.cols = messageCols;
        QRBody.id = "quickreplybody";
        QRBody.className = "inputbox";
        QRBody.value = "";
        QRBody.name = "body";
        QRBody.tabIndex = 4;

        QRSubmit = document.createElement("input");
        QRSubmit.type = "submit";
        QRSubmit.className = "inputbutton";
        QRSubmit.id = "quickreplysubmit";
        QRSubmit.value = "Quick Reply";
        QRSubmit.tabIndex = 5;

        QRCell.align = "right";
        QRCell.appendChild(QRForm);

        /* Uncomment the commented lines to add labels for the two boxes */

        // QRForm.appendChild(document.createTextNode("Subject: "));
        QRForm.appendChild(QRSubject);
        QRForm.appendChild(QRSubmit);
        // QRForm.appendChild(document.createElement("br"));
        // QRForm.appendChild(document.createTextNode("Message: "));
        QRForm.appendChild(document.createElement("br"));
        QRForm.appendChild(QRBody);

        QRForm.appendChild(document.createElement("br"));

        if (postType != "choose") {
                QRpt = document.createElement("input");
                QRpt.type = "hidden";
                QRpt.name = "postType";
                QRpt.value = postType;
                QRForm.appendChild(QRpt);
        }
                else {
                QRpt = document.createElement("select");
                QRpt.name = "postType";
                QRpt.appendChild(QRSelection("text", "Plain Text"));
                QRpt.appendChild(QRSelection("ezcodes", "EZ Codes"));
                QRpt.appendChild(QRSelection("html", "HTML"));
                QRForm.appendChild(QRpt);
        }

        if ( includeSignature > 0) {
                QRForm.appendChild(QROption("includeSignature","Include custom signature.", includeSignature));
                }
        if ( includePersonalPhoto > 0) {
                QRForm.appendChild(QROption("includePersonalPhoto","Include personal photo.", includePersonalPhoto));
                }
        if ( useEmoticons > 0 ) {
                QRForm.appendChild(QROption("emoticons","Use Emoticons.",useEmoticons));
                }
        if ( convertLinks > 0 ) {
                QRForm.appendChild(QROption("convertLinks","Convert URL links.",convertLinks));
                }
        if ( stayInTopic > 0) {
                QRForm.appendChild(QROption("stayInTopic","Stay in topic", stayInTopic));
                }

if ( showPreview > 0) {
QRForm.appendChild(QROption('preview','Preview', showPreview));
}

        if ( linkEmoticonList && ezFullPub != "") {
                eListLink = document.createElement("a");
                eListLink.href = "http://" + ezFullPub + ".ezboard.com/b" + ezBoardID + ".showEmoticonsHelp";
                eListLink.target = "_blank";
                eListLink.innerHTML = "complete emoticon list";
                QRForm.appendChild(document.createElement("br"));
                QRForm.appendChild(eListLink);
        }
}

function QROption(sName, sLabel, iShowState) {
        if ( iShowState > 0 ) {
                QROpt = document.createElement("span");
                QROpt.id = "span" + sName;
                QRCheckBox = document.createElement("input");
                QRCheckBox.name = sName;
                QRCheckBox.id = sName;
                QRCheckBox.value = "on";
        
                if ( iShowState > 1 ) {
                        QRCheckBox.type = "checkbox";

                        // checkbox label
                        QRCheckBoxLabel = document.createElement("label");
                        QRCheckBoxLabel.htmlFor = sName;
                        QRCheckBoxLabel.innerHTML = sLabel;
                        
                        if ( iShowState > 2 ) {
                                QRCheckBox.defaultChecked = true;
                        }
                        QROpt.appendChild(QRCheckBox);
                        QROpt.appendChild(QRCheckBoxLabel);
                       } else {
                                QRCheckBox.type = "hidden";
                                QROpt.appendChild(QRCheckBox);
                        }
                return QROpt;
                }
        }

function QRSelection(sOption, sDisplay) {
        QRSel = document.createElement("option");
        QRSel.innerHTML = sDisplay;
        QRSel.value = sOption;

        return QRSel;
}
/* END QUICK REPLY */
</script>

You can comment out the includePersonalPhoto and includeSignature lines to turn those features on or off by default for quick replies.

There are some labels for the two boxes that are commented out by default. Uncomment them if you want labels on the boxes.

To add "Re: " to the subject, change the line:
    QRSubject.value = document.title.replace(" - www.ezboard.com", "");

to:
    QRSubject.value = "Re: " + document.title.replace(" - www.ezboard.com", "");


This script has not been confirmed to work with the following layouts:
- CLEAN
- PDA

These layouts don't show the addreply button

History:
2/11/2005 - added html style, removed requirement for changing add/reply image.
2/11/2005 - fixed Prev/Next issue
6/27/2004 - fixed Opera/Safari bug (innerText changed to innerHTML)
1/1/2004 - added more options, display of options
8/21/2003 - added plain text / ezcodes option
7/27/2003 - added option for emoticon list link
7/11/2003 - added info for "Re:" in subject line.
3/28/2003 - created

Credits:
written by phalen180
Prev/Next update help from Disco Deek

Edited by: ezGoalieAunt at: 1/7/07 9:17 pm

  reply to this message

ezstrangelets

ezboard Moderator
ezSupporter
Posts: 25
Posted: 11/17/03 10:39 pm    
Re: Quick reply by phalen180
Note: after using the quickreply, users may find that their posting preferences (having ezcodes checked, emoticons on 'show', etc) will be reset to plain text and hide emoticons. They just have to make a post using the standard reply page to set them back to their preference.


  reply to this message

Nutrocker

ezboard Moderator
ezSupporter
Posts: 10075
Posted: 11/29/03 4:34 am    
Signatures enabled or disabled per forum
Someone wanted to use quick reply but in one forum disable the signatures just for that forum but enable it for other forums...

phalen answered the question with this reply...

Replace:
    
includeSignature = 1;

in the quick reply with the appropriate switch statement:

    
switch (ezForum) {
  case "frm22":
includeSignature = 0;
     break;
  case "frm19":
includeSignature = 0;
     break;
  default:
includeSignature = 1;
}


For the above to work you need ONE copy of the ezurl script installed on the board.

Edited by: Nutrocker at: 12/30/04 3:12 pm

  reply to this message

Nutrocker

ezboard Moderator
ezSupporter
Posts: 14988
Posted: 2/4/05 2:16 pm    
I want to control how the quick reply looks
If you want to use a background image for QR, or to change the background color, or the border colors, use some CSS in the custom html area.

Please note that this same css will also control how the standard reply area looks when replying to a topic or making a new topic.

Custom HTML
1st text box from the top


    <style>

.inputbox, textarea
{
background-color: #cc9966;
background-image: url(http://example.com/yourbg.jpg);
border-bottom: 3px #cccc99 solid;
border-left: 3px #336600 solid;
border-right: 3px #cccc99 solid;
border-top: 3px #336600 solid;
color: #663300; font-family: Arial, sans-serif; height: 200px; width: 300px; } </style>


I want a background image for Quick Reply
I want to change the border color and thickness used in Quick Reply
I want to change the font color used in Quick Reply
I want to change the font family used in Quick Reply

Edited by: Nutrocker at: 2/4/05 2:17 pm

  reply to this message

Nutrocker

ezboard Moderator
ezSupporter
Posts: 16074
Posted: 8/28/05 2:45 pm    
Re: Signatures enabled or disabled per forum
holdenmichael figured out how to move the "Quick Reply" button, and I asked him to post the code he used...

This is his reply...

This is the code as originally given to us:
   
        //QRForm.appendChild(document.createTextNode("Subject: "));
        QRForm.appendChild(QRSubject);
        QRForm.appendChild(QRSubmit);
        // QRForm.appendChild(document.createElement("br"));
        // QRForm.appendChild(document.createTextNode("Message: "));
        QRForm.appendChild(document.createElement("br"));
        QRForm.appendChild(QRBody);

        QRForm.appendChild(document.createElement("br"));



I've added line breaks between:

- the last reply on the page and the subject box
- the subject box and the message box
- the message box and line with the input button, drop down menu, and feature checkboxes

   
        QRForm.appendChild(document.createElement("br"));
        // QRForm.appendChild(document.createTextNode("Subject: "));
           QRForm.appendChild(QRSubject);
        QRForm.appendChild(document.createElement("br"));
        // QRForm.appendChild(document.createTextNode("Message: "));
        QRForm.appendChild(document.createElement("br"));
        QRForm.appendChild(QRBody);

        QRForm.appendChild(document.createElement("br"));
        QRForm.appendChild(document.createElement("br"));

        QRForm.appendChild(QRSubmit);


The following line of code is the "Quick Reply" button so I placed it after the other elements of the feature:

   
QRForm.appendChild(QRSubmit);


I entered the line breaks by adding the following line of code in between the elements of the feature:

   
QRForm.appendChild(document.createElement("br"));


I hope that my explanation isn't too confusing.

Continued...
I forgot to add that you have to change
  
QRCell.align = "right";


to

  
QRCell.align = "center";


and use the following settings

  
includePersonalPhoto = 1;
includeSignature = 1;
useEmoticons = 0;
convertLinks = 1;
stayInTopic = 0;
showPreview = 0;
linkEmoticonList = false;


to get only the quick reply button to appear and have it be centered (anything set to 1 can also be set to 0, but 2 will make it appear and move the qr button off center).

Unfortunately, this will also result in your page numbers (those that appear after you have more than 20- or however many you have it set to- posts on a page) appearing centered above the quick reply feature.


Edited by: Nutrocker at: 9/1/05 3:06 pm

  reply to this message

ezjennifer

Registered User
ezSupporter
Posts: 1
Posted: 10/16/06 3:30 pm    
Re: Quick reply by phalen180
Last week ezboard made a change in the document titles of topic pages to improve search engine optimization. The quickreply box gets it's default (autofilled) subject line from the document title, so you will need to edit your quickreply script a little bit. You only need to edit this one line:

change this line

   QRSubject.value = document.title.replace(" - www.ezboard.com", "") ;


to this line

   QRSubject.value = document.title.replace(" - Message Board - ezboard.com", "") ;


11-15-06 This seems to have changed again.
Change
   QRSubject.value = document.title.replace(" - Message Board - ezboard.com", "") ;


back to:
   QRSubject.value = document.title.replace(" - www.ezboard.com", "") ;

Edited by: ezGoalieAunt at: 11/28/06 9:55 pm

  reply to this message

Click to receive email notification of replies Click to stop receiving email notification of replies email this topic to a friend

New Topic    Add Reply

jump to:
Topic Control Image::: Topic Commands
<< Prev Topic | Next Topic >>

Icon Legend

reply button:::Reply to Post Button   edit button:::Edit Post Button  delete button:::Delete Post Button (Moderator Only)

subscribe/unsubscribe to thread button:::Subscribe to Thread Button   email to friend button:::Email to Friend Button  



- Cool Tips & Tricks - Javascript FAQ -

Communitiesezboard Help Communities:

Help Forums Help Forums Bug Base Bug Base





Powered By ezboard® Ver. 7.32
Copyright ©1999-2007 ezboard, Inc.