>>  Site Map >>  Forums >>  Blocks

Forum module - topics in forum:



Blocks - Having problems with a block? Code doesn't work, get help here.



Blocks help

Hello, I am new to all this.. so sorry if i am just being stupid!!

But can someone have alook at this block i have made, and tell me why it wont work ?

I am just tring to get the first 5 top skilled players from our Stats database, and put them on this block...

Help!!!


Code: :


<?php require_once('../Connections/stats.php');

if (eregi("block-stats_1.php",$PHP_SELF)) {
    Header("Location: index.php");
    die();
}

$maxRows_Recordset1 = 5;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
  $pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;

mysql_select_db($database_stats, $stats);
$query_Recordset1 = "SELECT skill, name FROM pstatsplr ORDER BY skill DESC";
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $stats) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);

if (isset($_GET['totalRows_Recordset1'])) {
  $totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
  $all_Recordset1 = mysql_query($query_Recordset1);
  $totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;

$content .="<table><tr><td>$row_Recordset1['name']</td></tr></table>";
?>



Thank you






I'll give you one clue. You can't include or require another php file in a block. A block would be pulling the ino from the database, not another php file.






hiya, Thank you...

I have dont that, by taking out the:

<?php require_once('../Connections/stats.php');

and leaving

<?php

But still no block.. if dont even show up now....

HHEEELLLPPPP!!! Smile






It's really difficult to picture what this block does based on the fact we have never heard of this module. So therefore I am not even going to attempt to answer this without more information.






This dose not have a module, its just a block, that i would like to collect information from a data base, and show... thats it...






We are not talking about your block you are making. She is referring to the Stats module that you have on your site. If you could tell us where you got this module at then maybe we could help you. Also please tell us what version of php-nuke you are running and if you site is patched or not.






ah.. okay....

I have module called psyhchonuke_6 (www.psychonuke.com), gives good info bout a player. I would like to make a new block that holds some info, but also calculate some of the numbers in the database.

and i have phpnuke 7.7 just a normal version that has a new theme.

www.cash4kills.com




Attention! You are currently viewing sitemap page!
We strongly suggest to look at original content

Search from web

Valid HTML 4.01 Valid CSS