The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
I am wanting to add two custom fields to new threads:
latitude longitude I want these stored in the thread table in VB What I have tried: 1. Modified newthread template to include: Code:
<!-- GOOGLE MAP COORDINATES START HERE --> <fieldset class="fieldset"> <legend>$vbphrase[map_coordinates]</legend> <div style="padding:$stylevar[formspacer]px"> <div><label for="latitude"><input type="text" class="bginput" size="5" name="latitude" value="$latitude" id="latitude" tabindex="1" /> $vbphrase[latitude]</label></div> <br /> <div><label for="longitude"><input type="text" class="bginput" size="5" name="longitude" value="$longitude" id="longitude" tabindex="1" /> $vbphrase[longitude]</label></div> </fieldset> <!-- GOOGLE MAP COORDINATES END HERE --> 3. Created hooks in: threadfpdata_start Code:
$this->validfields['latitude'] = array(TYPE_INT, REQ_NO); $this->validfields['longitude'] = array(TYPE_INT, REQ_NO); Code:
$this->validfields['latitude'] = array(TYPE_INT, REQ_NO); $this->validfields['longitude'] = array(TYPE_INT, REQ_NO); Code:
$vbulletin->input->clean_array_gpc('p', array('latitude' => TYPE_INT, 'longitude', TYPE_INT)); $newpost['lattitude'] =& $vbulletin->GPC['latitude']; $newpost['longitude'] =& $vbulletin->GPC['longitude']; Thanks very much Ok, I'm getting there. There is a typo in newpost_process it now reads: Code:
if ($type == 'thread') { $dataman->setr('thread_dec_lat', $post['thread_dec_lat']); $dataman->setr('thread_dec_lon', $post['thread_dec_lon']); } I've change the variable names from 'latitude' to 'thread_dec_lat' and 'longitude' to 'thread_dec_long' by the way ![]() Now to figure out why it is only writing one of the variables into the database ... |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|