Infoz v1.0 :D

JagSwag2014

New Member
Supporter
Crafter
Dec 16, 2013
975
3
0
22
USA
www.planetminecraft.com
#1
I've just finished my plugin, Infoz, which logs when a player is promoted/demoted/etc.

The commands are as follows...:
  • /infoz - About the plugin.
  • /infoz help - Shows all commands.
  • /infoz info player - Show info about a player. (Rank, prefix, etc.)
  • /rank player group - Sets a player to the group specified.
    ΘAliases: /setrank, /setgroup
Permissions correspond to what group a player can promote. For example, on CraftBlock, a moderator wants to promote a Blockling to Builder. The moderator would need 'infoz.promote.builder' to change the Blockling to that rank. It goes by what rank is specified, so if the moderator tries to use a different rank, for example Owner, they would not be able to, because they don't have 'infoz.promote.owner'. ;)

I couldn't figure out how to do it with the normal pex commands, so I just made my own. Seems a bit simpler to me anyways. :p

The promotions are logged in /plugins/Infoz/logs.txt and are formatted by month/day/year hour/minute/second (Promoter) promoted (promotee) to (group).
Example: 09/03/2014 00:04:35 CONSOLE promoted JagSwag2014 to Novice!

It is currently installed on Nano if you would like to bring it over to Main. :p
 

Ar7ific1al

Active Member
Supporter
Crafter
Dec 15, 2013
985
6
38
26
#2
Did you hook Vault like I suggested? :p
 

misskoa

addiction.
Staff member
Owner
misskoa
misskoa
Dec 15, 2013
3,051
850
113
#3
Hey, you two should really create a private bitbucket account and work on some projects together.  Bitbucket allows free private repos. zygar and me is working with it and with the SourceTree client, it's pretty simple. Ask me if you guys do and need any help.

Anyways, since you both can code now, I have an idea of a plugin for the both of you. This implements the forums more on the server.

So, the forums have an XML feed (You'll be XML parsing) http://craftblock.me/forum/misc.php?action=syndication Select a few forums and it'll give you the XML feed for them. This shows the latest forum. Also set's a limit.

Now the plugin is pretty simple. So the best way to explain it by saying what the command would do.

/forum [feed]

Example:

/forum news

This would get the feed for the news forum, STRIPS any HTML content (That's important to do!) and then displays the title, and the link. Content is possible but that may be to much. It  you' want content, it would need to be stripped to 30 characters max.

So

Code:
Player: /forum news
-------------------------------------------
A news announcement
http://craftblock.me/forum/thread-1842-post-12672.html

Second news announcement
http://craftblock.me/forum/thread-1842-post-12672.html

Third news announcement
http://craftblock.me/forum/thread-1842-post-12672.html
--------------------------------------------
Other idea would be /forum apps (select selecting multiple forums in apps in the xml feed selector), /forum complaints (Hey, player. You just got a complaint. You want to reply to it. Do /forum complaints) oh and /forum wiki.
This is how I implemented it on the front-page website. This might help out. 

Code:
function getForumFeedNews() 
{
    $newsXML = file_get_contents('http://craftblock.me/forum/syndication.php?fid=4&limit=3');
    $xml = new SimpleXMLElement($newsXML);
    $titles = $xml->xpath('channel/item/title');
    $links = $xml->xpath('channel/item/link');
    foreach (array_combine($titles, $links) as $title => $link) {
        echo '<li><a href="'.$link.'">'.$title.'</a>';
    }
}
If you want to do this, you'll want to see the elements in the XML feed, for example channel->item->link. You can do that by going to the XML url and downloading a XML formatter (XML prettierfyer (I think) in Chrome.
 

Ar7ific1al

Active Member
Supporter
Crafter
Dec 15, 2013
985
6
38
26
#4
@kawohi
No offense, but not really interested in any of that. lol
 

misskoa

addiction.
Staff member
Owner
misskoa
misskoa
Dec 15, 2013
3,051
850
113
#5
Ar7ific1al said:
@kawohi
No offense, but not really interested in any of that. lol
Why? It'll help the players know about the latest announcement in forums, specially in news.
 

Ar7ific1al

Active Member
Supporter
Crafter
Dec 15, 2013
985
6
38
26
#6
@kawohi
Because I'm just not. And you've been saying for a long time that you'd get into it yourself and you've yet to do anything involving Bukkit development. If we do it all for you, you're never going to learn. lol
 

misskoa

addiction.
Staff member
Owner
misskoa
misskoa
Dec 15, 2013
3,051
850
113
#7
Ar7ific1al said:
@kawohi
Because I'm just not. And you've been saying for a long time that you'd get into it yourself and you've yet to do anything involving Bukkit development. If we do it all for you, you're never going to learn. lol
Ugh, you're right. I just never have the time to get to the next step after the basics (Which I already know how to). 

And to be honest, Java just hasn't interest me as of yet. I've been deep into the JavaScript world with Node.js, ArangularJS and what not. 
 

JagSwag2014

New Member
Supporter
Crafter
Dec 16, 2013
975
3
0
22
USA
www.planetminecraft.com
#8
Ar7ific1al said:
Did you hook Vault like I suggested? :p
Indeed I did. :p
Vault did not have any events that it handled, but PEX did (RANK_CHANGED and PERMISSIONS_CHANGED). There were a few more as well. I ended up just implementing it for all permissions plugins that use Vault, 'coz why not? :p

And @kawohi - I've been able to code a while now. :p
 

misskoa

addiction.
Staff member
Owner
misskoa
misskoa
Dec 15, 2013
3,051
850
113
#9
You both should work on a project together then! :)
 

Avoxsas

Active Member
Supporter
Crafter
Dec 15, 2013
789
1
38
#10
-sits in the corner playing a sad song on a tiny violin-
 

Avoxsas

Active Member
Supporter
Crafter
Dec 15, 2013
789
1
38
#12
Sadly, I cannot code to save my life. xD
 

misskoa

addiction.
Staff member
Owner
misskoa
misskoa
Dec 15, 2013
3,051
850
113
#13
Avoxsas said:
Sadly, I cannot code to save my life. xD
If you'd like to do what Ar7 does, you can start here (and after, buy some java ebooks)

http://www.youtube.com/watch?v=Hl-zzrqQoSE

If you'd like to do what I do... web development..

http://www.codecademy.com/
 

JagSwag2014

New Member
Supporter
Crafter
Dec 16, 2013
975
3
0
22
USA
www.planetminecraft.com
#14
I wouldn't waste your money on Java eBooks. I didn't need them. I bought one, but it didn't help at all. I just went off of other websites for sources and such.
 

misskoa

addiction.
Staff member
Owner
misskoa
misskoa
Dec 15, 2013
3,051
850
113
#15
JagSwag2014 said:
I wouldn't waste your money on Java eBooks. I didn't need them. I bought one, but it didn't help at all. I just went off of other websites for sources and such.
That's how I learned as well, but picking up an eBook explains the technical side of things. You can find docs and such for code, but to put the code together to do something? An eBook explains that.

Also I recommend to look for "Java Cook Books". It's pretty helpful. Not your standard eBook, but offers a lot of advice and tips.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)