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)

EvilLS1 10-20-2003 10:00 PM

vB Timeslip Database -for Automotive websites
 
I doubt this will be used by many people since its designed specifically for automotive websites.. But it has been requested here several times, so here ya go.

What does it do? This hack does a few things. First, it will add a separate Vehicle Profile page to your forum where your users can enter their type of vehicle, horsepower, best 60' time, 1/8 mile time, 1/4 mile time, a link to their timeslip and more. Once the data is entered the timeslips.php page will display the info sorted by the best times, highest trap speeds, highest horsepower #s, proof of ET, or ET brackets (user selectable).

You can also ban users from editing their Vehicle Profile. This comes in handy if you have some users who insist on entering false data into the Timeslip Database just to be funny. To use this feature, just click on the user's profile, then click "user options" and set "Can edit vehicle profile" to no. The user will still be able to edit his regular profile, but not his vehicle profile.


Demo: http://modernmusclecars.net/forums/timeslips.php

(Note: I just added this to my board a couple of days ago so there's only a few entries right now.. It does have pagination and will display 25 per page by default once more ETs are entered.)

Screenshot1: Vehcile Profile page
Screenshot2: Edit Vehcile Profile page


Features include:
*The ability to sort by:
-1/4 Mile ET
-1/4 Mile MPH
-1/8 Mile ET
-1/8 Mile MPH
-60' Time
-Horsepower
-Cars with proof of ET (actual timeslip)
-Username
-ET brackets (New!)
*Show the average ET, MPH, and HP for your site. (New!)
*Vehcile Profile (separate from user profile) (New!)
*Ability to ban users from editing their vehicle profile (New!)
*Installer


Installation is easy:
1. Upload TDinstaller.php to your admin directory & run the installer.
2. Follow the hack instructions to edit the 4 php files.
3. Edit two templates.
4. Add five new templates.
5. Upload timeslips.php to your forum directory and slipicon.gif to your image directory.

This has been tested on 2.2.8 - 2.3.2 and should work fine with any 2.X.X version.

Note: I don't use vb 2.X anymore so this hack is no longer supported

Download vB Timeslip Database v1.3

(Version 2.0 is availible for VB3 users here.)

Add-ons:
*Add-on: Display the Top Five 1/4 mile ETs on your front page portal
*Add-on: Require a link to the actual timeslip for all ETs that are 11.99 or quicker.
*Add-on: A "timeslips" button for your header (PSD and GIF). -by Optima
*Add-on: Show the ET club that users belong to in the postbit.
*How to: Add a "select" field & sort by it in the timeslip database.
*How to: Change the default sort method



Updated 10-29-03 to add new features: - Added the ability to sort by ET brackets. (ie. show 10 second cars only. 11 second cars only, 13 sec cars, etc). Requested by BrendonM
Check the demo page to see it in action.

Updated 10-31-03 (new feature): -Added a new action that will show the average ET, trap speed, and horsepower for your site.
Go to the demo page and select "Site Averages" from the drop down menu to see what I mean.

Updated 11-10-03: -Added the vehicle profile addon to the hack instructions. Added a few new fields to the vehicle profile page (race weight, track, D/A, mods, tranny type, etc). Added a "details" column to the Timeslip Database page which lets you view all vehicle profile fields when the details link is clicked (see demo).

Instructions for upgrading all previous versions to v1.3.

If you find this script useful please click install. :)

corsacrazy 10-21-2003 09:28 PM

im the 1st to congratulate you and install NICE ONE

corsacrazy 10-21-2003 09:44 PM

i have made these fields required to suit the design of my modify profile page BUT how can i hide these profile fields on register?

drumsy 10-21-2003 09:56 PM

Looks good. I plan on using it in the future. In the meantime, how do I remove the installation?

EvilLS1 10-21-2003 10:01 PM

corsacrazy,
You would have to exclude those fields from $customfields in register.php. I'll check it out for you later.

drumsy,
In your admin panel go to modify profile fields & remove them.

corsacrazy 10-21-2003 10:40 PM

Quote:

Originally Posted by EvilLS1
corsacrazy,
You would have to exclude those fields from $customfields in register.php. I'll check it out for you later.


thanks for being helpfullm where abouts and how wouldi exlude the fields

i like the way u managed to make these fiels id's like 50 + ;) clever

EvilLS1 10-21-2003 11:23 PM

Corsa,

In register.php find:
Code:

  // get extra profile fields
  $profilefields=$DB_site->query("SELECT *
                                  FROM profilefield
                                  WHERE editable = 1
                                  ORDER BY displayorder");

Replace it with:
Code:

  // get extra profile fields
  $profilefields=$DB_site->query("SELECT *
                                  FROM profilefield
                                  WHERE editable = 1
                                  AND profilefieldid NOT IN (50,51,52,53,54,55,56,57)
                                  ORDER BY displayorder");

That should do it.

corsacrazy 10-21-2003 11:31 PM

i got it werking now

MindTrix 10-22-2003 03:44 PM

Nice work here sure it would benifit alot of people, unfortunatly not me but hey, seems a nice idea to me. Well done

corsacrazy 10-22-2003 03:47 PM

how to chnage it so that a user doesnt have to fill in EVERY field for it to appear on timeslips.php ?

EvilLS1 10-22-2003 03:57 PM

Quote:

Originally Posted by corsacrazy
how to chnage it so that a user doesnt have to fill in EVERY field for it to appear on timeslips.php ?

They don't have to fill in every field for it to appear.. The default sort method is by 1/4 mile ET, so it will only show users who have entered something into the 1/4 mile ET field.. But if someone only posts an 1/8 mile ET, it will show them if you select "sort by 1/8 mile ET" from the drop down menu. Same with horsepower, mph, and 60' times. The username method sorts by username AND 1/4 mile ET. So if the 1/4 mile ET field is left blank, they won't show up. You can change the default sort method to something else, if thats what you mean.

Josh Combs 10-22-2003 06:54 PM

Has anyone installed it on 2.3.2??? Thanks

corsacrazy 10-22-2003 07:22 PM

Quote:

Originally Posted by EvilLS1
The default sort method is by 1/4 mile ET,



You can change the default sort method to something else


ok how can i change the default to 60 foot times ? cheers

drumsy 10-22-2003 09:44 PM

Quote:

Originally Posted by liquid ninja
Has anyone installed it on 2.3.2??? Thanks

I installed it and it works fine for me! :)

EvilLS1 10-22-2003 11:13 PM

Quote:

Originally Posted by corsacrazy
ok how can i change the default to 60 foot times ? cheers

In timeslips.php find:
Code:

// If no action is set order by quarter
if (!isset($action) or $action=="") {
  $action="quarter";
}

Replace it with:
Code:

// If no action is set order by sixty
if (!isset($action) or $action=="") {
  $action="sixty";
}

Find:
Code:

} else {
  $cond.=" WHERE userfield.field55>'".intval($number)."'";
  $condition.=" AND userfield.field55>'".intval($number)."'";
  $orderby="userfield.field55";
  $direction=ASC;
}

Replace it with:
Code:

} else {
  $cond.=" WHERE userfield.field52>'".intval($number)."'";
  $condition.=" AND userfield.field52>'".intval($number)."'";
  $orderby="userfield.field52";
  $direction=ASC;
}


Josh Combs 10-23-2003 12:43 AM

I have it running on my forums also now :) thanks for the great hack.

Josh
http://www.gmperformancetuning.com

EvilLS1 10-23-2003 03:31 AM

y/w Josh. Glad you like it. :)

corsacrazy 10-23-2003 06:20 AM

perfect :) i see good things in the future for this one and car sites :)

SVTBlackLight01 10-23-2003 07:34 AM

Great Hack!! :up:

This has been out for phpBB for a while. I was waiting on someone to make one for VB.

Good Job!

EvilLS1 10-23-2003 11:13 AM

Thanks.

Quote:

Originally Posted by SVTBlackLight01

This has been out for phpBB for a while. I was waiting on someone to make one for VB.

Do you mean this one?
http://phpbbhacks.com/viewhack.php?id=546

Thats my hack also. I made it about a year and a half ago when I was using phpBB. :)

Dewayne

VampireMan 10-23-2003 11:18 AM

I gotta thank you for this , my site is totaly not to do with cars. But wedding forums. Im adapting the timeslips database for my needs.

It's easy to understand the code , and so it's easy for me to adapt. Im allready 50% along the way of changing the feilds over all ready. Good code is easy to edit. And the code in this is very good , thanks. :)

EvilLS1 10-23-2003 03:00 PM

You're welcome. Good luck w/ converting it to suit your needs. :)

corsacrazy 10-23-2003 04:04 PM

is it possible to produce addons for homepages ? ie top 5 cars sorted by XXX ?

gmarik 10-23-2003 04:17 PM

A good hack, could add more features in the future!

VampireMan 10-23-2003 07:53 PM

Done the conversion , must say i really enjoyed doing this.
Going to add more as i go , but thanks for the base :)

Pic included of finished conversion

Chris

SVTBlackLight01 10-24-2003 12:26 PM

Quote:

Originally Posted by EvilLS1
Thanks.



Do you mean this one?
http://phpbbhacks.com/viewhack.php?id=546

Thats my hack also. I made it about a year and a half ago when I was using phpBB. :)

Dewayne

Yep. Same one!

SpeedStreet 10-24-2003 01:34 PM

Very nice....someone from the car communities actually sharing their hacks for once :)

Nice job!

ImportPassion 10-24-2003 02:33 PM

Looks cool. Installing now.

One thing I noticed is that you hardcoded id's in there

PHP Code:

$DB_site->query("INSERT INTO profilefield (profilefieldid,title,description,required,hidden,maxlength,size,displayorder,editable) VALUES (50,'".addslashes($aa)."','".addslashes($a)."',0,0,'20','20','50', '1')"); 

You might want to consider this instead

PHP Code:

$DB_site->query("INSERT INTO profilefield (title,description,required,hidden,maxlength,size,displayorder,editable) VALUES ('".addslashes($aa)."','".addslashes($a)."',0,0,'20','20','50', '1')");
 
$newid mysql_insert_id();
$DB_site->query("ALTER TABLE userfield ADD field".$newid." CHAR(250) NOT NULL"); 

You may mess up some users installs if they have those id's already.

Thanks for the hack.

Derek

EvilLS1 10-24-2003 06:44 PM

corsacrazy ,
Yes, I can make an add-on for portals that will show the top 5 quickest cars. I'll make it as soon as I get some free time (maybe this weekend) and post it here.

VampireMan,
Looks very good. Nice job converting it!

7thgenCivic.Com,
The new fields are hardcoded because they must correspond with the specified fields in timeslips.php. However, I set the ID numbers for the new fields very high (@ 50+) so this shouldn't be a problem for anyone. And even if they already had that many custom fields (highly doubtful) it would simply give an error saying that those fields already exist.

Anyway, thanks everyone for the compliments.. Nice to see some of you found it useful.

Dewayne

EvilLS1 10-24-2003 11:13 PM

Portal add-on: Top Five 1/4 mile ETs

Attached is instructions and a screenshot for the top five 1/4 mile ETs add on for your front page portal.

If you want to show or sort by other fields just change the userfield IDs accordingly.

glo 10-25-2003 12:57 AM

Hey EvilLS1, good work!

"Clicks Install"

Do you know how i can add an extra field for a drop down menu for "Vehicle Make"

EvilLS1 10-25-2003 01:29 AM

Thanks glo.

Yes its easy to add an extra field for a drop down menu. I have one myself.

If you haven't already done so, install this hack (adds ability to make drop down menus in custom profile fields). Look in the last couple of pages of that thread to find updated instructions for later versions of vbulletin.

Anyway, once you've added that hack, go into your admin panel and add the new profile field w/ drop down menu.

Then hold your mouse over the "edit" link for the new field and make a note of the field ID # (at the end of the URL).

Then open timeslips.php and find:
Code:

} else if ($action=="username") {
  $cond.=" WHERE userfield.field55>'".intval($number)."'";
  $condition.=" AND userfield.field55>'".intval($number)."'";
  $orderby="user.username";
  $direction=ASC;

Below it add:
Code:

} else if ($action=="make") {
  $cond.=" WHERE userfield.field55>'".intval($number)."'";
  $condition.=" AND userfield.field55>'".intval($number)."'";
  $orderby="userfield.fieldXX";
  $direction=ASC;

In the code above, replace the red Xs with the ID# of the new field you added.

Still in timeslips.php find:
Code:

$ride= $userinfo[field50];
Below it add:
Code:

$make= $userinfo[fieldXX];
Again, replace the red Xs with the ID# of the new field you added.

Now in your "timeslips" template find:
Code:

<option value="$bburl/timeslips.php?s=$session[sessionhash]&action=username">Username</option>
Below it add:
Code:

<option value="$bburl/timeslips.php?s=$session[sessionhash]&action=make">Vehicle Make</option>
Find:
Code:

        <td bgcolor="{categorybackcolor}" colspan="8"><normalfont color="{categoryfontcolor}"><CENTER><b> Timeslip Database</b></CENTER></normalfont></td>
Replace it with:
Code:

        <td bgcolor="{categorybackcolor}" colspan="9"><normalfont color="{categoryfontcolor}"><CENTER><b> Timeslip Database</b></CENTER></normalfont></td>
Find:
Code:

<td bgcolor="{tableheadbgcolor}" align="center"><smallfont color="{tableheadtextcolor}"><b>Username</b></smallfont></td>
Below it add:
Code:

<td bgcolor="{tableheadbgcolor}" align="center"><smallfont color="{tableheadtextcolor}"><b>Vehicle Make</b></smallfont></td>
Find:
Code:

<td bgcolor="{categorybackcolor}" colspan="8">
Replace it with:
Code:

<td bgcolor="{categorybackcolor}" colspan="9">

In your "timeslipsbit" template find:
Code:

<td bgcolor="{secondaltcolor}"><normalfont><a href="member.php?s=$session[sessionhash]&action=getinfo&userid=$userinfo[userid]">$username</a></normalfont></td>
Below it add:
Code:

<td bgcolor="{firstaltcolor}">$make</td>
That will add the extra vehicle make info to the timeslips page and allow you to sort by it (alphabetically). You can experiment with the code a little and make it sort differently or whatever you want.

Dewayne

corsacrazy 10-25-2003 03:29 PM

im good at ideas and you are a great hacker, thank you my friend :)

EvilLS1 10-25-2003 04:26 PM

Thanks corsa. That was a nice idea. :)


BTW, I made a small addition to the hack. Now the timeslips page will put brackets around the catagory that is currently being sorted by.
Example (sorting by 1/4):
Username - Ride - RWHP - 60' - 1/8 mile ET - [1/4 Mile ET] - Slip

I updated the zip in the first post.. To upgrade just replace your timeslips template with the new one, then upload the new timeslips.php.

NickCat 10-25-2003 05:02 PM

*clicks install*

Thanks EvilLS1... Great Hack.

I just installed it on my board this morning. I had to make a few small modifications though. I changed RWHP to WHP (Subaru website... AWD cars) and I already had car info in the user profiles to I pulled that info instead or the new 'Ride' field.

Teriffic hack though, I hope my members like using it.

The only request I might make would be if it were possible to allow the timeslips to be uploaded like an attachment. Since you know users tend to change image hosts all the time, and or delete stuff.

-Nick
http://www.nasioc.com/

MaxScript 10-25-2003 05:09 PM

***vb3***? :)

EvilLS1 10-25-2003 09:47 PM

NickCat,
Thanks. :) And sorry about the RWHP thing.. I just copied the template from my own site (about 99% of my members have rwd cars).

Anyway, I will probably add the upload feature to v2.0. But for now, you could do what I do.. Next to the timeslip link field I posted a link to a thread in my drag racing forum that says "upload your images here". They can upload the images in that thread and then just put a link to the attachment in the field.

MaxScript,
I'll probably update this hack and a couple of others for VB3 once it goes final. Should be fairly easy to do.

MaxScript 10-25-2003 09:48 PM

Quote:

Originally Posted by EvilLS1
NickCat,
Thanks. :) And sorry about the RWHP thing.. I just copied the template from my own site (about 99% of my members have rwd cars).

Anyway, I will probably add the upload feature to v2.0. But for now, you could do what I do.. Next to the timeslip link field I posted a link to a thread in my drag racing forum that says "upload your images here". They can upload the images in that thread and then just put a link to the attachment in the field.

MaxScript,
I'll probably update this hack and a couple of others for VB3 once it goes final. Should be fairly easy to do.


great thanks

NickCat 10-25-2003 11:04 PM

Quote:

Originally Posted by EvilLS1
NickCat,
Thanks. :) And sorry about the RWHP thing.. I just copied the template from my own site (about 99% of my members have rwd cars).

Anyway, I will probably add the upload feature to v2.0. But for now, you could do what I do.. Next to the timeslip link field I posted a link to a thread in my drag racing forum that says "upload your images here". They can upload the images in that thread and then just put a link to the attachment in the field.

Thanks for the update. I added a few more tweaks of my own today. I used the custom dropdown to add a list of tracks and type of induction. My users were concerned about elevation effects on the 1/4 times in the registry so I figure as an alternative to trying to add elevation, temp, and humidity (which most users would leave blank anyway) I just added the track name field with a drop down of the most popular tracks.

And good idea on the image attachment thread.

I'll anxiously be awaiting the release of V2.0 with the built in attachment upload! ;)

-Nick
http://www.nasioc.com/

EvilLS1 10-26-2003 06:58 PM

NOTE: This comes standard with version 1.3!

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.

Instructions and screenshot attached:


All times are GMT. The time now is 04:49 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.01674 seconds
  • Memory Usage 1,865KB
  • 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
  • (20)bbcode_code_printable
  • (2)bbcode_php_printable
  • (9)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
  • (40)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