Random Popup On Forum?
3 posters
Page 1 of 1
Random Popup On Forum?
Hello, my helpful, fellow forumotion users! I am yet again trying to find out how to go about making a very cool feature that will allow me to interact more with my members, but I don't know how to do it, which is why, ofcourse, I am here!
First off, what I am trying to accomplish is a popup box, that pops up randomly when you visit a random (not specific) forum on my site. This popup will just pop up, and even add a lightbox effect so the popup is more clearer, and the background is kind of blackened out. I want this so that when the popup pops out, it will say something like
"You have come across walking to ___ and turn your head and find 50$. Please PM an admin to receive your reward!" However, how can I make this?
An example is below, retrieved from www.HexRPG.com
First off, what I am trying to accomplish is a popup box, that pops up randomly when you visit a random (not specific) forum on my site. This popup will just pop up, and even add a lightbox effect so the popup is more clearer, and the background is kind of blackened out. I want this so that when the popup pops out, it will say something like
"You have come across walking to ___ and turn your head and find 50$. Please PM an admin to receive your reward!" However, how can I make this?
An example is below, retrieved from www.HexRPG.com
HogwartsAcademy- Forumember
- Posts : 474
Reputation : 1
Language : English
Re: Random Popup On Forum?
Yes, indeed I know that already, but I never knew how to put it together. Can you please, please use your brilliant mind and put the steps together for me to show me how to put it together so it shows the pop up on my forum - like creating the JS page, and how to add it to the forum, etc.
HogwartsAcademy- Forumember
- Posts : 474
Reputation : 1
Language : English
Re: Random Popup On Forum?
No, after clicking on a categorized forum, and make it so that it happens like once every 2 days to each IP or something possibly?
HogwartsAcademy- Forumember
- Posts : 474
Reputation : 1
Language : English
Re: Random Popup On Forum?
IT may be possible, but this is not secure for you ya know. Once people hear of this, they are just going to PM you saying "Hey I found $50."
Instead maybe you should make it so that you send of the PM's
Creating a link with an ID and when clicked it'll pop up.
Just to provide you a more fair way of doing this...
Or you can create random numbers and whoever sends you the first correct one will get the points and then change them once they have been redeemed.
Instead maybe you should make it so that you send of the PM's
Creating a link with an ID and when clicked it'll pop up.
Just to provide you a more fair way of doing this...
Or you can create random numbers and whoever sends you the first correct one will get the points and then change them once they have been redeemed.
Re: Random Popup On Forum?
nextlevelgaming wrote:IT may be possible, but this is not secure for you ya know. Once people hear of this, they are just going to PM you saying "Hey I found $50."
Instead maybe you should make it so that you send of the PM's
Creating a link with an ID and when clicked it'll pop up.
Just to provide you a more fair way of doing this...
Or you can create random numbers and whoever sends you the first correct one will get the points and then change them once they have been redeemed.
That is what I am doing, except keep in mind this doesn't include real money. It is payed in points. What happens is in the pop up I will put in a generated code and once the code is used once, I won't accept it again and make a new one. So does anyone know how I can go about doing this so it happens if they click on a forum but it's randomized so it doesn't open every time they click on that forum?
HogwartsAcademy- Forumember
- Posts : 474
Reputation : 1
Language : English
Re: Random Popup On Forum?
Rideem3 wrote:I could provide you with a quick way:
- Code:
var number = Math.floor(Math.random() * 2) + 1; //Random number between 1 and 2
if (number == 1 && /\/?f(\d+).*/.test(window.location.pathname)) alert('Your Text Here');
Where do I put this, mate?
I was thinking of something I could put into a javascript and set it in index only, and the code can include something that randomizes the factor of the popup.. like it includes that the popup opens on all the forums but doesn't happen everytime, do you know what I mean?
HogwartsAcademy- Forumember
- Posts : 474
Reputation : 1
Language : English
Re: Random Popup On Forum?
Rideem3 wrote:What that script does, is when your browsing the topic list of a forum, if the random number is 1, then the message will display.
You would put it:
Admin Panel -> Modules -> JavaScript Codes Management -> Create New -> Select in All Pages
Which number should I keep it so that it is random every time and doesn't happen every say.. 10 minutes, maybe spread it between a few hours?
Also, I don't like the style that the button is in, can I make it in HTML so that the background is black, and I can add an image in it with colorful text, etc? Like in the example I put in the first post?
HogwartsAcademy- Forumember
- Posts : 474
Reputation : 1
Language : English
Re: Random Popup On Forum?
I do not know how to do this because what I did is I made my whole popup in HTML, how can I style it in CSS if it's in HTML?
Here is the code for the pop up:
What can I do to put this as a popup?
Here is the code for the pop up:
- Code:
<html>
<head>
<title></title>
</head>
<body>
<p>
</p>
<table bgcolor="#776952" border="0" cellpadding="5" cellspacing="1" style="color: rgb(216, 198, 163); font-family: verdana, arial, sans-serif;" width="420">
<tbody>
<tr bgcolor="#000000">
<td align="center" style="font-size: 11px;" valign="middle" width="300">
Whilst flying past Hogwarts, Cupid was hit by a rogue bludger. Concussed and confused he flies to your window, professing his undying love for you. You take him to Madame Promfrey, who treats and discharges him that day. The next morning you find a single red rose on your window sill, with a note: I will never forget you - C</td>
<td style="font-size: 11px;">
<img src="http://www.hexrpg.com/images/logo/hogwarts.gif" /></td>
</tr>
</tbody>
</table>
<p>
</p>
</body>
</html>
What can I do to put this as a popup?
HogwartsAcademy- Forumember
- Posts : 474
Reputation : 1
Language : English
Re: Random Popup On Forum?
It is a popup that the graphic designer for the website I am using this off gave me, he told me that this was the HTML and I needed to convert it to CSS.. isn't there a way to put this in a widget or something so that it will show as html?
HogwartsAcademy- Forumember
- Posts : 474
Reputation : 1
Language : English
Re: Random Popup On Forum?
HTML and CSS are two complete different things, though they go hand in hand together. CSS styles what the HTML will look like. Also you only need <head tags and <body tags if you are using it for an HTML page. If you are using it for a widget/editing templates you do not need those tags.
Re: Random Popup On Forum?
Do you know how I can convert this html to CSS?
HogwartsAcademy- Forumember
- Posts : 474
Reputation : 1
Language : English
Re: Random Popup On Forum?
HogwartsAcademy you do not convert HTML to CSS! You use CSS to style the HTML you need both to have it work. HTML is ok, but without HTML CSS is nothing really. Use this code
CSS would be like so
- Code:
<table id="popup_mess" border="0" cellpadding="5" cellspacing="1">
<tbody>
<tr>
<td align="center">
Whilst flying past Hogwarts, Cupid was hit by a rogue bludger. Concussed and confused he flies to your window, professing his undying love for you. You take him to Madame Promfrey, who treats and discharges him that day. The next morning you find a single red rose on your window sill, with a note: I will never forget you - C</td>
<td>
<img src="http://www.hexrpg.com/images/logo/hogwarts.gif" /></td>
</tr>
</tbody>
</table>
CSS would be like so
- Code:
#popup_mess{
background:#000;
color:#ff0000;
font-size: 12px;
font-family:Time New Roman;
}
#popup_mess tr{style inside brackets}
#popup_mess td{ style inside brackets}
Re: Random Popup On Forum?
What do I put in where it says "style inside brackets"?
HogwartsAcademy- Forumember
- Posts : 474
Reputation : 1
Language : English
Re: Random Popup On Forum?
Style it with background colors text colors and so forth. That is what we call styling
Re: Random Popup On Forum?
Can you re-write the code for me using Rideem's way to make this and the popup that I am using with the rewritten code you gave me? I have so many information here it is hard to understand what to put and where to put it, this would be excellent. Thank you.
HogwartsAcademy- Forumember
- Posts : 474
Reputation : 1
Language : English
Re: Random Popup On Forum?
Sorry can not due, I am too busy on my own websites, and helping others on mine. HTML goes in HTML, CSS goes in CSS, and javascript goes in javascript
Re: Random Popup On Forum?
Okay man, thank you.
Also, I did what you gave me, and it's not working for me. It could just be Rideem's code that may not work. I don't know. This is what I'm doing:
=====================================================
JAVASCRIPT CODE:
FORUM WIDGET CODE
CSS CODE
Rideem or anyone, can you make sure that this is right? Because it's been a few days after I published all these changes and nothing even popped up.
Also, I did what you gave me, and it's not working for me. It could just be Rideem's code that may not work. I don't know. This is what I'm doing:
=====================================================
JAVASCRIPT CODE:
- Code:
if (!my_getcookie('forum_popup') && /\/?f(\d+).*/.test(window.location.pathname)) {
var now = new Date();
var time = now.getTime();
time += 3600 * 10000;
now.setTime(time);
document.cookie =
'forum_popup=true'; expires=' + now.toGMTString() +
';
document.getElementById('forum_popup').style.display="block";
}
FORUM WIDGET CODE
- Code:
<div id="forum_popup" style="display: none;"><table id="popup_mess" border="0" cellpadding="5" cellspacing="1">
<tr>
<td align="center">
Whilst flying past Hogwarts, Cupid was hit by a rogue bludger. Concussed and confused he flies to your window, professing his undying love for you. You take him to Madame Promfrey, who treats and discharges him that day. The next morning you find a single red rose on your window sill, with a note: I will never forget you - C</td>
<td>
<img src="http://www.hexrpg.com/images/logo/hogwarts.gif" /></td>
</tr>
</table></div>
CSS CODE
- Code:
#forum_popup {
/*#popup_mess{
background:#000;
color:#ff0000;
font-size: 12px;
font-family:Time New Roman;
}
#popup_mess tr{style inside brackets}
#popup_mess td{ style inside brackets}*/
}
Rideem or anyone, can you make sure that this is right? Because it's been a few days after I published all these changes and nothing even popped up.
HogwartsAcademy- Forumember
- Posts : 474
Reputation : 1
Language : English
Re: Random Popup On Forum?
HTML and Java are the same.nextlevelgaming wrote:Sorry can not due, I am too busy on my own websites, and helping others on mine. HTML goes in HTML, CSS goes in CSS, and javascript goes in javascript
Re: Random Popup On Forum?
LMAO!
1. It is called javascript, not Java, Java is a different programming.
2. HTML and Javascript ARE NOT the same coding.
So don't try to correct me thanks
1. It is called javascript, not Java, Java is a different programming.
2. HTML and Javascript ARE NOT the same coding.
So don't try to correct me thanks
Re: Random Popup On Forum?
This doesn't help my solution..
HogwartsAcademy- Forumember
- Posts : 474
Reputation : 1
Language : English
Re: Random Popup On Forum?
"Well your CSS has issues and if rideens code is not working you should check your error console.
Similar topics
» Random Space Appeared about my forum
» Random Forum About Nothing!!!
» Random Affiliates on forum
» My Forum Keeps Deleting Topics at Random!
» Random Forum Deletion!!!! HELP!
» Random Forum About Nothing!!!
» Random Affiliates on forum
» My Forum Keeps Deleting Topics at Random!
» Random Forum Deletion!!!! HELP!
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum