Quote:
Originally Posted by zer026
What would be the conditional statement to display a link to a users uploaded
timeslip(just the timeslip not the full "details" page) if they have submitted one from in their vbgarage?
or,
link to the users full "details" page(if they have submitted timeslip data)?
|
Adding a link to the details page is easy. Just use a conditional to check if the user has entered something in the 1/4 mile ET field like this:
Code:
<if condition="$user[field55] >0">
<a href="member.php?$session[sessionurl]&do=vehicledetails&userid=$id">Timeslip Details</a>
</if>
As for adding a link to the timeslip itself, I believe that would require adding a query to vbgarage.php in order to get the dateline.
I didn't test this but it should work:
In vbgarage.php find:
Code:
eval('$commentbits .= "' . fetch_template('vbgarage_commentbits') . '";');
}
Below it add:
Code:
$timeslip=$DB_site->query("SELECT dateline
FROM " . TABLE_PREFIX . "customtimeslippic WHERE userid = $id LIMIT 1
");
$result_timeslip = $DB_site->fetch_Array($timeslip);
$tdateline = $result_timeslip[dateline];
Then put this somewhere in your vbgarage_viewgarage template:
Code:
<if condition="$tdateline!=''">
<a href="image.php?u=$id&type=timeslip&dateline=$tdateline" target="_blank">View Timeslip <img src="$stylevar[imgdir_misc]/slipicon.gif" border=0></a>
</if>