Advertisement:

Author Topic: IM Box Full - Bar Level  (Read 41567 times)

Offline FaSan

  • Sophist Member
  • *****
  • Posts: 1,053
  • Gender: Male
  • http://www.smitaly.net
    • SMitaly - Supporto a SMF
IM Box Full - Bar Level
« on: January 20, 2005, 12:12:14 PM »
If you want a bar level for see the status of your IM Box, add this :


InstantMessage.php


Code: [Select]
<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

Code: [Select]
<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.


« Last Edit: January 20, 2005, 12:17:43 PM by FaSan »

Offline mytreo

  • Jr. Member
  • **
  • Posts: 284
    • treo
Re: IM Box Full - Bar Level
« Reply #1 on: January 20, 2005, 12:22:06 PM »
Nice1 Fasan :)
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

Offline edi67

  • SMF Hero
  • ******
  • Posts: 1,532
  • Gender: Male
  • Italian Supporter
    • CrazyZone
Re: IM Box Full - Bar Level
« Reply #2 on: January 20, 2005, 12:47:27 PM »
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

Offline FaSan

  • Sophist Member
  • *****
  • Posts: 1,053
  • Gender: Male
  • http://www.smitaly.net
    • SMitaly - Supporto a SMF
Re: IM Box Full - Bar Level
« Reply #3 on: January 20, 2005, 01:07:31 PM »
Unlimited if is it your membergroup settings ;)

Offline edi67

  • SMF Hero
  • ******
  • Posts: 1,532
  • Gender: Male
  • Italian Supporter
    • CrazyZone
Re: IM Box Full - Bar Level
« Reply #4 on: January 20, 2005, 01:12:38 PM »
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

Offline FaSan

  • Sophist Member
  • *****
  • Posts: 1,053
  • Gender: Male
  • http://www.smitaly.net
    • SMitaly - Supporto a SMF
Re: IM Box Full - Bar Level
« Reply #5 on: January 20, 2005, 01:24:53 PM »
Uhmm... i think five messages is to much little... set at 10 for minimal ;)
« Last Edit: January 20, 2005, 01:26:29 PM by FaSan »

Offline Owdy

  • SMF Fossil
  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,590
  • Gender: Male
  • W00t!
    • janoloferiksson on LinkedIn
    • @@jaoler on Twitter
Re: IM Box Full - Bar Level
« Reply #6 on: January 20, 2005, 01:25:36 PM »
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

Offline FaSan

  • Sophist Member
  • *****
  • Posts: 1,053
  • Gender: Male
  • http://www.smitaly.net
    • SMitaly - Supporto a SMF
Re: IM Box Full - Bar Level
« Reply #7 on: January 20, 2005, 01:30:24 PM »
all my users have it ... :( to user with only 5 message as limit


Change it :

Code: [Select]
$bar_fill = (int) $bar;

in

Code: [Select]
$bar_fill = (int) $bar;

if (!$bar_fill)
    $bar_fill = 1;



FaSan

Offline Owdy

  • SMF Fossil
  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,590
  • Gender: Male
  • W00t!
    • janoloferiksson on LinkedIn
    • @@jaoler on Twitter
Re: IM Box Full - Bar Level
« Reply #8 on: January 20, 2005, 05:26:47 PM »
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

Offline edi67

  • SMF Hero
  • ******
  • Posts: 1,532
  • Gender: Male
  • Italian Supporter
    • CrazyZone
Re: IM Box Full - Bar Level
« Reply #9 on: January 21, 2005, 12:38:24 AM »
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

Offline Alisha

  • Jr. Member
  • **
  • Posts: 313
  • Gender: Female
    • Dance Dance Kc
Re: IM Box Full - Bar Level
« Reply #10 on: January 21, 2005, 01:21:54 AM »
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??

Offline FaSan

  • Sophist Member
  • *****
  • Posts: 1,053
  • Gender: Male
  • http://www.smitaly.net
    • SMitaly - Supporto a SMF
Re: IM Box Full - Bar Level
« Reply #11 on: January 21, 2005, 10:20:12 AM »
Look the code. I' ve add this :

global $im_bar, $settings;

and this :

global $im_bar;


;)

Offline edi67

  • SMF Hero
  • ******
  • Posts: 1,532
  • Gender: Male
  • Italian Supporter
    • CrazyZone
Re: IM Box Full - Bar Level
« Reply #12 on: January 21, 2005, 10:28:36 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

Offline Bullcat Webhosting

  • Sophist Member
  • *****
  • Posts: 1,245
  • Gender: Male
  • Ooit was ik programeur, nu gelukkig weer hobby'ist
    • Bullcat Webhosting
Re: IM Box Full - Bar Level
« Reply #13 on: January 21, 2005, 10:37:12 AM »
Fasan i still have the same error "'Unlimited Space'" and i just install it now :(


Wij ondersteunen SMF forums & safe mode staat uit.

Offline edi67

  • SMF Hero
  • ******
  • Posts: 1,532
  • Gender: Male
  • Italian Supporter
    • CrazyZone
Re: IM Box Full - Bar Level
« Reply #14 on: January 21, 2005, 10:43:22 AM »
another thing after installation LOG ERRORS begin full of this errors for all members:

Code: [Select]
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

Offline Bullcat Webhosting

  • Sophist Member
  • *****
  • Posts: 1,245
  • Gender: Male
  • Ooit was ik programeur, nu gelukkig weer hobby'ist
    • Bullcat Webhosting
Re: IM Box Full - Bar Level
« Reply #15 on: January 21, 2005, 10:49:20 AM »
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.

Offline FaSan

  • Sophist Member
  • *****
  • Posts: 1,053
  • Gender: Male
  • http://www.smitaly.net
    • SMitaly - Supporto a SMF
Re: IM Box Full - Bar Level
« Reply #16 on: January 21, 2005, 10:53:12 AM »
Ehmm....  :-\ :-\ :-\


Excuse me... i don't remeber :D

Uhmm on this ? http://www.simplemachines.org/community/index.php?topic=17277.msg183514#msg183514


 >:( >:( >:(



Offline FaSan

  • Sophist Member
  • *****
  • Posts: 1,053
  • Gender: Male
  • http://www.smitaly.net
    • SMitaly - Supporto a SMF
Re: IM Box Full - Bar Level
« Reply #17 on: January 21, 2005, 10:55:08 AM »

Offline Bullcat Webhosting

  • Sophist Member
  • *****
  • Posts: 1,245
  • Gender: Male
  • Ooit was ik programeur, nu gelukkig weer hobby'ist
    • Bullcat Webhosting
Re: IM Box Full - Bar Level
« Reply #18 on: January 21, 2005, 12:33:54 PM »
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"
Code: [Select]
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 !

Code: [Select]
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.

Offline Bullcat Webhosting

  • Sophist Member
  • *****
  • Posts: 1,245
  • Gender: Male
  • Ooit was ik programeur, nu gelukkig weer hobby'ist
    • Bullcat Webhosting
Re: IM Box Full - Bar Level
« Reply #19 on: January 21, 2005, 12:39:45 PM »
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.