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)

Mobo 02-02-2004 12:55 PM

Great Hack!! Just installed it with the ET&Trap in the postbit with no probs at all!! Well done.

I do have one question. Would it be possible to make it were only users or a certain User group should show up on the main list (timeslip.php)? My site has normal users and paid members, and I'd like for this to be an extra feature that the paid members have.

Thanks for the great Hack!

Mobo 02-02-2004 05:23 PM

Okay, I ran into a problem. When I tried to put a link to the timeslip.php file on my forum, ithe page is not found. I added a button int the Head section (forum styles). This what I added...

<a href="timeslips.php?s=$session[sessionhash]"><img src="{imagesfolder}/top_carinfo.gif" alt="Timeslips, Mods and HP!!" border="0"></a>

EvilLS1 02-02-2004 09:18 PM

Quote:

Originally Posted by Mobo
Great Hack!! Just installed it with the ET&Trap in the postbit with no probs at all!! Well done.

I do have one question. Would it be possible to make it were only users or a certain User group should show up on the main list (timeslip.php)? My site has normal users and paid members, and I'd like for this to be an extra feature that the paid members have.

Thanks for the great Hack!

Just change the queries in timeslips.php so that it only selects from your specified usergroup like this:

Find:
Code:

// Get total number of users
  $userscount=$DB_site->query_first("SELECT COUNT(*) AS users
                                    FROM user,userfield
                                    $cond
                                    AND user.userid = userfield.userid");

Replace it with:
Code:

// Get total number of users
  $userscount=$DB_site->query_first("SELECT COUNT(*) AS users
                                    FROM user,userfield
                                    $cond
                                    AND user.userid = userfield.userid AND user.usergroupid = X");

Change the X to the usergroupid in this bit of code: user.usergroupid = X

Then find:
Code:

// Get users
$users=$DB_site->query("SELECT *
                          FROM user,userfield
                          WHERE user.userid = userfield.userid
                          $condition 
                          ORDER BY $orderby $direction
                          LIMIT $pos,$perpage");

Replace it with:
Code:

// Get users
$users=$DB_site->query("SELECT *
                          FROM user,userfield
                          WHERE user.userid = userfield.userid
                          AND user.usergroupid = X
                          $condition 
                          ORDER BY $orderby $direction
                          LIMIT $pos,$perpage");

Again, change the X in the code above to the usergroupid.

Quote:

Okay, I ran into a problem. When I tried to put a link to the timeslip.php file on my forum, ithe page is not found. I added a button int the Head section (forum styles). This what I added...

<a href="timeslips.php?s=$session[sessionhash]"><img src="{imagesfolder}/top_carinfo.gif" alt="Timeslips, Mods and HP!!" border="0"></a>
Is this in your forum directory? Try adding $bburl/ before timeslips.php. If that doesn't work just add the full url. If you can go to the page manually its gotta be just a typo in the URL or timeslips.php isn't in that directory.

Mobo 02-03-2004 10:58 AM

Quote:

Originally Posted by EvilLS1
Just change the queries in timeslips.php so that it only selects from your specified usergroup like this:

Find:
Code:

// Get total number of users
  $userscount=$DB_site->query_first("SELECT COUNT(*) AS users
                                    FROM user,userfield
                                    $cond
                                    AND user.userid = userfield.userid");

Replace it with:
Code:

// Get total number of users
  $userscount=$DB_site->query_first("SELECT COUNT(*) AS users
                                    FROM user,userfield
                                    $cond
                                    AND user.userid = userfield.userid AND user.usergroupid = X");

Change the X to the usergroupid in this bit of code: user.usergroupid = X

Then find:
Code:

// Get users
$users=$DB_site->query("SELECT *
                          FROM user,userfield
                          WHERE user.userid = userfield.userid
                          $condition 
                          ORDER BY $orderby $direction
                          LIMIT $pos,$perpage");

Replace it with:
Code:

// Get users
$users=$DB_site->query("SELECT *
                          FROM user,userfield
                          WHERE user.userid = userfield.userid
                          AND user.usergroupid = X
                          $condition 
                          ORDER BY $orderby $direction
                          LIMIT $pos,$perpage");

Again, change the X in the code above to the usergroupid.


Is this in your forum directory? Try adding $bburl/ before timeslips.php. If that doesn't work just add the full url. If you can go to the page manually its gotta be just a typo in the URL or timeslips.php isn't in that directory.

EvilLS1 great support for a great hack. Thanks for the quick replies and help. I'll give them a shot.

Mobo 02-03-2004 12:31 PM

Adding $bburl/ in front of it made it work thanks! Also, the paid members only thing worked as well. Is it possible to add more then one usergroupid to it? So that say paid members and club officers could have their stats show up? Or can you assign a user to more then on usergroup?

EvilLS1 02-03-2004 02:26 PM

n/p.
Quote:

Is it possible to add more then one usergroupid to it?
Yes, just use this instead of the other code:
Code:

AND user.usergroupid IN (X,X,X)
Replace the X's with the usergroupids. You can add as many as you'd like.. Just separate each one with a comma.

Mobo 02-03-2004 04:45 PM

Cool, thanks a million!

EvilLS1 02-03-2004 07:36 PM

Anytime. :)

Tungsten 02-14-2004 03:00 PM

This is an excellent add-on, EvilLS1. Check your PM, I'd like to slide a little something into your PayPal account for sharing this with everyone. We've been trying unsuccessfully to code a timeslip db for our site for a while now and you just took a major load off of our non-programming asses. :D

EvilLS1 02-14-2004 08:03 PM

Tungsten,
I'm glad you like it. And thank you very much for offering a donation, but thats not necessary. A simple "thanks" is enough payment for me. :) I use alot of hacks that others have released here, so sharing my own hacks is my way of saying thanks to the vb.org community. Plus, I'm always happy to help out a fellow car enthusiast.

Enjoy the hack, my friend. :)


All times are GMT. The time now is 09:35 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.03523 seconds
  • Memory Usage 1,760KB
  • 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
  • (9)bbcode_code_printable
  • (4)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