https://www.icyphoenix.com/viewtopic.php?f=35&t=4996
-----------------------------------
gearhead
Thu 06 Nov, 2008 02:14

SOLVED - Php Error In Blocks_imp_random_quote.php
-----------------------------------
Hi everyone. I'm running IP 1.2.0.27c .

I've had IP for a long time, and love it. 

Right now, I'm having a php error. It happens when I try to use the random quote block on my home page.

Here's the error message: [spoiler]Warning: include_once(./language/lang_/lang_randomquote.php) [function.include-once]: failed to open stream: No such file or directory in /home/.foxie/gearmeister5/portal.thegtsaga.net/main/blocks/blocks_imp_random_quote.php on line 31

Warning: include_once() [function.include]: Failed opening './language/lang_/lang_randomquote.php' for inclusion (include_path='.:/usr/local/php5/lib/php:/usr/local/lib/php') in /home/.foxie/gearmeister5/portal.thegtsaga.net/main/blocks/blocks_imp_random_quote.php on line 31
[/spoiler]

here's the blocks_imp_random_quote.php:

[spoiler]<?php
/***************************************************************************
*                     blocks_imp_random_quote.php
*                        -------------------
*   begin                : 2007/02/06
*   copyright            : Mighty Gorgon
*   website              : http://www.mightygorgon.com
*   email                : mightygorgon@mightygorgon.com
*
***************************************************************************/

/***************************************************************************
*
*   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.
*
***************************************************************************/

if ( !defined('IN_PHPBB') )
{
	die('Hacking attempt');
}

if(!function_exists(imp_random_quote_func))
{
	function imp_random_quote_func()
	{
		global $lang, $template, $phpbb_root_path, $phpEx;
		include_once($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_randomquote.' . $phpEx);
		$randomquote_phrase = $randomquote[rand(0, count($randomquote) - 1)];
		$template->assign_vars(array(
			'RANDOM_QUOTE' => $randomquote_phrase,
			)
		);
	}
}

imp_random_quote_func();

?>[/spoiler]

There's an error in line 31? 

I'm getting pretty good at mysql, but need to study php more in depth, so I can solve more issues myself. Maybe a simple php syntax error?

Thanks in advance.


-----------------------------------
Limun
Thu 06 Nov, 2008 05:28

Re: Php Error In Blocks_imp_random_quote.php
-----------------------------------
i would check if u have in [b]all[/b] your "lang_ " this file [b]lang_randomquote.php[/b]


-----------------------------------
gearhead
Thu 06 Nov, 2008 06:42

Re: Php Error In Blocks_imp_random_quote.php
-----------------------------------
So, I must have more than just English to make random quote php work?

Thanks Limun.

 :?:

P.S. the default random quotes work perfect on forum.php

(forum view)


-----------------------------------
Limun
Thu 06 Nov, 2008 11:03

Re: Php Error In Blocks_imp_random_quote.php
-----------------------------------
[quote user="gearhead" post="33710"]So, I must have more than just English to make random quote php work?

Thanks Limun.

 :?:

P.S. the default random quotes work perfect on forum.php

(forum view)[/quote]

you can do this 

open your block_imp_random_quote.php

FIND
[code linenumbers=false]global $lang, $template, $phpbb_root_path, $phpEx; [/code]

REPLACE WITH
[code linenumbers=false]global $lang, $board_config, $template, $phpbb_root_path, $phpEx; [/code]

let us know if help :wink:


-----------------------------------
gearhead
Fri 07 Nov, 2008 02:54

Re: Php Error In Blocks_imp_random_quote.php
-----------------------------------
Thanks. The error is gone, but there is no quote in the block.

any ideas?

Anyway, I'm using a javascript random quote on my home page now, and new quoted can be added, as many as you want.

 :)


-----------------------------------
fucile
Fri 07 Nov, 2008 05:29

Re: Php Error In Blocks_imp_random_quote.php
-----------------------------------
Sorry for my bad english

The mod " Random Quote " needed the this line

[code syntax=php]

if(!function_exists(imp_random_quote_func))
{
	function imp_random_quote_func()
	{
       global $lang, $template, $board_config, $portalconfig, $phpbb_root_path, $phpEx, $randomquote; 	 
       include_once($phpbb_root_path . 'includes/page_header.' . $phpEx);
	   include_once($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_randomquote.' . $phpEx);
		$randomquote_phrase = $randomquote[rand(0, count($randomquote) - 1)];
		$template->assign_vars(array(
			'RANDOM_QUOTE' => $randomquote_phrase,

[/code]

Bye Fucile


-----------------------------------
gearhead
Sat 08 Nov, 2008 17:09

Re: Php Error In Blocks_imp_random_quote.php
-----------------------------------
Thanks Fucile;

That totally fixed the problem!!!

 :mricy:  :mrgreen:  :mrblue:


