[ABD] Advanced BBcode box 3

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
Locked
calproye
Registered User
Posts: 108
Joined: Wed Oct 03, 2007 5:06 pm
Location: Madrid - ES
Contact:

Re: [DEV] Advanced BBcode box 3

Post by calproye »

Leviatan, I've got a problem :oops: . I installed all patches and I get this error:

Parse error: syntax error, unexpected T_VARIABLE in /........./includes/acp/acp_abbcodes.php on line 79

My acp_abbcodes.php wiht all pacthes aplied is this:

Code: Select all

<?php
/**
* 
* @package: phpBB3 :: Advanced BBCode box 3 -> acp
* @version: $Id: acp_abbcode.php, v 1.0.9 2008/05/01 05:01:00 leviatan21 Exp $
* @copyright: leviatan21 < info@mssti.com > (Gabriel) http://www.mssti.com/phpbb3/
* @license: http://opensource.org/licenses/gpl-license.php GNU Public License
* @author: leviatan21 - http://www.phpbb.com/community/memberlist.php?mode=viewprofile&u=345763
**/

/**
* @ignore
**/
if (!defined('IN_PHPBB'))
{
	exit;
}

/**
* @package acp
**/
class acp_abbcodes
{
	var $u_action;
	var $u_back;
	var $new_config;
	var $submit;
	var $dir;
	
	function main($id, $mode)
	{
		global $db, $user, $auth, $template, $cache;
		global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
		
		$user->add_lang(array('acp/styles', 'mods/acp_abbcodes', 'mods/abbcode'));
		
		// Set up general vars
		$action				= request_var('action', '');
		$bbcode_id			= request_var('bbcode_id', '');
		
		$this->tpl_name		= 'acp_abbcodes';
		$this->page_title	= 'ACP_ABBCODES';
		$form_key			= 'acp_abbcodes';
		
		add_form_key($form_key);
		
		$this->u_back 		= $this->u_action;
		$this->submit		= (isset($_POST['submit'])) ? true : false;
		$abbc3_root_path	= ( $phpbb_admin_path ) ? $phpbb_admin_path : $phpbb_root_path ;
		$this->dir 			= $phpbb_root_path . $config['ABBC3_PATH'] ;
		
		// Execute overall actions
		switch ($mode)
		{
			case 'settings':
				
				switch ($action)
				{
					case 'purge_cache':
						$this->purge_cache($id, $mode, $action);
						break;
				}
				$this->abbc3_details( );
				break;
				
			case 'bbcodes'	:
				switch ($action)
				{
					case 'move_up':
					case 'move_down':
						
						// Get current order id...
						$sql = "SELECT bbcode_order as current_order
							FROM " . BBCODES_TABLE . "
							WHERE bbcode_id = $bbcode_id";
						$result = $db->sql_query($sql)
						
						
						$current_order = (int) $db->sql_fetchfield('current_order');
						$db->sql_freeresult($result);
						

			                  if ( ($current_order == 0 && $action == 'move_up') || ($current_order <= 5 && $action == 'move_up') )
                  			{
			                     $bbcode_id = null;
                  			   break;
			                  }

						
						// on move_down, switch position with next order_id...
						// on move_up, switch position with previous order_id...
						$switch_order_id = ($action == 'move_down') ? $current_order + 1 : $current_order - 1;
						
						$sql = "UPDATE " . BBCODES_TABLE . "
							SET bbcode_order = $current_order
							WHERE bbcode_order = $switch_order_id
								AND bbcode_id <> $bbcode_id";
						$db->sql_query($sql);
						
						// Only update the other entry too if the previous entry got updated
						if ($db->sql_affectedrows())
						{
							$sql = "UPDATE " . BBCODES_TABLE . "
								SET bbcode_order = $switch_order_id
								WHERE bbcode_order = $current_order
									AND bbcode_id = $bbcode_id";
							$db->sql_query($sql);
						}
						$bbcode_id = null;
					// no break;
				}
				$this->bbcodes_edit($id, $mode, $action, $bbcode_id);
				break;
		}
	}

	/**
	* Build Frontend with supplied options
	**/
	function abbc3_details( )
	{
		global $db, $user, $template, $phpbb_root_path, $config;
		
		$this->page_title = 'ABBCODES_SETINGS';
		
		$display_vars = array(
			'title'	=> 'ABBCODES_SETINGS',
			'lang'	=> array('mods/abbcode', 'mods/acp_abbcodes', 'acp/attachments'),
			'vars'	=> array(
				'legend1'				=> 'GENERAL_OPTIONS',
				'ABBC3_MOD'				=> array('lang' => 'ABBCODES_DISABLE',			'validate' => 'bool',	'type' => 'radio:yes_no',	'explain' => true),
				'ABBC3_BG'				=> array('lang' => 'ABBCODES_BG',				'validate' => 'string',	'type' => 'custom',			'function' => 'image_select', 'params' => array($this->dir . '/images/bg', '{CONFIG_VALUE}', 'config[ABBC3_BG]', true, $this->u_action), 'explain' => true),
				'ABBC3_TAB'				=> array('lang' => 'ABBCODES_TAB',				'validate' => 'bool',	'type' => 'radio:yes_no',	'explain' => true, 'append' => '&nbsp;&nbsp;<span>[ <img src="' . $this->dir . '/images/dots.gif" alt="" /> ]</span>'),
				'ABBC3_BOXRESIZE'		=> array('lang' => 'ABBCODES_BOXRESIZE',		'validate' => 'bool',	'type' => 'radio:yes_no',	'explain' => true),
				
				'legend2'				=> 'CAT_IMAGES',
				'ABBC3_RESIZE'			=> array('lang' => 'ABBCODES_RESIZE',			'validate' => 'bool', 	'type' => 'radio:yes_no',	'explain' => true),
				'ABBC3_RESIZE_METHOD'	=> array('lang' => 'ABBCODES_RESIZE_METHOD',	'validate' => 'string',	'type' => 'custom',			'function' => 'method_select', 'params' => array('{CONFIG_VALUE}', 'config[ABBC3_RESIZE_METHOD]'), 'explain' => true),
				'ABBC3_GREYBOX'			=> array('lang' => 'ABBCODES_GREYBOX',			'validate' => 'bool',	'type' => 'radio:yes_no',	'explain' => true, 'append' => '&nbsp;&nbsp;<span>[ <a href="http://www.orangoo.com/labs/GreyBox/" target="_blank">GreyBox</a> ]</span>'),
				
				'ABBC3_MAX_IMG_WIDTH'   => array('lang' => 'ABBCODES_MAX_IMAGE_WIDTH',   'validate' => 'int',   'type' => 'text:7:15',      'explain' => true, 'append' => ' px'),
		            'ABBC3_MAX_IMG_HEIGHT'   => array('lang' => 'ABBCODES_MAX_IMAGE_HEIGHT',   'validate' => 'int',   'type' => 'text:7:15',      'explain' => true, 'append' => ' px'),
				
				'ABBC3_MAX_THUM_WIDTH'	=> array('lang' => 'ABBCODES_MAX_THUMB_WIDTH',	'validate' => 'int',	'type' => 'text:7:15',		'explain' => true, 'append' => ' px'),
				
				'legend3'				=> 'ABBC3_BBVIDEO_TAG',
				'ABBC3_VIDEO'			=> array('lang' => 'ABBCODES_VIDEO_SIZE',		'validate' => 'int',	'type' => 'dimension:3:4',	'explain' => true, 'append' => ' px'),
				'ABBC3_VIDEO_width'		=> false,
				'ABBC3_VIDEO_height'	=> false,
				
				'legend4'				=> 'ABBC3_UPLOAD_MOVER',
				'upload_path'			=> array('lang'	=> 'UPLOAD_DIR',										'type' => 'string',			'explain' => true, 'append' => ' ' . $config['upload_path'] . '/'),
				'ABBC3_UPLOAD_MAX_SIZE'	=> array('lang'	=> 'ATTACH_MAX_FILESIZE',		'validate' => 'int',	'type' => 'text:7:15',		'explain' => true, 'append' => ' ' . $user->lang['BYTES']),
				'ABBC3_UPLOAD_EXTENSION'=> array('lang'	=> 'ABBC3_UPLOAD_EXTENSION',	'validate' => 'string',	'type' => 'textarea:5:40',	'explain' => true),
			)
		);
		
		if (isset($display_vars['lang']))
		{
			$user->add_lang($display_vars['lang']);
		}
		
		$this->new_config = $config;
		$cfg_array = (isset($_REQUEST['config'])) ? request_var('config', array('' => '')) : $this->new_config;
		$error = array();
		
		// We validate the complete config if whished
		validate_config_vars($display_vars['vars'], $cfg_array, $error);
		
		// Do not write values if there is an error
		if (sizeof($error))
		{
			$this->submit = false;
		}
		
		// We go through the display_vars to make sure no one is trying to set variables he/she is not allowed to...
		foreach ($display_vars['vars'] as $config_name => $null)
		{
			if (!isset($cfg_array[$config_name]) || strpos($config_name, 'legend') !== false)
			{
				continue;
			}
			
			$this->new_config[$config_name] = $config_value = $cfg_array[$config_name];
			
			if ($this->submit)
			{
				$this->set_config($config_name, $config_value);
			}
		}
		
		if ($this->submit)
		{
			add_log('admin', 'LOG_CONFIG_ABBCODES');
			
			if (!sizeof($error))
			{
				trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
			}
			else
			{
				trigger_error($user->lang['LOG_CONFIG_ABBCODES_ERROR'] . adm_back_link($this->u_action), E_USER_WARNING);
			}
		}
		
		$template->assign_vars(array(
			'S_EDIT'			=> true,
			
			'L_TITLE_EDIT'		=> $user->lang['ABBCODES_SETINGS'],
			'L_TITLE_EXPLAIN'	=> $user->lang['ABBCODES_SETINGS_EXPLAIN'],
			'ICON_BASEDIR'		=> $this->dir,
			
			'S_ERROR'			=> (sizeof($error)) ? true : false,
			'ERROR_MSG'			=> implode('<br />', $error),
			
			'S_FOUNDER'			=> ($user->data['user_type'] == USER_FOUNDER) ? true : false,
			'NO_FOUNDER'		=> $user->lang['NO_AUTH_OPERATION'],
			
			'U_ABBC3'			=> $user->lang['ABBC3_HELP_ABOUT'],
			'U_ACTION'			=> $this->u_action,
		));
		
		// Output relevant page
		foreach ($display_vars['vars'] as $config_key => $vars)
		{
			if (!is_array($vars) && strpos($config_key, 'legend') === false)
			{
				continue;
			}
			
			if (strpos($config_key, 'legend') !== false)
			{
				$template->assign_block_vars('options', array(
					'S_LEGEND'		=> true,
					'LEGEND'		=> ((isset($user->lang[$vars])) ? $user->lang[$vars] : $vars ),
				));
				continue;
			}
			
			$type = explode(':', $vars['type']);
			
			$l_explain = '';
			if ($vars['explain'] && isset($vars['lang_explain']))
			{
				$l_explain = (isset($user->lang[$vars['lang_explain']])) ? $user->lang[$vars['lang_explain']] : $vars['lang_explain'];
			}
			else if ($vars['explain'])
			{
				$l_explain = (isset($user->lang[$vars['lang'] . '_EXPLAIN'])) ? $user->lang[$vars['lang'] . '_EXPLAIN'] : '';
			}
			$template->assign_block_vars('options', array(
				'KEY'			=> $config_key,
				'TITLE'			=> (isset($user->lang[$vars['lang']])) ? $user->lang[$vars['lang']] : $vars['lang'],
				'S_EXPLAIN'		=> $vars['explain'],
				'TITLE_EXPLAIN'	=> $l_explain,
				'CONTENT'		=> build_cfg_template($type, $config_key, $this->new_config, $config_key, $vars),
				)
			);
			unset($display_vars['vars'][$config_key]);
		}
	}

	/**
	* Set config value. Creates missing config entry.
	**/
	function set_config($config_name, $config_value, $is_dynamic = true)
	{
		global $db, $cache, $config;
		
		$sql = 'UPDATE ' . CONFIG_TABLE . "
				SET config_value = '" . $db->sql_escape($config_value) . "'
				WHERE config_name = '" . $db->sql_escape($config_name) . "'";
		$db->sql_query($sql);
		
		if (!$db->sql_affectedrows() && !isset($config[$config_name]))
		{
			$sql = 'INSERT INTO ' . CONFIG_TABLE . ' ' . $db->sql_build_array('INSERT', array(
					'config_name'	=> $config_name,
					'config_value'	=> $config_value,
					'is_dynamic'	=> ($is_dynamic) ? 1 : 0));
			$db->sql_query($sql);
		}
		
		$config[$config_name] = $config_value;
		
		if (!$is_dynamic)
		{
			$cache->destroy('config');
		}
	}

	/**
	* Enter description here...
	**/
	function purge_cache($id, $mode, $action)
	{
		global $user, $auth, $phpbb_admin_path, $phpEx;
		
		if ((int) $user->data['user_type'] !== USER_FOUNDER)
		{
			trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
		}
		
		if (confirm_box(true))
		{
			global $cache;
			$cache->purge();
			
			// Clear permissions
			$auth->acl_clear_prefetch();
			cache_moderators();
			
			add_log('admin', 'LOG_PURGE_CACHE');
			
			trigger_error( $user->lang['LOG_PURGE_CACHE'] . adm_back_link($this->u_action));
		}
		else
		{
			confirm_box(false, $user->lang['PURGE_CACHE_CONFIRM'], build_hidden_fields(array(
				'i'			=> $id,
				'mode'		=> $mode,
				'action'	=> $action,
			)),'confirm_body.html', "{$phpbb_admin_path}adm/index.$phpEx?i=$id&mode=$mode" );
		}
	}

	/**
	* Show/edit bbcodes
	**/
	function bbcodes_edit($id, $mode, $action, $bbcode = '')
	{
		global $user, $db, $template, $config;
		
		$user->add_lang(array('acp/posting', 'mods/acp_abbcodes', 'mods/abbcode'));
		
		// Is this ABBC3 is disables on this style
		if ( !$config['ABBC3_MOD'] )
		{
			trigger_error($user->lang['ABBCODES_MOD_DISABLE'] . adm_back_link($this->u_action), E_USER_WARNING);
		}
		
		$img_spacer = 'spacer.gif';
		$img_noimg  = 'no_image.png';
		
		if ( $this->submit && $bbcode )
		{
			// Get items to create/modify
			$abbcode_name		= (isset($_POST['name']))				? request_var('name', array('' => '')) : array();
			$display_on_posting = (isset($_POST['display_on_posting']))	? request_var('display_on_posting', array('' => 0)) : array();
			$display_on_pm		= (isset($_POST['display_on_pm']))		? request_var('display_on_pm', array('' => 0)) : array();
			$display_on_sig		= (isset($_POST['display_on_sig']))		? request_var('display_on_sig', array('' => 0)) : array();
			$bbcode_image		= utf8_normalize_nfc(request_var('image', array('' => ''), true));
			
			$bbcode_sql = array(
				'display_on_posting'	=> (isset( $display_on_posting[$bbcode])) ? 1 : 0,
				'display_on_pm'			=> (isset( $display_on_pm[$bbcode])) ? 1 : 0,
				'display_on_sig'		=> (isset( $display_on_sig[$bbcode])) ? 1 : 0,
				'bbcode_image'			=> (isset( $bbcode_image[$bbcode])) ? $bbcode_image[$bbcode] : '',
			);
			
			// Fix for breack line?
			if ( substr($abbcode_name[$bbcode],0,5) == 'break')
			{
				$bbcode_sql['bbcode_image'] = $img_spacer;
			}
			
			$sql = "UPDATE " . BBCODES_TABLE . "
				SET " . $db->sql_build_array('UPDATE', $bbcode_sql) . "
				WHERE bbcode_id = " . $bbcode;
			$result = $db->sql_query($sql);
			
			if ($result )
			{
				trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
			}
			else
			{
				trigger_error($user->lang['LOG_CONFIG_ABBCODES_ERROR'] . adm_back_link($this->u_action), E_USER_WARNING);
			}
			$bbcode = '';
		}
		
		$error = array();
		
		$sql = "SELECT abbcode, bbcode_order, bbcode_id, bbcode_tag, bbcode_helpline, bbcode_image, display_on_posting, display_on_pm, display_on_sig 
				FROM " . BBCODES_TABLE . " 
				ORDER BY bbcode_order";
		$result = $db->sql_query($sql);
		
		$template->assign_vars(array(
			'S_BBCODES'			=> true,
			
			'L_TITLE_BBCODES'	=> $user->lang['ABBCODES_CONFIG'],
			'L_EXPLAIN_BBCODES'	=> $user->lang['ABBCODES_CONFIG_EXPLAIN'],
			
			'S_BBCODE_EDIT'		=> ( $bbcode ) ? true :false,
			
			'ICON_BASEDIR'		=> $this->dir,
			
			'S_ERROR'			=> (sizeof($error)) ? true : false,
			'ERROR_MSG'			=> implode('<br />', $error),
			
			'U_ABBC3'			=> $user->lang['ABBC3_HELP_ABOUT'],
			'U_ACTION'			=> $this->u_action,
			'F_ACTION'			=> ( $bbcode ) ? $this->u_action . '&mode=bbcodes&action=edit&bbcode_id=' . $bbcode : null,
			'U_BACK'			=> ( $bbcode ) ? $this->u_back : null,
		));
		
		while ($row = $db->sql_fetchrow($result))
		{
			/** Some fixes **/
		         $bbcode_id      = $row['bbcode_id'];
     			   $abbcode      = $row['abbcode'];
       		   $abbcode_name   = ( ($row['abbcode']) ? 'ABBC3_' : '' ) . strtoupper( str_replace('=', '', trim($row['bbcode_tag']) ) );
    			   $abbcode_name   = ( $row['bbcode_helpline'] == 'ABBC3_ED2K_TIP') ? 'ABBC3_ED2K' : $abbcode_name;
		         $abbcode_image   = trim($row['bbcode_image']);
			
			// is a breack line or division ?
			if ( ( substr($abbcode_name,0,11) == 'ABBC3_BREAK') || ( substr($abbcode_name,0,14) == 'ABBC3_DIVISION' ) )
			{
				if ( substr($abbcode_name,0,14) == 'ABBC3_DIVISION' )
				{
					if ( $config['ABBC3_TAB'] )
					{
						$abbcode_name = 'ABBCODES_DIVISION';
					}
					else
					{
						continue;
					}
				}
				else
				{
						$abbcode_name = 'ABBCODES_BREAK';
				}
			}
			$no_move = array('ABBC3_FONT', 'ABBC3_SIZE', 'ABBC3_HIGHLIGHT', 'ABBC3_COLOR' );
			
			if ( $action != 'edit' )
			{
				$template->assign_block_vars('items', array(
					'ID'					=> $bbcode_id,
					'TAG_NAME'				=> ( $abbcode ) ? '' : str_replace( '=', '', trim($row['bbcode_tag']) ),
					'TAG_EXPLAIN'			=> @$user->lang[$abbcode_name . '_MOVER'],
				
					'ON_POST'				=> ($row['display_on_posting']) ? $user->lang['ENABLED'] : $user->lang['DISABLED'],
					'ON_PM'					=> ($row['display_on_pm']) ? $user->lang['ENABLED'] : $user->lang['DISABLED'],
					'ON_SIG'				=> ($row['display_on_sig']) ? $user->lang['ENABLED'] : $user->lang['DISABLED'],
					
					'S_NOMOVE'				=> ( $abbcode && $row['bbcode_order'] <  5 ) ? true : null,
					'S_FIRST_ROW'			=> ( $abbcode && $row['bbcode_order'] <= 5 ) ? true : false,
					
					'U_EDIT'				=> $this->u_action . '&mode=bbcodes&action=edit&bbcode_id=' . $row['bbcode_id'],
					'U_MOVE_UP'				=> $this->u_action . '&mode=bbcodes&action=move_up&bbcode_id=' . $row['bbcode_id'],
					'U_MOVE_DOWN'			=> $this->u_action . '&mode=bbcodes&action=move_down&bbcode_id=' . $row['bbcode_id'],
				));
			}
			elseif ( $action == 'edit' && $row['bbcode_id'] == $bbcode )
			{
				$template->assign_block_vars('items', array(
					'ID'					=> $bbcode_id,
					'NAME'					=> str_replace( '=', '', trim($row['bbcode_tag']) ),
					'TAG_NAME'				=> ( $abbcode ) ? '' : str_replace( '=', '', trim($row['bbcode_tag']) ),
					'TAG_EXPLAIN'			=> @$user->lang[$abbcode_name . '_MOVER'],
					
					'IMG_SRC'            => ($abbcode_image) ? ($abbcode_image != $img_spacer) ? $this->dir . '/images/' . $abbcode_image : '' : $this->dir . '/images/' . $img_noimg,
					'S_NEW_IMG'				=> image_select($this->dir . '/images', $abbcode_image, 'image[' . $bbcode_id . ']', false, $this->u_action),
					'POSTING_CHECKED'		=> ( $row['display_on_posting'] ) ? ' checked="checked"' : '',
					'PM_CHECKED'			=> ( $row['display_on_pm'] ) ? ' checked="checked"' : '',
					'SIG_CHECKED'			=> ( $row['display_on_sig'] ) ? ' checked="checked"' : '',
				));
			}
		}
	}
}

	/**
	* Select list of images in current style folder
	**/
	function image_select($dir, $current, $name, $show = false, $u_action)
	{
		global $user, $config, $phpbb_admin_path, $phpbb_root_path, $phpEx;
		
		// Read the folder and get images
		$dp = @opendir($dir);
		$count = 0;
		
		if ($dp)
		{
			while (($file = readdir($dp)) !== false)
			{
				if (preg_match('#\.(?:gif|jpg|png)$#', $file))
				{
					$imagesetlist[$count] = $file;
					$count++;
				}
			}
			closedir($dp);
		}
		else
		{
			trigger_error($user->lang['NO_IMAGESET'] . adm_back_link($u_action), E_USER_WARNING);
		}
		
		if (sizeof( $imagesetlist ))
		{
			// Make sure the list of possible images is sorted alphabetically
			sort($imagesetlist);
			
			$icons_list = '<select id="image_select" name="' . $name . '" onchange="update_image(this.options[selectedIndex].value);">' . "\n";
			$icons_list .= '<option value="" ' . (($current == '') ? ' selected="selected"' : ''). '>' . $user->lang['NO_IMAGE'] . '</option>' . "\n";
			
			for( $i = 0; $i < count($imagesetlist); $i++ )
			{
				$selected = ($imagesetlist[$i] == $current) ? ' selected="selected"' : '';
				$icons_list .= '<option value="' . $imagesetlist[$i] . '"' . $selected . '>' . $imagesetlist[$i] . '</option>' . "\n";
			}
			$icons_list .= '</select>'. (($show) ? '&nbsp; <label>' . $user->lang['CURRENT_IMAGE'] . '</label><span><img src="' . $dir . '/' . $current .'" id="newimg" name="' . $name .'" alt="" width="80" height="30" /></span>' : '' );
		}
		return $icons_list;
	}

	/**
	* Select list of display full size image
	**/
	function method_select($selected_method = 'greybox', $name)
	{
		global $user;
		
		$method_options = $user->lang['ABBCODES_RESIZE_METHODS'];
		
		$s_method_options = '<select name="' . $name . '">';
		foreach($method_options as $method_name => $method_value)
		{
			$selected = ($selected_method == $method_name) ? ' selected="selected"' : '';
			$s_method_options .= '<option value="' . $method_name . '"' . $selected . ' >' . $method_value . '</option>';
		}
		$s_method_options.= '</select>';
		
		return $s_method_options;
	}

?>
What's the problem? What's wrong?

Thanks...
calproye
Registered User
Posts: 108
Joined: Wed Oct 03, 2007 5:06 pm
Location: Madrid - ES
Contact:

Re: [DEV] Advanced BBcode box 3

Post by calproye »

calproye wrote:Leviatan, I've got a problem :oops: . I installed all patches and I get this error:

Parse error: syntax error, unexpected T_VARIABLE in /........./includes/acp/acp_abbcodes.php on line 79

My acp_abbcodes.php wiht all pacthes aplied is this:

Code: Select all

<?php
/**
* 
* @package: phpBB3 :: Advanced BBCode box 3 -> acp
* @version: $Id: acp_abbcode.php, v 1.0.9 2008/05/01 05:01:00 leviatan21 Exp $
* @copyright: leviatan21 < info@mssti.com > (Gabriel) http://www.mssti.com/phpbb3/
* @license: http://opensource.org/licenses/gpl-license.php GNU Public License
* @author: leviatan21 - http://www.phpbb.com/community/memberlist.php?mode=viewprofile&u=345763
**/

/**
* @ignore
**/
if (!defined('IN_PHPBB'))
{
	exit;
}

/**
* @package acp
**/
class acp_abbcodes
{
	var $u_action;
	var $u_back;
	var $new_config;
	var $submit;
	var $dir;
	
	function main($id, $mode)
	{
		global $db, $user, $auth, $template, $cache;
		global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
		
		$user->add_lang(array('acp/styles', 'mods/acp_abbcodes', 'mods/abbcode'));
		
		// Set up general vars
		$action				= request_var('action', '');
		$bbcode_id			= request_var('bbcode_id', '');
		
		$this->tpl_name		= 'acp_abbcodes';
		$this->page_title	= 'ACP_ABBCODES';
		$form_key			= 'acp_abbcodes';
		
		add_form_key($form_key);
		
		$this->u_back 		= $this->u_action;
		$this->submit		= (isset($_POST['submit'])) ? true : false;
		$abbc3_root_path	= ( $phpbb_admin_path ) ? $phpbb_admin_path : $phpbb_root_path ;
		$this->dir 			= $phpbb_root_path . $config['ABBC3_PATH'] ;
		
		// Execute overall actions
		switch ($mode)
		{
			case 'settings':
				
				switch ($action)
				{
					case 'purge_cache':
						$this->purge_cache($id, $mode, $action);
						break;
				}
				$this->abbc3_details( );
				break;
				
			case 'bbcodes'	:
				switch ($action)
				{
					case 'move_up':
					case 'move_down':
						
						// Get current order id...
						$sql = "SELECT bbcode_order as current_order
							FROM " . BBCODES_TABLE . "
							WHERE bbcode_id = $bbcode_id";
						$result = $db->sql_query($sql)
						
						
						$current_order = (int) $db->sql_fetchfield('current_order');
						$db->sql_freeresult($result);
						

			                  if ( ($current_order == 0 && $action == 'move_up') || ($current_order <= 5 && $action == 'move_up') )
                  			{
			                     $bbcode_id = null;
                  			   break;
			                  }

						
						// on move_down, switch position with next order_id...
						// on move_up, switch position with previous order_id...
						$switch_order_id = ($action == 'move_down') ? $current_order + 1 : $current_order - 1;
						
						$sql = "UPDATE " . BBCODES_TABLE . "
							SET bbcode_order = $current_order
							WHERE bbcode_order = $switch_order_id
								AND bbcode_id <> $bbcode_id";
						$db->sql_query($sql);
						
						// Only update the other entry too if the previous entry got updated
						if ($db->sql_affectedrows())
						{
							$sql = "UPDATE " . BBCODES_TABLE . "
								SET bbcode_order = $switch_order_id
								WHERE bbcode_order = $current_order
									AND bbcode_id = $bbcode_id";
							$db->sql_query($sql);
						}
						$bbcode_id = null;
					// no break;
				}
				$this->bbcodes_edit($id, $mode, $action, $bbcode_id);
				break;
		}
	}

	/**
	* Build Frontend with supplied options
	**/
	function abbc3_details( )
	{
		global $db, $user, $template, $phpbb_root_path, $config;
		
		$this->page_title = 'ABBCODES_SETINGS';
		
		$display_vars = array(
			'title'	=> 'ABBCODES_SETINGS',
			'lang'	=> array('mods/abbcode', 'mods/acp_abbcodes', 'acp/attachments'),
			'vars'	=> array(
				'legend1'				=> 'GENERAL_OPTIONS',
				'ABBC3_MOD'				=> array('lang' => 'ABBCODES_DISABLE',			'validate' => 'bool',	'type' => 'radio:yes_no',	'explain' => true),
				'ABBC3_BG'				=> array('lang' => 'ABBCODES_BG',				'validate' => 'string',	'type' => 'custom',			'function' => 'image_select', 'params' => array($this->dir . '/images/bg', '{CONFIG_VALUE}', 'config[ABBC3_BG]', true, $this->u_action), 'explain' => true),
				'ABBC3_TAB'				=> array('lang' => 'ABBCODES_TAB',				'validate' => 'bool',	'type' => 'radio:yes_no',	'explain' => true, 'append' => '&nbsp;&nbsp;<span>[ <img src="' . $this->dir . '/images/dots.gif" alt="" /> ]</span>'),
				'ABBC3_BOXRESIZE'		=> array('lang' => 'ABBCODES_BOXRESIZE',		'validate' => 'bool',	'type' => 'radio:yes_no',	'explain' => true),
				
				'legend2'				=> 'CAT_IMAGES',
				'ABBC3_RESIZE'			=> array('lang' => 'ABBCODES_RESIZE',			'validate' => 'bool', 	'type' => 'radio:yes_no',	'explain' => true),
				'ABBC3_RESIZE_METHOD'	=> array('lang' => 'ABBCODES_RESIZE_METHOD',	'validate' => 'string',	'type' => 'custom',			'function' => 'method_select', 'params' => array('{CONFIG_VALUE}', 'config[ABBC3_RESIZE_METHOD]'), 'explain' => true),
				'ABBC3_GREYBOX'			=> array('lang' => 'ABBCODES_GREYBOX',			'validate' => 'bool',	'type' => 'radio:yes_no',	'explain' => true, 'append' => '&nbsp;&nbsp;<span>[ <a href="http://www.orangoo.com/labs/GreyBox/" target="_blank">GreyBox</a> ]</span>'),
				
				'ABBC3_MAX_IMG_WIDTH'   => array('lang' => 'ABBCODES_MAX_IMAGE_WIDTH',   'validate' => 'int',   'type' => 'text:7:15',      'explain' => true, 'append' => ' px'),
		            'ABBC3_MAX_IMG_HEIGHT'   => array('lang' => 'ABBCODES_MAX_IMAGE_HEIGHT',   'validate' => 'int',   'type' => 'text:7:15',      'explain' => true, 'append' => ' px'),
				
				'ABBC3_MAX_THUM_WIDTH'	=> array('lang' => 'ABBCODES_MAX_THUMB_WIDTH',	'validate' => 'int',	'type' => 'text:7:15',		'explain' => true, 'append' => ' px'),
				
				'legend3'				=> 'ABBC3_BBVIDEO_TAG',
				'ABBC3_VIDEO'			=> array('lang' => 'ABBCODES_VIDEO_SIZE',		'validate' => 'int',	'type' => 'dimension:3:4',	'explain' => true, 'append' => ' px'),
				'ABBC3_VIDEO_width'		=> false,
				'ABBC3_VIDEO_height'	=> false,
				
				'legend4'				=> 'ABBC3_UPLOAD_MOVER',
				'upload_path'			=> array('lang'	=> 'UPLOAD_DIR',										'type' => 'string',			'explain' => true, 'append' => ' ' . $config['upload_path'] . '/'),
				'ABBC3_UPLOAD_MAX_SIZE'	=> array('lang'	=> 'ATTACH_MAX_FILESIZE',		'validate' => 'int',	'type' => 'text:7:15',		'explain' => true, 'append' => ' ' . $user->lang['BYTES']),
				'ABBC3_UPLOAD_EXTENSION'=> array('lang'	=> 'ABBC3_UPLOAD_EXTENSION',	'validate' => 'string',	'type' => 'textarea:5:40',	'explain' => true),
			)
		);
		
		if (isset($display_vars['lang']))
		{
			$user->add_lang($display_vars['lang']);
		}
		
		$this->new_config = $config;
		$cfg_array = (isset($_REQUEST['config'])) ? request_var('config', array('' => '')) : $this->new_config;
		$error = array();
		
		// We validate the complete config if whished
		validate_config_vars($display_vars['vars'], $cfg_array, $error);
		
		// Do not write values if there is an error
		if (sizeof($error))
		{
			$this->submit = false;
		}
		
		// We go through the display_vars to make sure no one is trying to set variables he/she is not allowed to...
		foreach ($display_vars['vars'] as $config_name => $null)
		{
			if (!isset($cfg_array[$config_name]) || strpos($config_name, 'legend') !== false)
			{
				continue;
			}
			
			$this->new_config[$config_name] = $config_value = $cfg_array[$config_name];
			
			if ($this->submit)
			{
				$this->set_config($config_name, $config_value);
			}
		}
		
		if ($this->submit)
		{
			add_log('admin', 'LOG_CONFIG_ABBCODES');
			
			if (!sizeof($error))
			{
				trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
			}
			else
			{
				trigger_error($user->lang['LOG_CONFIG_ABBCODES_ERROR'] . adm_back_link($this->u_action), E_USER_WARNING);
			}
		}
		
		$template->assign_vars(array(
			'S_EDIT'			=> true,
			
			'L_TITLE_EDIT'		=> $user->lang['ABBCODES_SETINGS'],
			'L_TITLE_EXPLAIN'	=> $user->lang['ABBCODES_SETINGS_EXPLAIN'],
			'ICON_BASEDIR'		=> $this->dir,
			
			'S_ERROR'			=> (sizeof($error)) ? true : false,
			'ERROR_MSG'			=> implode('<br />', $error),
			
			'S_FOUNDER'			=> ($user->data['user_type'] == USER_FOUNDER) ? true : false,
			'NO_FOUNDER'		=> $user->lang['NO_AUTH_OPERATION'],
			
			'U_ABBC3'			=> $user->lang['ABBC3_HELP_ABOUT'],
			'U_ACTION'			=> $this->u_action,
		));
		
		// Output relevant page
		foreach ($display_vars['vars'] as $config_key => $vars)
		{
			if (!is_array($vars) && strpos($config_key, 'legend') === false)
			{
				continue;
			}
			
			if (strpos($config_key, 'legend') !== false)
			{
				$template->assign_block_vars('options', array(
					'S_LEGEND'		=> true,
					'LEGEND'		=> ((isset($user->lang[$vars])) ? $user->lang[$vars] : $vars ),
				));
				continue;
			}
			
			$type = explode(':', $vars['type']);
			
			$l_explain = '';
			if ($vars['explain'] && isset($vars['lang_explain']))
			{
				$l_explain = (isset($user->lang[$vars['lang_explain']])) ? $user->lang[$vars['lang_explain']] : $vars['lang_explain'];
			}
			else if ($vars['explain'])
			{
				$l_explain = (isset($user->lang[$vars['lang'] . '_EXPLAIN'])) ? $user->lang[$vars['lang'] . '_EXPLAIN'] : '';
			}
			$template->assign_block_vars('options', array(
				'KEY'			=> $config_key,
				'TITLE'			=> (isset($user->lang[$vars['lang']])) ? $user->lang[$vars['lang']] : $vars['lang'],
				'S_EXPLAIN'		=> $vars['explain'],
				'TITLE_EXPLAIN'	=> $l_explain,
				'CONTENT'		=> build_cfg_template($type, $config_key, $this->new_config, $config_key, $vars),
				)
			);
			unset($display_vars['vars'][$config_key]);
		}
	}

	/**
	* Set config value. Creates missing config entry.
	**/
	function set_config($config_name, $config_value, $is_dynamic = true)
	{
		global $db, $cache, $config;
		
		$sql = 'UPDATE ' . CONFIG_TABLE . "
				SET config_value = '" . $db->sql_escape($config_value) . "'
				WHERE config_name = '" . $db->sql_escape($config_name) . "'";
		$db->sql_query($sql);
		
		if (!$db->sql_affectedrows() && !isset($config[$config_name]))
		{
			$sql = 'INSERT INTO ' . CONFIG_TABLE . ' ' . $db->sql_build_array('INSERT', array(
					'config_name'	=> $config_name,
					'config_value'	=> $config_value,
					'is_dynamic'	=> ($is_dynamic) ? 1 : 0));
			$db->sql_query($sql);
		}
		
		$config[$config_name] = $config_value;
		
		if (!$is_dynamic)
		{
			$cache->destroy('config');
		}
	}

	/**
	* Enter description here...
	**/
	function purge_cache($id, $mode, $action)
	{
		global $user, $auth, $phpbb_admin_path, $phpEx;
		
		if ((int) $user->data['user_type'] !== USER_FOUNDER)
		{
			trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
		}
		
		if (confirm_box(true))
		{
			global $cache;
			$cache->purge();
			
			// Clear permissions
			$auth->acl_clear_prefetch();
			cache_moderators();
			
			add_log('admin', 'LOG_PURGE_CACHE');
			
			trigger_error( $user->lang['LOG_PURGE_CACHE'] . adm_back_link($this->u_action));
		}
		else
		{
			confirm_box(false, $user->lang['PURGE_CACHE_CONFIRM'], build_hidden_fields(array(
				'i'			=> $id,
				'mode'		=> $mode,
				'action'	=> $action,
			)),'confirm_body.html', "{$phpbb_admin_path}adm/index.$phpEx?i=$id&mode=$mode" );
		}
	}

	/**
	* Show/edit bbcodes
	**/
	function bbcodes_edit($id, $mode, $action, $bbcode = '')
	{
		global $user, $db, $template, $config;
		
		$user->add_lang(array('acp/posting', 'mods/acp_abbcodes', 'mods/abbcode'));
		
		// Is this ABBC3 is disables on this style
		if ( !$config['ABBC3_MOD'] )
		{
			trigger_error($user->lang['ABBCODES_MOD_DISABLE'] . adm_back_link($this->u_action), E_USER_WARNING);
		}
		
		$img_spacer = 'spacer.gif';
		$img_noimg  = 'no_image.png';
		
		if ( $this->submit && $bbcode )
		{
			// Get items to create/modify
			$abbcode_name		= (isset($_POST['name']))				? request_var('name', array('' => '')) : array();
			$display_on_posting = (isset($_POST['display_on_posting']))	? request_var('display_on_posting', array('' => 0)) : array();
			$display_on_pm		= (isset($_POST['display_on_pm']))		? request_var('display_on_pm', array('' => 0)) : array();
			$display_on_sig		= (isset($_POST['display_on_sig']))		? request_var('display_on_sig', array('' => 0)) : array();
			$bbcode_image		= utf8_normalize_nfc(request_var('image', array('' => ''), true));
			
			$bbcode_sql = array(
				'display_on_posting'	=> (isset( $display_on_posting[$bbcode])) ? 1 : 0,
				'display_on_pm'			=> (isset( $display_on_pm[$bbcode])) ? 1 : 0,
				'display_on_sig'		=> (isset( $display_on_sig[$bbcode])) ? 1 : 0,
				'bbcode_image'			=> (isset( $bbcode_image[$bbcode])) ? $bbcode_image[$bbcode] : '',
			);
			
			// Fix for breack line?
			if ( substr($abbcode_name[$bbcode],0,5) == 'break')
			{
				$bbcode_sql['bbcode_image'] = $img_spacer;
			}
			
			$sql = "UPDATE " . BBCODES_TABLE . "
				SET " . $db->sql_build_array('UPDATE', $bbcode_sql) . "
				WHERE bbcode_id = " . $bbcode;
			$result = $db->sql_query($sql);
			
			if ($result )
			{
				trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
			}
			else
			{
				trigger_error($user->lang['LOG_CONFIG_ABBCODES_ERROR'] . adm_back_link($this->u_action), E_USER_WARNING);
			}
			$bbcode = '';
		}
		
		$error = array();
		
		$sql = "SELECT abbcode, bbcode_order, bbcode_id, bbcode_tag, bbcode_helpline, bbcode_image, display_on_posting, display_on_pm, display_on_sig 
				FROM " . BBCODES_TABLE . " 
				ORDER BY bbcode_order";
		$result = $db->sql_query($sql);
		
		$template->assign_vars(array(
			'S_BBCODES'			=> true,
			
			'L_TITLE_BBCODES'	=> $user->lang['ABBCODES_CONFIG'],
			'L_EXPLAIN_BBCODES'	=> $user->lang['ABBCODES_CONFIG_EXPLAIN'],
			
			'S_BBCODE_EDIT'		=> ( $bbcode ) ? true :false,
			
			'ICON_BASEDIR'		=> $this->dir,
			
			'S_ERROR'			=> (sizeof($error)) ? true : false,
			'ERROR_MSG'			=> implode('<br />', $error),
			
			'U_ABBC3'			=> $user->lang['ABBC3_HELP_ABOUT'],
			'U_ACTION'			=> $this->u_action,
			'F_ACTION'			=> ( $bbcode ) ? $this->u_action . '&mode=bbcodes&action=edit&bbcode_id=' . $bbcode : null,
			'U_BACK'			=> ( $bbcode ) ? $this->u_back : null,
		));
		
		while ($row = $db->sql_fetchrow($result))
		{
			/** Some fixes **/
		         $bbcode_id      = $row['bbcode_id'];
     			   $abbcode      = $row['abbcode'];
       		   $abbcode_name   = ( ($row['abbcode']) ? 'ABBC3_' : '' ) . strtoupper( str_replace('=', '', trim($row['bbcode_tag']) ) );
    			   $abbcode_name   = ( $row['bbcode_helpline'] == 'ABBC3_ED2K_TIP') ? 'ABBC3_ED2K' : $abbcode_name;
		         $abbcode_image   = trim($row['bbcode_image']);
			
			// is a breack line or division ?
			if ( ( substr($abbcode_name,0,11) == 'ABBC3_BREAK') || ( substr($abbcode_name,0,14) == 'ABBC3_DIVISION' ) )
			{
				if ( substr($abbcode_name,0,14) == 'ABBC3_DIVISION' )
				{
					if ( $config['ABBC3_TAB'] )
					{
						$abbcode_name = 'ABBCODES_DIVISION';
					}
					else
					{
						continue;
					}
				}
				else
				{
						$abbcode_name = 'ABBCODES_BREAK';
				}
			}
			$no_move = array('ABBC3_FONT', 'ABBC3_SIZE', 'ABBC3_HIGHLIGHT', 'ABBC3_COLOR' );
			
			if ( $action != 'edit' )
			{
				$template->assign_block_vars('items', array(
					'ID'					=> $bbcode_id,
					'TAG_NAME'				=> ( $abbcode ) ? '' : str_replace( '=', '', trim($row['bbcode_tag']) ),
					'TAG_EXPLAIN'			=> @$user->lang[$abbcode_name . '_MOVER'],
				
					'ON_POST'				=> ($row['display_on_posting']) ? $user->lang['ENABLED'] : $user->lang['DISABLED'],
					'ON_PM'					=> ($row['display_on_pm']) ? $user->lang['ENABLED'] : $user->lang['DISABLED'],
					'ON_SIG'				=> ($row['display_on_sig']) ? $user->lang['ENABLED'] : $user->lang['DISABLED'],
					
					'S_NOMOVE'				=> ( $abbcode && $row['bbcode_order'] <  5 ) ? true : null,
					'S_FIRST_ROW'			=> ( $abbcode && $row['bbcode_order'] <= 5 ) ? true : false,
					
					'U_EDIT'				=> $this->u_action . '&mode=bbcodes&action=edit&bbcode_id=' . $row['bbcode_id'],
					'U_MOVE_UP'				=> $this->u_action . '&mode=bbcodes&action=move_up&bbcode_id=' . $row['bbcode_id'],
					'U_MOVE_DOWN'			=> $this->u_action . '&mode=bbcodes&action=move_down&bbcode_id=' . $row['bbcode_id'],
				));
			}
			elseif ( $action == 'edit' && $row['bbcode_id'] == $bbcode )
			{
				$template->assign_block_vars('items', array(
					'ID'					=> $bbcode_id,
					'NAME'					=> str_replace( '=', '', trim($row['bbcode_tag']) ),
					'TAG_NAME'				=> ( $abbcode ) ? '' : str_replace( '=', '', trim($row['bbcode_tag']) ),
					'TAG_EXPLAIN'			=> @$user->lang[$abbcode_name . '_MOVER'],
					
					'IMG_SRC'            => ($abbcode_image) ? ($abbcode_image != $img_spacer) ? $this->dir . '/images/' . $abbcode_image : '' : $this->dir . '/images/' . $img_noimg,
					'S_NEW_IMG'				=> image_select($this->dir . '/images', $abbcode_image, 'image[' . $bbcode_id . ']', false, $this->u_action),
					'POSTING_CHECKED'		=> ( $row['display_on_posting'] ) ? ' checked="checked"' : '',
					'PM_CHECKED'			=> ( $row['display_on_pm'] ) ? ' checked="checked"' : '',
					'SIG_CHECKED'			=> ( $row['display_on_sig'] ) ? ' checked="checked"' : '',
				));
			}
		}
	}
}

	/**
	* Select list of images in current style folder
	**/
	function image_select($dir, $current, $name, $show = false, $u_action)
	{
		global $user, $config, $phpbb_admin_path, $phpbb_root_path, $phpEx;
		
		// Read the folder and get images
		$dp = @opendir($dir);
		$count = 0;
		
		if ($dp)
		{
			while (($file = readdir($dp)) !== false)
			{
				if (preg_match('#\.(?:gif|jpg|png)$#', $file))
				{
					$imagesetlist[$count] = $file;
					$count++;
				}
			}
			closedir($dp);
		}
		else
		{
			trigger_error($user->lang['NO_IMAGESET'] . adm_back_link($u_action), E_USER_WARNING);
		}
		
		if (sizeof( $imagesetlist ))
		{
			// Make sure the list of possible images is sorted alphabetically
			sort($imagesetlist);
			
			$icons_list = '<select id="image_select" name="' . $name . '" onchange="update_image(this.options[selectedIndex].value);">' . "\n";
			$icons_list .= '<option value="" ' . (($current == '') ? ' selected="selected"' : ''). '>' . $user->lang['NO_IMAGE'] . '</option>' . "\n";
			
			for( $i = 0; $i < count($imagesetlist); $i++ )
			{
				$selected = ($imagesetlist[$i] == $current) ? ' selected="selected"' : '';
				$icons_list .= '<option value="' . $imagesetlist[$i] . '"' . $selected . '>' . $imagesetlist[$i] . '</option>' . "\n";
			}
			$icons_list .= '</select>'. (($show) ? '&nbsp; <label>' . $user->lang['CURRENT_IMAGE'] . '</label><span><img src="' . $dir . '/' . $current .'" id="newimg" name="' . $name .'" alt="" width="80" height="30" /></span>' : '' );
		}
		return $icons_list;
	}

	/**
	* Select list of display full size image
	**/
	function method_select($selected_method = 'greybox', $name)
	{
		global $user;
		
		$method_options = $user->lang['ABBCODES_RESIZE_METHODS'];
		
		$s_method_options = '<select name="' . $name . '">';
		foreach($method_options as $method_name => $method_value)
		{
			$selected = ($selected_method == $method_name) ? ' selected="selected"' : '';
			$s_method_options .= '<option value="' . $method_name . '"' . $selected . ' >' . $method_value . '</option>';
		}
		$s_method_options.= '</select>';
		
		return $s_method_options;
	}

?>
What's the problem? What's wrong?

Thanks...

I forgot ";" in line 76

Sorry for disturbing unnecessarily!!
User avatar
leviatan21
Registered User
Posts: 2663
Joined: Fri Aug 10, 2007 7:22 am
Location: Buenos Aires, Argentina
Name: Gabriel

Re: [DEV] Advanced BBcode box 3

Post by leviatan21 »

calproye wrote:Leviatan, I've got a problem :oops: . I installed all patches and I get this error:

Parse error: syntax error, unexpected T_VARIABLE in /........./includes/acp/acp_abbcodes.php on line 79

My acp_abbcodes.php wiht all pacthes aplied is this:
What's the problem? What's wrong?

Thanks...
On line 76 you have :

Code: Select all

                      $result = $db->sql_query($sql)
and should be :

Code: Select all

						$result = $db->sql_query($sql);
end the line with a ;
Excuse me for my poor English, I speak Spanish. | Image phpBB en Español
calproye
Registered User
Posts: 108
Joined: Wed Oct 03, 2007 5:06 pm
Location: Madrid - ES
Contact:

Re: [DEV] Advanced BBcode box 3

Post by calproye »

leviatan21 wrote:
calproye wrote:Leviatan, I've got a problem :oops: . I installed all patches and I get this error:

Parse error: syntax error, unexpected T_VARIABLE in /........./includes/acp/acp_abbcodes.php on line 79

My acp_abbcodes.php wiht all pacthes aplied is this:
What's the problem? What's wrong?

Thanks...
On line 76 you have :

Code: Select all

                      $result = $db->sql_query($sql)
and should be :

Code: Select all

						$result = $db->sql_query($sql);
end the line with a ;

thanks you very much for you help. It's working fine
User avatar
fazaljatoi
I've Been Banned!
Posts: 503
Joined: Wed Aug 31, 2005 8:02 pm

Re: [DEV] Advanced BBcode box 3

Post by fazaljatoi »

leviatan21 wrote: Hi fazaljatoi :
The problem with your forum is the amount of javascript you have added, and ABBC3 add more.
I don't care if you disable/unistall my mod, you will still have problems in future.
how i fix this issue ?
User avatar
leviatan21
Registered User
Posts: 2663
Joined: Fri Aug 10, 2007 7:22 am
Location: Buenos Aires, Argentina
Name: Gabriel

Re: [DEV] Advanced BBcode box 3

Post by leviatan21 »

fazaljatoi wrote:
leviatan21 wrote: Hi fazaljatoi :
The problem with your forum is the amount of javascript you have added, and ABBC3 add more.
I don't care if you disable/unistall my mod, you will still have problems in future.
how i fix this issue ?
Hi, you come back ! I see you around [RC2] BBCodeBox3 ;)
I see that you quit a lot of images forum, that helps too.
In IE the image logo is not displayed...

Example :
Do you need 6 google ads in the index?
you background sound is not working
Your visit counter is not good, it count each refresh from each visitor/user...
What for is "function plugNS()" and AdLogger Tracking ?
Excuse me for my poor English, I speak Spanish. | Image phpBB en Español
TigerCrow
Registered User
Posts: 13
Joined: Wed Jan 30, 2008 10:16 am
Location: Germany

Re: [DEV] Advanced BBcode box 3

Post by TigerCrow »

leviatan21 wrote:
TigerCrow wrote:Hello Guys

i have install the new version 1.09 but when i will make a upload or mail or quicktime movie or url i have error :(

here is a pic for the error: the message is : Object not found
OK he search a site, but the site is there !


can everywhere help me please :) or have a idear

Image


i think this is the error: http://localhost/evil_project/styles/X- ... e/greybox/loader_frame.html%3fs=0

but what can i do, who is writing this link ?

TigerCrow
Hi TigerCrow :
I think you made a mistake with the install, because in v109 there is no more styles/YOURSKIN/imageset/abbcode/ now the ABBC3 files are stored in styles/abbcode,

Code: Select all

i think this is the error: http://localhost/evil_project/styles/X-Treme/imageset/abbcode/greybox/[color=#FF0000][b]loader_frame.html%3fs=0[/b][/color]
thanks ... thats right .. Grrrr
but
when i kill the old folder "/imageset/abbcode" he was not found the css file !!! and the link to file_upload will not work !

i have clear the cache, in browser and forum, the style was updated but nothing, the same error!
he goes to the old folder but the images comes from the new one

have you a idear ? what i can do , i'm at the end :cry:

TigerCrow


EDIT:
i have found the error :)

i have install the old overall_header part !!! :twisted:
Es ist ebenso interessant und schwer, etwas gut zu sagen, wie es gut zu malen ist.
It is just as interesting and heavy to say somewhat well how it is to be painted well.
eegle1
Registered User
Posts: 9
Joined: Sat Apr 07, 2007 1:27 pm

Re: [DEV] Advanced BBcode box 3

Post by eegle1 »

So is there any new information on when this will be released for use on live Forums?

eegle1
User avatar
leviatan21
Registered User
Posts: 2663
Joined: Fri Aug 10, 2007 7:22 am
Location: Buenos Aires, Argentina
Name: Gabriel

Re: [DEV] Advanced BBcode box 3

Post by leviatan21 »

eegle1 wrote:So is there any new information on when this will be released for use on live Forums?

eegle1
Hi eegle1 :

The actual version 1.0.9 is considered stable, but you need to apply some minor fix.

As no new big problems appears in the last 2 weeks, I will release the next version with all fixes applied and change the stage from DEV ( Developer ) to RC ( Release Candidate ). :D

And also I will submit it to the MODDB ( Modifications Database ) :mrgreen:
Excuse me for my poor English, I speak Spanish. | Image phpBB en Español
calproye
Registered User
Posts: 108
Joined: Wed Oct 03, 2007 5:06 pm
Location: Madrid - ES
Contact:

Re: [DEV] Advanced BBcode box 3

Post by calproye »

eegle1 wrote:So is there any new information on when this will be released for use on live Forums?

eegle1

I installed 1.0.8 and 1.09 version ( with the patches) and for me never I have problems. Perhaps you have to be careful with the Interaction of other mods. But if your board only has this mod, it shouldn't have problems and it works properly.


Best Regards
User avatar
leviatan21
Registered User
Posts: 2663
Joined: Fri Aug 10, 2007 7:22 am
Location: Buenos Aires, Argentina
Name: Gabriel

Re: [DEV] Advanced BBcode box 3

Post by leviatan21 »

calproye wrote:
eegle1 wrote:So is there any new information on when this will be released for use on live Forums?

eegle1

I installed 1.0.8 and 1.09 version ( with the patches) and for me never I have problems. Perhaps you have to be careful with the Interaction of other mods. But if your board only has this mod, it shouldn't have problems and it works properly.


Best Regards
HI calproye :

Some ABBC3 users that talk to me have a lot of other mods, I can build a list with almost 100 mods that work fine with ABBC3.

The only big problem in ABBC3 is testlink for servers without CURL installed :oops:

I can't be 100% sure about my mod, but who are ? :lol:
Excuse me for my poor English, I speak Spanish. | Image phpBB en Español
eegle1
Registered User
Posts: 9
Joined: Sat Apr 07, 2007 1:27 pm

Re: [DEV] Advanced BBcode box 3

Post by eegle1 »

The good news is that I have no other mods on my board, nor do intend to have any if I can help it. ;)

So what you are saying is that if I download the current version at the beginning of this topic I'll still have to modify it?
User avatar
leviatan21
Registered User
Posts: 2663
Joined: Fri Aug 10, 2007 7:22 am
Location: Buenos Aires, Argentina
Name: Gabriel

Re: [DEV] Advanced BBcode box 3

Post by leviatan21 »

eegle1 wrote:The good news is that I have no other mods on my board, nor do intend to have any if I can help it. ;)

So what you are saying is that if I download the current version at the beginning of this topic I'll still have to modify it?
HI eegle1 :
Until new version, you have to install the v109 and apply all 10 fix :oops:
Excuse me for my poor English, I speak Spanish. | Image phpBB en Español
User avatar
CrossoverX
Registered User
Posts: 121
Joined: Thu Apr 05, 2007 2:35 pm
Location: 5-X
Contact:

Re: [DEV] Advanced BBcode box 3

Post by CrossoverX »

eegle1 wrote:So is there any new information on when this will be released for use on live Forums?

eegle1
me too have installed on a live forum and is perfect. applied only one fix :P

go ahead and install this great mod

Thnx mssti
.

Add your board to phpBB-topsites.com

.
calproye
Registered User
Posts: 108
Joined: Wed Oct 03, 2007 5:06 pm
Location: Madrid - ES
Contact:

Re: [DEV] Advanced BBcode box 3

Post by calproye »

leviatan21 wrote:
calproye wrote:
eegle1 wrote:So is there any new information on when this will be released for use on live Forums?

eegle1

I installed 1.0.8 and 1.09 version ( with the patches) and for me never I have problems. Perhaps you have to be careful with the Interaction of other mods. But if your board only has this mod, it shouldn't have problems and it works properly.


Best Regards
HI calproye :

Some ABBC3 users that talk to me have a lot of other mods, I can build a list with almost 100 mods that work fine with ABBC3.

The only big problem in ABBC3 is testlink for servers without CURL installed :oops:

I can't be 100% sure about my mod, but who are ? :lol:
Yes, you are right.

Now, I am testing your MOD with a portal, statistics and chat mods. If they live togehter in harmony, I tell you ;)

Best regards
Locked

Return to “[3.0.x] Abandoned MODs”