collapse

* User Info

 
 
Welcome, Guest. Please login or register.
Did you miss your activation email?

* Who's Online

  • Dot Guests: 146
  • Dot Hidden: 0
  • Dot Users: 2
  • Dot Users Online:

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • Jade Elizabeth: It's GREAT to see you too Sinan!! :D
    July 06, 2016, 02:33:26 am
  • [SiNaN]: Hey Jade! It's great to see you around! Jade!
    July 03, 2016, 06:51:31 am
  • Jade Elizabeth: Oops, sorry I mean HEY SINAN! ;)
    July 01, 2016, 11:07:13 am
  • Jade Elizabeth: Hey Sinan!! :D
    July 01, 2016, 11:06:59 am
  • [SiNaN]: But you shouldn't wait for a security issue and drop by more often. :D
    June 27, 2016, 04:32:18 pm
  • [SiNaN]: Hey ディン1031! It's great to see you around!
    June 27, 2016, 04:31:56 pm
  • ディン1031: Uh to long ago that i was last time here xD
    June 27, 2016, 02:03:08 pm
  • Schnuffeltier: :D
    June 24, 2016, 05:22:34 am
  • Jade Elizabeth: SHOUTBOX IS FOR SHOUTING AAAAAAHHHHHHHHHHH!!
    June 24, 2016, 12:57:05 am
  • [DFg]DJF-1975: Thank you, SP!
    June 21, 2016, 01:35:09 pm
  • Skhilled: phpBB is a good product but has a steeper learning curve.
    June 21, 2016, 08:19:04 am
  • ♦ Ninja ZX-10RR ♦: Hmm, not so sure about it, Eliana: [link]
    May 05, 2016, 02:03:02 am
  • Eliana Tamerin: That may have faded away now, or gotten better. I hope so. I see a lot of happy phpBB users, so I have to imagine someone is having success.
    April 25, 2016, 12:48:06 am
  • Eliana Tamerin: @andy, the phpBB folks had (at one point, not sure how it is now) a specific set of rules you had to follow to get support. Anyone not found doing so would have their topic ignored.
    April 25, 2016, 12:47:40 am
  • andy: SP team is a breath of fresh air...
    April 24, 2016, 11:24:32 pm
  • andy: Yes they are difficult to deal with at SMF. I never experienced anybody like that at phpbb several years ago.
    April 24, 2016, 11:24:03 pm
  • D.Va: Their team is very antagonistic and I prefer this forum and this staff far more. So kudos to SP for doing it right.
    April 24, 2016, 09:18:21 pm
  • andy: When SMF went gold there was a lot of optimism about progress and talk of 3.0.  Five years on and that soulds like SF.
    April 24, 2016, 08:37:31 pm
  • andy: Just my frustration at the slow pace of SMF. I suppose we have an alternative now.
    April 24, 2016, 08:34:38 pm
  • Burke Knight: Andy, as long as the SMF team keeps like they are doing, there's always going to be bugs, mainly due to SMF issues, because the team can't get their stuff straight.
    April 24, 2016, 08:25:41 pm

* Recent Posts

Re: how can i change my ip by emanuele
[Today at 02:44:07 am]


Re: Kaynak dosyalarda portal.css dosya yolu by emanuele
[Today at 02:42:41 am]


Re: custom topic link block by D.Va
[Yesterday at 06:10:28 pm]


Re: how can i change my ip by D.Va
[Yesterday at 06:08:49 pm]


Re: Kaynak dosyalarda portal.css dosya yolu by tc bolubeyi
[Yesterday at 04:05:25 pm]

Welcome to SimplePortal.net! You can download SimplePortal from the Downloads Area!

Author Topic: Shout "room" selector  (Read 4498 times)

0 Members and 1 Guest are viewing this topic.

Offline newsman

  • Semi Newbie
  • *
  • Posts: 10
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Shout "room" selector
« on: February 18, 2012, 03:39:32 pm »
Would like to see..... multiple shout boxes that switch on the fly....

Say: left-middle-right block layout.

In the middle blok the shoutbox.
In the right block a shout "room" selector.

  Shoutbox                                                                  Rooms         
|-----------------------------------------------------------|   |----------------------------------|
say: blabla                                                                   -Public                         
say: nej nej                                                                  -Helpdesk
say: JoJo                                                                      -Private Staff
say: hihi
say: goto helpdesk
say: Need help ?
|-----------------------------------------------------------|   |----------------------------------|

When someone needs another room Like helpdesk they click on Helpdesk. The page refreshes and only the shoutbox changes to helpdesk, the rest of the portal page stays the same.

When they are done they click on Public and the whole portal page refreshes but only the shoutbox blok switches back to the public shoutbox.

Staff could use a private shout "room" and switch on the fly....

Greetz

Offline Kryzen

  • Localizer
  • Language
  • *
  • Posts: 823
  • Gender: Male
  • SMF Version: 2.0.11
  • SP Version: 2.3.6
Re: Shout "room" selector
« Reply #1 on: February 18, 2012, 03:46:25 pm »

Offline newsman

  • Semi Newbie
  • *
  • Posts: 10
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Shout "room" selector
« Reply #2 on: February 18, 2012, 04:01:18 pm »
I knew that one. It directs to different pages. It does not leave the rest of the original front page "unchanged" it just switches out the whole page. At least that's what it did for me..... maybe i screwed something up....?

I don't wanna clone 5 front pages only for the shoutbox to change, that's too difficult with complex front pages. I just want the shoutbox block to swap on 1 and the same frontpage (after refresh)

Let's call it block switching.... :)

Would something like this be possible ?

Greetz

Offline Kryzen

  • Localizer
  • Language
  • *
  • Posts: 823
  • Gender: Male
  • SMF Version: 2.0.11
  • SP Version: 2.3.6
Re: Shout "room" selector
« Reply #3 on: February 18, 2012, 04:08:23 pm »
I'm afraid that's not possible, but it sounds like a very awesome idea. It would take some time to implement though, but it's worth requesting it as a feature for sure. I'll see what I can do. ;)

Offline newsman

  • Semi Newbie
  • *
  • Posts: 10
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Shout "room" selector
« Reply #4 on: February 18, 2012, 04:19:25 pm »
Would open up a whole new concept in my opinion.....

For example:

Shoutboxes that change on the fly and thus creating shoutbox rooms same like chatrooms.
 
Different blocks which would switch on the fly and be controlled with selectors. Different custom "Who's online" blocks that users can control themselves, "last topic" or rather "last post's" selector... click and switch...

Greetz

Offline newsman

  • Semi Newbie
  • *
  • Posts: 10
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Shout "room" selector
« Reply #5 on: February 19, 2012, 10:28:39 am »
Maybe an easier way would be too make <TABS> above shoutbox ?


____________________________
|General | Private | Admin | Sports |
----------------------------------------------------------------
Refresh icon, smiley icon etc etc
----------------------------------------------------------------
Say: haha
Say: NeyNey
etc
etc

----------------------------------------------------------------


Would this be possible/easier ?

Greetz

Offline Chen Zhen

  • The Underdog
  • Support
  • *
  • Posts: 1221
  • Gender: Male
  • MOOSE KNUCKLES
    • WebDev
  • SMF Version: 2.0.11
  • SP Version: 2.3.6
  • Elkarte Version: None
Re: Shout "room" selector
« Reply #6 on: February 19, 2012, 04:38:10 pm »
This is a good idea.
imo a drop-down menu would be better.

Offline Devil jimmy

  • Jr. Member
  • **
  • Posts: 73
  • Gender: Male
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Shout "room" selector
« Reply #7 on: February 20, 2012, 08:07:19 am »
this already exists
this is stated on the forum owner bluedevil
I'm not sure I can post the link here
but you can ask him He is a member here
works perfectly
« Last Edit: February 20, 2012, 08:11:13 am by Devil jimmy »

Offline newsman

  • Semi Newbie
  • *
  • Posts: 10
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Shout "room" selector
« Reply #8 on: February 28, 2012, 11:06:28 am »
No it doesn't exist.

As stated before the bleudevil's chat room uses different pages to display the different rooms. When changing chat room the whole page changes to a different one.

A normal shout box is displayed on the portal page together with other blocks. Using this approach with the solution from bluedevil would mean you would have to create multiple <cloned> portal pages. 1 for each chat room and switch between different pages. All <cloned> pages would need the same (extra) blocks from the original portal page. A lot of work and very confusing when you chance 1 block on the portal page you would also have to change that same block on the "cloned" pages also.

I want to give the current SHOUT block an extra option. The idea is to have only change the shout box <on the fly> on 1 and the same portal page. Thus creating the same effect as in a real chat with different chat rooms. In effect making the shout behave the same as a "real" chat.

Many many people are looking too have some kind of live chat with multiple rooms on their forum which is fully integrated in SMF. Login permissions etc etc. Currently this is one of the most requested features, i think.

In essence the simpleportal shout box is a chat with a single room and more important it's fully integrated in SMF. So we only need the option of having more "rooms".

The options how ? I stated before.

It being a whole page refresh when changing "shout-rooms" selected through an new "shout-rooms" block or added <tabs> to the shout for selecting the "shout-rooms".




One other option would be to have multiple shout rooms and multiple shout-rooms in the database. I think this is already so now.
The shoutbox name is stored in the database as: sp_shoutboxes > id_shoutbox > name
The shoutbox date is stored in the databse as:  sp_shouts > body

When changing shout-room the normal refresh would simply jump to another database entry and change the title and content of the shout.

Let's say we create 2 shouts.

One called PUBLIC and in the database it's called:  id_shoutbox=1
and one called PRIVATE and in the database it's called:  id_shoutbox=2.

What we would need is a separate block (or tabs) for the room categories, so we can select what "shout-room" we want to see. This block reads and displays the database title of all the shout boxes we created. It simply read the title name from database (sp_shoutboxes > name) and displays those names.

When we are in the <public> "shout-room" and we chance the "shout-room" by clicking <private> in the "shout-categories" block we FORCE a refresh and clear all data in the current shout box so all is empty.

And then we also switch what we read from the database, from <public:id_shoutbox=1> to <private:id_shoutbox=2> and read all the new data and display that instead of the old data. In effect we only swapped out the data inside the shout box. For the user it "LOOKS" like he switched to another room.

In short:

The whole switch would only require a <clear current shoutbox> and a chance of <id_shoutbox=1> to <id_shoutbox=2>.
The same idea as bluedevil but not switching out the pages but only switch what we read from the database.

DATABASE:
Current shout:  id_shoutbox=1, name PUBLIC read and display data from : sp_shouts, id_shoutbox=1, BODY

SWITCHING ROOM:
"Shout-rooms" block> select id_shoutbox=2, name PRIVATE > clear all shoutbox data

DATABASE
display NEW shout: id_shoutbox=2, name PRIVATE read and display data from : sp_shouts, id_shoutbox=2, BODY


I hope I explained it clearly enough ?

Sadly I am not skilled enough to write this in PHP. Maybe one of you knows if this is even possible and finds the time to do this.

Greetz

Offline newsman

  • Semi Newbie
  • *
  • Posts: 10
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Shout "room" selector
« Reply #9 on: March 02, 2012, 08:35:14 am »
No takers, probably not a good idea after all  :'(

Greetz

Offline grafitus

  • Comrade
  • *
  • Posts: 1554
  • Gender: Male
  • just looking for own old energy
  • SMF Version: None
  • SP Version: None
Re: Shout "room" selector
« Reply #10 on: March 02, 2012, 10:16:57 am »
Good idea. But we *just* love simplicity. ;)
my mods
I don't reply support PMs. Please use support forums.

Offline newsman

  • Semi Newbie
  • *
  • Posts: 10
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Shout "room" selector
« Reply #11 on: March 05, 2012, 10:55:42 am »
All portals have some kind of "simple" shout.

Portals with an integrated "chat"-like function would have a much wanted feature that would give it an advantage over other portals.

Simple would be no portal at all....

....but I get the point.

Greetz

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6779
  • SMF Version: 2.0.10
  • SP Version: 2.3.6
Re: Shout "room" selector
« Reply #12 on: March 06, 2012, 06:03:01 am »
Just to demonstrate the power of SimplePortal...

Code: [Select]
global $context, $user_info, $txt, $scripturl, $settings, $options;

$shoutboxes = array(
// shoutbox id => label
1 => 'Room 1',
2 => 'Room 2'
// 3 => 'Room 3',
// 4 => 'Room 4',
// 5 => 'Room 5',
);
if ($context['user']['is_guest'])
$default = !empty($_COOKIE['sp_current_room']) ? (int) $_COOKIE['sp_current_room'] : 0;
else
$default = !empty($options['sp_current_room']) ? (int) $options['sp_current_room'] : 0;
if ($default === 0)
$default = current(array_keys($shoutboxes));

$shoutbox = sportal_get_shoutbox($default);

$can_moderate = allowedTo('sp_admin') || allowedTo('sp_manage_shoutbox');
if (!$can_moderate && !empty($shoutbox['moderator_groups']))
$can_moderate = count(array_intersect($user_info['groups'], $shoutbox['moderator_groups'])) > 0;

$shout_parameters = array(
'limit' => $shoutbox['num_show'],
'bbc' => $shoutbox['allowed_bbc'],
'reverse' => $shoutbox['reverse'],
'cache' => $shoutbox['caching'],
'can_moderate' => $can_moderate,
);
$shoutbox['shouts'] = sportal_get_shouts($shoutbox['id'], $shout_parameters);

$shoutbox['warning'] = parse_bbc($shoutbox['warning']);
$context['can_shout'] = $context['user']['is_logged'];

echo '
<div class="shoutbox_container">
<div class="shoutbox_info flow_auto">
<select id="room_select" onchange="sp_update_room(); return false;" style="float: right;">';

foreach ($shoutboxes as $id => $name)
echo '
<option value="', $id, '"', $default == $id ? ' selected="selected"' : '', '>', $name, '</option>';

echo '
</select>
<div id="shoutbox_load_', $shoutbox['id'], '" style="float: right; display: none;"><img src="', $settings['sp_images_url'], '/loading.gif" alt="" /></div>
<a id="shoutbox_refresh" href="', $scripturl, '?action=portal;sa=shoutbox;shoutbox_id=', $shoutbox['id'], '" onclick="sp_refresh_room(); return false;">', sp_embed_image('refresh'), '</a> <a id="shoutbox_history" href="', $scripturl, '?action=portal;sa=shoutbox;shoutbox_id=', $shoutbox['id'], '">', sp_embed_image('history'), '</a>
</div>
<div class="shoutbox_body">
<ul class="shoutbox_list_compact" id="shouts_', $shoutbox['id'], '"', !empty($shoutbox['height']) ? ' style="height: ' . $shoutbox['height'] . 'px;"' : '', '>';

if (!empty($shoutbox['warning']))
echo '
<li class="shoutbox_warning smalltext">', $shoutbox['warning'], '</li>';

if (!empty($shoutbox['shouts']))
foreach ($shoutbox['shouts'] as $shout)
echo '
<li class="smalltext">', !$shout['is_me'] ? '<strong>' . $shout['author']['link'] . ':</strong> ' : '', $shout['text'], '<br />', !empty($shout['delete_link_js']) ? '<span class="shoutbox_delete">' . $shout['delete_link_js'] . '</span>' : '' , '<span class="smalltext shoutbox_time">', $shout['time'], '</span></li>';
else
echo '
<li class="smalltext">', $txt['sp_shoutbox_no_shout'], '</li>';

echo '
</ul>
</div>';

if ($context['can_shout'])
echo '
<div class="shoutbox_input smalltext">
<input type="text" name="new_shout" id="new_shout_', $shoutbox['id'], '" class="shoutbox_input sp_float_left input_text" onkeypress="if (sp_catch_enter(event)) { sp_submit_room(); return false; }" />
<input type="submit" name="submit_shout" id="shoutbox_submit" value="', $txt['sp_shoutbox_button'], '" class="sp_float_right button_submit" onclick="sp_submit_room(); return false;" />
</div>';

echo '
</div>
<script language="Javascript" type="text/javascript"><!-- // --><![CDATA[
var current_room = ', $default, ';
function sp_update_room()
{
var new_room = document.getElementById("room_select").value;
document.getElementById("shoutbox_load_" + current_room).id = "shoutbox_load_" + new_room;
document.getElementById("shoutbox_refresh").href = document.getElementById("shoutbox_refresh").href.replace(/shoutbox_id=\d+/, "shoutbox_id=" + new_room);
document.getElementById("shoutbox_history").href = document.getElementById("shoutbox_history").href.replace(/shoutbox_id=\d+/, "shoutbox_id=" + new_room);
document.getElementById("shouts_" + current_room).id = "shouts_" + new_room;';

if ($context['can_shout'])
echo '
document.getElementById("new_shout_" + current_room).id = "new_shout_" + new_room;';

if ($context['user']['is_guest'])
echo '
document.cookie = "sp_current_room=" + new_room;';
else
echo '
smf_setThemeOption("sp_current_room", new_room, null, "' . $context['session_id'] . '", "' . $context['session_var'] . '");';

echo '
current_room = new_room;
sp_refresh_room();
}
function sp_refresh_room()
{
sp_refresh_shout(current_room, 0);
}
function sp_submit_room()
{
sp_submit_shout(current_room, \'', $context['session_var'], '\', \'', $context['session_id'], '\');
}
// ]]></script>';

You just need to create separate shoutboxes for each room and change the $shoutboxes array at the beginning of the code accordingly.

There are a few limitations in this code, such as no smileys, styling options, and auto refresh and obviously it won't work unless you have JavaScript enabled. They could be added but I'm no longer the young The Amazing Coder who can spend time on it.

Attached a screenshot as well.
« Last Edit: March 06, 2012, 06:05:35 am by [SiNaN] »
And slowly, you come to realize... It's all as it should be...

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6779
  • SMF Version: 2.0.10
  • SP Version: 2.3.6
Re: Shout "room" selector
« Reply #13 on: March 07, 2012, 10:47:45 am »
I should add that this isn't something many would benefit. So I would leave it up to people who need it to customize it on their own.
And slowly, you come to realize... It's all as it should be...