Jump to content

Help Basic MOD Coding

Featured Replies

Posted

Hello,

I'm trying to learn how to create mod's / edits for IPB.
I know PHP, MYSQL, XHTML, CSS, JAVASCRIPT.


First thing i'm trying to learn is how to create your own page.
like this, index.php?act=mypage

I found some tutorials but most of them where outdated, or didn't work.


I know the first step, edit index.php, find

'component'  => array( 'component'          , 'component'    , array() ),

Add below:

'mypage'  => array( 'mypage'          , 'mypage'    , array() ),

Now i created a php file called mypage.php in sources/action_public/ I know you need a lang & skin file. So i created, lang_mypage.php in cache/lang_cache/en/ and skin_mypage.php in cache/skin_cache/cacheid_3/. This is how my files look. sources/action_public/mypage.php

<?php
if ( ! defined( 'IN_IPB' ) )
{
    print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";
    exit();
}

class mypage
{
    # Global
    var $ipsclass;
}
?>

cache/lang_cache/en/lang_mypage.php

<?php

$lang = array (

'welcome_message'            => "Welcome to my page!",
'page_title'                     => 'My Page!',
);

?>

cache/skin_cache/cacheid_3/skin_mypage.php

<?php
class skin_mypage_3 {

 var $ipsclass;

function index() {
$IPBHTML = "";
//--starthtml--//
$IPBHTML .= "<b>PageTitle:</b> {$this->ipsclass->lang['page_title']} <br />
<b>My Welcome Message:</b>  {$this->ipsclass->lang['welcome_message']}";
//--endhtml--//
return $IPBHTML;
}

}
?>



That's all i know, but i dont know how to make it output or something like that :(
Could somebody help me with the basics :) or if you know a good working tutorial, that would be fine to :)

Kind Regards,

Headshot

This needs to be posted at IPSBeyond :)

Ok ;) will do ;) thanks :)

Archived

This topic is now archived and is closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.