News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

nneonneo's Shoutbox

Started by nneonneo, December 26, 2006, 06:58:11 PM

Previous topic - Next topic

tlen

nneonneo, post above you've done this


if(empty($_REQUEST['action']) && empty($context['current_board']) && empty($context['current_topic']))


In order to enable (and completely hide elsewhere) the Shout only on the "Home" button.

Now i would extend this to Guest too.

In other words, a Guest doesn't view completely the shoutbox (identical to the behaviour posted above), both logged or not, and not even able to see the "You must be logged" or the "Shoutbox" title.

How do i do?

Thanks

nneonneo

Right after
}
// Otherwise they're a guest - this time ask them to either register or login - lazy bums...
else
{

in index.template.php is a block of shoutbox code (between // YSHOUT HERE and // YSHOUT END). Remove that whole block, and the shoutbox will become invisible to guests.

Also, set allowGuests to false in yshout/yshout.php, to avoid having people use an old or cached version of the page to access yshout.
Check out the AJAX Shoutbox (my one and only mod to date :P)
Do you like SMF? Are you using ProBoards, InvisionFree, ActiveBoards or some other web-hosted forum? I can help you convert to SMF (without having to purchase a DB conversion)...contact me [nneonneo {at} gmail *dot* com], and see this topic
spammers here!

NEMINI

#1182
thank you nneo.  now to move it to a TP block.  Now its working in a TP block too :D
signatures are boring.

NEMINI

Quote from: pongsak on August 18, 2007, 11:10:08 PM


4. Search after in index.template.php or boardindex.template.php depend on where u put shout box.

<div style="padding: 1ex 25px 1ex 25px;"id="yshout"', empty($options['collapse_header']) ? '>' : ' style="display: none;">',$txt['yshout_loading'],'<br /><br /></div>

   add

<div class="smalltext" style="padding-left:25px;"><a href="javascript:collapse1.slidedown()">Open Smiley</a> | <a href="javascript:collapse1.slideup()">Close</a>';
require('mymod/smiley.php');
loadSmileys();
echo '
<div id="smiley_pic">';
printSmileys('shout_form','shout_text');
echo '
</div>
<script type="text/javascript">
//Syntax: var uniquevar=new animatedcollapse("DIV_id", animatetime_milisec, enablepersist(true/fase), [initialstate] )
var collapse1=new animatedcollapse("smiley_pic", 1000, false)
</script>
</div>





How would we add a smiley bar if we're using this shoutbox in a TP block?  that code has been removed.
signatures are boring.

tlen

Quoteand the shoutbox will become invisible to guests
It works good. Thanks.

Now, i do i hide the input box containing the username (and the username itself inside it) occupying this additional space with the input text shoutbox?

Tks

pongsak

I don't sure there's some bugs.
When i pressed extended history, it shows dialog box
how many lines i want and ok and cancel.
If i press cancel it still go to shout history instead of cancel
dialog box.
smf 1.1.2 with dilbermc themes.
> 50 mods installed.

kichu

How to Display Membergroup colour in ShoutBox

nneonneo

#1187
@kichu: Sarke told you how: http://www.simplemachines.org/community/index.php?topic=137508.msg996336;topicseen#msg996336

Updated instructions for 1.10:
Replace
$p_class = "";

if($user['is_admin']) $p_class = ' class="owner"';
if($user['is_mod']) $p_class = ' class="moderator"';
if(!$user['is_logged']) $p_class = ' class="guest"';
$shoutName=$user['name'];
$userID=$user['id'];
$writeText="<p$p_class><em title=\"".time()." | $ip\"><span class=\"shout-timestamp\">[<timeval=".time().">]</span> ";
if($user['is_logged'])
$writeText.="<a href=\"index.php?action=profile;u=$userID\">$shoutName</a>";
else
$writeText.="$shoutName";

with
$p_class = "";

    global $user_profile;
    loadMemberData(array($user['id']));
    if (!empty($user_profile[$user['id']]['member_group_color']))
       $color = ' style="color: ' . $user_profile[$user['id']]['member_group_color'] . '"';
    elseif (!empty($user_profile[$user['id']]['post_group_color']))
       $color = ' style="color: ' . $user_profile[$user['id']]['post_group_color'] . '"';
    else
       $color = '';
if(!$user['is_logged']) $p_class = ' class="guest"';
$shoutName=$user['name'];
$userID=$user['id'];
$writeText="<p$p_class><em title=\"".time()." | $ip\"><span class=\"shout-timestamp\">[<timeval=".time().">]</span> ";
if($user['is_logged'])
$writeText.="<a href=\"index.php?action=profile;u=$userID\"><span$color>$shoutName</span></a>";
else
$writeText.="$shoutName";

@pongsak: Indeed a bug. Change the line with 'yshout_exthistory' on it to
echo '&nbsp;<a href="javascript:history_number=prompt(\'How far back?\',200);if(history_number){goTo(\'file=',checkName($chatFile),'&amp;history&amp;n=\'+history_number)}else{void(0)}">',$txt['yshout_exthistory'],'</a>';
and it will properly show. This will be fixed in an upcoming release.

@NEMINI: The TP block currently looks like
echo '<div id="yshout"></div>';
Add pongsak's code right before the '; and it should work, since it's a phpbox.

@tlen: Delete every line in yshout/yshout.php starting with
<input id="forum-name" style="color: #666666;" .
Check out the AJAX Shoutbox (my one and only mod to date :P)
Do you like SMF? Are you using ProBoards, InvisionFree, ActiveBoards or some other web-hosted forum? I can help you convert to SMF (without having to purchase a DB conversion)...contact me [nneonneo {at} gmail *dot* com], and see this topic
spammers here!

kichu

You Rock nneonneo :x thanks its working

NEMINI

thanks nneonneo that works.

One more question then I will stop being a pest.  Is there a setting to change to stop the shoutbox from auto hiding/shrinking.  ie: I want the last 10 shouts to always show.
signatures are boring.

nneonneo

Auto hiding? Hmm? It _should_ work, unless there is a bug with the auto-refresh.

If the shoutbox disappears every ~15 to 20 seconds, but only reappear after you shout, change $updateTimeout in yshout/yshout.php to 10.
Check out the AJAX Shoutbox (my one and only mod to date :P)
Do you like SMF? Are you using ProBoards, InvisionFree, ActiveBoards or some other web-hosted forum? I can help you convert to SMF (without having to purchase a DB conversion)...contact me [nneonneo {at} gmail *dot* com], and see this topic
spammers here!

NEMINI

#1191
Quote from: nneonneo on October 18, 2007, 09:10:09 PM
If the shoutbox disappears every ~15 to 20 seconds, but only reappear after you shout, change $updateTimeout in yshout/yshout.php to 10.

yes thats what its doing.  I will try your suggestion and let you know. it works.  thanks again.

Apparently I lied ... I have another question to ask.  Is there a way to add a command that will erase the history file? /clear empties the shoutbox but I'd like an easier way to erase the history as well. (it's easy for me to truncate the file on the server but my staff don't have access to the server).
signatures are boring.

kichu

for adding smileys bar... where i have to download smiley.php ??

can u please tell me nneo

NEMINI

signatures are boring.

nneonneo

@NEMINI: To add that function, place this somewhere (probably before
case "/clear":
) in processAdminCommand:
case "/clearhist":
$handle = fopen("$logDir/history.$chatFile", "w+");
fputs($handle, "");
fclose($handle);
return true;

then use /clearhist to clear out all the history (this isn't undoable, so use with caution!)
Check out the AJAX Shoutbox (my one and only mod to date :P)
Do you like SMF? Are you using ProBoards, InvisionFree, ActiveBoards or some other web-hosted forum? I can help you convert to SMF (without having to purchase a DB conversion)...contact me [nneonneo {at} gmail *dot* com], and see this topic
spammers here!

NEMINI

I suppose I can just edit the language file to add the command instructions to it.  many thanks again.
signatures are boring.

NEMINI

Any plans to add the ability to edit an existing shout? Would be useful to fix typos and such.
signatures are boring.

kichu

Hey nneonneo am using smiley bar, but when i click on smiley it is not working.. i mean the shout code not inserting to shout text

nneonneo

@NEMINI: Yes, editing the language file is the "preferred" way to create command docs. As for a shout editing function, I don't see that being implemented too soon. If you are having a conversation via the shoutbox, it is typically not useful to retroactively edit an existing shout; probably better to say "I meant xxx" or something along those lines. Or, if not having a conversation, then you can delete and repost the message.

@kichu: I'm going to have to have a look at the forum, since I'm not an expert on the smiley code.
Check out the AJAX Shoutbox (my one and only mod to date :P)
Do you like SMF? Are you using ProBoards, InvisionFree, ActiveBoards or some other web-hosted forum? I can help you convert to SMF (without having to purchase a DB conversion)...contact me [nneonneo {at} gmail *dot* com], and see this topic
spammers here!

tlen

#1199
Quote@tlen: Delete every line in yshout/yshout.php starting with

Code:
<input id="forum-name" style="color: #666666;"

nneonneo, deleting entirely the line, the ShoutBox hangs on loading because (i think) the form array lenght is modified. But setting <type> to "hidden", it works good. Thanks btw.

Another thing, how do i do to show just the Hour,minutes and not even the date? But doing it so that the shoutbox clock doesn't depend on the forum clock/date setting?

Thanks

Advertisement: