Quick code formatting question

Discussion forum for MOD Writers regarding MOD Development.
Sicle
Registered User
Posts: 27
Joined: Fri Aug 06, 2010 8:38 pm
Location: Netherlands, @home
Name: Bart McCall

Re: Quick code formatting question

Post by Sicle »

What is the name of the HTML template file?
BBRAIN
Registered User
Posts: 55
Joined: Tue Aug 26, 2008 10:33 am

Re: Quick code formatting question

Post by BBRAIN »

just call it test as the php m8 ;)
Sicle
Registered User
Posts: 27
Joined: Fri Aug 06, 2010 8:38 pm
Location: Netherlands, @home
Name: Bart McCall

Re: Quick code formatting question

Post by Sicle »

Code: Select all

<?php
    define('IN_PHPBB', true);
    $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
    $phpEx = substr(strrchr(__FILE__, '.'), 1);
    include($phpbb_root_path . 'common.' . $phpEx);
    include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
    include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
    
    $user->session_begin();
    $auth->acl($user->data);   
    $user->setup();     
       
    $sqls  = "SELECT * FROM " . POSTS_TABLE;
    $results1 = $db->sql_query($sqls);

    while($list = $db->sql_fetchrow($results1))
    {
        $rawdata=$list['post_text']. " - ". $list['post_id'];
        $data=explode('[img]',$rawdata);
        $before=$data[0];
        $data=explode('[/img]',$data[1]);
        $after=$data[1];
        $image='[img]'.$data[0].'[/img]';   
       
        $template->assign_block_vars('data_row', array(
                'STRINGONE'        =>    $list['post_text']. " - ". $list['post_id'],
            'STRINGTWO'        =>    $after,
            'IMAGE'        =>    $image
        ));
    }

    $db->sql_freeresult($result1);
    
    
    //you forgot the following 3 functions..... the functions that will open your template file and print it >.>
    page_header('The title of this page.');
 
    $template->set_filenames(array(
       'body' => 'YOUR_TEMPLATE_FILE.html' //like forum_body.html
    ));
    
    page_footer();
?>
Hope it works this time >.>
BBRAIN
Registered User
Posts: 55
Joined: Tue Aug 26, 2008 10:33 am

Re: Quick code formatting question

Post by BBRAIN »

Many Thanks m8 will try it :)

Like a charm Many Many Thanks :D
Sicle
Registered User
Posts: 27
Joined: Fri Aug 06, 2010 8:38 pm
Location: Netherlands, @home
Name: Bart McCall

Re: Quick code formatting question

Post by Sicle »

Your welcome :P
Locked

Return to “[3.0.x] MOD Writers Discussion”