» Log in
User Name:

Password:

Not a member yet?
Register Now!
» Online Users: 98
0 members and 98 guests
No Members online
Most users ever online was 611, 03-21-2008 at 10:10 PM.
» .::.
Web Hosting - web hosting, dedicated servers and web design services
Online Degree - search for 1000+ online degrees, online colleges & online universities.
tattoo - we are a group of tattoo enthusiasts
Gexa Energy - your absolute best choice in electric service
Texas electricity - save on electric rates
Rimonabant
www.rimonabant-weight-loss.com
Football Betting - best nfl betting promotions at sportsbook.com.
Poker Chips - Clay and composite poker chips for home games.

Register Now! Contact Us

About this Page
This is a discussion on NUKE CENTER FORUM BLOCK within the Nuke 7.x - Blocks forums, part of the PHP-Nuke 7.x category; I have a problem with my forum center block. Before when i ran ONLY 1 phpnuke on my account.. the ...



Go Back   Nukemods Forum » PHP-Nuke 7.x » Nuke 7.x - Blocks

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-02-2006, 11:40 PM
Junior Member
 
Join Date: Apr 2005
Posts: 4
NUKE CENTER FORUM BLOCK
I have a problem with my forum center block.

Before when i ran ONLY 1 phpnuke on my account.. the block worked great. Then i separated the clan into 2.

first site is www.domain.com/ut
2nd www.domain.com/gta

Both are on drifferent sql.

The forum center block worked great until i separated it. the stock block that comes with the nuke works, but its not really nice. so this other block was found in your downloads!

I never altered any codes in it....


i tried pasting the code in here..but it seems sentinel thought i was doing an attack..so here is a .txt link for it

http://www.esdclan.net/block-Forums.txt


to see how the block looks go to www.esdclan.net/gta

u'll see its like its not connecting to sql.

Thank You
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 08-05-2006, 10:57 AM
Junior Member
 
Join Date: Apr 2005
Posts: 4
please. someone please help me
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 08-05-2006, 11:19 PM
Junior Member
 
Join Date: May 2005
Posts: 242
Your PHP Block file code needs updated. It still uses $dbi, which is the old sql layer.

Quote:
One change in the files that i can explain is the move to phpBB's abstraction layer,
those with an average knowledge of php/MySQL can perform the change themselves on
files they don't want to replace because of modifications, before doing this MAKE A
BACKUP OF THE FILES so you can roll back to them if anything goes wrong, here are
the steps:
1-By default each function's global line includes $dbi, this must be replaced with
$db, sql query lines often end with ,$dbi which should be removed.
2-sql_fetch_row or mysql_fetch_row should now be $db->sql_fetchrow
3-sql_query or mysql_query should now be $db->sql_query
4-sql_num_rows or mysql_num_rows should now be $db->sql_numrows
5-sql_fetch_array or mysql_fetch_array should now be $db->sql_fetchrow
6-sql_free_result or mysql_free_result should now be $db->sql_freeresult
7-sql_insert_id or mysql_insert_id should now be $db->sql_nextid
8-sql_close or mysql_close should now be $db->sql_close
Others might apply but these are the ones i found being used.
One other thing to look for are unquoted variables in sql queries, in example:
$result = $db->sql_query("SELECT rid, name, url from ".$prefix."_related where tid=$topicid");
should be:
$result = $db->sql_query("SELECT rid, name, url from ".$prefix."_related where tid='$topicid'");
notice $topicid was enclosed between single quotes which brings us to one other change, this
particular query attempts to grab 3 values from a database table, an id, a name and a url,
the id is a numerical value, there are two ways in which you can get the result of this
query:
The one i suggest using:
$row = $db->sql_fetchrow($result);
$rid = $row['rid'];
$name = $row['name'];
$url = $row['url'];

and the one some use to reduce the amount of code:
list($rid, $name, $url) = $db->sql_fetchrow($result);

In the first method results are returned in the format $row['value']
in the second method they are returned in the format $value
since one of the values is a number we add a php function to make sure only numbers
are used, in this case we use intval(), in values that return emails & urls we can
use another function, in this case stripslashes(), they would now change to:
The one i suggest using:
$row = $db->sql_fetchrow($result);
$rid = intval($row['rid']);
$name = $row['name'];
$url = stripslashes($row['url']);

and the one some use to reduce the amount of code:
list($rid, $name, $url) = $db->sql_fetchrow($result);
$rid = intval($rid);
$url = stripslashes($url);

There are many more functions one can use to check what gets passed through a
variable but these should help make the files more secure, anyway here's one more:
Let's say that from our example we know $name will have a maximum allowed
character limit of 12, we can make sure that limit is not exceeded in one
of several ways, in this case we'll use substr() so the above will now be:
The one i suggest using:
$row = $db->sql_fetchrow($result);
$rid = intval($row['rid']);
$name = substr("$row['name']", 0,12);
$url = stripslashes($row['url']);

and the one some use to reduce the amount of code:
list($rid, $name, $url) = $db->sql_fetchrow($result);
$rid = intval($rid);
$name = substr("$name", 0,12);
$url = stripslashes($url);
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 08-06-2006, 10:14 AM
Junior Member
 
Join Date: Apr 2005
Posts: 4
Hey, Ty very much! I replaced the old codes with the new ones u provided and it worked!

Ty
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Advanced Center Forum Block izone Nuke 7.x - Blocks 1 08-28-2005 03:16 PM
I want to add the nuke ad banners in a center block... protegechris Nuke 7.x - General 10 07-06-2005 01:23 PM
is there way to have the forum in the center block asif Nuke 7.x - General 1 11-21-2004 04:05 AM
Forum Center Block 6.5 FleaSOG Nuke 6.5 to 6.9 - Blocks 3 06-18-2003 02:34 PM
Center Forum Block: Does Not Work Vachi Nuke 6.5 to 6.9 - Blocks 12 05-18-2003 10:51 PM


All times are GMT -5. The time now is 02:51 AM.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.

LinkBacks Enabled by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31