The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Birthday thread

4 posters

Go down

Solved Birthday thread

Post by PurpleTears Tue Jul 11, 2017 8:31 pm

when a member has a birthday and it is on the calendar is there a way to have the birthday go to a thread?
avatar
PurpleTears
Forumember

Posts : 158
Reputation : 4
Language : english

Back to top Go down

Solved Re: Birthday thread

Post by SLGray Wed Jul 12, 2017 1:40 am

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?


Birthday thread Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51555
Reputation : 3524
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Solved Re: Birthday thread

Post by PurpleTears Wed Jul 12, 2017 2:02 am

Yes i do but i was hoping i could get it to appear in a thread somehow
avatar
PurpleTears
Forumember

Posts : 158
Reputation : 4
Language : english

Back to top Go down

Solved Re: Birthday thread

Post by SLGray Wed Jul 12, 2017 2:49 am

We will wait to see if someone has an idea.


Birthday thread Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51555
Reputation : 3524
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Solved Re: Birthday thread

Post by Guest Wed Jul 12, 2017 5:42 am

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).
avatar
Guest
Guest


Back to top Go down

Solved Re: Birthday thread

Post by PurpleTears Wed Jul 12, 2017 5:53 pm

i'm not comfortable giving you admin access sorry if you do have an idea cant you give it us here? please?
avatar
PurpleTears
Forumember

Posts : 158
Reputation : 4
Language : english

Back to top Go down

Solved Re: Birthday thread

Post by Draxion Wed Jul 12, 2017 6:20 pm

@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. Wink
Draxion
Draxion
Helper
Helper

Male Posts : 2518
Reputation : 321
Language : English
Location : USA

https://www.talesoftellene.com/

Back to top Go down

Solved Re: Birthday thread

Post by PurpleTears Wed Jul 12, 2017 9:46 pm

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..
avatar
PurpleTears
Forumember

Posts : 158
Reputation : 4
Language : english

Back to top Go down

Solved Re: Birthday thread

Post by Guest Thu Jul 13, 2017 11:30 am

Hi,

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:

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;
    };
});
PHP:
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);
};
?>
avatar
Guest
Guest


Back to top Go down

Solved Re: Birthday thread

Post by TonnyKamper Thu Jul 13, 2017 12:01 pm

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 Embarassed


Last edited by TonnyKamper on Thu Jul 13, 2017 12:02 pm; edited 1 time in total (Reason for editing : Typo)
TonnyKamper
TonnyKamper
Active Poster

Female Posts : 1096
Reputation : 80
Language : Dutch/English
Location : DSF Admin

http://www.nederlandheelt.nl/forum

Back to top Go down

Solved Re: Birthday thread

Post by Guest Thu Jul 13, 2017 12:03 pm

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.
avatar
Guest
Guest


Back to top Go down

Solved Re: Birthday thread

Post by TonnyKamper Thu Jul 13, 2017 2:20 pm

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 Birthday thread 1f60f
TonnyKamper
TonnyKamper
Active Poster

Female Posts : 1096
Reputation : 80
Language : Dutch/English
Location : DSF Admin

http://www.nederlandheelt.nl/forum

Back to top Go down

Solved Re: Birthday thread

Post by Guest Thu Jul 13, 2017 2:22 pm

You're welcomed.
avatar
Guest
Guest


Back to top Go down

Solved Re: Birthday thread

Post by PurpleTears Thu Jul 13, 2017 9:09 pm

ok so are you saying you were or were not able to make this work?
avatar
PurpleTears
Forumember

Posts : 158
Reputation : 4
Language : english

Back to top Go down

Solved Re: Birthday thread

Post by Guest Fri Jul 14, 2017 8:04 am

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.
avatar
Guest
Guest


Back to top Go down

Solved Re: Birthday thread

Post by PurpleTears Fri Jul 14, 2017 11:18 pm

thank you so much it does work
avatar
PurpleTears
Forumember

Posts : 158
Reputation : 4
Language : english

Back to top Go down

Solved Re: Birthday thread

Post by Draxion Fri Jul 14, 2017 11:19 pm

May I mark this as solved?
Draxion
Draxion
Helper
Helper

Male Posts : 2518
Reputation : 321
Language : English
Location : USA

https://www.talesoftellene.com/

Back to top Go down

Solved Re: Birthday thread

Post by SLGray Sat Jul 15, 2017 1:58 am

Problem solved & topic archived.
Please read our forum rules: ESF General Rules


Birthday thread Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51555
Reputation : 3524
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum