collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 381
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • 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
  • {OCS}MasterSeal: 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

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

Blocks speak! Do you have an interest in getting more blocks - or even making your own? The Blocks Board is for you!

Author Topic: Shout "room" selector  (Read 12330 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: 826
  • 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: 826
  • 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
  • Operations Manager
  • *
  • Posts: 1350
  • Gender: Male
  • Kinesis
    • WebDev
  • SMF Version: 2.1
  • EhPortal Version: 1.22
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 modsI 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: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
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: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
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...