View Single Post
  #247  
Old 06-21-2004, 01:34 AM
EvilLS1's Avatar
EvilLS1 EvilLS1 is offline
 
Join Date: Apr 2002
Location: Georgia, USA
Posts: 987
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

dcevoclub,

First go to your admincp and add a new custom profile field. The names of the classes must be exactly as I list them or it won't work when sorting on the timeslips page.

Go to: admincp >> User Profile Fields >> Add New User Profile Field

Profile Field Type: Single Selection Menu

Click Continue.

Title: Class
Description: whatever you want

Options:
Street
Outlaw
Full Drag

Set Default: Yes, include a first blank option.

Display Order: Whatever you want

Field Required: No

Field Editable by User? Yes

Field Hidden on Profile? No

Field Searchable on Members List? No

Show on Members List? No

Allow user to input their own value for this option? No

Max length of allowed user input: 15

Display Size: 15

Regular Expression: 0

Which page displays this option? Edit Profile

Click Save.


Now on the next screen (the user profile field manager screen) find the new field that you just added. Over to the right of the new field you'll see a link that says [Edit]. Hold your mouse over that link (don't click it) and look at the bottom of your browser where it shows the url. Make a note of the field ID # for the field you just added.

Assuming that you're still using v2.0 in member.php and includes/functions_user.php find all instances of this (there will be several):

Code:
(50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65)
Now in the code below replace the XX with the field ID of the new class field.. Then copy the code below and replace ALL instances of the code above in member.php and includes/functions_user.php:
Code:
(50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,XX)
Save & upload.

Now open timeslips.php and find this:

Code:
$natasp='N/A';
Below it add this:
Code:
$street = 'Street';
$outlaw = 'Outlaw';
$drag = 'Full Drag';
Still in timeslips.php find:

Code:
   }
    else if ($_REQUEST['do'] == 'na') 
   {
        $condition.=" AND userfield.field65='$natasp' AND userfield.field55>'".intval($number)."'";
        $cond.=" WHERE userfield.field55!=''";
        $orderby="userfield.field55";
        $direction=ASC;
        $bracket13="<b>[</b>";
        $bracket14="<b>]</b>";
Below it add:
Code:
   }
    else if ($_REQUEST['do'] == 'street') 
   {
        $condition.=" AND userfield.fieldXX='$street' AND userfield.field55>'".intval($number)."'";
        $cond.=" WHERE userfield.field55!=''";
        $orderby="userfield.field55";
        $direction=ASC;
        $bracket133="<b>[</b>";
        $bracket143="<b>]</b>";
   }
    else if ($_REQUEST['do'] == 'outlaw') 
   {
        $condition.=" AND userfield.fieldXX='$outlaw' AND userfield.field55>'".intval($number)."'";
        $cond.=" WHERE userfield.field55!=''";
        $orderby="userfield.field55";
        $direction=ASC;
        $bracket133="<b>[</b>";
        $bracket143="<b>]</b>";
   }
    else if ($_REQUEST['do'] == 'drag') 
   {
        $condition.=" AND userfield.fieldXX='$drag' AND userfield.field55>'".intval($number)."'";
        $cond.=" WHERE userfield.field55!=''";
        $orderby="userfield.field55";
        $direction=ASC;
        $bracket133="<b>[</b>";
        $bracket143="<b>]</b>";
Now in the chunk of code above find all 3 instances of XX and replace it with the field ID for the new class field.


Still in timeslips.php find:
Code:
$spacer=" - ";
Below it add:
Code:
$class = "---";
Find:
Code:
$pos++;
Below it add:
Code:
$class = $userinfo[fieldXX];
Again, replace the XX in the code above with the field ID for the class field.


Save and upload timeslips.php

In your timeslips template find:
Code:
<td bgcolor="{categorybackcolor}" colspan="5" class="tcat"><b> Timeslip Database
Replace it with:
Code:
<td bgcolor="{categorybackcolor}" colspan="6" class="tcat"><b> Timeslip Database
Find:
Code:
<option value="timeslips.php?$session[sessionurl]&do=na">N/A cars only</option>
Below it add:
Code:
<option value="timeslips.php?$session[sessionurl]&do=street">Street Class</option>
<option value="timeslips.php?$session[sessionurl]&do=outlaw">Outlaw Class</option>
<option value="timeslips.php?$session[sessionurl]&do=drag">Full Drag Class</option>
Find:
Code:
<td class="thead" align="center">$bracket13<b>Induction</b>$bracket14</td>
Below it add:
Code:
<td class="thead" align="center">$bracket133<b>Class</b>$bracket143</td>
Find:
Code:
<td class="tfoot" colspan="10">
Replace it with:
Code:
<td class="tfoot" colspan="11">

In your timeslipsbit template find:
Code:
<td class="alt2">$induction</td>
Below it add:
Code:
<td class="alt1">$class</td>
Thats it! If you added the profile field class names exactly as I said and you replaced all of the XXs with the correct field ID it will work.


Now you know why I said it would be much easier if I just do it myself.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01269 seconds
  • Memory Usage 1,801KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (20)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete