vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   vB Timeslip Database -for Automotive websites (https://vborg.vbsupport.ru/showthread.php?t=58076)

ImportPassion 10-29-2003 02:40 PM

Quote:

Originally Posted by EvilLS1
Add-on: Separate "Vehicle Profile" page for submitting Timeslip Data.

Description: This add-on will remove the timeslip fields from your edit profle & registration pages and put them in thier own separate catagory called "Vehicle Profile".

This should help cut down the number of users who submit false data when registering or editing their profile since the vehicle info is edited on a completely separate page.

What's up with this code?
PHP Code:

   $profilefields=$DB_site->query("SELECT profilefieldid,required,title,size,maxlength
                                  FROM profilefield
                                  WHERE editable = 1
                                  AND profilefieldid IN (5,6,11,12,13,14,15,18,19)"
); 

Are the profile id's wrong?

EvilLS1 10-29-2003 03:03 PM

oly51,
Yes you can add any new fields to the Vehicle Profile page.. Just add the new field IDs into the queries where it says "AND profilefieldid IN (50,51,52,53,54,55,56,57)" and they will show up on the new vehicle profile page. You'll need to add the new field ID in 5 places (in the hack instructions for the addon).

As for the info on the other 150 cars that don't belong to registered users, I'm not sure how you could include those.

7thgenCivic.Com,
Sorry about that.. Those profile fields are from my own board and I forgot to change them in the hack instructions. Just replace that section of code with this:
Code:

  $profilefields=$DB_site->query("SELECT profilefieldid,required,title,size,maxlength
                                  FROM profilefield
                                  WHERE editable = 1
                                  AND profilefieldid IN (50,51,52,53,54,55,56,57)");

I updated the instructions for the vehicle profile addon.. Thanks for pointing it out.

ImportPassion 10-29-2003 04:01 PM

hmm....I am not getting the actual form fields output with your new addition. It shows the field names, but not the form fields.

brendonm 10-29-2003 08:58 PM

Nice, I have got the phpBB version working on two boards out there already. I have just installed this one on my Nissan Skyline related website which uses vBulletin. The install was very very simple, I will probably tweak it up later but for now is pretty standard.
Thanks EvilLS1 -*clicks install*

ImportPassion 10-29-2003 10:50 PM

when I made the separate page for the timeslips, i made HP required field, but when ppl tried to join, they got an error saying HP was a required field and there was no HP field being presented, which is what I want, but it should be coming up as not entered.

EvilLS1 10-29-2003 11:40 PM

7thgenCivic.Com,
I appologise. It looks like I posted the wrong contents for the "timeslips_customfields" template. I also left out a step and forgot to put a "); at the end of one of the queries. I was very tired when I wrote the instructions for the addon.. Thats my excuse. :p

Anyway, I updated the instructions once again for the vehicle profile page addon, and this time its right.

But to save you from having to look through the whole thing to find what I changed, I'll post it here:

Replace the entire contents of your "timeslips_customfields" template with this:
Code:

<tr>
        <td bgcolor="$bgcolor"><normalfont><b>$profilefield[title]:</b></normalfont><br>
        <smallfont>$profilefield[description]</smallfont></td>
        <td bgcolor="$bgcolor"><normalfont><input type="text" class="bginput" name="$profilefieldname" value="$bbuserinfo[$profilefieldname]" size="$profilefield[size]" maxlength="$profilefield[maxlength]"></normalfont></td>
</tr>

In your usercpnav template find:
Code:

        <td bgcolor="$cpnav[2]"><smallfont><b><a href="member.php?s=$session[sessionhash]&action=editprofile">Edit Profile</a></b></smallfont></td>
Below it add:
Code:

        <td bgcolor="$cpnav[2]"><smallfont><b><a href="member.php?s=$session[sessionhash]&action=edittimeslip">Edit Vehicle Profile</a></b></smallfont></td>
This will fix the problem you're having with the required HP field:

In register.php find:
Code:

  $profilefields=$DB_site->query("SELECT maxlength,profilefieldid,required,title
                                  FROM profilefield
                                  WHERE editable = 1
                                  ORDER BY displayorder");

Replace it with:
Code:

  $profilefields=$DB_site->query("SELECT maxlength,profilefieldid,required,title
                                  FROM profilefield
                                  WHERE editable = 1
                                  AND profilefieldid NOT IN (50,51,52,53,54,55,56,57)
                                  ORDER BY displayorder");

That should do it.

@ brendonm.. Thanks. :)

brendonm 10-29-2003 11:58 PM

Hiya,
I like SVTOA's approach - nice work dude :) In particular I like the sorting into time brackts.

Using the timeslip mod, how hard would it be to structure a search function to present only vehicles within a given bracket? e.g. 8sec, 9sec, 10sec and then include these searches into the sort box? (actually I think the search box inclusion may have been discussed, but not the time brackets).

If I take a look at the existing if/else statement, I can see a condition statement thing. Is this where I'd put in some sort of less than/greater than condition?

} else if ($action=="10SecondBracket") {
$cond.=" WHERE userfield.field55>'".intval($number)."'";
$condition.=" AND userfield.field55>'".intval($number)."'";
$orderby="userfield.field55";
$direction=ASC;
$bracket3="<b>[</b>";
$bracket4="<b>]</b>";

This would actually be a very nice enhancement for this mod in the instance that I am using it for aswell as might be a nice addition for others too. Even if someone can help me with the syntax for the first one I can write the rest (I don't expect everything to be done for me, I just don't know where to start with developing such a query). I am only interested in sorting by time bracket for 1/4 mile, not for 60 foot and 1/8 mile aswell. Any help or guidance in this matter would be much appreciated - if I manage to make anything useful I'll be sure to post it up here.

regards

BrendonM

EvilLS1 10-30-2003 12:23 AM

BrendonM,
Yes, you have the right idea.

You would just add some variables above "// Do sorting methods" something like this:

Code:

$a=11;
$b=10;
$number=0;
// Do sorting methods

And then add a new action with the $conditions like this:
Code:

} else if ($action=="TenSecCars") {
  $cond.=" WHERE userfield.field55<'".intval($a)."' AND userfield.field55>='".intval($b)."'";
  $condition.=" AND userfield.field55<'".intval($a)."' AND userfield.field55>='".intval($b)."'";
  $orderby="userfield.field55";
  $direction=ASC;

You get the idea. Good luck with it.

EvilLS1 10-30-2003 01:25 AM

BrendonM,
I'm adding this feature for you. Give me a few more minutes and I'll have it done.

brendonm 10-30-2003 01:29 AM

Hiya,

that is perfect, works very well thank you. I was'nt sure how to approach that syntactically now I can code as many brackets as I like. I have just asked my community for the brackets they want to sort by and will code them up tommorrow. If anyone wants the code let me know, although it is pretty easy.... ...now :)


All times are GMT. The time now is 04:15 PM.

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.01184 seconds
  • Memory Usage 1,758KB
  • 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
  • (8)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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