[問題]vault股市外掛

phpBB 2 MOD Support
無論是官方或非官方認證之外掛,安裝與使用問題討論。
(發表文章請按照公告格式發表,違者砍文)

版主: 版主管理群

天地人
星球普通子民
星球普通子民
文章: 30
註冊時間: 2004-04-09 07:50
來自: hk

文章 天地人 »

問題外掛:(vault)

使用版本:(phpBB 2.0.8)
網站位置:(http://members.lycos.co.uk/bolung/index.php)


用戶名稱: >>123
密碼:>>>>>123


to:動機不明
我已修改,但還是老樣子
如果你要我張貼程式碼給你過目,,請你說明檔案名稱,我會盡快post上來給你看
謝謝
頭像
bbsbsai
星球公民
星球公民
文章: 113
註冊時間: 2003-11-20 22:57
來自: Only Money
聯繫:

[討論]動機大別誤會

文章 bbsbsai »

動機大別誤會:

你的valut mod好用、好玩又有趣,只是「仙人打鼓有時錯嘛!!」

而且這可是你嘔心瀝血之作~~~~

我們只是坐享其成的竹貓小訪客而已啦~~~

大家用過都說好~~good
頭像
bbsbsai
星球公民
星球公民
文章: 113
註冊時間: 2003-11-20 22:57
來自: Only Money
聯繫:

[建議]程式可以貼出來嗎??

文章 bbsbsai »

程式可以貼出來嗎??
你的網站錯誤是:
Parse error: parse error in /data/members/free/tripod/uk/b/o/l/bolung/htdocs/includes/template.php(127) : eval()'d code on line 31


可以給個template.php看看嗎????
天地人
星球普通子民
星球普通子民
文章: 30
註冊時間: 2004-04-09 07:50
來自: hk

文章 天地人 »

如下:

代碼: 選擇全部

<?php
/***************************************************************************
 *                              template.php
 *                            -------------------
 *   begin                : Saturday, Feb 13, 2001
 *   copyright            : (C) 2001 The phpBB Group
 *   email                : support@phpbb.com
 *
 *   $Id: template.php,v 1.10.2.3 2002/12/21 19:09:57 psotfx Exp $
 *
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

/**
 * Template class. By Nathan Codding of the phpBB group.
 * The interface was originally inspired by PHPLib templates,
 * and the template file formats are quite similar.
 *
 */

class Template {
	var $classname = "Template";

	// variable that holds all the data we'll be substituting into
	// the compiled templates.
	// ...
	// This will end up being a multi-dimensional array like this:
	// $this->_tpldata[block.][iteration#][child.][iteration#][child2.][iteration#][variablename] == value
	// if it's a root-level variable, it'll be like this:
	// $this->_tpldata[.][0][varname] == value
	var $_tpldata = array();

	// Hash of filenames for each template handle.
	var $files = array();

	// Root template directory.
	var $root = "";

	// this will hash handle names to the compiled code for that handle.
	var $compiled_code = array();

	// This will hold the uncompiled code for that handle.
	var $uncompiled_code = array();

	/**
	 * Constructor. Simply sets the root dir.
	 *
	 */
	function Template($root = ".")
	{
		$this->set_rootdir($root);
	}

	/**
	 * Destroys this template object. Should be called when you're done with it, in order
	 * to clear out the template data so you can load/parse a new template set.
	 */
	function destroy()
	{
		$this->_tpldata = array();
	}

	/**
	 * Sets the template root directory for this Template object.
	 */
	function set_rootdir($dir)
	{
		if (!is_dir($dir))
		{
			return false;
		}

		$this->root = $dir;
		return true;
	}

	/**
	 * Sets the template filenames for handles. $filename_array
	 * should be a hash of handle => filename pairs.
	 */
	function set_filenames($filename_array)
	{
		if (!is_array($filename_array))
		{
			return false;
		}

		reset($filename_array);
		while(list($handle, $filename) = each($filename_array))
		{
			$this->files[$handle] = $this->make_filename($filename);
		}

		return true;
	}


	/**
	 * Load the file for the handle, compile the file,
	 * and run the compiled code. This will print out
	 * the results of executing the template.
	 */
	function pparse($handle)
	{
		if (!$this->loadfile($handle))
		{
			die("Template->pparse(): Couldn't load template file for handle $handle");
		}

		// actually compile the template now.
		if (!isset($this->compiled_code[$handle]) || empty($this->compiled_code[$handle]))
		{
			// Actually compile the code now.
			$this->compiled_code[$handle] = $this->compile($this->uncompiled_code[$handle]);
		}

		// Run the compiled code.
		eval($this->compiled_code[$handle]);
		return true;
	}

	/**
	 * Inserts the uncompiled code for $handle as the
	 * value of $varname in the root-level. This can be used
	 * to effectively include a template in the middle of another
	 * template.
	 * Note that all desired assignments to the variables in $handle should be done
	 * BEFORE calling this function.
	 */
	function assign_var_from_handle($varname, $handle)
	{
		if (!$this->loadfile($handle))
		{
			die("Template->assign_var_from_handle(): Couldn't load template file for handle $handle");
		}

		// Compile it, with the "no echo statements" option on.
		$_str = "";
		$code = $this->compile($this->uncompiled_code[$handle], true, '_str');

		// evaluate the variable assignment.
		eval($code);
		// assign the value of the generated variable to the given varname.
		$this->assign_var($varname, $_str);

		return true;
	}

	/**
	 * Block-level variable assignment. Adds a new block iteration with the given
	 * variable assignments. Note that this should only be called once per block
	 * iteration.
	 */
	function assign_block_vars($blockname, $vararray)
	{
		if (strstr($blockname, '.'))
		{
			// Nested block.
			$blocks = explode('.', $blockname);
			$blockcount = sizeof($blocks) - 1;
			$str = '$this->_tpldata';
			for ($i = 0; $i < $blockcount; $i++)
			{
				$str .= '[\'' . $blocks[$i] . '.\']';
				eval('$lastiteration = sizeof(' . $str . ') - 1;');
				$str .= '[' . $lastiteration . ']';
			}
			// Now we add the block that we're actually assigning to.
			// We're adding a new iteration to this block with the given
			// variable assignments.
			$str .= '[\'' . $blocks[$blockcount] . '.\'][] = $vararray;';

			// Now we evaluate this assignment we've built up.
			eval($str);
		}
		else
		{
			// Top-level block.
			// Add a new iteration to this block with the variable assignments
			// we were given.
			$this->_tpldata[$blockname . '.'][] = $vararray;
		}

		return true;
	}

	/**
	 * Root-level variable assignment. Adds to current assignments, overriding
	 * any existing variable assignment with the same name.
	 */
	function assign_vars($vararray)
	{
		reset ($vararray);
		while (list($key, $val) = each($vararray))
		{
			$this->_tpldata['.'][0][$key] = $val;
		}

		return true;
	}

	/**
	 * Root-level variable assignment. Adds to current assignments, overriding
	 * any existing variable assignment with the same name.
	 */
	function assign_var($varname, $varval)
	{
		$this->_tpldata['.'][0][$varname] = $varval;

		return true;
	}


	/**
	 * Generates a full path+filename for the given filename, which can either
	 * be an absolute name, or a name relative to the rootdir for this Template
	 * object.
	 */
	function make_filename($filename)
	{
		// Check if it's an absolute or relative path.
		if (substr($filename, 0, 1) != '/')
		{
       		$filename = phpbb_realpath($this->root . '/' . $filename);
		}

		if (!file_exists($filename))
		{
			die("Template->make_filename(): Error - file $filename does not exist");
		}

		return $filename;
	}


	/**
	 * If not already done, load the file for the given handle and populate
	 * the uncompiled_code[] hash with its code. Do not compile.
	 */
	function loadfile($handle)
	{
		// If the file for this handle is already loaded and compiled, do nothing.
		if (isset($this->uncompiled_code[$handle]) && !empty($this->uncompiled_code[$handle]))
		{
			return true;
		}

		// If we don't have a file assigned to this handle, die.
		if (!isset($this->files[$handle]))
		{
			die("Template->loadfile(): No file specified for handle $handle");
		}

		$filename = $this->files[$handle];

		$str = implode("", @file($filename));
		if (empty($str))
		{
			die("Template->loadfile(): File $filename for handle $handle is empty");
		}

		$this->uncompiled_code[$handle] = $str;

		return true;
	}



	/**
	 * Compiles the given string of code, and returns
	 * the result in a string.
	 * If "do_not_echo" is true, the returned code will not be directly
	 * executable, but can be used as part of a variable assignment
	 * for use in assign_code_from_handle().
	 */
	function compile($code, $do_not_echo = false, $retvar = '')
	{
		// replace \ with \\\ and then ' with \'.
		$code = str_replace('\\\', '\\\\\\\', $code);
		$code = str_replace('\'', '\\\\\'', $code);

		// change template varrefs into PHP varrefs

		// This one will handle varrefs WITH namespaces
		$varrefs = array();
		preg_match_all('#\{(([a-z0-9\-_]+?\.)+?)([a-z0-9\-_]+?)\}#is', $code, $varrefs);
		$varcount = sizeof($varrefs[1]);
		for ($i = 0; $i < $varcount; $i++)
		{
			$namespace = $varrefs[1][$i];
			$varname = $varrefs[3][$i];\r
			$new = $this->generate_block_varref($namespace, $varname);

			$code = str_replace($varrefs[0][$i], $new, $code);
		}

		// This will handle the remaining root-level varrefs
		$code = preg_replace('#\{([a-z0-9\-_]*?)\}#is', '\' . ( ( isset($this->_tpldata[\'.\'][0][\'\1\']) ) ? $this->_tpldata[\'.\'][0][\'\1\'] : \'\' ) . \'', $code);

		// Break it up into lines.
		$code_lines = explode("
", $code);

		$block_nesting_level = 0;
		$block_names = array();
		$block_names[0] = ".";

		// Second: prepend echo ', append ' . "
"; to each line.
		$line_count = sizeof($code_lines);
		for ($i = 0; $i < $line_count; $i++)
		{
			$code_lines[$i] = chop($code_lines[$i]);
			if (preg_match('#<!-- BEGIN (.*?) -->#', $code_lines[$i], $m))
			{
				$n[0] = $m[0];
				$n[1] = $m[1];

				// Added: dougk_ff7-Keeps templates from bombing if begin is on the same line as end.. I think. :)
				if ( preg_match('#<!-- END (.*?) -->#', $code_lines[$i], $n) )
				{
					$block_nesting_level++;
					$block_names[$block_nesting_level] = $m[1];
					if ($block_nesting_level < 2)
					{
						// Block is not nested.
						$code_lines[$i] = '$_' . $n[1] . '_count = ( isset($this->_tpldata[\'' . $n[1] . '.\']) ) ?  sizeof($this->_tpldata[\'' . $n[1] . '.\']) : 0;';
						$code_lines[$i] .= "
" . 'for ($_' . $n[1] . '_i = 0; $_' . $n[1] . '_i < $_' . $n[1] . '_count; $_' . $n[1] . '_i++)';
						$code_lines[$i] .= "
" . '{';
					}
					else
					{
						// This block is nested.

						// Generate a namespace string for this block.
						$namespace = implode('.', $block_names);
						// strip leading period from root level..
						$namespace = substr($namespace, 2);
						// Get a reference to the data array for this block that depends on the
						// current indices of all parent blocks.
						$varref = $this->generate_block_data_ref($namespace, false);
						// Create the for loop code to iterate over this block.
						$code_lines[$i] = '$_' . $n[1] . '_count = ( isset(' . $varref . ') ) ? sizeof(' . $varref . ') : 0;';
						$code_lines[$i] .= "
" . 'for ($_' . $n[1] . '_i = 0; $_' . $n[1] . '_i < $_' . $n[1] . '_count; $_' . $n[1] . '_i++)';
						$code_lines[$i] .= "
" . '{';
					}

					// We have the end of a block.
					unset($block_names[$block_nesting_level]);
					$block_nesting_level--;
					$code_lines[$i] .= '} // END ' . $n[1];
					$m[0] = $n[0];
					$m[1] = $n[1];
				}
				else
				{
					// We have the start of a block.
					$block_nesting_level++;
					$block_names[$block_nesting_level] = $m[1];
					if ($block_nesting_level < 2)
					{
						// Block is not nested.
						$code_lines[$i] = '$_' . $m[1] . '_count = ( isset($this->_tpldata[\'' . $m[1] . '.\']) ) ? sizeof($this->_tpldata[\'' . $m[1] . '.\']) : 0;';
						$code_lines[$i] .= "
" . 'for ($_' . $m[1] . '_i = 0; $_' . $m[1] . '_i < $_' . $m[1] . '_count; $_' . $m[1] . '_i++)';
						$code_lines[$i] .= "
" . '{';
					}
					else
					{
						// This block is nested.

						// Generate a namespace string for this block.
						$namespace = implode('.', $block_names);
						// strip leading period from root level..
						$namespace = substr($namespace, 2);
						// Get a reference to the data array for this block that depends on the
						// current indices of all parent blocks.
						$varref = $this->generate_block_data_ref($namespace, false);
						// Create the for loop code to iterate over this block.
						$code_lines[$i] = '$_' . $m[1] . '_count = ( isset(' . $varref . ') ) ? sizeof(' . $varref . ') : 0;';
						$code_lines[$i] .= "
" . 'for ($_' . $m[1] . '_i = 0; $_' . $m[1] . '_i < $_' . $m[1] . '_count; $_' . $m[1] . '_i++)';
						$code_lines[$i] .= "
" . '{';
					}
				}
			}
			else if (preg_match('#<!-- END (.*?) -->#', $code_lines[$i], $m))
			{
				// We have the end of a block.
				unset($block_names[$block_nesting_level]);
				$block_nesting_level--;
				$code_lines[$i] = '} // END ' . $m[1];
			}
			else
			{
				// We have an ordinary line of code.
				if (!$do_not_echo)
				{
					$code_lines[$i] = 'echo \'' . $code_lines[$i] . '\' . "\\
";';
				}
				else
				{
					$code_lines[$i] = '$' . $retvar . '.= \'' . $code_lines[$i] . '\' . "\\
";'; 
				}
			}
		}

		// Bring it back into a single string of lines of code.
		$code = implode("
", $code_lines);
		return $code	;

	}


	/**
	 * Generates a reference to the given variable inside the given (possibly nested)
	 * block namespace. This is a string of the form:
	 * ' . $this->_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['varname'] . '
	 * It's ready to be inserted into an "echo" line in one of the templates.
	 * NOTE: expects a trailing "." on the namespace.
	 */
	function generate_block_varref($namespace, $varname)
	{
		// Strip the trailing period.
		$namespace = substr($namespace, 0, strlen($namespace) - 1);

		// Get a reference to the data block for this namespace.
		$varref = $this->generate_block_data_ref($namespace, true);
		// Prepend the necessary code to stick this in an echo line.

		// Append the variable reference.
		$varref .= '[\'' . $varname . '\']';

		$varref = '\' . ( ( isset(' . $varref . ') ) ? ' . $varref . ' : \'\' ) . \'';

		return $varref;

	}


	/**
	 * Generates a reference to the array of data values for the given
	 * (possibly nested) block namespace. This is a string of the form:
	 * $this->_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['$childN']
	 *
	 * If $include_last_iterator is true, then [$_childN_i] will be appended to the form shown above.
	 * NOTE: does not expect a trailing "." on the blockname.
	 */
	function generate_block_data_ref($blockname, $include_last_iterator)
	{
		// Get an array of the blocks involved.
		$blocks = explode(".", $blockname);
		$blockcount = sizeof($blocks) - 1;
		$varref = '$this->_tpldata';
		// Build up the string with everything but the last child.
		for ($i = 0; $i < $blockcount; $i++)
		{
			$varref .= '[\'' . $blocks[$i] . '.\'][$_' . $blocks[$i] . '_i]';
		}
		// Add the block reference for the last child.
		$varref .= '[\'' . $blocks[$blockcount] . '.\']';
		// Add the iterator for the last child if requried.
		if ($include_last_iterator)
		{
			$varref .= '[$_' . $blocks[$blockcount] . '_i]';
		}

		return $varref;
	}

}

?>

先謝謝啦.
頭像
bbsbsai
星球公民
星球公民
文章: 113
註冊時間: 2003-11-20 22:57
來自: Only Money
聯繫:

[討論]你先試試看

文章 bbsbsai »

代碼: 選擇全部

<?php 
/*************************************************************************** 
*                              template.php 
*                            ------------------- 
*   begin                : Saturday, Feb 13, 2001 
*   copyright            : (C) 2001 The phpBB Group 
*   email                : support@phpbb.com 
* 
*   $Id: template.php,v 1.10.2.3 2002/12/21 19:09:57 psotfx Exp $ 
* 
* 
***************************************************************************/ 

/*************************************************************************** 
* 
*   This program is free software; you can redistribute it and/or modify 
*   it under the terms of the GNU General Public License as published by 
*   the Free Software Foundation; either version 2 of the License, or 
*   (at your option) any later version. 
* 
***************************************************************************/ 

/** 
* Template class. By Nathan Codding of the phpBB group. 
* The interface was originally inspired by PHPLib templates, 
* and the template file formats are quite similar. 
* 
*/ 

class Template { 
   var $classname = "Template"; 

   // variable that holds all the data we'll be substituting into 
   // the compiled templates. 
   // ... 
   // This will end up being a multi-dimensional array like this: 
   // $this->_tpldata[block.][iteration#][child.][iteration#][child2.][iteration#][variablename] == value 
\n   // if it's a root-level variable, it'll be like this: 
   // $this->_tpldata[.][0][varname] == value 
   var $_tpldata = array(); 

   // Hash of filenames for each template handle. 
   var $files = array(); 

   // Root template directory. 
   var $root = ""; 

   // this will hash handle names to the compiled code for that handle. 
   var $compiled_code = array(); 

   // This will hold the uncompiled code for that handle. 
   var $uncompiled_code = array(); 

   /** 
    * Constructor. Simply sets the root dir. 
    * 
    */ 
   function Template($root = ".") 
   { 
      $this->set_rootdir($root); 
   } 

   /** 
    * Destroys this template object. Should be called when you're done with it, in order 
    * to clear out the template data so you can load/parse a new template set. 
    */ 
   function destroy() 
   { 
      $this->_tpldata = array(); 
   } 

   /** 
    * Sets the template root directory for this Template object. 
    */ 
   function set_rootdir($dir) 
   { 
      if (!is_dir($dir)) 
      { 
         return false; 
      } 

      $this->root = $dir; 
      return true; 
   } 

   /** 
    * Sets the template filenames for handles. $filename_array 
    * should be a hash of handle => filename pairs. 
    */ 
   function set_filenames($filename_array) 
   { 
      if (!is_array($filename_array)) 
      { 
         return false; 
      } 

      reset($filename_array); 
      while(list($handle, $filename) = each($filename_array)) 
      { 
         $this->files[$handle] = $this->make_filename($filename); 
      } 

      return true; 
   } 


   /** 
    * Load the file for the handle, compile the file, 
    * and run the compiled code. This will print out 
    * the results of executing the template. 
    */ 
   function pparse($handle) 
   { 
      if (!$this->loadfile($handle)) 
      { 
         die("Template->pparse(): Couldn't load template file for handle $handle"); 
      } 

      // actually compile the template now. 
      if (!isset($this->compiled_code[$handle]) || empty($this->compiled_code[$handle])) 
      { 
         // Actually compile the code now. 
         $this->compiled_code[$handle] = $this->compile($this->uncompiled_code[$handle]); 
      } 

      // Run the compiled code. 
      eval($this->compiled_code[$handle]); 
      return true; 
   } 

   /** 
    * Inserts the uncompiled code for $handle as the 
    * value of $varname in the root-level. This can be used 
    * to effectively include a template in the middle of another 
    * template. 
    * Note that all desired assignments to the variables in $handle should be done 
    * BEFORE calling this function. 
    */ 
   function assign_var_from_handle($varname, $handle) 
   { 
      if (!$this->loadfile($handle)) 
      { 
         die("Template->assign_var_from_handle(): Couldn't load template file for handle $handle"); 
      } 

      // Compile it, with the "no echo statements" option on. 
      $_str = ""; 
      $code = $this->compile($this->uncompiled_code[$handle], true, '_str'); 

      // evaluate the variable assignment. 
      eval($code); 
      // assign the value of the generated variable to the given varname. 
      $this->assign_var($varname, $_str); 

      return true; 
   } 

   /** 
    * Block-level variable assignment. Adds a new block iteration with the given 
    * variable assignments. Note that this should only be called once per block 
    * iteration. 
    */ 
   function assign_block_vars($blockname, $vararray) 
   { 
      if (strstr($blockname, '.')) 
      { 
         // Nested block. 
         $blocks = explode('.', $blockname); 
         $blockcount = sizeof($blocks) - 1; 
         $str = '$this->_tpldata'; 
         for ($i = 0; $i < $blockcount; $i++) 
         { 
            $str .= '[\'' . $blocks[$i] . '.\']'; 
            eval('$lastiteration = sizeof(' . $str . ') - 1;'); 
            $str .= '[' . $lastiteration . ']'; 
         } 
         // Now we add the block that we're actually assigning to. 
         // We're adding a new iteration to this block with the given 
         // variable assignments. 
         $str .= '[\'' . $blocks[$blockcount] . '.\'][] = $vararray;'; 

         // Now we evaluate this assignment we've built up. 
         eval($str); 
      } 
      else 
      { 
         // Top-level block. 
         // Add a new iteration to this block with the variable assignments 
         // we were given. 
         $this->_tpldata[$blockname . '.'][] = $vararray; 
      } 

      return true; 
   } 

   /** 
    * Root-level variable assignment. Adds to current assignments, overriding 
    * any existing variable assignment with the same name. 
    */ 
   function assign_vars($vararray) 
   { 
      reset ($vararray); 
      while (list($key, $val) = each($vararray)) 
      { 
         $this->_tpldata['.'][0][$key] = $val; 
      } 

      return true; 
   } 

   /** 
    * Root-level variable assignment. Adds to current assignments, overriding 
    * any existing variable assignment with the same name. 
    */ 
   function assign_var($varname, $varval) 
   { 
      $this->_tpldata['.'][0][$varname] = $varval; 

      return true; 
   } 


   /** 
    * Generates a full path+filename for the given filename, which can either 
    * be an absolute name, or a name relative to the rootdir for this Template 
    * object. 
    */ 
   function make_filename($filename) 
   { 
      // Check if it's an absolute or relative path. 
      if (substr($filename, 0, 1) != '/') 
      { 
             $filename = phpbb_realpath($this->root . '/' . $filename); 
      } 

      if (!file_exists($filename)) 
      { 
         die("Template->make_filename(): Error - file $filename does not exist"); 
      } 

      return $filename; 
   } 


   /** 
    * If not already done, load the file for the given handle and populate 
    * the uncompiled_code[] hash with its code. Do not compile. 
    */ 
   function loadfile($handle) 
   { 
      // If the file for this handle is already loaded and compiled, do nothing. 
      if (isset($this->uncompiled_code[$handle]) && !empty($this->uncompiled_code[$handle])) 
      { 
         return true; 
      } 

      // If we don't have a file assigned to this handle, die. 
      if (!isset($this->files[$handle])) 
      { 
         die("Template->loadfile(): No file specified for handle $handle"); 
      } 

      $filename = $this->files[$handle]; 

      $str = implode("", @file($filename)); 
      if (empty($str)) 
      { 
         die("Template->loadfile(): File $filename for handle $handle is empty"); 
      } 

      $this->uncompiled_code[$handle] = $str; 

      return true; 
   } 



   /** 
    * Compiles the given string of code, and returns 
    * the result in a string. 
    * If "do_not_echo" is true, the returned code will not be directly 
    * executable, but can be used as part of a variable assignment 
    * for use in assign_code_from_handle(). 
    */ 
   function compile($code, $do_not_echo = false, $retvar = '') 
   { 
      // replace \ with \\\ and then ' with \'. 
      $code = str_replace('\\\', '\\\\\\\', $code); 
      $code = str_replace('\'', '\\\\\'', $code); 

      // change template varrefs into PHP varrefs 

      // This one will handle varrefs WITH namespaces 
      $varrefs = array(); 
      preg_match_all('#\{(([a-z0-9\-_]+?\.)+?)([a-z0-9\-_]+?)\}#is', $code, $varrefs); 
      $varcount = sizeof($varrefs[1]); 
      for ($i = 0; $i < $varcount; $i++) 
      { 
         $namespace = $varrefs[1][$i]; 
         $varname = $varrefs[3][$i]; 
         $new = $this->generate_block_varref($namespace, $varname); 

         $code = str_replace($varrefs[0][$i], $new, $code); 
      } 

      // This will handle the remaining root-level varrefs 
      $code = preg_replace('#\{([a-z0-9\-_]*?)\}#is', '\' . ( ( isset($this->_tpldata[\'.\'][0][\'\1\']) ) ? $this->_tpldata[\'.\'][0][\'\1\'] : \'\' ) . \'', $code); 

      // Break it up into lines. 
      $code_lines = explode("
", $code); 

      $block_nesting_level = 0; 
      $block_names = array(); 
      $block_names[0] = "."; 

      // Second: prepend echo ', append ' . "
"; to each line. 
      $line_count = sizeof($code_lines); 
      for ($i = 0; $i < $line_count; $i++) 
      { 
         $code_lines[$i] = chop($code_lines[$i]); 
         if (preg_match('#<!-- BEGIN (.*?) -->#', $code_lines[$i], $m)) 
         { 
            $n[0] = $m[0]; 
            $n[1] = $m[1]; 

            // Added: dougk_ff7-Keeps templates from bombing if begin is on the same line as end.. I think.  
            if ( preg_match('#<!-- END (.*?) -->#', $code_lines[$i], $n) ) 
            { 
               $block_nesting_level++; 
               $block_names[$block_nesting_level] = $m[1]; 
               if ($block_nesting_level < 2) 
               { 
                  // Block is not nested. 
                  $code_lines[$i] = '$_' . $n[1] . '_count = ( isset($this->_tpldata[\'' . $n[1] . '.\']) ) ?  sizeof($this->_tpldata[\'' . $n[1] . '.\']) : 0;'; 
                  $code_lines[$i] .= "
" . 'for ($_' . $n[1] . '_i = 0; $_' . $n[1] . '_i < $_' . $n[1] . '_count; $_' . $n[1] . '_i++)'; 
                  $code_lines[$i] .= "
" . '{'; 
               } 
               else 
               { 
                  // This block is nested. 

                  // Generate a namespace string for this block. 
                  $namespace = implode('.', $block_names); 
                  // strip leading period from root level.. 
                  $namespace = substr($namespace, 2); 
                  // Get a reference to the data array for this block that depends on the 
                  // current indices of all parent blocks. 
                  $varref = $this->generate_block_data_ref($namespace, false); 
                  // Create the for loop code to iterate over this block. 
                  $code_lines[$i] = '$_' . $n[1] . '_count = ( isset(' . $varref . ') ) ? sizeof(' . $varref . ') : 0;'; 
                  $code_lines[$i] .= "
" . 'for ($_' . $n[1] . '_i = 0; $_' . $n[1] . '_i < $_' . $n[1] . '_count; $_' . $n[1] . '_i++)'; 
                  $code_lines[$i] .= "
" . '{'; 
               } 

               // We have the end of a block. 
               unset($block_names[$block_nesting_level]); 
               $block_nesting_level--; 
               $code_lines[$i] .= '} // END ' . $n[1]; 
               $m[0] = $n[0]; 
               $m[1] = $n[1]; 
            } 
            else 
            { 
               // We have the start of a block. 
               $block_nesting_level++; 
               $block_names[$block_nesting_level] = $m[1]; 
               if ($block_nesting_level < 2) 
               { 
                  // Block is not nested. 
                  $code_lines[$i] = '$_' . $m[1] . '_count = ( isset($this->_tpldata[\'' . $m[1] . '.\']) ) ? sizeof($this->_tpldata[\'' . $m[1] . '.\']) : 0;'; 
                  $code_lines[$i] .= "
" . 'for ($_' . $m[1] . '_i = 0; $_' . $m[1] . '_i < $_' . $m[1] . '_count; $_' . $m[1] . '_i++)'; 
                  $code_lines[$i] .= "
" . '{'; 
               } 
               else 
               { 
                  // This block is nested. 

                  // Generate a namespace string for this block. 
                  $namespace = implode('.', $block_names); 
                  // strip leading period from root level.. 
                  $namespace = substr($namespace, 2); 
                  // Get a reference to the data array for this block that depends on the 
                  // current indices of all parent blocks. 
                  $varref = $this->generate_block_data_ref($namespace, false); 
                  // Create the for loop code to iterate over this block. 
                  $code_lines[$i] = '$_' . $m[1] . '_count = ( isset(' . $varref . ') ) ? sizeof(' . $varref . ') : 0;'; 
                  $code_lines[$i] .= "
" . 'for ($_' . $m[1] . '_i = 0; $_' . $m[1] . '_i < $_' . $m[1] . '_count; $_' . $m[1] . '_i++)'; 
                  $code_lines[$i] .= "
" . '{'; 
               } 
            } 
         } 
         else if (preg_match('#<!-- END (.*?) -->#', $code_lines[$i], $m)) 
         { 
            // We have the end of a block. 
            unset($block_names[$block_nesting_level]); 
            $block_nesting_level--; 
            $code_lines[$i] = '} // END ' . $m[1]; 
         } 
         else 
         { 
            // We have an ordinary line of code. 
            if (!$do_not_echo) 
            { 
               $code_lines[$i] = 'echo \\'' . $code_lines[$i] . '\' . "\\
";'; 
            } 
            else 
            { 
               $code_lines[$i] = '$' . $retvar . '.= \'' . $code_lines[$i] . '\' . "\\
";'; 
            } 
         } 
      } 

      // Bring it back into a single string of lines of code. 
      $code = implode("
", $code_lines); 
      return $code   ; 

   } 


   /** 
    * Generates a reference to the given variable inside the given (possibly nested) 
    * block namespace. This is a string of the form: 
    * ' . $this->_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['varname'] . ' 
    * It's ready to be inserted into an "echo" line in one of the templates. 
    * NOTE: expects a trailing "." on the namespace. 
    */ 
   function generate_block_varref($namespace, $varname) 
   { 
      // Strip the trailing period. 
      $namespace = substr($namespace, 0, strlen($namespace) - 1); 

      // Get a reference to the data block for this namespace. 
      $varref = $this->generate_block_data_ref($namespace, true); 
      // Prepend the necessary code to stick this in an echo line. 

      // Append the variable reference. 
      $varref .= '[\'' . $varname . '\']'; 

      $varref = '\' . ( ( isset(' . $varref . ') ) ? ' . $varref . ' : \'\' ) . \''; 

      return $varref; 

   } 


   /** 
    * Generates a reference to the array of data values for the given 
    * (possibly nested) block namespace. This is a string of the form: 
    * $this->_tpldata['parent'][$_parent_i]['$child1'][$_child1_i]['$child2'][$_child2_i]...['$childN'] 
    * 
    * If $include_last_iterator is true, then [$_childN_i] will be appended to the form shown above. 
    * NOTE: does not expect a trailing "." on the blockname. 
    */ 
   function generate_block_data_ref($blockname, $include_last_iterator) 
   { 
      // Get an array of the blocks involved. 
      $blocks = explode(".", $blockname); 
      $blockcount = sizeof($blocks) - 1; 
      $varref = '$this->_tpldata'; 
      // Build up the string with everything but the last child. 
      for ($i = 0; $i < $blockcount; $i++) 
      { 
         $varref .= '[\'' . $blocks[$i] . '.\'][$_' . $blocks[$i] . '_i]'; 
      } 
      // Add the block reference for the last child. 
      $varref .= '[\'' . $blocks[$blockcount] . '.\']'; 
      // Add the iterator for the last child if requried. 
      if ($include_last_iterator) 
      { 
         $varref .= '[$_' . $blocks[$blockcount] . '_i]'; 
      } 

      return $varref; 
   } 

} 

?>
天地人
星球普通子民
星球普通子民
文章: 30
註冊時間: 2004-04-09 07:50
來自: hk

[問題][問題]to:bbsbsai

文章 天地人 »

已試了.按照你的指示更改..但問題還是一樣\r
我自己亦找尋錯誤當中
阿鎔
星球普通子民
星球普通子民
文章: 16
註冊時間: 2004-04-10 19:35

文章 阿鎔 »

"董事長"的功能還在測試吧?.?
希望動機不明大大加油加油喔~^^

為努力不懈,無私付出的人,致上最重高敬意~
天地人
星球普通子民
星球普通子民
文章: 30
註冊時間: 2004-04-09 07:50
來自: hk

[問題]

文章 天地人 »

找了一天還找不到錯誤,,還在努力中
mailt01
星球普通子民
星球普通子民
文章: 12
註冊時間: 2003-10-22 19:07

文章 mailt01 »

不好意思

我在買賣股票時都會出現這個訊息\r

代碼: 選擇全部

一般錯誤 
  
無法更新股票總數及董事長名單\r

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE stock_id = 3' at line 4

UPDATE phpbb_vault_exchange SET stock_total = 60 - 0, chairman = WHERE stock_id = 3

Line : 419
File : d:\windows2003service\\www\tw\vault.php 

圖片 :
圖檔

可是回到股票交易市場裡面發現買賣的動作還是有進行
我是使用這個檔案 http://gop.pda.com.tw/vault_0415.rar

是否有辦法解決?
Arisa520
星球公民
星球公民
文章: 206
註冊時間: 2003-10-27 00:26

文章 Arisa520 »

mailt01 寫:不好意思

..............述刪\r

可是回到股票交易市場裡面發現買賣的動作還是有進行
我是使用這個檔案 http://gop.pda.com.tw/vault_0415.rar\r

是否有辦法解決?
你可以問一下這位jikey大大~
前面幾頁他好像也有類似的問題~
他說解決了.... 8-)
mailt01
星球普通子民
星球普通子民
文章: 12
註冊時間: 2003-10-22 19:07

文章 mailt01 »

難道我跟他一樣式SQL版本不符...
天阿...
難道我跟股市Mod沒緣><
剛剛自己找了一下...
還找不出到底錯在哪= =||

jikey 你該不會是重灌資料庫吧...
無敵肉腳
星球公民
星球公民
文章: 91
註冊時間: 2004-03-05 16:59
來自: 太平洋區-沙庫索島

文章 無敵肉腳 »

動大咩.........
我裝了股市外掛.........
沒出現什麼董市長........
在後台有控制出現..........
還有就是.....股票如果只有一個人買1一千張..一張10....設定是100張...
那是不是超過.......那照理說該股票是熱門票.......為何股票設定金額是10元是100張...買超過一千張...股價卻是...剩下6元....不會漲.......那沒人買的股票卻漲了........
網站位置:http://playgame.no-ip.org/phpbb2/
測試帳號:海之聲\r
密碼是:1234
幫我看一下...如須要後台..那偶就給你admin帳號
圖檔
傑尼斯
星球普通子民
星球普通子民
文章: 1
註冊時間: 2004-04-21 16:59

文章 傑尼斯 »

請問大大~
我安裝好之後 有個地方有錯誤~
在我要買入幾張那邊 我按送出之後 出現:

Could not obtain items pets information

DEBUG MODE

SQL Error : 1054 Unknown column 'chairman' in 'field list'

SELECT stock_total , stock_price , stock_id , chairman FROM jaynese_vault_exchange ORDER BY stock_id

Line : 320
File : c:\appserv3.0\www\jaynese\vault.php

請問一下這是怎麼了!? 麻煩一下囉 謝謝
meamea
星球普通子民
星球普通子民
文章: 17
註冊時間: 2003-05-12 06:14

文章 meamea »

傑尼斯 寫:請問大大~
SQL Error : 1054 Unknown column 'chairman' in 'field list'
請問一下這是怎麼了!? 麻煩一下囉 謝謝
這個不用麻煩大大~小小來回答就好了 :oops:
請確認table裡面有沒有chairman這個欄位,沒有的話就新增進去就好囉 8-)

嗚嗚嗚
我的「無法更新股票總數及董事長名單 」這個問題還是不知道怎麼解決說 ><~
我的MySQL 版本 4.0.16-nt
是跟著AppServ一起裝的,不知道可不可以分開更新 :-?
動機不明
喝咖啡的綠皮猴
喝咖啡的綠皮猴
文章: 1179
註冊時間: 2002-03-06 20:37
來自: GOP (重啟)

文章 動機不明 »

我不曉得是不是版本的問題...
不過倒是很多人都有遇到無法更新的情況...

試試看:
  • ● 刪除原來的 chairman 欄位
    ● 改輸入以下

    代碼: 選擇全部

    ALTER TABLE `phpbb2`.`phpbb_vault_exchange` ADD `chairman` INT(8) DEFAULT '2';
    phpbb2 <- 是資料庫名稱
    2 <- 是管理員ID (請自行更改)

    ● 將每個股票各跑一次 (目的是取得董事長頭銜)
應該就可以了...
非官方外掛問題區公告: [必看]請配合發問格式及明確主題發問(2006 02/24更新)
七點要求:
1. 發問前先搜尋,確定沒有重複後再發表
2. 主題要明確
3. 依照發問格式
4. 禁連續推文
5. 請盡量減少使用地方性語言
6. 解決問題後請修改第一篇主題,並感謝曾經幫過你的前輩們 ^^
7. 請不要將檔案內容完整貼出喔! 只要提供問題行及上下各五行就可以了
主題已鎖定

回到「外掛問題討論」