Author |
Message |
ena
New Member


Joined: Jul 14, 2005
Posts: 20
|
Posted:
Wed Oct 12, 2005 7:13 pm |
|
hello again
well i have created phpbb forum, that is not embbeded to phpnuke. I have the below code:
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  |
|
|
|
 |
Raven
Site Admin/Owner

Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Wed Oct 12, 2005 8:08 pm |
|
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. |
|
|
|
 |
ena

|
Posted:
Wed Oct 12, 2005 8:15 pm |
|
it is on deferrent database....where can i find which connection has the other database? |
|
|
|
 |
ena

|
Posted:
Wed Oct 12, 2005 8:22 pm |
|
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? |
|
|
|
 |
Raven

|
Posted:
Wed Oct 12, 2005 8:35 pm |
|
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. |
|
|
|
 |
ena

|
Posted:
Wed Oct 12, 2005 8:48 pm |
|
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
|
|
|
|
|
 |
ena

|
Posted:
Thu Oct 13, 2005 6:27 pm |
|
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;; |
|
|
|
|
 |
|