Pagina 1 van 1

[BETA] FXP Mod

Geplaatst: 04 jan 2006, 11:42
door Lucky Luke
Yorick en ik zijn bezig met een FXP Mod voor phpBB2. Op dit moment is eigenlijk IPB een beetje dé standaard board voor FXP forums. Daar willen wij veranderingen in brengen :mrgreen:

MOD Titel: FXP Mod
MOD Beschrijving: Deze mod voegt een aantal FXP functie's toe aan je phpBB2 board.
MOD Version: 0.2.0

MOD Download: http://dev.saverct2.com/fxp_mod_0.2.0.zip
Last Stable version: 0.2.0

Demo Board: http://dev.saverct2.com
Demo Username: test
Demo Password: test

Dit forum is ook ons development forum, dus als je iets vreemds ziet, moet je niet raar op kijken.

Features
  • Voeg FTP info toe, bij het maken van een nieuw topic - 100%
  • Bewerk FTP info - 100%
  • FTP Status checker - 100%
  • FTP Info only visible when user has posted within topic 100%
  • FTP dingen alleen zichtbaar in bepaalde fora - 100%
  • Admin Configuratie paneel 100%
  • Mogelijke integratie met Thank mod - 0%
En, wat vinden jullie ervan?
Suggestie's altijd welkom :)

Voor download zie, hierboven

Geplaatst: 06 jan 2006, 11:59
door Lucky Luke
Versie 0.2.0 gereleased

Download ook beschikbaar, zie Topicstart

:)

Geplaatst: 06 jan 2006, 15:26
door XP-Rene
Hier een nieuwe install.txt, er zaten een paar foutjes in, en met deze install is ie ook EasyMod compatibel op een klein foutje na, dat ik nog niet gevonden heb:

Code: Selecteer alles

##############################################################
## MOD Title: FXP Mod
##
## MOD Author: Lucky Luke < lucas@aoe3capitol.nl > (Lucas van Dijk) http://www.aoe3capitol.nl
##             Kiwietje < yorickbouma@gmail.com > (Yorick Bouma) http://www.saverct2.com 
## MOD Description: This mod adds serverval FXP functions to your 
##                  phpBB2 board.     
##
## MOD Version: 0.2.0
##
## Installation Level: Medium
## Installation Time: 20 Minutes
## Files To Edit:
##      - includes/constants.php
##      - includes/functions.php
##      - includes/functions_post.php
##      - language/lang_english/lang_main.php
##      - posting.php
##      - viewforum.php
##      - viewtopic.php
##      - templates/subSilver/overall_header.tpl
##      - templates/subSilver/viewtopic_body.tpl
##      - templates/subSilver/posting_body.tpl
##      - templates/subSilver/viewforum_body.tpl
##      - templates/subSilver/subSilver.cfg
## Included Files:
##      - checkftp.php
##      - admin/admin_fxp.php
##      - templates/subSilver/images/red.gif
##      - templates/subSilver/images/yellow.gif
##      - templates/subSilver/images/green.gif
##      - templates/subSilver/check_ftp_body.tpl
##      - templates/subSilver/posting_ftp_body.tpl
##      - templates/subSilver/viewtopic_ftp.tpl
##      - templates/subSilver/admin/fxp_body.tpl
##
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##     None @ the moment
##############################################################
## MOD History:
##      2006-03-01 - Version 0.1.0      
##        -Intial release
##      2006-06-01 - Version 0.2.0
##        - Added admin configuration panel
##        - Fixed bug in FTP Checker  
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ SQL ]-------------------------------------------
#
CREATE TABLE phpbb_ftp (
  ftp_id MEDIUMINT(8) unsigned NOT NULL auto_increment,
  topic_id MEDIUMINT(8) unsigned NOT NULL default '0',
  ftp_ftp TEXT NOT NULL,
  ftp_ip TEXT NOT NULL,
  ftp_port text NOT NULL,
  ftp_username text NOT NULL,
  ftp_password text NOT NULL,
  ftp_path text NOT NULL,
  ftp_status varchar(255) NOT NULL default '0',
  ftp_lastcheck int(11) NOT NULL default '0',
  PRIMARY KEY  (ftp_id),
  KEY topic_id (topic_id)
) ENGINE=MyISAM;

INSERT INTO phpbb_config (config_name, config_value)
VALUES ('ftp_forum_ids', '');
INSERT INTO phpbb_config (config_name, config_value)
VALUES ('ftp_no_duplicate_ftps', '0');
INSERT INTO phpbb_config (config_name, config_value)
VALUES ('ftp_required', '0');

#
#-----[ COPY ]------------------------------------------
#
copy root/checkftp.php to checkftp.php
copy root/admin/admin_fxp.php to admin/fxp.php
copy root/templates/subSilver/admin/fxp_body.tpl to templates/subSilver/admin/fxp_body.tpl
copy root/templates/subSilver/check_ftp_body.tpl to templates/subSilver/check_ftp_body.tpl
copy root/templates/subSilver/posting_ftp_body.tpl to templates/subSilver/posting_ftp_body.tpl 
copy root/templates/subSilver/viewtopic_ftp.tpl to templates/subSilver/viewtopic_ftp.tpl
copy root/templates/subSilver/images/red.gif to templates/subSilver/images/red.gif
copy root/templates/subSilver/images/yellow.gif to templates/subSilver/images/yellow.gif
copy root/templates/subSilver/images/green.gif to templates/subSilver/images/green.gif 

#
#-----[ OPEN ]------------------------------------------
#
includes/constants.php

#
#-----[ FIND ]------------------------------------------
#
define('VOTE_USERS_TABLE', $table_prefix.'vote_voters');

#
#-----[ AFTER, ADD ]------------------------------------
#
define('FTP_TABLE', $table_prefix.'ftp');

#
#-----[ OPEN ]------------------------------------------
#
includes/functions.php

#
#-----[ FIND ]------------------------------------------
#
?>

#
#-----[ BEFORE, ADD ]-----------------------------------
#
/*
* @desc checks ftp status
* @param FTP server IP
* @param FTP server port
* @param ftp username
* @param ftp password
* @param timeout
* @return array with status code and description
*/
/*
* @desc checks ftp status
* @param FTP server IP
* @param FTP server port
* @param ftp username
* @param ftp password
* @param timeout
* @return array with status code and description
*/
function check_ftp_status($ip, $port, $username, $pass, $timeout = 10)
{
        //
        // Check vars
        //
        if(empty($port) || !ctype_digit($port))
        {
                $port = 21;
        }
        if(empty($username))
        {
                $username = "anonymous";
        }
        if(empty($pass))
        {
                $pass = "anonymous";
        }
        
        // Check ftp
        $ftp = @fsockopen($ip, $port, $errno, $errstr, $timeout);
        
        if(!is_resource($ftp))
        {
                $status = "Offline";
                $code = 666;
        }
        else
        {
                @set_time_limit($timeout);
                
                $newline = chr(10).chr(13);
                
                fwrite($ftp, "user ".$username.$newline);
                fwrite($ftp, "pass ".$pass.$newline);
                $stop = false;
                while($stop != true)
                {
                        $text = fgets($ftp, 4096);
                        $code = substr($text, 0, 3);
                        $status = substr($text, 4);
                        
                        if($code == "230" || $code =="530" || $code == "421")
                        {
                                $stop = true;
                        }
                }
                fclose($ftp);
        }
        
        return array($code, $status);
}

/*
* @desc prevents SQL injection, and applies it to the whole array
* @param the array
* @param preserve keys
*/
function array_prevent_sql_injection($array, $preserve_keys = true)
{
        if(!is_array($array))
        {
                return false;
        }
        $new_array = array();
        
        foreach($array as $key => $value)
        {
                if(is_array($value))
                {
                        $new_array[($preserve_keys ? $key : '')] = array_prevent_sql_injection($value);
                }
                else
                {
                        $new_array[($preserve_keys ? $key : '')] = str_replace("\'", "''", $value);
                }
        }
        
        return $new_array;
}

#
#-----[ OPEN ]------------------------------------------
#
includes/functions_post.php

#
#-----[ FIND ]------------------------------------------
#
function prepare_post(&$mode, &$post_data, &$bbcode_on, &$html_on, &$smilies_on, &$error_msg, &$username, &$bbcode_uid, &$subject, &$message, &$poll_title, &$poll_options, &$poll_length)

#
#-----[ IN-LINE FIND ]----------------------------------
#
, &$poll_length

#
#-----[ IN-LINE AFTER, ADD ]----------------------------
#
, &$ftp

#
#-----[ FIND ]------------------------------------------
#
global $board_config, $userdata, $lang, $phpEx, $phpbb_root_path;

#
#-----[ IN-LINE FIND ]----------------------------------
#
, $phpbb_root_path

#
#-----[ IN-LINE AFTER, ADD ]----------------------------
#
, $forum_id, $db

#
#-----[ FIND ]------------------------------------------
#
	// Check message
	if (!empty($message))
	{
		$bbcode_uid = ($bbcode_on) ? make_bbcode_uid() : '';
		$message = prepare_message(trim($message), $html_on, $bbcode_on, $smilies_on, $bbcode_uid);
	}
	else if ($mode != 'delete' && $mode != 'poll_delete') 
	{
		$error_msg .= (!empty($error_msg)) ? '<br />' . $lang['Empty_message'] : $lang['Empty_message'];
	}

#
#-----[ AFTER, ADD ]------------------------------------
#
	//
        // Handle FTP stuff
        //
        $ftp_forum_ids = explode(",", $board_config['ftp_forum_ids']);
        if(($mode == 'newtopic' && $forum_id) || ($mode == 'editpost' && $post_data['first_post']))
        {
                if($mode == 'newtopic' && (in_array($forum_id, $ftp_forum_ids))) 
                {
                        if($board_config['ftp_no_duplicate_ftps'])
                        {                        
                                $sql = "SELECT * FROM ".FTP_TABLE."
                                        WHERE ftp_ip='".$ftp['ip']."'
                                        AND ftp_port='".$ftp['port']."'
                                        AND ftp_username='".$ftp['username']."'
                                        AND ftp_password='".$ftp['password']."'
                                        AND ftp_path='".urldecode($ftp['path'])."'";
                                if(!$result = $db->sql_query($sql)) 
                                {
                                        message_die(GENERAL_ERROR, "Could not select FTP info", '', __LINE__, __FILE__, $sql);
                                }
                                if($db->sql_numrows > 0) 
                                {
                                        $error_msg .= (!empty($error_msg)) ? "<br />".$lang['ftp_exists'] : $lang['ftp_exists'];
                                }
                        }
                        if(!empty($ftp['adress']))
                        {
                                $ftp['adress'] = htmlspecialchars(trim($ftp['adress']));
                        } 
                        else 
                        {
                                if($board_config['ftp_required'])
                                {
                                        $error_msg .= (!empty($error_msg)) ? "<br />".$lang['ftp_no_adress'] : $lang['ftp_no_adress'];
                                }
                        }
                } 
                else if(in_array($forum_id, $ftp_forum_ids)) 
                {
                        if(!empty($ftp['adress']))
                        {
                                $ftp['adress'] = htmlspecialchars(trim($ftp['adress']));
                        } 
                        else 
                        {
                                if($board_config['ftp_required'])
                                {
                                        $error_msg .= (!empty($error_msg)) ? "<br />".$lang['ftp_no_adress'] : $lang['ftp_no_adress'];
                                }
                        }
                }
                if(!empty($ftp['ip']))
                {
                        $ftp['ip'] = htmlspecialchars(trim($ftp['ip']));
                }
                if(!empty($ftp['port']))
                {
                        $ftp['port'] = htmlspecialchars(trim($ftp['port']));
                }
                if(!empty($ftp['username']))
                {
                        $ftp['username'] = htmlspecialchars(trim($ftp['username']));
                }
                if(!empty($ftp['password']))
                {
                        $ftp['password'] = htmlspecialchars(trim($ftp['password']));
                }
                if(!empty($ftp['path']))
                {
                        $ftp['path'] = htmlspecialchars(trim($ftp['path']));
                }
                if(!empty($ftp['server_type']))
                {
                        $ftp['server_type'] = htmlspecialchars(trim($ftp['server_type']));
                }
        }

#
#-----[ FIND ]------------------------------------------
#
function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, &$bbcode_uid, $post_username, $post_subject, $post_message, $poll_title, &$poll_options, &$poll_length)

#
#-----[ IN-LINE FIND ]----------------------------------
#
, &$poll_length

#
#-----[ IN-LINE AFTER, ADD ]----------------------------
#
, &$ftp

#
#-----[ FIND ]------------------------------------------
#
global $userdata, $user_ip;

#
#-----[ IN-LINE FIND ]----------------------------------
#
, $user_ip

#
#-----[ IN-LINE AFTER, ADD ]----------------------------
#
, $forum_id

#
#-----[ FIND ]------------------------------------------
#
	add_search_words('single', $post_id, stripslashes($post_message), stripslashes($post_subject));

#
#-----[ AFTER, ADD ]------------------------------------
#
        //
        // Add FTP things
        //
        $ftp_forum_ids = explode(",", $board_config['ftp_forum_ids']);
        if(in_array($forum_id, $ftp_forum_ids) && !empty($ftp['adress']))
        {        
                if($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post'])) 
                {
                        $sql = "SELECT * 
                                FROM ".FTP_TABLE." 
                                WHERE topic_id=".$topic_id;
                        $sqlinsert = "INSERT INTO ".FTP_TABLE." (topic_id, ftp_ftp, ftp_ip, ftp_port, ftp_username, ftp_password, ftp_path)
                                      VALUES ('".$topic_id."', '".$ftp['adress']."', '".$ftp['ip']."', '".$ftp['port']."', '".$ftp['username']."', '".$ftp['password']."', '".$ftp['path']."')";
                        $sqlupdate = "UPDATE ".FTP_TABLE." 
                                      SET ftp_ftp='".$ftp['adress']."', 
                                          ftp_ip='".$ftp['ip']."', 
                                          ftp_port='".$ftp['port']."', 
                                          ftp_username='".$ftp['username']."', 
                                          ftp_password='".$ftp['password']."', 
                                          ftp_path='".$ftp['path']."' 
                                        WHERE topic_id=".$topic_id;
                        if (!$result = $db->sql_query($sql))
                        {
                               message_die(GENERAL_ERROR, 'Could not select FTP info', '', __LINE__, __FILE__, $sql);
                        }
                        if($mode == 'editpost') 
                        {
                                if($db->sql_numrows($result) > 0) 
                                {
                                        $sql = $sqlupdate;
                                } 
                                else 
                                {
                                        $sql = $sqlinsert;
                                }
                        } 
                        else 
                        {
                                $sql = $sqlinsert;
                        }
                        if (!$db->sql_query($sql))
                        {
                               message_die(GENERAL_ERROR, 'Could not add FTP', '', __LINE__, __FILE__, $sql);
                        }
                }
        }
        
#
#-----[ FIND ]------------------------------------------
#
                remove_search_post($post_id);
                
#
#-----[ BEFORE, ADD ]-----------------------------------
#
		if($post_data['first_post'])
		{
		      $sql = "DELETE FROM ".FTP_TABLE."
		      WHERE topic_id =".$topic_id;
		      
		      if(!$db->sql_query($sql))
		      {
		              message_die(GENERAL_ERROR, "Error in deleting post", '', __LINE__, __FILE__, $sql);
		      }
		}
		
#
#-----[ OPEN ]------------------------------------------
#
posting.php

#
#-----[ FIND ]------------------------------------------
#
			$bbcode_uid = '';
			
#
#-----[ AFTER, ADD ]------------------------------------
#
			// FTP
			$ftp['adress'] = ( !empty($HTTP_POST_VARS['ftp_ftp']) ) ? $HTTP_POST_VARS['ftp_ftp'] : '';
                        $ftp['ip'] = ( !empty($HTTP_POST_VARS['ftp_ip']) ) ? $HTTP_POST_VARS['ftp_ip'] : '';
                        $ftp['port'] = ( !empty($HTTP_POST_VARS['ftp_port']) ) ? $HTTP_POST_VARS['ftp_port'] : '';
                        $ftp['username'] = ( !empty($HTTP_POST_VARS['ftp_username']) ) ? $HTTP_POST_VARS['ftp_username'] : '';
                        $ftp['password'] = ( !empty($HTTP_POST_VARS['ftp_password']) ) ? $HTTP_POST_VARS['ftp_password'] : '';
                        $ftp['path'] = ( !empty($HTTP_POST_VARS['ftp_path']) ) ? $HTTP_POST_VARS['ftp_path'] : '';
                        
#
#-----[ FIND ]------------------------------------------
#
			prepare_post($mode, $post_data, $bbcode_on, $html_on, $smilies_on, $error_msg, $username, $bbcode_uid, $subject, $message, $poll_title, $poll_options, $poll_length);
			
#
#-----[ IN-LINE FIND ]----------------------------------
#
, $poll_length

#
#-----[ IN-LINE AFTER, ADD ]----------------------------
#
, $ftp

#
#-----[ FIND ]------------------------------------------
#
				submit_post($mode, $post_data, $return_message, $return_meta, $forum_id, $topic_id, $post_id, $poll_id, $topic_type, $bbcode_on, $html_on, $smilies_on, $attach_sig, $bbcode_uid, str_replace("\'", "''", $username), str_replace("\'", "''", $subject), str_replace("\'", "''", $message), str_replace("\'", "''", $poll_title), $poll_options, $poll_length);
				
#
#-----[ IN-LINE FIND ]----------------------------------
#
, $poll_length

#
#-----[ IN-LINE AFTER, ADD ]----------------------------
#
, array_prevent_sql_injection($ftp)

#
#-----[ FIND ]------------------------------------------
#
	'reviewbody' => 'posting_topic_review.tpl'
	
#
#-----[ AFTER, ADD ]------------------------------------
#
, 'ftpbody' => 'posting_ftp_body.tpl'

#
#-----[ FIND ]------------------------------------------
#
	$template->assign_var_from_handle('POLLBOX', 'pollbody');
}

#
#-----[ AFTER, ADD ]------------------------------------
#
if(($mode == 'editpost' && $post_data['first_post']) || $mode == 'newtopic')
{
        $forum_ids = explode(",", $board_config['ftp_forum_ids']);
        if(in_array($forum_id, $forum_ids))
        {
                if($mode != 'newtopic')
                {                
                        $sql = "SELECT *
                	FROM ".FTP_TABLE."
                	WHERE topic_id = ".$topic_id;
        	
                	if(!$result = $db->sql_query($sql))
                	{
                	       message_die(GENERAL_ERROR, "Could not select FTP info", '', __LINE__, __FILE__, $sql);
                	}                
        	
        	       $ftp_info = $db->sql_fetchrow($result);
        	       
        	       $template -> assign_vars(array(
        	               'FTP_FTP' => $ftp_info['ftp_ftp'],
                                'FTP_IP' => $ftp_info['ftp_ip'],
                                'FTP_PORT' => $ftp_info['ftp_port'],
                                'FTP_USERNAME' => $ftp_info['ftp_username'],
                                'FTP_PASSWORD' => $ftp_info['ftp_password'],
                                'FTP_PATH' => $ftp_info['ftp_path']
                        ));
        	               
        	}
        	
        	$template -> assign_vars(array(
        	        'L_ADD_FTP' => $lang['Add_ftp'],
                        'L_ADD_FTP_EXPLAIN' => $lang['Add_ftp_explain'],
                        'L_FTP_FTP' => $lang['ftp_ftp'],
                        'L_FTP_IP' => $lang['ftp_ip'],
                        'L_FTP_PORT' => $lang['ftp_port'],
                        'L_FTP_USERNAME' => $lang['ftp_username'],
                        'L_FTP_PASSWORD' => $lang['ftp_password'],
                        'L_FTP_PATH' => $lang['ftp_path']
                ));
                
                $template->assign_var_from_handle('FTPBOX', 'ftpbody');
        }
}

#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php

#
#-----[ FIND ]------------------------------------------
#
//
// Does this topic contain a poll?
//

#
#-----[ BEFORE, ADD ]-----------------------------------
#
//
// Does this topic contain FTP info?
//
$ftp_forum_ids = explode(",", $board_config['ftp_forum_ids']);

if(in_array($forum_id, $ftp_forum_ids))
{
        $sql = "SELECT *
        FROM ".FTP_TABLE."
        WHERE topic_id = ".$topic_id;
        
        if(!$result = $db->sql_query($sql))
        {
                message_die(GENERAL_ERROR, 'error_ftp_info', '', __LINE__, __FILE__, $sql);
        }
        
        if($ftp_row = $db->sql_fetchrow($result))
        {
                $template -> set_filenames(array(
                        'ftpbody' => 'viewtopic_ftp.tpl'
                ));
                
                $can_view = FALSE;
                if($userdata['session_logged_in']) 
                {                        
                        $sql = "SELECT poster_id, topic_id
                        FROM " . POSTS_TABLE . "
                        WHERE topic_id = $topic_id
                        AND poster_id = " . $userdata['user_id'];
                        $result2 = $db->sql_query($sql);
                        $can_view = $db->sql_numrows($result2) ? TRUE : FALSE;
                }
                
                $error_code = substr($ftp_row['ftp_status'], 0, 3);
                
                switch($error_code)
                {
                        case 421:
                        case 530:
                        case 500:
                                $ftp_img = $images['ftp_yellow'];
                                break;
                        case 230:
                                $ftp_img = $images['ftp_green'];
                                break;
                        default:
                                $ftp_img = $images['ftp_red'];
                                break;
                }
                
                $template -> assign_vars(array(
                        'L_FTP_STATUS' => $lang['ftp_status'],
                        'L_FTP_CHECK_NOW' => $lang['ftp_check_now'],
                        'L_FTP_LAST_CHECK' => $lang['ftp_last_check'],
                        
                        'FTP_STATUS' => $ftp_row['ftp_status'],
                        'FTP_LAST_CHECK' => create_date($board_config['default_dateformat'], $ftp_row['ftp_lastcheck'], $board_config['board_timezone']),
                        'FTP_IMG' => '<img src="'.$ftp_img.'" border="0" alt="" />',
                ));
                
                if($can_view)
                {
                        $template -> assign_block_vars('switch_ftp_true', array());
                        
                        $template -> assign_vars(array(
                                'L_FTP_INFO' => $lang['ftp_info'],
                                'L_FTP_FTP' => $lang['ftp_ftp'],
                                'L_FTP_IP' => $lang['ftp_ip'],
                                'L_FTP_PORT' => $lang['ftp_port'],
                                'L_FTP_USERNAME' => $lang['ftp_username'],
                                'L_FTP_PASSWORD' => $lang['ftp_password'],
                                'L_FTP_PATH' => $lang['ftp_path'],
                                
                                'FTP_FTP' => $ftp_row['ftp_ftp'],
                                'FTP_IP' => $ftp_row['ftp_ip'],
                                'FTP_PORT' => $ftp_row['ftp_port'],
                                'FTP_USERNAME' => $ftp_row['ftp_username'],
                                'FTP_PASSWORD' => $ftp_row['ftp_password'],
                                'FTP_PATH' => $ftp_row['ftp_path'],
                                
                                'U_CHECK_NOW' => append_sid('checkftp.'.$phpEx.'?'.POST_TOPIC_URL.'='.$topic_id),
                        ));
                }
                else
                {
                        $template -> assign_block_vars('switch_ftp_false', array());
                        
                        $template -> assign_vars(array(
                                'FTP_ERRORTEXT' => $lang['ftp_errortext'],
                                'L_FTP_INFO' => $lang['ftp_info'],
                        ));
                }
                
                $template -> assign_var_from_handle('FTP_DISPLAY', 'ftpbody');
        }
}

#
#-----[ OPEN ]------------------------------------------
#
viewforum.php
	
#
#-----[ FIND ]------------------------------------------
#
	'L_AUTHOR' => $lang['Author'],
	
#
#-----[ AFTER, ADD ]------------------------------------
#
        'L_FTP_STATUS' => $lang['ftp_status2'],

#
#-----[ FIND ]------------------------------------------
#
        for($i = 0; $i < $total_topics; $i++)

#
#-----[ BEFORE, ADD ]-----------------------------------
#
	$show_ftp = false;
	
#
#-----[ FIND ]------------------------------------------
#
		$row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
		
#
#-----[ AFTER, ADD ]------------------------------------
#
                //
                // Show FTP status Img on viewforum page
                //
                $ftp_forum_ids = explode(",", $board_config['ftp_forum_ids']);
                $show_status = false;
                $ftp_img = '';
                $last_check = '';
                if(in_array($forum_id, $ftp_forum_ids))
                {
                        $show_status = true;
                        $show_ftp = true;
                        $sql = "SELECT *
                                FROM ".FTP_TABLE."
                                WHERE topic_id = ".$topic_id;
                        
                        if(!$result = $db->sql_query($sql))
                        {
                                message_die(GENERAL_ERROR, "Could not get FTP Info", '', __LINE__, __FILE__, $sql);
                        }
                        
                        if($ftprow = $db->sql_fetchrow($result))
                        {
                                $errorcode = substr($ftprow['ftp_status'], 0, 3);
                                $last_check = create_date($board_config['default_dateformat'], $ftprow['ftp_status'], $board_config['board_timezone']);
                                
                                switch($errorcode)
                                {
                                        case 421:
                                        case 530:
                                                $ftp_img = $images['ftp_yellow'];
                                                break;
                                        case 230:
                                                $ftp_img = $images['ftp_green'];
                                                break;
                                        default:
                                                $ftp_img = $images['ftp_red'];
                                                break;
                                }
                        }
                }
                
#
#-----[ FIND ]------------------------------------------
#
			'LAST_POST_IMG' => $last_post_url,
			
#
#-----[ AFTER, ADD ]------------------------------------
#
                        'FTP_IMG' => !empty($ftp_img) ? '<a href="#" onclick="NewWindow(\''.append_sid('checkftp.php?'.POST_TOPIC_URL.'='.$topic_id).'\',\'checkftp\',\'550\',\'150\',\'center\',\'front\');return false;"><img src="'.$ftp_img.'" alt="'.$lang['ftp_last_check'].': '.$last_check.'" title="'.$lang['ftp_last_check'].': '.$last_check.'" border="0" /></a>' : '&nbsp;',
                        
#
#-----[ FIND ]------------------------------------------
#
			'U_VIEW_TOPIC' => $view_topic_url)
		);
		
#
#-----[ AFTER, ADD ]------------------------------------
#
		if($show_status)
        	{
        	       $template -> assign_block_vars('topicrow.switch_show_status', array());
        	}
        	
#
#-----[ FIND ]------------------------------------------
#
	$topics_count -= $total_announcements;
	
#
#-----[ BEFORE, ADD ]-----------------------------------
#
	if($show_ftp)
	{
	       $template -> assign_block_vars('switch_show_ftp', array());
	}
	else
	{
	       $template -> assign_block_vars('switch_hide_ftp', array());
	}

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/subSilver.cfg

#
#-----[ FIND ]------------------------------------------
#
$images['voting_graphic'][4] = "$current_template_images/voting_bar.gif";

#
#-----[ AFTER, ADD ]------------------------------------
#
$images['ftp_red'] = "$current_template_images/red.gif";
$images['ftp_yellow'] = "$current_template_images/yellow.gif";
$images['ftp_green'] = "$current_template_images/green.gif";

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/overall_header.tpl

#
#-----[ FIND ]------------------------------------------
#
</head>

#
#-----[ BEFORE, ADD ]-----------------------------------
#
<script language="Javascript" type="text/javascript">
 <!--
var win=null;
function NewWindow(mypage,myname,w,h,pos,infocus)
{
        if(pos=="random")
        {
                myleft = (screen.width) ? Math.floor(Math.random()*(screen.width-w)) : 100; 
                mytop = (screen.height) ? Math.floor(Math.random()*((screen.height-h)-75)) : 100;
        }
        if(pos=="center")
        {
                myleft = (screen.width) ? (screen.width-w) / 2 : 100;
                mytop = (screen.height) ? (screen.height-h) / 2 : 100;
        }
        else if((pos!='center' && pos!="random") || pos==null)
        {
                myleft = 0;
                mytop = 20;
        }
        settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no";
        win=window.open(mypage,myname,settings);
        win.focus();
}
// -->
</script>

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/posting_body.tpl

#
#-----[ FIND ]------------------------------------------
#
{POLLBOX}

#
#-----[ BEFORE, ADD ]-----------------------------------
#
{FTPBOX}

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/viewtopic_body.tpl

#
#-----[ FIND ]------------------------------------------
#
{POLL_DISPLAY}

#
#-----[ AFTER, ADD ]-----------------------------------
#
{FTP_DISPLAY}

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/viewforum_body.tpl

#
#-----[ FIND ]------------------------------------------
#
	  <th colspan="2" align="center" height="25" class="thCornerL" nowrap="nowrap">&nbsp;{L_TOPICS}&nbsp;</th>

#
#-----[ AFTER, ADD ]------------------------------------
#
	  <!-- BEGIN switch_show_ftp -->
	  <th width="50" align="center" class="thTop" nowrap="nowrap">&nbsp;{L_FTP_STATUS}&nbsp;</th>
	  <!-- END switch_show_ftp -->
	  
#
#----[ FIND ]-------------------------------------------
#
	  <td class="row2" align="center" valign="middle"><span class="postdetails">{topicrow.REPLIES}</span></td>
	  
#
#-----[ BEFORE, ADD ]-----------------------------------
#
	  <!-- BEGIN switch_show_status -->
	  <td class="row3" align="center" valign="middle">{topicrow.FTP_IMG}</td>
	  <!-- END switch_show_status -->
	  
#
#-----[ FIND ]------------------------------------------
#
	<!-- END switch_no_topics -->
	
#
#-----[ AFTER, ADD ]------------------------------------
#
	<!-- BEGIN switch_hide_ftp -->
	<tr> 
	  <td class="catBottom" align="center" valign="middle" colspan="6" height="28"><span class="genmed">{L_DISPLAY_TOPICS}:&nbsp;{S_SELECT_TOPIC_DAYS}&nbsp; 
		<input type="submit" class="liteoption" value="{L_GO}" name="submit" />
		</span></td>
	</tr>
	<!-- END switch_hide_ftp -->
	<!-- BEGIN switch_show_ftp -->
	<tr> 
	  <td class="catBottom" align="center" valign="middle" colspan="7" height="28"><span class="genmed">{L_DISPLAY_TOPICS}:&nbsp;{S_SELECT_TOPIC_DAYS}&nbsp; 
		<input type="submit" class="liteoption" value="{L_GO}" name="submit" />
		</span></td>
	</tr>
	<!-- END switch_show_ftp -->
	
#
#-----[ DIY INSTRUCTIONS ]------------------------------
#
Check if the colspan matches with your template. The colspan in the 
<!-- BEGIN switch_show_ftp -->
...
<!-- END switch_show_ftp -->

block needs te be 1 higer then in the

<!-- BEGIN switch_hide_ftp -->
...
<!-- END switch_hide_ftp -->

block.

#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------
#
# EoM
Hier de laatste foutmelding van EasyMod:

Code: Selecteer alles

'Do it yourself' instructions need to be executed by you manually, EasyMOD can not perform these actions 
Check if the colspan matches with your template. The colspan in the 
<!-- BEGIN switch_show_ftp --> 
... 
<!-- END switch_show_ftp --> 
block needs te be 1 higer then in the 
<!-- BEGIN switch_hide_ftp --> 
... 
<!-- END switch_hide_ftp --> 
block.  

Geplaatst: 06 jan 2006, 15:28
door YorickB
Dat is geen foutmelding :) Hij vertelt alleen wat wij hem hebben laten zeggen :)

Geplaatst: 07 jan 2006, 09:58
door Lucky Luke
Kheb btw een nieuwe versie van mod_install.txt geupped, nu MET language veranderingen :mrgreen:

Fxp Mod

Geplaatst: 08 jan 2006, 12:47
door Duifje
Hej Lucky Luke,

Ik heb geprobeerd je [BETA] Fxp Mod uit te testen maar ik krijg hem niet aan de praat.

Zou jij mij mischien de bestanden willen geven van subsilver met de mod er al ingebouwd. Het test forum want ik zou hem graag even willen testenn.

Geplaatst: 08 jan 2006, 21:20
door Lucky Luke
Hoezo krijg je hem niet aan de praat?

Geplaatst: 08 jan 2006, 22:40
door Duifje
Parse error: parse error, unexpected T_STRING in c:\wamp\www\includes\functions_post.php on line 411

Krijg ik zou je functions_post.php even beschikbaar willen stellen op het forum zo kan ik zien wat ik fot heb gedaan want ik heb alles 100% uitgevoerd naar mijn mening. :bier:

Geplaatst: 08 jan 2006, 23:48
door YorickB
Ik heb het even voor je gedaan, ook goed :D?

http://dev.saverct2.com/includes/functions_post.phps

Suc6 ermee :bier: en anders horen we het wel :bier:

Geplaatst: 09 jan 2006, 15:08
door Duifje
Ja bedankt, YorickB
Nu kan ik tenminste posten maar heb nog een kleine fout.

Warning: Cannot modify header information - headers already sent by (output started at c:\wamp\www\includes\functions_post.php:990) in c:\wamp\www\includes\page_header.php on line 483

Warning: Cannot modify header information - headers already sent by (output started at c:\wamp\www\includes\functions_post.php:990) in c:\wamp\www\includes\page_header.php on line 485

Warning: Cannot modify header information - headers already sent by (output started at c:\wamp\www\includes\functions_post.php:990) in c:\wamp\www\includes\page_header.php on line 486

Geplaatst: 09 jan 2006, 15:11
door Duifje
Heel vaag het posten werkte wel, maar nu heb ik deze fouten er gratis bij gekregen. :lol:

Warning: Cannot modify header information - headers already sent by (output started at c:\wamp\www\includes\functions_post.php:990) in c:\wamp\www\includes\sessions.php on line 370

Warning: Cannot modify header information - headers already sent by (output started at c:\wamp\www\includes\functions_post.php:990) in c:\wamp\www\includes\sessions.php on line 371

Warning: Cannot modify header information - headers already sent by (output started at c:\wamp\www\includes\functions_post.php:990) in c:\wamp\www\includes\page_header.php on line 483

Kan je ook even page_header.php geven.
Warning: Cannot modify header information - headers already sent by (output started at c:\wamp\www\includes\functions_post.php:990) in c:\wamp\www\includes\page_header.php on line 485

Warning: Cannot modify header information - headers already sent by (output started at c:\wamp\www\includes\functions_post.php:990) in c:\wamp\www\includes\page_header.php on line 486

Geplaatst: 09 jan 2006, 15:31
door Paul

Code: Selecteer alles

                        $sql = "SELECT * 
                                FROM ".FTP_TABLE." 
                                WHERE topic_id=".$topic_id;
                        $sqlinsert = "INSERT INTO ".FTP_TABLE." (topic_id, ftp_ftp, ftp_ip, ftp_port, ftp_username, ftp_password, ftp_path)
                                      VALUES ('".$topic_id."', '".$ftp['adress']."', '".$ftp['ip']."', '".$ftp['port']."', '".$ftp['username']."', '".$ftp['password']."', '".$ftp['path']."')";
                        $sqlupdate = "UPDATE ".FTP_TABLE." 
                                      SET ftp_ftp='".$ftp['adress']."', 
                                          ftp_ip='".$ftp['ip']."', 
                                          ftp_port='".$ftp['port']."', 
                                          ftp_username='".$ftp['username']."', 
                                          ftp_password='".$ftp['password']."', 
                                          ftp_path='".$ftp['path']."' 
                                        WHERE topic_id=".$topic_id;
                        if (!$result = $db->sql_query($sql))
                        {
                               message_die(GENERAL_ERROR, 'error_ftp_info', '', __LINE__, __FILE__, $sql);
                        }
                        if($mode == 'editpost') 
                        {
                                if($db->sql_numrows($result) > 0) 
                                {
                                        $sql = $sqlupdate;
                                } 
                                else 
                                {
                                        $sql = $sqlinsert;
                                }
                        } 
                        else 
                        {
                                $sql = $sqlinsert;
                        }
Kan je beter dit van maken:

Code: Selecteer alles

                       $sqlinsert = "INSERT INTO ".FTP_TABLE." (topic_id, ftp_ftp, ftp_ip, ftp_port, ftp_username, ftp_password, ftp_path)
                                      VALUES ('".$topic_id."', '".$ftp['adress']."', '".$ftp['ip']."', '".$ftp['port']."', '".$ftp['username']."', '".$ftp['password']."', '".$ftp['path']."')";
                        $sqlupdate = "UPDATE ".FTP_TABLE." 
                                      SET ftp_ftp='".$ftp['adress']."', 
                                          ftp_ip='".$ftp['ip']."', 
                                          ftp_port='".$ftp['port']."', 
                                          ftp_username='".$ftp['username']."', 
                                          ftp_password='".$ftp['password']."', 
                                          ftp_path='".$ftp['path']."' 
                                        WHERE topic_id=".$topic_id;
                        
                        if($mode == 'editpost') 
                        {
                        $sql = "SELECT * 
                                FROM ".FTP_TABLE." 
                                WHERE topic_id=".$topic_id;
                                if (!$result = $db->sql_query($sql))
                                {
                                      message_die(GENERAL_ERROR, 'error_ftp_info', '', __LINE__, __FILE__, $sql);
                                }
                                if($db->sql_numrows($result) > 0) 
                                {
                                        $sql = $sqlupdate;
                                } 
                                else 
                                {
                                        $sql = $sqlinsert;
                                }
                        } 
                        else 
                        {
                                $sql = $sqlinsert;
                        }
Dat is dan namelijk weer een query minder ;)(Rest van de code nog nie bekeken :))

Geplaatst: 09 jan 2006, 16:31
door Lucky Luke
ah das wel een goede :P

Geplaatst: 21 jan 2006, 16:22
door Lucky Luke
Duifje schreef:Heel vaag het posten werkte wel, maar nu heb ik deze fouten er gratis bij gekregen. :lol:

Warning: Cannot modify header information - headers already sent by (output started at c:\wamp\www\includes\functions_post.php:990) in c:\wamp\www\includes\sessions.php on line 370

Warning: Cannot modify header information - headers already sent by (output started at c:\wamp\www\includes\functions_post.php:990) in c:\wamp\www\includes\sessions.php on line 371

Warning: Cannot modify header information - headers already sent by (output started at c:\wamp\www\includes\functions_post.php:990) in c:\wamp\www\includes\page_header.php on line 483

Kan je ook even page_header.php geven.
Warning: Cannot modify header information - headers already sent by (output started at c:\wamp\www\includes\functions_post.php:990) in c:\wamp\www\includes\page_header.php on line 485

Warning: Cannot modify header information - headers already sent by (output started at c:\wamp\www\includes\functions_post.php:990) in c:\wamp\www\includes\page_header.php on line 486
Open het bestand functions_post.php
ga naar het einde van het bestand.
zet je tekst cursor ACHTER ?>
houd de delete knop zo'n 5-10 seconden in.

save :)

Geplaatst: 12 mar 2006, 15:12
door Sevy
Enige vooruitgang met deze mod?

Geplaatst: 06 nov 2006, 21:23
door Sevy
Kan iemand de mod terug uploaden? De link is down :?

Geplaatst: 09 nov 2006, 18:50
door Bee
kwaksalver schreef:Kan iemand de mod terug uploaden? De link is down :?
Hij werkt weer hoor :wink:

Re: [BETA] FXP Mod

Geplaatst: 14 jun 2007, 22:22
door Duifje
Sorry voor de 'schop' maar kan iemand de fxp mod nog even online zetten.
Ik heb 1 klein probleempje met de lay-out maar heb jammer genoeg niet meer de bestanden.

Sorry voor het ongemak maar vindt het z'n gaafe mod dat ik hem nog steeds naar 2 jaar niet vergeten ben. ;)