Announcement

Collapse
No announcement yet.

Getting data out from event.customfields

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Getting data out from event.customfields

    This is the code I currently use. It also also outlines the problematic, still missing variables
    PHP Code:
    $limit_page1 '1';    
    $get_events DB_site->query ("SELECT `eventid` , `userid` , `title` , `customfields` , `dateline_from`  
    FROM `" 
    TABLE_PREFIX "event`
    WHERE userid = '
    $userinfo[userid]
    ORDER BY `dateline_from` DESC
    LIMIT 
    $limit_page1");  

    while(
    $events $DB_site->fetch_array($get_events))
        {
            
    exec_switch_bg();
            
    $events['date'] = vbdate($vboptions['dateformat'],$events['dateline_from']);
            
    // THE PROBLEM
            // how to formulate the customfields based variables ?
            // Below should be pulling clendar customfield id 1
            
    $events['type'] = ' ';
            
    // Below should be pulling clendar customfield id 2
            
    $events['location'] = ' ';
            eval(
    '$usersevents .= "' fetch_template('memberinfo_usersevents') . '";');
        } 
    So... my problem only seems to be what code I should use for $events['type'] = ' '; and $events['location'] = ' ';

    I was told that following array separates the data
    PHP Code:
    $customArray unserialize($row["customfields"]);
    array(
    2) {
      [
    1]=>
      
    string(4"Club"
      
    [2]=>
      
    string(8"Helsinki"

    In above example Club equals type and Helsinki equals Location. Unfortunately I don't get how to formulate the $events['type'] = ' '; and $events['location'] = ' '; variables so they become dynamic and can be used in the template for final output.

    Thank's for any help.

    -Mika
    www.SoundChilds.net

  • #2
    You'll need to put the data into an array and then serialize() that.
    You should ask for further help with custom code on www.vbulletin.org though.
    Best Regards
    Colin Frei

    Please don't contact me per PM.

    Comment


    • #3
      Thank you

      Originally posted by Colin F View Post
      You'll need to put the data into an array and then serialize() that.
      You should ask for further help with custom code on www.vbulletin.org though.
      Ok. I'll ask at .org.

      Colin, thanks for your effort,
      -Mika
      www.SoundChilds.net

      Comment

      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
      Working...
      X