vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Sort by: Option for VbGarage (https://vborg.vbsupport.ru/showthread.php?t=66088)

BamaStangGuy 06-12-2004 01:45 AM

Sort by: Option for VbGarage
 
I am wanting to let my users sort through the cars by Car Year, Car Model, Username, and a few other options

Right now it sorts by username only and users have no other way to find a car.

I'm not looking for the code handed to me I am just looking for th ebest place to start.

PHP Code:

// ############################################################################
// ############################# LIST ALL GARAGES #############################
// ############################################################################

if ($_REQUEST['do'] == 'list')
{
    
globalize($_REQUEST, array('pagenumber' => INT'perpage' => INT));
    
    
$perpage intval($perpage);

    if (
$perpage == or $perpage 200
    {
        
$perpage 25;
    }

    if (
intval($pagenumber) == 0
    {
        
$pagenumber 1;
    }

    
$limitlower = ($pagenumber 1) * $perpage 1;
    
$limitupper = ($pagenumber) * $perpage;
    
$counter 0;

    
$garagecount $DB_site->query_first("
        SELECT COUNT(*) AS garages FROM " 
TABLE_PREFIX "vbgarage_users
    "
);

    
$numberpages $garagecount['garages'] / $perpage;
    
$numberpages ceil($numberpages);    
    
    if (!isset(
$pagenumber) or ($pagenumber 1) or ($pagenumber $numberpages))
    
$pagenumber 1;

    
$pos = ($pagenumber 1) * $perpage;

    
$result_list $DB_site->query("
        SELECT * FROM " 
TABLE_PREFIX "vbgarage_users ORDER BY userid ASC LIMIT $pos,$perpage
    "
);
    
    
$counter 0;
    
$count 0;

    while (
$list $DB_site->fetch_Array($result_list) AND $counter++ < $perpage)
    {
        
$count++;
        
$list['lastactivity'] = vbdate($vboptions['dateformat'],$list['lastactivity'],true);

        
$user fetch_userinfo($list[userid]);

        eval(
'$listbits .= "' fetch_template('vbgarage_listbits') . '";');
    }
    
    
$result_latest $DB_site->query("
        SELECT * FROM " 
TABLE_PREFIX "vbgarage_images ORDER BY vbgarageid DESC LIMIT 5
    "
);
    
    while (
$latest $DB_site->fetch_Array($result_latest))
    {
        eval(
'$latestbits .= "' fetch_template('vbgarage_latestbits') . '";');
    }

    
$pagenav construct_page_nav($garagecount[garages],"vbgarage.php?$session[sessionurl]do=$_REQUEST[do]&perpage=$perpage");

    
$navbits construct_navbits(array('' => 'vBGarage'));
    eval(
'$navbar = "' fetch_template('navbar') . '";');
    
    eval(
'print_output("' fetch_template('vbgarage_listgarage') . '");');


Thats a whole lot of code for me to digest at once. I'm not to familiar with PHP just learning it.

I would a start to rearrange that to allow users to sort by their choice?

Thats

BamaStangGuy 06-12-2004 02:02 AM

Also how does vbgarage handle attachments? I cant find anything in vbgarage and it requires three files. What file and what part does it use to control attachments.

cinq 06-15-2004 03:34 AM

It doesn't control attachments.
Uploaded images are stored as blobs in the database.


All times are GMT. The time now is 10:00 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.01093 seconds
  • Memory Usage 1,743KB
  • 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
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete