collapse

* User Info

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

* Who's Online

  • Dot Guests: 46
  • Dot Hidden: 0
  • Dot Users: 3
  • Dot Users Online:

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • Mstcool: Oh, ok, Sinan
    August 25, 2014, 10:19:15 PM
  • ArsenArsen: When i make them
    August 19, 2014, 12:20:20 AM
  • ArsenArsen: I had some mod ideas, i will put them.
    August 19, 2014, 12:19:45 AM
  • [SiNaN]: We could, but it's there as a reminder of some kind, that we should fill it in, somehow.
    August 18, 2014, 09:57:14 PM
  • Mstcool: Y don't u guys remove the customization section since it has no files?
    August 17, 2014, 10:27:28 PM
  • ArsenArsen: Ok, Great!
    August 15, 2014, 03:13:18 PM
  • [SiNaN]: We have the translators' names listed in the downloads area.
    August 15, 2014, 03:05:39 PM
  • ArsenArsen: Never Mind, i wont, noone did.
    August 15, 2014, 02:22:32 PM
  • ArsenArsen: Can i put mz name on translation
    August 15, 2014, 02:21:06 PM
  • [SiNaN]: You can only change your forum profile options once you have 5 posts. I have made an exception for Translator group though, so you should be able to do it now.
    August 13, 2014, 03:32:17 PM
  • ArsenArsen: Cant find where to change avatar
    August 13, 2014, 03:12:38 PM
  • ArsenArsen: Ok
    August 11, 2014, 05:17:55 AM
  • Underdog: there is a documentation link on your top-right
    August 10, 2014, 08:48:45 PM
  • ArsenArsen: What to use for docs? This is NoT SP support question.
    August 10, 2014, 02:55:55 PM
  • Ron-KK4HGY: Hello all!
    August 06, 2014, 03:22:50 PM
  • USFA: tada
    August 04, 2014, 09:49:45 PM
  • BCNPalomino: lol, that search doe :O
    July 18, 2014, 09:26:27 AM
  • RohailPro23: hi all
    July 18, 2014, 08:09:00 AM
  • samborabora: sorry, thought this was search, lol
    June 29, 2014, 04:45:12 AM
  • samborabora: sp_embed_image
    June 29, 2014, 04:45:01 AM

* Team Blog

* Recent Posts

Re: home page help by XaR
[Today at 03:59:32 PM]


Re: home page help by sumairali
[Today at 05:40:31 AM]


Re: home page help by XaR
[Today at 04:47:36 AM]


home page help by sumairali
[Today at 01:40:11 AM]


Showing latest news... Skipping a few posts by XaR
[Yesterday at 05:13:55 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 1735 times)

0 Members and 1 Guest are viewing this topic.

Offline phantomm

  • Support
  • *
  • Posts: 379
  • 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 Underdog

  • Support
  • *
  • Posts: 801
  • Gender: Male
  • On Hiatus
    • WebDev
  • SMF Version: 2.0.8
  • SP Version: 2.3.5
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: 379
  • 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 Underdog

  • Support
  • *
  • Posts: 801
  • Gender: Male
  • On Hiatus
    • WebDev
  • SMF Version: 2.0.8
  • SP Version: 2.3.5
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()