Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
  #1  
Old 10-02-2004, 07:26 AM
Starscream's Avatar
Starscream Starscream is offline
 
Join Date: Jun 2004
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Create a Seperate Page for Custom Profile Fields

I have searched around and have been unable to find an answer to my question. Forgive me if I missed it somewhere.

How would I go about creating a page that displays only the username and custom profile field of all the users on my site? I only want the User to show up on the list if he has that profile field filled out.

Basically, what I want to do is have a page where users can go to see all the other members profile field. For example: If I create a field for Xbox Live Gamertags and users fill it out, I want other members to see it on a seperate page called Xbox Gamertags.

Is this possible? Has this been done? Any help would be greatly appreciated.

Thanks
Reply With Quote
  #2  
Old 10-03-2004, 05:11 PM
Starscream's Avatar
Starscream Starscream is offline
 
Join Date: Jun 2004
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I know it would be similar to memberlist, I'm just not sure how to make users only show if they have that profile feild filled out.
Reply With Quote
  #3  
Old 10-06-2004, 04:16 AM
Starscream's Avatar
Starscream Starscream is offline
 
Join Date: Jun 2004
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is what I have as far as the php file is concerned. It's wrong, but it's a start - I think. I also have made two templates which I can post if they would help.

PHP Code:
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS'1);
define('THIS_SCRIPT''GTList');

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// pre-cache templates used by all actions
$globaltemplates = array(
'GTLIST'
'GT_listbit
);

// pre-cache templates used by specific actions
$actiontemplates = array();

// get special phrase groups
$phrasegroups = array();

// get special data templates from the datastore
$specialtemplates = array();

########################################################################

    $users = $DB_site->query("
        SELECT user.*,usertextfield.*,userfield.*, user.userid, options,
            IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid

$GT = $DB_site->query("SELECT user.userid, user.username, usertextfield.userid, usertextfield.field5 FROM users, usertextfield WHERE user.userid == usertextfield.userid ORDER BY user.username DESC");
  

// pre-cache templates used by specific actions
$actiontemplates = array();

// ######################### REQUIRE BACK-END ############################
require_once('
./global.php');

// ### ALL DONE! SPIT OUT THE HTML AND LET'
S GET OUTA HERE... ###

  
while($row=mysql_fetch_object($GT))
{
    
    
$who $row->username;
    
$gtname $row->field5;

eval(
'$gtbit = "' fetch_template('GT_listbit') . '";');

}

eval(
'print_output("' fetch_template('GTLIST') . '");');

eval(
'$navbar = "' fetch_template('navbar') . '";');
I'm pretty sure this is disorganized and somethings are incorrectly placed, but I am new to this and have very little idea of where things go.

Please help! Thanks.

edited - made some changes but not fixed
Reply With Quote
  #4  
Old 10-06-2004, 04:25 AM
Colin F's Avatar
Colin F Colin F is offline
 
Join Date: Jul 2004
Location: Switzerland
Posts: 1,551
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'd advise to move this part near the top:
Code:
// pre-cache templates used by all actions 
$globaltemplates = array( 
'GTLIST' 
'GT_listbit 
); 

// pre-cache templates used by specific actions 
$actiontemplates = array(); 

// ######################### REQUIRE BACK-END ############################ 
require_once('./global.php');
Especially because without the global.php you won't be able to use the object $DB_site


Then, you'll also need to move this:
Code:
  while($row=mysql_fetch_object($GT)) 
{ 
     
    $who = $row->username; 
    $gtname = $row->field5; 

eval('$gtbit = "' . fetch_template('GT_listbit') . '";'); 

} 

eval('print_output("' . fetch_template('GTLIST') . '");');
further down, as that has to be able to use $GT, which you only define later on.

And lastly, it won't help doing two queries if they both have the same varname, as the second will overwrite the first.
You might try to just use on query.


I'll post an edited version if I have time later on, gotta go now
Reply With Quote
  #5  
Old 10-06-2004, 05:58 AM
Starscream's Avatar
Starscream Starscream is offline
 
Join Date: Jun 2004
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for your help. I think I am slowly beginning to understand (or, at least, I'm trying to understand).
Reply With Quote
  #6  
Old 10-06-2004, 07:24 AM
Colin F's Avatar
Colin F Colin F is offline
 
Join Date: Jul 2004
Location: Switzerland
Posts: 1,551
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I haven't checked the SQL syntax, but here's your code, cleaned up a bit more:

PHP Code:
<?php 
// ####################### SET PHP ENVIRONMENT ########################### 
error_reporting(E_ALL & ~E_NOTICE); 

// #################### DEFINE IMPORTANT CONSTANTS ####################### 
define('NO_REGISTER_GLOBALS'1); 
define('THIS_SCRIPT''GTList'); 

// ######################### REQUIRE BACK-END ############################ 
require_once('./global.php'); 

// ################### PRE-CACHE TEMPLATES AND DATA ###################### 
// pre-cache templates used by all actions 
$globaltemplates = array( 
'GTLIST' 
'GT_listbit 
); 

// pre-cache templates used by specific actions 
$actiontemplates = array(); 

// get special phrase groups 
$phrasegroups = array(); 

// get special data templates from the datastore 
$specialtemplates = array(); 


eval('
$navbar "' . fetch_template('navbar') . '";'); 
//######################################################################## 

$GT = $DB_site->query("SELECT user.userid, user.username, usertextfield.userid, usertextfield.field5 FROM users, usertextfield WHERE user.userid == usertextfield.userid ORDER BY user.username DESC"); 
   

while($row=$DB_site->fetch_array($GT)) 

     
    $who = $row['
username']; 
    $gtname = $row['
field5']; 

    eval('
$gtbit .= "' . fetch_template('GT_listbit') . '";'); 



eval('
print_output("' . fetch_template('GTLIST') . '");');?

?>
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:29 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08272 seconds
  • Memory Usage 2,228KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete