Nukemods Forum  
» Log in
User Name:

Password:

Not a member yet?
Register Now!
» Online Users: 86
9 members and 77 guests
asrapxl, claudiamazzonif, denzk9tistw6iwp, howsztoge2xwtp, lnkmastes, rivdsercruise, scigo6catica3gz, watcy5gerp, whasst3xniisabs
Most users ever online was 611, 03-21-2008 at 11:10 PM.
» .::.
tattoo fonts
http://www.checkoutmyink.com/category/tattoo-fonts-tattoo

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

Reply
 
LinkBack Thread Tools Display Modes
NUKE CENTER FORUM BLOCK
Old
  (#1 (permalink))
Junior Member
 
Status: Offline
Posts: 4
Join Date: Apr 2005
NUKE CENTER FORUM BLOCK - 08-03-2006, 12:40 AM

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
Old
  (#2 (permalink))
Junior Member
 
Status: Offline
Posts: 4
Join Date: Apr 2005
08-05-2006, 11:57 AM

please. someone please help me
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old
  (#3 (permalink))
Junior Member
 
Status: Offline
Posts: 242
Join Date: May 2005
08-06-2006, 12:19 AM

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
Old
  (#4 (permalink))
Junior Member
 
Status: Offline
Posts: 4
Join Date: Apr 2005
08-06-2006, 11:14 AM

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 04:16 PM
I want to add the nuke ad banners in a center block... protegechris Nuke 7.x - General 10 07-06-2005 02:23 PM
is there way to have the forum in the center block asif Nuke 7.x - General 1 11-21-2004 05:05 AM
Forum Center Block 6.5 FleaSOG Nuke 6.5 to 6.9 - Blocks 3 06-18-2003 03:34 PM
Center Forum Block: Does Not Work Vachi Nuke 6.5 to 6.9 - Blocks 12 05-18-2003 11:51 PM




vBulletin Skin developed by: vBStyles.com


LinkBacks Enabled by vBSEO 3.3.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