We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Locked Topic
  • Pages:
  • 1
[ C ] A small shoutbox feature request
Topic Started: Aug 28 2015, 08:53 AM (1,634 Views)
Devourz
Member Avatar
Member
[ *  *  * ]
Is it possible to get a feature like this http://prntscr.com/89v4pq (that's a IPB forum btw) for my shoutbox which would put a little "@" before a user's name and when clicked it will do this http://prntscr.com/89v546 for example so it would basically when you click the "@" infront of someones username for example "@ Nick" when you click the @ before my name it would put a "@Nick" in the text box so that person knows you're talking to them





so


"@ Nick"
say i pressed the @

Chatbox here: @Nick (then i could type here)
Offline Profile Goto Top
 
Quozzo
Member Avatar
By the blood of Sanguinius!
[ *  *  *  *  * ]
Code: Below the Board
 
<script>
$(function(){
var sbx = $('#sbx').find('a.member').before("<span class='at' style='cursor:pointer;'>@</span>").end().on('click', '.at', function(){
var $this = $(this), input = sbx.find('[name=shouttext]'), txt = input.val(), user = $this.next().text();
input.val(txt+"@"+user+" ").focus();
});
});
</script>
Offline Profile Goto Top
 
Devourz
Member Avatar
Member
[ *  *  * ]
Quozzo
Aug 28 2015, 08:06 PM
Code: Below the Board
 
<script>
$(function(){
var sbx = $('#sbx').find('a.member').before("<span class='at' style='cursor:pointer;'>@</span>").end().on('click', '.at', function(){
var $this = $(this), input = sbx.find('[name=shouttext]'), txt = input.val(), user = $this.next().text();
input.val(txt+"@"+user+" ").focus();
});
});
</script>
Below The Board?
Offline Profile Goto Top
 
DaPizzaMan
Member Avatar
#TeamSupport

Yes.
Offline Profile Goto Top
 
Devourz
Member Avatar
Member
[ *  *  * ]
Quozzo
Aug 28 2015, 08:06 PM
Code: Below the Board
 
<script>
$(function(){
var sbx = $('#sbx').find('a.member').before("<span class='at' style='cursor:pointer;'>@</span>").end().on('click', '.at', function(){
var $this = $(this), input = sbx.find('[name=shouttext]'), txt = input.val(), user = $this.next().text();
input.val(txt+"@"+user+" ").focus();
});
});
</script>


DaPizzaMan
Aug 28 2015, 11:54 PM
Yes.


Didn't work at all

Offline Profile Goto Top
 
Quozzo
Member Avatar
By the blood of Sanguinius!
[ *  *  *  *  * ]
What's your board URL?
Offline Profile Goto Top
 
Devourz
Member Avatar
Member
[ *  *  * ]
Quozzo
Aug 29 2015, 12:41 AM
What's your board URL?
Update: it didn't work when i first installed the code but 2 hours later i go back to my board and the "@" is beside peoples name so i refreshed it again and it was still there but i refreshed it a third time and it has disappeared again -.- so basically it



Edit: i caught it again look (It appeared when i reloaded http://prntscr.com/8a5nap then i went to a new tab and clicked back and poof gone again http://prntscr.com/8a5nju)
Edited by Devourz, Aug 29 2015, 06:52 AM.
Offline Profile Goto Top
 
Quozzo
Member Avatar
By the blood of Sanguinius!
[ *  *  *  *  * ]
GamingNick
Aug 29 2015, 02:00 AM
Quozzo
Aug 29 2015, 12:41 AM
What's your board URL?
Update: it didn't work when i first installed the code but 2 hours later i go back to my board and the "@" is beside peoples name so i refreshed it again and it was still there but i refreshed it a third time and it has disappeared again -.- so basically it's being weird






Board URL: http://s15.zetaboards.com/RealityScape/index/



Edit: i caught it again look (It appeared when i reloaded http://prntscr.com/8a5nap then i went to a new tab and clicked back and poof gone again http://prntscr.com/8a5nju)
Do you have a code that refreshes the shoutbox? That can cause issues with this.
Offline Profile Goto Top
 
Devourz
Member Avatar
Member
[ *  *  * ]
Quozzo
Aug 29 2015, 02:35 AM
GamingNick
Aug 29 2015, 02:00 AM
Quozzo
Aug 29 2015, 12:41 AM
What's your board URL?
Update: it didn't work when i first installed the code but 2 hours later i go back to my board and the "@" is beside peoples name so i refreshed it again and it was still there but i refreshed it a third time and it has disappeared again -.- so basically it's being weird






Board URL: http://s15.zetaboards.com/RealityScape/index/



Edit: i caught it again look (It appeared when i reloaded http://prntscr.com/8a5nap then i went to a new tab and clicked back and poof gone again http://prntscr.com/8a5nju)
Do you have a code that refreshes the shoutbox? That can cause issues with this.
I think I do but I don't remember which code it is in my Board Template :/
Offline Profile Goto Top
 
Jason
Member Avatar
Member
[ *  *  *  *  * ]
GamingNick
Aug 29 2015, 04:27 AM
Quozzo
Aug 29 2015, 02:35 AM
GamingNick
Aug 29 2015, 02:00 AM
Quozzo
Aug 29 2015, 12:41 AM
What's your board URL?
Update: it didn't work when i first installed the code but 2 hours later i go back to my board and the "@" is beside peoples name so i refreshed it again and it was still there but i refreshed it a third time and it has disappeared again -.- so basically it's being weird






Board URL: http://s15.zetaboards.com/RealityScape/index/



Edit: i caught it again look (It appeared when i reloaded http://prntscr.com/8a5nap then i went to a new tab and clicked back and poof gone again http://prntscr.com/8a5nju)
Do you have a code that refreshes the shoutbox? That can cause issues with this.
I think I do but I don't remember which code it is in my Board Template :/
You do, it's this bit of your board template:

Code:
 
<script type='text/javascript'>
// <![CDATA[
var seconds_refresh = 30, refresh_timer, can_refresh = true;

function set_refresh_timer() {
refresh_timer = setInterval(function() {
if (can_refresh)
$('#shoutrefresh').click();
}, seconds_refresh * 1000);
}

if ($('#shoutbox').length) {
set_refresh_timer();
$('#shoutpost').submit(function() {
clearInterval(refresh_timer);
can_refresh = false;
setTimeout(function() {
$('#shoutrefresh').click();
set_refresh_timer();
can_refresh = true;
}, seconds_refresh * 1000);
});
}
// ]]>
</script>


The issue is that after 30 seconds the shoutbox refreshes, but as the page doesn't reload the new code you added cannot run on the newly refreshed shoutbox.
Offline Profile Goto Top
 
Devourz
Member Avatar
Member
[ *  *  * ]
Edit: I've removed my automatic shoutbox refreshing code but i am still having this issue..
Edited by Devourz, Aug 29 2015, 11:02 PM.
Offline Profile Goto Top
 
-The-
Member Avatar
#the { display: none; }
[ *  *  *  *  * ]
I'm still seeing it in the board template. Are you sure you removed it/pressed the Edit button? Try it again :)
Offline Profile Goto Top
 
Devourz
Member Avatar
Member
[ *  *  * ]
-The-
Aug 30 2015, 01:16 PM
I'm still seeing it in the board template. Are you sure you removed it/pressed the Edit button? Try it again :)
I re-added it after the fact i realized this code wouldn't work still








OT: can i ask how you see what i have in my board template? O.o
Offline Profile Goto Top
 
Roby
Member Avatar
#27

GamingNick
Aug 30 2015, 01:22 PM
OT: can i ask how you see what i have in my board template? O.o
In pretty much all browsers there's developer options that let you view the HTML, CSS and Javascript of a page. Nobody without ACP access can see your actual Board Template but the public HTML, CSS, and Javascript is viewable.
Edited by Roby, Aug 30 2015, 01:48 PM.
Offline Profile Goto Top
 
-The-
Member Avatar
#the { display: none; }
[ *  *  *  *  * ]
Try removing the code and clearing your cache. Does it work now or not?
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
Go to Next Page
« Previous Topic · Closed Requests · Next Topic »
Locked Topic
  • Pages:
  • 1