function mx_showusershowsstr($user) { global $mxuser; $usershows = array('usershows' => array('shows' => array(0, _('Wall'), 'shows'))); $usershowsb = array('usershows' => array()); $usershowsptr = $mxuser->listusershows($user->id); $usershows = array(); if ($usershowsptr) { while ($show = $mxuser->listusershows($user->id, $usershowsptr)) { $ashow = new StdClass(); $ashow->select = '<input type="checkbox" name="selshows[]" value="' . $show->msgid . '">'; $show->type = 'me'; $show->mylikes = $mxuser->getlikes($show->msgid); $ashow->show = $show; $ashow->flags = $show->flags; $usershows['usershows'][] = $ashow; } } return mx_showtablestr($usershows, $usershows, 'shows', $usershowsb, 'usershows'); }
function mx_xmlbundle($bundleid, $section, $orderkey, $protect = true) { global $mxdb, $mxuser; $allmedia = array(); if ($orderkey) { $listorder = $orderkey . ' asc'; } else { $listorder = 'type asc, title asc'; } $artistid = mx_getartistidfrombundle($bundleid); $bundleinfo = $mxuser->getmediainfo($bundleid); $bundle = $mxuser->listmediafrombundle($bundleid, $listorder, $artistid); foreach ($bundle as $media) { $media = $mxuser->getmediainfo($media->id); $media->bundletitle = $bundleinfo->title; /*if ($artistid==$mxuser->id) { $fanship=null; } else { */ $fanship = $mxuser->getfanship($artistid, $media->id); //} error_log('media ' . $media->id . ' fanship=' . print_r($fanship, true)); mx_medialist($media, $fanship, false, $section != 'media' && $section != 'pubmed'); //error_log($media); if ($media->status >= MXMEDIAVALIDATED || $media->status < MXMEDIAFANVISIBLE) { $allmedia['new'][] = $media; $allmedia['newbun'][] = $media; } if ($media->status == MXMEDIAARCHIVED) { $allmedia['archived'][] = $media; } if ($media->status >= MXMEDIAFANVISIBLE && $media->status <= MXMEDIAPUBLICSHARED) { $allmedia['published'][] = $media; } if ($media->status == MXMEDIAVIRTUAL) { $allmedia['new'][] = $media; $allmedia['newbun'][] = $media; $allmedia['published'][] = $media; $allmedia['archived'][] = $media; } $allmedia['allmedia'][] = $media; if ($media->status >= MXMEDIAFANVISIBLE && $media->status < MXMEDIASUSPENDED) { $allmedia['media'][] = $media; } if ($media->status == MXMEDIAFANVISIBLE || $media->status == MXMEDIAFANSHARED) { $allmedia['fanmed'][] = $media; } if ($media->status == MXMEDIAMEMBERVISIBLE || $media->status == MXMEDIAMEMBERSHARED) { $allmedia['membmed'][] = $media; } if ($media->status == MXMEDIAPUBLIC || $media->status == MXMEDIAPUBLICSHARED) { $allmedia['pubmed'][] = $media; } } $tablefmt = array(); $tablefmt[$section] = array(-1, _('New Media'), ''); $tablefmt['select'] = $section == 'media' || $section == 'pubmed' || $section == 'membmed' || $section == 'fanmed' || $section == 'newbun' ? '' : array(0, '<input id="checkallbox" type="checkbox" onclick="javascript:checkall(\'' . $section . '\');">', 'html', 3); if ($section != 'media' && $section != 'pubmed') { $tablefmt['grabber'] = array(0, 'xxx', 'html', 2); $tablefmt['dragpic'] = array(0, 'xxx', 'dragdroppic', 1); } $tablefmt['mediadata'] = array(0, _('Media'), 'movablebundledata'); $medialist = array('medialist', 0, _('Media List'), '', array(), array($section => $tablefmt)); $str = mx_showtablestr($medialist[5], $allmedia, 'media', $medialist[4], $section, true); // generate table row if (!$protect) { $str = str_replace('{PRICE}', '<table class="buymedia"><tr><td>', $str); $str = str_replace('{PRICE2}', '</td><td>', $str); $str = str_replace('{PRICE3}', '</td></tr></table>', $str); } return $str; }
function whoswhere() { global $mxdb, $mxuser; $users = $mxdb->whoswhere($this->id); if ($users) { if (is_admin()) { $whoswhere['users'] = array('user' => array(0, _('Who'), 'fan'), 'location' => array(0, _('Where'), 'text'), 'time' => array(0, _('when'), 'date'), 'ip' => array(0, _('IP'), 'text')); } else { $whoswhere['users'] = array('user' => array(0, _('Who'), 'fan'), 'location' => array(0, _('Where'), 'text'), 'time' => array(0, _('when'), 'date')); } $logs = array(); foreach ($users as $k => $userloc) { $log = new StdClass(); $log->user = $userloc->userid; $log->location = mx_pagename($userloc->pag) . ($userloc->opt ? '/' . mx_optionname($userloc->pag, $userloc->opt) : ''); $log->time = $userloc->date; $log->ip = $userloc->ip; $logs['users'][] = $log; } echo '<div class="form">'; echo mx_showtablestr($whoswhere, $logs, 'whoswhere', array(), 'users'); echo '</div>'; /* echo '<ul>'; foreach ($users as $id => $userloc) { $user=$this->getuserinfo($id); echo '<li>'; $where=mx_pagename($userloc->pag) .(($userloc->opt)?('/'.mx_optionname($userloc->pag,$userloc->opt)):''); echo sprintf(_('%s was in "%s" %s'), mx_getname($user), $where,mx_difftime($userloc->date)); echo '</li>'; } echo '</ul>'; */ } }
function mx_fieldsetstr($form, $values, $cansubmit = true, $errors = null, $nofieldset = false, $fielddesc = true) { //if ($form[1]==1) $nofieldset=true; $str = $nofieldset ? '' : '<fieldset>'; $fieldset = 0; //die(print_r($form)); $cols = 0; foreach ($form[5] as $field => $fldinfo) { if (is_array($fldinfo) && $fldinfo[0] >= 0 && $fldinfo[2] != "hidden") { $cols++; } } $mandatory = 0; foreach ($form[5] as $field => $fldinfo) { if (!is_array($fldinfo)) { continue; } if ($fldinfo[0] == -1) { if (!$form[1]) { if ($fieldset) { if ($mandatory) { $str .= '<tr><td class="mandatoryhelp" colspan="' . $cols . '"><sup>*</sup>' . _('Information in <b>bold</b> is mandatory') . '</td></tr>'; $mandatory = 0; } $str .= '</table></fieldset><br/></td></tr>'; $str .= '<tr><td><fieldset>'; } $str .= '<a name="' . $field . '"></a>'; if (!$nofieldset) { $str .= '<legend>' . $fldinfo[1] . '</legend>'; } $fieldset = 1; $str .= '<table class="subform">'; if ($fldinfo[2]) { $str .= '<tr><td colspan=2 class="tabledesc">' . $fldinfo[2] . '</td></tr>'; } } continue; } if ($fldinfo[0] == -2) { $str .= '<tr><td colspan="2">' . mx_showtablestr($fldinfo[1], $fldinfo[2], $fldinfo[3], $fldinfo[4], $fldinfo[5]) . '</td></tr>'; continue; } if ($fldinfo[0] == -3) { //inside buttons $spacer = ''; $str .= '<tr><td class="buttons" colspan="' . $cols . '">'; $spacer = ''; foreach ($fldinfo[1] as $btnname => $btnlabel) { if (!is_array($btnlabel)) { $str .= $spacer . mx_formfield($btnname, $btnlabel, 'button', null, true); } else { $str .= $spacer . $btnlabel[0]; } $spacer = ' '; } //$str.=mx_formfield('submit',$form[4],'submit').' '; //$str.=mx_formfield('clear',$form[6],'reset'); $str .= '</td></tr>'; continue; } if ($fieldset == 0) { $str .= '<table class="subform">'; $fieldset = 1; } if ($fldinfo[2] == 'hidden') { $str .= '<tr><td colspan=2>' . mx_formfield($field, $values[$field] ? $values[$field] : $fldinfo[1], $fldinfo) . '</td></tr>'; continue; } $str .= '<tr class="row_' . $field . '">'; if ($fldinfo[0] >= 3) { $mandatory = 1; } if ($fielddesc) { $str .= '<td class="fieldname' . ($fldinfo[0] >= 3 ? ' mandatory' : '') . ($errors && array_key_exists($field, $errors) ? ' flderror' : '') . '">' . $fldinfo[1] . ($fldinfo[0] >= 3 ? '<sup>*</sup>' : '') . '</td>'; } if (!$fldinfo[0] || !$cansubmit) { $str .= '<td class="data"' . ($fielddesc ? '' : ' colspan=2') . '>' . mx_infofield($field, $values[$field], $fldinfo); $str .= '</td>'; } else { $str .= '<td class="input"' . ($fielddesc ? '' : ' colspan=2') . '>'; if ($errors && array_key_exists($field, $errors)) { $str .= '<div class="formerror"><table><tr><td class="errorarrow">↓</td><td>' . $errors[$field] . '</td></tr></table></div>'; } $str .= mx_formfield($field, $values[$field], $fldinfo); $str .= '</td>'; } $str .= '</tr>'; } if ($mandatory) { $str .= '<tr><td class="mandatoryhelp" colspan="' . $cols . '"><sup>*</sup>' . _('Information in <b>bold</b> is mandatory') . '</td></tr>'; } if ($cansubmit && is_array($form[4]) && false) { // inside buttons (disabled) $spacer = ''; $str .= '<tr><td style="border:red 1px solid;" class="buttons" colspan="' . $cols . '">'; $spacer = ''; foreach ($form[4] as $btnname => $btnlabel) { $str .= $spacer . mx_formfield($btnname, $btnlabel, 'button', null, true); $spacer = ' '; } //$str.=mx_formfield('submit',$form[4],'submit').' '; //$str.=mx_formfield('clear',$form[6],'reset'); $str .= '</td></tr>'; } $str .= '</table>'; $str .= $nofieldset ? '' : '</fieldset>'; return $str; }
function mx_showuserwallstr($user) { global $mxuser; $userwall = array('userwall' => array('wall' => array(0, _('Wall'), 'wall'))); $userwallb = array('userwall' => array()); $userwallptr = $mxuser->listuserwalls($user->id); $userwalls = array(); if ($userwallptr) { while ($wall = $mxuser->listuserwalls($user->id, $userwallptr)) { $awall = new StdClass(); $awall->select = '<input type="checkbox" name="selwall[]" value="' . $wall->msgid . '">'; $wall->type = 'me'; $wall->mylikes = $mxuser->getlikes($wall->msgid); $awall->wall = $wall; $awall->flags = $wall->flags; $userwalls['userwall'][] = $awall; } } return mx_showtablestr($userwall, $userwalls, 'wall', $userwallb, 'userwall'); }