Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating Blocks
Author Message
rebelt
Worker
Worker



Joined: May 07, 2006
Posts: 172

PostPosted: Sat Dec 13, 2008 2:20 pm Reply with quote

I have 2 blocks which display a total and would like to add them to user_info.

Code:
if (eregi("block-Players_Block.php",$_SERVER['SCRIPT_NAME'])) {

    Header("Location: index.php");
    die();
}
$result = mysql_query("SELECT * FROM team_players") or die(mysql_error());

$num_rows = mysql_num_rows($result);
$content = "Players: $num_rows";

and
Code:
if( eregi( "block-teams_registered.php",$PHP_SELF ) ) {

   Header( "Location: index.php" );
   die();
}
$result = mysql_query("SELECT * FROM team_names2") or die(mysql_error());

$num_rows = mysql_num_rows($result);
$content = "Teams: $num_rows";

Tried adding the code between Membership and People online so I had

League:
Players: 999
Teams: 74

But nothing I did seemed to work.

Can anyone help out please?
 
View user's profile Send private message Visit poster's website
Palbin
Site Admin



Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania

PostPosted: Sat Dec 13, 2008 5:55 pm Reply with quote

Other than making sure you are not overwriting a previously needed $result all you need to do is make sure your $content variables read like this $content .= "......";


P.S. I should have looked at your code better. You need to be using code as shown below.

Code:


$result = $db->sql_query("SELECT * FROM team_players");
$num_rows = $db->sql_numrows($result);

$content .= "Players: $num_rows";


Code:


$result =  $db->sql_query("SELECT * FROM team_names2");
$num_rows =  $db->sql_numrows($result);

$content .= "Teams: $num_rows";
 
View user's profile Send private message
rebelt







PostPosted: Sun Dec 14, 2008 5:47 am Reply with quote

Thanks Palbin. That code was years old with the block created using nuke tools.
Trouble with ravennuke is it's so good, you go for months without adding a block or whatever, then forget how you did it last time. Smile

Anyone know how to add it to user_info please?
 
Palbin







PostPosted: Sun Dec 14, 2008 10:22 am Reply with quote

You should be able to just drop those lines in where you need them. Even if the queries don't work for some reason you should still see "Players:" and "Teams:"

If it doesn't work post the code you are trying to insert and also some of the surrounding code so I can see exactly where you are trying to insert it.
 
rebelt







PostPosted: Sun Dec 14, 2008 6:03 pm Reply with quote

Starting at line 280, here is where I inserted the code.
Code:
    if (is_admin($admin) AND @file_exists('modules/Resend_Email/index.php')) $waitLink = '<a href="modules.php?name=Resend_Email" title="'._TTL_RESENDEMAIL.'">'._WAITLINK.'</a>';

    else $waitLink = _WAITLINK;
    $content .= '<img src="images/blocks/ur-member.gif" height="14" width="17" alt="" /> '.$waitLink.': <b>'.$waiting.'</b><br />'."\n";
    $content .= '<img src="images/blocks/ur-guest.gif" height="14" width="17" alt="" /> '._BOVER.': <b>'.number_format($numrows1,0).'</b><br />'."\n<hr />\n";
$result = $db->sql_query("SELECT * FROM team_players");
$num_rows = $db->sql_numrows($result);

$content .= "Players: $num_rows";
$result =  $db->sql_query("SELECT * FROM team_names2");
$num_rows =  $db->sql_numrows($result);

$content .= "Teams: $num_rows";

But I get this
Image

I'm trying to get it to look like

Membership:
Latest: RebelT
New Today: 0
New Yesterday: 0
Waiting: 0
Overall: 1
____________
League:
Players: 999
Teams: 74
____________
People Online:
Visitors: 0
Members: 0
Hidden: 0
Total: 1
 
Palbin







PostPosted: Sun Dec 14, 2008 7:11 pm Reply with quote

Well you need to add some formatting with html. You need to add a <br />at the end of each line. Add an <hr /> for the horizontal rule at the bottom of the league area. You don't even have anything stating "League:" in the code.
 
rebelt







PostPosted: Sun Dec 14, 2008 7:16 pm Reply with quote

Wasn't sure how to put it in Embarassed
 
rebelt







PostPosted: Sun Dec 14, 2008 7:30 pm Reply with quote

I tried this.
Code:
$content .= "<b>League: '</b><br />'"

$result = $db->sql_query("SELECT * FROM team_players");
$num_rows = $db->sql_numrows($result);

$content .= "Players: $num_rows '<br />'";
$result =  $db->sql_query("SELECT * FROM team_names2");
$num_rows =  $db->sql_numrows($result);

$content .= "Teams: $num_rows '<br /><hr />'";

but then I can't see the block or anything after it. Sorry if I'm being a bit thick
 
trunks
Worker
Worker



Joined: Oct 05, 2007
Posts: 152
Location: United Kingdom

PostPosted: Mon Dec 15, 2008 7:06 pm Reply with quote

You have a mixture of " and ' in that code rebelt try:

Code:


$content .= "<hr/>";
$content .= "<b>League:</b><br />";
$result = $db->sql_query("SELECT * FROM team_players");
$num_rows = $db->sql_numrows($result);
$content .= "Players: $num_rows<br />";
$content .= "<hr/>";
 
View user's profile Send private message Visit poster's website MSN Messenger
Palbin







PostPosted: Mon Dec 15, 2008 7:56 pm Reply with quote

rebelt, your code was fine except that you need to replace '</b> with </b> and '<br /> with <br /> (both locations). See corrected code below. Cheers

Code:


$content .= "<b>League: </b><br />'"
$result = $db->sql_query("SELECT * FROM team_players");
$num_rows = $db->sql_numrows($result);

$content .= "Players: $num_rows <br />'";
$result =  $db->sql_query("SELECT * FROM team_names2");
$num_rows =  $db->sql_numrows($result);

$content .= "Teams: $num_rows <br /><hr />'";
 
trunks







PostPosted: Mon Dec 15, 2008 8:00 pm Reply with quote

Thats also what i did :S except added the horizontal line on a different line... i removed the ' also for him O.o
 
Palbin







PostPosted: Mon Dec 15, 2008 9:36 pm Reply with quote

trunks wrote:
Thats also what i did :S except added the horizontal line on a different line... i removed the ' also for him O.o


Except you missed a piece of code. THe part about the teams Smile
 
rebelt







PostPosted: Tue Dec 16, 2008 9:06 am Reply with quote

Sorry guys but I must be missing something Question
I added the code to a block
Code:
<?php


if (eregi("block-Players_Block.php",$_SERVER['SCRIPT_NAME'])) {
    Header("Location: index.php");
    die();
}

$content .= "<b>League: </b><br />'"
$result = $db->sql_query("SELECT * FROM team_players");
$num_rows = $db->sql_numrows($result);

$content .= "Players: $num_rows <br />'";
$result =  $db->sql_query("SELECT * FROM team_names2");
$num_rows =  $db->sql_numrows($result);

$content .= "Teams: $num_rows <br /><hr />'";
die();

?>

to see it in action but it kills everything from that block onwards. Sad

From this Image
to this Image

I can't provide a link because it's on my computer but here's the view source code.
Code:
<!DOCTYPE html

   PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
   <head>
   <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1" />
<title>RebelT Play site - Administration Menu</title>

<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="EXPIRES" content="0" />
<meta name="RESOURCE-TYPE" content="DOCUMENT" />
<meta name="DISTRIBUTION" content="GLOBAL" />
<meta name="AUTHOR" content="RebelT Play site" />
<meta name="COPYRIGHT" content="Copyright (c) by RebelT Play site" />
<meta name="KEYWORDS" content="CMS, cms, Best CMS, best cms, Raven, RavenNuke, Raven Nuke, raven, ravennuke, raven nuke, ravenuke, Ravenuke, scripts, PHP, php, MySQL, mysql, SQL, sql, News, news, Technology, technology, Headlines, headlines, Nuke, nuke, PHP-Nuke, phpnuke, php-nuke, Linux, linux, Windows, windows, Software, software, Download, download, Downloads, downloads, Free, FREE, free, Community, community, Forum, forum, Forums, forums, Bulletin, bulletin, Board, board, Boards, boards, Survey, survey, Comment, comment, Comments, comments, Portal, portal, ODP, odp, Open, open, Open Source, OpenSource, Opensource, opensource, open source, Free Software, FreeSoftware, Freesoftware, free software, GNU, gnu, GPL, gpl, License, license, Unix, UNIX, *nix, unix, Database, DataBase, Blogs, blogs, Blog, blog, database, Programming, programming, Web Site, web site, Weblog, WebLog, weblog" />
<meta name="DESCRIPTION" content="Local site" />
<meta name="ROBOTS" content="INDEX, FOLLOW" />
<meta name="REVISIT-AFTER" content="1 DAYS" />
<meta name="RATING" content="GENERAL" />
<meta name="GENERATOR" content="RavenNuke(tm) Copyright (c) 2008 by Gaylen Fraley. This is free software, and you may redistribute it under the GPL (http://www.gnu.org/licenses/gpl-2.0.txt). RavenNuke(tm) is supported by the RavenNuke(tm) Team at http://ravenphpscripts.com." />      <script type="text/javascript">
/*<![CDATA[*/
         function hideshow(which) {
            if (!document.getElementById) {
               return;
            }
            if (which.style.display=="block") {
               which.style.display="none";
            }
            else {
               which.style.display="block";
            }
         }
/*]]>*/
      </script><script type="text/javascript">
   function gotoURL(dropDown) {
      URL=dropDown.options[dropDown.selectedIndex].value;
      if(URL.length>0) {
         top.location.href = URL;
      }
   }
</script>
<style type="text/css">
.mymodulesselectbox{
   width:140px;
   background:#f7f8fc;
}
</style><link rel="StyleSheet" href="themes/ravennuke.css" type="text/css" />
<link rel="StyleSheet" href="themes/weston/style/style.css" type="text/css" />
<link rel="StyleSheet" href="includes/nukeSEO/nukePIE.css" type="text/css" />
<script type="text/javascript" language="JavaScript" src="includes/boxover/boxover.js"></script>
<link rel="StyleSheet" href="includes/nukeSEO/seoHelp.css" type="text/css" /><link rel="STYLESHEET" type="text/css" href="includes/nukeSEO/forms/dhtmlxCombo/css/dhtmlXCombo.css" />

</head>
<body bgcolor="#FFFFFF" text="#000000" style="margin: 10px"><br />
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="20%" style="background-image: url(themes/weston/images/cloth.jpg)"><div align="center"><img src="themes/weston/images/rack.jpg"></div></td>
    <td width="60%" style="background-image: url(themes/weston/images/cloth.jpg)" height="110"><div align="center"><a href="http://ravenphpscripts.com" title="Weston Pool League"><img src="themes/weston/images/logo.gif" alt="PHP Web Host - Quality Web Hosting For All PHP Applications" border="0" /></a></div></td>
    <td width="20%" style="background-image: url(themes/weston/images/cloth.jpg)" height="110">
      <div align="center"><img src="themes/weston/images/rack.jpg"></div></td>
  </tr>
</table>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><table width="100%" border="0" cellpadding="4" cellspacing="0" style="background-image: url(themes/weston/images/cellpic1.gif)">
        <tr>
             
          <td width="20%" height="30" nowrap="nowrap"><font class="content">&nbsp;&nbsp;Welcome RebelT!</font></td>
             
          <td width="60%" nowrap="nowrap">
<div align="center"><a href="index.php"><img src="themes/weston/images/navbar_b1.gif" width="100" height="25" border="0"></a><a href="modules.php?name=NukeWrap&page=Hesk"><img src="themes/weston/images/navbar_b2.gif" width="79" height="22" border="0"></a><a href="modules.php?name=FAQ"><img src="themes/weston/images/navbar_b4.gif" width="79" height="22" border="0"></a><a href="http://forum.westonpoolleague.org.uk" target="_blank"><img src="themes/weston/images/navbar_b3.gif" width="79" height="22" border="0"></a><a href="modules.php?name=Downloads"><img src="themes/weston/images/navbar_b6.gif" width="79" height="22" border="0"></a><a href="modules.php?name=Web_Links"><img src="themes/weston/images/navbar_b5.gif" width="79" height="22" border="0"></a></div></td>
             
          <td width="20%" nowrap="nowrap">
<div align="right"><font class="content"> <script type="text/javascript">

<!--   // Array of Month Names
var monthNames = new Array( 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
var now = new Date();
var thisYear = now.getYear();
if(thisYear < 1900) {thisYear += 1900; }document.write(monthNames[now.getMonth()] + ' ' + now.getDate() + ', ' + thisYear);
// -->

</script> </font></div></td>
            </tr>
          </table></td>
      </tr>
    </table>
    <table width="100%" cellpadding="0" cellspacing="0" border="0" align="center">
      <tr valign="top">
        <td align="center"></td>
</tr></table>
<table width="100%" cellpadding="0" cellspacing="0" border="0" align="center">
<tr valign="top">
  <td valign="top" width="1" style="background-image: url(themes/weston/images/7px.gif)">
<script type="text/javascript" language="JavaScript">
function sommaire_envoielistbox(page) {
   var reg= new RegExp('(_sommaire_targetblank)$','g');
   if (reg.test(page)) {
      page=page.replace(reg,"");
      window.open(page,'','menubar=yes,status=yes, location=yes, scrollbars=yes, resizable=yes');
   }else if (page!="select") {
         top.location.href=page;
   }
}            
function sommaire_ouvre_popup(page,nom,option) {
   window.open(page,nom,option);
}
</script>
<table width="170" border="0" cellspacing="0" cellpadding="7">
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="1">
        <tr>
          <td bgcolor="#486386"><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
              <tr>
                <td height="27" style="background-image: url(themes/weston/images/cellpic3.gif)"><table width="100%" border="0" cellspacing="0" cellpadding="4">
                    <tr>
                      <td><font class="block-title"><strong>Navigation</strong></font></td>
                    </tr>
                  </table></td>
              </tr>
              <tr>
                <td style="background-image: url(themes/weston/images/cloth.jpg)"><table width="100%" border="0" cellspacing="0" cellpadding="4">
                    <tr>
                      <td>
<!-- Sommaire realise grace au module Sommaire Parametrable v.2.1.1 - ©marcoledingue - marcoledingue .-:@at@:-. free.fr -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr height="4" bgcolor=""><td></td></tr>
                  <tr ><td bgcolor="" ><font class="storytitle"><strong>Rules</strong></font></td></tr>
<tr name="sommaire-1" id="sommaire-1"><td bgcolor=""><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="0" align="right"><img src="images/sommaire/categories/petitrond.gif" border="0"></td><td>&nbsp;<a href="modules.php?name=Content&pa=showpage&pid=94"><font class="boxcontent"><strong>League</strong></font></a></td></tr>
<tr><td width="0" align="right"><img src="images/sommaire/categories/petitrond.gif" border="0"></td><td>&nbsp;<a href="modules.php?name=Content&pa=list_pages_categories&cid=2"><font class="boxcontent"><strong>World</strong></font></a></td></tr>
<tr><td width="0" align="right"><img src="images/sommaire/categories/petitrond.gif" border="0"></td><td>&nbsp;<a href="modules.php?name=Referee"><font class="boxcontent"><strong>Referee</strong></font></a></td></tr>
</table></td></tr><tr height="4" bgcolor=""><td></td></tr>
                  <tr height="4" bgcolor=""><td></td></tr>
                  <tr ><td bgcolor="" ><font class="storytitle"><strong>Cup Games</strong></font></td></tr>
<tr name="sommaire-3" id="sommaire-3"><td bgcolor=""><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="0" align="right"><strong><big>&middot;</big></strong></td><td>&nbsp;<a href="modules.php?name=Content&pa=showpage&pid=80"><font class="boxcontent"><strong>Baxter (wint)</strong></font></a></td></tr>
<tr><td width="0" align="right"><strong><big>&middot;</big></strong></td><td>&nbsp;<a href="modules.php?name=Content&pa=showpage&pid=82"><font class="boxcontent"><strong>Workingmens (wint)</strong></font></a></td></tr>
<tr><td width="0" align="right"><strong><big>&middot;</big></strong></td><td>&nbsp;<a href="modules.php?name=Content&pa=showpage&pid=81"><font class="boxcontent"><strong>MacAverne (wint)</strong></font></a></td></tr>
<tr><td width="0" align="right"><strong><big>&middot;</big></strong></td><td>&nbsp;<a href="modules.php?name=Content&pa=showpage&pid=89"><font class="boxcontent">Gifford (summ)</font></a></td></tr>
<tr><td width="0" align="right"><strong><big>&middot;</big></strong></td><td>&nbsp;<a href="modules.php?name=Content&pa=showpage&pid=88"><font class="boxcontent">Forresters (summ)</font></a></td></tr>
<tr><td width="0" align="right"><strong><big>&middot;</big></strong></td><td>&nbsp;<a href=""><font class="boxcontent">View Cup Results</font></a></td></tr>
</table></td></tr><tr height="4" bgcolor=""><td></td></tr>
                  <tr height="4" bgcolor=""><td></td></tr>
                  <tr ><td bgcolor="" ><font class="storytitle"><strong>League Games</strong></font></td></tr>
<tr name="sommaire-4" id="sommaire-4"><td bgcolor=""><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="0" align="right"><img src="images/sommaire/categories/yellow.gif" border="0"></td><td>&nbsp;<a href="modules.php?name=NukeWrap&page=Current_Table"><font class="boxcontent"><strong>Tables</strong></font></a></td></tr>
<tr><td width="0" align="right"><img src="images/sommaire/categories/red.gif" border="0"></td><td>&nbsp;<a href="modules.php?name=Content&pa=showpage&pid=83"><font class="boxcontent"><strong>Doubles Cat 1</strong></font></a></td></tr>
<tr><td width="0" align="right"><img src="images/sommaire/categories/yellow.gif" border="0"></td><td>&nbsp;<a href="modules.php?name=Content&pa=showpage&pid=84"><font class="boxcontent"><strong>Doubles Cat 2</strong></font></a></td></tr>
<tr><td width="0" align="right"><img src="images/sommaire/categories/red.gif" border="0"></td><td>&nbsp;<a href="modules.php?name=Content&pa=showpage&pid=85"><font class="boxcontent"><strong>Singles Cat 1</strong></font></a></td></tr>
<tr><td width="0" align="right"><img src="images/sommaire/categories/yellow.gif" border="0"></td><td>&nbsp;<a href="modules.php?name=Content&pa=showpage&pid=86"><font class="boxcontent"><strong>Singles Cat 2</strong></font></a></td></tr>
<tr><td width="0" align="right"><img src="images/sommaire/categories/red.gif" border=0></td><td>&nbsp;<a href="leagueresult.php"><strong><font class="boxcontent">Live Results</font></strong></a></td></tr>
<tr><td width="0" align="right"><img src="images/sommaire/categories/yellow.gif" border=0></td><td>&nbsp;<a href="maintenance.php?op=ListTeams"><strong><font class="boxcontent">Team Details</font></strong></a></td></tr>
<tr><td width="0" align="right"><img src="images/sommaire/categories/red.gif" border=0></td><td>&nbsp;<a href="http://westonpoolleague.org.uk/8balls2/main.php?table_id=0&Action=Go" target="_blank"><strong><font class="boxcontent">8 Ball List</font></strong></a></td></tr>
<tr><td width="0" align="right"><img src="images/sommaire/categories/yellow.gif" border="0"></td><td>&nbsp;<a href="modules.php?name=NukeWrap&page=fixtures"><font class="boxcontent"><strong>Fixtures</strong></font></a></td></tr>
</table></td></tr><tr height="4" bgcolor=""><td></td></tr>
                  <tr height="4" bgcolor=""><td></td></tr>
                  <tr ><td bgcolor="" ><font class="storytitle">Forms</font></td></tr>
<tr name="sommaire-5" id="sommaire-5"><td bgcolor=""><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="0" align="right"><img src="images/sommaire/categories/red.gif" border=0></td><td>&nbsp;<a href="leagueresult.php?op=resultform"><strong><font class="boxcontent">League Result</font></strong></a></td></tr>
<tr><td width="0" align="right"><img src="images/sommaire/categories/yellow.gif" border=0></td><td>&nbsp;<a href="league_cupres.php"><strong><font class="boxcontent">Cup Result</font></strong></a></td></tr>
<tr><td width="0" align="right"><img src="images/sommaire/categories/red.gif" border=0></td><td>&nbsp;<a href=""><font class="boxcontent">Doubles Result</font></a></td></tr>
<tr><td width="0" align="right"><img src="images/sommaire/categories/yellow.gif" border="0"></td><td>&nbsp;<a href="modules.php?name=NukeWrap&page=singles_results"><font class="boxcontent"><strong>Singles Result</strong></font></a></td></tr>
<tr><td width="0" align="right"><img src="images/sommaire/categories/red.gif" border=0></td><td>&nbsp;<a href=""><font class="boxcontent">Remove Player</font></a></td></tr>
<tr><td width="0" align="right"><img src="images/sommaire/categories/yellow.gif" border=0></td><td>&nbsp;<a href=""><font class="boxcontent">Postpone Request</font></a></td></tr>
<tr><td width="0" align="right"><img src="images/sommaire/categories/red.gif" border=0></td><td>&nbsp;<a href=""><font class="boxcontent">Postponed Result</font></a></td></tr>
<tr><td width="0" align="right"><img src="images/sommaire/categories/yellow.gif" border=0></td><td>&nbsp;<a href="maintenance.php"><strong><font class="boxcontent">Team Registration</font></strong></a></td></tr>
<tr><td width="0" align="right"><img src="images/sommaire/categories/red.gif" border=0></td><td>&nbsp;<a href="http://westonpoolleague.org.uk/singles_doubles" target="_blank"><strong><font class="boxcontent">Singles/Doubles Entry</font></strong></a></td></tr>
</table></td></tr><tr height="4" bgcolor=""><td></td></tr>
                  <tr height="4" bgcolor=""><td></td></tr>
                  <tr ><td bgcolor="" ><a href="modules.php?name=Content&pa=showpage&pid=87"><a href="modules.php?name=Content&pa=showpage&pid=87"><font class="storytitle">Committee</font></a></td></tr>

                  <tr height="4" bgcolor=""><td></td></tr>
                  <tr ><td bgcolor="" ><font class="storytitle">Miscellaneous</font></td></tr>
<tr name="sommaire-11" id="sommaire-11"><td bgcolor=""><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="0" align="right"><img src="images/sommaire/categories/yellow.gif" border="0"></td><td>&nbsp;<a href="modules.php?name=Journal"><font class="boxcontent">Journal</font></a></td></tr>
<tr><td width="0" align="right"><img src="images/sommaire/categories/red.gif" border="0"></td><td>&nbsp;<a href="modules.php?name=Members_List"><font class="boxcontent">Members List</font></a></td></tr>
<tr><td width="0" align="right"><img src="images/sommaire/categories/yellow.gif" border="0"></td><td>&nbsp;<a href="modules.php?name=Recommend_Us"><font class="boxcontent">Recommend Us</font></a></td></tr>
<tr><td width="0" align="right"><img src="images/sommaire/categories/red.gif" border="0"></td><td>&nbsp;<a href="modules.php?name=Reviews"><font class="boxcontent">Reviews</font></a></td></tr>
<tr><td width="0" align="right"><img src="images/sommaire/categories/yellow.gif" border="0"></td><td>&nbsp;<a href="modules.php?name=Statistics"><font class="boxcontent">Statistics</font></a></td></tr>
<tr><td width="0" align="right"><img src="images/sommaire/categories/red.gif" border="0"></td><td>&nbsp;<a href="modules.php?name=Stories_Archive"><font class="boxcontent">Stories Archive</font></a></td></tr>
<tr><td width="0" align="right"><img src="images/sommaire/categories/yellow.gif" border="0"></td><td>&nbsp;<a href="modules.php?name=Submit_News"><font class="boxcontent">Submit News</font></a></td></tr>
<tr><td width="0" align="right"><img src="images/sommaire/categories/red.gif" border="0"></td><td>&nbsp;<a href="modules.php?name=Content&pa=list_pages_categories&cid=6"><font class="boxcontent">Table Archive</font></a></td></tr>
<tr><td width="0" align="right"><img src="images/sommaire/categories/yellow.gif" border="0"></td><td>&nbsp;<a href="modules.php?name=Your_Account"><font class="boxcontent">Your Account</font></a></td></tr>
</table></td></tr><tr height="4" bgcolor=""><td></td></tr><tr><td><hr><div align="center"><strong>Modules visible</strong><br>but unselected (in <a href="admin.php?op=sommaire">SP admin panel</a>)</div><br><strong><big>&middot;</big></strong>&nbsp;<a href="modules.php?name=Content">Content</a><br>
<strong><big>&middot;</big></strong>&nbsp;<a href="modules.php?name=Doubles_view">Doubles_view</a><br>
<strong><big>&middot;</big></strong>&nbsp;<a href="modules.php?name=Downloads">Downloads</a><br>
<strong><big>&middot;</big></strong>&nbsp;<a href="modules.php?name=FAQ">FAQ</a><br>
<strong><big>&middot;</big></strong>&nbsp;<a href="modules.php?name=Feedback">Feedback</a><br>
<strong><big>&middot;</big></strong>&nbsp;<a href="modules.php?name=Forums">Forums</a><br>
<strong><big>&middot;</big></strong>&nbsp;<a href="modules.php?name=Groups">Groups</a><br>
<strong><big>&middot;</big></strong>&nbsp;<a href="modules.php?name=Hesk">Hesk</a><br>
<strong><big>&middot;</big></strong>&nbsp;<a href="modules.php?name=NukeSentinel">NukeSentinel</a><br>
<strong><big>&middot;</big></strong>&nbsp;<a href="modules.php?name=NukeWrap">NukeWrap</a><br>
<strong><big>&middot;</big></strong>&nbsp;<a href="modules.php?name=Referee">Referee</a><br>
<strong><big>&middot;</big></strong>&nbsp;<a href="modules.php?name=Single_submit">Single_submit</a><br>
<strong><big>&middot;</big></strong>&nbsp;<a href="modules.php?name=Single_View">Single_View</a><br>
<strong><big>&middot;</big></strong>&nbsp;<a href="modules.php?name=Web_Links">Web Links</a><br>
</td></tr></table><br><center><b>Invisible Modules</b><br><font class="tiny">(Active but invisible link)</font></center><form action="modules.php" method="get" name="sommaireformlistboxinvisibles"><select name="somlistboxinvisibles" onchange="sommaire_envoielistbox(this.options[this.selectedIndex].value)"><option value="select">Select...<option value="modules.php?name=Advertising">Advertising<option value="modules.php?name=Feeds">Feeds<option value="modules.php?name=GCalendar">GCalendar<option value="modules.php?name=HTML_Newsletter">HTML Newsletter<option value="modules.php?name=Legal">Legal<option value="modules.php?name=Resend_Email">Resend Email</select></form>
<br><center><b>Inactive Modules</b><br><font class="tiny">(for Admin tests)</font></center><form action="modules.php" method="get" name="sommaireformlistboxinactifs"><select name="somlistboxinactifs" onchange="sommaire_envoielistbox(this.options[this.selectedIndex].value)"><option value="select">Select...<option value="modules.php?name=AvantGo">AvantGo<option value="modules.php?name=Comments">Comments<option value="modules.php?name=Encyclopedia">Encyclopedia<option value="modules.php?name=ErrorDocuments">ErrorDocuments<option value="modules.php?name=How_To_Install">How To Install<option value="modules.php?name=Private_Messages">Private Messages<option value="modules.php?name=rwsMetAuthors">Authors and Articles<option value="modules.php?name=RWS_WhoIsWhere">RWS WhoIsWhere<option value="modules.php?name=Search">Search<option value="modules.php?name=Surveys">Surveys<option value="modules.php?name=Top">Top 10<option value="top.htmlics">Topics<option value="modules.php?name=UserInfoAddons">UserInfoAddons</select></form>
</td>
                    </tr>
                  </table></td>
              </tr>
              <tr>
                <td height="27" style="background-image: url(themes/weston/images/cellpic1.gif)">&nbsp;</td>
              </tr>
            </table></td>
        </tr>
      </table></td>
  </tr>
</table>
<table width="170" border="0" cellspacing="0" cellpadding="7">
  <tr>
    <td><table width="100%" border="0" cellspacing="0" cellpadding="1">
        <tr>
          <td bgcolor="#486386"><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
              <tr>
                <td height="27" style="background-image: url(themes/weston/images/cellpic3.gif)"><table width="100%" border="0" cellspacing="0" cellpadding="4">
                    <tr>
                      <td><font class="block-title"><strong>User Info</strong></font></td>
                    </tr>
                  </table></td>
              </tr>
              <tr>
                <td style="background-image: url(themes/weston/images/cloth.jpg)"><table width="100%" border="0" cellspacing="0" cellpadding="4">
                    <tr>
                      <td><form action="modules.php?name=Your_Account" method="post"><center><b>Your IP: 127.0.0.1</b></center><center><img alt="" src="modules/Forums/images/avatars/blank.gif" /></center><br /><center>125 post(s)</center>
<br /><img src="images/blocks/group-4.gif" height="14" width="17" alt="" /> Welcome, <b>RebelT</b><br />

<a href="modules.php?name=Your_Account&amp;op=logout"><img src="images/blocks/arrow-blk.gif" width="17" border="0" alt="" />&nbsp;Logout</a>
<hr />
<img src="images/blocks/group-2.gif" height="14" width="17" alt="" /> <b><u>Membership:</u></b><br />
<img src="images/blocks/ur-moderator.gif" height="14" width="17" alt="" /> Latest: <a href="modules.php?name=Your_Account&amp;op=userinfo&amp;username=daddy"><img src="images/blocks/icon_mini_profile.gif" border="0" title="Check the profile of daddy" alt="Check the profile of daddy" /></a>&nbsp;<a href="modules.php?name=Forums&amp;file=profile&amp;mode=viewprofile&amp;u=746"><b>daddy</b></a><br />
<img src="images/blocks/ur-author.gif" height="14" width="17" alt="" /> New Today: <b>0</b><br />
<img src="images/blocks/ur-admin.gif" height="14" width="17" alt="" /> New Yesterday: <b>0</b><br />
<img src="images/blocks/ur-member.gif" height="14" width="17" alt="" /> <a href="modules.php?name=Resend_Email" title="Resend Email phpNuke Module at RavenPHPScripts">Waiting</a>: <b>0</b><br />
<img src="images/blocks/ur-guest.gif" height="14" width="17" alt="" /> Overall: <b>525</b><br />
<hr />
<img src="images/blocks/group-3.gif" height="14" width="17" alt="" /> <b><u>People Online:</u></b>
<br />
<img src="images/blocks/ur-anony.gif" height="14" width="17" alt="" /> Visitors: <b>0</b><br />
<img src="images/blocks/ur-member.gif" height="14" width="17" alt="" /> Members: <b>0</b><br />
<img src="images/blocks/ur-hiddenmember.gif" height="14" width="17" alt="" /> Hidden: <b>1</b><br />
<img src="images/blocks/ur-registered.gif" height="14" width="17" alt="" /> Total: <b>1</b><br />
<hr noshade="noshade" />
<img src="images/blocks/group-1.gif" height="14" width="17" align="middle" alt="" /> <b><u>Online Now:</u></b><br /><a href="http://www.dnsstuff.com/tools/whois.ch?ip=127.0.0.1" title="127.0.0.1" target="_blank">01</a>:&nbsp;<a href="modules.php?name=Your_Account&amp;op=userinfo&amp;username=RebelT"><img src="images/blocks/icon_mini_profile.gif" border="0" alt="Check the profile of RebelT" title="Check the profile of RebelT" /></a>&nbsp;<a href="modules.php?name=Private_Messages&amp;mode=post&amp;u=2"><img src="images/blocks/nopm.gif" border="0" alt="Send a quick private message to RebelT" title="Send a quick private message to RebelT" /></a>&nbsp;<a title="Check the profile of RebelT" href="modules.php?name=Forums&amp;file=profile&amp;mode=viewprofile&amp;u=2">RebelT</a>(H)<br />
<hr /><center><small>We have received</small><br />
<b>682,875</b><br />
<small>page views since<br />2005</small></center><hr noshade="noshade" /><center>Hits New Today: <b>0</b><br />Hits New Yesterday: <b>0</b><br /></center><hr noshade="noshade" /><center>Server Date/Time<br />16 December 2008
14:58:56 GMT (GMT +0)</center></form></td>
                    </tr>
                  </table></td>
              </tr>
              <tr>
                <td height="27" style="background-image: url(themes/weston/images/cellpic1.gif)">&nbsp;</td>
              </tr>
            </table></td>
        </tr>
      </table></td>
  </tr>
</table>


Just in case there's something else. Very Happy
 
Guardian2003
Site Admin



Joined: Aug 28, 2003
Posts: 6799
Location: Ha Noi, Viet Nam

PostPosted: Tue Dec 16, 2008 9:17 am Reply with quote

Try removing the die() from the second to last line.
 
View user's profile Send private message Send e-mail
Palbin







PostPosted: Tue Dec 16, 2008 9:22 am Reply with quote

Remove die(); at the end that is killing everything. I also changed the security check at the top to bring it up to date.

Code:


<?php

if ( !defined('BLOCK_FILE') ) {
    Header("Location: ../index.php");
}

$content .= "<b>League: </b><br />'"
$result = $db->sql_query("SELECT * FROM team_players");
$num_rows = $db->sql_numrows($result);

$content .= "Players: $num_rows <br />'";
$result =  $db->sql_query("SELECT * FROM team_names2");
$num_rows =  $db->sql_numrows($result);

$content .= "Teams: $num_rows <br /><hr />'";

?>
 
Palbin







PostPosted: Tue Dec 16, 2008 9:22 am Reply with quote

Guardian2003, got me while I was typing Smile
 
Guardian2003







PostPosted: Tue Dec 16, 2008 9:23 am Reply with quote

Wink
 
rebelt







PostPosted: Tue Dec 16, 2008 9:26 am Reply with quote

No change.

Just added a phpinfo. would the following make a difference?

PHP Version 5.2.6
Mysql 5.0.51b
 
rebelt







PostPosted: Sun Dec 21, 2008 10:16 am Reply with quote

Palbin wrote:


Code:


<?php

if ( !defined('BLOCK_FILE') ) {
    Header("Location: ../index.php");
}

$content .= "<b>League: </b><br />'"
$result = $db->sql_query("SELECT * FROM team_players");
$num_rows = $db->sql_numrows($result);

$content .= "Players: $num_rows <br />'";
$result =  $db->sql_query("SELECT * FROM team_names2");
$num_rows =  $db->sql_numrows($result);

$content .= "Teams: $num_rows <br /><hr />'";

?>

Created a new block pasted the above code in it. Killed everything afterwards.
Crying or Very sad
 
Guardian2003







PostPosted: Sun Dec 21, 2008 10:49 am Reply with quote

Try this;
Code:


if ( !defined('BLOCK_FILE') ) {
    Header("Location: ../index.php");
}
global $db;
$content = '';
$content .= "<b>League: </b><br />";
$result = $db->sql_query("SELECT * FROM team_players");
$num_rows = $db->sql_numrows($result);

$content .= "Players: $num_rows <br />";
$result =  $db->sql_query("SELECT * FROM team_names2");
$num_rows =  $db->sql_numrows($result);

$content .= "Teams: $num_rows <br /><hr />";
 
rebelt







PostPosted: Sun Dec 21, 2008 3:35 pm Reply with quote

Worked a treat. Thank you.
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating Blocks

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 ©