コード例 #1
0
ファイル: blocks.php プロジェクト: LeeGlendenning/formulize
function b_profile_friends_show($options)
{
    global $xoTheme;
    if (!empty(icms::$user)) {
        $profile_friendship_handler = icms_getModuleHandler('friendship', basename(dirname(dirname(__FILE__))), 'profile');
        $friends = $profile_friendship_handler->getFriendships(0, 0, icms::$user->getVar('uid'), 0, PROFILE_FRIENDSHIP_STATUS_ACCEPTED);
        if (count($friends) == 0) {
            return;
        }
        $block = array();
        $i = 0;
        foreach ($friends as $friend) {
            $friend_uid = icms::$user->getVar('uid') == $friend['friend1_uid'] ? $friend['friend2_uid'] : $friend['friend1_uid'];
            $block['friends'][$i]['uname'] = icms_member_user_Handler::getUserLink($friend_uid);
            $block['friends'][$i]['friend_uid'] = $friend_uid;
            $block['friends'][$i]['sort'] = icms_member_user_Object::getUnameFromId($friend_uid);
            $i++;
        }
        if (isset($block['friends']) && count($block['friends']) > 0) {
            usort($block['friends'], 'sortFriendsArray');
        }
        // adding PM javascript, $xoTheme cannot be used in this place because jQuery is not yet loaded
        if (count($block['friends']) > 0) {
            $block['jQuery'] = 'jQuery(document).ready(function(){jQuery("a.block-profile-pm").colorbox({width:600, height:395, iframe:true});});';
        }
    }
    return $block;
}
コード例 #2
0
    } else {
        $com_mode = $icmsConfig['com_mode'];
    }
}
if (!isset($_GET['com_order'])) {
    if (is_object(icms::$user)) {
        $com_order = icms::$user->getVar('uorder');
    } else {
        $com_order = $icmsConfig['com_order'];
    }
} else {
    $com_order = (int) $_GET['com_order'];
}
$comment_handler = icms::handler('icms_data_comment');
$comment =& $comment_handler->get($com_id);
$r_name = icms_member_user_Object::getUnameFromId($comment->getVar('com_uid'));
$r_text = _CM_POSTER . ': <strong>' . $r_name . '</strong>&nbsp;&nbsp;' . _CM_POSTED . ': <strong>' . formatTimestamp($comment->getVar('com_created')) . '</strong><br /><br />' . $comment->getVar('com_text');
$com_title = $comment->getVar('com_title', 'E');
if (!preg_match("/^(Re|" . _CM_RE . "):/i", $com_title)) {
    $com_title = _CM_RE . ": " . icms_core_DataFilter::icms_substr($com_title, 0, 56);
}
$com_pid = $com_id;
$com_text = '';
$com_id = 0;
$dosmiley = 1;
$groups = is_object(icms::$user) ? icms::$user->getGroups() : ICMS_GROUP_ANONYMOUS;
$gperm_handler = icms::handler('icms_member_groupperm');
if ($icmsConfig['editor_default'] != 'dhtmltextarea' && $gperm_handler->checkRight('use_wysiwygeditor', 1, $groups, 1, false)) {
    $dohtml = 1;
    $dobr = 0;
} else {
コード例 #3
0
ファイル: xoopsstory.php プロジェクト: nao-pon/impresscms
 /**
  * Returns the current username from (@link icms_member_user_Object)
  *
  * @return   string
  **/
 function uname()
 {
     return icms_member_user_Object::getUnameFromId($this->uid);
 }
コード例 #4
0
ファイル: pmlite.php プロジェクト: LeeGlendenning/formulize
     $subject = $pm->getVar('subject', 'E');
     if (!preg_match("/^Re:/i", $subject)) {
         $subject = 'Re: ' . $subject;
     }
     echo "<td class='even'><input type='text' name='subject' value='" . $subject . "' size='30' maxlength='100' /></td>";
 } else {
     echo "<td class='even'><input type='text' name='subject' size='30' maxlength='100' /></td>";
 }
 echo "</tr>";
 echo "<tr valign='top'><td class='head' width='25%'>" . _PM_MESSAGEC . "</td>";
 echo "<td class='even'>";
 if ($reply == 1) {
     $pm_handler = icms::handler('icms_data_privmessage');
     $pm =& $pm_handler->get($msg_id);
     if ($pm->getVar("to_userid") == (int) icms::$user->getVar('uid')) {
         $pm_uname = icms_member_user_Object::getUnameFromId($pm->getVar("from_userid"));
         $message = "[quote]\n";
         $message .= sprintf(_PM_USERWROTE, $pm_uname);
         $message .= "\n" . $pm->getVar("msg_text", "E") . "\n[/quote]";
     } else {
         unset($pm);
         $reply = $send2 = 0;
     }
     $textarea = new icms_form_elements_Dhtmltextarea(_PM_MESSAGEC, 'message', $message);
 } else {
     $textarea = new icms_form_elements_Dhtmltextarea(_PM_MESSAGEC, 'message', '');
 }
 echo $textarea->render();
 echo "</td>";
 echo "</tr>";
 echo "<tr><td class='head'>&nbsp;</td><td class='even'>\r\n        <input type='hidden' name='op' value='submit' />" . icms::$security->getTokenHTML() . "\r\n        <input type='submit' class='formButton' name='submit' value='" . _PM_SUBMIT . "' />&nbsp;\r\n        <input type='reset' class='formButton' value='" . _PM_CLEAR . "' />\r\n        &nbsp;<input type='button' class='formButton' name='cancel' value='" . _PM_CANCELSEND . "' onclick='javascript:window.close();' />\r\n        </td></tr></table>\n";
コード例 #5
0
 /**
  * get user name of the friend
  *
  * @return str user name
  */
 public function getFriendUname()
 {
     return icms_member_user_Object::getUnameFromId($this->getFriendUid());
 }
コード例 #6
0
ファイル: viewpmsg.php プロジェクト: nao-pon/impresscms
	}

	for ($i = 0; $i < $total_messages; $i++) {
		$class = ($i % 2 == 0) ? 'even' : 'odd';
		echo "<tr align='" . _GLOBAL_LEFT . "' class='$class'>"
		. "<td style='vertical-align: middle; width: 2%; text-align: center;'><input type='checkbox' id='message_" 
		. $pm_arr[$i]->getVar('msg_id') . "' name='msg_id[]' value='" . $pm_arr[$i]->getVar('msg_id') . "' /></td>\n";
		if ($pm_arr[$i]->getVar('read_msg') == 1) {
			echo "<td style='vertical-align: middle; width: 5%; text-align: center;'>&nbsp;</td>\n";
		} else {
			echo "<td style='vertical-align: middle; width: 5%; text-align: center;'>"
			. "<img src='images/read.gif' alt='" . _PM_NOTREAD . "' /></td>\n";
		}
		echo "<td style='vertical-align: middle; width: 5%; text-align: center;'>"
		. "<img src='images/subject/" . $pm_arr[$i]->getVar('msg_image', 'E') . "' alt='' /></td>\n";
		$postername = icms_member_user_Object::getUnameFromId($pm_arr[$i]->getVar('from_userid'));
		echo "<td style='vertical-align: middle; width: 10%; text-align: center;'>";
		// no need to show deleted users
		if ($postername) {
			echo "<a href='userinfo.php?uid=". (int) ($pm_arr[$i]->getVar('from_userid')) . "'>" . $postername . "</a>";
		} else {
			echo $icmsConfig['anonymous'];
		}
		echo "</td>\n";
		echo "<td valign='middle' style='vertical-align: middle;'><a href='readpmsg.php?start="
		. (int) (($total_messages-$i-1)) . "&amp;total_messages="
		. (int) $total_messages . "'>" . $pm_arr[$i]->getVar('subject') . "</a></td>";
		echo "<td style='vertical-align: middle; width: 30%; text-align: center;'>"
		. formatTimestamp($pm_arr[$i]->getVar('msg_time')) . "</td></tr>";
	}
コード例 #7
0
ファイル: search.php プロジェクト: LeeGlendenning/formulize
 $count - $start > $max_results_per_page ? $num_show_this_page = $max_results_per_page : ($num_show_this_page = $count - $start);
 for ($i = $start; $i < $start + $num_show_this_page; $i++) {
     $results[$i]['processed_image_alt_text'] = icms_core_DataFilter::checkVar($modname, 'text', 'output') . ": ";
     if (isset($results[$i]['image']) && $results[$i]['image'] != "") {
         $results[$i]['processed_image_url'] = "modules/" . $moddir . "/" . $results[$i]['image'];
     } else {
         $results[$i]['processed_image_url'] = "images/icons/posticon2.gif";
     }
     if (!preg_match("/^http[s]*:\\/\\//i", $results[$i]['link'])) {
         $results[$i]['link'] = "modules/" . $moddir . "/" . $results[$i]['link'];
     }
     $results[$i]['processed_title'] = icms_core_DataFilter::checkVar($results[$i]['title'], 'text', 'output');
     if ($icmsConfigSearch['search_user_date']) {
         $results[$i]['uid'] = @(int) $results[$i]['uid'];
         if (!empty($results[$i]['uid'])) {
             $uname = icms_member_user_Object::getUnameFromId($results[$i]['uid']);
             $results[$i]['processed_user_name'] = $uname;
             $results[$i]['processed_user_url'] = ICMS_URL . "/userinfo.php?uid=" . $results[$i]['uid'];
         }
         $results[$i]['processed_time'] = !empty($results[$i]['time']) ? " (" . formatTimestamp((int) $results[$i]['time']) . ")" : "";
     }
 }
 $search_url_prev = "";
 $search_url_next = "";
 $search_url_base = ICMS_URL . '/search.php?';
 $search_url_get_params = 'query=' . urlencode(stripslashes(implode(' ', $queries)));
 $search_url_get_params .= "&mid={$mid}&action={$action}&andor={$andor}";
 if ($action == 'showallbyuser') {
     $search_url_get_params .= "&uid={$uid}";
 }
 $search_url_get_params = htmlspecialchars($search_url_get_params, ENT_COMPAT, _CHARSET);