The vB Geek

The vB Geek (http://www.thevbgeek.com/index.php)
-   Geek Article and Review System (http://www.thevbgeek.com/forumdisplay.php?f=26)
-   -   Creating a module and accessing the value of a custom field (http://www.thevbgeek.com/showthread.php?t=5608)

milsirhc 01-21-2010 12:55 PM

Creating a module and accessing the value of a custom field
 
Hi,

I got a custom field: Address, which contains the address of the restaurant.

I figure that if I append the Address custom field value to: http://maps.google.com.au/maps?f=q&s...en&geocode=&q= <address custom field>

I will be able to provide a hyperlink to google map for the restaurant location.

My problem is how can I do that.....

WizKaz 01-23-2010 09:46 PM

You have to write a Plugin.

If you want do show the result in the postbit, use the hook "postbit_display_complete" (Position 1-5, just try)

Then enter a code like this:
(gars5 = Costum Field Nr. 5, you might change the number)

Code:

if(isset($post[gars5]))

{

$showatgooglemaps = "http://maps.google.com.au/maps?f=q&source=s_q&hl=en&geocode=&q="
. $post[gars5];}

}

Now, all you have to do, is insert the variable $showatgooglemaps in the templat gars_pb at the position you want it to appear.

If you want to use it in the threadbit you have to use these values:

Costumfield = $thread[gars5]
Hook = threadbit_display
Template = gars_threabit

Good luck! :)

best regards,

Wizzy


All times are GMT. The time now is 11:41 AM.

Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.