Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 07-29-2003, 04:52 AM
WoodiE WoodiE is offline
 
Join Date: May 2002
Posts: 317
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How to insert this PHP line?!?!

Hello, I'm wanting to install a quote script called phpMyQuote on my forum.

I'd like to display the quotes on the forum home, but I am unsure of how to or where to insert the php code. Below is part of the Readme file:

Quote:
How to install Random Quote Viewer into your webpage:

1.) The first thing is to edit file quotes.inc.php. You just have to change the line:
$path = "/home/httpd/virtual/temp/myQuotes/";

Just write the right path where config.inc.php exist !

2.) Now open your personal webpage and go to the position where random quote should be displayed. You have to include file quotes.inc.php and then you just call function ShowQuote() which return string with quote:

Example:
include("quotes.inc.php");
echo ShowQuote();

You should also check for the right path in include statement.
If you dont use mysql at your webpage the code should be like this:

Example:
include("quotes.inc.php");
$link = ConnectMysql();
echo ShowQuote();
DisconnectMysql($link);

We have also include example which can be found in file testQuote.php
I know I have the script installed correctly because the testQuote.php displays them just fine, I just don't have a clue on how to get this on my forum home, would anyone care to help me out?


-Michael
Reply With Quote
  #2  
Old 07-29-2003, 04:48 PM
Gary King's Avatar
Gary King Gary King is offline
 
Join Date: Jan 2002
Posts: 2,046
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Open forum/index.php and find:
PHP Code:
require('./global.php'); 
Replace with
PHP Code:
require('./global.php');
include(
"quotes.inc.php");

$showquote=ShowQuote(); 
Now place
PHP Code:
$showquote 
in your forumhome template wherever you want it to show up.
Reply With Quote
  #3  
Old 07-29-2003, 08:10 PM
WoodiE WoodiE is offline
 
Join Date: May 2002
Posts: 317
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I receive this error when I do the above:

LINE 8:Table 'rcnitro_forum.quotes' doesn't exist

What would cause that?

-Michael
Reply With Quote
  #4  
Old 07-29-2003, 08:41 PM
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Location: England
Posts: 9,071
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You don't have the table in your database
Reply With Quote
  #5  
Old 07-29-2003, 08:44 PM
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Location: CA University
Posts: 1,696
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Perhaps replace:
PHP Code:
require('./global.php'); 
include(
"quotes.inc.php"); 

$showquote=ShowQuote(); 
With:
PHP Code:
include("quotes.inc.php"); 
$showquote=ShowQuote();

require(
'./global.php'); 
My only guess is the DB connections are getting interlinked or something. Maybe it is searching for rcnitro_forum on the vBulletin database? Which, of course, is the wrong thing.
Reply With Quote
  #6  
Old 07-29-2003, 08:46 PM
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Location: CA University
Posts: 1,696
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh, or as Mist said, you didn't add the table into your database.
Reply With Quote
  #7  
Old 07-29-2003, 08:56 PM
WoodiE WoodiE is offline
 
Join Date: May 2002
Posts: 317
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm this script looks so easy, but its kicking my butt right now.

Here is what I have setup for my config.inc.php file:

PHP Code:
<?
$host     = "localhost";
$username = "rcnitro_quotes";
$password = "************";
$database = "rcnitro_quote";
$mytable  = "quotes";
?>
I have already imported/ran or whatever you call it the "dump.sql" and have added two test quotes. The database even shows them as being added. I goto quotes admin panel and I can add, edit, and delete quotes just fine.

So what am I doing wrong?


-Michael


EDIT: One thing I did forget to mention... the quotes script is installed in "public_html/quotes" while the forum is installed on "public_html/forum" if that makes any difference.
Reply With Quote
  #8  
Old 07-29-2003, 09:29 PM
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Location: CA University
Posts: 1,696
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If config.inc.php is located in that directory, than what you should do is:

PHP Code:
require_once('global.php');

chdir('../quotes/');
require_once(
'config.inc.php');
$showquote=ShowQuote(); 
I believe..
Reply With Quote
  #9  
Old 07-29-2003, 09:54 PM
WoodiE WoodiE is offline
 
Join Date: May 2002
Posts: 317
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Done as you suggested and received this error:

Fatal error: Call to undefined function: showquote() in /home/rcnitro/public_html/forum/index.php on line 21

-Michael
Reply With Quote
  #10  
Old 07-29-2003, 09:56 PM
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Location: CA University
Posts: 1,696
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry, I made you reference to the wrong file ... ^^

Replace:

config.inc.php

With:

quotes.inc.php

Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:48 PM.


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.04438 seconds
  • Memory Usage 2,265KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (7)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete