Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Thema gestartet von: FaSan in Januar 20, 2005, 12:12:14 NACHMITTAGS

Titel: IM Box Full - Bar Level
Beitrag von: FaSan in Januar 20, 2005, 12:12:14 NACHMITTAGS
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.


Titel: Re: IM Box Full - Bar Level
Beitrag von: mytreo in Januar 20, 2005, 12:22:06 NACHMITTAGS
Nice1 Fasan :)
Titel: Re: IM Box Full - Bar Level
Beitrag von: edi67 in Januar 20, 2005, 12:47:27 NACHMITTAGS
i wrote it but return me back

Unlimited Space of message for gropu user where i have 60 message for example
Titel: Re: IM Box Full - Bar Level
Beitrag von: FaSan in Januar 20, 2005, 01:07:31 NACHMITTAGS
Unlimited if is it your membergroup settings ;)
Titel: Re: IM Box Full - Bar Level
Beitrag von: edi67 in Januar 20, 2005, 01:12:38 NACHMITTAGS
all my users have it ... :( to user with only 5 message as limit
Titel: Re: IM Box Full - Bar Level
Beitrag von: FaSan in Januar 20, 2005, 01:24:53 NACHMITTAGS
Uhmm... i think five messages is to much little... set at 10 for minimal ;)
Titel: Re: IM Box Full - Bar Level
Beitrag von: Owdy in Januar 20, 2005, 01:25:36 NACHMITTAGS
Nice tip Fasan. You should make a MOD!
Titel: Re: IM Box Full - Bar Level
Beitrag von: FaSan in Januar 20, 2005, 01:30:24 NACHMITTAGS
Zitat von: edi67 in Januar 20, 2005, 01:12:38 NACHMITTAGS
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
Titel: Re: IM Box Full - Bar Level
Beitrag von: Owdy in Januar 20, 2005, 05:26:47 NACHMITTAGS
This isnt working, my all members see 'Unlimited Space'. Limit is 50.
Titel: Re: IM Box Full - Bar Level
Beitrag von: edi67 in Januar 21, 2005, 12:38:24 VORMITTAG
Zitat von: Owdy in Januar 20, 2005, 05:26:47 NACHMITTAGS
This isnt working, my all members see 'Unlimited Space'. Limit is 50.

we have the same error
Titel: Re: IM Box Full - Bar Level
Beitrag von: Alisha in Januar 21, 2005, 01:21:54 VORMITTAG
Zitat von: edi67 in Januar 21, 2005, 12:38:24 VORMITTAG
Zitat von: Owdy in Januar 20, 2005, 05:26:47 NACHMITTAGS
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??
Titel: Re: IM Box Full - Bar Level
Beitrag von: FaSan in Januar 21, 2005, 10:20:12 VORMITTAG
Look the code. I' ve add this :

global $im_bar, $settings;

and this :

global $im_bar;


;)
Titel: Re: IM Box Full - Bar Level
Beitrag von: edi67 in Januar 21, 2005, 10:28:36 VORMITTAG
Zitat von: FaSan in Januar 21, 2005, 10:20:12 VORMITTAG
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
Titel: Re: IM Box Full - Bar Level
Beitrag von: Bullcat Webhosting in Januar 21, 2005, 10:37:12 VORMITTAG
Fasan i still have the same error "'Unlimited Space'" and i just install it now :(
Titel: Re: IM Box Full - Bar Level
Beitrag von: edi67 in Januar 21, 2005, 10:43:22 VORMITTAG
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
Titel: Re: IM Box Full - Bar Level
Beitrag von: Bullcat Webhosting in Januar 21, 2005, 10:49:20 VORMITTAG
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'] ??
Titel: Re: IM Box Full - Bar Level
Beitrag von: FaSan in Januar 21, 2005, 10:53:12 VORMITTAG
Ehmm....  :-\ :-\ :-\


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

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


>:( >:( >:(


Titel: Re: IM Box Full - Bar Level
Beitrag von: FaSan in Januar 21, 2005, 10:55:08 VORMITTAG
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.ilmalocchio.net%2Fcommunity%2FSmileys%2Fmalocchio%2Fbanghead.gif&hash=65007b25b3d966b180750d3e10a478999b3e55a6) (https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.ilmalocchio.net%2Fcommunity%2FSmileys%2Fmalocchio%2Fbanghead.gif&hash=65007b25b3d966b180750d3e10a478999b3e55a6) (https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.ilmalocchio.net%2Fcommunity%2FSmileys%2Fmalocchio%2Fbanghead.gif&hash=65007b25b3d966b180750d3e10a478999b3e55a6) (https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.ilmalocchio.net%2Fcommunity%2FSmileys%2Fmalocchio%2Fbanghead.gif&hash=65007b25b3d966b180750d3e10a478999b3e55a6) (https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.ilmalocchio.net%2Fcommunity%2FSmileys%2Fmalocchio%2Fbanghead.gif&hash=65007b25b3d966b180750d3e10a478999b3e55a6) (https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.ilmalocchio.net%2Fcommunity%2FSmileys%2Fmalocchio%2Fbanghead.gif&hash=65007b25b3d966b180750d3e10a478999b3e55a6)
Titel: Re: IM Box Full - Bar Level
Beitrag von: Bullcat Webhosting in Januar 21, 2005, 12:33:54 NACHMITTAGS
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>';


Titel: Re: IM Box Full - Bar Level
Beitrag von: Bullcat Webhosting in Januar 21, 2005, 12:39:45 NACHMITTAGS
Woeps ther is know controll about the messages, i can send 6/5 messages :( ?? how i fix that ?
Titel: Re: IM Box Full - Bar Level
Beitrag von: FaSan in Januar 21, 2005, 01:21:49 NACHMITTAGS
Ok... i making the work mod and post it, in the next days.

Please, coming soon :D ;)
Titel: Re: IM Box Full - Bar Level
Beitrag von: Bullcat Webhosting in Januar 21, 2005, 01:28:26 NACHMITTAGS
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
Titel: Re: IM Box Full - Bar Level
Beitrag von: Zenigata in Dezember 19, 2005, 05:42:50 NACHMITTAGS
It doesn't work to me. :(
Titel: Re: IM Box Full - Bar Level
Beitrag von: Owdy in Dezember 19, 2005, 11:06:15 NACHMITTAGS
Use smf 1.1. Its built in feature in it.
Titel: Re: IM Box Full - Bar Level
Beitrag von: Zenigata in Dezember 20, 2005, 04:56:09 VORMITTAG
Zitat von: Owdy in Dezember 19, 2005, 11:06:15 NACHMITTAGS
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
Titel: Re: IM Box Full - Bar Level
Beitrag von: geezmo in August 03, 2006, 03:15:56 VORMITTAG
Anything like this that works for 1.1RC2?
Titel: Re: IM Box Full - Bar Level
Beitrag von: Owdy in August 03, 2006, 03:28:10 VORMITTAG

Zitat von: geezmo in August 03, 2006, 03:15:56 VORMITTAG
Anything like this that works for 1.1RC2?

Zitat von: Owdy in Dezember 19, 2005, 11:06:15 NACHMITTAGS
Use smf 1.1. Its built in feature in it.
Titel: Re: IM Box Full - Bar Level
Beitrag von: geezmo in August 03, 2006, 03:39:34 VORMITTAG
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.
Titel: Re: IM Box Full - Bar Level
Beitrag von: Owdy in August 03, 2006, 03:56:19 VORMITTAG
No, 1.1 RC2
http://www.simplemachines.org/community/index.php?topic=17277.msg667246#msg667246