Profile Statuses

Started by oOo--STAR--oOo, January 28, 2011, 07:04:59 PM

Previous topic - Next topic

agent47

Pretty awesome. Just what I was looking for.
Just one thing though, now since I'm using Tiny Portal is there any way I can display "top 5 status updates" on the homepage with the use of a PHP/HTML block? That'll be really cool.

PortaMx is probably the best SMF portal!

agent47

I had 2 errors while trying to install this and I'm assuming it's because I have Ultimate Profile installed.
So please help me out with this someone.
I've attached the two files which gave issues while trying to install the package.
Here are the codes the package had trouble replacing them with. Please replace/add before them on the attached files and re-attach them so that I can upload them back to my server. Thanks in advance.


Find (/Themes/default/Profile.template.php):
echo '
</div>
<span class="botslice"><span></span></span>
</div>
</div>
<div class="clear"></div>
</div>';
}


Replace with:
echo '
</div>
<span class="botslice"><span></span></span>
</div>
</div>';

if (!empty($modSettings['profile_statuses_enable']) && $context['member']['profilestatuses']['enabled'] == 1) {

echo '<br class="clear" />
<br />
<div id="detailedinfo">
<div class="cat_bar">
<h3 class="catbg">
<span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/profile_sm.gif" alt="" class="icon" />', $txt['profile_statuses'], '</span>
</h3>
</div>
<div class="windowbg2">
<span class="topslice"><span></span></span>
<div class="content">';

if ($context['user']['is_owner'] || allowedTo('profile_extra_any')) {
echo '<form action="' . $scripturl . '?action=profile;area=poststatus" method="post" accept-charset="', $context['character_set'], '">
<label for="status"><strong>' . $txt['update_status_text'] . '</strong> <textarea name="status" rows="4" style="width: 95%; margin: 5px;"></textarea></label>
<input type="hidden" name="sc" value="' . $context['session_id'] . '" />
<input type="submit" name="submit" value="' . $txt['statuses_submit'] . '" />&nbsp;&nbsp;<label for="locked">' . $txt['statuses_lock_status'] . ' <input type="checkbox" name="locked" value="1" /></label>
</form>
<dl></dl>';
}

if (isset($context['statuses'])) {
$status_count = count($context['statuses']);
for ($i = 0; $i < $status_count; $i++) {
echo '
<dl>
<dt>
<a href="' . $scripturl . '?action=profile;u=' . $context['statuses'][$i]['member_id'] . ';">' . $context['statuses'][$i]['name'] . '</a><div class="smalltext">' . $context['member']['title'] . '<br /><br />' . $context['member']['avatar']['image'] . '<br /></div>';

if ($context['user']['is_owner'] || allowedTo('profile_extra_any')) {
echo '<a href="' . $scripturl . '?action=profile;area=deletestatus;s=' . $context['statuses'][$i]['status_id'] . ';sesc=' . $context['session_id'] . '" style="font-weight: normal; font-size: 7pt;">' . $txt['statuses_delete'] . '</a> <a href="' . $scripturl . '?action=profile;area=lockstatus;s=' . $context['statuses'][$i]['status_id'] . ';sesc=' . $context['session_id'] . '" style="font-weight: normal; font-size: 7pt;">' . ($context['statuses'][$i]['locked'] == 0 ? $txt['statuses_lock'] : $txt['statuses_unlock']) . '</a>';
}

echo '</dt>
<dd>
' . ($context['statuses'][$i]['locked'] > 0 ? '<img src="' . $settings['theme_url'] . '/images/topic/normal_post_locked.gif" alt="" /> ' : '') . '' . parse_bbc($context['statuses'][$i]['post']) . '
<div class="smalltext">' . $context['statuses'][$i]['date'] . '</div>
</dd>
<dd>
<table width="75%" border="0" cellspacing="0" cellpadding="4" align="left" class="tborder">';
if (isset($context['replies'][$i])) {
$reply_count = count($context['replies'][$i]);
for ($j = 0; $j < $reply_count; $j++) {
if ($j & 1) {
echo '
<tr>
<td class="windowbg2" style="max-width: 300px; max-height: 300px;">
<a href="' . $scripturl . '?action=profile;u=' . $context['replies'][$i][$j]['member_id'] . ';">' . $context['replies'][$i][$j]['name'] . '</a> - ' . $context['replies'][$i][$j]['date'] . ' ' . ($context['user']['is_owner'] || allowedTo('profile_extra_any') ? '<a href="' . $scripturl . '?action=profile;area=deletereply;reply=' . $context['replies'][$i][$j]['reply_id'] . ';sesc=' . $context['session_id'] . '" style="font-weight: normal; font-size: 7pt;">' . $txt['statuses_delete'] . '</a>' : '') . '
<hr />
<div style="width: 300px; height: 40px; overflow: auto;">' . $context['replies'][$i][$j]['reply'] . '</div>
</td>
</tr>';
} else {
echo '
<tr>
<td class="windowbg" style="max-width: 300px; max-height: 300px;">
<a href="' . $scripturl . '?action=profile;u=' . $context['replies'][$i][$j]['member_id'] . ';">' . $context['replies'][$i][$j]['name'] . '</a> - ' . $context['replies'][$i][$j]['date'] . ' ' . ($context['user']['is_owner'] || allowedTo('profile_extra_any') ? '<a href="' . $scripturl . '?action=profile;area=deletereply;reply=' . $context['replies'][$i][$j]['reply_id'] . ';sesc=' . $context['session_id'] . '" style="font-weight: normal; font-size: 7pt;">' . $txt['statuses_delete'] . '</a>' : '') . '
<hr />
<div style="width: 300px; height: 40px; overflow: auto;">' . $context['replies'][$i][$j]['reply'] . '</div>
</td>
</tr>';
}
}
}

echo '
</tr>
<tr class="catbg">
<th style="text-align: left;"><div class="smalltext">' . ($context['statuses'][$i]['locked'] == 0 ? '<a href="javascript: void(0)" onclick="activateReplyBox(' . $context['statuses'][$i]['status_id'] . ')">' . $txt['statuses_comment'] . '</a>' : '') . ' - ' . ($context['reply_total'][$i] > 3 ? '<a href="' . $scripturl . '?action=profile;area=showstatus;s=' . $context['statuses'][$i]['status_id'] . '">' . $txt['statuses_view_all'] . ' (' . $context['reply_total'][$i] . ') ' . $txt['statuses_comments']. '</a>' : '') . '</div></th>
</tr>

<tr>
<td id="profile_statuses_replybox' . $context['statuses'][$i]['status_id'] . '" class="windowbg"></td>
</tr>
</table>
</dd>
</dl>';
}
}

echo constructPageIndex($scripturl . '?action=profile;u=' . $context['member_id'] . ';status=%d', $context['start'], $context['total'], $context['statuses_per_page'], true);

echo '
</div>
<span class="botslice"><span></span></span>
</div>
</div>';
}

echo '<div class="clear"></div>
</div>';
}

function template_showStatus() {

global $context, $txt, $modSettings, $settings, $scripturl;

echo '
<div id="basicinfo">
<div class="windowbg">
<span class="topslice"><span></span></span>
<div class="content flow_auto">
' . $txt['statuses_showing_reply_total_pre'] . '' . ($context['reply_total'] > 0 ? $context['reply_total'] : 0) . '' . $txt['statuses_showing_reply_total_suf'] . '
</div>
<span class="botslice"><span></span></span>
</div>
</div>
<div id="detailedinfo">
<div class="cat_bar">
<h3 class="catbg">
<span class="ie6_header floatleft"><img src="', $settings['images_url'], '/icons/profile_sm.gif" alt="" class="icon" />', $txt['statuses_showing_status'], '' . $context['status'] . '</span>
</h3>
</div>
<div class="windowbg2">
<span class="topslice"><span></span></span>
<div class="content">
<form action="' . $scripturl . '?action=profile;area=postreply" method="post" accept-charset="', $context['character_set'], '">
<label for="status"><strong>' . $txt['statuses_showing_status_reply'] . '</strong> <textarea name="reply" rows="4" style="width: 95%; margin: 5px;"></textarea></label>
<input type="hidden" name="sc" value="' . $context['session_id'] . '" />
<input type="hidden" value="' . $context['status'] . '" name="s" />
<input type="submit" name="submit" value="' . $txt['statuses_submit'] . '" />
</form>
<dl></dl>';

echo '
<dl>
<dt>
<a href="' . $scripturl . '?action=profile;u=' . $context['statuses']['member_id'] . ';">' . $context['statuses']['name'] . '</a><div class="smalltext">' . $context['member']['title'] . '<br /><br />' . $context['member']['avatar']['image'] . '<br /></div>';

if ($context['user']['is_owner'] || allowedTo('profile_extra_any')) {
echo '<a href="' . $scripturl . '?action=profile;area=deletestatus;s=' . $context['statuses']['status_id'] . ';sesc=' . $context['session_id'] . '" style="font-weight: normal; font-size: 7pt;">' . $txt['statuses_delete'] . '</a> <a href="' . $scripturl . '?action=profile;area=lockstatus;s=' . $context['statuses']['status_id'] . ';sesc=' . $context['session_id'] . '" style="font-weight: normal; font-size: 7pt;">' . ($context['statuses']['locked'] == 0 ? $txt['statuses_lock'] : $txt['statuses_unlock']) . '</a>';
}

echo '</dt>
<dd>
' . ($context['statuses']['locked'] > 0 ? '<img src="' . $settings['theme_url'] . '/images/topic/normal_post_locked.gif" alt="" /> ' : '') . '' . parse_bbc($context['statuses']['post']) . '
<div class="smalltext">' . $context['statuses']['date'] . '</div>
</dd>
<dd>
<table width="75%" border="0" cellspacing="0" cellpadding="4" align="left" class="tborder">';
if (isset($context['replies'])) {
$reply_count = count($context['replies']);
for ($i = 0; $i < $reply_count; $i++) {
if ($i & 1) {
echo '
<tr>
<td class="windowbg2" style="max-width: 300px; max-height: 300px;">
<a href="' . $scripturl . '?action=profile;u=' . $context['replies'][$i]['member_id'] . ';">' . $context['replies'][$i]['name'] . '</a> - ' . $context['replies'][$i]['date'] . ' ' . ($context['user']['is_owner'] || allowedTo('profile_extra_any') ? '<a href="' . $scripturl . '?action=profile;area=deletestatus;reply=' . $context['replies'][$i]['reply_id'] . ';sesc=' . $context['session_id'] . '" style="font-weight: normal; font-size: 7pt;">' . $txt['statuses_delete'] . '</a>' : '') . '
<hr />
<div style="width: 400px; height: 60px; overflow: auto;">' . $context['replies'][$i]['reply'] . '</div>
</td>
</tr>';
} else {
echo '
<tr>
<td class="windowbg" style="max-width: 300px; max-height: 300px;">
<a href="' . $scripturl . '?action=profile;u=' . $context['replies'][$i]['member_id'] . ';">' . $context['replies'][$i]['name'] . '</a> - ' . $context['replies'][$i]['date'] . ' ' . ($context['user']['is_owner'] || allowedTo('profile_extra_any') ? '<a href="' . $scripturl . '?action=profile;area=deletereply;reply=' . $context['replies'][$i]['reply_id'] . ';sesc=' . $context['session_id'] . '" style="font-weight: normal; font-size: 7pt;">' . $txt['statuses_delete'] . '</a>' : '') . '
<hr />
<div style="width: 300px; height: 40px; overflow: auto;">' . $context['replies'][$i]['reply'] . '</div>
</td>
</tr>';
}
}
}

echo '
</tr>
<tr class="catbg">
<th>&nbsp;</th>
</tr>

<tr>
<td id="profile_statuses_replybox' . $context['statuses']['status_id'] . '" class="windowbg"></td>
</tr>
</table>
</dd>
</dl>';

echo '
</div>
<span class="botslice"><span></span></span>
</div>
</div>';

echo '<div class="clear"></div>
</div>';
}


Find (./Sources/Load.php):
'aim' => $profile['aim'] != '' && (empty($modSettings['guest_hideContacts']) || !$user_info['is_guest']) ? array(
'name' => $profile['aim'],
'href' => 'aim:goim?screenname=' . urlencode(strtr($profile['aim'], array(' ' => '%20'))) . '&amp;message=' . $txt['aim_default_message'],
'link' => '<a class="aim" href="aim:goim?screenname=' . urlencode(strtr($profile['aim'], array(' ' => '%20'))) . '&amp;message=' . $txt['aim_default_message'] . '" title="' . $txt['aim_title'] . ' - ' . $profile['aim'] . '"><img src="' . $settings['images_url'] . '/aim.gif" alt="' . $txt['aim_title'] . ' - ' . $profile['aim'] . '" /></a>',
'link_text' => '<a class="aim" href="aim:goim?screenname=' . urlencode(strtr($profile['aim'], array(' ' => '%20'))) . '&amp;message=' . $txt['aim_default_message'] . '" title="' . $txt['aim_title'] . ' - ' . $profile['aim'] . '">' . $profile['aim'] . '</a>'
) : array('name' => '', 'href' => '', 'link' => '', 'link_text' => ''),


Add before:

'profilestatuses' => $profile['profilestatuses'] != '' && (!$user_info['is_guest']) ? array(
'name' => $txt['profile_statuses'],
'enabled' => $profile['profilestatuses']
) : array('name' => '', 'enabled' => ''),

PortaMx is probably the best SMF portal!

ascaland

Give the attatched below a try.

agent47

I'm gonna try it now buddy.. Please stick around.

PortaMx is probably the best SMF portal!

agent47

Doesn't work man....even after enabling it from admin pane and forum profile.

PortaMx is probably the best SMF portal!

ascaland

Quote from: agent47 on March 12, 2011, 08:02:36 PM
Doesn't work man....even after enabling it from admin pane and forum profile.

Can I have a link to your forum?

agent47


PortaMx is probably the best SMF portal!

ascaland

Looks like this mod just isnt compatible with the Ultimate Profile mod. To get this to work you would obviously have to disable Ultimate Profile... But give me a week or two and I will update this so it can work properly with UP installed.

But im not sure why the edits I gave you wouldnt work...

Xarcell

Quote from: Project Evolution on March 13, 2011, 12:10:04 PM
Looks like this mod just isnt compatible with the Ultimate Profile mod. To get this to work you would obviously have to disable Ultimate Profile... But give me a week or two and I will update this so it can work properly with UP installed.

But im not sure why the edits I gave you wouldnt work...

I'll most likely use this mod once it's compatible with UP.

Rain Forest

Nice mod! I will use it! :)

Somehow, this mod is not comtable with the Member Color Link



Name should me orange. How to fix? :)

ascaland

Cool, thanks for giving me the heads up. I will be sure to include that in the next version of Profile Statuses. :)

As for a quick fix, give me some time today to get you one. Im a little short on time. :P

Rain Forest

Ok :)

Btw, smileys should be enabled in the next version! :)

ascaland

#32
Im going to see if I could get the SMF editor in there as well. :)

fdr77

News regard compatibility with the Ultimate Profile mod

ascaland

Currently working on that for version 1.2. Just finishing up integrating that SMF editor.

fdr77


ascaland

Finally Profile Statuses has reached version 2! The update includes compatibility with the Ultimate Profile modification and now uses SMF's editor as opposed to a simple textarea and filters out certain BB codes.

OCJ

I just set up the latest version on smf5 and getting the 'resolved' error.
status is too short and all data is lost going back to input.



ascaland

#38
Quote from: igirisjin on March 24, 2011, 11:28:22 PM
I just set up the latest version on smf5 and getting the 'resolved' error.
status is too short and all data is lost going back to input.

Are you using Ultimate Profile? Are the statuses/replies your sending more than 4 characters in length?

I tested this fine on a blank RC5 forum and im having no problems. Anyone else having this problem?

OCJ

#39
no portal ... the statuses were varying lengths but 3 characters or 100 characters gives the same 'too short' message.

Display statuses per page - set to '0'
Set max length of messages 200

Advertisement: