The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Extracting Custom Calendar Fields from Database in PHP
Hi
I have some custom fields in my vbulletin calendar which I'd like to show on a non-vb page. Since the all the custom field information is held in a long string, the only way I can think of extracting, in the case of the example below is by using strpos and substr. Code:
a:2:{i:1;s:19:"Birmingham, England";i:2;s:5:"88248";} Code:
$location = substr($row_Events['customfields'], strpos($row_Events['customfields'],"\"")+1, strpos($row_Events['customfields'],"\"", strpos($row_Events['customfields'],"\"")+1)-strpos($row_Events['customfields'],"\"")-1); Thanks Andy. |
#2
|
||||
|
||||
The string is actually a serialized array. You can "reform" the array using the unserialize() function.
|
#3
|
|||
|
|||
Superb, thanks!
Code:
$customfields = unserialize($row_Events['customfields']); $location = $customfields[1]; Andy |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|