vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   What's wrong with this code? (https://vborg.vbsupport.ru/showthread.php?t=68331)

Davey 08-14-2004 12:09 PM

I found the bug allright.
PHP Code:

while ($memberlist $DB_site->fetch_array($memberlistquery))
{
eval(
'$endtemplate .= "' fetch_template('guild_memberrow') . '";');
}
if (!
$memberlist['username'])
{
echo 
"something's wrong.";
}
// done
$templatename 'guild_memberslist'

See attachment.

Now how to fix that? lol

Dean C 08-14-2004 12:12 PM

Well i've no idea without looking at it fully. Are you not showing me some code? How does it output undisclosed?

Davey 08-14-2004 12:14 PM

I changed the templates to debug the <if> conditioning.
It'd look something like:

Code:

<td>
<if condition="$memberlist[field6]">
$memberlist[field6]
</if>
<if condition="!$memberlist[field6]">
Undisclosed.
</if>

edit.- That prooves that it's not <if> but it's the $memberlist fetched array which isn't doing as it should for whatever reason.

Dean C 08-14-2004 01:54 PM

You are going seriously wrong here ;) Where are you getting field6 from? You should be using the field username? Also if you're trying to get profile fields then you have to join the profilefield table (or whatever it is in vB3)

Davey 08-14-2004 02:32 PM

Code:

<tr>
<td style="text-align: center; vertical-align: middle">
<a href="member.php?u=$memberlist[userid]">$memberlist[musername]</a>
</td>
<td style="text-align: center; vertical-align: middle">
<if condition="$memberlist[field5]">
$memberlist[field5]
</if>
<if condition="!$memberlist[field5]">
Undisclosed.
</if>
</td>
<td style="text-align: center; vertical-align: middle">
<if condition="$memberlist[field6]">
$memberlist[field6]
</if>
<if condition="!$memberlist[field6]">
Undisclosed.
</if>
</td>
<td style="text-align: center; vertical-align: middle">
<if condition="$memberlist[field7]">
$memberlist[field7]
</if>
<if condition="!$memberlist[field7]">
Undisclosed.
</if>
</td>
</tr>

It's not returning anything, let alone the profile fields. Not that I understand JOIN'ing at all.
edit.- I've updated the code and templates in the first post.

Tigga 08-14-2004 04:31 PM

Try something like this instead:
PHP Code:

 $memberlistquery $DB_site->query(
SELECT user.*, userfield.*
FROM " 
TABLE_PREFIX "user AS user
LEFT JOIN " 
TABLE_PREFIX "userfield AS userfield USING (userid)
WHERE '8' IN (membergroupids) 
ORDER BY username ASC 
"
) or die("mysql error"); 


Davey 08-14-2004 06:26 PM

That didn't work any, still comes up blank.

Tigga 08-14-2004 06:37 PM

Try moving this part:

PHP Code:

if (empty($_REQUEST['do'])) 

    
$_REQUEST['do'] = 'members'


Below the call to global.php. It being above the call to global.php will create a problem... Other than that I don't see anything else wrong.

Davey 08-14-2004 06:44 PM

lol
Quote:

Originally Posted by CarCdr
Also, I would do the check for an empty $_REQUEST['do'] so that it is set before including global.php. This will allow it to pre-cache the $actiontemplates.

Who's right?
*confused*

Tigga 08-14-2004 06:51 PM

Keep that code below the call to global.php, then add this above to cache the templates:

$actiontemplates['none'] = &$actiontemplates['members'];


All times are GMT. The time now is 11:56 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01008 seconds
  • Memory Usage 1,743KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (3)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete