Topic: cant realy understand the new extension sistem realy .. is there any

hi .. i was try to make some mods

cant realy understand the new extension sistem realy .. is there any software that will make the process easy .. just compare the simple extensions which i dont understand /// like : last post subject in index

look the xml extension file:

  <?xml version="1.0" encoding="utf-8" ?> 
- <extension engine="1.0">
  <id>subject_index</id> 
  <title>Last Post Subject on Forum Index</title> 
  <version>1.0</version> 
  <description>This will add the subject of the last post under the last post column on the index page.</description> 
  <author>StevenBullen (Ju of CtrlAltSuppr.com)</author> 
  <minversion>1.3 Beta</minversion> 
  <maxtestedon>1.3 Beta</maxtestedon> 
- <hooks>
- <hook id="in_qr_get_cats_and_forums">
- <![CDATA[ 
        $query['SELECT'] .= ', t.subject';
        $query['JOINS'][] = array(
            'LEFT JOIN'    => 'topics AS t',
            'ON'        => 't.last_post_id=f.last_post_id'
        );
    

  ]]> 
  </hook>
- <hook id="in_row_pre_display">
- <![CDATA[ 
        if ($cur_forum['last_post'] != '')
        {
            unset($pun_page['item_last_post']);
        
            $idm = $cur_forum['subject'];
            if(strlen($idm) > 30) {
                $idmComp = str_replace('"', "''", $idm);
                $idm = substr($idm, 0, 30).'...';
            } else
                $idmComp = '';
         
            $idmT = (isset($idmComp)) ? ' title="'.$idmComp.'"' : '';

            $pun_page['item_last_post'][] = '<a href="'.pun_link($pun_url['post'], $cur_forum['last_post_id']).'"'.$idmT.'><span>'.$idm.'</span></a>';
            $pun_page['item_last_post'][] =    '<span class="byuser">'.sprintf($lang_common['By user'], htmlspecialchars($cur_forum['last_poster'])).'</span>';
        }
    

  ]]> 
  </hook>
  </hooks>
  </extension>

and look at the 1.2 mod


index.php 
Line 42, replace 

$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.redirect_url, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE fp.read_forum IS NULL OR fp.read_forum=1 ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());With 

$result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.forum_desc, f.redirect_url, f.moderators, f.num_topics, f.num_posts, f.last_post, f.last_post_id, f.last_poster, t.subject FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'topics AS t ON t.last_post_id=f.last_post_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE fp.read_forum IS NULL OR fp.read_forum=1 ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());Line 109, replace 

    // If there is a last_post/last_poster.
    if ($cur_forum['last_post'] != '')
        $last_post = '<a href="viewtopic.php?pid='.$cur_forum['last_post_id'].'#p'.$cur_forum['last_post_id'].'">'.format_time($cur_forum['last_post']).'</a> <span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_forum['last_poster']).'</span>';
    else
        $last_post = ' ';With 

    // Display the last topic
    $idm = $cur_forum['subject'];
    if(strlen($idm) > 30) {
        $idmComp = str_replace('"', "''", $idm);
        $idm = substr($idm, 0, 30).'...';
    } else
        $idmComp = '';
 
    // If there is a last_post/last_poster.
    if ($cur_forum['last_post'] != '') {
        $idmT = (isset($idmComp)) ? ' title="'.$idmComp.'"' : '';
        $last_post = format_time($cur_forum['last_post']).'<br />dans <a href="viewtopic.php?pid='.$cur_forum['last_post_id'].'#p'.$cur_forum['last_post_id'].'"'.$idmT.'><em>'.$idm.'</em></a><br /><span class="byuser">'.$lang_common['by'].' '.pun_htmlspecialchars($cur_forum['last_poster']).'</span>';
    } else
        $last_post = ' ';Save and upload.

can some one help please for finding easy way or software ...

thanks

MyFootballCafe.com  is Now Online!

2 (edited by StevenBullen 2008-02-08 10:33)

Re: cant realy understand the new extension sistem realy .. is there any

Anyone else want this info?
because if a few do... then I will do a topic goig through how I converted it.

EDIT: Also will the documents for 1.3 go over anything like this?

Re: cant realy understand the new extension sistem realy .. is there any

How to create extensions? Certainly

4 (edited by StevenBullen 2008-02-08 11:56)

Re: cant realy understand the new extension sistem realy .. is there any

Smartys wrote:

How to create extensions? Certainly

Yeah but how in depth will the documents go? beginner/intermediate/expert or covering all 3?

Re: cant realy understand the new extension sistem realy .. is there any

It depends on how you defined each of those "levels": give me some examples and I might be able to be more specific.

Re: cant realy understand the new extension sistem realy .. is there any

This is true.

Will wait for the docs... tongue
Then will give some feedback... if required.

Re: cant realy understand the new extension sistem realy .. is there any

so where is the docs ... i want to start from now to convert or create new mods ... as i realy excited

MyFootballCafe.com  is Now Online!

Re: cant realy understand the new extension sistem realy .. is there any

There are no docs as they'd probably be outdated by the time of 1.3 final.

Re: cant realy understand the new extension sistem realy .. is there any

StevenBullen wrote:

Anyone else want this info?
because if a few do... then I will do a topic goig through how I converted it.

EDIT: Also will the documents for 1.3 go over anything like this?

could you show me how did u convert that mod ... the more moders there are the faster it will become

MyFootballCafe.com  is Now Online!

Re: cant realy understand the new extension sistem realy .. is there any

I don't understand it at all. I tryed to do some simple stuff but all I end up with is error messages eval() ect..