collapse

* User Info

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

* Who's Online

  • Dot Guests: 160
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 am
  • emanuele: [link]
    November 01, 2016, 12:43:50 pm
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 pm
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 am
  • [DFg]DJF-1975: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 am
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 pm
  • phantomm: and from what I see only patch is broken, full install package is fine
    October 21, 2016, 03:44:44 pm
  • phantomm: they say it for over 3 weeks now..
    October 21, 2016, 03:43:52 pm
  • aegersz: SMF say that bug fix 2.0.13 is coming soon ...
    October 19, 2016, 06:46:12 pm
  • Chen Zhen: check that thread at a later date as that file is not a final fix
    October 10, 2016, 03:09:18 pm
  • [DFg]DJF-1975: Thanks for the shoutbox fix file!
    October 10, 2016, 09:17:19 am
  • * Burke Knight Lurks
    October 02, 2016, 09:17:45 pm
  • [DFg]DJF-1975: Not to shoutbox spam, but I use this portal daily and I wanted to say thank you. It's been too long since I last thanked you all!
    October 02, 2016, 11:52:06 am
  • [DFg]DJF-1975: Is this project or for that matter anyone here still active?
    October 02, 2016, 11:48:04 am
  • ♦ Ninja ZX-10RR ♦: Hey :)
    September 30, 2016, 11:34:37 pm
  • aegersz: Hello SimplePortal people !
    September 30, 2016, 05:10:53 am
  • 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

* Recent Posts

Re: Shoutbox Problem After SMF Minor Upgrade by ♦ Ninja ZX-10RR ♦
[November 27, 2016, 10:38:24 pm]


Re: Shoutbox Problem After SMF Minor Upgrade by D.Va
[November 27, 2016, 10:30:27 pm]


Re: Shoutbox Problem After SMF Minor Upgrade by KathyL
[November 27, 2016, 03:05:12 am]


Re: Shoutbox Problem After SMF Minor Upgrade by D.Va
[November 26, 2016, 12:04:56 pm]


Re: Shoutbox does not load shouts in SMF 2.0.12 by newtoallthis
[November 25, 2016, 04:25:09 pm]

NEED HELP? If you're looking for support with Simple Portal, look no further than the Support Board!

Author Topic: Shout "room" selector  (Read 4654 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: 1237
  • 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: 6781
  • 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: 6781
  • 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...