Pagina 1 van 1

0 wordt neit weergegeven.

Geplaatst: 16 jun 2004, 12:57
door LazyTiger
ik heb wat zitten knutselen in profielen, maar nu komen de getallen van het aantal topics/posts want mensen hebben niet helemaal door.

een voorbeeld van podium 4 zijn profiel: http://www.muziekforumonline.nl/phpBB2/ ... file&u=189

mijn profiel:
http://www.muziekforumonline.nl/phpBB2/ ... rofile&u=3

zoals je ziet komt het getal 0 eigenlijk niet door.
die wordt niet weergegeven.

Code: Selecteer alles

'POSTS' => $profiledata['user_posts'],
	'POSTS2' => $profiledata['user_posts2'],
	'TOPICS' => $user_topics2,
	'TOPICS2' => $user_topics,
user_topics wordt zo gegeven:

Code: Selecteer alles

$sql = "SELECT t.topic_poster 
         FROM slave1_topics t 
         WHERE t.topic_poster = " . $profiledata['user_id'] . " "; 
      if ( !($result = $db->sql_query($sql)) ) 
      { 
         message_die(GENERAL_ERROR, 'Could not count topics information', '', __LINE__, __FILE__, $sql); 
      } 

      while( $user_topics_info[] = $db->sql_fetchrow($result) ) 
      ( $user_topics = count($user_topics_info) );
hoe komt het dat ik de 0 niet zie staan?

Geplaatst: 16 jun 2004, 15:28
door mosymuis
Ik zie even niet waarom er niets wordt weergegeven, als het enkel om de 0 gaat zal dit helpen;

Code: Selecteer alles

   'POSTS' => intval($profiledata['user_posts']),
   'POSTS2' => intval($profiledata['user_posts2']),
   'TOPICS' => intval($user_topics2),
   'TOPICS2' => intval($user_topics),
intval() geeft namelijk gegarandeerd een integer terug, en geeft dus een 0 als er niets wordt ingevoerd.

Geplaatst: 16 jun 2004, 15:35
door WebSiteNet
Mischien hoort het zo maar ik zie dat er bij TOPIC van $user_topics2 komt en TOPICS2 van $user_topics. Klopt dat?

Geplaatst: 16 jun 2004, 15:43
door mosymuis
WebSiteNet schreef:Mischien hoort het zo maar ik zie dat er bij TOPIC van $user_topics2 komt en TOPICS2 van $user_topics. Klopt dat?
Denk van wel, ivm zijn FFO en MFO

Geplaatst: 16 jun 2004, 15:47
door WebSiteNet
Dat snap ik, maar ik denk dat $user_topics2 bij TOPICS2 hoort.

Geplaatst: 16 jun 2004, 18:32
door LazyTiger
hoort zo.
ik moet dat allemaal nog een keer wat opschonen.

ik zal de intval eens proberen..

Geplaatst: 16 jun 2004, 19:34
door LazyTiger
laat ik ook maar even melden dat de intval werkte :P
http://www.muziekforumonline.nl/phpBB2/ ... file&u=109

Geplaatst: 16 jun 2004, 19:42
door mosymuis
Da's mooi, maar...?

http://www.muziekforumonline.nl/phpBB2/ ... rofile&u=2

Code: Selecteer alles

 Could not count topics information

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3

SELECT t.topic_poster FROM slave1_topics t WHERE t.topic_poster =
Line : 62
File : /usr/home/mfo/public_html/phpBB2/includes/usercp_viewprofile.php

Geplaatst: 16 jun 2004, 19:52
door LazyTiger
:p

gebruiker 2 bestaat niet.
bij messageboard wordt automatisch een account aangemaakt (helpdesk) die dan nr 2 krijgt.
jij wordt dan automatisch 3.

vandaar dat ik 3 ben.
http://www.muziekforumonline.nl/phpBB2/ ... rofile&u=3
of
http://www.muziekforumonline.nl/FFO/pro ... rofile&u=3

Geplaatst: 16 jun 2004, 20:11
door mosymuis
ic ;)

Als ik jou was zou ik dan deze mod eens installeren:
http://www.phpbb.com/phpBB/viewtopic.php?t=202004

Geplaatst: 16 jun 2004, 20:35
door LazyTiger
goed idee..
zal het binnenkort eens doen.

//edit
$lang['No_user_id_specified']
die staat al in de lang_main?

Geplaatst: 16 jun 2004, 20:39
door mosymuis
Dat klopt, er staat toch ook niet dat je hem moet toevoegen? :P

Geplaatst: 16 jun 2004, 20:40
door LazyTiger
nee okee... maar dacht dat die er niet in zou staan. :oops: