vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Major Additions - vbRides ? Garage (https://vborg.vbsupport.ru/showthread.php?t=313438)

Dragonsys 10-02-2015 03:56 AM

1 Attachment(s)
I noticed a couple of bugs:

1: When deleting Extra Fields, the data is not removed from the DB, this causes for a strange display on the ride page.
2: If images fail to upload, due to size (might happen if deleted after upload as well), they are still counted towards the # of photos, even though they do not exist on the system.

I also made a couple of tweaks, and I can share them with the author if he is interested in them:

A: Display location from User Profile, instead of per ride
B: Timeslips display (still working on add/edit) - Best 1/8 & 1/4 mile displayed on ride profile.

A: Changing the location display is rather easy
edit vbrides_view_ride (template)
Find:
HTML Code:

<dd>{vb:raw location}</dd>
Replace With:
HTML Code:

<dd>{vb:raw userinfo.field2}</dd>
If location is not Custom User Profile Field #2, then adjust to the correct #.

B: Timeslips
I have this working with List, Profile Tab, Best Slips on vbRides page, Add/Edit/List Tracks and Add/Edit Slips. I can release this to anyone who wants it, but it does require making some edits to vbRides core files & templates (I will fix this later). I am still working on Delete Slips, Delete Tracks and a few tweaks, so be aware, if you ask for this, it is in beta, and if Action-N asks me to, I will remove it. Once I get it in better shape, I might release it as an add-on for vbRides, separately. You can see a demo at my site linked below (this is a dev site, and so might not work from time to time). EDIT: This is pretty much working without requiring edits to the core rides files; however, my custom display for view_rides (mod list, partsbin & wishlist) does require edits to vbrides.php, functions_vbrides.php & vbrides_view_ride template.

I would love to give this to Action-N so he can add it to his scripts if he wants.

Issue #1 Fix:
Open admincp/vbrides_admin.php
Find:
PHP Code:

    $db->query_write("DELETE FROM ".TABLE_PREFIX."vbrides_fields WHERE id=$itemfieldid"); 

Replace with:
PHP Code:

    $db->query_write("DELETE FROM ".TABLE_PREFIX."vbrides_fields WHERE id=".$itemfieldid."");
    
$db->query_write("DELETE FROM ".TABLE_PREFIX."vbrides_values WHERE fieldid=".$itemfieldid.""); 

Issue #2 Fix:
create file - includes/cron/vbrides_photos.php:
PHP Code:

<?php
/*======================================================================*\
|| #################################################################### ||
|| # vBulletin vbRide 1.0.0                                           # ||
|| # ---------------------------------------------------------------- # ||
|| # Copyright ?2013-2014 vbRide Action-Network All Rights Reserved.  # ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # ---------------- VBULLETIN IS NOT FREE SOFTWARE ---------------- # ||
|| # http://www.vbulletin.com | http://www.vbulletin.com/license.html # ||
|| #################################################################### ||
\*======================================================================*/

// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
if (!
is_object($vbulletin->db))
{
    exit;
}

// ########################################################################
// ######################### START MAIN SCRIPT ############################
// ########################################################################

    
$get_rides $vbulletin->db->query_read("SELECT id FROM ".TABLE_PREFIX."vbrides_rides ORDER BY id ASC");
    while (
$row $vbulletin->db->fetch_array($get_rides)) {
        
$query_logo $vbulletin->db->query_read("SELECT logo FROM ".TABLE_PREFIX."vbrides_rides WHERE id=".$row['id']."");
            
$num_rows_logo $vbulletin->db->num_rows($query_logo); 
        
$query_photos $vbulletin->db->query_read("SELECT id FROM ".TABLE_PREFIX."vbrides_photos WHERE rideid=".$row['id']."");
            
$num_rows_photos $vbulletin->db->num_rows($query_photos);
        
$total_pics $num_rows_logo $num_rows_photos;
        
$vbulletin->db->query_write("UPDATE ".TABLE_PREFIX."vbrides_rides SET photos=".$total_pics." WHERE id=".$row['id']."");
    }
    
    
$vbulletin->db->free_result($get_rides);

log_cron_action(''$nextitem1);

?>

Add Schedule Task:
admincp -> Scheduled Tasks -> Add New Scheduled Task:
(See attached image for Task Example)
once per day should be enough

http://forums.txracers.com/vbrides.p...wride&rideid=1

Dragonsys 11-04-2015 05:25 PM

@RSprinkle: to remove the photo types do the following.

Open: vbrides_usercp.php

Find (twice; lines #189 & #308):
PHP Code:

                <select size="1" name="phototype['.$p.']" style="width:90px;">
                    <
option value="0" />'.$vbphrase['vbrides_select'].'</option>
                    
' . $html_types . '
                
</select></div

Replace With:
PHP Code:

                <!-- <select size="1" name="phototype['.$p.']" style="width:90px;">
                    <
option value="0" />'.$vbphrase['vbrides_select'].'</option>
                    
' . $html_types . '
                
</select> --></div


Edit Template: vbrides_edit_photo
Replace All With:
HTML Code:

<div class="blockrow">
        <label for="photo{vb:raw photo_id}">
        <img border="0" src="{vb:raw photo_photopath}" />
    </label>
        <div class="rightcol">
        <input type="text" name="editphototitle[{vb:raw photo_id}]" value="{vb:raw photo_title}" style="width:80%;" />
        <!-- <select size="1" name="editphototype[{vb:raw photo_id}]" style="width:90px;">
            <option value="0" />{vb:var vbphrase.vbrides_select}</option>
            {vb:raw html_types}
        </select> -->

        <br /><br />
                <input type="checkbox" name="delete[{vb:raw photo_id}]" value="{vb:raw photo_id}" />  {vb:var vbphrase.vbrides_remove_photo}
                <input type="hidden" name="editphotoname[{vb:raw photo_id}]" value="{vb:raw photo_photoname}" />
        </div>
</div>


Dragonsys 12-11-2015 09:19 PM

I found another issue. Approve Rides does not work properly, though Reject does. When trying to approve a ride I get the following message:

Quote:

You're trying to add a new ride, or to activate an old one, but this is not permitted from your usergroup's settings.
This only seems to occur if the total number of rides, in the entire system, exceeds the Maximum number allowed for the person owning the ride being approved.

For example, my user is allowed 2 active rides max. He submits his ride, at this point he has 1 ride in the system, and I have 2, making a total of 3 rides. I cannot approve his ride, unless I delete one of mine first (therefore making the total be 2). If I allow him to have 3 rides, then I can freely approve his ride, as 3 is the total in the system; however, I would not be able to approve a 2nd ride for him.

I will try and get the fix this weekend.

Dragonsys 12-16-2015 06:44 PM

Ok, fix for the above:

Open: {forumroot}/vbrides_modcp.php
Find:
PHP Code:

        // And now let's count user's rides excluding hiddens
        
$active_rides $db->query_read("SELECT * FROM ".TABLE_PREFIX."vbrides_rides WHERE userid=$checkuserid AND status=1"); 

Replace With:
PHP Code:

        // And now let's count user's rides excluding hiddens
        
$active_rides $db->query_read("SELECT * FROM ".TABLE_PREFIX."vbrides_rides WHERE userid=$checkuserid AND active=1"); 


Dragonsys 12-25-2015 01:28 AM

I'm almost ready to release a Timeslips & Tracks Listing addon for this, I just have a few final changes to make before it will be ready for others to use. This does require vBrides & my Font Awesome addon to work properly

I wanted to get feed back on what things you would like to see, currently the following is tracked:
Timeslips:
  • Date & Time
  • Vehicle (linked to vBrides)
  • Driver
  • Track
  • Lane
  • Temp
  • DA
  • Dial-In
  • R/T
  • 60'
  • 330'
  • 1/8 ET & MPH
  • 1000'
  • 1/4 ET & MPH
  • Win/Lose
  • Notes

Tracks:
  • Name
  • Website & Facebook
  • Address
  • Coordiantes (with link to Google Maps)
  • Elevation
  • Type & Size (currently Drag only)
  • Notes

Timeslips are listed on User's profile
Best 1/8 & 1/4 Timeslip are listed on Vehicle profile (vBrides page)

RobAC 01-06-2016 06:56 PM

I tried installing this mod on vbulletin 4.2.3, but when importing the XML file I get the following message:

Invalid value '' for 'widgettypeid'

Dragonsys 01-06-2016 07:02 PM

Quote:

Originally Posted by RobAC (Post 2562142)
I tried installing this mod on vbulletin 4.2.3, but when importing the XML file I get the following message:

Invalid value '' for 'widgettypeid'

Do you have the full CMS?

RobAC 01-06-2016 07:14 PM

No. I don't use the CMS or blog parts of vBulletin.

Dragonsys 01-06-2016 07:18 PM

Quote:

Originally Posted by RobAC (Post 2562147)
No. I don't use the CMS or blog parts of vBulletin.

ok, but do you have them? If the CMS is not installed you should not get that error, as the cms_widget table should not exist. try this, edit the product-vbrides.xml and delete the below (lines 276-342)

PHP Code:

$wg $db->query_first("SELECT widgetid FROM " TABLE_PREFIX "cms_widget where product = '" $info['productid'] . "'");

if (!
$db->errno())
{
    echo(
'<li>Adding widget <strong>Member Rides</strong> ... ');
    if (
$wg['widgetid'])
    {       
         
$widgetid $wg['widgetid'];
        require_once(
DIR '/includes/adminfunctions_cms.php');
        require_once(
DIR '/packages/vbcms/dm/widget.php');
           
$widgets = new vBCms_Collection_Widget($widgetid);
        if (isset(
$widgets[$widgetid]))
        {
            
$widget $widgets[$widgetid];
        }
        else
        {
            
print_stop_message('invalid_x_specified''widgetid');
        }
        
        
$widgetdm $widget->getDM();
        
        try
        {
             
$widgetdm->set('title''Member Rides');
             
$widgetdm->set('description'$info['description']);
             
$widgetdm->set('config', array(
                        
'template_name' => 'vbcms_widget_rides_page',
                        
'cache_ttl' => 0,
                        
'phpcode' => $arr['widgetphp'],
                              ));

             if (!
$widgetdm->save())
             {
                     
print_cp_message($widgetdm->error);
             }
        }
        catch (
vB_Exception $e)
        {
            
print_cp_message($e->getMessage());
        }
    }
    else
    {
        require_once(
DIR '/packages/vbcms/dm/widget.php');
        
$widgetdm = new vBCms_DM_Widget();
        
$widgetdm->set('widgettypeid''12');
        
$widgetdm->set('title''Member Rides');
        
$widgetdm->set('description'$info['description']);
        
$widgetdm->set('config', array(
                        
'template_name' => 'vbcms_widget_rides_page',
                        
'cache_ttl' => 5,
                        
'phpcode' => $arr['widgetphp'],
                              ));

        
$widgetid $widgetdm->save();
        if (!
$widgetid)
        {
            
$errmsg implode("\n<br /><br />"$widgetdm->getErrors());
            
print_cp_message($errmsg);
        }
        else
        {
            
$db->query_write("UPDATE " TABLE_PREFIX "cms_widget set product = '" $info['productid'] . "' where widgetid = $widgetid");
        }
    }    


Then try installing again

RobAC 01-06-2016 07:26 PM

That worked. Thanks!


All times are GMT. The time now is 04:56 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.01299 seconds
  • Memory Usage 1,848KB
  • 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
  • (3)bbcode_html_printable
  • (8)bbcode_php_printable
  • (3)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