diff --git a/serendipity_event_userprofiles/serendipity_event_userprofiles.php b/serendipity_event_userprofiles/serendipity_event_userprofiles.php index cd1cae94..62bf2633 100755 --- a/serendipity_event_userprofiles/serendipity_event_userprofiles.php +++ b/serendipity_event_userprofiles/serendipity_event_userprofiles.php @@ -1,4 +1,4 @@ - true )); $propbag->add('author', 'Garvin Hicking, Falk Doering'); - $propbag->add('version', '0.29'); + $propbag->add('version', '0.30'); $propbag->add('requirements', array( - 'serendipity' => '0.8', + 'serendipity' => '2.0', 'smarty' => '2.6.7', 'php' => '4.1.0' )); @@ -202,45 +202,49 @@ class serendipity_event_userprofiles extends serendipity_event { function showUsers() { global $serendipity; + echo '

' . (function_exists('serendipity_specialchars') ? serendipity_specialchars(PLUGIN_EVENT_USERPROFILES_SELECT) : htmlspecialchars(PLUGIN_EVENT_USERPROFILES_SELECT, ENT_COMPAT, LANG_CHARSET)) . '

'."\n"; + if(!empty($serendipity['POST']['submitProfile'])) { - echo '
' . DONE . ': ' . sprintf(SETTINGS_SAVED_AT, serendipity_strftime('%H:%M:%S')) . '
'; + echo ' ' . DONE . ': ' . sprintf(SETTINGS_SAVED_AT, serendipity_strftime('%H:%M:%S')) . ''; } if(!empty($serendipity['POST']['submitProfileOptions'])) { - echo '
' . DONE . ': ' . sprintf(SETTINGS_SAVED_AT, serendipity_strftime('%H:%M:%S')) . '
'; + echo ' ' . DONE . ': ' . sprintf(SETTINGS_SAVED_AT, serendipity_strftime('%H:%M:%S')) . ''; } if(!empty($serendipity['POST']['createVcard'])) { if ($this->createVCard($serendipity['POST']['profileUser'])) { - echo '
'. DONE . ': ' . sprintf(PLUGIN_EVENT_USERPROFILES_VCARDCREATED_AT, serendipity_strftime('%H:%M:%S')) . '
'; - echo '
'. IMPORT_NOTES . ': '. PLUGIN_EVENT_USERPROFILES_VCARDCREATED_NOTE . '
'; + echo ' '. DONE . ': ' . sprintf(PLUGIN_EVENT_USERPROFILES_VCARDCREATED_AT, serendipity_strftime('%H:%M:%S')) . ''; + echo ' '. IMPORT_NOTES . ': '. PLUGIN_EVENT_USERPROFILES_VCARDCREATED_NOTE . ''; } else { - echo '
'. ERROR . ': ' . PLUGIN_EVENT_USERPROFILES_VCARDNOTCREATED . '
'; + echo ' '. ERROR . ': ' . PLUGIN_EVENT_USERPROFILES_VCARDNOTCREATED . ''; } } - echo '
'."\n"; - echo ''."\n"; - echo ''."\n"; - echo "
\n"; - echo '' . (function_exists('serendipity_specialchars') ? serendipity_specialchars(PLUGIN_EVENT_USERPROFILES_SELECT) : htmlspecialchars(PLUGIN_EVENT_USERPROFILES_SELECT, ENT_COMPAT, LANG_CHARSET)) . '

'."\n";; - echo USER . ' '."\n"; + echo ''."\n"; + echo "
\n"; + echo ''; + echo ' '."\n";; - echo ' '."\n";; + echo ''."\n"; + echo "
\n"; + echo "
\n"; + echo ' '."\n"; if ($this->checkUser($user)) { - echo ' '."\n";; - echo ' '."\n";; + echo ' '."\n"; + echo ' '."\n"; ## very very bad the next line (show only when edit the local_properties) if (!empty($serendipity['POST']['profileUser']) && empty($serendipity['POST']['editOptions']) && empty($serendipity['POST']['viewUser'])) { - echo ' '."\n";; + echo ' '."\n"; } } - echo "

\n
\n"; + echo "
\n"; if (!empty($serendipity['POST']['profileUser'])) { $user = serendipity_fetchUsers($serendipity['POST']['profileUser']); @@ -300,7 +304,7 @@ class serendipity_event_userprofiles extends serendipity_event { 'selected_group_data' => $group, 'selected_members' => $members )); - + $tfile = serendipity_getTemplateFile('plugin_groupmembers.tpl', 'serendipityPath'); if (!$tfile) { $tfile = dirname(__FILE__) . '/plugin_groupmembers.tpl'; @@ -337,12 +341,13 @@ class serendipity_event_userprofiles extends serendipity_event { function showUser(&$user) { global $serendipity; - echo ''."\n"; + echo '
' . "\n"; $local_properties =& $this->getLocalProperties(); foreach($local_properties as $property => $info) { - echo '
'."\n"; + echo '
' . $info['desc'] .'
' . "\n"; + echo '
' . $user[$property] . '
' . "\n"; } - echo "
'.$info['desc'].''.$user[$property].'
\n"; + echo "\n"; } function showCol($property, &$info, &$user) { @@ -351,7 +356,7 @@ class serendipity_event_userprofiles extends serendipity_event { echo " \n"; switch($info['type']) { case 'html': - echo '\n"; + echo '\n"; break; case 'boolean': @@ -363,15 +368,15 @@ class serendipity_event_userprofiles extends serendipity_event { break; case 'date': - ?> " size="2" maxlength="2" />. - " size="2" maxlength="2" />. - " size="4" maxlength="4" /> + ?> " size="2" maxlength="2">. + " size="2" maxlength="2">. + " size="4" maxlength="4"> '."\n"; + echo ''."\n"; } echo " \n"; echo "\n"; @@ -397,7 +402,8 @@ class serendipity_event_userprofiles extends serendipity_event { unset($serendipity['POST']['profilebirthday_month'], $serendipity['POST']['profilebirthday_day'], $serendipity['POST']['profilebirthday_year']); } - echo ''."\n"; + echo "
\n"; + echo "
\n"; $local_properties =& $this->getLocalProperties(); foreach($local_properties as $property => $info) { @@ -424,14 +430,16 @@ class serendipity_event_userprofiles extends serendipity_event { } echo "
\n"; - echo ''."\n\n"; + echo "\n"; + echo '' . "\n"; } function editOptions(&$user) { global $serendipity; - echo ''."\n"; + echo "
\n"; + echo "
\n"; $profile =& $this->getConfigVars($user['authorid']); foreach($this->option_properties as $property => $info) { @@ -446,7 +454,8 @@ class serendipity_event_userprofiles extends serendipity_event { $this->showCol($property, $info, $user); } echo "
\n"; - echo ''."\n\n"; + echo "\n"; + echo '' . "\n"; } @@ -524,14 +533,8 @@ class serendipity_event_userprofiles extends serendipity_event { case 'css_backend': // do use in 2.0+ versions - if ($serendipity['version'][0] > 1 ) { -?> + echo file_get_contents(dirname(__FILE__) . '/userprofiles_backend.css'); -/* userprofiles plugin ------------- */ -.userprofileform { margin-top: 1.5em; } - -' . PLUGIN_EVENT_USERPROFILES_TITLE . ''; + echo '
  • ' . PLUGIN_EVENT_USERPROFILES_TITLE . '
  • '; return true; break; @@ -654,7 +657,7 @@ class serendipity_event_userprofiles extends serendipity_event { // No image found, do not try again in next article. $this->found_images[$author] = ''; } - + // Assign smarty variable {$entry.authorpic} $eventData['authorpic'] = $this->found_images[$author]; diff --git a/serendipity_event_userprofiles/userprofiles_backend.css b/serendipity_event_userprofiles/userprofiles_backend.css new file mode 100644 index 00000000..39a55211 --- /dev/null +++ b/serendipity_event_userprofiles/userprofiles_backend.css @@ -0,0 +1,63 @@ +.userprofiles_wrap { + min-height: .01%; + -ms-overflow-style: -ms-autohiding-scrollbar; + overflow-x: auto; + overflow-y: hidden; +} + +.userprofiles_wrap th, +.userprofiles_wrap td { + white-space: nowrap; +} + +.userprofiles_table { + border: 1px solid #aaa; + width: 100%; +} + +.userprofiles_table tr:nth-child(odd) { + background: #eee; +} + +.userprofiles_table td { + border-bottom: 1px solid #aaa; + padding: .25em; +} + +@media only screen and (min-width: 768px) { + .userprofiles_wrap { + overflow-y: auto; + } + + .userprofiles_wrap th, + .userprofiles_wrap td { + white-space: normal; + } + + .userprofiles_table td { + min-width: 15em; + } + + .userprofiles_show { + border: 1px solid #aaa; + border-bottom: 0; + } + + .userprofiles_show dt, + .userprofiles_show dd { + border-bottom: 1px solid #aaa; + box-sizing: border-box; + float: left; + padding: .25em .5em; + } + + .userprofiles_show dt { + border-right: 1px solid #aaa; + clear: left; + width: 40%; + } + + .userprofiles_show dd { + width: 60%; + } +}