vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Include a php file on main forum (https://vborg.vbsupport.ru/showthread.php?t=113428)

Anakior 04-19-2006 10:58 AM

Include a php file on main forum
 
Hi,

I'm french so sorry for my really bad english.

I'm working on an simple script who makes random quotations from my sql. It's working nice in stand alone. I put it here :

PHP Code:

include("includes/config.php");

//Connection
$connections mysql_connect($config['MasterServer']['servername'], $config['MasterServer']['username'], $config['MasterServer']['password']) or die ('Impossible de se connecter !');
mysql_select_db($config['Database']['dbname']) or die ('Impossible de s?lectionner la base de donn?es !');

//Select for quote
$query "SELECT id, nom, nom_auteur, citation FROM pdp";
$result mysql_query($query) or die ("Erreur dans la requ?te : $query. " mysql_error());


srand((double)microtime()*10000);

$num mysql_num_rows($result);

$nb rand(0$num-1);

mysql_data_seek($result$nb);

$ligne mysql_fetch_assoc($result);

echo 
'<table border="0" align="center">';
echo 
'<tr>';
echo 
'<td><div align="left"><em>"'.$ligne['citation'].'"</em></div></td>';
echo 
'</tr>';
echo 
'<tr>';
echo  
'<td><div align="right"><b>'.$ligne['nom'].'</b></div></td>';
echo 
'</tr>';
echo 
'</table>'

But i want to put it on my vb forum page above the Mark Forums Read and the View Forum Leaders.

I have followed the method on this page :
http://www.vbulletin.com/forum/showthread.php?t=173937

Unfortunately without success because the forum give me this error :

Fatal error: Call to a member function on a non-object in blabla/functions_user.php on line 161

Somes ideas to make it work?^^

Thanks in advance for your help :up:


All times are GMT. The time now is 10:23 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01023 seconds
  • Memory Usage 1,726KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete