TinyPortal

Development => Block Codes => Topic started by: mongey on October 07, 2007, 06:57:21 PM

Title: Script Conversion. Phpp->Tp/Smf
Post by: mongey on October 07, 2007, 06:57:21 PM
Hello,
We are looking to add league and tournament management capabilities to our website, www.gamezbox.com.  As we couldnt find any specific SMF/Tinyportal mods to buy, we bought a php script called nukeladder which claimed to work on "PhpNuke, CPGNuke, PlatinumNuke, IPBNuke , PhpBB , vbulletin, e107 and possibly others".

I can also obtain the script for vbulletinif it is of any help.

We did this thinking we could modify slightly to work with SMF/Tiny Portal but it seems the code is specifically written for phpbb and we are looking for help in converting it to smf/tp.  We believe that this will be a valuable addon and others will use it also.

We appreciate any help in this regard.

I have attached the code to the main NukeLadder file.
<?php
###############################################################
# X1plugin Competition Management
# File::index.php
# File Version::2.5.5 
# Homepage::http://www.projectxnetwork.com
# Copyright:: Shane Andrusiak
###############################################################
define('X1plugin_include'true);
# PHPBB StartUp
define('IN_PHPBB'true);  
$phpbb_root_path './'
include(
$_root_path 'extension.inc');  
include(
$phpbb_root_path 'common.'.$phpEx);  
$userdata session_pagestart($user_ip0);  
init_userprefs($userdata);    
$page_title 'NukeLadder'

# Load X1 Config
require_once("NukeLadder/config.php");

# Load AdodbLite if Requested
if(X1_useadodblite) require_once(X1_plugpath.'/adodb/adodb.inc.php');

# Load  Language Definitions
require_once(X1_langpath."/".X1_adminlang."/admin_lang.php");
require_once(
X1_langpath."/".X1_corelang."/core_lang.php");

# Load Integration Functions
require_once(X1_plugpath."/integrate.php");

# Load System Functions
require_once(X1_plugpath."/core/system/system_selectboxes.php");
require_once(
X1_plugpath."/core/system/system_functions.php");
require_once(
X1_plugpath."/core/system/system_paginate.php");

# Load Admin Functions
function X1_require_admin(){
if(check_admin()){
require_once(X1_plugpath."/core/admin/admin_disputes.php");
require_once(X1_plugpath."/core/admin/admin_config.php");
require_once(X1_plugpath."/core/admin/admin_index.php");
require_once(X1_plugpath."/core/admin/admin_games.php");
require_once(X1_plugpath."/core/admin/admin_events.php");
require_once(X1_plugpath."/core/admin/admin_matches.php");
require_once(X1_plugpath."/core/admin/admin_teams.php");
require_once(X1_plugpath."/core/admin/admin_maps.php");
require_once(X1_plugpath."/core/admin/admin_mapgroups.php");
require_once(X1_plugpath."/core/admin/admin_config.php");
require_once(X1_plugpath."/core/admin/admin_challenges.php");
}else{
die("Go Away");
}
}

#pseudo cron
expire_challenges();
$op $_REQUEST[X1_actionoperator];
if(!
defined('X1_cookiename'))define('X1_cookiename'"team");
# Header
include($phpbb_root_path 'includes/page_header.'.$phpEx); 
opentable();
# Menu
# Custom Menu
if(X1_custommenu)require_once(X1_plugpath."/core/system/".X1_custommenu_inc);
# Load Switch
require_once(X1_plugpath."/core/system/system_cases.php");
closetable();
# LinkBack
echo X1plugin_linkback();
# Footer
include($phpbb_root_path 'includes/page_tail.'.$phpEx); 
?>


Below is the config.php <?php
###########################################
# SCRIPT CONFIG FOR PHP-NUKE
###########################################
# ERROR REPORTING OPTIONS
#error_reporting(2047);
###########################################
# PATH OPTIONS
# Path options define directorys where files should exsist and what to insert 
# into certain links to trigger certain actions within a cms.
###########################################

#Sets site name
define('X1_sitename'"NukeLadder Powered Gaming Site");
#Return url, loggin out ect
define('X1_url''http://www.pxn.ca/Forum/');  
#Path to Plugin directory
define('X1_plugpath'"NukeLadder");
#Path to css directory
define('X1_csspath'X1_plugpath."/css");
#Path to images directory
define('X1_imgpath'X1_plugpath."/images");
#Path to javascripts
define('X1_jspath'X1_plugpath."/jscript");
#Path to plugin mod files
define('X1_modpath',X1_plugpath."/mods");
#Path to language files
define('X1_langpath'X1_plugpath."/language");
#Path to email files
define('X1_emailpath'X1_plugpath."/emails");

#File to use in POST requests in admin
define('X1_adminpostfile''nukeladder.php');
#File to use in GET requests in admin
define('X1_admingetfile''nukeladder.php');

#File to use in POST requests in core
define('X1_publicpostfile''nukeladder.php');
#File to use in GET requests in core
define('X1_publicgetfile''nukeladder.php');
#Action operators

define('X1_linkactionoperator''op');
define('X1_actionoperator''op');


#Which cms the plugin is running in
define('X1_parent''phpbb');
#Output format of the plugin
define('X1_output'"echo");

###########################################
# LOCALE OPTIONS
# Locale options define which lanaguage files to use in core and admin areas.
# (only english, spanish so far, tanslators needed.)
###########################################

#Admin Lang 
define('X1_adminlang''english');
#Core Lang
define('X1_corelang''english');

#Normal dateformat
define('X1_dateformat''M:d:Y');
#Extended dateformat with time
define('X1_extendeddateformat''M:d:Y H:i');

###########################################
# DATABASE MAPPING OPTIONS
# The following tables define which prefixes and which database tables to use.
# If you have a default setup, most of these should remain as is.
# Some nuke users may need to change the prefix options
###########################################

#Use external adodb abstraction layer, NukeEvo 2.0.0+ set to false as it has built-in adodb
define('X1_useadodblite'true);

#main tables prefix
define('X1_prefix''nuke_'); 
#user table prefix
define('X1_userprefix''phpbb_');

#Users Main
#CMS Database table containing users
define('X1_DB_userstable''users');
#Key name which contains user's id
define('X1_DB_usersidkey''user_id');
#Key name which contains user's name
define('X1_DB_usersnamekey''username');
#Key name which contains user's email
define('X1_DB_usersemailkey''user_email');
#Key name which contains user's fake email
define('X1_DB_usersfakeemailkey''femail');
#Key name which contains user's public email flag
define('X1_DB_usersviewemailkey''user_viewemail');
#User extras
#Key name which contains user's icq
define('X1_DB_userseicqkey''user_icq');
#Key name which contains user's aim
define('X1_DB_userseaimkey''user_aim');
#Key name which contains user's msn
define('X1_DB_usersemsnkey''user_msn');
#Key name which contains user's yim
define('X1_DB_userseyimkey''user_yim');
#Key name which contains user's homepage
define('X1_DB_usersewebkey''user_website');
#Key name which contains user's avatar
define('X1_DB_userseavatarkey''user_avatar');
#Key name which contains user's country
define('X1_DB_userslocationkey''user_from');
#Key name which contains user's registration date
define('X1_DB_usersregdatekey''user_regdate');


#Table Mapping
#Plugin Maps Table
define('X1_DB_maps''laddermaplist');
#Plugin Games Table
define('X1_DB_games''games');
#Plugin Teams Table
define('X1_DB_teams''teams');
#Plugin Events Table
define('X1_DB_events''ladders');
#Plugin Challenges Table
define('X1_DB_teamchallenges''challengeteam');
#Plugin Temp Challenges Table
define('X1_DB_teamtempchallenges''challengeteamtemp');
#Plugin Invites Table
define('X1_DB_teaminvites''confirminvites');
#Plugin Disputes Table
define('X1_DB_teamdisputes''ladderdisputes');
#Plugin Team's Events Table
define('X1_DB_teamsevents''ladderteams');
#Plugin Matches Table
define('X1_DB_teamhistory''playedgames');
#Plugin Joined Teams Table
define('X1_DB_teamroster''userteams');
#Plugin Mapgroups Table
define('X1_DB_mapgroups','mapgroups');



###########################################
# LINKBACK OPTIONS
# Linking back is nice.
###########################################

#Show linkback, true or false
define('X1_showlinkback'true);
#Show text version info under image, true or false
define('X1_showversion'true);
#Version Number
define('X1_release''2.5.5');
#Alignment , right, center, left
define('X1_lbalign''right');
#black, blue, green, grey, orange, red, violet, white, yellow (.png)
define('X1_lbimage''blue.png');
#Linkback url
define('X1_lblink''http://www.nukeladder.com');



###########################################
# COOKIE AND LOGIN/OUT OPTIONS
# Define cookie name and time, and refreshtime when logging in and out.
###########################################

#Cookie mode (0=php) (1=javascript) (0 is default, 1 for phpbb)
define('X1_cookiemode','1');
#Cookie name (default works fine)
define('X1_cookiename''team');
#Time for cookie to last
define('X1_cookietime''32000');
#Time to wait to fresh when logging in and out
define('X1_refreshtime'"2");
#Page to goto when logging out
define('X1_logoutpage'X1_url.'index.php');


###########################################
# EMAIL OPTIONS
# Options for sending emails
###########################################

#Turn sending on and off
define('X1_emailon',false);
#Return mail address
define('X1_returnmail''noreply@yourdomain.com');
#Timestamp format used when creating dates in emails
define('X1_emailtimestamp''M:d:Y H:i');
#Show text when emails are sent, for debugging use.
define('X1_emaildebug',false);


###########################################
# TEAMS OPTIONS
# Options related to teams and team profiles
###########################################

#How many teams to display per page on the team list
define('X1_teamlistlimit',5);
#How many teams one user is allowed to create
define('X1_maxcreate'"2");
#How many teams one user is allowed to join
define('X1_maxjoin'"5");
#Team image width
define('X1_teamimagew',"100");
#Team image height
define('X1_teamimageh',"100");
#Extra option on roster
define('X1_extraroster1'"Extra1");
define('X1_extraroster2'"Extra2");
define('X1_extraroster3'"Extra3");
#Mysql Orderby for sortinng rosters
define('X1_rostersort'"name ASC");
#Default Logo
define('X1_team_image'X1_imgpath.'/deflogo.gif');

###########################################
# LADDER HOME LIMIT OPTIONS
###########################################

#Number of teams to show in top standings table
define('X1_topteamlimit'"5");
#Number of new matches to show
define('X1_newmatchlimit',"5");
#number of past matches to show
define('X1_resultslimit'"5");

###########################################
# PLAYER OPTIONS - BROKEN!!!!!
###########################################

define('X1_newplayerdays'"3");
define('X1_newplayercolor'"#CCCCCC");
define('X1_showavatars'false );


###########################################
# MOD SETTINGS OPTIONS
###########################################

#Show settings when challenging
define('X1_showsettingschall'true );
#Show Rules when challenging
define('X1_showruleschall'true );
#Show settings when reporting
define('X1_showsettingsreport'true );
#Show rules when reporting
define('X1_showrulesreport'true );


###########################################
# CHALLENGE EXTRA OPTIONS - Marked for workover
###########################################

#Turn on Extras in challenges 1
define('X1_extraoneon'true );
#Turn on Extras in challenges 2
define('X1_extratwoon'true );
#Extra field 1's name
define('X1_extraonename''Server IP' );
#Extra field 2's name
define('X1_extratwoname''Server Port' );
# False =  shows field on send challenge form
# True  = shows field on accept challenge form
#Page to show field 1
define('X1_extraonepage'false );
#Page to show field 2
define('X1_extratwopage'false );


###########################################
# Css Options and Menu 
# Some systems may have conflicting or conforming css style classes, 
# define them here or leave as is for main style.
###########################################
define('X1_custommenu'false);
define('X1_custommenu_inc'"system_menu.php");

#Use a custom stylesheet found in Plugin Css directory
define('X1_customstyle'true);
define('X1plugin_title''title');
define('X1_formstyle''margin:0;');
define('X1_teamlistclass''tborder');
define('X1_teamreportclass''tborder');
define('X1plugin_gamecontainer''tborder');
define('X1plugin_newmatchestable''tborder');
define('X1plugin_pastmatchestable''tborder');
define('X1plugin_matchdetailstable''tborder');
define('X1plugin_standingstable''tborder');
define('X1plugin_mapslist''tborder');
define('X1plugin_teamprofiletable''tborder');
define('X1plugin_createteamtable''tborder');
define('X1plugin_quitteamtable''tborder');
define('X1plugin_jointeamtable''tborder');
define('X1plugin_teamadmintable''tborder');
define('X1plugin_playerprofiletable''tborder');
define('X1plugin_challengeteamtable''tborder');
define('X1plugin_admintable''tborder');
define('X1plugin_disputestable''tborder');
define('X1plugin_rulestable''tborder');
define('X1plugin_ladderhometable''tborder');
define('X1plugin_tablehead''thead');
define('X1plugin_tablebody''tbody');
define('X1plugin_tablefoot''tfoot');


###########################################
# Admin Options
###########################################

#help file, liad in admin panel 
define('X1_helpfile''http://www.projectxnetwork.com/help.htm');
#Icon Images
define('X1_addimage''/submit/add.gif');
define('X1_delimage''/submit/close_red.gif');
define('X1_saveimage''/submit/disk.gif');
define('X1_editimage''/submit/edit.gif');
define('X1_tab_image''/folder.gif');
#Show or hide the config panel in the admin
define('X1_useconfigpanel'false);

#How many lines to show per panel page
define('X1_adminquerylimit'10);

###########################################
# More
###########################################

#defualt image preview image
define('X1_defpreviewimage''/games/default.png');
#Tab Size
define('X1_tab_width''10');
define('X1_tab_height''10');
#Tab Border
define('X1_tab_border''0');
#Yes and no colors
define('X1_Yescolor''#00FF00');
define('X1_Nocolor''#FF0000');
?>

Title: Re: Script Conversion. Phpp->Tp/Smf
Post by: Crip on October 07, 2007, 07:01:44 PM
Nice theme you got there.. :P
Title: Re: Script Conversion. Phpp->Tp/Smf
Post by: Zetan on October 07, 2007, 07:05:26 PM
And I wonder who recommended that ;)

If anybody can help Mongey, I'd be grateful too, I know it's probably a tall order.
But it's way beyond my knowledge of scripts.
Title: Re: Script Conversion. Phpp->Tp/Smf
Post by: IchBin on October 07, 2007, 09:00:28 PM
I can't look at it and test it if I don't have the script. All I see in those files is a bunch of constants that are defined and included files. Without being able to test this on my own I couldn't get it to work.
Title: Re: Script Conversion. Phpp->Tp/Smf
Post by: mongey on October 07, 2007, 09:25:10 PM
Thanks for the replies everyone.

I haven't included all the files as it is a paid script.
IchBin
Shall i send you the files in a pm? Thanks for the help
Title: Re: Script Conversion. Phpp->Tp/Smf
Post by: IchBin on October 07, 2007, 09:51:13 PM
I'll give it a shot if you'd like and see if I can get it to work. ichbin at tinyportal dot net.
Title: Re: Script Conversion. Phpp->Tp/Smf
Post by: mongey on October 07, 2007, 10:08:50 PM
Sent !
Title: Re: Script Conversion. Phpp->Tp/Smf
Post by: mongey on October 10, 2007, 03:08:48 PM
Just wondering if there have been any updates? Is it possible to do ?

Thanks
Title: Re: Script Conversion. Phpp->Tp/Smf
Post by: IchBin on October 10, 2007, 04:31:50 PM
Haven't had any success yet. Also haven't had much time to work on it. Will let you know ASAP.
Title: Re: Script Conversion. Phpp->Tp/Smf
Post by: mongey on October 17, 2007, 09:53:37 PM
Just wondering if you have had any luck with it? If not thanks for having a look at it.

Anyone else upto the task?
Title: Re: Script Conversion. Phpp->Tp/Smf
Post by: bloc on October 18, 2007, 09:19:45 AM
Is it a script that interacts with the forum/members then?
Title: Re: Script Conversion. Phpp->Tp/Smf
Post by: mongey on October 18, 2007, 09:10:39 PM
By the looks of it yes. Would you care to take a look at it ?
Title: Re: Script Conversion. Phpp->Tp/Smf
Post by: IchBin on October 18, 2007, 09:21:00 PM
Sorry mongey, haven't had the time. Should have some time tonight when I get home from school.
Title: Re: Script Conversion. Phpp->Tp/Smf
Post by: mongey on October 18, 2007, 10:59:12 PM
Ok thanks, if you want to have a look sometime in the futher you know where to ask :D
Title: Re: Script Conversion. Phpp->Tp/Smf
Post by: bloc on October 19, 2007, 12:03:15 AM
Well, it seems interesting, so if you are stuck, Brad, just pass it over and I'll try lol :)
Title: Re: Script Conversion. Phpp->Tp/Smf
Post by: Craven on October 19, 2007, 12:57:24 AM
This script is very involved with many files... and it really similar to MyGamingLadder.  A complete port of this script would take many hours as its a stand alone system and is nothing like SMF.  I've had 3 guys working on porting Nuke ladder for SMF for months and their no where close to completing the project.  The easier port is the MyGamingLadder script. 

If you have any luck in porting this, then let me know...  Good Luck in porting it over...

Craven
Title: Re: Script Conversion. Phpp->Tp/Smf
Post by: IchBin on October 19, 2007, 03:17:15 AM
After a few tries tonight I'm not sure I'll be able to get it working. It seems to require some files from Nuke which of course I don't have. Not sure if it will work without an installation of Nuke at this point. I'll let Bloc take a quick look at what I have.
Title: Re: Script Conversion. Phpp->Tp/Smf
Post by: bloc on October 19, 2007, 10:03:15 AM
Sure thing..I will need the files, so if you can send them to my email, it would be great.
Title: Re: Script Conversion. Phpp->Tp/Smf
Post by: IchBin on October 19, 2007, 01:31:31 PM
Actually, I meant to say phpBB. I think it requires files from phpBB. The files were sent last night.
Title: Re: Script Conversion. Phpp->Tp/Smf
Post by: mongey on October 19, 2007, 03:46:02 PM
Bloc will i email you the files ?
Title: Re: Script Conversion. Phpp->Tp/Smf
Post by: IchBin on October 19, 2007, 04:40:57 PM
I have shared the files with him via email. I'm sure he'll respond when he gets a chance.
Title: Re: Script Conversion. Phpp->Tp/Smf
Post by: mongey on October 19, 2007, 07:33:24 PM
ok thanks IchBin
Title: Re: Script Conversion. Phpp->Tp/Smf
Post by: bloc on October 19, 2007, 08:02:59 PM
I looked it over briefly and while it does look like it can be run with SMF initially, it will take some time to convert it. I don't currently have that time I am afraid.

This goes also beyond using TP to simply connect to it..its more a SMF bridge issue than anything. Once its bridged properly TP can fetch the appropiate data, operating on the joint member base.

Title: Re: Script Conversion. Phpp->Tp/Smf
Post by: mongey on October 19, 2007, 08:20:20 PM
Ok, cool at least it can be done, there is no rush on it, however If you get the time to do it i would be very greatful.

Thanks
Title: Re: Script Conversion. Phpp->Tp/Smf
Post by: TimUSA on October 19, 2007, 09:49:40 PM
I think there are many out here that are eagerly waiting a tournament/ladder system for tp-smf. I don't know squat about coding so i would be of no help there. Let me know if there is anything else i can help with! We desperately need something like this at our site.
Title: Re: Script Conversion. Phpp->Tp/Smf
Post by: bloc on October 19, 2007, 11:50:34 PM
I don't know much about this kind of system lol..a tournament/ladder system, how does that work? It might be easier to simply write something from scratch than trying to fit code meant for other scripts, into SMF/TP - but a good layout/description of what it does/require will be needed.
Title: Re: Script Conversion. Phpp->Tp/Smf
Post by: mongey on October 20, 2007, 12:29:46 AM
Either way I'd be happy lol
Title: Re: Script Conversion. Phpp->Tp/Smf
Post by: TimUSA on October 20, 2007, 12:51:15 AM
Bloc I will be happy to supply you with the info. Give me a day to pull it all together. A good example can be found here:
http://demo.gotbase.org/

Rumor is they are working on porting this to SMF.
Title: Re: Script Conversion. Phpp->Tp/Smf
Post by: IchBin on October 20, 2007, 01:45:32 AM
All I see is a phpbb board there that says its a demo. I don't see anything.
Title: Re: Script Conversion. Phpp->Tp/Smf
Post by: mongey on October 20, 2007, 01:47:49 AM
Same here lol
Title: Re: Script Conversion. Phpp->Tp/Smf
Post by: TimUSA on October 20, 2007, 02:07:18 AM
Should see icons in the top menu for ladder/create clan/tournaments...ect.
Title: Re: Script Conversion. Phpp->Tp/Smf
Post by: bloc on October 20, 2007, 08:34:15 AM
Yes, but you need to register..I would be most interested in just a text description of what it does though. ;)
Title: Re: Script Conversion. Phpp->Tp/Smf
Post by: TimUSA on October 20, 2007, 09:04:43 AM
Well lets give this a shot. this is the description on gotbase.org

Quote* Tournament System
    * League System
    * Ladder System
    * Clan System
    * Users can manage multiple clans.
    * Participate in graphical tournaments.
    * Single and Double Emlimination style tournaments offered.
    * Participate in divisional round-robin leagues.
    * View standings on various ladders with rating, score, wins, losses, ties, etc.
    * View clan pages with a list of past matches, standings, stats and rosters.
    * Challenge other clans with great detail.
    * Quick report abilities or extended report abilities.
    * Admins can control all aspects of tournaments.
    * Admins can report wins/losses in tournament brackets graphically.
    * Admins can edit all clans, ladders, tournament and league details.
    * Clan leaders have a vast control panel.
    * Manage everything from your clan details to your roster.
    * Manage everything from your clan details to your roster.
    * Manage match/league and tournament reports with a click of a button.
    * Both the Admins and Clan Leaders have full control over their experience with phpBB Rivals.

I have also attached the phpbb3 files, this may help.

I believe one of the persons involved with this code is londonhogfan who posts here frequently. (Or at least the share the same avatar here and at smf.)
Title: Re: Script Conversion. Phpp->Tp/Smf
Post by: mongey on October 24, 2007, 01:13:47 AM
Description of Nukeladder

QuoteNukeladder lets you run multiple competitions for multiple games.

What kind of competitions? Well, Nukeladder now includes its own mods directory where you can load different types of competitions. Adding new competition formats is easy, and more are currently being worked on. Current formats include, league, ladder and knockout.(more below)

This flexibility lets you run different types of competitions all at the same time, with the same script, same teams, and players. Phew.

You can make your own mods with some php/mysql experience. More documentation will be provided on this shortly. This is a new feature that has been added.

Nukeladder comes default with 2 mod types, league, ladder.

League Mod is a league format (sorry no divisions yet, could be a new mod), Its standings are based on a rating, points, ect, depends what you would like.

Ladder Mod lets you run competitions like the WorldOgl, where you have to defend your rung. If you lose a match, the challenger is going to take your rung. You may only challenge up so many rungs.

NukeLadder has an in-depth team admin system. All the players are pulled directly from your cms database. No re-registrations!

Your users can create teams and invite or give out their join password for other registered members to join. If you want a way to increase your visitors and registered members this will be a good way to start.
Title: Re: Script Conversion. Phpp->Tp/Smf
Post by: mongey on October 24, 2007, 02:09:56 AM
Also found this topic on smf fourms. http://www.simplemachines.org/community/index.php?topic=186652.msg1284466#msg1284466

I have tried the mod that was available for download by A.I Bot, but it seems that it calls upon phpbb functions still