Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 6.9
Author Message
ena
New Member
New Member



Joined: Jul 14, 2005
Posts: 20

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

hello again Smile

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

Quote:
www.xania.gr/block-Forums.txt


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: 17088

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

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
ena







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

it is on deferrent database....where can i find which connection has the other database?
 
ena







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

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







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

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







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

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







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

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;;
 
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 6.9

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
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©