News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

IM Box Full - Bar Level

Started by FaSan, January 20, 2005, 12:12:14 PM

Previous topic - Next topic

FaSan

If you want a bar level for see the status of your IM Box, add this :


InstantMessage.php



<search>
// A folder, ie. outbox/inbox.
function MessageFolder()
{
global $txt, $scripturl, $db_prefix, $ID_MEMBER, $modSettings, $context;
</search>

<add after>
global $im_bar, $settings;
</add after>


<search>
$context['page_title'] = $txt[143];
</search>

<add after>
if (!$user_info['maxMessages'])
$im_bar = '<img src="' . $settings['images_url'] . '/bar_up.gif" width="106" height="5"><br><img src="' . $settings['images_url'] . '/bar_full.gif" width="106" height="11"><br><img src="' . $settings['images_url'] . '/bar_down.gif" width="106" height="5"><br><font color="red">Unlimited Space</font>';
else
if ($user_info['maxMessages'] - $max_messages != 0)
{
$bar = (($max_messages * 10) / ($user_info['maxMessages'] / 10));
$bar_fill = (int) $bar;
$bar_empty = $user_info['maxMessages'];
$bar_f = '<img src="' . $settings['images_url'] . '/bar_fill.gif" width="' . $bar_fill . '" height="11">';
$bar_empty = '<img src="' . $settings['images_url'] . '/bar_empty.gif" width="' . $bar_empty . '" height="11">';

$bar_fill = '<img src="' . $settings['images_url'] . '/bar_fill.gif" width="' . $bar_fill . '" height="11">';
$im_bar = '
<table width="110" cellpadding="0" cellspacing="0" border="0">
<tr><td align="left"><img src="' . $settings['images_url'] . '/bar_up.gif" width="106" height="5"></td></tr>
<tr><td align="left"><img src="' . $settings['images_url'] . '/bar_left.gif" width="3" height="11">' . $bar_f . '<img src="' . $settings['images_url'] . '/bar_right.gif" width="3" height="11">' . $bar_empty . '</td></tr>
<tr><td align="left"><img src="' . $settings['images_url'] . '/bar_down.gif" width="106" height="5"></td></tr>
<tr><td width="110" align="center"><font color="red">' . $max_messages . ' / ' . $user_info['maxMessages'] . '</font></td></tr>
</table>';
}
else
$im_bar = '<img src="' . $settings['images_url'] . '/bar_up.gif" width="106" height="5"><br><img src="' . $settings['images_url'] . '/bar_full.gif" width="106" height="11"><br><img src="' . $settings['images_url'] . '/bar_down.gif" width="106" height="5"><br><font color="red">Full Box !</font>';

</add after>



InstantMessage.template.php


<search>
// Version: 1.0; InstantMessage

function template_folder()
{
global $context, $settings, $options, $scripturl, $modSettings, $txt;
</search>

<add after>
global $im_bar;
</add after>

<search>
echo '
<tr>
<td colspan="5" class="catbg" height="25">
<table width="100%" cellpadding="2" cellspacing="0" border="0"><tr>
<td><b>', $txt[139], ':</b> ', $context['page_index'], '</td>
<td align="right"><input type="submit" value="', $txt['quickmod_delete_selected'], '" style="font-weight: normal;" /></td>
</tr></table>
</search>

<add after>
<div align="center">' . $im_bar . '</div>
</add after>




WARNING : This Tip use "Bar of Experience" Images. If you not have this mod installed, please download it and insert the images on yours folder.



mytreo

Treo forum - Powered by SMF, of course
Treo news - powered by MovableType and integrated with SMF
Treo downloads - hacked from phpNuke and integrated with SMF
Treo knowledge base - powered by Wikka and integrated with SMF
Treo 650 | Treo 700w | Treo 700p

edi67

i wrote it but return me back

Unlimited Space of message for gropu user where i have 60 message for example
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

FaSan

Unlimited if is it your membergroup settings ;)

edi67

all my users have it ... :( to user with only 5 message as limit
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

FaSan

#5
Uhmm... i think five messages is to much little... set at 10 for minimal ;)

Owdy

Nice tip Fasan. You should make a MOD!
Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

FaSan

Quote from: edi67 on January 20, 2005, 01:12:38 PM
all my users have it ... :( to user with only 5 message as limit


Change it :


$bar_fill = (int) $bar;


in


$bar_fill = (int) $bar;

if (!$bar_fill)
    $bar_fill = 1;




FaSan

Owdy

This isnt working, my all members see 'Unlimited Space'. Limit is 50.
Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

edi67

Quote from: Owdy on January 20, 2005, 05:26:47 PM
This isnt working, my all members see 'Unlimited Space'. Limit is 50.

we have the same error
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

Alisha

Quote from: edi67 on January 21, 2005, 12:38:24 AM
Quote from: Owdy on January 20, 2005, 05:26:47 PM
This isnt working, my all members see 'Unlimited Space'. Limit is 50.

we have the same error

As do I... Any fix for this yet??

FaSan

Look the code. I' ve add this :

global $im_bar, $settings;

and this :

global $im_bar;


;)

edi67

Quote from: FaSan on January 21, 2005, 10:20:12 AM
Look the code. I' ve add this :

global $im_bar, $settings;

and this :

global $im_bar;


;)

exactly copied but the same errors all user have UNLIMITED messages
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

Bullcat Webhosting

Fasan i still have the same error "'Unlimited Space'" and i just install it now :(


Wij ondersteunen SMF forums & safe mode staat uit.

edi67

another thing after installation LOG ERRORS begin full of this errors for all members:

8: Undefined index: maxMessages
File: /home/forumzo7/public_html/Sources/InstantMessage.php
Linea: 232


may be something lost for example variable maxMessages
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

Bullcat Webhosting

Fasan, where do you find the global user_info['maxMessages'] in your source ik can't find it in the sources ?? is it not user_info['messages'] ??


Wij ondersteunen SMF forums & safe mode staat uit.

FaSan


FaSan


Bullcat Webhosting

Hello Fasan wil you control the next code, i have it working i think ??  If you like it, i put it in a Mod file ?? ( yes i know it of smf 1.1 ! )

i have add the next global in "InstantMessage.php"

global  $bar_Pmlevel;
$bar_Pmlevel = 5 ; //later in a mod i change it for a Modsetting !


and i fix the bar itself take look at the code !


if (!$user_info['messages'])
$im_bar = '<img src="' . $settings['images_url'] . '/bar_up.gif" width="106" height="5"><br><img src="' . $settings['images_url'] . '/bar_full.gif" width="106" height="11"><br><img src="' . $settings['images_url'] . '/bar_down.gif" width="106" height="5"><br><font color="red">Unlimited Space</font>';
else
if ($user_info['messages'] - $bar_Pmlevel != 0)
{
$bar1 = ( $bar_Pmlevel / $user_info['messages'] );
$bar = ( 100 / $bar1 );
// $bar = (($user_info['messages'] * 10) / ($user_info['messages'] / 10 ));

echo $bar;
$bar_fill = (int) $bar;
$bar_empty = $user_info['messages'];
$bar_f = '<img src="' . $settings['images_url'] . '/bar_fill.gif" width="' . $bar_fill . '" height="11">';
$bar_empty = '<img src="' . $settings['images_url'] . '/bar_empty.gif" width="' . $bar_empty . '" height="11">';

$bar_fill = '<img src="' . $settings['images_url'] . '/bar_fill.gif" width="' . $bar_fill . '" height="11">';
$im_bar = '
<table width="110" cellpadding="0" cellspacing="0" border="0">
<tr><td align="left"><img src="' . $settings['images_url'] . '/bar_up.gif" width="106" height="5"></td></tr>
<tr><td align="left"><img src="' . $settings['images_url'] . '/bar_left.gif" width="3" height="11">' . $bar_f . '<img src="' . $settings['images_url'] . '/bar_right.gif" width="3" height="11">' . $bar_empty . '</td></tr>
<tr><td align="left"><img src="' . $settings['images_url'] . '/bar_down.gif" width="106" height="5"></td></tr>
<tr><td width="110" align="center"><font color="red"> ' . $user_info['messages'] . ' / ' . $bar_Pmlevel . '</font></td></tr>
</table>';
}
else
$im_bar = '<p>12</p><img src="' . $settings['images_url'] . '/bar_up.gif" width="106" height="5"><br><img src="' . $settings['images_url'] . '/bar_full.gif" width="106" height="11"><br><img src="' . $settings['images_url'] . '/bar_down.gif" width="106" height="5"><br><font color="red">Full Box !</font>';




Wij ondersteunen SMF forums & safe mode staat uit.

Bullcat Webhosting

Woeps ther is know controll about the messages, i can send 6/5 messages :( ?? how i fix that ?


Wij ondersteunen SMF forums & safe mode staat uit.

Advertisement: