PHP Web Host - Quality Web Hosting For All PHP Applications Just Great Software
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
ena
New Member
New Member


Joined: Jul 14, 2005
Posts: 20

PostPosted: Wed Oct 12, 2005 7:13 pm Reply with quote Back to top

hello again Smile

well i have created phpbb forum, that is not embbeded to phpnuke. I have the below code:

Quote:
Only registered users can see links on this board!
Get registered or login to the forums!


that code take the posts from forum that is embbeded to phpnuke, and show it in a block on phpnuke.
i hope to understand until now.

the new phpbb is on the same server with phpnuke. Can i change something to the code above and take the post etc from new phpbb??

thank you in advanced Smile
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 15235
Location: Kansas

PostPosted: Wed Oct 12, 2005 8:08 pm Reply with quote Back to top

Start by replacing all occurrences of $prefix with the prefix of your stand alone phpbb. Then, if it is not on the same database, you will need to esatblish a separate mysql connection. Right now the block is using the $dbi connection which is to phpnuke. If the phpbb tables are all on the same database as phpnuke, then you do not have to worry about $dbi.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
ena
New Member
New Member


Joined: Jul 14, 2005
Posts: 20

PostPosted: Wed Oct 12, 2005 8:15 pm Reply with quote Back to top

it is on deferrent database....where can i find which connection has the other database?
View user's profile Send private message
ena
New Member
New Member


Joined: Jul 14, 2005
Posts: 20

PostPosted: Wed Oct 12, 2005 8:22 pm Reply with quote Back to top

as i can see from control panel, i see that all databases connected with DBI!

Propably i must as you said the $prefix

for example there is:

Code:
$result1 = sql_query("SELECT t.topic_id, t.topic_last_post_id, t.topic_title, f.forum_name, f.forum_id [b]FROM ".$prefix."_bbtopics t, ".$prefix."_bbforums[/b] f where t.forum_id=f.forum_id and f.auth_view=0  ORDER BY t.topic_last_post_id DESC LIMIT 20", $dbi);


i should do:?

Code:
$result1 = sql_query("SELECT t.topic_id, t.topic_last_post_id, t.topic_title, f.forum_name, f.forum_id FROM [b]phpbb1.phpbb_bbtopics t, phpbb1.phpbb_forums[/b] f where t.forum_id=f.forum_id and f.auth_view=0  ORDER BY t.topic_last_post_id DESC LIMIT 20", $dbi);


something like the above?
View user's profile Send private message
Raven
Site Admin/Owner


Joined: Aug 27, 2002
Posts: 15235
Location: Kansas

PostPosted: Wed Oct 12, 2005 8:35 pm Reply with quote Back to top

No, that's not the same $dbi. That's just an example in cPanel. $dbi is set in phpnuke and connects to your database in config.php. If the phpbb tables do not show up in phpmyadmin when you look at your nuke table, then they are not on the same database.
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
ena
New Member
New Member


Joined: Jul 14, 2005
Posts: 20

PostPosted: Wed Oct 12, 2005 8:48 pm Reply with quote Back to top

well, i can't find which connection it is use!! Could you help me to find it?

Secondly, the change that i must do is that:?

Code:
FROM phpbb1.phpbb_bbtopics t, phpbb1.phpbb_forums

from that:
Code:
FROM ".$prefix."_bbtopics t, ".$prefix."_bbforums
View user's profile Send private message
ena
New Member
New Member


Joined: Jul 14, 2005
Posts: 20

PostPosted: Thu Oct 13, 2005 6:27 pm Reply with quote Back to top

i did it. i find the code below:

Code:
$p_user="user";
$p_pass="pass";
$p_db="dbname";
$p_host="localhost";
$p_prefix="phpbb";

$n_user="$dbuname";
$n_pass="$dbpass";
$n_db="$dbname";
$n_host="$dbhost";
$n_prefix="$prefix";

//connect to db's
$p_con=mysql_connect($p_host,$p_user,$p_pass);
$n_con=mysql_connect("localhost","username","pass");

global $dbi, $sitename, $admin, $ThemeSel;
mysql_select_db($p_db,$p_con);


but i have one more problem. Is shows me few data and i have an error:

Code:
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home2/***/public_html/includes/sql_layer.php on line 286


the line 286 is that:

Quote:
case "MySQL":
if ($row = mysql_fetch_row($res)) {
return $row;
} else {
print (mysql_error());
}
break;;
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2008 by Raven
Proud to be listed at Lobo Links Web Directory

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::

:: fisubice Theme Recoded To 100% W3C CSS & HTML 4.01 Transitional Compliance by Raven and 64bitguy ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum