Page 1 of 1

Three 'Must Have' Code Suggestions

Posted: Tue May 06, 2014 7:21 pm
by Scissoro
Codes that Will Improve Our Forum
Like/Dislike Buttons
Nothing improves the functionality and interactiveness of a forum like Like and Dislike buttons. This code goes Below the Board.
Spoiler

Code: Select all

<style type="text/css"><!--
/*
Facebook Style Like/Dislike System for ZetaBoards v1.0
Copyright 10-29-10 ~Wonder
May not be reposted anywhere
Place in the Below the Board section of the Board Template
*/
.likebg {background-color: #eaeaea;}
--></style>

<script>
//The Buttons are what you click to like/dislike a post, the Icons are what are shown next to the users who like/dislike a post
likeImageButtonURL="http://z1.ifrm.com/0/1/0/p408628/likeZB.png";
likeImageIconURL="http://img299.imageshack.us/img299/7645/thumbsupgreenr.gif";
dislikeImageButtonURL="http://img411.imageshack.us/img411/2557/zbdislike.png";
dislikeImageIconURL="http://img299.imageshack.us/img299/9333/thumbsdownrede.gif";

//Set to true if you want to disable Liking
disableLike=false;

//Set to true if you want to disable Disliking
disableDislike=false;

//If you want to change the word 'Like' to something else, edit these strings.
likeText=["Like","Likes","like this","likes this","Unlike"];

//If you want to change the word 'Dislike' to something else, edit these strings.
dislikeText=["Dislike","Dislikes","dislike this","dislikes this","Undislike"];
</script>
<script src="http://ifzblike.appspot.com/static/zblike.js"></script>

Ask Before Leaving
Have you ever typed a bit long post, then accidentally click away, and lost it all? This code prevents that. What it does is when you are on the 'reply' page and you click away to close it, it will prompt you and ask if you intend to leave. This code has saved me personally hours of time having to retype some big speech, news story or post. This goes "Below the Board".
Spoiler

Code: Select all

<script type="text/javascript">
// Ask Users to Confirm Before Leaving a Page with Post Data
// by Makaze of Zathyus Networks
window.onbeforeunload = confirmExit;
function confirmExit() {
var postField = $("#c_post-text").length;
var fastReplyField = $("#fast-reply dd textarea").length;
var pmField = $("#quickcompose").length;
var confirmMsg = "You have unsaved data. If you continue, your data may be lost."; // Customize the prompt message. The text "Are you sure you want to leave this page?" is automatically appended on the next line.

if (postField != 0) {
var emptyPost = $("#c_post-text").val();
if (emptyPost != "") {
return confirmMsg;
};
};

if (fastReplyField != 0) {
var emptyFastReply = $("#fast-reply dd textarea").val();
if (emptyFastReply != "") {
return confirmMsg;
};
};

if (pmField != 0) {
var emptyPM = $("#quickcompose").val();
if (emptyPM != "") {
return confirmMsg;
};
};
};

function justExit() {

};

$('#c_postbtn button, #fast-reply button, .postbtn button:contains("Send"), #pm_compose td:contains("Send Message") button').click(function() {
window.onbeforeunload = justExit;
});
</script>


Reply Notifier
Want to know in real time if someone has replied to one of your topics? Forgotten where you put that big post? This is the code for you. This code adds a small "Replies" button next to your Inbox. Whenever you get a reply on a topic you started, it colors up like the inbox does. Then, if you hover over it, it will show you exactly which topic you got a reply in. This is good for more active players who post numerous Topics a day and helps keep them organized. This goes "Above the Board".

Spoiler

Code: Select all

<script type="text/javascript">
// Topic Reply Notifications
// Created by Mwr247 (Mike)

// Image to use on top bar
var trn_img = "http://z3.ifrm.com/static/1/t_newpost.png";

// Time to update (in minutes) [default: 10]
var trn_time = 10;

</script><script type="text/javascript" src="http://z3.ifrm.com/1/22/0/p450693/trn.mini.pdf"></script>



Three 'Must Have' Code Suggestions

Posted: Tue May 06, 2014 7:33 pm
by Lord Ravenclaw
-Administrator Note-

We removed the like/dislike system as it links to an external source. The owner of said code would not allow it to be hosted on the forum server and we were wary of allowing a possible security vulnerability on the forum.

The other two, I really like the idea of. Thanks for them! I'll speak to the other administrators and see what they think.

Three 'Must Have' Code Suggestions

Posted: Tue May 06, 2014 8:20 pm
by Scissoro
Lord Joshua Ravenclaw wrote:Wed May 07, 2014 12:33 am-Administrator Note-

We removed the like/dislike system as it links to an external source. The owner of said code would not allow it to be hosted on the forum server and we were wary of allowing a possible security vulnerability on the forum.

The other two, I really like the idea of. Thanks for them! I'll speak to the other administrators and see what they think.
Okay Two Must Have Codes :P

Three 'Must Have' Code Suggestions

Posted: Sun May 11, 2014 12:40 am
by Scissoro
Bump

Three 'Must Have' Code Suggestions

Posted: Sun May 11, 2014 10:33 am
by Lord Ravenclaw
I linked this to our Tech Admin. ^

Three 'Must Have' Code Suggestions

Posted: Sun May 11, 2014 3:46 pm
by r3naissanc3r
Sorry for the delay Scissoro. I will need to test the two codes before installing them (especially the third one which is minified and therefore impossible to read). I'll try to do that by next weekend and let you know.