Thread: Major Additions - vbRides ? Garage
View Single Post
  #112  
Old 10-02-2015, 03:56 AM
Dragonsys's Avatar
Dragonsys Dragonsys is offline
 
Join Date: Jan 2008
Location: DFW, Texas
Posts: 743
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Attached Images
File Type: png stask_photo.png (37.8 KB, 0 views)
Reply With Quote
Благодарность от:
Keyser Soze
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01331 seconds
  • Memory Usage 1,839KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_html
  • (3)bbcode_php
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_box_bit
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_attachment
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete