Clan Adverts

www.afgserv.com

 

www.clan-themes.co.uk :: View topic - Forums center block question

 Welcome To Clan Themes 

As the board grows please remember the Search Option and we hope you find our community useful.

We also monitor Private Messages to stop members from abusing our sites system.
If you are asking for assistance please provide your site link and nuke version, Thanks.

Forums center block question
Goto page 1, 2, 3, 4, 5, 6, 7  Next

74 Replies / 8098 Views


Post new topic   Reply to topic  

   www.clan-themes.co.uk Forum Index » General PhpNuke

View previous topic :: View next topic


dakota
Reputation: 474.2
Local time: 8:14 AM

usa.gif

Status: Offline
0.13 posts per day
Medals: 0

Joined: Apr 07, 2007
Last Visit: 30 Oct 2008
Posts: 77
Points: 734 

Post Forums center block question Posted: Mon Jul 30, 2007 3:36 pm   

Shop Purchases:
Counter Strike (Sabre) Theme · Clan Roster v1.7 Php Nuke Module

Hi was wandering if it is possible to code the top 5 post from forums center block using PHPbb3.0

I have phpbb forums in a seperate database due to my website getting hacked tired of losing my forums. Floppy is this something you could code for me. Its the block that shows 5 post and has the users avatars underneath with top posters on the forum thx

My website is www.valhallaclan.com just redid it
 

 
View user's profileSend private messageVisit poster's website Reply with quote

floppy
Reputation: 1791.9
votes: 10
Local time: 10:14 AM
Location: Jackson Mississippi
usa.gif

Status: Offline
2.78 posts per day
Medals: 1 (View more...)
Dedicated User (Amount: 1)
Clan Themes Scripts/Coder
Clan Themes Scripts/Coder
Joined: Nov 14, 2006
Last Visit: 19 Nov 2008
Posts: 2052
Points: 2525 

Post Forums center block question Posted: Mon Jul 30, 2007 3:51 pm   

Shop Purchases:
Clan Roster 2.0

Are you using the same database or a different one?

Oh btw bro. I don't really code anything for anyone unless you plan on paying me for my time spent. I would rather teach you something that you can possibly teach someone else or use in the future.
 

 
View user's profileSend private messageVisit poster's website Reply with quote

dakota
Reputation: 474.2
Local time: 8:14 AM

usa.gif

Status: Offline
0.13 posts per day
Medals: 0

Joined: Apr 07, 2007
Last Visit: 30 Oct 2008
Posts: 77
Points: 734 

View user's profileSend private messageVisit poster's website Reply with quote




floppy
Reputation: 1791.9
votes: 10
Local time: 10:14 AM
Location: Jackson Mississippi
usa.gif

Status: Offline
2.78 posts per day
Medals: 1 (View more...)
Dedicated User (Amount: 1)
Clan Themes Scripts/Coder
Clan Themes Scripts/Coder
Joined: Nov 14, 2006
Last Visit: 19 Nov 2008
Posts: 2052
Points: 2525 

Post Forums center block question Posted: Mon Jul 30, 2007 6:02 pm   

Shop Purchases:
Clan Roster 2.0

Its honestly not that hard in concept. If you can figure out how to change the table names to match the new tables in your phpbb3 database you should be ok with my instructions.

Here is an example

Find
Code:
".$prefix."_users


Change To
Code:
mybbtable_users


Ok lets get started. Yeah all excited I know. Keep in mind I have not looked at this code once ever Angel Just gonna wing it.

Find
Code:
global $db, $prefix


Something like the above

Change to
Code:
$server = 'localhost';
$username = 'db_uname';
$password = 'password';
$database = 'db_name';
$link = mysql_connect($server,$username,$password);
mysql_select_db($database);


This is kinda tricky so try to stay with me. Nuke uses the string value $db to connect to the database.

So for every instance of
Code:
$db->sql_query


You need to replace with the mysql equivalent

Code:
mysql_query


And so on

Another example
Code:
$db->sql_numrows


Replace with mysql equivalent
Code:
mysql_num_rows


Then after all is said and done at the bottom of the file close to ?> you need to close the db connection
Code:
mysql_close($link);


Lets review the steps
1.Close to the top of the file replace globals with the new connect string to the phpbb3 database
2.Find the old table names (".$prefix."_bbtopics <--or whatever they may be) and replace with the new table names from the phpbb3 database.
3.Replace $db->sql_query with the equvalent mysql_query and so on
4. Close out the database.

In theory thats the steps. Lets see how far you can get without my help.
 

 
View user's profileSend private messageVisit poster's website Reply with quote

floppy
Reputation: 1791.9
votes: 10
Local time: 10:14 AM
Location: Jackson Mississippi
usa.gif

Status: Offline
2.78 posts per day
Medals: 1 (View more...)
Dedicated User (Amount: 1)
Clan Themes Scripts/Coder
Clan Themes Scripts/Coder
Joined: Nov 14, 2006
Last Visit: 19 Nov 2008
Posts: 2052
Points: 2525 

View user's profileSend private messageVisit poster's website Reply with quote

dakota
Reputation: 474.2
Local time: 8:14 AM

usa.gif

Status: Offline
0.13 posts per day
Medals: 0

Joined: Apr 07, 2007
Last Visit: 30 Oct 2008
Posts: 77
Points: 734 

View user's profileSend private messageVisit poster's website Reply with quote


Far Cry 2



floppy
Reputation: 1791.9
votes: 10
Local time: 10:14 AM
Location: Jackson Mississippi
usa.gif

Status: Offline
2.78 posts per day
Medals: 1 (View more...)
Dedicated User (Amount: 1)
Clan Themes Scripts/Coder
Clan Themes Scripts/Coder
Joined: Nov 14, 2006
Last Visit: 19 Nov 2008
Posts: 2052
Points: 2525 

Post Forums center block question Posted: Mon Jul 30, 2007 6:36 pm   

Shop Purchases:
Clan Roster 2.0

http://us2.php.net/manual/en/ref.mysql.php

At the very bottom are all the mysql functions you will ever need to know lol. I hope that is helpful.

Here is a better connect script taken from that page. It has some debugging built in to help you.

Code:
// Connecting, selecting database
$link = mysql_connect('mysql_host', 'mysql_user', 'mysql_password')
    or die('Could not connect: ' . mysql_error());
echo 'Connected successfully';
mysql_select_db('my_database') or die('Could not select database');
 

 
View user's profileSend private messageVisit poster's website Reply with quote

dakota
Reputation: 474.2
Local time: 8:14 AM

usa.gif

Status: Offline
0.13 posts per day
Medals: 0

Joined: Apr 07, 2007
Last Visit: 30 Oct 2008
Posts: 77
Points: 734 

View user's profileSend private messageVisit poster's website Reply with quote

floppy
Reputation: 1791.9
votes: 10
Local time: 10:14 AM
Location: Jackson Mississippi
usa.gif

Status: Offline
2.78 posts per day
Medals: 1 (View more...)
Dedicated User (Amount: 1)
Clan Themes Scripts/Coder
Clan Themes Scripts/Coder
Joined: Nov 14, 2006
Last Visit: 19 Nov 2008
Posts: 2052
Points: 2525 

View user's profileSend private messageVisit poster's website Reply with quote


Far Cry 2



dakota
Reputation: 474.2
Local time: 8:14 AM

usa.gif

Status: Offline
0.13 posts per day
Medals: 0

Joined: Apr 07, 2007
Last Visit: 30 Oct 2008
Posts: 77
Points: 734 

View user's profileSend private messageVisit poster's website Reply with quote

floppy
Reputation: 1791.9
votes: 10
Local time: 10:14 AM
Location: Jackson Mississippi
usa.gif

Status: Offline
2.78 posts per day
Medals: 1 (View more...)
Dedicated User (Amount: 1)
Clan Themes Scripts/Coder
Clan Themes Scripts/Coder
Joined: Nov 14, 2006
Last Visit: 19 Nov 2008
Posts: 2052
Points: 2525 

Post Forums center block question Posted: Mon Jul 30, 2007 7:31 pm   

Shop Purchases:
Clan Roster 2.0

Lose it. $prefix is a nuke global. If you look in config.php you will see that

Code:
$prefix = 'nuke';


They did this so that if you wanted your tables to be named something else. If you look at your nuke database you will see that all tables are prefixed so to speak with nuke_whatever.

nuke being the prefix.

So your outcome should render something like

Code:
"SELECT * FROM phpbb3_whatever
 

 
View user's profileSend private messageVisit poster's website Reply with quote

dakota
Reputation: 474.2
Local time: 8:14 AM

usa.gif

Status: Offline
0.13 posts per day
Medals: 0

Joined: Apr 07, 2007
Last Visit: 30 Oct 2008
Posts: 77
Points: 734