collapse

* User Info

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

* Who's Online

  • Dot Guests: 91
  • Dot Hidden: 0
  • Dot Users: 1
  • Dot Users Online:

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • CaLy: hi all! I know it´s late but anyway happy 2015 to all the community!
    January 18, 2015, 04:43:46 am
  • ribwhulp: hoi
    January 17, 2015, 07:55:06 am
  • ♦ Ninja ZX-10RR ♦: Right above the Shoutbox there is a "Who's online" block, just so you know ;)
    January 11, 2015, 03:28:04 pm
  • BlackHeartStudios: Anyone online?
    January 09, 2015, 10:11:24 pm
  • Elliott: Hello
    January 08, 2015, 11:50:47 pm
  • mecane: test
    January 08, 2015, 09:38:30 am
  • ♦ Ninja ZX-10RR ♦: Oh hai!
    January 07, 2015, 07:14:01 pm
  • Elliott: Hello my friends
    January 07, 2015, 03:14:07 pm
  • Capion: ha! I found it ;)
    January 04, 2015, 04:58:45 pm
  • Capion: hmm.. what shoutbox mod is this?
    January 04, 2015, 04:51:21 pm
  • SamElanius: Thank you for info Chen Zhen. It worked
    December 28, 2014, 12:27:23 pm
  • Chen Zhen: new members are not permitted to post links. for those having an issue please make your posts without any working links. thank you.
    December 27, 2014, 09:15:16 pm
  • sub5: BoardNews for Frontpage block is the problem, cant get it right, need your help please
    December 27, 2014, 06:00:09 pm
  • Infernus: What's the problem?
    December 26, 2014, 08:32:26 am
  • sub5: @Elina and SiNaN, can you help me on my post in the BoardNews for frontpage block
    December 26, 2014, 08:28:57 am
  • sub5: I had same issues yesterday,
    December 26, 2014, 08:26:51 am
  • Skhilled: Or first time posters?
    December 26, 2014, 06:58:01 am
  • Skhilled: I get the same too. I think something is wrong with the anti-spam process for new users?
    December 26, 2014, 06:57:47 am
  • SamElanius: What I get when I try to post here in english support new topic is that I get blank (white screen).I tried different browser but same result. If I refresh it, it says that I posted it but no topic is created. Any advice please ?
    December 26, 2014, 06:31:20 am
  • sub5: @Elina thanks, i have been able to post it
    December 25, 2014, 07:16:45 pm

* Recent Posts

Re: Paid Subscription Status by mrnuke7175
[Yesterday at 09:03:43 pm]


Re: Attachments in Shoutbox by 19eighties
[Yesterday at 01:30:05 pm]


Shoutbox style change by Dumke
[Yesterday at 08:26:20 am]


Re: [Plugin] SP - Extra Shoutbox Permissions/Options by Chen Zhen
[January 29, 2015, 05:43:08 pm]


Display users on a given page by Lycoris
[January 29, 2015, 07:56:41 am]

Installation errors? Mod incompatibilities? Upgrade problems? Make your way over to the Install and Upgrade Support board for all your solutions!

Author Topic: Changing forum title if there is new shout  (Read 1855 times)

0 Members and 1 Guest are viewing this topic.

Offline phantomm

  • Support
  • *
  • Posts: 393
  • Gender: Male
  • Smile, tomorrow will be worse...
    • Polish ElkArte community
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Changing forum title if there is new shout
« on: February 28, 2013, 09:18:03 am »
Hi, so I've been trying to make something like this:

If there is new shout in SP Shoutbox forum title would be changed to "New shout!", but when you visit tab/window with this shourbox it should be changed to default forum title.

I know how and where* use document.title = 'New shout!';. Problem is how to reset forum title to default after visiting page, without need to refresh whole page?

* - you need to add document.title before this code in portal.js
Code: [Select]
}

setInnerHTML(document.getElementById('shouts_' + shoutbox_id), new_body);
« Last Edit: February 28, 2013, 09:20:31 am by phantomm »

Offline Chen Zhen

  • Support
  • *
  • Posts: 995
  • Gender: Male
  • ベジータ王
    • WebDev
  • SMF Version: 2.0.9
  • SP Version: 2.3.6
Re: Changing forum title if there is new shout
« Reply #1 on: February 28, 2013, 10:32:27 am »
phantomm,

  Imo use DOM or javascript.

Here it is using javascript:
Code: [Select]
echo '<script type="text/javascript">
    document.title = "New Page Title";
  </script>';


Offline phantomm

  • Support
  • *
  • Posts: 393
  • Gender: Male
  • Smile, tomorrow will be worse...
    • Polish ElkArte community
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Changing forum title if there is new shout
« Reply #2 on: February 28, 2013, 12:01:50 pm »
Thanks for repy, but this code will change title right after page will be loaded.
What I need to have here is JS to set specified forum title when user will go to already open tab.

Offline Chen Zhen

  • Support
  • *
  • Posts: 995
  • Gender: Male
  • ベジータ王
    • WebDev
  • SMF Version: 2.0.9
  • SP Version: 2.3.6
Re: Changing forum title if there is new shout
« Reply #3 on: March 04, 2013, 01:49:42 am »
Thanks for repy, but this code will change title right after page will be loaded.
What I need to have here is JS to set specified forum title when user will go to already open tab.

phantomm,

  My apologies for the late reply as I am working on a project as of late.
I have not tested it but you put what I posted in a js function & have it execute the function when the shout button or ie. onkeydown keycode 13 (return/enter) is executed if I understand you correctly.

Code: [Select]
echo '<script type="text/javascript">
onLoad = function changeTitle() {
    document.title = "New Page Title";
}
  </script>';
.. then in the js for what I mentioned prior you execute changeTitle()