Hello
RageZone!!
Since its discussion/development thread i don't have to say a boring intro :mellow:, As you notice -if you're keeping up with my threads- the J3lackSwOrD class used in the rank script, which include functions for SelectRankQuery, ExpBarsGenerator, JobDetector was just the beginning,
I'm planning to create something much better, which require time and a discussions with you!, J3lack_Lib, it sound sucks that's true but couldn't find better name oO
J3lack_Lib is PHP liberary which contain all the scripts that u may need in anything related to Kalonline website,Big Scripts (ranks, registration, userpanel,..etc) or even small scripts (Castle owner, Server status, Online players,..etc), And i was thinking about the best way to give the Designer|Developer the power of creating ANY THING!
And creating a function for each part wont be strong enough for designers that don't know much about development, so i came up with the idea of Shortcode, just like Wordpress or Joomla, I'm not gonna user Wordpress or Joomla Itself, just the shortcode system,
And for those who don't know about the shortcodes, its system that allow you to type (for example) [castleowner] inside any website template, and it will be automatic replaced with a dynamic PHP function which echo the Castle Owner guild's name.
Imagine what we can do with that, Everything, even inside the userpanel [get_pid name='J3lackSwOrD'] will return the PID of the player, or even [get_info pid=34] will return array with the full info of that player, its name/ all the stats/ skills (index -> level)/ and items and every thing u might need to know about that player!
Or even rank script (for example) [rank show='100' columns='rank,name,level,guild,exp,status'] will return the full rank with your own options! with only simple line of code!
And after long time thinking about that i did split the whole J3lack_Lib into many Phases, (and if anybody got better idea tell me about it).
========= (Green => done, Teal=> under-construction, Red => Coming soon) =========
Phase I: Custom Shortcode System.
Phase II: PHP Functions that do anything u might need (from selecting the required query to printing out the results).
Phase III: Creating templates for the full website (main layout, registration, rank, userpanel,...etc).
Phase IV: Full tutorial that explain how to use the J3lack_Lib
=====================================================================
Since this Lib will be Open_source/Free, it will be for Pure discussion and enchanting the idea and realizing it, so feel free to give your best feedback, which will be very helpfull.
=====================================================================
=========================== Discussion Section ===========================
=====================================================================
=======================
======== Phase I ========
=======================
Shortcode system was one of the hardest parts, which extract any short-codes from the template which may contain PHP tags that have the same construct (like fetching from database $r['Name']), But its completed fully clean and successfully by extracting the wordpress shortcode system from its installation.
How it works:
- include the shortcodes.php (which contain the main script of the shortcodes)
- Adding the functions, for example
PHP Code:
get_pid($name){
//get the required query using custom function query(); then fetch the pid and return it
}
- registering the shortcode
PHP Code:
add_shortcode('short_code', 'function');
example:
PHP Code:
add_shortcode('getpid', 'get_pid');
Shortcode system automatic parse any parameters attached in the shortcode,
For example:
PHP Code:
function rank($settings){//rank script}
add_shortcode('rank', 'rank');
When we use it like this:
PHP Code:
[rank show='100' columns='rank,name,class,guild,guildrole' job_names='Samurai, Wizard, Sniper, Ninja']
will run the function:
PHP Code:
rank($settings);
Where $settings is array:
PHP Code:
$settings =array(
'show' => '100',
'columns' => 'rank,name,class,guild,guildrole',
'job_names' => 'Samurai, Wizard, Sniper, Ninja'
);
Amazing, isn't it? :O
Now Phase I completed, and working on Phase II, if you have any ideas for organizing or arranging the functions, please let me know :)
Best Regards,
J3lackSwOrD:blush: