|
how to find out MySQL database
|
|
Topic Started: Sep 7 2005, 05:31 PM (415 Views)
|
|
CrazyaZnBoii
|
Sep 7 2005, 05:31 PM
Post #1
|
- Posts:
- 9
- Group:
- Members
- Member
- #63,061
- Joined:
- July 30, 2005
|
how to find out the link MySQL database username and password because I am trying to make a news thing from a forum but i dont know how to find out so anyone have any idea?
|
|
|
| |
|
Nemesis
|
Sep 7 2005, 05:56 PM
Post #2
|
- Posts:
- 537
- Group:
- Banned
- Member
- #47,941
- Joined:
- March 16, 2005
|
InvisionFree does not give you access to the MySQL database...
|
|
|
| |
|
CrazyaZnBoii
|
Sep 7 2005, 05:59 PM
Post #3
|
- Posts:
- 9
- Group:
- Members
- Member
- #63,061
- Joined:
- July 30, 2005
|
because i want to use this code on my website but i need my database info to show my news unless there another way to do it
that the news code i want to use on my main page
- Code:
-
<?php
##################################################### ##### IPB News Script v1.1 by Adam Stasiniewicz ##### ##### Copyright © 2004 Adam Stasiniewicz ##### ##### http://www.adamscs.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.
# This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details.
# You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
############################################################################################## ##### Configuration section, please edit this info to meet your specific setup and needs ##### ##############################################################################################
//database address $databaseip = 'localhost'; //name of the database the stores IPB $databasename = 'ipb'; //database username $username = 'yourmysqlusernamegoeshere'; //database password $password = 'password'; //the forum id of the news forum (look for the XX in index.php?showforum=XX part of the forums URL) $forumid = '2'; //how many news post you want to show $topicrows = '10';
## ## IPB 2.0-only Settings ## // enter the name of the emoticons set you want to use on the homepage (look in your skin config setting, or else leave it as is) $emoticons = 'default'; // Enter the name of the image directory that you want the script to use (look in your skin config setting, or else leave it as is) $img_dir = '1';
########################################################## ##### Code starts here, scroll down to edit template ##### ##########################################################
mysql_connect ($databaseip, $username, $password); mysql_select_db ($databasename); $topicq = mysql_query ("select* from ibf_topics where forum_id=".$forumid." order by start_date desc"); for ($i=0; $i <$topicrows; $i++) { $topicrow = mysql_fetch_array($topicq); $titleid = $topicrow["tid"]; $topictitle = ($topicrow["title"]); $postq = mysql_query ("SELECT * FROM `ibf_posts` where topic_id = ".$titleid." and new_topic = 1 order by post_date"); $postfetch = mysql_fetch_array($postq); $postrow = $postfetch["post"]; $unixdate = $topicrow["start_date"]; $date = date("F jS, Y",$unixdate); $writter = $topicrow["starter_name"]; $postrow = str_replace('<#EMO_DIR#>', $emoticons, $postrow); $postrow = str_replace('<#IMG_DIR#>', $img_dir, $postrow);
######################################################################################################################### ##### Everything between the echo (' and '); is the template for the "repeating" section. ##### ##### Useful variables: ##### ##### '.$topictitle.' = The title of the news post. ##### ##### '.$postrow.' = The actual text of the news post. ##### ##### '.$writter.' = The name of the person that wrote the news post. ##### ##### '.$date.' = The date of the news post. ##### ##### '.$titleid.' = The numeric number IPB givies to the topic. Useful if you want to generate a "comments" link. ##### ##### ##### ##### Below is an example, edit it to meet your needs. ##### ######################################################################################################################### echo ('
<p>'.$topictitle.'</p> <p>'.$postrow.'</p> <p>'.$writter.'</p> <p>'.$date.'</p> <p><a href="http://forums.yourwebsite.com/index.php?showtopic='.$titleid.'">Comments?</a></p> <p><hr></p>
'); } ?>
|
|
|
| |
|
Rory
|
Sep 7 2005, 06:21 PM
Post #4
|
- Posts:
- 6,147
- Group:
- Members
- Member
- #451
- Joined:
- January 25, 2003
|
That script is for Invision Power Board, not InvisionFree. You do not have access to the database with InvisionFree, and even if you did, it would be incompatable with that script.
|
|
|
| |
|
CrazyaZnBoii
|
Sep 7 2005, 06:27 PM
Post #5
|
- Posts:
- 9
- Group:
- Members
- Member
- #63,061
- Joined:
- July 30, 2005
|
Is there any other way to show news on a front page?
|
|
|
| |
|
Anreem
|
Sep 7 2005, 06:33 PM
Post #6
|
- Posts:
- 174
- Group:
- Members
- Member
- #7,890
- Joined:
- November 22, 2003
|
Yes, just turn on IF Dynamic Lite
|
|
|
| |
|
CrazyaZnBoii
|
Sep 7 2005, 06:41 PM
Post #7
|
- Posts:
- 9
- Group:
- Members
- Member
- #63,061
- Joined:
- July 30, 2005
|
I mean showing it on a website not on the portal
|
|
|
| |
| 1 user reading this topic (1 Guest and 0 Anonymous)
|