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('', $nextitem, 1);
?>
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