Birthday thread
4 posters
Page 1 of 1
Birthday thread
when a member has a birthday and it is on the calendar is there a way to have the birthday go to a thread?
PurpleTears- Forumember
- Posts : 158
Reputation : 4
Language : english
Re: Birthday thread
I really do not know if it is possible. Do you have the birthday management activate where a pop up will appear foe someone whose birthday it is?
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Birthday thread
Yes i do but i was hoping i could get it to appear in a thread somehow
PurpleTears- Forumember
- Posts : 158
Reputation : 4
Language : english
Re: Birthday thread
We will wait to see if someone has an idea.
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Birthday thread
Hi,
So you have a thread, and when it is someones birthday, a message should be posted in the thread, right? It's possible to do something like this. Send me a PM with your forum's link and an account that has admin access(not necessary the founder account, I only need access to the JS part).
So you have a thread, and when it is someones birthday, a message should be posted in the thread, right? It's possible to do something like this. Send me a PM with your forum's link and an account that has admin access(not necessary the founder account, I only need access to the JS part).
Guest- Guest
Re: Birthday thread
i'm not comfortable giving you admin access sorry if you do have an idea cant you give it us here? please?
PurpleTears- Forumember
- Posts : 158
Reputation : 4
Language : english
Re: Birthday thread
@PurpleTears, there is nothing to worry about. If you are worried about giving him admin rights due to trust issues, I can assure you can trust @Wolfuryo. He's assisted many others in the same manner.
Of course, this is your choice. Just trying to make it easier on you.
Of course, this is your choice. Just trying to make it easier on you.
Re: Birthday thread
Wolfuryo wrote:Hi,
So you have a thread, and when it is someones birthday, a message should be posted in the thread, right? It's possible to do something like this. Send me a PM with your forum's link and an account that has admin access(not necessary the founder account, I only need access to the JS part).
Sorry i just did not see if you were staff so i got a little unsure..
PurpleTears- Forumember
- Posts : 158
Reputation : 4
Language : english
Re: Birthday thread
Hi,
I have installed the script on your forum.(ACP->Modules->Javascript code management, the code named Birthdays).
If anyone is curious about the coding behind this, the codes are below.
JS:
I have installed the script on your forum.(ACP->Modules->Javascript code management, the code named Birthdays).
- Click here to see what modifications you can ake to the code:
->This will be the name that show as the topic poster.- Code:
var poster_name = "BOT";
->The title of the birthday topic. %user is utomatically replaced by the code with the username of the member whose birthday it is.- Code:
var subject = "Happy Birthday %user!";
->The message that is posted. %user will be automatically replaced with the username of the member whose birthday it is.- Code:
var message = "Happy Birthday %user!";
->The avatar of the poster. Replace 0 with the link to an image, or leave it like this if you don't want any avatar- Code:
var avatar = 0;
If anyone is curious about the coding behind this, the codes are below.
JS:
- Code:
$(function() {
var poster_name = "BOT";
var message = "Happy Birthday %user!";
var subject = "Happy Birthday %user!";
var avatar = 0;
if (_userdata.session_logged_in && (location.pathname == "/" || location.pathname == "/forum")) {
var tbd = [],
tb = [],
arr, leng, len;
function check() {
var ar = $("span:contains('birthday')").first().html().split("<br")[0].match(/<strong>.+<\/strong>/),
len = ar.length;
if (len != 0) {
for (var i = 0; i < len; i++) {
ar[i] = ar[i].replace(/<strong>|<\/strong>/g, "");
tbd.push(ar[i]);
};
get_d();
};
};
function get_d() {
$.get("http://virus-design.esy.es/2girlsgraphics.php/?get", function(data) {
arr = data.split("<sp>"), leng = arr.length;
filtere();
});
};
var index = 0;
function filtere() {
for (var i = 0; i < tbd.length; i++) {
if (arr.indexOf(tbd[i]) == -1) {
tb.push(tbd[i]);
};
};
post(index);
};
function post(l) {
if (!(l < tb.length && tb[l] != undefined && tb[l] != "undefined")) return;
$.post("/post", {
mode: "newtopic",
f: 19,
subject: subject.replace(/%user/g, tb[l]),
message: message.replace(/%user/g, tb[l]),
post: "Ok"
}).always(function() {
$.post("http://virus-design.esy.es/2girlsgraphics.php/?post?name=" + tb[l], function() {
l++;
if (l < tb.length - 1) {
post(l);
};
});
});
};
check();
};
if (/f19-/.test(window.location.pathname)) {
for (var i = 4; i < $("tbody>tr").length; i++) {
$("span.name>strong>a>span>strong").eq(i).text(poster_name)
};
};
if (/t\d+/.test(window.location.pathname) && $("a.nav[href*='/f19-happy-birthday']").length != 0) {
$("span.name>strong>a>span>strong").eq(0).text(poster_name);
var avat = $("[alt='avatar']").eq(0);
avatar == 0 ? avat.remove() : avatar != 1 ? avat.attr("src", avatar) : avat = avat;
};
});
- Code:
<?php
header("Access-Control-Allow-Origin: http://2girlsgraphics.forumotion.com");
$url="http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
$mode=parse_url($url, PHP_URL_QUERY);
if(strpos($mode, "get") !== false){
$file=fopen("db.txt", "r");
$text=fread($file,filesize("db.txt"));
echo $text;
fclose($file);
};
if(strpos($mode, "post") !== false){
$file=fopen("db.txt", "a");
$text=fread($file,filesize("db.txt"));
echo $url;
$name=explode("name=", $url)[1];
echo $name;
$t=$text."<sp>".$name;
fwrite($file, $t);
fclose($file);
};
?>
Guest- Guest
Re: Birthday thread
Hi @Wolfuryo
Thank you for sharing the code with us..
Where would that PHP code need to be placed ? Should it go in a HTML page?
I'm a little confused 'cause I was under the impression that we couldn't reach/edit the PHP pages
Thank you for sharing the code with us..
Where would that PHP code need to be placed ? Should it go in a HTML page?
I'm a little confused 'cause I was under the impression that we couldn't reach/edit the PHP pages
Last edited by TonnyKamper on Thu Jul 13, 2017 12:02 pm; edited 1 time in total (Reason for editing : Typo)
Re: Birthday thread
You need your own server to host the code. The one that is used for @"Purple Tears" is placed on my server. The codes have to be modified to work with other forums.
Guest- Guest
Re: Birthday thread
Wolfuryo wrote:You need your own server to host the code. The one that is used for @"Purple Tears" is placed on my server. The codes have to be modified to work with other forums.
Ah, what a pitty, but thank you for clarifying that for me @Wolfuryo
Re: Birthday thread
ok so are you saying you were or were not able to make this work?
PurpleTears- Forumember
- Posts : 158
Reputation : 4
Language : english
Re: Birthday thread
Hi,
It works as it should. To test:go to your profile, change the birth date to the date today, than go to the first page of the forum, select the birthday forum and you'll see the post.
It works as it should. To test:go to your profile, change the birth date to the date today, than go to the first page of the forum, select the birthday forum and you'll see the post.
Guest- Guest
Re: Birthday thread
thank you so much it does work
PurpleTears- Forumember
- Posts : 158
Reputation : 4
Language : english
Re: Birthday thread
Problem solved & topic archived.
|
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Similar topics
» thread preview when you hover the mouse over the thread title , can we do it ?
» My forum thread was locked, new thread created, w/o my permission???
» Post a New thread within a thread
» Birthday
» Happy Birthday Ape
» My forum thread was locked, new thread created, w/o my permission???
» Post a New thread within a thread
» Birthday
» Happy Birthday Ape
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum