News:

Wondering if this will always be free?  See why free is better.

Main Menu

building subactions for my mod

Started by bigjoe11a, November 08, 2012, 03:25:45 PM

Previous topic - Next topic

bigjoe11a

I been reading threw some of these mods that have the sa=? and well I just can't figure this out at all. So my question is. How do I add subactions to my mod. I just wanted some thing else other then this,


<?php
if(isset($_GET['sa'])) {

}


I see that a lot of the mods use this and it seems to work real good, I just have not figure out how to set this up. Can some one give me an idea on how to use this, and IchBin is right. There's never any doc's for things like this.

Joe
SMF Forums http://www.df-barracks.com Where gamers go.

Sorck

That is only checking for the existence of the sa=something bit in the URL.

If you want to check for a specific sa then you need to use a comparison operator
e.g.

<?php
// Check for a "test" sub action
if(isset($_GET['sa']) && $_GET['sa'] === 'test') {
    echo 
'This is a test sub-action';
}


If you want quite a few sub actions, you could consider something along the lines of the following:

<?php
call_user_func
(SubActionLoader());

function 
SubActionLoader()
{
/*
* Sub-Action array
'sa-in-url' => array('file.php', 'function_name')
*/
$subActions = array(
'test' => array('my_mod.php''my_sa_test'),
'hello' => array('my_mod.php''my_sa_helloworld'),
);

// Do we have a sub-action to check?
if(isset($_REQUEST['sa']))
{
// Does it exist in our subActions array?
if(isset($subActions[$_REQUEST['sa']]))
{
// Load it's required file
require_once $scriptdir '/' $subActions[$_REQUEST['sa']][0];
// Return the function to use
return $subActions[$_REQUEST['sa']][1];
}
}
// Default function to use
return 'my_default';
}




To my knowledge hooks wouldn't be able to add subactions but I've never looked into them so wouldn't know.

bigjoe11a

Ok, Thanks. Let me show you this I fount in the SAShop Mod.


$subActions = array(
'main' => 'Shop_main',
'buy' => 'Shop_view',
'inventory' => 'shop_Inventory',
'inventory2' => 'shop_Inventory',
'bank' => 'shop_Bank',
'gift' => 'shop_Gift',
'use' => 'shop_use',
'use2' => 'shop_use',
'use3' => 'shop_use',
'trade' => 'shop_trade',
'trade_sell' => 'shop_trade',
'trade_sell2' => 'shop_trade',
'trade_buy' => 'shop_trade',
'trade_stop' => 'shop_trade',
'gameroom' => 'Shop_Game',
'stats' => 'stats_shop',
'owners' => 'shop_owners',

);

// Default the sub-action to 'affiliates_veiw'.
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'main';

// Set title and default sub-action.
$context['page_title'] = $txt['shop'];
$context['sub_action'] = $_REQUEST['sa'];

// Add it to the linktree
$context['linktree'][] = array(
'url' => $scripturl . '?action=shop',
'name' => $txt['shop_tab_main'],
);

// Call the right function for this sub-acton.
$subActions[$_REQUEST['sa']]();


and last he has the links in the center of the code. His hook is not as big as I thought it be. This makes things simple.


// Setup their permissions
    $allowedtrade = allowedTo('view_trade');
$allowedshop = allowedTo('view_shop');
$allowedgames = allowedTo('view_gameroom');
$allowedbank = allowedTo('view_bank');
$allowedgift = allowedTo('view_gift');
$allowedotherinv = allowedTo('view_othersinv');
$allowedbuy = allowedTo('view_buy');

// the menu links array
$context['tab_links'] = array();

$context['tab_links'][] = array('action' => 'main',
'label' =>  $txt['shop_tab_home']);
// Is the user allowed to buy items
if ($allowedbuy)
$context['tab_links'][] = array('action' => 'buy',
'label' =>  $txt['shop_tab_buy']);

// If you cant buy they wont be needing this so we use the shop by permission
if ($allowedbuy)
$context['tab_links'][] = array('action' => 'inventory',
'label' =>  $txt['shop_tab_inv']);

// Is the user allowed to see other users inventory
if ($allowedotherinv)
$context['tab_links'][] = array('action' => 'inventory2',
'label' =>  $txt['shop_tab_invm']);

// is the gift shop enabled?
if($modSettings['shop_Enable_Gift']){
// Is the user allowed to send gifts
if ($allowedgift)
    $context['tab_links'][] = array('action' => 'gift',
'label' => $txt['shop_tab_sg']);
}
//Is the bank enabled?
if($modSettings['shop_Enable_Bank']){
// Is the user allowed to use the bank?
if ($allowedbank)
    $context['tab_links'][] = array('action' => 'bank',
'label' => $txt['shop_tab_bank']);
}
// Is the trade center enabled?
if($modSettings['shop_Enable_trade']){
// Is the user allowed to trade?
if ($allowedtrade)
    $context['tab_links'][] = array('action' => 'trade',
'label' => $txt['shop_tab_trade']);
}
//Is the games room enabled?
if($modSettings['shop_Enable_gameroom']){
// Is the user allowed to use the games room
if ($allowedgames)
    $context['tab_links'][] = array('action' => 'gameroom',
'label' => $txt['shop_tab_gr']);
}
   //Is the shop stats enabled?
    if($modSettings['shop_Enable_Stats']){
    $context['tab_links'][] = array('action' => 'stats',
'label' => $txt['shop_Stats']);
}


See above are just the links. I made some thing like this before. How ever I can't fingure out how he does this or how it works. I mean the $subActions. I don't know how this works.


SMF Forums http://www.df-barracks.com Where gamers go.

SA™

the tablink are called via the shop template $context['tab_links'] them one are for the shop not in the main menu

for the sub action you can set a master funtion like i did with sa shop

function myfunc()
{

loadTemplate('mytemplate');

// Here's our little sub-action array.
$subActions = array(
               //action     function
'main' => 'main_acton',
'sub' => 'sub_action',
'sub1' => 'sub_action1',
'sub2' => 'sub_action2',
'sub3' => 'sub_action3',

);

// Call the right function for this sub-acton.
$subActions[$_REQUEST['sa']]();
}


then were you set up the action for the mod you would use that funtion

if you using hooks it would be like this
$actionArray['myaction'] = array('myfile.php', 'myfunc');


http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

bigjoe11a

Well you have me more confused then before. I'm looking at your SAShop code. And the only function your using for this is the main hook. You don't have the $subActions in a function, Other then the main function called "Shop"

So your code really has me confused.  In your main source file. called Shop. You have these parts of code.

$subActions = array(
'main' => 'Shop_main',
'buy' => 'Shop_view',
'inventory' => 'shop_Inventory',
'inventory2' => 'shop_Inventory',
'bank' => 'shop_Bank',
'gift' => 'shop_Gift',
'use' => 'shop_use',
'use2' => 'shop_use',
'use3' => 'shop_use',
'trade' => 'shop_trade',
'trade_sell' => 'shop_trade',
'trade_sell2' => 'shop_trade',
'trade_buy' => 'shop_trade',
'trade_stop' => 'shop_trade',
'gameroom' => 'Shop_Game',
'stats' => 'stats_shop',
'owners' => 'shop_owners',

);


And at the bottom. You have


// Default the sub-action to 'affiliates_veiw'.
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'main';



and last is this


$subActions[$_REQUEST['sa']]();


I don't see you running the $subAction from a function. All this is in your main Shop hook or (Source)..


SMF Forums http://www.df-barracks.com Where gamers go.

Sorck

Quote from: bigjoe11a on November 09, 2012, 07:56:34 PM

$subActions[$_REQUEST['sa']]();


I don't see you running the $subAction from a function. All this is in your main Shop hook or (Source)..
That bit of code is what calls the sub action's function.

bigjoe11a

Quote from: Sorck on November 10, 2012, 05:00:33 AM
Quote from: bigjoe11a on November 09, 2012, 07:56:34 PM

$subActions[$_REQUEST['sa']]();


I don't see you running the $subAction from a function. All this is in your main Shop hook or (Source)..
That bit of code is what calls the sub action's function.

Ok, so can you tell me how to use it. Lets say this is what I have so far.


$subActions = array(
'main' => '????',
'category' => '?????',
'groups' => '?????',
'clubs' => '?????',
);


Where the ? is I don't know what to add in there. and then can you tell me how to run it or how to get this to work ????

and will I need this code all so


$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'main';


SMF Forums http://www.df-barracks.com Where gamers go.

bigjoe11a

Some on Guys, I could really use some help on this. PLEASE
SMF Forums http://www.df-barracks.com Where gamers go.

SA™

Were U put the????? In the above codes U put the functiion to call for that sub action sry can't go into ittoo much have only my phone and no pc till tuesday
http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

bigjoe11a

Oh, So that's nothing other then a function. and Then when a user clicks on one of the links. It just runs and loads a function. Ok. I'll have to try that.
SMF Forums http://www.df-barracks.com Where gamers go.

bigjoe11a

Well after changing some things and adding your $subActions array to my new mod. Now I'm getting this error

Fatal error: Function name must be a string in C:\www\vhosts\_static\toppers\smf\Sources\bjclub.php on line 103

Here's line 103
$subActions[$_REQUEST['sa']]();

Can you tell me why I'm getting this error, Or did you need to see the source.

SMF Forums http://www.df-barracks.com Where gamers go.

SA™

Post the source might be a bit hard to see on phone but I'll try 8)
http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

bigjoe11a

Ok, Here is the main part of my source file.


<?php
if (!defined('SMF'))
die('Hacking attempt...');

function 
main(){

// Second, give ourselves access to all the global variables we will need for this action
global $context$scripturl$txt$modSettings;

    require_once(
$boarddir."\ssi.php");

    
//Load in layers templates
    
$context['template_layers'][] = 'bjclub';
    
    
loadlanguage('BJClub');
// Third, Load the specialty template for this action.
loadTemplate('bjclub');
    
    
GetTotals(); //Get some totals
    
GetClubListings();
    
    
    
// Here's our little sub-action array.
$subActions = array(
'join' => 'JoinBJClubs',
        
'delete' => 'DeleteMember',
        
'savecat' => 'SaveCategory',
        
'savegroup' => 'SaveGroup',
        
'saveclub' => 'SaveClub',
        
'listgroups' => 'list_groups',
);
    
    
    if(!
$modSettings['BJClub_enable']) {
        
$context['system_msg'] = $txt['bjclub_closed'];
        
$context['sub_template'] = 'closed';
    }
    
    
    
//If the user is a guest, take them to the no guest template
    
if($context['user']['is_guest']) {
         
$context['system_msg'] = $txt['bjclub_noguests'];
         
$context['sub_template'] = 'noguest';
    }
    
    
//Check to see if user has joined BJClub
    
CheckIfJoined();
    
    
    if(!isset(
$context['system_msg']) == '' || empty($context['system_msg']))
      
$context['system_msg'] = $txt['welcome_club'];
      
      
$context['welcome_title_msg'] = sprintf($txt['welcome_title'], $txt['bjclub_header']);
      
$context['welcome_title_intro'] = $txt['title_intro'];

       
    
$context['tab_links'] = array();
    
    
$context['tab_links'][] = array('sa' => 'main',
                                    
'label' => $txt['bjclub_header'],
                                    
'url'   => '?action=bjclub'); 

    if(
allowedTo('bjclub_can_new_group'))
    
$context['tab_links'][] = array('sa' => 'group',
                                    
'label' => $txt['bjclub_groups'],
                                    
'url'   => '?action=bjclub;sa=group'); 

    if(
allowedTo('bjclub_can_new_club'))    
    
$context['tab_links'][] = array('sa' => 'club',
                                    
'label' => $txt['bjclub_clubs'],
                                    
'url'   => '?action=bjclub;sa=club'); 
        
if(allowedTo('bjclub_can_new_cat'))
    
$context['tab_links'][] = array('sa' => 'cat',
                                    
'label' => $txt['bjclub_category'],
                                    
'url'   => $scripturl.'?action=bjclub;sa=cat'); 
    
    if(
allowedTo('bjclub_can_join_club'))
    
$context['tab_links'][] = array('sa' => 'joinc',
                                    
'label' => $txt['bjclub_joint_club'],
                                    
'url'   => '?action=bjclub;sa=joinc'); 
    
    if(
allowedTo('bjclub_can_join_group'))
    
$context['tab_links'][] = array('sa' => 'joing',
                                    
'label' => $txt['bjclub_joint_group'],
                                    
'url'   => '?action=bjclub;sa=joing'); 
    

    
    
// Default the sub-action to 'affiliates_veiw'.
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'main';

    
$context['page_title'] = $txt['bjclub_PageTitle'];
$context['page_title_html_safe'] = $smcFunc['htmlspecialchars'](un_htmlspecialchars($context['page_title']));
        
$context['linktree'][] = array(
  
'url' => $scripturl'?action=bjclub',
 
'name' => $txt['bjclub_header'],
);
    
    
// Call the right function for this sub-acton.
$subActions[$_REQUEST['sa']](); // This errors out
    
}



and here's the rest of it



function SaveGroup() {
   
        global $smcFunc, $user_info;
   
        $request = $smcFunc['db_insert']('INSERT',
        '{db_prefix}bjclubs_groups',
        array('groupname' => 'string','groupownerid' => 'int','groupownername' => 'string','gr_locked' => 'int','mode' => 'string','status' => 'string'),
        array($_POST['groupname'],$user_info['id'],$user_info['name'],0,$_POST['mode'],'approved'),
        array()
        );
       
        $smcFunc['db_free_result']($request);
        GetTotals();   
   
}

function SaveClub() {
   
    global $smcFunc, $user_info;
   
        $request = $smcFunc['db_insert']('INSERT',
        '{db_prefix}bjclubs_clubs',
        array('clubname' => 'string','clubownerid' => 'int','clubownername' => 'string','cl_locked' => 'int','mode' => 'string','status' => 'string'),
        array($_POST['clubname'],$user_info['id'],$user_info['name'],0,$_POST['mode'],'approved'),
        array()
        );
       
        $smcFunc['db_free_result']($request);
        GetTotals();
   
}

function SaveCategory() {
   
        global $smcFunc;
   
        $request = $smcFunc['db_insert']('INSERT',
        '{db_prefix}bjclubs_category',
        array('category' => 'string'),
        array($_POST['catname']),
        array()
        );
       
        $smcFunc['db_free_result']($request);
        GetTotals();
}

function GetTotals() {
   
        global $smcFunc, $context, $user_info;
   
        $request = $smcFunc['db_query']('', '
        SELECT * FROM {db_prefix}bjclubs_category
        ',   
        array()
        );
       
        $context['bjclubs_cat_totals'] = $smcFunc['db_num_rows']($request);
       
        $smcFunc['db_free_result']($request);
   
        $request = $smcFunc['db_query']('', '
        SELECT * FROM {db_prefix}bjclubs_groups
        ',   
        array()
        );
       
        $context['bjclubs_group_totals'] = $smcFunc['db_num_rows']($request);
       
        $smcFunc['db_free_result']($request);
   
        //
        // Get users total groups
        $request = $smcFunc['db_query']('', '
        SELECT * FROM {db_prefix}bjclubs_groups
        WHERE `groupownerid` = {int:groupownerid}',   
        array('groupownerid' => $user_info['id'])
        );
       
        $context['bjclubs_group_owner_totals'] = $smcFunc['db_num_rows']($request);
       
        $smcFunc['db_free_result']($request);
   
       
        //
        // Get users total clubs
        $request = $smcFunc['db_query']('', '
        SELECT * FROM {db_prefix}bjclubs_clubs
        WHERE `clubownerid` = {int:clubownerid}',   
        array('clubownerid' => $user_info['id'])
        );
       
        $context['bjclubs_club_owner_totals'] = $smcFunc['db_num_rows']($request);
       
        $smcFunc['db_free_result']($request);
       
   
}

function list_groups() {
   
    global $txt, $context;
   
    $context['system_msg'] = $txt['bjclub_list_all_groups'];
    $context['sub_template'] = 'list_groups';
   
   
}

function DeleteMember() {
   
    global $smcFunc, $user_info;
   
    //Now delete the post   
    $request = $smcFunc['db_query']('', '
    DELETE FROM {db_prefix}bjclubs_users
    WHERE uid = {int:uid}',
    array('uid' => $user_info['id'])
    );
   
    $context['BJClub']['User'] = array();
}


function CheckIfJoined() {
   
    global $context, $scripturl, $txt, $smcFunc, $user_info;
   
    $request = $smcFunc['db_query']('', '
    SELECT * FROM {db_prefix}bjclubs_users
    WHERE uid = {int:uid}
    LIMIT 1
    ',   
    array('uid' => $user_info['id'])
    );
   
    if($smcFunc['db_num_rows']($request) == 1) {
       
    $row = $smcFunc['db_fetch_assoc']($request);
   
    $context['BJClub']['User'][] = array(
    'uid' => $row['uid'],
    'uname' => $row['uname'],
    'joined' => date("m/d/Y h:i a",$row['ujoined']),
    'locked' => $row['locked'],
    'banned' => $row['banned'],
    'groups' => array($row['groups']),
    'clubs' => array($row['clubs']),     
    );
        $context['is_joined'] = '<a href="'.$scripturl.'?action=bjclub;sa=delete">Unjoin</a>';
       
    } else {
        $context['is_joined'] = '<a href="'.$scripturl.'?action=bjclub;sa=join">Join</a>';
       
    }
}

function JoinBJClubs() {
   
    global $context, $scripturl, $txt, $smcFunc, $user_info;
   
    /*
    $request = $smcFunc['db_query']('', '
    INSERT INTO {db_prefix}bjclub_users   
    VALUES ('.$user_info['id'].','.$user_info['name'].','.mktime().',',0,',',0,'','');
    */
   
   
    $request = $smcFunc['db_insert']('INSERT',
        '{db_prefix}bjclubs_users',
        array('uid' => 'int', 'uname' => 'string','ujoined' => 'int','locked' => 'int','banned' => 'int','groups' => 'text','clubs' => 'text'),
        array($context['user']['id'],$context['user']['name'],mktime(),0,0,'',''),
        array()
        );
       
        $smcFunc['db_free_result']($request);
       
    $request = $smcFunc['db_query']('', '
    SELECT * FROM {db_prefix}bjclubs_users
    WHERE uid = {int:uid}',   
    array('uid' => $context['user']['id'])
    );   
           
    $context['BJClub']['User'] = array();
   
    $result = $smcFunc['db_fetch_assoc']($request);
    if(!$result)
       fatal_error($txt['bjclub_error_db1']);
   
    $context['BJClub']['User'][] = array(
    'uid' => $result['uid'],
    'uname' => $result['uname'],
    'joined' => date("m/d/Y h:i a",$result['ujoined']),
    'locked' => $result['locked'],
    'banned' => $result['banned'],
    'groups' => array($result['groups']),
    'clubs' => array($result['clubs']),     
    );
   
   
    $smcFunc['db_free_result']($request);
   
}

function GetClubListings() {
   
        global $context, $scripturl, $txt, $smcFunc, $user_info;
   
        // Get groups list
        $request = $smcFunc['db_query']('', '
        SELECT * FROM {db_prefix}bjclubs_groups
        ',   
        array()
        );
   
   
        $context['BJClub']['Groups'] = array();
   
        $row = $smcFunc['db_fetch_assoc']($request);
            if(!$row)
                fatal_error($txt['bjclub_error_db2']);
   
        $context['BJClub']['Groups'][] = array(
        'id'             => $row['id'],
        'groupname'      => $row['groupname'],
        'groupownerid'   => $row['groupownerid'],
        'groupownername' => $row['groupownername'],
        'gr_locked'      => $row['gr_locked'],
        'mode'           => $row['mode'],
        'status'         => $row['status'],     
        );
   
        $smcFunc['db_free_result']($request);
   
}


?>


SMF Forums http://www.df-barracks.com Where gamers go.

IchBin™

Do a var_dump($subActions[$_REQUEST['sa']]); It's telling you it's not a string. Do it right before the function call to see what is output. $_REQUEST['sa'] is likely not set properly.
IchBin™        TinyPortal

bigjoe11a

Ok, I guess it not calling a function. This is when I load the page. The only function that should show is the main function, sense that's the default one.

Any way I not getting any other error other then what I posted.

All I'm tring to do is load the main function. Look for your self's

http://www.toppersbbs.info/smf/index.php?action=bjclub

SMF Forums http://www.df-barracks.com Where gamers go.

SA™

$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'main';

should be
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'join';



Why are you including SSI.php?
http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

bigjoe11a

Quote from: SA™ on November 12, 2012, 03:50:02 PM
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'main';

should be
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'join';



Why are you including SSI.php?

Thanks, That worked. Any way. Why am I including the ssi.php file. Because I never took it off from my 1st mod.
SMF Forums http://www.df-barracks.com Where gamers go.

Matthew K.

The best way to do it?
$subActions = array(
'main' => 'mainHandler',
'notes' => 'notes_function',
'manage' => 'manageFunction'
);

if (!empty($_GET['sa']) && array_key_exists($_GET['sa'], $subActions))
call_user_func($subActions[$_GET['sa']]);

bigjoe11a

Quote from: Labradoodle-360 on November 12, 2012, 08:14:08 PM
The best way to do it?
$subActions = array(
'main' => 'mainHandler',
'notes' => 'notes_function',
'manage' => 'manageFunction'
);

if (!empty($_GET['sa']) && array_key_exists($_GET['sa'], $subActions))
call_user_func($subActions[$_GET['sa']]);


I just have to figure out how to make a main function. Of some kind. So I'm not running the 'join' all the time.
SMF Forums http://www.df-barracks.com Where gamers go.

SA™

You can just addon to the sub actions array then change the below code to the new defult subaction

Quote from: SA™ on November 12, 2012, 03:50:02 PM
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'main';

should be
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'join';



Why are you including SSI.php?
http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

bigjoe11a

Quote from: SA™ on November 12, 2012, 09:19:43 PM
You can just addon to the sub actions array then change the below code to the new defult subaction

Quote from: SA™ on November 12, 2012, 03:50:02 PM
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'main';

should be
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'join';



Why are you including SSI.php?


That part I do know, I just don't know how to setup a main sub-Action. The main part that loads in 1st. Like the main function I have in my source.

See the sub action 'join' is just a way for users to register in the mod. I need some way of adding one in for main() function, So that it loads. 1st before any thing.


SMF Forums http://www.df-barracks.com Where gamers go.

SA™

Quote from: SA™ on November 12, 2012, 03:50:02 PM
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'main';

should be
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'join';



Why are you including SSI.php?

That what this code does set the defult sub action if sa is not set
http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

Matthew K.

$subActions = array(
'main' => 'mainHandler',
'notes' => 'notes_function',
'manage' => 'manageFunction'
);

if (!empty($_GET['sa']) && array_key_exists($_GET['sa'], $subActions))
call_user_func($subActions[$_GET['sa']]);
else
call_user_func($subActions['main']);
There you go.

bigjoe11a

See the problem I have is the mainhandler. Sense I don't have one, I would have to make one. and Sense I all ready have a main. I have no idea what to do. So I'm lost on this.

SMF Forums http://www.df-barracks.com Where gamers go.

SA™

So how did you do the others

Post the source? I'm on a phone still so I can't do much
http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

Matthew K.

The main handler is just a random function name, you can name it whatever you want. Heck...you could even have it be 'some_random_subaction' => 'MyMainHandler', you just have to tell it later on in the script if no $_GET['sa'] is set, or it's not in the $subActions array, then it loads 'some_random_subaction', for naming sake, I put it as 'main'.

bigjoe11a

Here you go, This is the full source file for my mod


<?php
if (!defined('SMF'))
die('Hacking attempt...');

function 
main(){

// Second, give ourselves access to all the global variables we will need for this action
global $context$scripturl$txt$modSettings$boarddir;

    require_once(
$boarddir."\ssi.php");

    
//Load in layers templates
    
$context['template_layers'][] = 'bjclub';
    
    
loadlanguage('BJClub');
// Third, Load the specialty template for this action.
loadTemplate('bjclub');
    
    
GetTotals(); //Get some totals
    
GetClubListings();
    
    
    
// Here's our little sub-action array.
$subActions = array(    
    
'join' => 'JoinBJClubs',
        
'delete' => 'DeleteMember',
        
'savecat' => 'SaveCategory',
        
'savegroup' => 'SaveGroup',
        
'saveclub' => 'SaveClub',
        
'groups' => 'list_groups',
);
    
    
    if(!
$modSettings['BJClub_enable']) {
        
$context['system_msg'] = $txt['bjclub_closed'];
        
$context['sub_template'] = 'closed';
    }
    
    
    
//If the user is a guest, take them to the no guest template
    
if($context['user']['is_guest']) {
         
$context['system_msg'] = $txt['bjclub_noguests'];
         
$context['sub_template'] = 'noguest';
    }
    
    
//Check to see if user has joined BJClub
    
CheckIfJoined();
    
    
    if(!isset(
$context['system_msg']) == '' || empty($context['system_msg']))
      
$context['system_msg'] = $txt['welcome_club'];
      
      
$context['welcome_title_msg'] = sprintf($txt['welcome_title'], $txt['bjclub_header']);
      
$context['welcome_title_intro'] = $txt['title_intro'];

       
    
$context['tab_links'] = array();
    
    
$context['tab_links'][] = array('sa' => 'main',
                                    
'label' => $txt['bjclub_header'],
                                    
'url'   => '?action=bjclub'); 

    if(
allowedTo('bjclub_can_new_group'))
    
$context['tab_links'][] = array('sa' => 'group',
                                    
'label' => $txt['bjclub_groups'],
                                    
'url'   => '?action=bjclub;sa=groups'); 

    if(
allowedTo('bjclub_can_new_club'))    
    
$context['tab_links'][] = array('sa' => 'club',
                                    
'label' => $txt['bjclub_clubs'],
                                    
'url'   => '?action=bjclub;sa=club'); 
        
if(allowedTo('bjclub_can_new_cat'))
    
$context['tab_links'][] = array('sa' => 'cat',
                                    
'label' => $txt['bjclub_category'],
                                    
'url'   => $scripturl.'?action=bjclub;sa=cat'); 
    
    if(
allowedTo('bjclub_can_join_club'))
    
$context['tab_links'][] = array('sa' => 'joinc',
                                    
'label' => $txt['bjclub_joint_club'],
                                    
'url'   => '?action=bjclub;sa=joinc'); 
    
    if(
allowedTo('bjclub_can_join_group'))
    
$context['tab_links'][] = array('sa' => 'joing',
                                    
'label' => $txt['bjclub_joint_group'],
                                    
'url'   => '?action=bjclub;sa=joing'); 
    

    
    
// Default the sub-action to 'affiliates_veiw'.
$_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'join';

    
$context['page_title'] = $txt['bjclub_PageTitle'];
        
$context['linktree'][] = array(
  
'url' => $scripturl'?action=bjclub',
 
'name' => $txt['bjclub_header'],
);
    

    
    
// Call the right function for this sub-acton.
$subActions[$_REQUEST['sa']]();
    
//var_dump($subActions[$_REQUEST['sa']]());
    //die;
    
}

function 
SaveGroup() {
    
        global 
$smcFunc$user_info$modSettings$sourcedir$txt;
        
//if the admin needs to approve them 1st
        
if(!$modSettings['BJClub_clubs_approved'])
          
$isOk 'Approved';
        else
          
$isOk 'Pending';
    
    
        
$request $smcFunc['db_insert']('INSERT',
        
'{db_prefix}bjclubs_groups',
        array(
'groupname' => 'string','groupownerid' => 'int','groupownername' => 'string','gr_locked' => 'int','mode' => 'string','status' => 'string'),
        array(
$_POST['groupname'],$user_info['id'],$user_info['name'],0,$_POST['mode'],$isOk),
        array()
        );
        
        
$smcFunc['db_free_result']($request);
        
GetTotals();
        
        require_once(
$sourcedir.'/Subs-Post.php');
        if(
$isOk 'Pending') {
        
            
$to_pm = array(
            
'to' => array(!empty($modSettings['BJClub_admin_id']) ? $modSettings['BJClub_admin_id'] : 1),
            
'bcc' => array(),
            );
            
            
$subject $txt['bjclub_pm1_subject'];
            
$message sprintf($txt['bjclub_pm_message'],$user_info['name']);
            
$from = array(
            
'id' => $user_info['id'],
            
'name' => $user_info['name'],
            
'username' => $user_info['username'],
            );
        
            
$sndPm sendpm($to_pm,$subject,$message,false,$from);
            if(!
$sndPm)
                
fatal_error($txt['bjclub_error_sending1']);
            }
}

function 
SaveClub() {
    
    global 
$smcFunc$user_info$modSettings;
    
        if(
$modSettings['BJClub_clubs_approved'])
          
$isOk 'Approved';
        else
          
$isOk 'Pending';    
    
        
$request $smcFunc['db_insert']('INSERT',
        
'{db_prefix}bjclubs_clubs',
        array(
'clubname' => 'string','clubownerid' => 'int','clubownername' => 'string','cl_locked' => 'int','mode' => 'string','status' => 'string'),
        array(
$_POST['clubname'],$user_info['id'],$user_info['name'],0,$_POST['mode'],$isOk),
        array()
        );
        
        
$smcFunc['db_free_result']($request);
        
GetTotals();
    
}

function 
SaveCategory() {
    
        global 
$smcFunc;
    
        
$request $smcFunc['db_insert']('INSERT',
        
'{db_prefix}bjclubs_category',
        array(
'category' => 'string'),
        array(
$_POST['catname']),
        array()
        );
        
        
$smcFunc['db_free_result']($request);
        
GetTotals();
}

function 
GetTotals() {
    
        global 
$smcFunc$context$user_info;
    
        
$request $smcFunc['db_query']('''
        SELECT * FROM {db_prefix}bjclubs_category
        '
,    
        array()
        );
        
        
$context['bjclubs_cat_totals'] = $smcFunc['db_num_rows']($request);
        
        
$smcFunc['db_free_result']($request);
    
        
$request $smcFunc['db_query']('''
        SELECT * FROM {db_prefix}bjclubs_groups
        '
,    
        array()
        );
        
        
$context['bjclubs_group_totals'] = $smcFunc['db_num_rows']($request);
        
        
$smcFunc['db_free_result']($request);
    
        
//
        // Get users total groups
        
$request $smcFunc['db_query']('''
        SELECT * FROM {db_prefix}bjclubs_groups
        WHERE `groupownerid` = {int:groupownerid}'
,    
        array(
'groupownerid' => $user_info['id'])
        );
        
        
$context['bjclubs_group_owner_totals'] = $smcFunc['db_num_rows']($request);
        
        
$smcFunc['db_free_result']($request);
    
        
        
//
        // Get users total clubs
        
$request $smcFunc['db_query']('''
        SELECT * FROM {db_prefix}bjclubs_clubs
        WHERE `clubownerid` = {int:clubownerid}'
,    
        array(
'clubownerid' => $user_info['id'])
        );
        
        
$context['bjclubs_club_owner_totals'] = $smcFunc['db_num_rows']($request);
        
        
$smcFunc['db_free_result']($request);
        
    
}

function 
list_groups() {
    
    global 
$txt$context;
    
GetClubListings(); //Get Groups and Clubs Lists
    
$context['system_msg'] = $txt['bjclub_list_all_groups'];
    
$context['sub_template'] = 'list_groups';
    
    
}

function 
DeleteMember() {
    
    global 
$smcFunc$user_info;
    
    
//Now delete the post    
    
$request $smcFunc['db_query']('''
    DELETE FROM {db_prefix}bjclubs_users
    WHERE uid = {int:uid}'
,
    array(
'uid' => $user_info['id'])
    );
    
    
$context['BJClub']['User'] = array();
}


function 
CheckIfJoined() {
    
    global 
$context$scripturl$txt$smcFunc$user_info;
    
    
$request $smcFunc['db_query']('''
    SELECT * FROM {db_prefix}bjclubs_users
    WHERE uid = {int:uid}
    LIMIT 1
    '
,    
    array(
'uid' => $user_info['id'])
    );
    
    if(
$smcFunc['db_num_rows']($request) == 1) {
        
    
$row $smcFunc['db_fetch_assoc']($request);
    
    
$context['BJClub']['User'][] = array(
    
'uid' => $row['uid'],
    
'uname' => $row['uname'],
    
'joined' => date("m/d/Y h:i a",$row['ujoined']),
    
'locked' => $row['locked'],
    
'banned' => $row['banned'],
    
'groups' => array($row['groups']),
    
'clubs' => array($row['clubs']),     
    );
        
$context['is_joined'] = '<a href="'.$scripturl.'?action=bjclub;sa=delete">Unjoin</a>';
        
    } else {
        
$context['is_joined'] = '<a href="'.$scripturl.'?action=bjclub;sa=join">Join</a>';
        
    }
}

function 
JoinBJClubs() {
    
    global 
$context$scripturl$txt$smcFunc$user_info;
    
    
/*
    $request = $smcFunc['db_query']('', '
    INSERT INTO {db_prefix}bjclub_users    
    VALUES ('.$user_info['id'].','.$user_info['name'].','.mktime().',',0,',',0,'','');
    */
    
    
    
$request $smcFunc['db_insert']('INSERT',
        
'{db_prefix}bjclubs_users',
        array(
'uid' => 'int''uname' => 'string','ujoined' => 'int','locked' => 'int','banned' => 'int','groups' => 'text','clubs' => 'text'),
        array(
$context['user']['id'],$context['user']['name'],mktime(),0,0,'',''),
        array()
        );
        
        
$smcFunc['db_free_result']($request);
        
    
$request $smcFunc['db_query']('''
    SELECT * FROM {db_prefix}bjclubs_users
    WHERE uid = {int:uid}'
,    
    array(
'uid' => $context['user']['id'])
    );    
            
    
$context['BJClub']['User'] = array();
    
    
$result $smcFunc['db_fetch_assoc']($request);
    if(!
$result)
       
fatal_error($txt['bjclub_error_db1']);
    
    
$context['BJClub']['User'][] = array(
    
'uid' => $result['uid'],
    
'uname' => $result['uname'],
    
'joined' => date("m/d/Y h:i a",$result['ujoined']),
    
'locked' => $result['locked'],
    
'banned' => $result['banned'],
    
'groups' => array($result['groups']),
    
'clubs' => array($result['clubs']),     
    );
    
    
    
$smcFunc['db_free_result']($request);
    
}

function 
GetClubListings() {
    
        global 
$context$scripturl$txt$smcFunc$user_info;
    
        
// Get groups list
        
$request $smcFunc['db_query']('''
        SELECT * FROM {db_prefix}bjclubs_groups
        '
,    
        array()
        );
    
    
        
$context['BJClub']['Groups'] = array();
    
        
$row $smcFunc['db_fetch_assoc']($request);
            if(!
$row)
                
fatal_error($txt['bjclub_error_db2']);
    
        
$context['BJClub']['Groups'][] = array(
        
'id'             => $row['id'],
        
'groupname'      => $row['groupname'],
        
'groupownerid'   => $row['groupownerid'],
        
'groupownername' => $row['groupownername'],
        
'gr_locked'      => $row['gr_locked'],
        
'mode'           => $row['mode'],
        
'status'         => $row['status'],     
        );
    
        
$smcFunc['db_free_result']($request);
    
}


?>


SMF Forums http://www.df-barracks.com Where gamers go.

Matthew K.

Meh...that code could be improved quite a bit.

bigjoe11a

Quote from: Labradoodle-360 on November 12, 2012, 10:36:19 PM
The main handler is just a random function name, you can name it whatever you want. Heck...you could even have it be 'some_random_subaction' => 'MyMainHandler', you just have to tell it later on in the script if no $_GET['sa'] is set, or it's not in the $subActions array, then it loads 'some_random_subaction', for naming sake, I put it as 'main'.

Thank you, How ever I know that. The problem is. I have a main function all ready. I just posted my source file. Look at it. the main() function is what should load in. I tried adding the main to the $subActions and it just locked every thing up.

So if I add this to my subactions.

$subActions = array(
'main' => 'mainHandler',
'notes' => 'notes_function',
'manage' => 'manageFunction'
);


How would the main function run. See when I setup the bjclub hook. I all so added 'main'  too. So main should load every time by default. Witch is true.



SMF Forums http://www.df-barracks.com Where gamers go.

bigjoe11a

Quote from: Labradoodle-360 on November 12, 2012, 10:40:34 PM
Meh...that code could be improved quite a bit.

Well this is my 2nd mod. and sense there are no tutorials or even a skull version of the mod. I had to do it the way I learned how to from SMF.

SMF Forums http://www.df-barracks.com Where gamers go.

Matthew K.

Remove $context['sub_template'] from the main function, and then put that in the function that is called when a subAction is determined.

If "mainHandler()" is called, put $context['sub_template'] = 'main_base'; in mainHandler(); so that the sub_template is loaded from your main template when the main action is loaded. That's quite a bit of terminology...but it's quite simple, in reality.

Matthew K.

Quote from: bigjoe11a on November 12, 2012, 10:42:36 PM
Quote from: Labradoodle-360 on November 12, 2012, 10:40:34 PM
Meh...that code could be improved quite a bit.

Well this is my 2nd mod. and sense there are no tutorials or even a skull version of the mod. I had to do it the way I learned how to from SMF.


Wasn't trying to insult you, just wish I had time to update the code for you myself.

bigjoe11a

Quote from: Labradoodle-360 on November 12, 2012, 10:46:19 PM
Quote from: bigjoe11a on November 12, 2012, 10:42:36 PM
Quote from: Labradoodle-360 on November 12, 2012, 10:40:34 PM
Meh...that code could be improved quite a bit.

Well this is my 2nd mod. and sense there are no tutorials or even a skull version of the mod. I had to do it the way I learned how to from SMF.


Wasn't trying to insult you, just wish I had time to update the code for you myself.

LOL, Sorry, You trying to insult me, Trust me that thought never entered my mind. I just happy that you can give what help you can, That's why I wish some one would make a skull version. I asked before and every one just said. NO. Read threw the other mods and learn how to code them. Well that doesn't work for every one. That's why I'm tried to learn this $subAction.

SMF Forums http://www.df-barracks.com Where gamers go.

bigjoe11a

Quote from: Labradoodle-360 on November 12, 2012, 10:45:44 PM
Remove $context['sub_template'] from the main function, and then put that in the function that is called when a subAction is determined.

If "mainHandler()" is called, put $context['sub_template'] = 'main_base'; in mainHandler(); so that the sub_template is loaded from your main template when the main action is loaded. That's quite a bit of terminology...but it's quite simple, in reality.

Thanks, How ever, I don't have a $context['sub_template']  = 'main'; in my main source file. I was told I didn't need it. Because of the hook I created. and you have me all so lost.

any way, This is how I did it.

function BJClub_add_hook(&$actionArray) {
$actionArray['bjclub'] = array('bjclub.php', 'main');
}


I have a main added to my hook and I all so have a template_main(). This loads every time the mod starts. What I need to do is figure out how to leave the join in there and replace it with some thing else that will run the main and start the template_main too. That's the problem I have.



SMF Forums http://www.df-barracks.com Where gamers go.

Matthew K.

But...if you put it in a function that's called based on a sub-action, that template will be loaded. function template_main(); is only called if no other template is loaded (from $context['sub_template']).

bigjoe11a

Quote from: Labradoodle-360 on November 12, 2012, 10:57:08 PM
But...if you put it in a function that's called based on a sub-action, that template will be loaded. function template_main(); is only called if no other template is loaded (from $context['sub_template']).

Right, What would run the main() function. What would start that up. I guess the hook it self. Can you give me a small sample of code showing me what you mean


// Here's our little sub-action array.
$subActions = array(
        'main' => 'mainsomething', // This is where I would start at
    'join' => 'JoinBJClubs',
        'delete' => 'DeleteMember',
        'savecat' => 'SaveCategory',
        'savegroup' => 'SaveGroup',
        'saveclub' => 'SaveClub',
        'groups' => 'list_groups',
);

function mainsomething() {

//How would I run the main function or does that start up all by it self because it is the default function

}

SMF Forums http://www.df-barracks.com Where gamers go.

Matthew K.

Use the code I posted for subActions...

$subActions = array('your_array');
if (!empty($_GET['sa']) && array_key_exists($_GET['sa'], $subActions))
[tab_here]call_user_func($subActions[$_GET['sa']]);
else
[tab_here]call_user_func($subActions['main']);


Then in your function...

function mainsomething() {
[tab_here]global $context;
[tab_here]$context['sub_template'] = 'mainsomething';
}


Whenever a subaction is not set, or valid, it'll load the function mainsomething, which in turn loads the template function "template_mainsomething", which you need to define in a template that's already loaded.

bigjoe11a

Quote from: Labradoodle-360 on November 12, 2012, 11:07:52 PM
Use the code I posted for subActions...

$subActions = array('your_array');
if (!empty($_GET['sa']) && array_key_exists($_GET['sa'], $subActions))
[tab_here]call_user_func($subActions[$_GET['sa']]);
else
[tab_here]call_user_func($subActions['main']);


Then in your function...

function mainsomething() {
[tab_here]global $context;
[tab_here]$context['sub_template'] = 'mainsomething';
}


Whenever a subaction is not set, or valid, it'll load the function mainsomething, which in turn loads the template function "template_mainsomething", which you need to define in a template that's already loaded.

Now I get the idea. See what I mean is that when I setup another function. I DON'T want to call another template. Because the main template loads in.

So what I did is I added this


$subActions = array(
'main' => 'mainframe',
'notes' => 'notes_function',
'manage' => 'manageFunction'
);

function mainframe() {

//I left this one empty, Blank. The main templates load.

}


So if I'm right and I'll test this. and it worked. It took me right back the the main hook. This crap is so cool.


$context['tab_links'][] = array('sa' => 'main',
                                    'label' => $txt['bjclub_header'],
                                    'url'   => '?action=bjclub');


Now this means I have an extra function to add some more crap too. If I need to. Any way. Let me ask you. When you have time. and little time. Could you make up a skull or a skeleton version of the mod.

Showing every one how to code the right way. Add some permissions and some settings. using hooks. and then add like 2 pages to it. and That's it.

You should get like 2 or 3000 downloads hits from it. lol. Let me know

SMF Forums http://www.df-barracks.com Where gamers go.

Matthew K.

Problem is, I don't have time, unfortunately. To do it properly would take many hours. There are already many modifications on the mod site that have settings, permissions, hooks, and pages. And some that do it well, in many different ways, too.

bigjoe11a

Quote from: Labradoodle-360 on November 12, 2012, 11:35:12 PM
Problem is, I don't have time, unfortunately. To do it properly would take many hours. There are already many modifications on the mod site that have settings, permissions, hooks, and pages. And some that do it well, in many different ways, too.

See that's the problem. There's so many of them and so many users just don't all ways under stand. and I could make one up in like just 2 or 3 hours. Then I would need some one to fine tune it.

See I looked threw lots of mods and I all ways have a hard time under standing just what they are trying to do. So most of the time. I have to guess. That's not right. I lot a mod makers have told me that's how they learned. Well I can't. My skills in PHP are good. Not this kind of coding. Most of it is way over my head. I just don't under stand it. Most of the PHP coding I do I learned from videos on youtube. How ever they don't all ways teach you every thing you need to know.

That's why I wish there were tutorials on how to make mods for SMF. There are none. Any way I didn't think it would hurt to ask. have you looked at my 1st mod. look here.

http://custom.simplemachines.org/mods/index.php?mod=3524

I have some plains on some cool updates for it. One more thing, If you download it. You have to change the way the file is zip up. A 2nd folder was added to it. So every thing goes into the root folder of the file. and there's a bjblog folder. and that needs to stay where it is. So that the installer will work.


SMF Forums http://www.df-barracks.com Where gamers go.

SA™

Indeed no need to reinvent the wheel every thing is on the mod site ;)

Quote from: Labradoodle-360 on November 12, 2012, 11:35:12 PM
Problem is, I don't have time, unfortunately. To do it properly would take many hours. There are already many modifications on the mod site that have settings, permissions, hooks, and pages. And some that do it well, in many different ways, too.
http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

bigjoe11a

Quote from: SA™ on November 12, 2012, 11:50:11 PM
Indeed no need to reinvent the wheel every thing is on the mod site ;)

Quote from: Labradoodle-360 on November 12, 2012, 11:35:12 PM
Problem is, I don't have time, unfortunately. To do it properly would take many hours. There are already many modifications on the mod site that have settings, permissions, hooks, and pages. And some that do it well, in many different ways, too.

lol, not every thing
SMF Forums http://www.df-barracks.com Where gamers go.

Matthew K.

There aren't any tutorials, because it's way too broad of a subject. Trust me, I've intended on making tutorials many many times. But now that I have the knowledge that I do, I realize that it's not worth it.

SA™

QuoteMy skills in PHP are good
If that the case I suspect you would know what these mods are doing in dilexic and I under stand code better than english:P
http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

bigjoe11a

Quote from: Labradoodle-360 on November 12, 2012, 11:55:30 PM
There aren't any tutorials, because it's way too broad of a subject. Trust me, I've intended on making tutorials many many times. But now that I have the knowledge that I do, I realize that it's not worth it.

I know what you mean. It's just it would have been easy for me, With out the need to bug every one on the forum. If there was some thing I couldn't get to work. or I didn't under stand some thing. Then SMF can help. most of the time I just don't under stand.

SMF Forums http://www.df-barracks.com Where gamers go.

bigjoe11a

Quote from: SA™ on November 12, 2012, 11:57:18 PM
QuoteMy skills in PHP are good
If that the case I suspect you would know what these mods are doing in dilexic and I under stand code better than english:P

Well I'm happy that you do. Sorry I don't. This is all so new.
SMF Forums http://www.df-barracks.com Where gamers go.

SA™

Just keep at it it will come to U eventualy PHP.net helps aswell
http://samods.github.io/SAChatBar/

Xbox Live: smokerthecheese 360 or xbone
My Work
Piano Movers / Delivery service
QuoteMy allies are dead.
I'm 'bout to be too.
Zombies are chasing me.
F*** it, I'm screwed -___-

bigjoe11a

Quote from: SA™ on November 13, 2012, 12:05:01 AM
Just keep at it it will come to U eventualy PHP.net helps aswell

In PHP it will. Not in SMF.
SMF Forums http://www.df-barracks.com Where gamers go.

Matthew K.

Remember that SMF is written in PHP, and is handled very logically.

bigjoe11a

Quote from: Labradoodle-360 on November 13, 2012, 12:11:57 AM
Remember that SMF is written in PHP, and is handled very logically.

Now you know why I run it. The mods are easy to install. I have less problems with it.
SMF Forums http://www.df-barracks.com Where gamers go.

Advertisement: