collapse

* User Info

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

* Who's Online

  • Dot Guests: 36
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • Burke Knight: LOL!
    Yesterday at 03:35:00 pm
  • andy: Shoutbox IS for support... moral support  ;D
    Yesterday at 11:18:48 am
  • {OCS}MasterSeal: THANKS AGAIN FOR SP!
    June 22, 2015, 09:47:08 am
  • angeljs: Thanks :)
    June 20, 2015, 08:28:30 am
  • ♦ Ninja ZX-10RR ♦: Unfortunately I am only a Support Apprentice and I don't have access to it, so I cannot approve it. But I will let my Support coach know ;)
    June 19, 2015, 06:30:47 pm
  • angeljs: Yes. that was it. I managed to edit the post, but now can't make any more new ones as it's back in the moderation queue again! :(
    June 19, 2015, 05:06:05 pm
  • ♦ Ninja ZX-10RR ♦: There should be...? Maybe the post is waiting for approval, don't know.
    June 18, 2015, 03:26:04 pm
  • angeljs: Ok, thanks. I just need to know how to edit my posts as I can't find any edit button
    June 18, 2015, 03:13:00 pm
  • ♦ Ninja ZX-10RR ♦: Newbies cannot post in some sections due to antispam I think, especially if they post links. Feel free to open a topic somewhere, a mod will move it :)
    June 18, 2015, 02:53:02 pm
  • angeljs: I know the shoutbox isn't for support, but I can't post in the support forums! Where can I find help with this website?
    June 18, 2015, 10:36:07 am
  • Jazzpa: Thank you Chen!
    June 12, 2015, 08:31:09 am
  • Chen Zhen: Your thread has been approved and a solution posted.
    June 11, 2015, 11:05:45 pm
  • Jazzpa: How long does it take approve a thread/question over here?
    June 11, 2015, 12:25:01 pm
  • {OCS}MasterSeal: AGAIN. I'm here to spam...errr I mean THANK YOU FOR SP!!!
    May 29, 2015, 02:57:41 am
  • ♦ Ninja ZX-10RR ♦: Cool! Glad that you enjoy SimplePortal! :)
    May 02, 2015, 01:12:20 pm
  • iain sherriff: first SP portal installafter trying most of the others...flawless :)
    May 02, 2015, 09:17:00 am
  • streetfire: hi guys!
    April 30, 2015, 06:59:50 pm
  • empire: good luck with your friends and relatives of his father had to get to work
    April 30, 2015, 09:30:53 am
  • Rupurudu!: :)
    April 28, 2015, 08:27:16 pm
  • empire: when I say bob bob it means bob bob
    April 27, 2015, 10:30:46 am

* Recent Posts

Re: Shoutbox refreshing error by andy
[Yesterday at 09:04:16 pm]


Re: Shoutbox refreshing error by Burke Knight
[Yesterday at 03:31:38 pm]


Re: Shoutbox refreshing error by ♦ Ninja ZX-10RR ♦
[Yesterday at 01:12:25 pm]


Re: Shoutbox refreshing error by andy
[Yesterday at 11:14:25 am]


Re: Shoutbox refreshing error by ♦ Ninja ZX-10RR ♦
[July 04, 2015, 01:33:39 pm]

If you're interested in helping other members with support requests, consider joining the Community Support Helpers group.

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

0 Members and 1 Guest are viewing this topic.

Offline phantomm

  • Support
  • *
  • Posts: 395
  • 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, 10: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, 10:20:31 am by phantomm »

Offline Chen Zhen

  • Support
  • *
  • Posts: 1089
  • 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, 11: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: 395
  • 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, 01: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: 1089
  • 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, 02: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()