News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

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.

FaSan

Ok... i making the work mod and post it, in the next days.

Please, coming soon :D ;)

Bullcat Webhosting

I hope it's also have the restriction's activate ? so when a user have is imbox or outbox full he can't send any massage ?? :) Please :D :D


Wij ondersteunen SMF forums & safe mode staat uit.

Zenigata


Owdy

Use smf 1.1. Its built in feature in it.
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

Zenigata

#24
Quote from: Owdy on December 19, 2005, 11:06:15 PM
Use smf 1.1. Its built in feature in it.

SMF 1.1 is not stable yet, also I use a custom theme I can't port to 1.1.

edit: it works! I've added this: http://www.simplemachines.org/community/index.php?topic=17277.msg183514#msg183514

geezmo

Anything like this that works for 1.1RC2?

Owdy

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

geezmo

You're referring to 1.1 Beta version right? I can't use that because most if not all of the mods currently installed in my forum won't work with the beta. That's why I'm looking for a mod or codes to have this in 1.1 RC2.

Owdy

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

Advertisement: