[Tutorial] How to install a MOD

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
User avatar
DonvanVliet
Registered User
Posts: 18
Joined: Sat Sep 06, 2003 11:01 am
Location: The Little House I Used To Live In
Contact:

Post by DonvanVliet » Thu Oct 23, 2003 1:12 am

Ok. where do I paste the code???? at the end of the original file?

User avatar
A_Jelly_Doughnut
Former Team Member
Posts: 34448
Joined: Sat Jan 18, 2003 1:26 am
Location: Where the Rivers Run
Contact:

Post by A_Jelly_Doughnut » Thu Oct 23, 2003 1:17 am

There should be a [ FIND ] statement before that one in the install file. Is there not?
A Donut's Blog
"Bach's Prelude (Cello Suite No. 1) is driving Indiana country roads in Autumn" - Ann Kish

User avatar
DonvanVliet
Registered User
Posts: 18
Joined: Sat Sep 06, 2003 11:01 am
Location: The Little House I Used To Live In
Contact:

Post by DonvanVliet » Thu Oct 23, 2003 9:28 am

This is the MOD:

#
#-----[ ACTION: open ]---------------------------------
#
/templates/subSilver/index_body.tpl

#
#-----[ ACTION: find ]---------------------------------
#
<td class="row1" align="center" valign="middle" rowspan="2"><img src="templates/subSilver/images/whosonline.gif" alt="{L_WHO_IS_ONLINE}" /></td>

#
#-----[ ACTION: replace by ]---------------------------
#
<td class="row1" align="center" valign="middle" rowspan="3"><img src="templates/subSilver/images/whosonline.gif" alt="{L_WHO_IS_ONLINE}" /></td>

#
#-----[ ACTION: find ]---------------------------------
#
<td class="row1" align="left"><span class="gensmall">{TOTAL_USERS_ONLINE} & [ {L_WHOSONLINE_ADMIN} ] & [ {L_WHOSONLINE_MOD} ]<br />{RECORD_USERS}<br />{LOGGED_IN_USER_LIST}</span></td>

#
#-----[ ACTION: add after ]----------------------------
#
</tr>
<tr>
<td class="row1" align="left"><span class="gensmall">{USERS_OF_THE_DAY_LIST}</span></td>

#
#-----[ ACTION: repeat for all templates ]-------------
#



#
#-----[ ACTION: open ]--------------------------------
#
/language/lang_english/lang_main.php

#
#-----[ ACTION: find ]--------------------------------
#
$lang['Registered_users'] =

#
#-----[ ACTION: add before ]--------------------------
#
$lang['Day_users'] = '%d registered users visit during the last %d hours:';
$lang['Not_day_users'] = '%d registered users <span style="color:red">DIDN\'T</span> visit during the last %d hours:';

#
#-----[ ACTION: repeat for all languages ]------------
#



#
#-----[ ACTION: open ]--------------------------------
#
/includes/page_header.php

#
#-----[ ACTION: find ]--------------------------------
#
'LOGGED_IN_USER_LIST' => $online_userlist,

#
#-----[ ACTION: add after ]---------------------------
#
'USERS_OF_THE_DAY_LIST' => $day_userlist,

#
#-----[ ACTION: find ]--------------------------------
#
//
// Obtain number of new private messages
// if user is logged in
//

#
#-----[ ACTION: add before ]--------------------------
#
//
// Users of the day MOD
//

// ############ Edit below ############
// #
$display_not_day_userlist = 0; // change to 1 here if you also want the list of the users who didn't visit to be displayed
$users_list_delay = 24; // change here to the number of hours wanted for the list
// #
// ############ Edit above ############

$sql = "SELECT user_id, username, user_allow_viewonline, user_level, user_session_time
FROM ".USERS_TABLE."
WHERE user_id > 0
ORDER BY user_level DESC, username ASC";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain user/day information', '', __LINE__, __FILE__, $sql);
}

$day_userlist = '';
$day_users = 0;
$not_day_userlist = '';
$not_day_users = 0;

while( $row = $db->sql_fetchrow($result) )
{
$style_color = '';
if ( $row['user_level'] == ADMIN )
{
$row['username'] = '<b>' . $row['username'] . '</b>';
$style_color = 'style="color:#' . $theme['fontcolor3'] . '"';
}
else if ( $row['user_level'] == MOD )
{
$row['username'] = '<b>' . $row['username'] . '</b>';
$style_color = 'style="color:#' . $theme['fontcolor2'] . '"';
}
if ( $row['user_allow_viewonline'] )
{
$user_day_link = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'>' . $row['username'] . '</a>';
}
else
{
$user_day_link = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'><i>' . $row['username'] . '</i></a>';
}
if ( $row['user_allow_viewonline'] || $userdata['user_level'] == ADMIN )
{
if ( $row['user_session_time'] >= ( time() - $users_list_delay * 3600 ) )
{
$day_userlist .= ( $day_userlist != '' ) ? ', ' . $user_day_link : $user_day_link;
$day_users++;
}
else
{
$not_day_userlist .= ( $not_day_userlist != '' ) ? ', ' . $user_day_link : $user_day_link;
$not_day_users++;
}
}
}

$day_userlist = ( ( isset($forum_id) ) ? '' : sprintf($lang['Day_users'], $day_users, $users_list_delay) ) . ' ' . $day_userlist;

$not_day_userlist = ( ( isset($forum_id) ) ? '' : sprintf($lang['Not_day_users'], $not_day_users, $users_list_delay) ) . ' ' . $not_day_userlist;

if ( $display_not_day_userlist )
{
$day_userlist .= '<br />' . $not_day_userlist;
}

//
// End of MOD
//



#
#-----[ ACTION: save/close all ]----------------------
#

#
#-----[ ACTION: upload the modified files ]-----------
#

#
#-----[ ACTION: enjoy ]-------------------------------
#

#
#-----[ PLEASE REPORT ANY BUGS OR SUGGESTIONS]--------

#

User avatar
morpheus2matrix
Former Team Member
Posts: 9171
Joined: Wed Apr 10, 2002 7:31 pm
Location: France
Contact:

Post by morpheus2matrix » Thu Oct 23, 2003 3:06 pm

so open the specified files, make the correct modifications in the files and then, upload them onto your FTP
Former phpBB MOD-Team Member -

Forgive my bad English :(

No support by PM/Email - Thanks - You can thanks me here :) - Pay me for installing MOD's :lol:

User avatar
DonvanVliet
Registered User
Posts: 18
Joined: Sat Sep 06, 2003 11:01 am
Location: The Little House I Used To Live In
Contact:

Post by DonvanVliet » Fri Oct 24, 2003 12:49 am

Well,.....I think it only works for SuBsilver. 8O

User avatar
AlleyKat
Registered User
Posts: 1037
Joined: Wed Jul 16, 2003 5:06 pm
Location: Odense, Denmark
Contact:

Post by AlleyKat » Fri Oct 24, 2003 3:00 am

This specific instruction does, yup...

So lets look at it.

Code: Select all

# 
#-----[ ACTION: open ]--------------------------------- 
# 
/templates/subSilver/index_body.tpl 
replace by your template to be
/templates/{yourtemplatewhichyoudidntmention}/index_body.tpl
In this,

Code: Select all

# 
#-----[ ACTION: find ]--------------------------------- 
# 
<td class="row1" align="center" valign="middle" rowspan="2"><img src="templates/subSilver/images/whosonline.gif" alt="{L_WHO_IS_ONLINE}" /></td> 
This looks for a box with an image and - the important part would be - looking for {L_WHO_IS_ONLINE} (Language text 'Who is online') - so look for that in your template and replace by

Code: Select all

# 
#-----[ ACTION: replace by ]--------------------------- 
# 
<td class="row1" align="center" valign="middle" rowspan="3"><img src="templates/subSilver/images/whosonline.gif" alt="{L_WHO_IS_ONLINE}" /></td> 
- but ofcourse only with a fitting image, and only if an image belongs in your template - else you gotta modify it to fit in.

and so on...
8)
Image Dansk phpBB support (uofficielt)
Find unofficial support in your language here.
Help translate Mozilla extensions @ Babelzilla - Your Language Counts Too!

User avatar
AlleyKat
Registered User
Posts: 1037
Joined: Wed Jul 16, 2003 5:06 pm
Location: Odense, Denmark
Contact:

Post by AlleyKat » Fri Oct 24, 2003 3:13 am

Oh maybe I was too general...

This part I think you don't get, right?

Code: Select all

# 
#-----[ ACTION: open ]-------------------------------- 
# 
/includes/page_header.php 

(...)


# 
#-----[ ACTION: find ]-------------------------------- 
# 
// 
// Obtain number of new private messages 
// if user is logged in 
// 

# 
#-----[ ACTION: add before ]-------------------------- 
# 
// 
// Users of the day MOD 
// 

// ############ Edit below ############ 
// # 
$display_not_day_userlist = 0; // change to 1 here if you also want the list of the users who didn't visit to be displayed 
$users_list_delay = 24; // change here to the number of hours wanted for the list 
// # 
// ############ Edit above ############ 

$sql = "SELECT user_id, username, user_allow_viewonline, user_level, user_session_time 
FROM ".USERS_TABLE." 
WHERE user_id > 0 
ORDER BY user_level DESC, username ASC"; 
if( !($result = $db->sql_query($sql)) ) 
{ 
message_die(GENERAL_ERROR, 'Could not obtain user/day information', '', __LINE__, __FILE__, $sql); 
} 

(... AND A LOT MORE CODE)

// 
// End of MOD 
// 
lets presume you want default settings;

It would look like

Code: Select all

# 
#-----[ ACTION: open ]-------------------------------- 
# 
/includes/page_header.php 

### (... other little change)

# 
#-----[ ACTION: find ]-------------------------------- 
# 
// 
// Obtain number of new private messages 
// if user is logged in 
// 

# 
#-----[ ACTION: add before ]-------------------------- 
# 
// 
// Users of the day MOD 
// 

$display_not_day_userlist = 0; 
$users_list_delay = 24;

$sql = "SELECT user_id, username, user_allow_viewonline, user_level, user_session_time 
FROM ".USERS_TABLE." 
WHERE user_id > 0 
ORDER BY user_level DESC, username ASC"; 
if( !($result = $db->sql_query($sql)) ) 
{ 
message_die(GENERAL_ERROR, 'Could not obtain user/day information', '', __LINE__, __FILE__, $sql); 
} 
$day_userlist = ''; 
$day_users = 0; 
$not_day_userlist = ''; 
$not_day_users = 0; 

while( $row = $db->sql_fetchrow($result) ) 
{ 
$style_color = ''; 
if ( $row['user_level'] == ADMIN ) 
{ 
$row['username'] = '<b>' . $row['username'] . '</b>'; 
$style_color = 'style="color:#' . $theme['fontcolor3'] . '"'; 
} 
else if ( $row['user_level'] == MOD ) 
{ 
$row['username'] = '<b>' . $row['username'] . '</b>'; 

$style_color = 'style="color:#' . $theme['fontcolor2'] . '"'; 
} 
if ( $row['user_allow_viewonline'] ) 
{ 
$user_day_link = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'>' . $row['username'] . '</a>'; 
} 
else 
{ 
$user_day_link = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $row['user_id']) . '"' . $style_color .'><i>' . $row['username'] . '</i></a>'; 
} 
if ( $row['user_allow_viewonline'] || $userdata['user_level'] == ADMIN ) 
{ 
if ( $row['user_session_time'] >= ( time() - $users_list_delay * 3600 ) )
{ 
$day_userlist .= ( $day_userlist != '' ) ? ', ' . $user_day_link : $user_day_link; 
$day_users++; 
} 
else 
{ 
$not_day_userlist .= ( $not_day_userlist != '' ) ? ', ' . $user_day_link : $user_day_link; 
$not_day_users++; 
} 
} 
} 

$day_userlist = ( ( isset($forum_id) ) ? '' : sprintf($lang['Day_users'], $day_users, $users_list_delay) ) . ' ' . $day_userlist;

$not_day_userlist = ( ( isset($forum_id) ) ? '' : sprintf($lang['Not_day_users'], $not_day_users, $users_list_delay) ) . ' ' . $not_day_userlist; 

if ( $display_not_day_userlist ) 
{ 
$day_userlist .= '<br />' . $not_day_userlist; 
} 

// 
// End of MOD 
// 
Image Dansk phpBB support (uofficielt)
Find unofficial support in your language here.
Help translate Mozilla extensions @ Babelzilla - Your Language Counts Too!

User avatar
DonvanVliet
Registered User
Posts: 18
Joined: Sat Sep 06, 2003 11:01 am
Location: The Little House I Used To Live In
Contact:

Post by DonvanVliet » Sun Oct 26, 2003 10:55 am

I have to digest all this information. 8O :roll:

Glass Foot
Registered User
Posts: 1
Joined: Mon Oct 27, 2003 3:43 am

Whoa...

Post by Glass Foot » Mon Oct 27, 2003 4:52 am

spacefem wrote: you know, it'd be nice if there was a link to this thread on http://www.phpbb.com/mods/faq.php or somewhere similar. I felt equally clueless about all this, wasn't sure if I was supposed to install something or what, and hate to think what I would have done if this thread were hidden away more somewhere.

Anyway, thanks a lot for writing this tutorial morpheus!


AGREED
"How to install a MOD" ought to be the first link you see when clicking the "mods" link in the tool bar above.

When I first clicked the Mods link, I was expecting at the least a replacement file or some script to run (I mean isn't that the standard expectation?). But when I downloaded one and saw that it was a ".txt" file, I opened it up thinking... what could this mean? Where do you put it? Do you upload it from your bbs admin panel which then consumes it? That would be clever. But, um.. it turns out it's a step by step how to modify your .php script in your text editor? So the end user IS the compiler? Ug. I would have never guessed this just by looking at the contents of the script file... I mean at first glance, the contents read like compiler directives.

To save grief and confusion, I would recommend a simple change in philosophy. If a mod truly is a manual, make it look like one. A .PDF with pictures and stuff :mrgreen:

I'm a newb, go easy on me!
Chris

User avatar
morpheus2matrix
Former Team Member
Posts: 9171
Joined: Wed Apr 10, 2002 7:31 pm
Location: France
Contact:

Re: Whoa...

Post by morpheus2matrix » Mon Oct 27, 2003 9:17 am

Glass Foot wrote:
spacefem wrote:you know, it'd be nice if there was a link to this thread on http://www.phpbb.com/mods/faq.php or somewhere similar. I felt equally clueless about all this, wasn't sure if I was supposed to install something or what, and hate to think what I would have done if this thread were hidden away more somewhere.

Anyway, thanks a lot for writing this tutorial morpheus!


AGREED
"How to install a MOD" ought to be the first link you see when clicking the "mods" link in the tool bar above.



i've already submitted this tutorial and the Tutorial "How-To use PhpMyAdmin" to the KB of phpBB.com more than 2 times (on request of a MOD Team Member) : there is still no news. So, i've decided to not submited them again and to wait.
Former phpBB MOD-Team Member -

Forgive my bad English :(

No support by PM/Email - Thanks - You can thanks me here :) - Pay me for installing MOD's :lol:

User avatar
wGEric
Former Team Member
Posts: 8805
Joined: Sun Oct 13, 2002 3:01 am
Location: Friday
Name: Eric Faerber
Contact:

Post by wGEric » Wed Oct 29, 2003 2:11 am

Added to the Knowledge Base. You can read it here http://www.phpbb.com/kb/article.php?article_id=150
Eric

User avatar
morpheus2matrix
Former Team Member
Posts: 9171
Joined: Wed Apr 10, 2002 7:31 pm
Location: France
Contact:

Post by morpheus2matrix » Wed Oct 29, 2003 8:38 am

Kool :mrgreen:

Thanks :wink:
Former phpBB MOD-Team Member -

Forgive my bad English :(

No support by PM/Email - Thanks - You can thanks me here :) - Pay me for installing MOD's :lol:

User avatar
AlleyKat
Registered User
Posts: 1037
Joined: Wed Jul 16, 2003 5:06 pm
Location: Odense, Denmark
Contact:

Post by AlleyKat » Wed Oct 29, 2003 10:24 am

8) /me would suppose they would be thanking you Morpheus :wink: good job!

Glass Foot >> 8O PDF? Oh no no no no, I can't get EasyMOD to read PDFs - text format, can't get it wrong. I just wish they wouldn't use the extention .MOD as this is the format for quite a bit of my music on my PC (yup, SID music rulez).

DonvanVliet >> If it still bugs you, PM me.

8)
Image Dansk phpBB support (uofficielt)
Find unofficial support in your language here.
Help translate Mozilla extensions @ Babelzilla - Your Language Counts Too!

JLG2000
Registered User
Posts: 3
Joined: Wed Oct 29, 2003 6:43 pm

Here's a really dumb newbie question.

Post by JLG2000 » Wed Oct 29, 2003 6:57 pm

I'm trying to install the Easy MOD mod (the thread about that mod is stickied, but closed, and the linked forum doesn't work...), but it's far from "easy"... Do you just unzip the files to any directory? Also, editing the admin_easymod.php.txt file didn't help. I wind up getting errors like:

[snip]

EDIT: I think I've finally got it... I guess mods need to go into the admin folder. :oops:

rulezurlife12
Registered User
Posts: 3
Joined: Wed Oct 29, 2003 9:12 pm

Post by rulezurlife12 » Wed Oct 29, 2003 9:20 pm

hey guys im a little confused here :( i got a free hosted phpbb forum and well, how do i install the mods onto them? i would be able to follow those instructions if i new where to do it :lol: cuz i really want to add that money mod to my forum :D or someone could do it for me :oops:
Last edited by rulezurlife12 on Wed Oct 29, 2003 10:02 pm, edited 1 time in total.

Locked

Return to “[2.0.x] MODs in Development”

Who is online

Users browsing this forum: No registered users and 4 guests

cron