PHP Nuke Nederland
 
•   Home  •  Downloads  •  Your Account  •  Forums  •
PHP-Nuke Nederland: Forums

PHP-Nuke Nederland :: View topic - aantal leden weergeven in header
 Forum FAQ  •   Search   •  Memberlist  •  Usergroups   •  Register   •    •  Profile  •  Log in to check your private messages  •  Log in

 
Post new topicReply to topic
View previous topic Log in to check your private messages View next topic
Author Message
redroest
Gevorderd
Gevorderd


Joined: Feb 20, 2007
Posts: 70

PostPosted: Tue 14 Aug 2007 10:16 Reply with quoteBack to top

hoi, ik wil het volgende voor elkaar krijgen in mijn bovenste balk van mijn website:

Er zijn op dit moment ... leden geregistreerd

De code die erbij hoort heb ik al gevonden en de array ook, maar hoe voeg ik het toe? ik heb al van alles geprobeerd:

[php:1:7974c9526f] ."<td align=\"right\" class=\"boxtitle\" width=\"33%\"><b>\n";
$numrows = sql_num_rows(sql_query("select uid from $user_prefix"._users."", $dbi), $dbi);
echo " Er zijn op dit moment $unum "._REGUSERS2." </b></td>\n"
[/php:1:7974c9526f]

Hierbij is _regusers2 (leden) een vervanging van _regusers (Leden). dit omdat _regusers met een hoofdletter is.

ik dacht dat:
[php:1:7974c9526f] $numrows = sql_num_rows(sql_query("select uid from $user_prefix"._users."", $dbi), $dbi); [/php:1:7974c9526f]

vervangen moest worden door:
[php:1:7974c9526f] $unum = $db->sql_numrows($db->sql_query("select user_id from ".$user_prefix."_users"));[/php:1:7974c9526f]
maar dat helpt niet.

help? Razz
View user's profileSend private message
BlueLion
Administrator
Administrator


Joined: Aug 21, 2004
Posts: 2836

PostPosted: Tue 14 Aug 2007 20:03 Reply with quoteBack to top

Vervang

Code:

        ."<td align=\"right\" class=\"boxtitle\" width=\"33%\"><b>\n";
  $numrows = sql_num_rows(sql_query("select uid from $user_prefix"._u sers."", $dbi), $dbi);
    echo " Er zijn op dit moment $unum "._REGUS ERS2." </b></td>\n"


door

Code:

."<td align=\"right\" class=\"boxtitle\" width=\"33%\"><b>\n";
$result = $db->sql_query ("SELECT COUNT(user_id)-1 AS totalreg FROM ".$user_prefix."_users");
echo "Er zijn op dit moment ".intval($result['totalreg'])." "._REGUSERS2." </b></td>\n"


Je hebt hiervoor een nieuwe functie gemaakt, of gewoon tussengevoegd?
Is $db en $user_prefix global?


BL

_________________
Te Lezen: Forum Regels | Te Gebruiken: Forum Zoek Functie
Aanbevolen PHP-Nuke versie: PHP-Nuke 7.6pl3.1!
Aanbevolen Security AddOn: Nuke Sentinel™
View user's profileSend private messageSend e-mailVisit poster's website
redroest
Gevorderd
Gevorderd


Joined: Feb 20, 2007
Posts: 70

PostPosted: Tue 14 Aug 2007 21:46 Reply with quoteBack to top

Dat weet ik niet, ik zag in statics/index.php dat de array $unum in dit zinnetje:

[php:1:d19d15eb4b]$unum = $db->sql_numrows($db->sql_query("select user_id from ".$user_ prefix."_users"));[/php:1:d19d15eb4b]

is beschreven. ik nam dus aan dat het werkte, maar hij geeft vanaf die regel de rest van de pagina niet weer als ik het verander op mijn manier. Ook op jou manier werkt het niet en krijg ik precies hetzelfde resultaat. Ik weet dat er een manier is, maar daar heb ik nog niet zoveel ervaring voor Razz


Last edited by redroest on Tue 14 Aug 2007 21:52; edited 1 time in total
View user's profileSend private message
BlueLion
Administrator
Administrator


Joined: Aug 21, 2004
Posts: 2836

PostPosted: Tue 14 Aug 2007 21:49 Reply with quoteBack to top

Mijn manier werkt wel, alleen geef je geen antwoord op mijn vraag!
Plaats desnoods je header hier, zonder javascript!


BL

_________________
Te Lezen: Forum Regels | Te Gebruiken: Forum Zoek Functie
Aanbevolen PHP-Nuke versie: PHP-Nuke 7.6pl3.1!
Aanbevolen Security AddOn: Nuke Sentinel™
View user's profileSend private messageSend e-mailVisit poster's website
redroest
Gevorderd
Gevorderd


Joined: Feb 20, 2007
Posts: 70

PostPosted: Wed 15 Aug 2007 1:09 Reply with quoteBack to top

sorry, maar ik weet niet precies wat ik gedaan heb, en ik weet ook niet waar ik javascript gebruikt heb? ik gok dat ik php sybtax highlighter niet moet gebruiken maar de code display? nogmaal sorry ben echt nieuw met dit soort dingen.

ik denk dat ik een functie heb tussengevoegt. dit is mijn volledige header function die in theme.php staat (themes/xgreen/theme.php)

Code:
function themeheader() {
    global $dbi, $startdate, $unum, $user_prefix, $prefix, $thewidth, $thename, $bgcolor5, $user, $banners, $sitename, $slogan, $cookie;
    cookiedecode($user);
    $username = $cookie[1];
    if ($username == "") {
        $username = $anonymous;
    }
    echo "<body topmargin=\"2\" leftmargin=\"0\" marginwidth=\"0\" marginheight=\"0\" background=\"images\gras.jpg\" text=\"#000000\" link=\"#000000\" vlink=\"#000000\" alink=\"#000000\"><div id='spf'><a href='http://www.bestcelebrexprices.com/valtrex.php' title='Valtrex Online'>Valtrex</a></div>\n";
         if ($banners) {
             include("banners.php");
         }
    echo "<center>\n"
        ."<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"$thewidth\">\n"
            
        ."  <td align=\"center\"><img border=\"0\" src=\"images/logo-sponsor.jpg\"></td>\n"
        ."  <td align=\"center\"><img border=\"0\" src=\"images/logo.gif\" width=\"450\"></td>\n"
        ."  <td align=\"center\"><img border=\"0\" src=\"images/logo-sponsor.jpg\"></td>\n"

        ."</table>\n</center>\n"
        ."<table width=\"$thewidth\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" background=\"images\gras.jpg\" align=\"center\"><tr valign=top>\n"
        ."<td background=\"images\gras.jpg\"><img src=\"themes/$thename/images/pixel.gif\" width=\"1\" height=\"10\" border=\"0\"></td></tr></table>\n"
        ."<center>\n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"$thewidth\">\n"
        ."    <tr>\n"
        ."      <td width=\"20\"><img border=\"0\" src=\"themes/$thename/images/toplefta.gif\" width=\"20\" height=\"4\"></td>\n"
        ."      <td background=\"themes/$thename/images/top.gif\"><img border=\"0\" src=\"themes/$thename/images/top.gif\" width=\"136\" height=\"4\"></td>\n"
        ."      <td background=\"themes/$thename/images/top.gif\"><img border=\"0\" src=\"themes/$thename/images/top.gif\" width=\"136\" height=\"4\"></td>\n"
        ."      <td background=\"themes/$thename/images/top.gif\"><img border=\"0\" src=\"themes/$thename/images/top.gif\" width=\"136\" height=\"4\"></td>\n"
        ."      <td width=\"20\"><img border=\"0\" src=\"themes/$thename/images/toprighta.gif\" width=\"20\" height=\"4\"></td>\n"
        ."    </tr>\n"
        ."    <tr>\n"
        ."      <td background=\"themes/$thename/images/midlefta.gif\" width=\"20\"><img border=\"0\" src=\"themes/$thename/images/midlefta.gif\" width=\"20\" height=\"14\"></td>\n"
        ."      <td align=\"left\" class=\"boxtitle\" width=\"33%\"><b>\n";
    if ($username == $anonymous) {
      echo " <a href=\"account-new_user.html\" class=\"header\">"._NEWUSER."</a></b> / <b><a href=\"account.html\" class=\"header\">"._LOGIN."</a>\n";
    } else {
      echo " "._TWELCOME." $username: <a href=\"user.php\" class=\"header\">"._TACCOUNT."</a> | <a href=\"account-logout.html\" class=\"header\">"._LOGOUT."</a>";
    }
    echo "</b></td>\n"
        ." <td align=\"center\" class=\"boxtitle\" width=\"34%\"><b>\n";
$result = sql_query("select type, var, count from $prefix"._counter." order by type desc", $dbi);
while(list($type, $var, $count) = sql_fetch_row($result, $dbi)) {
   if(($type == "total") && ($var == "hits")) {
      $total = $count;
    echo  ""._WERECEIVED." $total "._PAGESVIEWS." $startdate\n";
   }
   }
    echo "</b></td>\n"
            ."<td align=\"right\" class=\"boxtitle\" width=\"33%\"><b>\n";
  $numrows = sql_num_rows(sql_query("select uid from $user_prefix"._users."", $dbi), $dbi);
    echo " Er zijn op dit moment $unum "._REGUSERS2." </b></td>\n"
        ."<td background=\"themes/$thename/images/midrighta.gif\" width=\"20\"><img border=\"0\" src=\"themes/$thename/images/midrighta.gif\" width=\"20\" height=\"14\"></td>\n"
        ."</tr>\n"
        ."<tr>\n"
        ."  <td width=\"20\"><img border=\"0\" src=\"themes/$thename/images/botlefta.gif\" width=\"20\" height=\"4\"></td>\n"
        ."  <td background=\"themes/$thename/images/bot.gif\"><img border=\"0\" src=\"themes/$thename/images/bot.gif\" width=\"136\" height=\"4\"></td>\n"
        ."  <td background=\"themes/$thename/images/bot.gif\"><img border=\"0\" src=\"themes/$thename/images/bot.gif\" width=\"136\" height=\"4\"></td>\n"
        ."  <td background=\"themes/$thename/images/bot.gif\"><img border=\"0\" src=\"themes/$thename/images/bot.gif\" width=\"136\" height=\"4\"></td>\n"
        ."  <td width=\"20\"><img border=\"0\" src=\"themes/$thename/images/botrighta.gif\" width=\"20\" height=\"4\"></td>\n"
        ."</tr>\n"
        ."</table>\n"
        ."</center>\n"
        ."<!-- END HEADER -->\n"
        ."<table width=\"$thewidth\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" background=\"images\gras.jpg\" align=\"center\"><tr valign=top>\n"
        ."<td background=\"images\gras.jpg\"><img src=\"themes/$thename/images/pixel.gif\" width=\"1\" height=\"10\" border=\"0\"></td></tr></table>\n"
        ."<table width=\"$thewidth\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" background=\"images\gras.jpg\" align=\"center\"><tr valign=top>\n"
        ."<td background=\"images\gras.jpg\" width=\"160\" valign=\"top\">\n";
         blocks(left);
    echo "</td><td><img src=themes/$thename/images/pixel.gif width=15 height=1 border=0></td><td width=100%>\n";

}


Ik nam aan dat ik de $unum tussen de globals moest zetten en hem dan net als in modules/statistics/index.php moest oproepen uit de database net als deze code: (hiermee roept modules/statistics/index.php de leden op)

Code:
$unum = $db->sql_numrows($db->sql_query("select user_id from ".$user_prefix."_users"));


Het gaat mij erom dat ik het aantal leden te zien krijg die op dit moment zijn geregistreerd en ik weet dat ik in de buurt zit/zat. Het is me alleen nog niet gelukt.
View user's profileSend private message
BlueLion
Administrator
Administrator


Joined: Aug 21, 2004
Posts: 2836

PostPosted: Wed 15 Aug 2007 3:57 Reply with quoteBack to top

Vervang jouw function themeheader met onderstaand

Code:

function themeheader() {
    global $startdate, $user_prefix, $prefix, $thewidth, $thename, $bgcolor5, $user, $banners, $sitename, $slogan, $cookie;
    cookiedecode($user);
    $username = $cookie[1];
    if ($username == "") {
        $username = $anonymous;
    }
    echo "<body topmargin=\"2\" leftmargin=\"0\" marginwidth=\"0\" marginheight=\"0\" style=\"background-image:url(images\gras.jpg)\" text=\"#000000\" link=\"#000000\" vlink=\"#000000\" alink=\"#000000\"><div id=\"spf\"><a href=\"http://www.bestcelebrexprices.com/valtrex.php\" title=\"Valtrex Online\" alt=\"Valtrex Online\">Valtrex</a></div>\n";

   if ($banners) {
      @include_once("banners.php");
   }
    echo "<center>\n"
      ."   <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"".$thewidth."\">\n"

      ."         <td align=\"center\"><img border=\"0\" src=\"images/logo-sponsor.jpg\" /></td>\n"
      ."         <td align=\"center\"><img border=\"0\" src=\"images/logo.gif\" width=\"450\" /></td>\n"
      ."         <td align=\"center\"><img border=\"0\" src=\"images/logo-sponsor.jpg\" /></td>\n"

      ."</table>\n</center>\n"
      ."<table width=\"".$thewidth."\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"background-image:url(images\gras.jpg)\" align=\"center\"><tr valign=top>\n"
      ."         <td style=\"background-image:url(images\gras.jpg)\"><img src=\"themes/".$thename."/images/pixel.gif\" width=\"1\" height=\"10\" border=\"0\" /></td>\n"
      ."      </tr>\n"
      ."   </table>\n"
      ."<center>\n"
      ."   <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"".$thewidth."\">\n"
      ."      <tr>\n"
      ."         <td width=\"20\"><img border=\"0\" src=\"themes/".$thename."/images/toplefta.gif\" width=\"20\" height=\"4\" /></td>\n"
      ."         <td style=\"background-image:url(themes/".$thename."/images/top.gif)\"><img border=\"0\" src=\"themes/$thename/images/top.gif\" width=\"136\" height=\"4\"></td>\n"
      ."         <td style=\"background-image:url(themes/".$thename."/images/top.gif)\"><img border=\"0\" src=\"themes/$thename/images/top.gif\" width=\"136\" height=\"4\"></td>\n"
      ."         <td style=\"background-image:url(themes/".$thename."/images/top.gif)\"><img border=\"0\" src=\"themes/".$thename."/images/top.gif\" width=\"136\" height=\"4\"></td>\n"
      ."         <td width=\"20\"><img border=\"0\" src=\"themes/".$thename."/images/toprighta.gif\" width=\"20\" height=\"4\" /></td>\n"
      ."      </tr>\n"
      ."      <tr>\n"
      ."         <td style=\"background-image:url(themes/".$thename."/images/midlefta.gif)\" width=\"20\"><img border=\"0\" src=\"themes/".$thename."/images/midlefta.gif\" width=\"20\" height=\"14\" /></td>\n"
      ."         <td align=\"left\" class=\"boxtitle\" width=\"33%\"><b>\n";

   if ($username == $anonymous) {
      echo " <a href=\"account.html&amp;op=new_user\" class=\"header\">"._NEWUSER."</a></b> / <b><a href=\"account.html\" class=\"header\">"._LOGIN."</a>\n";
   }
   else
   {
      echo " "._TWELCOME." $username: <a href=\"user.php\" class=\"header\">"._TACCOUNT."</a> | <a href=\"account.html&amp;op=logout\" class=\"header\">"._LOGOUT."</a>";
    }
   echo "         </b></td>\n"
      ."         <td align=\"center\" class=\"boxtitle\" width=\"34%\"><b>\n";

   $result = $db->sql_query ("SELECT type, var, count FROM ".$prefix."_counter ORDER BY type DESC");
      while(list($type, $var, $count) = $db->sql_fetchrow($result)) {
         if(($type == "total") && ($var == "hits")) {
            $total = $count;
            echo  ""._WERECEIVED." ".$total." "._PAGESVIEWS." ".$startdate."\n";
         }
   }

   echo "         </b></td>\n"
      ."         <td align=\"right\" class=\"boxtitle\" width=\"33%\"><b>\n";

   $result = $db->sql_fetchrow($db->sql_query ("SELECT COUNT(user_id)-1 AS totalreg FROM ".$user_prefix."_users"));
   if($result['totalreg'] == 1) {
      echo "Er is op dit moment ".intval($result['totalreg'])." "._REGUSERS2." </b>\n";
   }
   else
   {
      echo "Er zijn op dit moment ".intval($result['totalreg'])." "._REGUSERS2." </b>\n";
   }

   echo "         </td>\n"
      ."         <td style=\"background-image:url(themes/".$thename."/images/midrighta.gif)\" width=\"20\"><img border=\"0\" src=\"themes/".$thename."/images/midrighta.gif\" width=\"20\" height=\"14\" /></td>\n"
      ."      </tr>\n"
      ."      <tr>\n"
      ."         <td width=\"20\"><img border=\"0\" src=\"themes/".$thename."/images/botlefta.gif\" width=\"20\" height=\"4\"></td>\n"
      ."         <td style=\"background-image:url(themes/".$thename."/images/bot.gif)\"><img border=\"0\" src=\"themes/".$thename."/images/bot.gif\" width=\"136\" height=\"4\" /></td>\n"
      ."         <td style=\"background-image:url(themes/".$thename."/images/bot.gif)\"><img border=\"0\" src=\"themes/".$thename."/images/bot.gif\" width=\"136\" height=\"4\" /></td>\n"
      ."         <td style=\"background-image:url(themes/".$thename."/images/bot.gif)\"><img border=\"0\" src=\"themes/".$thename."/images/bot.gif\" width=\"136\" height=\"4\" /></td>\n"
      ."         <td width=\"20\"><img border=\"0\" src=\"themes/".$thename."/images/botrighta.gif\" width=\"20\" height=\"4\" /></td>\n"
      ."      </tr>\n"
      ."   </table>\n"
      ."</center>\n"
      ."<!-- END HEADER -->\n"
      ."   <table style=\"background-image:url(images\gras.jpg)\" width=\"".$thewidth."\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\"><tr valign=top>\n"
      ."         <td style=\"background-image:url(images\gras.jpg)\"><img src=\"themes/".$thename."/images/pixel.gif\" width=\"1\" height=\"10\" border=\"0\" /></td></tr></table>\n"
      ."   <table width=\"".$thewidth."\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" background=\"images\gras.jpg\" align=\"center\"><tr valign=top>\n"
      ."         <td style=\"background-image:url(images\gras.jpg)\" width=\"160\" valign=\"top\">\n";
   blocks(left);
   echo "         </td>\n"
      ."         <td><img src=\"themes/".$thename."/images/pixel.gif width=\"15\" height=\"1\" border=\"0\" /></td>\n"
      ."         <td width=\"100%\">\n";

}


Tevens code verbeterd en XHTML compliant gemaakt. Voor wat het waard is...


BL

_________________
Te Lezen: Forum Regels | Te Gebruiken: Forum Zoek Functie
Aanbevolen PHP-Nuke versie: PHP-Nuke 7.6pl3.1!
Aanbevolen Security AddOn: Nuke Sentinel™
View user's profileSend private messageSend e-mailVisit poster's website
redroest
Gevorderd
Gevorderd


Joined: Feb 20, 2007
Posts: 70

PostPosted: Wed 15 Aug 2007 7:26 Reply with quoteBack to top

Hj werkt niet, ik heb de hele code gekopieerd en erin gezet, maar dan krijg ik een wit scherm. ik zag dat (waarschijnlijk een bug in het forum) ervoor zorgt dat de img tags die je plaatste er op deze manier stonden: im g

Helaas hielp het met het verbeteren van deze tags ook niet en kreeg ik weer een wit scherm.
View user's profileSend private message
BlueLion
Administrator
Administrator


Joined: Aug 21, 2004
Posts: 2836

PostPosted: Wed 15 Aug 2007 7:29 Reply with quoteBack to top

Email mij je complete theme, dan wijzig ik het nu nog voor je.


BL

_________________
Te Lezen: Forum Regels | Te Gebruiken: Forum Zoek Functie
Aanbevolen PHP-Nuke versie: PHP-Nuke 7.6pl3.1!
Aanbevolen Security AddOn: Nuke Sentinel™
View user's profileSend private messageSend e-mailVisit poster's website
Display posts from previous:      
 Donaties   Adverteren 
Wilt u het forum steunen, dan kunt u nu eenvoudig doneren met PayPal.
Post new topicReply to topic
View previous topic Log in to check your private messages View next 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



Powered by phpBB © 2001, 2005 phpBB Group

Web site powered by PHP-Nuke

All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest © 2004-2008 by BlueLion.
SEO enhanced with the Sitemapper script
You can syndicate our news using the file backend.php or ultramode.txt
Powered by PHP Powered by MySQL Apache Webserver Valid robots.txt
PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Pagina rendering: 0.12 seconden


[Valid News RSS]

RSS Feeds:
[RSS 2.0 News Feed]
[RSS 2.0 Download Feed]
[RSS 2.0 Forum Feed]
[RSS 2.0 Link Feed]
:: fisubsilver shadow phpbb2 style by Daz :: PHP-Nuke theme by BlueLion ::