vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   Add-On Releases - CND Garage add-on: Show cars in postbit (https://vborg.vbsupport.ru/showthread.php?t=202523)

flup 01-20-2009 10:00 PM

CND Garage add-on: Show cars in postbit
 
This plugin is made for the CND Garage system (click) and will display the cars a user has in his garage. If there are no cars in the users garage, there wont be displayed anything :)

EDITS / UPLOADS / IMPORTS
- 1 plugin import
- 1/2 template edits

INSTALLATION GUIDE
First of all, import the plugin using: admincp -> Plugins & Products -> Download / Upload Plugins, the import form is on the bottom of the page.

After that, edit your postbit and/or postbit_legacy templates and find:
HTML Code:

<div>
$vbphrase[posts]: $post[posts]
</div>

Below it add:
HTML Code:

<if condition="$show[garage_cars]"><div><small><b><a href="garage.php?do=user_garage_view&id=$post[userid]">$post[musername]'s Garage</a></b>:<br />$post[garage_cars]</small></div></if>
RESULT
See the attached screenshot for the result, of course this one is customized to fit my forum style :)

VERSIONS
  • 1.00 - Vehicles order by date of adding to the CND Garage
  • 1.01 - Order of the vehicle list by putting the main vehicle on top followed by the other/previous vehicles

CUSTOM TEMPLATE EDIT GUIDE
If you have a custom style, you can use these codes in your postbit templates:

To display the link to a users garage:
HTML Code:

<a href="garage.php?do=user_garage_view&id=$post[userid]">$post[musername]'s Garage</a>
To display the users cars (+ links to the cnd garage car page):
HTML Code:

$post[garage_cars]
Both can be placed between the following tags, these check if there are any cars found for the users:
HTML Code:

<if condition="$show[garage_cars]">
and
HTML Code:

</if>

recklessop 01-23-2009 12:45 AM

This looks like EXACTLY what we have been waiting for

flup 01-23-2009 06:39 AM

Seems that it was already released under cnd itself (at their forums), however it looks a bit different as mine checks wether you actually have cars in your garage, if not - it won't display anything.

I'm not sure how their plugin works, but at least this was a good test for me to start getting used to the plugin system of vB :P

Haltech 01-23-2009 08:43 AM

I own the CND Garage but since half of my users are IE7 guys, they cant even use the garage, which is a shame. i added your plugin for the post bit anyhow, no issues. Thanks.

flup 01-23-2009 09:31 AM

How come? I haven't had any messages from users that it wouldn't work in IE7 .. http://www.clubpunto.nl/garage.php is the link to my garage.. guess I'm gonna check this out for myself anyhow, perhaps I can find a fix :)

I disabled a lot of features for now, but the things I can find in the first couple of pages is only a template error.
While viewing my own vehicle, it showed the 'Add as primary' button next to a photo instead of above, which kinda stretched my website to wide. Other than that, everything seems to go find (submit forms, image uploads, viewing vehicles/modifications).

Blackheart_72 02-26-2009 06:37 AM

Fantastic mod fella, works just as i want it to. :)

River_rush 03-14-2009 12:24 PM

Missing the table prefix from the xml code, it works if you edit the line after // Get Cars from database to read

Code:

$cars = $this->registry->db->query("SELECT uv.vehicle_id, model.model, make.make FROM " . TABLE_PREFIX . "garage_user_vehicle uv, " . TABLE_PREFIX . "garage_makes make, " . TABLE_PREFIX . "garage_models model WHERE uv.make_id = make.id AND uv.model_id = model.id AND uv.user_id = '".$post[userid]."' ORDER BY uv.main_vehicle DESC");
if($this->registry->db->num_rows($cars) > 0) {


Redzzand 03-16-2009 02:09 AM

Quote:

Originally Posted by River_rush (Post 1767833)
Missing the table prefix from the xml code, it works if you edit the line after // Get Cars from database to read

Code:

$cars = $this->registry->db->query("SELECT uv.vehicle_id, model.model, make.make FROM " . TABLE_PREFIX . "garage_user_vehicle uv, " . TABLE_PREFIX . "garage_makes make, " . TABLE_PREFIX . "garage_models model WHERE uv.make_id = make.id AND uv.model_id = model.id AND uv.user_id = '".$post[userid]."' ORDER BY uv.main_vehicle DESC");
if($this->registry->db->num_rows($cars) > 0) {


where can this be found? what file?

Edit: Found it under Plugins & Products >> Plugin Manager >> Edit "Show CND Cars in Postbit" >> Plugin PHP Code

Edit 2: Thanks a million for this code! With this code, it works on 3.8.1 PL1!!!

ArchangelX 03-18-2009 04:08 AM

Thanks a bunch! Works even on 3.5!

externalaw.com 03-21-2009 01:59 AM

we found an IE fix, this product is not working if you use Cyb New Posts hack


All times are GMT. The time now is 12:02 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.01619 seconds
  • Memory Usage 1,738KB
  • 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
  • (2)bbcode_code_printable
  • (6)bbcode_html_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (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