![]() |
What's wrong with this code?
Table coming up blank. Everything else was peachy.
I kind of troubleshot it down to roughly where it is, seems my fetch_template() calls aren't doing their job properly. Called from DB, if my query wasn't successful, surely it'd have fetched the error template (no num_rows) Anyway... the stuff. File: guild.php Incompleted. PHP Code:
Code:
$stylevar[htmldoctype] Code:
<tr> Code:
<tr><td>There are no members in this group.</td></tr> Outcome: See attachment screenshot. |
It's probably not it, but you're missing <tr>'s around the two tcat rows.
Also, look in your database for how many rows should be returned. |
If there are no rows retrieved, you will not see the error. Right after you set "$endtemplate" to the error message you set it to the empty string in the line:
$endtemplate = ''; 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. Finally, as Colin pointed out, I would fix your <TR>/<TD> tags before debugging much further. |
OK well I did everything listed (check the code above).
The SQL in phpmyadmin returns 1 user (me) I'm still getting nothing, not even an error message. edit.- Could it be I need something else included? Maybe I've set the $actiontemplates or $globaltemplates wrong? After all I don't understand what either do so I'm not sure if they're right or not. |
Try adding a $DB_site->data_seek(0,$memberlistquery); after the if(blabla =='0'){ bla }
|
No wonder, put all this inside the if($_REQUEST['do']... bit:
PHP Code:
|
@Dean C:
Are you sure?? The nav bits is nothing to do with listing the members. It does output the page, it just doesn't output what it needs to. If you look in the vBulletin 3 files, that is all at the bottom. In the 'if($_REQUEST['do']...' bit, there is a bit at the end: $templatename = 'template_name';//replace "template_name" with name of template. @Colin F: $test = $DB_site->data_seek(0,$memberlistquery); echo $test; Returns '1'.. (whatever that means, lol) |
Oh and Dean, I did what you said...
PHP Code:
|
Ok then debug it like so:
PHP Code:
|
I didn't try that because I figured out the problem. I assume it would have echo()'ed "one" in the browser. :)
That bit is working fine. Code:
<tr> edit.- I have to eval() the $memberlist variable, no..? |
I found the bug allright.
PHP Code:
Now how to fix that? lol |
Well i've no idea without looking at it fully. Are you not showing me some code? How does it output undisclosed?
|
I changed the templates to debug the <if> conditioning.
It'd look something like: Code:
<td> |
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)
|
Code:
<tr> edit.- I've updated the code and templates in the first post. |
Try something like this instead:
PHP Code:
|
That didn't work any, still comes up blank.
|
Try moving this part:
PHP Code:
|
lol
Quote:
*confused* |
Keep that code below the call to global.php, then add this above to cache the templates:
$actiontemplates['none'] = &$actiontemplates['members']; |
PHP Code:
edit.- I still don't see why the fetch_array of $memberlist is causing it not to work properly. How come the problem is so obscure? |
OK this is nothing to do with $DB_site.
This is something to do with the calling of $memberlist[value] in the templates. Just check out the attachments. edit.- So, what could be preventing the $memberlist[value] variable from doing its job? Is there something I missed out code-wise or a file or something I didn't require? |
Looks like the code you posted there is working just fine... To print out the additional fields you should just need to change the query back so that you're joining the userfield table. If it's still not working you may want to double check that field5,6 and 7 are the correct ones that you're trying to pull. And actually, it doesn't appear that those are... Are those hidden profile fields or something? From looking at the profiles on your site you don't even have any additional fields unless they're hidden from view.
|
They are hidden from view. Can you explain why the username isn't coming up in the first field? If what you said is true, at least the username should be showing up, no?
|
You have $memberlist[musername] in your template. Remove the 'm' there and it will show the username. ;)
|
Nvm I was using vbindex and it was a bit of hassle to tell you the truth. I'm switching to your CMS tigga, I'll have to do everything manually that's all. :)
Thx for the support though everyone. |
All times are GMT. The time now is 11:38 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|