collapse

* User Info

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

* Who's Online

  • Dot Guests: 42
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • BurkeKnight: [SiNaN] old friend. Great Job. I can't wait to see what you add next. :)
    October 13, 2014, 04:13:53 PM
  • [SiNaN]: Thank you everyone, for the kind words and support. For those who are interested, check out our Donators Program: [link]
    October 13, 2014, 11:57:44 AM
  • {OCS}MasterSeal: Glad to be here, glad to use your amazing portal THank you!
    October 13, 2014, 11:33:35 AM
  • Mike Vail: I'd like to donate to you for all your wonderful work. Do you guys have a place on your site to do that? THANKS FOR EVERYTHING!
    October 13, 2014, 11:12:16 AM
  • Mstcool: Yay, an update! :D
    October 12, 2014, 01:39:17 AM
  • stanyy: You're right. I have no idea how I got to the "Archived" index. It looks too similar.
    October 03, 2014, 11:38:32 AM
  • [SiNaN]: SimplePortal 2.3.5 package is listed in Stable SimplePortal Packages category in Downloads area.
    October 03, 2014, 06:08:01 AM
  • stanyy: SP 2.3.5 is not available in the downloads section?? The big download link on the homepage points newcomers to the downloads section who then download 2.3.4. Not good.
    October 03, 2014, 03:54:21 AM
  • Mulwa: if simpleportal team could make some of the blocks like articles to display photos just like how ebay does, it would be very great for shopping
    September 27, 2014, 08:24:14 AM
  • Mulwa: everybody is busy, no help for us this time
    September 26, 2014, 05:00:07 PM
  • [SiNaN]: That shows how simple but powerful SimplePortal is!
    September 26, 2014, 06:56:41 AM
  • oNLy1: thought the 'Blocks In Blocks' was going to be complicated - easy peasy - and was exactly what my site needed - ty
    September 20, 2014, 01:13:44 PM
  • P flex: Xup guys
    September 18, 2014, 08:29:06 AM
  • P flex: Xup
    September 18, 2014, 08:28:38 AM
  • Mstcool: :p *
    September 13, 2014, 07:55:49 PM
  • Mstcool: so when is a new version coming out? :o
    September 13, 2014, 07:55:45 PM
  • USFA: sorry thought was search no glasses
    September 06, 2014, 08:48:23 PM
  • USFA: rename forum
    September 06, 2014, 08:47:40 PM
  • Mstcool: Oh, ok, Sinan
    August 25, 2014, 10:19:15 PM
  • Arsen: When i make them
    August 19, 2014, 12:20:20 AM

* Recent Posts

Re: Shoutbox refresh and page reload discrepancy by i8088
[Yesterday at 04:44:24 PM]


Staff list - Sort by rank by ThatCrazyGuy
[October 22, 2014, 04:16:44 PM]


Re: SimplePortal 2.3.6 Released! by andy
[October 22, 2014, 08:35:00 AM]


Re: Blok İçinde Bloklar Oluşturmak by mkuru
[October 22, 2014, 04:27:32 AM]


Re: SimplePortal 2.3.6 Released! by candidosa2
[October 22, 2014, 01:18:20 AM]

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

Author Topic: Shout "room" selector  (Read 3230 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, 02: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 Doctor Deejay

  • Localizer
  • Language
  • *
  • Posts: 827
  • Gender: Male
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Shout "room" selector
« Reply #1 on: February 18, 2012, 02:46:25 PM »
Doctor Deejay
Simple Portal - Language Team
SMF - Localizer
Vienara - Lead Developer

Backup both your files and database before modifying anything!

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, 03: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 Doctor Deejay

  • Localizer
  • Language
  • *
  • Posts: 827
  • Gender: Male
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Shout "room" selector
« Reply #3 on: February 18, 2012, 03: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. ;)
Doctor Deejay
Simple Portal - Language Team
SMF - Localizer
Vienara - Lead Developer

Backup both your files and database before modifying anything!

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, 03: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, 09: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 Underdog

  • Support
  • *
  • Posts: 814
  • Gender: Male
  • On Hiatus
    • WebDev
  • SMF Version: 2.0.9
  • SP Version: 2.3.6
Re: Shout "room" selector
« Reply #6 on: February 19, 2012, 03: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, 07: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, 07: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, 10: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, 07:35:14 AM »
No takers, probably not a good idea after all  :'(

Greetz

Offline grafitus

  • Comrade
  • *
  • Posts: 1553
  • Gender: Male
  • just looking for own old energy
  • SMF Version: None
  • SP Version: None
Re: Shout "room" selector
« Reply #10 on: March 02, 2012, 09:16:57 AM »
Good idea. But we *just* love simplicity. ;)
my mods | hileci.org | yemek tarifleri | flash oyunlar
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, 09: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: 6527
  • The Amazing Coder!
  • SMF Version: 2.0.9
  • SP Version: 2.3.6
Re: Shout "room" selector
« Reply #12 on: March 06, 2012, 05: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, 05:05:35 AM by [SiNaN] »
And slowly, you come to realize... It's all as it should be...

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6527
  • The Amazing Coder!
  • SMF Version: 2.0.9
  • SP Version: 2.3.6
Re: Shout "room" selector
« Reply #13 on: March 07, 2012, 09: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...