Welcome Guest [Log In] [Register]

About Me

Tips, tricks, and projects from the Generation Studio team. Updated often.
Categories
Code Release (2)
Coding Tips (1)
Other (2)
RPGeneration (2)

Readers Online

0 Members, 1 Guest

Apr 01

ZB no more

I'll no longer be coding from ZB.

RPGeneration will be turned into a new, non-ZB project. Stay tuned for that.

modBase may be finished, but I doubt it. As a truly great coder, I simply don't have the time!
Posted at 8:20 pm · 2 comments
Feb 09

ZB Coding Conventions

I think it's time we establish a standard in layout of code for ZB. Page layouts for ZB currently look very messy, because something like this happens when you get multiple codes from different coders:
Code:
 

<script>
//Code by John of Doe
//http://google.com
//More random advertising here

var a = document.getElementById('ha');
</script>

<script type='text/javascript'>
/* RPG by Ron of TheCodes
To use this, make sure RPG.on is set to true!
If you have questions, visit support.zetaboards.com! */

var RPG = {};
RPG.on = true;
</script>


Obviously, these are two completely different styles of coding! Therefore I've set out to create a standard for people (including me, from now on!) to follow. I'd appreciate your comments on what changes should be made.

1. The script's type is text/javascript.
It doesn't really matter, but proper XHTML is
Code:
 
<script type="text/javascript">

Therefore, define the type (and only the type!) "text/javascript" in the script tag.

2. Wrap scripts in //<![CDATA[
This helps XHTML parsers from parsing your Javascript incorrectly.
Code:
 

<script type="text/javascript">
//<![CDATA[
(code here)
//]]>
</script>


3. Define information in a single /* .. */ at the top of the code.
Standard information: The code creator, information on how to use the code.
Code:
 
/* Code created by Ryura
The variables are Code.On (when set to true, turns it on. Set to false, turns the code off) Code.Link (defines the link for the code, should be in double quotes [""]). */


4. Define a single global variable (object) for your code to use.
Global variables are bad and can cause problems with other's codes, so define a single, meaningful object for your code.
Code:
 
var TopicEnhance = {};
TopicEnhance.text = "Your topics are being enhanced!";


5. Define actual coding comments with // .
Comments in your code help others to understand what is going on. Make your comments meaningful.
Don't do obvious things like:
Code:
 
TopicEnhance.number=1 //Sets number to 1.


6. Use proper spacing.
Indent is 4 types spaces. Don't use the tab key.
Code:
 

function () {
if(something) {
x++
}
}


7. Use jQuery.
Don't use document.getElementById and the like, unless absolutely necessary. jQuery is included on all ZB boards, so use it!

8. Don't pack, minify
Minify your external scripts to increase speed. Do not pack your scripts, for it takes time for them to be unpacked.

Obviously there may be problems with my initial suggestions, or I may be missing some standards that should be created. Comment with your thoughts!
Posted in Coding Tips at 1:47 pm · 10 comments
Jan 22

ZB Coding Tips #1

I'll be making frequent blog posts detailing the best ways to access certain information in ZB. Today's post goes over some basic things you'll want to know.

Getting the current user's username.
This is one of my most commonly used tricks; often when sending data to a server (more on that in the future), I use this.
Quote:
 
var youUser = $('#top_info strong').text();


Checking if a user is logged in
This is incredibly helpful for making your code not visible to guests. Note: This uses youUser from above.
Quote:
 
var is_logged_in = youUser != "Guest";


Finding out which page a user is on
Great for executing code only on certain pages. On this page, it would contain a string: "blog".
Quote:
 
var currentURL = window.location.href.split(main_url)[1].split("/")[0];


Executing an external script only on certain pages.
This one is critical to keeping load times on a board fast. If you don't use this, external scripts will be downloaded and read even on pages where they aren't needed.
Quote:
 
if (currentURL == "topic")
$('#copyright').append("<script src='http://something.com/scripts/script.js'><\/script>");
Posted at 9:27 pm · No comments
Jan 10

RPGeneration new item syntax

We're looking for your opinion!

Currently in RPGeneration, a new item (Items include weapons, armor, awards, etc) via this syntax:
Code:
 

RPGen.make(makewhat, makeobj)

makewhat is the TYPE of item you are creating, such as "meleeWeapon". RPGeneration comes with these default item types:
accessory
archeryWeapon
armor
award
magicWeapon
meleeWeapon
other

makeobj is simply the name of the item you are creating. For example, "Super Ice Sword".
You'll be able to manipulate item objects later on using RPGen.modify.

Now then, with that information revealed - do you like this "make" syntax? Or would you prefer a different way to code new items? Post comments in this blog!
Posted in RPGeneration at 7:16 pm · No comments
Jan 07

Got a code request?

I'll be finishing up a majority of my current projects soon, so I'd like to know what YOU want for your ZetaBoards. Requests can be for general release or for your private use only (may require some sort of payment :P). Comment here or PM me with any codes you would like.

Also, I will do IF-ZB skin conversions for you if you wish. These are easy and also fun :p

Not accepting:
RPG requests
Posted in Other at 10:13 pm · No comments
Dec 28

XeoLife

Just wanted to give everyone a heads up about a site we've just remodeled.
http://xeolife.com

Basically a site for tournaments over Nintendo Wifi connection. We have a pretty active community, so come join us! :)
Posted in Other at 8:15 pm · No comments
Dec 27

RPGeneration

RPGeneration is our biggest project. Slated to be launched in early 2008, RPGeneration will be the RPG system everybody is waiting for. Fully customizable, RPGeneration will have great features such as:
Shop
PvP (online and offline)
Monster-fighting
Quests
Complete Customization (Modify quests, classes, items, monsters, and more!)
Automatic Installation
Infinite Class Possibilities

Note that RPGeneration is simply the engine used to run the RPG code. It will come with no preset classes, items, or anything...you will need to check out the RPGeneration Series for those. Current Series codes include Tempest (standard medieval) and Heaven (uber magic). Series include some features not found in the general RPGeneration engine :)

We are looking to add a few new members to the roster of development for RPGeneration. Specifically, areas we need worked on include:
Combat Balancing
Series Development
Guild Systems
PvP Combat Systems

If you are interested in helping, drop me an email at yoyoboy@rpgeneration.org . Also, check out our (under development) forums at http://forums.rpgeneration.org

RPGeneration will be the topic of many future blog posts, as I'm incredibly excited to develop and release it!
Posted in RPGeneration at 9:28 pm · No comments
Dec 26

Reputation System v1

This code will add a reputation system to your board.
Features:
*Reputation +/-
*24 hour wait between reputations
*Automatic database and installation
*Reputation number in post details and profile
*Reputation Reasons
*Reputation History

Preview: http://s1.zetaboards.com/GenerationStudio/
Create your own account on the preview board to get the full experience.

INSTALLATION
Installing is simple, and is broken up into two steps.
Step 1: Add CSS.
Go to Admin CP→[Themes]→Themes
Click Edit Theme Appearance for your first active skin. Scroll down to the bottom of this CSS and add this snippet:
Code:
 
div#historybox {
display: none;
min-height: 120px;
background-color: #FFF;
text-align: center;
width: 400px;
left: 50%;
margin-left: -200px;
border: 1px solid #5A70B3;
}

#historybox a {
position: relative;
left: 125px;
}

div#hisloading {
display:none;
vertical-align: center;
}

Repeat the process for all other active skins.

Step 2: Add Code
Simply add to Admin CP→ Board Template→ Edit Board Template→ Above the copyright.
Quote:
 

<script type="text/javascript">
//<![CDATA[
/* ZetaBoards Reputation System by GenerationStudio
Do not edit this code except for these variables: */
RepOptions = {
on: true,
customDomainCode: "0",
name: "Reputation",
addImg: "<img src='http://209.85.62.24/static/1/w_up.png' alt='' />",
minusImg: "<img src='http://209.85.62.24/static/1/w_down.png' alt='' />",
version: "1.0.0"
};
// Don't edit below this line, thanks!
if (window.location.href.split(main_url)[1].split("/")[0] == "topic" || window.location.href.split(main_url)[1].split("/")[0] == "profile") {
document.write('<script src="http://generationstudio.net/codes/repsystem/rep.js"><\/script>')
}
//]]>
</script>

Options in orange are customizable.
on - Set to true to enable the Reputation System. Set to false to disable it.
customDomainCode - This is for if you are using a custom domain. Set it to something unique, it doesn't matter what. I suggest a string of random numbers, such as x542108. But don't use that one.
name - The name of your reputation (Reputation, Karma, Popularity, etc)
addImg - The image/text shown for a +1 reputation.
minusImg - The image/text shown for a -1 reputation.
version - Don't edit this.

UPGRADING TO 1.0
To upgrade, simply remove all pieces of your current installation (including customizable options) and then follow the installation instructions from above. This is contrary to what I had previously said; but this now allows for more options..

USING MULTIPLE THEMES
This was requested because some users wanted to be able to use different buttons for each theme.
ACP > Themes > Themes > Edit Theme Layout (on the theme you want)
Add the code to the END of the box.

Report bugs or questions here.

Developer's Notes: You can request a commented, unminified version by PMing me here.
Posted in Code Release at 6:38 pm · No comments
Nov 30

Add More Boxes to Board Statistics

Location: Admin CP > Themes > Board Template > Javascripts OR Below the Board (Prefer Javascripts)
Demo: http://s1.zetaboards.com/GenerationStudio/index/ (Look at Board Statistics)
Instructions:
Define a new box with $().newZBBS({Options}); Check the example if you are confused.
You must define a new set of options for each separate box, like in the example.
Options:
isOn - Set to true to turn on the box. Set to false to turn it off. This is useful if you must switch in boxes for whatever reason, or want to see if one box is causing a problem.
Info - This is the data that goes inside the box. Values include any HTML. Use single quotes(') instead of double(")
Title - This is the title of the box. Values include any HTML. Use single quotes(') instead of double(")
Image - This image goes to the box to the left. Values are URLs.
imageLink - This links the image to another site. Values are URLs. Leave blank if you want no link.
Quote:
 
<script src='http://generationstudio.net/codes/zbboardstats2.js'>// Add more boxes to Board Statistics</script>
<script type="text/javascript">
// Add more boxes to Board Statistics
$(function(){
$().newZBBS({
isOn: true,
Title: "MyTitle",
Info: "MyText",
Image: "http://209.85.62.24/static/1/s_stats.png"
});

$().newZBBS({
isOn: true,
Title: "MyTitle2",
Info: "MyTex2t",
Image: "http://209.85.62.24/static/1/s_stats.png",
imageLink: "http://generationstudio.net"
});
});
</script>
Posted in Code Release at 2:10 pm · 3 comments